Apple II Emulation Evaluation (2022)
juiced.gs
juiced.gs
For example, you can mostly treat the video system as a dumb framebuffer. But there are cases where this fails. It is possible to detect the vertical blanking period on an Apple II. [1] This relies on capacitance on the Apple II bus and very strict timing. On a real Apple II the value read from a non-existent memory address is not always 0, sometimes it's the last value read, which is sometimes the last value read by the video system which is overlapped with the CPU. To emulate this right, you need to emulate the whole video system lock-step and cycle accurate with the CPU.
The disk system is another major pain point. All of the timing and track movement is handled in software. Arbitrary disk formats can be created in software. One single spiral track was used by some games as copy protection. To support the Disk II completely requires emulating at a much lower level than that of 256 byte sectors. Some emulators going all the way for accuracy, use a structure, that is basically a map of the flux transitions on disk.
[1] http://deater.net/weave/vmwprod/megademo/vapor_lock.html
I mostly did my emu due to the rather poor quality I found for linux emulators I've seen, the 'goto' one is linapple, but the codebase is rather crusty.. I wanted a cleaner base to hack on, without the baggage -- more in the style of my own AVR emulator [1].
I've got a very big patchset to push 'soon' with a new UI library (that will be a topic of its own!) and a bunch of new features and improvements...
[0]: https://github.com/buserror/mii_emu [1]: https://github.com/buserror/simavr
My only gripe with it is that it's not as accurate as AppleWin, despite excelling in every other aspect. This means that writing a cycle-accurate demo won't work as smoothly with AppleWin as it would with AppleWin and AMPLE. Several cycle-counting demos fail to run on Virtual II, a shame for an otherwise perfect emulator. Hopefully the author addresses and resolves this issue in the future.
The last version finally has a debugger. It lacks the killer feature of Virtual II though: the ability to mount a folder as a ProDOS disk. This is gold for cross development.
I also ported it to Javascript, in an Observable notebook, with some attempt at explaining what was going on, here: https://observablehq.com/@zellyn/apple-ii-ntsc-emulation-ope...
This was my attempt to understand what the code was doing, but I went down the “I should learn signal processing” rabbit hole for a while and eventually got distracted.