VOGONS


First post, by UselessSoftware

User metadata
Rank Newbie
Rank
Newbie

Hi, I wanted to share a very early version of my 80186 PC emulator and get some feedback if anybody is interested.

Current features:

  • Full 80186 instruction set support
  • Standard XT-class PC chipset support (8259, 8253, 8237, 8255, 8250)
  • Microsoft-compatible serial mouse
  • CGA, EGA/VGA
  • Sound Blaster 2.0
  • Adlib/OPL2 (Nuked OPL, though I plan to finish my own version just for fun)
  • PC speaker
  • Hard and floppy disk support at int 13h level (I'm working on proper FD and HD controllers)
  • RTC
  • NE2000 emulation (adapted from Bochs)
  • Modem emulation via TCP (client and server)
  • Support for multiple machine definitions (Different BIOSes, memory maps, peripherals, etc)

Known issues:

  • Some parts of chipset incomplete or buggy (Due to this, only the public domain Turbo XT BIOS seems to boot 100% correctly)
  • CGA is not perfect if you try to do tricky things with the registers
  • EGA/VGA has a couple of issues I'm still trying to track down, but working for the most part
  • PC speaker is not perfect
  • Modem emulation very buggy in server mode (Most BBS programs don't like it) but seems to work well in client mode with terminal software

Future goals:

  • Proper disk controllers
  • 286 and then 386/486 support
  • VESA high res/color modes in VGA module
  • Additional peripherals

Source code and screen shots: https://github.com/mikechambers84/XTulator

Pre-compiled Windows binary plus ROMs and a sample hard disk image with DOS and some old games available here:
https://gofile.io/d/TCobEf

It's currently able to boot MS-DOS, MINIX 2, run Windows 3.0 and play many real mode DOS games. The "GUI" in Windows is super minimal and I'm going to be fleshing that out some more. You can see all of the available options by running XTulator.exe -h at the command prompt.

XTulator.exe -hd0 hd0.img will boot the sample image using the default generic, speed-unlimited XT machine definition.

I'm happy to hear any feedback/constructive criticism/bug reports etc if anybody feels like giving it a shot! Again, this is a very early build so issues are to be expected.

Reply 1 of 6, by danoon

User metadata
Rank Member
Rank
Member

I'm impressed and surprised the cpu emulator is only 3000 lines of code. Once you start coding for performance the lines of code start to explode. For example, lazy flags and caching the decoded instructions can add a lot of complexity, but really improve performance.

When you get to the point of improving performance, I'd recommend reading this article on branch prediction.

http://www.emulators.com/docs/nx25_nostradamus.htm

Last edited by danoon on 2020-08-24, 21:58. Edited 1 time in total.

http://www.boxedwine.org/

Reply 2 of 6, by UselessSoftware

User metadata
Rank Newbie
Rank
Newbie

Thanks for the link, I'll read through that tonight.

Yeah, the CPU emulator is pretty unoptimized. It's actually taken right from an emulator I wrote 10 years ago with only some minor modifications, and that old PC emulator had a slew of poor design decisions and poor code all around so I decided to write this new one. Only the CPU and a few other small parts were ripped from the old one. I was going to re-examine the entire structure of the CPU once I start adding 286 and 386 support, I thought that would be a good time to do it. I'd also like to add proper cycle counting at that point.

As it stands, it's still more than fast enough since it's only trying to emulate an 80's era PC. When running unthrottled on a modern desktop, it can easily reach high-end 486 or even much better speeds depending on what code is being emulated.

This was actually my first CPU emulator! I've done a few since then. (6502, MIPS, 8080, PIC)

Reply 3 of 6, by Jo22

User metadata
Rank l33t++
Rank
l33t++

Hi, good work! :)

Edit: I wonder if it can run Desqview or Geoworks Ensemble, too. I'll have to check..

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 4 of 6, by UselessSoftware

User metadata
Rank Newbie
Rank
Newbie

Thanks! I looked at your link. This does allow you to use base memory all the way up to the beginning of CGA memory with these command line parameters: -mem 736 -video cga

But you'll have to build build a custom binary of the Super/Turbo XT BIOS to access it all, which is very easy to do.

Unfortunately no x87 support or EMS yet, but EMS is something I've already spent a little time looking into! I'll be adding that.

I think I ran Geoworks on it early in development? I might be wrong. Let me know what you find! 😀

Reply 6 of 6, by Jo22

User metadata
Rank l33t++
Rank
l33t++
Neville wrote on 2021-02-19, 14:09:

Glad to have another PC emulator on the scene.

Exactly my thoughts!
I like the idea that XTulator comes close to the real world scenario of back then, when XT users made most of their XTs.
Enlarged memory, 80186 instructions set.. Just named a few. 😀

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//