home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / QWIK21.ZIP / CURSOR.INC next >
Encoding:
Text File  |  1986-12-09  |  2.6 KB  |  52 lines

  1. { Cursor.inc - GotoRC, CursorChange                         ver 2.0, 11-24-86 }
  2.  
  3. { GotoRC - move cursor                                      ver 1.3, 11-10-86 }
  4. { This is the inverse of Turbo's GotoXY procedure and just as fast. It applies
  5.   to the currently displayed page and ignores Turbo Windows.  Turbo's GotoXY
  6.   only works on page 0, while GotoRC works on all pages.                      }
  7. procedure GotoRC (Row, Col: Byte);
  8. begin
  9. Inline(
  10.    $B4/$02               {       MOV   AH,$02           ;Set AH = $02}
  11.   /$31/$DB               {       XOR   BX,BX            ;Set BX=0}
  12.   /$8E/$C3               {       MOV   ES,BX            ;Set ES=0}
  13.   /$26/$8A/$3E/$62/$04   {       ES:   MOV BH,[$0462]   ;Set BH=current page}
  14.   /$8A/$76/<ROW          {       MOV   DH,[BP+<Row]     ;Move Row}
  15.   /$FE/$CE               {       DEC   DH               ;Convert to 0-?? range}
  16.   /$8A/$56/<COL          {       MOV   DL,[BP+<Col]     ;Move Col}
  17.   /$FE/$CA               {       DEC   DL               ;Convert to 0-?? range}
  18.   /$CD/$10               {       INT   $10              ;Set cursor position}
  19. );
  20. end;
  21.  
  22.  
  23. { CursorChange - changes type or hides cursor, saves old    ver 1.3, 11-10-86 }
  24. { This utility will let you change the type (shape and visibility) of the
  25.   cursor.  At the same time, it saves the previous type.
  26.  
  27.   Shape:       Mono - top row = 0; bottom row = 13 (Default is 12,13)
  28.                CGA  - top row = 0; bottom row =  7 (Default is  6, 7)
  29.   Invisibilty: Set top row = 32 (bits 5-6 = 01)
  30.                 (Setting top > bottom also seems to work.)
  31.   Blinking:    Set top row + 96 (bits 5-6 = 11)
  32.                 (Supposedly this does a faster blink, but it doesn't
  33.                  work on all machines.)
  34.   Value:       >>>>>> SET New:= top shl 8 + bottom  <<<<<<
  35.  
  36.   Suggestions: For block cursor, set new:=  13   (Works on all machines.)
  37.                For invis cursor, set new:=8192                                }
  38.  
  39. procedure CursorChange (New: integer; VAR Old: integer);
  40. begin
  41. Inline(
  42.    $31/$C0               {       XOR   AX,AX            ;Set AX=0}
  43.   /$8E/$C0               {       MOV   ES,AX            ;Set ES=0}
  44.   /$26/$A1/$60/$04       {       ES: MOV AX,WO[$0460]   ;Read old cursor type}
  45.   /$C4/$7E/<OLD          {       LES   DI,[BP+<Old]     ;Set address for Old}
  46.   /$AB                   {       STOSW                  ;Store old value}
  47.   /$B4/$01               {       MOV   AH,$01           ;}
  48.   /$8B/$4E/<NEW          {       MOV   CX,[BP+<New]     ;Get New value}
  49.   /$CD/$10               {       INT   $10              ;Set cursor change}
  50. );
  51. end;
  52.