Modular emulator

Among the many programs I'd like to write is a replacement for MESS (and possibly also MAME while I'm at it). Don't get me wrong, I think these are fantastic pieces of software but I do have some problems with them that can really only be solved by starting my own emulation project rather than by contributing to them. In no particular order:

  • I like writing software from scratch.
  • They are written in C with all kinds of macro trickery to make it more object orientated. I'd rather write it in C++ or some language of my own devising.
  • I don't like the unskippable startup screens that MAME and MESS use. I'd like to set up a PC emulator using a free clone BIOS and DOS and distribute it as a turnkey method for running old games like Digger.
  • I'd like to make it possible to "build" emulated machines at run time (without having to create a driver etc.). You'd be able to say "connect up this CPU, this sound hardware, this video hardware and load this ROM at this address" and it would all work. The emulator would come with a set of pre-written modules, it would have a language for designing modules and plugging them together and possibly even a graphical designer for wiring things up.
  • MAME and MESS timeslice much more coarsely than I'd like to. They emulate the CPU for a while (until a new frame or an interrupt starts usually) then see what the screen has done in that time, what sound was output in that time and so on. I'd like to timeslice on a cycle by cycle basis for more accurate emulation (so raster effects can be done with horizontal pixel accuracy) and to enable emulation of things like the prefetch cache on the 8088 (the lack of which makes MESS about 30% too fast).This sounds like it would make emulation very slow, but in fact if we organized it well and all the code fits into the CPU cache, we'd be doing no more work than MESS is now.

6 Responses to “Modular emulator”

  1. [...] handy for describing electronic circuits (where assignment means connection). Also, when I write my modular emulator it will have a language like this built in for describing how things are connected up. For that the [...]

  2. transistorski says:

    Are you aware of the zet project? It is a complete PC in an FPGA, for running old computer games. It comes with an elaborate test suite for 8086 instruction set simulation:

    http://zet.aluzina.org/index.php/Category:Test_benches

    May I have your e-mail address, please? I'm stuck with a few questions about the 8086/8088, and your emulator does not seem to handle them (can your emulator run digger? I remember that digger was not clocked, i.e. it ran as fast as the cpu.)

    keep up the good work, bro (:

  3. transistorski says:

    I found "what does lock do?" in the TODO.txt in your emulator source on github. I'm not sure if I understand your question correctly, but LOCK inhibits all forms of interrupts (among other things) for the entirety of an instruction. In the old days it was used for implementing unbreakable semaphors with XCHG AX, [mySemaphor], for example. Details escape me, but I could step down into my old book dungeon with a compass and a miners lamp if you are interested.

  4. Marc says:

    Hello there,

    OpenEmulator has already passed beta status, maybe you want to check this out:

    http://www.openemulator.org

    The NTSC emulation is working nicely, and many versions of the Apple-1 and the stock Apple II is supported.

    I'm close to getting finished a new release, that will also support the Apple II+ and II j-plus, as well as disk drives and other gadgets :)

    With the best wishes,

    Marc.-

    • Andrew says:

      I've been following the development on your mailing list, Marc - it looks awesome. Too bad it's Mac only so I can't try it.

Leave a Reply