View Full Version : VB6 8086 PC emulator

Mike Chambers
March 27th, 2014, 08:14 AM
Just did this for a (time-consuming) laugh. I made an 8086 PC emulator in 100% pure VB6. Terrible, terrible language to try this but it's just "for the lulz". I just wanted to see it happen, since it hasn't been tried before that I know of. There seems to be a few CPU bugs that I think are related to not being able to use unsigned values. The same CPU code works correctly in FreeBASIC using unsigned for everything, maybe I'll work on fixing it if I feel like it sometime. It still works reasonably well.

It emulates the basics: CGA text and graphics modes, 320x200 8-bit MCGA graphics, i8253 timer chip, i8259 interrupt controller, disk access through int 13h, PC speaker (poorly)

It's pretty fast considering it's crusty old VB6 as long as you've got at least a really fast Pentium 4 to run it on. Any modern PC besides something like a netbook is fine. I'm providing all of the source code as well as a few data files with the font, BIOS, a precompiled executable, and a 20 MB hard drive image with MS-DOS and just a couple extremely old 1980's games. If you want to compile it yourself, just load the vb8086.vbp file and go for it. If you get any errors compiling or running, run the resreg.bat file which will register dx8vb.dll and comdlg32.ocx with Windows and try again.

Download: http://rubbermallet.org/vb8086-alpha.rar




March 27th, 2014, 02:15 PM
Actually very cool. The best part is with the source available and a fairly easy to read language it could be useful for amateurs to learn how an emulator is built.

Mike Chambers
March 27th, 2014, 02:48 PM
I was thinking the same same actually. I've seen plenty of posts from newbies around the internet saying stuff like "HOW DO MAKE EMULATOR" so maybe this will help some of them out... although the 8086 isn't exactly the best CPU for somebody new to emulation to understand. 6502 might be better, but there are already VB6 6502 emulators.

March 27th, 2014, 03:40 PM
This is good stuff Mike.


March 30th, 2014, 03:00 PM
Cool! I see you got windows running in there. 3.0? You can run Visual Basic 1.0 in there!