VOGONS


First post, by MatchesMalone

User metadata
Rank Newbie
Rank
Newbie

Hi!
I have a Pentium MMX 233 with a SiS 6326 PCI video card and a Samsung Syncmaster 3 monitor.
Out of complete nostalgy and nothing else, I'd love to run some old games (Prince of Persia, Leisure Suit Larry, Sokoban, etc) in Hercules mode (this was monochrome, right? I remember running things in black and white, amber and green phosphor monitors).
Is that possible? I've run for example Prince of Persia in CGA and EGA modes, but I'm guessing Hercules was too different on a hardware level and VGA cards do not work that way?
Is there a command/utility to emulate that video mode? (similar to what simcga.com did back in the day?).

Thanks!

Reply 1 of 53, by keenerb

User metadata
Rank Oldbie
Rank
Oldbie

I believe some vga cards had utilities that could put them in CGA and hercules compatibility modes...

Reply 2 of 53, by wierd_w

User metadata
Rank Oldbie
Rank
Oldbie

VGA cards have the display buffer area for CGA and MDA modes, but if they do the necessary register level functions is another matter...

Reply 3 of 53, by Grzyb

User metadata
Rank l33t
Rank
l33t

Impossible with that SIS card.

Yes, there's many ISA VGA cards with Hercules compatibility mode, but probably only one for PCI - PCI cards with 6845 compatibility

Kiełbasa smakuje najlepiej, gdy przysmażysz ją laserem!

Reply 4 of 53, by mkarcher

User metadata
Rank l33t
Rank
l33t

Hmm, thinking of this: We already have a set of retro tools that use I/O virtualization in DOS for different compatibility stuff, like SBEMU (emulate SB on AC97) or MIDITO (relocate the MPU hardware address, add a fix-up against the hanging note bug). As any VGA compatible card has no issue to produce a 720x350 image with standard VGA timings, a fully software based HGCEMU seems like a feasible project.

Reply 5 of 53, by BitWrangler

User metadata
Rank l33t++
Rank
l33t++

I am not sure if the util on this page called "Mono" does something close https://www.bttr-software.de/freesoft/screen.htm it's either that exact thing with a clumsy description or only forces MDA-ish text modes or something.

Unicorn herding operations are proceeding, but all the totes of hens teeth and barrels of rocking horse poop give them plenty of hiding spots.

Reply 6 of 53, by mkarcher

User metadata
Rank l33t
Rank
l33t
BitWrangler wrote on 2024-12-14, 18:38:

I am not sure if the util on this page called "Mono" does something close https://www.bttr-software.de/freesoft/screen.htm it's either that exact thing with a clumsy description or only forces MDA-ish text modes or something.

If I understand the page correctly, it is more about getting a better grayscale contrast by eliminating color. As the source code is available as well, I took a quick peek. It operates in all text modes (0..3 and 7), and patches attribute bytes in the timer interrupt to create MDA-like interpretation (for example, the algorithm in that tool will convert light blue on red to dark gray (nearly black) on light gray, whereas the grayscale conversion of light blue on red would have very low contrast).

Reply 7 of 53, by Grzyb

User metadata
Rank l33t
Rank
l33t
mkarcher wrote on 2024-12-14, 15:59:

Hmm, thinking of this: We already have a set of retro tools that use I/O virtualization in DOS for different compatibility stuff, like SBEMU (emulate SB on AC97) or MIDITO (relocate the MPU hardware address, add a fix-up against the hanging note bug). As any VGA compatible card has no issue to produce a 720x350 image with standard VGA timings, a fully software based HGCEMU seems like a feasible project.

Yes, a V86 mode emulator seems perfectly possible.
VGA can be set to 720 x 348 x 1bpp, and even supports Hercules-compatible 4-bank video memory layout.
Also, there's hardly any protected-mode software for Hercules - I'm only aware of Windows 3.x and XFree86 Mono Server - so no need to worry about this.

Kiełbasa smakuje najlepiej, gdy przysmażysz ją laserem!

Reply 8 of 53, by darry

User metadata
Rank l33t++
Rank
l33t++
Grzyb wrote on 2024-12-14, 22:36:
Yes, a V86 mode emulator seems perfectly possible. VGA can be set to 720 x 348 x 1bpp, and even supports Hercules-compatible 4-b […]
Show full quote
mkarcher wrote on 2024-12-14, 15:59:

Hmm, thinking of this: We already have a set of retro tools that use I/O virtualization in DOS for different compatibility stuff, like SBEMU (emulate SB on AC97) or MIDITO (relocate the MPU hardware address, add a fix-up against the hanging note bug). As any VGA compatible card has no issue to produce a 720x350 image with standard VGA timings, a fully software based HGCEMU seems like a feasible project.

Yes, a V86 mode emulator seems perfectly possible.
VGA can be set to 720 x 348 x 1bpp, and even supports Hercules-compatible 4-bank video memory layout.
Also, there's hardly any protected-mode software for Hercules - I'm only aware of Windows 3.x and XFree86 Mono Server - so no need to worry about this.

What kind of overhead could such emulation entail ? Since the target audience for this would be PCI based machines (or newer), I wonder if a high end 486, for example, could handle this alongside whatever is the most demanding application that would work with it.

Reply 9 of 53, by Grzyb

User metadata
Rank l33t
Rank
l33t
darry wrote on 2024-12-14, 22:47:

What kind of overhead could such emulation entail ? Since the target audience for this would be PCI based machines (or newer), I wonder if a high end 486, for example, could handle this alongside whatever is the most demanding application that would work with it.

The only overhead would be when the application accesses the I/O registers.
A program using Hercules graphics only does that in three cases:
- detecting the card (only once, if at all)
- setting the graphics mode (usually only once)
- switching video pages, for double-buffering (but I think most Hercules programs don't use it)

But no overhead when accessing the video memory - it's at the same address, and with the same layout.

Overall, seems perfectly feasible even for an entry-level 386SX.

Kiełbasa smakuje najlepiej, gdy przysmażysz ją laserem!

Reply 10 of 53, by MatchesMalone

User metadata
Rank Newbie
Rank
Newbie

Wow, very interesting input from everyone, thank you all!
The idea of a hercules mode emulator for PCI VGA cards sounds both challenging and cool.
In the meantime I'll try to get my hands at least on a ISA video card to see if it can run on HGC mode, and if I can find one, on an actual Hercules card.

Reply 11 of 53, by darry

User metadata
Rank l33t++
Rank
l33t++
Grzyb wrote on 2024-12-14, 23:20:
The only overhead would be when the application accesses the I/O registers. A program using Hercules graphics only does that in […]
Show full quote
darry wrote on 2024-12-14, 22:47:

What kind of overhead could such emulation entail ? Since the target audience for this would be PCI based machines (or newer), I wonder if a high end 486, for example, could handle this alongside whatever is the most demanding application that would work with it.

The only overhead would be when the application accesses the I/O registers.
A program using Hercules graphics only does that in three cases:
- detecting the card (only once, if at all)
- setting the graphics mode (usually only once)
- switching video pages, for double-buffering (but I think most Hercules programs don't use it)

But no overhead when accessing the video memory - it's at the same address, and with the same layout.

Overall, seems perfectly feasible even for an entry-level 386SX.

Thank you, that sounds really nice.
How about a scope creepy idea: full hardware CGA RGB emulation and possibly CGA composite emulation in DOS on a VGA (or SVGA card with VESA support). Would that be feasible/sane ?

Reply 12 of 53, by wierd_w

User metadata
Rank Oldbie
Rank
Oldbie

'Full' means composite output, with artifact color.

You *wont* get that for free, without a shadowmask crt.

Reply 13 of 53, by darry

User metadata
Rank l33t++
Rank
l33t++
wierd_w wrote on 2024-12-15, 05:06:

'Full' means composite output, with artifact color.

You *wont* get that for free, without a shadowmask crt.

Yes, I meant with NTSC composite artifact color.
To be clear, I meant as close an approximation as one could hope to achieve, purely in software on a P3 or faster class machine, possibly leveraging a 24-bit, higher resolution VESA mode for output. I do realize that convincingly emulating the look and feel of a 15KHz shadow mask CRT would be out of scope.

Reply 14 of 53, by Grzyb

User metadata
Rank l33t
Rank
l33t

CGA registers emulation on a VGA seems possible.
That should be enough to fix many problems:
- garbage in programs that set graphics mode using direct I/O, eg. Digger
- lack of 160 x 100 "graphics", eg. Round 42
- wrong palette, eg. Popcorn
- lack of palette effects, eg. J-Bird

Limitation: 386 would be necessary, while many CGA games only work well on 8088 @ 4.77 MHz.

But no easy way to emulate composite artifacts.
Yes, probably possible on a Pentium 3, but that's already fast enough for Dosbox...

Kiełbasa smakuje najlepiej, gdy przysmażysz ją laserem!

Reply 15 of 53, by mkarcher

User metadata
Rank l33t
Rank
l33t
darry wrote on 2024-12-15, 04:52:

Thank you, that sounds really nice.
How about a scope creepy idea: full hardware CGA RGB emulation and possibly CGA composite emulation in DOS on a VGA (or SVGA card with VESA support). Would that be feasible/sane ?

This is an entirely different piece of cake. I suggested a simple tool that detects when a virtualized Hercules card is put into graphics mode, and then reconfigures the physical VGA to behave just like a Hercules card on video memory access. The physical VGA card can be configured to a graphcs mode that is 100% compatible to the Hercules memory layout, so no live translation of video data needs to be performed. Your suggestion is a way more difficult, because it involves actual software emulation of the rendered picture and not just hardware configuration. This seems technically possible given enough resources spent, as there are dosbox variants that can emulate a composite picture. So you can definitely also roll your own graphics card virtualization that does the same job as well, but it likely takes an insane amount of effort to do so.

Modern graphics cards with sufficiently advanced shaders might be able to accelerate the CGA-artifact-to-RGB translation in hardware, but good luck getting this done without any Windows or Linux graphics driver helping you to do so...

Reply 16 of 53, by mkarcher

User metadata
Rank l33t
Rank
l33t
Grzyb wrote on 2024-12-14, 23:20:
The only overhead would be when the application accesses the I/O registers. A program using Hercules graphics only does that in […]
Show full quote

The only overhead would be when the application accesses the I/O registers.
A program using Hercules graphics only does that in three cases:
- detecting the card (only once, if at all)
- setting the graphics mode (usually only once)
- switching video pages, for double-buffering (but I think most Hercules programs don't use it)

Another thing to consider: Polling the status register for horizontal or vertical refresh. This will be way slower (think 1000 cycles instead of 10 cycles) if every access to the status port is trapped, but given the excess performance of a 386 computer compared to a typical Hercules-capable computer, a "wait-for-Vsync" loop should still work well enough.

My suggestion (if implemented) will not emulate real HGC refresh timing, but keep the 31.5kHz horizontal rate of the VGA card, while the vertical frequency in "standard compliant mode" would be 70Hz instead of 50Hz. Anecdotal evidence with some CRTs show that you can likely extend the (already enormous) blanking in that mode to get down to 60Hz, but going down to "real Hercules 50Hz" will not work on fixed-frequency VGA monitors, at least not without re-tuning V-Hold.

Reply 17 of 53, by Jo22

User metadata
Rank l33t++
Rank
l33t++

I think it would be nice if the Hercules image would be stretched 4:3 or aspect corrected.
On a real MDA monitor it's possible to make Windows 3.0 dimensions in Hercules mode look same as in VGA mode.

Edit: Or how about that polarity thing to display EGA 640x350 on VGA monitors.
Can the same circuit be used to make Hercules look full screen/non-squashed?

"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 18 of 53, by DEAT

User metadata
Rank Member
Rank
Member
Grzyb wrote on 2024-12-14, 06:51:

Impossible with that SIS card.

Yes, there's many ISA VGA cards with Hercules compatibility mode, but probably only one for PCI - PCI cards with 6845 compatibility

I can confirm that my PCI mach32 does have Hercules compatibility. Look for the fdoomhgc benchmark specifically:
https://docs.google.com/spreadsheets/d/12ZaYj … Om_JOKfCRIB9Uc/

S3 964/864 supposedly has it as well according to VGADOC and the Diamond Stealth 64 mode setting utility has text strings relating to CGA/Hercules emulation, though I'm yet to come across a DOS utility that actually sets it:
https://pdos.csail.mit.edu/6.828/2017/reading … e/vgadoc/S3.TXT
Page 8 of the S3 968 datasheet explicitly mentions that CGA/Herc support was removed in 968/868:
http://www.bitsavers.org/components/s3/DB016- … tor_Apr1995.pdf

I'll need to check my S3 928 cards at some point - the earliest S3 801 Win 3.1 drivers I came across (1.30) has DOS utilities that I haven't tested.

UPDATE: No luck with my PCI S3 928 cards. PCI S3 805i cards do exist, but I don't have one yet.

Last edited by DEAT on 2024-12-17, 05:29. Edited 1 time in total.

Reply 19 of 53, by BitWrangler

User metadata
Rank l33t++
Rank
l33t++

Been trying to dig stuff out of the net on and off all day, no DOS utils for 6326 coming up, the only file around that mentions DOS appears to be an AutoCAD 12 driver. Unless the 95 drivers just dump a dir on the HDD with stuff in and don't mention it. Kinda less than completely altruistic as I will have a machine or possibly two using 6326 graphics, and wondered what the lowest end graphics possibilities were, though I guess you can argue about whether the high res mono or the 4 colors lower res CGA is lowest, but you know what I mean. For myself though, I will have herc available elsewhere, and would also be using at least around P233MMX performance levels, which gives me the thought that probably DOSbox on that would give you at least turbo XT, low 286 kind of max speed... and herc emulation.

Does a VGA with no herc support necessarily grab up the resource ranges and the UMB space that a herc might need, and might need to be unencumbered for emulation?

You would think maybe a programmer had cobbled one up sometime to check hercules version of his program for the plebs on his shiny up to the minute VGA system. Though I am remembering that simulator and emulator were used pretty interchangeably some time back, so maybe it might not turn up searching for emulator, and might be buried in some obscure programming utils zip or arj or zoo etc.

Strangely... it seems like the components might be "out there" to assemble a set of mods and driver bodges to get a 6326 to put a display on a hercules monitor, this would be by abusing tools the Arcade cabinet guys have done for messing around with the frequencies of the 6326, most commonly for NTSC standard tubes, but adapted for some weird ones. However, this would be a VGA mode contorted to display on it, not a Hercules mode, so blind alley as far as this concerned.

Edit: this might be vaguely of interest, a file here in PC Blue user group disk 287 about Hercules BIOS http://cd.textfiles.com/pcblueii/PCBLUE/VOL287.ZIP catalog file has the file descriptions, I KNOW the emulators in there are herc to CGA, it's the other herc related stuff that I thought worth mentioning, might give insight into hacking up something that works. In my most optimistic unicorn and rainbow land vision, you would be able to shove that hercules BIOS at the CGA emulation stuff on a VGA and get hercules, but yeah, ain't gonna be that easy, basically wishing the 6845 workalike to run as herc. Did we speak about the problem of that because of the characteristics of the herc modes and the way CGA works, that a "natural" herc emu which forces double lines and double frequency might be kind of unpossible at the scan rates and res that are generally offered on VGA monitors, even if you can force the card to do it. i.e. you go "I think I got it!" and press return and get signal out of range or a scrambled mess... it's doing it, but your screen ain't.

Last edited by BitWrangler on 2024-12-16, 05:11. Edited 1 time in total.

Unicorn herding operations are proceeding, but all the totes of hens teeth and barrels of rocking horse poop give them plenty of hiding spots.