9

I used to use a CGA emulator (don't remember which one it was), that could show some gfx even in EGA/VGA-only games (when I selected EGA mode). I remember my frustration seeing some garbled graphics and wanting to fix the emulator, but I had no source code then. Obviously some level of emulation is/was possible.

user1095108
  • 803
  • 5
  • 17

1 Answers1

16

There can not be an EGA emulator for many reasons.

Emulating CGA works, because in graphics mode, Hercules has a 64k frame buffer at address B0000h - BFFFFh, and for a single page, only 32k from address B0000h is displayed. The CGA has a 16k frame buffer at B8000h - BBFFFh, which fits inside the frame buffer provided by the Hercules card.

Therefore what the CGA emulator TSR has to do is to read the CGA area, and do it's best to convert large 4-bit color pixels into small 1-bit pixels by dithering, and write to the active Hercules area.

The EGA has it's graphics mode frame buffer in the A0000h-AFFFFh area, for which the Hercules card does not provide the memory, so that alone makes it impossible to emulate EGA with Hercules. And because Hercules card by default is in monochrome text mode and has no way of mapping to EGA/VGA addresses, it can actually co-exist in a system with a EGA or VGA card.

Justme
  • 31,506
  • 1
  • 73
  • 145
  • 2
    That exact combination was my setup for development those days. And for clearer graphics I used a monochrome VGA monitor; no games, just professional work. – the busybee May 04 '20 at 08:19
  • But I remember clearly the CGA emulator showing something remotely recognizable. I wanted an EGA, but didn't have the $$$. – user1095108 May 04 '20 at 08:52
  • Are you saying the TSR would "follow behind" the application writes to CGA memory buffer, and clean up those writes to look like a dithered monochrome representation of the intended image? Is that the only way it could work? – Brian H May 04 '20 at 17:24
  • @BrianH No. See https://retrocomputing.stackexchange.com/questions/6963/how-do-cga-emulators-for-hercules-graphics-work - Hercules could be programmed to have the resolution and memory layout mostly compatible, with dithering being a side effect of the pixel layout. If you accept ugly empty lines, there is no speed penalty and almost no TSR needed (only to switch modes). – Radovan Garabík May 04 '20 at 17:28
  • 2
    A 386 protected mode driver operating like QEMM could do the emulation bypassing the memory range objection, couldn't it? Bit late for relevance, granted. – hobbs May 05 '20 at 01:59
  • I am also not happy with this answer. Impossible? It is possible to emulate EGA in dosbox and dosbox can run under dos, to name one example of how it might be possible. – user1095108 May 11 '20 at 21:39
  • 1
    @user1095108 Like hobbs said, the EGA could be virtualized in protected mode and then displayed on Hercules. But protected mode would require at least a 386 CPU. And you can of course run an emulator on DOS and Hercules, that emulates a DOS machine with EGA, same way you can run a DOS emulator on Raspberry Pi, but it was not possible back in the day. Back in the day, most likely if you had only the Hercules adapter, you most likely did not have a 386 either to assist in the emulation, but you still could run CGA games via the TSR. – Justme May 11 '20 at 21:57
  • I understand what all of you are saying and even fully agree with you, yet my memory of this is clear. I could somehow see garbled EGA graphics on my lowly '286 after running some CGA emulator (simcga?), I don't remember which one. This got me salivating after those fine EGAs, but, of course, I did not have the money. Perhaps someone else had a similar experience. – user1095108 Jul 01 '21 at 00:55
  • So it would seem you could map A0000-AFFFFF to RAM (obviously motherboard specific) and mess with it that way but it won't work because the EGA card is memory banked. – Joshua Aug 15 '21 at 00:46