[net.lang.pascal] Turbo Cursor Off/On

allbery@ncoast.UUCP (Brandon Allbery) (06/07/86)

Expires:

Quoted from <365@usc-oberon.UUCP> ["Turbo Pascal Questions"], by hartsoug@usc-oberon.UUCP (Mike Hartsough)...
+---------------
| Answers to the following questions regarding Turbo Pascal would be appreciated.
| I have version 2.0
| 
| A discussion a while back concerned turning the cursor off...I of course
| was not interested at the time...how is this done from a Turbo program? 
+---------------

I have a procedure to do this; anyone interested send mail.  I don't know if
it's 2.0 compatible or not (I have 3.0).  It uses information stored in low
RAM by MS-DOS and accesses the card (color or monochrome, there is a DOS
pointer in low RAM which knows which is in use and contains the port number of
the card), so it doesn't need INT 10 but DOES need a reasonably-compatible
MS-DOS (Sanyo MBC550 need not apply).  Works fine on my ITT XTRA, I assume it
will work on a PC/XT/AT since I got the tech info. from a book about those
machines, but others are ???.

Usage: cursor(true);  { turn cursor on  }
       cursor(false); { turn cursor off }

--Brandon
-- 
ihnp4!sun!cwruecmp!ncoast!allbery ncoast!allbery@Case.CSNET ncoast!tdi2!brandon
(ncoast!tdi2!root for business) 6615 Center St. #A1-105, Mentor, OH 44060-4101
Phone: +01 216 974 9210      CIS 74106,1032      MCI MAIL BALLBERY (part-time)

brad@looking.UUCP (Brad Templeton) (06/08/86)

In article <1210@ncoast.UUCP> allbery@ncoast.UUCP (Brandon Allbery) writes:
>
>I have a procedure to do this; anyone interested send mail.  I don't know if
>it's 2.0 compatible or not (I have 3.0).  It uses information stored in low
>RAM by MS-DOS and accesses the card (color or monochrome, there is a DOS
>pointer in low RAM which knows which is in use and contains the port number of
>the card), so it doesn't need INT 10 but DOES need a reasonably-compatible
>MS-DOS (Sanyo MBC550 need not apply).  Works fine on my ITT XTRA, I assume it
>will work on a PC/XT/AT since I got the tech info. from a book about those
>machines, but others are ???.

Don't send this guy mail to get this routine!  If you see any copies of it,
burn them quickly.

This is just crazy.  Why do people write routines like this?  Is it just
to drive people crazy or what?

IBM-PCs have an official way to deal with screen functions.  (This has
*nothing* to do with MS-DOS, by the way)  These routines aren't perfect, but
there is little excuse for not using them unless you want something that
they can't do.

Turbo Pascal & compatible systems have a built-in routine called "intr" that
makes interfacing to these routines easy.  Most C compilers have a similar
routine.

INT 10, function 15 (ah register) gets you the screen mode.  7 is monochrome
adapter, anything less is colour adapter or compatible, more is EGA or other
card.   Function 8 is cursor addressing.  Put -1 in dx and the cursor goes
away.

(I will admit that the above -1 is not documented, but it's still a damned
sight better than poking around in the BIOS ram!)
-- 
Brad Templeton, Looking Glass Software Ltd. - Waterloo, Ontario 519/884-7473