[comp.sys.ibm.pc] GRAFTABL.COM: how do I detect if it is loaded?

marvin@rmi.UUCP (Martin Freiss) (03/28/88)

This may have been asked before on the net, so if you consider it a dumb
question, my abject apologies :-).

For a program (written in C) that operates on the hercules graphics card in
graphics mode, I need the extended ASCII-character set (characters from
decimal 128 to 255) to display the german 'Umlaute'.
Being lazy but inventive :-), I use the ASCII charactertable in the ROM to
display text in graphics mode; however, this only giv%s me the 'normal'
letters. Now GRAFTABL.COM provides this extended character set, but I
need to ascertain if it has been loaded in my program prior to switching into
graphics mode. If anybody on the net has ideas on how to do this, I would be
grateful for any hints you might be able to give. Just checking if the int 1fh
vector points to 0000:0000 does not seem to work reliably on all machines.

Failing that, how do I load GRAFTABL per default from inside my program? As
GRAFTABL makes itself memory resident, a
  spawnlp("graftabl.com","graftabl.com",NULL);
or
  system("graftabl");
works, but plays havoc with the memory structure; after terminating my
program, a 2k block of memory stays allocated in the middle of
RAM and crashes the system soon afterwards.

Again, any hints on how to do this would be appreciated.
I'm running DOS3.3 on an AT-clone, if it matters.

Thanks in advance, Martin
 ...!uunet!unido!rmi!dg5kx!dg5kx                      "MSDOS? Just say NO!"
 ...!uunet!unido!rmi!marvin

sam@ncsuvx.ncsu.edu (Sam "SammyBake" Moore) (03/29/88)

In article <942@rmi.UUCP> marvin@rmi.UUCP (Martin Freiss) writes:
>
>This may have been asked before on the net, so if you consider it a dumb
>question, my abject apologies :-).
>
>For a program (written in C) that operates on the hercules graphics card in
>graphics mode, I need the extended ASCII-character set (characters from
>decimal 128 to 255) to display the german 'Umlaute'.
>Being lazy but inventive :-), I use the ASCII charactertable in the ROM to
>display text in graphics mode; however, this only giv%s me the 'normal'
>letters. 

On a Hercules graphics card in graphics mode you use the ASCII character table
in ROM? What mode are you working in and what Herc card is it? Can you explain
how you use this table? I assumed this table would be useless to you in the
(720 x 348) 2 color Hercules mode. 

>         Now GRAFTABL.COM provides this extended character set, but I
>need to ascertain if it has been loaded in my program prior to switching into
>graphics mode. If anybody on the net has ideas on how to do this, I would be
>grateful for any hints you might be able to give. Just checking if the int 1fh
>vector points to 0000:0000 does not seem to work reliably on all machines.
>...
>Again, any hints on how to do this would be appreciated.
>I'm running DOS3.3 on an AT-clone, if it matters.

I would get an EGA card and dump the character table for the mode you need
using BIOS. Then I would use the table in my program. If you can still use
BIOS text support in the mode you are using then you can replace the vector
that points the top 128 and have it point to your table. You can also replace
the original vector in case something else is using it. If the use of the
table produced by BIOS is not "free", then there are public domain fonts. Or
you can write your own font editor; easy to write but no fun to use.

I am confused how you can use the "ROM character table" in Herc graphics mode.
Since, you don't have BIOS support for it then I can't see it being useful. But,
when you talk about the "top 128" characters I assume you are using CGA graphics
modes. 




-- 
Sam Moore                          ||\\  || //==\\ //==\\ ||   ||
NCSU Computing Center              || \\ || ||     ||==\\ ||   ||
Raleigh, NC                        ||  \\|| ||         || ||   ||
sam@ncsuvx.ncsu.edu                ||   \\  \\==// \\==||  \\==//

alexande@drivax.UUCP (Mark Alexander) (03/31/88)

In article <1635@ncsuvx.ncsu.edu> sam@ncsuvx.UUCP (Sam "SammyBake" Moore) writes:
>On a Hercules graphics card in graphics mode you use the ASCII character table
>in ROM? What mode are you working in and what Herc card is it? Can you explain
>how you use this table? I assumed this table would be useless to you in the
>(720 x 348) 2 color Hercules mode. 

In the BIOS ROM of a true blue PC (don't know about clones) there is a
font table of 8x8 characters for the CGA card.  It's used by the BIOS
when you switch into graphics mode on the CGA.  You can also use this
font table on the Hercules monochrome graphics card when it's in
graphics mode.  You get 43 rows of 90 columns each.  It looks a bit
crude (like the CGA), but it's readable.  I recently modified
MicroEMACS to use this mode, and it's great for editing programs --
you can see nearly twice as much stuff on the screen at once.

The table is located at F000:FA6E in the PC's I've used.  This appears
to a constant, since it's the same in both an ancient PC and an AT.  I
can't find any pointer to it in the interrupt page.

The problem with the ROM table is that it only covers characters
0-7Fh.  The purpose of GRAFTABL.COM is to supply the rest of the
characters (80h-FFh).  Interrupt vector 1Fh is used as a pointer to
this upper font table.

If anyone is interested in some assembly code that uses the ROM font
table (specifically, the code that I use in MicroEMACS), I'd be happy
to email it.
-- 
Mark Alexander	(UUCP: amdahl!drivax!alexande)
"Bob-ism: the Faith that changes to meet YOUR needs." --Bob