Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!spool.mu.edu!uwm.edu!linac!att!cbnewsj!davet From: davet@cbnewsj.cb.att.com (Dave Tutelman) Newsgroups: comp.os.msdos.programmer Subject: Re: Fonts for Hercules Summary: I wrote a program to do this Message-ID: <1991Jun28.120235.9085@cbnewsj.cb.att.com> Date: 28 Jun 91 12:02:35 GMT References: Organization: AT&T Bell Labs - Lincroft, NJ Lines: 57 In article kai@kaiki.toppoint.de (Kai Voelcker) writes: >pshuang@athena.mit.edu (Ping-Shun Huang) writes: > >> You can, however, read this table so that your >> software can use it to display characters in graphics mode which look >> very much like the characters in text mode. > >Yes, but this is not so easy. One way would be to read out or define the >char set as byte pattern. Then You need a routine that emulates the int 10h >calls (eg tty) for herc in graphics mode (same as EGA / VGA would do). But >this will work only if Your software does *not* change the video mode *and* >uses int 10h for video output. I used this for an own program, worked fine. What Kai says is true, and most graphic-mode programs available for the PC DO NOT use the BIOS for video output; they write directly to the screen for efficiency. A short story: When I made my first near-clone in 1983, I made a Hercules-clone video board for it. I rapidly discovered that (1) I couldn't write much for it, since the standard functions (BIOS) in video mode worked only for CGA, and (2) almost none of the existing graphics programs would work with it, since they were written for CGA. My solution was to build a small TSR that I called HERCBIOS, which intercepted INT 10. If the display was in video mode, or if the call was a mode change function, the TSR executed it. Otherwise, it passed the call on to the ROM BIOS. If it was an "alpha write" function, my TSR looked into the BIOS tables for drawing characters. However, it could have been enhanced to look in some user-defined tables. In fact, it DID look in user-defined tables for codes over 127, per the BIOS specification. This solved problem (1) above, but not problem (2); almost no existing programs used the BIOS routines in graphics mode. By 1986, and several computers later, I had figured out how to emulate the CGA on my Hercules card (about the same time as others figured it out, as in SIMCGA). I released HERCBIOS 2, which added the following interesting functionality. If a mode-change command asked for a CGA graphics mode, the TSR would go into CGA emulation until a non-CGA-graphics mode was requested. This increased the TSR from about 1200 bytes to nearly 2000, still pretty small. That improvement allowed more than half the graphics programs for CGA to run on a Herc. Those that didn't were usually those that didn't even use the BIOS to change video mode; they did that directly to the hardware. I was able to convert a couple of these using DEBUG, but it was hard work. Anyway, CGA emulation does NOT address the font issue, since it can only place the pixels that the program sends to it. The emulator doesn't know which pixels are part of a character. Well most of that was sort-of on the subject. And I can make HERCBIOS 2 available to those who want it, if I can dig it out of my archives. It has both the BIOS-call support and the CGA emulation. However, I can't guarantee to support it; I no longer have a Hercules-compatible monitor at home, and haven't run the program in years. Dave