VOGONS


UniPCemu progress

Topic actions

Reply 720 of 729, by superfury

User metadata
Rank l33t++
Rank
l33t++

After some more testing, I found some weird things going on with the OPL2 KSL ROM that was taken from Dosbox or something like that I think (I don't remember which) together with the other volume envelope logic.

Somehow, when I move the KSL lookup table outside said function (which is displaced by 8 apparently, based on the ROMs), the sound for OPL2/OPL3 goes haywire for some OPL3 testing songs I used? Can't seem to figure out why that happens.

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 721 of 729, by superfury

User metadata
Rank l33t++
Rank
l33t++

Managed to get NT 4.0 workstation booting properly again during setup (phase 2, so after the formatting and copying the OS files over for the graphical stage of the boot). 😁

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 722 of 729, by superfury

User metadata
Rank l33t++
Rank
l33t++

Weird... When executing opcode 86h from a MS-DOS 6.22 install disk 1's scandisk when aborting while performing a surface scan (screen cleared due to returning to MS-DOS), the BIU managed to enter an invalid, bus locked state. There is a request still pending to be executed in the inbound request buffer, but it's never retrieved to be started it seems, causing the EU to lock up, permanently waiting for the result.

Edit: It seems to have been an issue with the IPS clocking mode handling, where it thought the operation was finished (and thus removed the handler from any pending state as it should), but it wasn't.

Having fixed that, the hang disappeared.

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 723 of 729, by superfury

User metadata
Rank l33t++
Rank
l33t++

After more testing, I found another bus lock contention.

In this case, somehow the CPU managed to lock the bus, while a DMA transfer had ownership of the bus, which obviously shouldn't happen.
This caused both the DMA controller and CPU to lock up, waiting for ownership of the bus (the CPU due to a normal instruction or hardware imposed lock(protected mode etc.), the hardware (DMA) due to trying to complete a transfer).

Once again took a look at the bus lock policies (which are now entirely owned by the BIU in the lastest commits). Adjusted the HLDA mechanics to properly detect an inactive bus (instead of just checking for DMA, checking for any kind of active bus counts there now). The HLDA output now also takes into account if a bus isn't locked before granting the bus.

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 724 of 729, by superfury

User metadata
Rank l33t++
Rank
l33t++

Eventually reached the point in WIndows NT 4.0 setup where it's writing the recovery disk (after formatting it using floppy disk controller format commands). Somehow it manages to error out on writing the first sector it tries to write somehow?
I've added some bugfixes to force seeking during such an access, but I'm not sure it worked until I get setup back to said point again (which has to restart from the first reboot step each time I test it for WIndows NT 4.0).

Last time, the bus lock was hanging the system (due to multiple locks being held at the same time that shouldn't), so I couldn't continue even if I wanted to. Currently waiting for it to reach that section again to verify if it works now (it should in theory, but I'm not sure).

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 725 of 729, by superfury

User metadata
Rank l33t++
Rank
l33t++

Fixing a floppy disk scanning (sector ID reading) issue (during read/write/read ID commands), the floppy now properly writes the NT4 ERD again during setup as it did before. 😁

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 726 of 729, by superfury

User metadata
Rank l33t++
Rank
l33t++

Odd... While testing my emulator, all of a sudden my display started erroring out (Windows 10 Pro) and the OS requested me to reboot. Looking at the hardware list in my PC (although 7-10 years old and upgraded a bit (except the motherboard itself and the GPU) through the device manager showed that somehow the APIC, DMA and some onboard components required a reboot? Normal SDL3 applications shouldn't cause such issues, or do they?
Windows seems to be up-to-date, except the 2025-07 update that's optional.

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 727 of 729, by superfury

User metadata
Rank l33t++
Rank
l33t++

Implemented some more bugfixes, including:
- Improved time support (properly supporting negative Unix timestamps internally now!)
- Emulator time protection. Somehow, sometimes (like during paging trashing on the host machine) the time elapsed that's reported on the application can make a big jump (on the high precision timing support). This caused the emulator to wait for a very very long time. When the main loop detects this case, it will now simply discard the elapsed time to synchronize it back up, after which it runs on a normal speed again. This case usually doesn't happen, but will cause possible speedups, which can't be avoided (the alternative being having to wait for a very long time that effectively didn't happen, which happened before the bugfix).

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 728 of 729, by superfury

User metadata
Rank l33t++
Rank
l33t++

Improved x86 task switching and interrupts handling of the EFLAGS register.
It now supports conditionally setting, clearing and unaffecting the EFLAGS resume flag (RF).

Now, when detecting the interrupt to launch, it will itself trigger a set of the resume flag on the stack (or TSS for task switches), if it's not a debug interrupt (interrupt number 01h, triggered by a debugging cause).
Thus it should behave just like Bochs and the documentation on the resume flag (either setting it or leaving it as the instruction left it during the time the interrupt was launched).
Since said flags storage are always based upon the committed state of the EFLAGS by default (if not affected), the documentation for said flag should behave properly now (instead of always setting it during INT1 debug interrupts (except the INT1 instruction of course, which is a trap, not a fault)).

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 729 of 729, by superfury

User metadata
Rank l33t++
Rank
l33t++

OK. Ran the !pci command a bit into the running of Windows XP booting.

It gave the following result:

kd> !pci
PCI Bus 0
00:0 8086:1237.00 Cmd[0006:.mb...] Sts[0280:.....] Device Host bridge
01:0 8086:7000.02 Cmd[000f:imb...] Sts[0200:.....] Device ISA bridge
01:1 8086:7010.02 Cmd[0007:imb...] Sts[0000:.....] Device Class:1:1:80
0f:0 1283:8888.01 Cmd[0007:imb...] Sts[0000:.....] Device SubID:100c:3203 Other bridge device

Perhaps that "Class 1:1:80" is it somehow misdetecting the PCI IDE device?

Looking at https://learn.microsoft.com/en-us/windows-har … ercmds/-pcitree , and comparing the device, I see differences on it compared to the real hardware (afaik):

0d:1  8086:7010.00  Cmd[0005:i.b...]  Sts[0280:.....]  Device  IDE controller

Edit: The command "!pci 15 0 1 1" gave some interesting information:

kd> !pci 0f 0 1 1
PCI Bus 0
01:1 8086:7010.02 Cmd[0007:imb...] Sts[0000:.....] Device Class:1:1:80
cf8:80000900 IntPin:0 IntLine:ff Rom:0 cis:0 cap:0
IO[4]:e801
00000000: 70108086 00000007 01018002 00800000
00000010: 00000000 00000000 00000000 00000000
00000020: 0000e801 00000000 00000000 00000000
00000030: 00000000 00000000 00000000 000000ff

kd> !pci 15 0 1 1
PCI Bus 0
01:1 8086:7010.02 Cmd[0007:imb...] Sts[0000:.....] Device Class:1:1:80
cf8:80000900 IntPin:0 IntLine:ff Rom:0 cis:0 cap:0
IO[4]:e801
00000000: 86 80 10 70 07 00 00 00-02 80 01 01 00 00 80 00 *...p............*
00000010: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 *................*
00000020: 01 e8 00 00 00 00 00 00-00 00 00 00 00 00 00 00 *................*
00000030: 00 00 00 00 00 00 00 00-00 00 00 00 ff 00 00 00 *................*

So the version is set to 02h, which might need to be 00h?

Edit: Continuing anyways, I get:

kd> g
HAL: An invalid V86 opcode was encountered at address 2000:f76
Break instruction exception - code 80000003 (first chance)
halapic!HalpOpcodeInvalid+13:
80191983 cc int 3
kd> g
Break instruction exception - code 80000003 (first chance)

A fatal system error has occurred.

*******************************************************************************
* *
* Bugcheck Analysis *
* *
*******************************************************************************

Use !analyzebugcheck -v to get more information.

BugCheck 7B, {fc90e63c, c0000034, 0, 0}
*** Bugcheck Analysis may not be correct, please followup with the following.
Followup : MachineOwner

ntkrnlmp!RtlpBreakWithStatusInstruction:
807e984c cc int 3

Some more interesting stuff, but first need to patch the revision of the hardware to 00h instead of 02h.
Edit: Also interesting, once that V86 opcode issue was encountered, the screen of the installation turned red? Maybe it was trying to perform a red screen of death?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io