VOGONS


First post, by Peter Swinkels

User metadata
Rank Oldbie
Rank
Oldbie

Hi,

Just wanted to share a project I am working on other people here might find interesting. It's a 8086 Emulator with simulated (though incomplete) hardware and BIOS and MS-DOS functions.

It can load and execute some DOS programs although there are a lot of glitches and it is prone to freezing::

helppc.gif
nc3.gif
readme.gif

Why am I writing this? Because I'm curious as to how the hardware and software work at a low-level. That, and if a program does work properly I have more control over debugging it and seeing what it does and influencing its behavior.

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

(For some reasons this forum breaks animated gifs.)
https://github.com/PeterSwinkels/8086-Emulato … ree/master/gifs

Also, remember this is a work in progress.

My GitHub:
https://github.com/peterswinkels

Reply 1 of 8, by BaronSFel001

User metadata
Rank Member
Rank
Member

This ground has been covered by others multiple times, but the more you learn the closer you may get to aspects others have not yet covered. For instance, it is simple enough to set specs 86box to simulate the Tandy 2000 but no actual emulator for that system exists to run the archives of dumped software for it. When they became moot in the late 80s early DOS-based PC incompatibles got little respect of their own (except for those in Japan, but then again they lasted longer in the market over there).

System 20: PIII 600, LAPC-I, GUS PnP, S220, Voodoo3, SQ2500, R200, 3.0-Me
System 21: G2030 3.0, X-fi Fatal1ty, GTX 560, XP-Vista
Retro gaming (among other subjects): https://baronsfel001.wixsite.com/my-site

Reply 2 of 8, by mkarcher

User metadata
Rank l33t
Rank
l33t
Peter Swinkels wrote on 2025-09-03, 14:43:

nc3.gif

The reason the horizontal lines are broken in the NC3 screen shot is that your emulator doesn't yet implement the line graphics expansion feature of the MDA card. In case you are not aware how it works: The 9th pixel column of a character is usually always the background color (which your emulator seems to implement perfectly), but for characters in the range C0-DF, the 9th pixel column is a copy of the 8th pixel column.

Reply 3 of 8, by Peter Swinkels

User metadata
Rank Oldbie
Rank
Oldbie

@BaronSFel001: I am not trying to create anything new. I am just doing this for the reasons stated in my original post. I doubt I will cover much that hasn't been covered yet. If I can ever get this program to work properly you will have an okay emulator written entirely in vb.net which might make it more accessible to some. Thank you for you reply btw. 😀

@mkarcher: I didn't notice that was an issue. Thank you for pointing that out. Do you know of any webpages detailing this aspect of the MDA ?

Any way, I noticed I still hadn't got the whole long to short filename mapping thing figured out properly. A project like this is fun and a good learning experience, but sometimes it feels like playing whack-a-mole with bugs. 😀

EDIT
Also, I have a new found respect for these types of projects. Goes to show just how tough those can be. 😀

My GitHub:
https://github.com/peterswinkels

Reply 4 of 8, by mkarcher

User metadata
Rank l33t
Rank
l33t
Peter Swinkels wrote on 2025-09-04, 08:21:

@mkarcher: I didn't notice that was an issue. Thank you for pointing that out. Do you know of any webpages detailing this aspect of the MDA ?

For me, it's oral tradition and knowing it from books I read some decades ago, but the information about the 9th column can be found at many pages, e.g. https://en.wikipedia.org/wiki/VGA_text_mode , the second paragraph of the "Fonts" subsection. If you need definite answers, you can find the schematics of the MDA in the original PC technical reference manual, which is archived at many places on the internet (including the first ones that spring to mind of talking about archiving and IBM PC retro stuff), and try to understand it.

While the Wikipedia page I linked is about the VGA card, the text mode technology didn't change since the EGA card. Furthermore, the 9-pixel technology was introduced to the EGA card because the EGA card should include the capability of displaying text on an MDA monitor just like the MDA did, so this 9-pixel text mode feature on VGA (if enabled) is just a clone of the MDA card behaviour. On the MDA card, this feature wasn't optional, though.

Reply 5 of 8, by Peter Swinkels

User metadata
Rank Oldbie
Rank
Oldbie

I made some progress on my emulator :

Paratroopers appears to fully work - except for the title screen's music sounding sluggish.

The attachment Parachut.gif is no longer available

Frogger starts but quickly becomes unstable when you try to play the game:

The attachment Frogger.gif is no longer available

Alley Cat works for the most part but some of the sound effects don't play and the game eventually becomes unstable:

The attachment Alley Cat.gif is no longer available

Also, text based programs now appear without glitches in MDA/Hercules mode.

The attachment nc.png is no longer available

My GitHub:
https://github.com/peterswinkels

Reply 6 of 8, by MagefromAntares

User metadata
Rank Member
Rank
Member

Hi,

Seeing a 8086 IBM Compatible system emulator especially written by a single person earns quite a bit of respect from me.

The closest I did was a MOS6502 system emulator.(Which was actually more of a MOS6510 emulator as we had a C64 for reference instead of an actual MOS6502 system for some reasons I no longer remember, anyway the program the emulator made specifically to run on it run properly on it in the end, so whatever 😁)

The choice of Visual Basic .NET is a bit weird in my opinion for a system emulator, but the code looks quite nice in my eyes. (Although I'm more of a C/C++ programmer, I do have a little bit of experience with BASIC languages including Visual Basic .NET)

Also I think you can update the first line of the README.md from "This program emulates a basic 8086 CPU" to "This program emulates a basic 8086 CPU IBM Compatible System", while obviously the parts emulating the system is incomplete currently, it is definitely getting there, and as such I think this project deserves to be called more than a simple CPU emulator at this point 😀.

Anyway thanks for making this emulator, it is always good to have more options to emulate older systems.

"A process cannot be understood by stopping it. Understanding must move with the flow of the process, must join it and flow with it." - Dune

Reply 7 of 8, by Peter Swinkels

User metadata
Rank Oldbie
Rank
Oldbie

Thank you for your kind feedback. 😀

I am most comfortable working with BASIC. If you decide to try it, please note that while several small programs do work or at least nearly work there are several stubborn bugs in the emulator. I have done dozens of small tests, but I cannot find out why most larger programs just won't work. Especially programs using medium/large memory models fail to run properly.

And while ai can be useful, I have noticed it is great at making up all kinds of stuff about what is wrong with my code it almost never manages to improve on it. Suggested changes either don't make a difference or actually cause more issues. 🤣

Any insightful feedback from a knowledgeable human would be most welcome.

EDIT:
Until most programs do more than crashing, I believe the readme shouldn't be updated. I have to be honest about the fact that my emulator is far from finished.

My GitHub:
https://github.com/peterswinkels

Reply 8 of 8, by Peter Swinkels

User metadata
Rank Oldbie
Rank
Oldbie

Well, Grand Prix starts now. Unfortunately there's a serious timing issue related to how the PIT works in my emulator.

file.php?mode=view&id=242591

For anyone wanting to give it a try themselves, go to https://github.com/PeterSwinkels/8086-Emulato … ter/bin/Release and download:
8086 Emulator.exe
SDL2-CS.dll
SDL2.dll

Then go to: https://github.com/PeterSwinkels/8086-Emulato … r/Documents/Bin and download
FONT.BIN
EXTFONT.BIN

These must be where 8086 Emulator.exe is located. These contain character bitmap data for graphical video modes. The emulator loads these each on each CPU reset when the emulator BIOS is also reset. If it complains about not being able to find these files, try copying to them to the folder containing the game you want to run.

Put this script in a text file:
[script]
mda off
reset
cd d:\other\gp
scr on
cs=8000
exe gpcga.exe
e

The line "cd d:\other\gp " should be changed to the full path of where gpcga.exe is located.

Drag and drop the file into the emulator's main window and it should start gpcga.exe.

Whenever I try to run it (in my emualtor) it freezes at the main menu. The cause is most likely issues with the way the emulated PIT works.

PS:
If anyone here has experience with high-precision (microseconds), I'd appreciate any advice you might have.

My GitHub:
https://github.com/peterswinkels