So it's February 2024, where the hell is 0.2?
I'm getting there - still tackling some intransigent bugs, issues with frame pacing, sound and other issues. Another minor rework to the CPU and a major bugfix in the PIC fixed several titles where segment address wrapping occurred, improvements to the FDC and HDC enabled several different editions of Minix to boot.
After poring over the schematics for a few hours, I rewrote the EGA (again) - this time breaking out the 5 LSI controller chips into 4 separate logical modules (the two graphics controllers can more or less be treated as one). Many of the seemingly redundant register settings on the VGA make a lot more sense when you realize they were registers that existed on separate chips on the EGA with no way to synchronize their state.
Suddenly the half-dozen or so combinations of flags and mode switches that enable CGA emulation mode started to gel:
ega_cga_emulation.png
(the image is shifted to the left - something i'm hoping resolves when i properly emulate the attribute controller, display enable skew and horizontal retrace delay)
Text mode is now properly implemented on odd/even planes for glyph and attribute, although software fonts are still not implemented - glyphs are still drawn using fast, pre-rasterized row caches. I'm thinking I don't necessarily have to abandon this optimization, but I will need to be able to update font cache on the fly when writes occur to plane #2 where the fonts are stored.
MDA emulation isn't really on my radar. It would need its own DIP switch setting i think. When you can easily switch to an actual MDA device, is there a need for this?
Another lingering puzzle is what to do about proper floppy drive size emulation. Right now you have the luxury of using 1.44Mb floppy images in MartyPC, but it's sort of an accident of the lack of sector checks that it works. If I let you select the drive size, and properly behave like a 720K drive, the BIOS could recognize them, and you'd be able to format blank disk images properly, but it would sort of break 1.44Mb images from working since we're limiting how far the drive can seek.
I sort of like the convenience of not needing to worry about your drive size now in MartyPC, and as long as you aren't formatting things everything seems to work fine. How important is being able to format a floppy in an emulator? I suppose I could let you select drive size along the lines of "360k", "720k", "auto" and auto would just behave how it does now.
MartyPC: A cycle-accurate IBM PC/XT emulator | https://github.com/dbalsom/martypc