🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.dec.micro
Article #1282

Getting the Rainbow's Cursor Position: A Quick Demo

#1282
From: s
Date: Mon, 04 Jan 1988 01:05
100 lines
3619 bytes

   Hello Net-land:

   The following is a quick demo program that contains two functions
   GetCursorColPos and GetCursorRowPos which return the cursor's
   current column and row positions, respectively.  The routines
   each grab a byte of data out of the Rainbow's screen RAM segment.
   This pair of routines are a lot easier to use than trying to
   use VT102 escape sequences or other methods of figuring out where
   the cursor is.  These routines are probably best used to 'remember'
   the cursor's position before using the SaveScreen and after using
   the RestoreScreen routines in the RBDEMO3 demo.

   The routines are after the .signature.

   Enjoy,
   Alan


   Alan I. Vymetalik  @  {allegra,seismo}!rochester!ritcv!iav1917
   ----------------------------------+----------------------------------
   J.A.M, Inc.                       |   Prism Software Designs
   300 Main Street                   |   44 Arborwood Crescent
   East Rochester, New York, 14445   |   Rochester, New York, 14615-3807
                                     |   1-716-458-4932
   ----------------------------------+----------------------------------
   DISCLAIMER:   The above statements and opinions belong to the author.
   Any resemblence to statements found in actual reality is purely coin-
   cidental.  And, as always, the above opinions have absolutely nothing
   to do with the little, fat man putting $100 bills in my pocket.
   ---------------------------------------------------------------------

   ---------------------------------------------------------------------

program DEC_Rainbow_Cursor_Demo;

var
   i : byte;                      { misc. loop variable }

{
   GetCursorColPos
   ======================================================================

   and

   GetCursorRowPos
   ======================================================================

   GetCursorColPos and GetCursorRowPos return the screen cursor's current
   column and row positions, respectively, from the values stored in the
   Screen RAM segment of video memory.

   These procedures can be useful in saving the cursor's position in a
   storage variable before saving and clearing the screen.  Later, the
   cursor can be properly replaced when the screen is restored.
}

function GetCursorColPos : byte;

begin { GetCursorColPos }

   GetCursorColPos := mem[$EE00:$0F41];

end;  { GetCursorColPos }



function GetCursorRowPos : byte;

begin { GetCursorRowPos }

   GetCursorRowPos := mem[$EE00:$0F42];

end;  { GetCursorRowPos }


{
   A quick demo program to demonstrate the above functions...
   The first character displayed is located at the position
   decribed.
}

Begin { demo }

   Write(#27,'[2J',#27,'[H');              { clear screen, home cursor }

   For i := 1 To 23 Do
      Begin
         GotoXY(i,i);
         Write(GetCursorColPos:1,',',GetCursorRowPos:1);
      End;

   For i := 23 DownTo 1 Do
      Begin
         GotoXY(76-i,i);
         Write(GetCursorColPos:1,',',GetCursorRowPos:1);
      End;

End.  { demo }
Technical Details
Message-ID: <64@ritcv.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!ccicpg!cci632!ritcv!iav1917

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!ccicpg!cci632!ritcv!iav1917
From: iav1917@ritcv.UUCP (s)
Newsgroups: comp.sys.dec.micro
Subject: Getting the Rainbow's Cursor Position: A Quick Demo
Message-ID: <64@ritcv.UUCP>
Date: 4 Jan 88 01:05:39 GMT
Reply-To: iav1917@ritcv.UUCP (alan i. vymetalik)
Distribution: na
Organization: Rochester Institute of Technology, Rochester, NY
Lines: 100
Keywords: DEC Rainbow, Turbo Pascal
Summary: Sorry, I left two functions out of my last posting...