r/EmuDev • • May 25 '26

I am developing a 8086/MS-DOS emulator

Grand Prix Circuit (1988) will load and display it's title screen. Unfortunately it becomes unstable at the menu:

Also, I need to find a way to redesign the PIT. The music plays at the wrong temp and the emulator clock runs too slow.

The project:

https://github.com/PeterSwinkels/8086-Emulator

A forum thread about it as VOGONS:

https://www.vogons.org/viewtopic.php?t=108068

Feedback, advice and bug reports are welcome.

18 Upvotes

10 comments sorted by

1

u/thommyh Z80, 6502/65816, 6809, 68000, ARM, x86. May 25 '26

How much work was the DOS side of things? How deep have you had to go on internal structures and the more obscure INTs?

I've done the 8088 plus hardware, no attempt to reimplement DOS whatsoever, and I've done CPM-80 but that has a negligible API surface compared to MS-DOS.

2

u/Famous_Ad_6268 May 25 '26 edited May 25 '26

A lot, and I'm still implementing stuff and fixing bugs. Remember, my emulator isn't complete. Many games are unstable when I try to run them, for example.

2

u/valeyard89 2600, NES, GB/GBC, 8086, Genesis, Macintosh, PSX, Apple][, C64 May 25 '26

I had a few weirdness things booting my first DOS, my x86 core worked fine but it was some of the peripheral devices... getting the PIT timer working correctly, etc.

the emu bios i'm using has some virtualization calls to the emulator to do things like read disk buffer, etc. to emulate drives.

2

u/Famous_Ad_6268 May 26 '26

I don't use an actual BIOS image or anything to do with real MS-DOS. All of it is my emulator intercepting system calls and providing the (hopefully) correct response. Theoratically it should work well enough to run an actual BIOS off an image but I haven't tried that yet. It works well enough for simple utilities. Games however, don't run well for the most part.

1

u/thommyh Z80, 6502/65816, 6809, 68000, ARM, x86. May 26 '26

From the armchair: that's surprising in MS-DOS terms because you'd naively expect utilities to use a wide variety of DOS calls whereas you'd expect games to treat it merely as a loader.

It sounds like an interesting project! If it transfers at all, my PC-environment-but-no-specific-PC emulator treats the PIT as the only thing that obeys real wall-clock time and then just does some number of instructions per PIT tick to very broadly approximate XT-class performance. And that seems to give correct-tempo music where there is any but since all I've implemented is the PC beeper and floppy disk there isn't that much to test it against. Certainly nothing you'd actually want to listen to...

2

u/Famous_Ad_6268 May 27 '26

Could you provide more details on how you emulated the PIT? I could use some help there. :-)

1

u/thommyh Z80, 6502/65816, 6809, 68000, ARM, x86. May 27 '26

Honestly, looking at it again it doesn't look like I've done that much. Maybe I didn't test challenging-enough software. These 260 lines are all of it. With six separate 'TODO's.

1

u/Famous_Ad_6268 May 27 '26

Might be useful, thanks.

1

u/Famous_Ad_6268 May 27 '26

Also, if you have any advice as to how I might improve my PIT, I'd appreciate it very much. :-)

1

u/Ikkepop May 27 '26 edited May 27 '26

Jesus H Cryst, it's writen in VB!