October 27th, 2011, 03:32
Fake86: new x86 PC emulator
Hey all, I've been a lurker on this site for a while but I decided to register and share my emu project Fake86. Some of you guys may have heard of it somewhere before. It's not exactly new, I've been working on it for almost a year. I am really looking forward to talking with other emu devs here, though. It's hard to find people that really understand how this stuff works for the most part.
It's a cross-platform x86 PC emulator I've been writing in C. It's the first emulator I've written that is 100% my own code. I wrote a NES emulator before, but used somebody else's 6502 core and built around it. Writing an x86 core on my own has been a GREAT learning experience! I can't think of any type of programming that's more interesting than computer emulation, fascinating stuff on the technical level.
At this point, Fake86 only supports real-mode and 8086/80186 instructions, but 386 and protected mode is on the way. I've begun re-writing the core with protected mode in mind, but it will be a few months until it's ready I'm sure. Anyway, here's an overview of where it stands:
-100% of the 8086/80186 instruction set emulated
-i8259 interrupt controller emulated
-Hercules/CGA/MCGA/VGA video adapter emulation (I don't have EGA or VGA planar modes like 640x480@4-bit working, I've been having problems with this.)
-Floppy and hard disk images support at the int 13h BIOS level, I would like to eventually implement true I/O register-level emulation of the controllers
-Adlib FM music card emulated (it needs work, but it's pretty acceptable... I haven't figured out the percussion stuff yet though)
-Disney Sound Source sound adapter emulated (this works great with Wolfenstein 3D)
-Windows version supports using WinPCap to emulate a network adapter, but it's a custom implementation that requires the use of a special DOS packet driver I made... Later I really want to emulate something like an NE2000 instead.
Also, a few VGA programs/games can show some graphical glitches but most stuff seems fine. I am going to rewrite the whole VGA/EGA emu code and try to get it all right.
It's capable of running just about anything that doesn't require EGA video, including Windows 3.0. So, I thought I would provide a download if anybody would like to try it out and offer advice/criticism/comments. I will also happily share the source code, but give me a few hours to clean it up a bit first.
That has the current compiled Win32 version, and a 20 MB test hard drive image with MS-DOS 6.22, shareware Wolfenstein 3D, and Ultima VI. Extract it to somewhere and run this command line to boot from the image:
fake86.exe -hd0 test.raw
If anybody wants to get involved in the development, let me know. It's been all me so far. I am hoping this ends up becoming a really viable option for a PC emulator in the future. It's no QEMU, but I think it's a start! Plenty of work to do...
Here's a video to really demonstrate what it's like so far. This is booting MS-DOS 6.22 and playing a bit of Wolfenstein 3D and Ultima VI: The False Prophet.
I've gotten it to successfully run on quite a few platforms... Win32, Linux, BSD, OS X, and Haiku. A while back I even compiled a very early version as a native XBE binary for the original XBOX. That was fun to see! I don't think I have that file on my drive anymore, I might re-do it using current code some time.
My ultimate goal is to eventually have support for at least emulating a Pentium and support hardware, to run more modern software. It would be awesome to see it run Linux or Windows XP eventually. Hey, I can dream right?
Last edited by miker00lz; October 27th, 2011 at 03:38.
October 28th, 2011, 00:49
Cool project! I wonder though about distributing MS-DOS in the download and possibly Ultima VI as well, both are old as dirt but still likely non-distributable? Maybe FreeDOS instead? I'll let another mod chime in if they don't mind
October 28th, 2011, 09:07
Hmm, you've probably got a good point there. I almost didn't, but due to the age of the software I included it anyway. I suppose I should take Ultima VI out and replace MS-DOS with FreeDOS.
November 1st, 2011, 04:59
Thank you for sharing this us. Please don't be discouraged by the fact that emutalk has been really quiet lately and keep working on this!
I gave you a plug at my emu news website:
Feel free to ping me if you have any more releases you'd like me share.
November 3rd, 2011, 09:31
Thanks! I appreciate the article. Awesome.
I probably won't have any more new versions until I finish the support for 386, unless I find and fix some major bug.
EDIT: Posting this vid to show early results of a port of the latest code to the xbox. Yes, I was bored tonight. I'm not able to get keyboard input to work yet, and haven't ported the audio code yet.
Last edited by miker00lz; November 3rd, 2011 at 10:07.
November 6th, 2011, 15:47
At your service, dood!
As far as the MS-Dos and Ultima thing goes, you're better off not having those things included if you're not that sure - they are fairly old but so are most N64 roms - so it just barely borders on the line of legality, people can find these things on their own easily enough after all.
One thing you should definitely not pack with it is Ultima, It is currently being sold online - I don't really want to link to it in case its misconstrued as Spam but it is a site called good old games, type that into google if you want to see for yourself.
Asides that: I love these sort of things, anything that lets me use my old DOS software from the past! Keep up the good work.
Last edited by ScottJC; November 6th, 2011 at 16:00.
Reason: Edited for Clarity :P