Pate has released a new version of his Dos Emulator for the DS Console:
Sorry for the one day delay to my normal Sunday updates, but as this was a long Easter weekend I wanted to use the one extra day to work on DS2x86 and get as many fixes implemented as possible.
DS2x86 0.07 release info
Okay, this new version has the following fixes:
- There is now (finally) a blinking cursor in the text modes, most importantly in the 4DOS command prompt.
- HIMEM.SYS emulation added. This allows Chaos Engine to run, and will enable support for Windows 3.00a in Standard Mode in the future.
- Fixed a serious total crash problem in 32-bit string opcodes. This happened in games like Abuse, Ascendancy and Carmageddon. Those games still don't work properly, but they don't hang the system completely any more so I have a chance of debugging and improving them further.
- Fixed a stack alignment problem that could cause "Exception 4" BSOD errors. This fixes at least Micro Machines.
- Improved the BSOD reporting. Now the printed data includes a stack trace, so I can better determine the location of the problem.
- Improved horizontal blank reporting, this might solve hanging problems in some games, like Pinball Fantasy.
- Improved Mode-X graphics blitting code to handle wrap-around properly.
- Changed the screen refresh interrupt interval from 60Hz to 59Hz. This might help with the intermittent "stuck key" problem in some games.
- Direct file read to EGA memory is now supported (for example in Heimdall).
- Implemented a number of previously missing opcodes.
DS2x86 0.07 background information
After the previous blog post I worked on
Jazz Jackrabbit for a while, but could not get any notable progress with it. It still needs a lot of debugging to determine the problem, and so I decided to move on to some other issues that might be faster to solve.
First, I decided to add
HIMEM.SYS emulation, as I could simply port the code from the most recent DSx86 version. This in itself didn't take long, although I ran into a very strange problem where the whole DS2x86 hung immediately when launching any game. It loaded 4DOS.COM fine, and I could give internal commands like "dir" or "memory", but immediately after launching any game it hung totally. I then began commenting out the new HIMEM.SYS stuff, until the only things remaining were a couple of static integer variables in the new C++ module! Commenting these variables out got rid of the problem, but when I added these static variables back, the problem came back. One of the variables had an initial value based on the addresses of two other variables, which seemed to cause the problem. I switched to using a #define, and the problem was solved, but I still don't quite understand how a static variable initialization can break the whole software.
After the HIMEM.SYS emulation started working,
Chaos Engine began to ran otherwise fine, except that the display had a moving line of black pixels, and scrolling the zoomed screen did not work properly. The game wraps the display around the A000 segment while scrolling (similarly to what Commander Keen 4 does in EGA mode), and this feature was not yet supported in my Mode-X screen blitting code. I took some time to make this work correctly in both Zoom and Scale screen modes, and now this type of wrap-around should cause no more visual glitches. This is what Chaos Engine now looks like, with a wrap around in the middle of the screen (but not showing :-).
After the HIMEM.SYS emulation in place, I wanted to see whether
Windows 3.00a would run in Standard Mode. I had several problems with it, all due to various bugs in my protected mode implementation which I had to fix. There is still a problem with the Global Descriptor Table handling, as Windows uses a segment selector 0x0101 when returning from protected mode to real mode, but in DS2x86 the GDT entry points to a data segment, while in DSx86 and DOSBox it points correctly to a code segment. So, no Windows 3.00a in Standard Mode yet in this version, but I'll try to fix this problem in the near future.
Next, I was looking whether I had
Hexen on my SD card. I didn't find it, but as there was
Heimdall, I decided to test how it runs. It started fine, but when talking to a character I got a BSOD reporting an invalid store address of 0x600CE030. In this same situation DSx86 shows garbage on the screen, so I thought that this might be a chance to find out what exactly is wrong in my emulation code. I checked the address reported by the BSOD, but it pointed to inside the C library
memcpy() function. Obviously, memcpy is used all around the code, so that was not of much help. I needed to find out what code it was that called the memcpy, so I implemented a simple stack traversal routine into my exception handler code. It attempts to find return addresses pointing to my own DS2x86 code by traversing the stack above the exception handler stack frame. When I ran Heimdall again, I got a stack trace that (after converting the hex addresses to function names
...
Catherine: Full Body’s English translation for the Vita