[comp.sys.ibm.pc.programmer] How to find ANSI...

austin@bucsf.bu.edu (Austin H. Ziegler, III) (02/24/90)

	For a program which I'm writing, I want to provide ANSI, BIOS, and
DMA screen support.  It is easy to determine whether I should use BIOS or
DMA, but I'm having problems detecting ANSI.  If anyone can point me to how
to check for any of the ANSI variants from within a Pascal or C program (I
will be using the Turbo variants, but I feel myself conversant enough with
both to translate to whichever form I will be programming in), I would
greatly appreciate it.

just my two bytes,
austin
--
+--------------------------------------------------------------------------+
| The surgeon general of the United States of America has determined that  |
| reading USENET turns your brain to jelly, leaving nothing to claim or to |
| disclaim. +--------------------------------------------------------------+
+-----------+ Austin Ziegler   austin@bucsf.bu.edu or austin@buengf.bu.edu |
| 700 Commonwealth Box 2094, Boston, Massachusetts  02215    BUENG '93     |
+--------------------------------------------------------------------------+

cs4g6ag@maccs.dcss.mcmaster.ca (Stephen M. Dunn) (02/27/90)

In article <AUSTIN.90Feb23155939@bucsf.bu.edu> austin@bucsf.bu.edu (Austin H. Ziegler, III) writes:
$	For a program which I'm writing, I want to provide ANSI, BIOS, and
$DMA screen support.  It is easy to determine whether I should use BIOS or
$DMA, but I'm having problems detecting ANSI.  If anyone can point me to how

   Well, I don't have a program, but here are a couple of ideas which
will work:

1.  Position the cursor to some known location using the BIOS, and then
    write some ANSI code and look at what's in that known location.  If
    ANSI.SYS (or replacement) is present, it will be what was there
    before; otherwise, you should see the escape code you sent.

2.  Clear the keyboard buffer and send the ANSI code that reports the
    status of the display, then see if anything appears in the keyboard
    buffer (also check to make sure it's what you expect so that you
    know ANSI put it there and that it wasn't the user typing something).

   Don't forget to clear the screen immediately afterwards if ANSI.SYS
isn't present, or the user will wonder what that garbage that appears on
the screen is there for!
-- 
Stephen M. Dunn                               cs4g6ag@maccs.dcss.mcmaster.ca
          <std_disclaimer.h> = "\nI'm only an undergraduate!!!\n";
****************************************************************************
               I Think I'm Going Bald - Caress of Steel, Rush

shap@bunker.UUCP (Joseph D. Shapiro) (03/01/90)

In article <AUSTIN.90Feb23155939@bucsf.bu.edu> austin@bucsf.bu.edu (Austin H. Ziegler, III) writes:
>
>	For a program which I'm writing, I want to provide ANSI, BIOS, and
>DMA screen support.  It is easy to determine whether I should use BIOS or
>DMA, but I'm having problems detecting ANSI.  If anyone can point me to how
>to check for any of the ANSI variants from within a Pascal or C program (I
>will be using the Turbo variants, but I feel myself conversant enough with
>both to translate to whichever form I will be programming in), I would
>greatly appreciate it.

How about clearing the screen via BIOS, Homing the cursor via BIOS,
clearing the screen with an ANSI sequence, then reading the first
screen position via BIOS to see if it is 0x00 or ESC?
-- 
__--__--__--__--__--__--__--__--__--__--__--__--__--__--__--__--__--__--__--__
Joe Shapiro					"My other car is a turbo...
ISC-Bunker Ramo     				 ...too."
{decvax,yale,philabs,oliveb}!bunker!shap