home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 15 / CD_ASCQ_15_070894.iso / maj / swag / cursor.swg < prev    next >
Text File  |  1994-05-27  |  35KB  |  4 lines

  1. SWAGOLX.EXE (c) 1993 GDSOFT  ALL RIGHTS RESERVED 00022         CURSOR HANDLING ROUTINES                                          1      05-28-9313:36ALL                      SWAG SUPPORT TEAM        Cursor SIZE/COLOR        IMPORT              7      .]Y {> And how can I hide my cursor ? I know it's something With INT 10 butπ> that's all I know...ππTry this:πSType 'C' or 'M' - Color or monchrome displayπSize 'S' or 'B' or 'O' cursor small, big, or none (invisible)π}πUses Dos;ππProcedure CursorSize(SType, Size : Char);ππVarπ  Regs : Registers;π  i : Integer;ππbeginπ  Size := UpCase(Size);π  if UpCase(SType) = 'M' thenπ    i := 6π  ELSEπ   i := 0;ππRegs.AH := $01;πCASE Size ofπ'O' :π  beginπ   Regs.CH := $20;π   Regs.CL := $20;π  end;π'B' :π  beginπ   Regs.CH := $0;π   Regs.CL := $7 + i;π  end;π'S' :π  beginπ   Regs.CH := $6+i;π   Regs.CL := $7+i;π  end;πend;πIntr($10, Regs);πend;ππbeginπ  CursorSize('C','B');π  readln;πend.                                                                                       2      05-28-9313:36ALL                      JOHN GIESBRECHT          CUSOR Handling #1        IMPORT              22     .]ß² Unit cursor;ππ(*π *  CURSOR v1.1 - a Unit to provide extended control of cursor shape.π *π *  Public Domain 1991 by John Giesbrecht (1:247/128)π *π *  Notes:π *π *  - This version requires Turbo Pascal 6.0 or later.π *  - These routines affect only the cursor on page 0.π *  - This Unit installs an Exit Procedure which restores the cursorπ *    to its original shape when the Programme terminates.π *)ππInterfaceππProcedure cursoroff;πProcedure cursoron;           (* original cursor shape *)ππProcedure blockcursor;πProcedure halfblockcursor;πProcedure linecursor;         (* Default Dos cursor    *)ππProcedure setcursor(startline, endline : Byte);πProcedure getcursor(Var startline, endline : Byte);ππ(********************************************************************)ππImplementationππConstπ  mono = 7;ππVarπ  origstartline,π  origendline,π  mode : Byte;π  origexitproc : Pointer;ππ(********************************************************************)πProcedure setcursor(startline, endline : Byte); Assembler;ππAsmπ  mov ah, $01π  mov ch, startlineπ  mov cl, endlineπ  int $10πend;π(********************************************************************)πProcedure getcursor(Var startline, endline : Byte); Assembler;ππAsmπ  mov ah, $03π  mov bh, $00π  int $10π  les di, startlineπ  mov Byte ptr es:[di], chπ  les di, endlineπ  mov Byte ptr es:[di], clπend;π(********************************************************************)πProcedure cursoroff;ππbeginπ  setcursor(32, 32);πend;π(********************************************************************)πProcedure cursoron;ππbeginπ  setcursor(origstartline, origendline);πend;π(********************************************************************)πProcedure blockcursor;ππbeginπ  if mode = monoπ    then setcursor(1, 12)π    else setcursor(1, 7);πend;π(********************************************************************)πProcedure halfblockcursor;ππbeginπ  if mode = monoπ    then setcursor(7, 12)π    else setcursor(4, 7);πend;π(********************************************************************)πProcedure linecursor;πbeginπ  if mode = monoπ    then setcursor(11, 12)π    else setcursor(6, 7);πend;π(********************************************************************)πProcedure restorecursor; Far;ππbeginπ  system.exitproc := origexitproc;π  cursoron;πend;π(**  I N I T I A L I Z A T I O N  ***********************************)πbeginπ getcursor(origstartline, origendline);π Asmπ  mov ah, $0Fπ  int $10π  mov mode, alπ end;π origexitproc := system.exitproc;π system.exitproc := addr(restorecursor);πend.π                                                                                                                      3      05-28-9313:36ALL                      SWAG SUPPORT TEAM        Cursor Handling #2       IMPORT              15     .]
  2. f MN> Anyone have any code on hiding the cursor and then bringing it back.ππMN>                               -+- Mike Normand -+-πππI've seen many replies to this but all suffer the same disadvantage: they allπassume you know the size of the cursor. A little bit debugging BASIC revealsπwhat's up (by the way, you'll find it described in some good books): you haveπto set bit 5 For the start line and the cursor will disappear since this valueπis not allowed. To get the cursor back again, clear bit 5 again. Use thisπsolution, if you Really just want to turn on/off the cursor. CursorOn/CursorOffπdo *not* change the cursor shape!!! and do *not* need an external Variable toπmanage this.ππThe  PUSH BP / POP BP  is needed For some *very* old BIOS versions using CGA/πmonochrome :-( display, that trash BP during an INT 10h. If you just want doπsupport EGA/VGA :-) and better, just push 'em out.ππ-----------------------------------------------------πProcedure CursorOff; Assembler;πAsmπ    push bp            { For old BIOSs }π    xor  ax, axπ    mov  es, axπ    mov  bh, Byte ptr es:[462h]  { get active page }π    mov  ah, 3π    int  10h           { get cursor Characteristics }π    or   ch, 00100000bπ    mov  ah, 1π    int  10h           { set cursor Characteristics }π    pop  bp            { restore bp For old BIOSs }πend;ππProcedure CursorOn; Assembler;πAsmπ    push bp            { old BIOSs like this... }π    xor  ax, axπ    mov  es, axπ    mov  bh, Byte ptr es:[462h]  { get active page }π    mov  ah, 3π    int  10h           { get cursor Characteristics }π    and  ch, 00011111bπ    mov  ah, 1π    int  10h           { set cursor Characteristics }π    pop  bp            { ...and this, too }πend;π                                                                                 4      05-28-9313:36ALL                      SWAG SUPPORT TEAM        Show/Hide Cursor         IMPORT              4      .]φ┬ Uses Crt;ππVarπ  Continue : Char;ππProcedure HideCursor; Assembler;πAsmπ  MOV   ax,$0100π  MOV   cx,$2607π  INT   $10πend;ππProcedure ShowCursor; Assembler;πAsmπ  MOV   ax,$0100π  MOV   cx,$0506π  INT   $10πend;ππbeginπ  Writeln('See the cursor ?');π  Continue := ReadKey;π  HideCursor;π  Writeln('Gone! ');π  Continue := ReadKey;π  ShowCursor;πend.                                   5      05-28-9313:36ALL                      SEAN PALMER              Cursor Size & Detect     IMPORT              9      .]Ü┤ {πSEAN PALMERπ}ππunit cursor; {Public domain, by Sean Palmer aka Ghost}ππinterfaceππvarπ  maxSize : byte;ππprocedure setSize(scans : byte);  {set size from bottom, or 0 for off}πprocedure detect;     {get max scan lines by reading current cursor}ππimplementationππprocedure setSize(scans : byte);πvarπ  t : byte;πbeginπ  if scans = 0 thenπ    t := $20π  elseπ    t := maxSize - scans;π  asmπ    mov ah, 1π    mov bh, 0π    mov ch, tπ    mov cl, maxSizeπ    dec clπ    int $10π  end;πend;ππprocedure detect; assembler;πasm  {do NOT call while cursor's hidden}π  mov ah, 3π  mov bh, 0π  int $10π  inc clπ  mov maxSize, clπend;ππbeginπ  detect;πend.ππprogram test;πusesπ  cursor;πbeginπ  writeln(cursor.maxSize);π  cursor.setSize(cursor.maxSize);π  readln;        {block}π  cursor.setSize(0);π  readln;                     {hidden}π  cursor.setSize(cursor.maxSize div 2);π  readln;  {half}π  cursor.setSize(2);π  readln;                     {normal}πend.π                                                                        6      05-28-9313:36ALL                      SWAG SUPPORT TEAM        Cursor Show/Hide #2      IMPORT              5      .]¢"   Procedure HideCursor;  assembler;π  asmπ    mov      ah,$01  { Function number }π    mov      ch,$20π    mov      cl,$00π    Int      $10     { Call BIOS }π  end;  { HideCursor }πππ  Procedure RestoreCursor;  assembler;π  asmπ    mov      ah,$01  { Function number }π    mov      ch,$06  { Starting scan line }π    mov      cl,$07  { Ending scan line }π    int      $10     { Call BIOS }π  end; { RestoreCursor }π                                                                                                 7      05-28-9313:36ALL                      SWAG SUPPORT TEAM        Find The Cursor          IMPORT              3      .]┴« Usesπ  Dos;ππProcedure FindXY(Var X, Y : Byte; Page : Byte);π{X = Row of Cursor}π{Y = Colum of Cursor}π{Page = Page Nummber}πVarπ  Regs : Registers;πbeginπ  Regs.Ah := 3;π  Regs.Bh := Page;π  intr($10, Regs);π  X := Regs.Dl;π  Y := Regs.Dh;πend;π          8      05-28-9313:36ALL                      SWAG SUPPORT TEAM        Spin The Cursor INPUT    IMPORT              13     .]û¥ Program SpinKey;ππUses Crt;π(*   ^^^^π     This is only For "beautifying" the stuff. XCrt has the Procedures:π     HideCursorπ     ShowCursorπ     but they are not Really important, perhaps you have youre ownπ*)ππConstπ  SpinChar : Array [1..4] of Char = ('│','/','─','\');ππFunction ReadKeySpin(Wait : Byte) : Char;πVarπ  X,Y  : Byte;π  Num  : Byte;π  Ch   : Char;πbeginπ  Num := 1;                               (* initialize SpinChars  *)π  X   := WhereX;                          (* Where am I ??         *)π  Y   := WhereY;π  Repeatπ    Write(SpinChar[Num]);           (* Spin the Cursor       *)π    GotoXY(X, Y);                   (* Go back               *)π    Delay(Wait);                    (* Wait, it's to fast!   *)π    Write(#32);                     (* Clean Screen          *)π    GotoXY(X, Y);                   (* Go back               *)π    Inc(Num);                       (* Next SpinChar, please *)π    if Num = 5 then Num := 1;       (* I have only 5 Chars   *)π  Until KeyPressed;π  Ch := ReadKey;                        (* Get the pressed Key   *)π  Write(Ch);                            (* and Write it to screen*)π  ReadKeySpin := Ch;                    (* give a result         *)πend;ππFunction ReadStringSpin : String;πVarπ  Help : String;π  Ch   : Char;π  i    : Byte;πbeginπ  Help := '';π  Repeatπ    Ch := ReadKeySpin(40);π    if Ch <> #13 then Help := Help + Ch;π  Until Ch = #13;π  ReadStringSpin := Help;π  WriteLn;πend;ππVarπ  TestString : String;πbeginπ  TestString := ReadStringSpin;πend.π       9      06-08-9308:22ALL                      LOU DUCHEZ               Cursor Stuff in ASM      IMPORT              20     .]àÜ (*π===========================================================================π BBS: Canada Remote SystemsπDate: 05-28-93 (05:36)             Number: 8641πFrom: LOU DUCHEZ                   Refer#: NONEπ  To: KURT TAN                      Recvd: NOπSubj: CURSOR CONTROL                 Conf: (58) PASCALπ---------------------------------------------------------------------------πKT>Can someone tell me how to make the cursor in Turbo Pascal disappear andπKT>appear?ππWhah, sher, li'l pardner.  There is *no* function to turn off the cursorπper se in Pascal or among the BIOS interrupts.  However, you can changeπthe appearance of the cursor, making it span 0 pixels (as opposed to theπusual 2).  And to this purpose, I've included some of my favorite cursorπroutines, stored in a prize Unit of mine.ππTo define a cursor, you need to store the format in a word.  The standardπcursor for, say, CGA is $8786 (I think); the "6" and "7" say that theπcursor starts at pixel 7 and ends at pixel 6.  The eights mean that thereπare eight pixels to be messing with -- honestly that's a guess, I'veπnever seen it in a book anywhere.  For VGA and Hercules, I'm pretty sureπyou have 15 pixels to work with; the normal cursor there is something likeπ$fefc (something like that -- I'm working off CGA, so it's hard for me toπtest that theory).  In either case, no matter the graphics system, a goodπway to turn off the cursor is to set it to $ffff.π*)ππprocedure cursoff;πconst ffff: word = $ffff;ππ{ Turns the cursor off.  Stores its format for later redisplaying. }ππbeginπ  asmπ    mov ah, 03hπ    mov bh, 00hπ    int 10hπ    mov crstyp, cx   { global variable -- for later retrieval }π    mov ah, 01hπ    mov cx, ffffπ    int 10hπ    end;π  end;πππprocedure curson;ππ{ Turns the cursor back on, using the cursor display previously stored. }ππbeginπ  asmπ    mov ah, 01hπ    mov cx, crstyp   { previously-stored cursor format }π    int 10hπ    end;π  end;πππfunction getcursor: word;ππ{ Returns the cursor format. }ππvar tempword: word;πbeginπ  asmπ    mov ah, 03hπ    mov bh, 00hπ    int 10hπ    mov tempword,cxπ    end;π  getcursor := tempword;π  end;πππprocedure setcursor(curstype: word);ππ{ Sets the cursor format. }ππvar tempword: word;πbeginπ  tempword := curstype;π  asmπ    mov ah, 01hπ    mov cx,tempwordπ    int 10hπ    end;π  end;ππ                                                                                                   10     07-16-9306:05ALL                      SWAG SUPPORT TEAM        Cursor Manipulations     IMPORT              15     .]s╒ π{ unit to manipulate the text cursor }ππunit Cursor;ππINTERFACEππTYPEππ  PCursorRec = ^TCursorShape;π  TCursorShape = recordπ    Start : byte;π    Stop  : byte;π  end;ππprocedure GetCursorShape (var Shape : TCursorShape);π{ Sets the Start and Stop fields of Shape }ππprocedure CursorOff;π{ Turns the cursor off }ππprocedure NormCursorOn;π{ Turns underscore cursor on }ππprocedure BlockCursorOn;π{ Turns block cursor on }ππprocedure SetCursorShape (Shape : TCursorShape);π{ Set cursor shape with Start and Stop fields of Shape }ππIMPLEMENTATIONπVARπ   VideoMode : BYTE ABSOLUTE $0040 : $0049; { Video mode: Mono=7, Color=0-3 }ππprocedure GetCursorShape (var Shape : TCursorShape); assembler;π  asmπ    mov ah,$03π    mov bx,$00π    int $10π    les di,Shapeπ    mov TCursorShape (es:[di]).Start,ch    {es:[di] is Start field of Shape}π    mov TCursorShape (es:[di]).Stop,cl  {es:[di+1] is Stop field of Shape}π  end;ππprocedure SetCursorShape; assembler;π  asmπ    mov ah,$01             { Service 1, set cursor size }π    mov ch,Shape.Startπ    mov cl,Shape.Stopπ    int $10π  end;ππprocedure CursorOff;  assembler;π  asmπ    mov ah,$01π    mov ch,$20π    mov cl,$00π    int $10π  end;ππprocedure NormCursorOn;π  varπ    Shape : TCursorShape;π  beginπ    if VideoMode = 7 thenπ      beginπ        Shape.Start := $0A;π        Shape.Stop  := $0B;π      endπ    elseπ      beginπ        Shape.Start := $06;π        Shape.Stop  := $07;π      end;π    SetCursorShape (Shape);π  end;ππprocedure BlockCursorOn;π  varπ    Shape : TCursorShape;π  beginπ    if VideoMode = 7 thenπ      beginπ        Shape.Start := $02;π        Shape.Stop  := $0B;π      endπ    elseπ      beginπ        Shape.Start := $02;π        Shape.Stop  := $08;π      end;π    SetCursorShape (Shape);π  end;ππEND.                11     08-18-9312:24ALL                      JOSE ALMEIDA             Get Cursor Position      IMPORT              9      .]▒ { Gets the cursor position for each of the eight display pages.π  Part of the Heartware Toolkit v2.00 (HTcursor.PAS) for Turbo Pascal.π  Author: Jose Almeida. P.O.Box 4185. 1504 Lisboa Codex. Portugal.π          I can also be reached at RIME network, site ->TIB or #5314.π  Feel completely free to use this source code in any way you want, and, ifπ  you do, please don't forget to mention my name, and, give me and Swag theπ  proper credits. }ππPROCEDURE Get_Cursor_Position(Page : byte;π                        var Column,π                               Row : byte);π{ DESCRIPTION:π    Gets the cursor position for each of the eight display pages.π  SAMPLE CALL:π    Get_Cursor_Position(0,Col,Row);π  RETURNS:ππ  NOTES:π    Page value must be from 0 to 7 }ππBEGIN { Get_Cursor_Position }π  Column := Succ(Lo(MemW[$0000:$0450 + Page * 2]));π  Row := Succ(Hi(MemW[$0000:$0450 + Page * 2]));πEND; { Get_Cursor_Position }π                                                                                                         12     08-27-9320:34ALL                      BRIAN DHATT              GoToXY Replacment        IMPORT              22     .]äì {BRIAN DHATTππ> Does anyone have codes/source For replacing GotoXY Procedure?π}πAsmπ  MOV AH,$0F                   {To get active page, returns BH}π  INT $10π  MOV Page,BHπend;ππAsm                  {to find current cursor pos in form XX,YY}π  MOV AH,$3           {Equiv of XX:=WhereX, YY:=WhereY         }π  MOV BH,Pageπ  INT $10π  MOV YY,DHπ  MOV XX,DLπend;ππAsm                        {This block moves the cursor to           }π  MOV AH,$02               {XX,YY just like GotoXY(XX,YY)            }π  MOV BH,Pageπ  MOV DL,XXπ  MOV DH,YYπ  INT $10πend;ππ{πGREG ESTABROOKSππ>Can someone tell me how to make the cursor in Turbo Pascal disappear andπ>appear?π}ππProgram CursorDemo;              (*  May 27/93, Greg Estabrooks     *)πUsesπ  Crt;                        (*  For ReadKey, ClrScr.           *)πConstπ  (* Define Cursor Value to make chaning cursor easier *)π  NoCursor      = $2000;π  DefaultCursor = $0607;π  BlockCursor   = $000A;πVarπ  Curs : Word;                 (* Stores saved cursor value         *)π  Ch   : Char;ππProcedure SetCursor(Cursor : Word); Assembler;π                    (* Routine to change the shape of the cursor    *)πAsmπ  Mov AH,1                      (* Function to change cursor shape   *)π  Mov BH,0                      (* Set Page to 0                     *)π  Mov CX,Cursor                 (* Load new cursor Shape Value       *)π  Int $10                       (* Call Dos                          *)πend;{SetCursor}ππFunction GetCursor : Word; Assembler;π                   (* Routine to return Cursor Shape                 *)πAsmπ  Mov AH,3                      (* Function to return cursor shape   *)π  Mov BH,0                      (* Set Page to 0                     *)π  Int $10                       (* Call Dos                          *)π  Mov AX,CX                     (* Move Result to proper register    *)πend;{GetCursor}ππbeginπ  ClrScr;                       (* Clear the screen For demonstration*)π  Curs := GetCursor;            (* Save Current Cursor Value         *)π  Writeln('The Cursor is turned off');π  SetCursor( NoCursor );        (* Turn off the cursor               *)π  Ch := ReadKey;                (* Pause to show user new cursor     *)π  Writeln('The Cursor is a block shape');π  SetCursor( BlockCursor );     (*  Set the cursor to a block        *)π  Ch := ReadKey;π  Writeln('The Cursor is now the normal shape');π  SetCursor( DefaultCursor );   (* Set Default Cursor                *)π  Ch := ReadKey;ππ  SetCursor( Curs );            (* Restore cursor to previous style  *)πend.π                                                                                                                              13     08-27-9321:58ALL                      SEAN PALMER              Spinning Cursor          IMPORT              5      .]éÄ {πSEAN PALMERππThis is an example for the cursor I talked about to someone on here...π}ππprogram spinCursor;ππusesπ  crt;ππvarπ  cursorState : byte;  {0..3}π  i           : integer;ππconstπ  cursorData : array [0..3] of char = (#30, #17, #31, #16);ππprocedure updateCursor;πbeginπ  cursorState := succ(cursorState) and 3;π  write(cursorData[cursorState], ^H);πend;ππbeginπ  for i := 1 to 100 doπ  beginπ    gotoxy(1,1);π    updateCursor;π    gotoxy(1,41);π    delay(100);π  end;πend.π                            14     09-26-9308:49ALL                      MARTIN RICHARDSON        Turn cursor off (ASM)    IMPORT              5      .]"π {****************************************************************************π * Procedure ..... CsrOffπ * Purpose ....... To turn the cursor offπ * Parameters .... Noneπ * Returns ....... N/Aπ * Notes ......... Noneπ * Author ........ Martin Richardsonπ * Date .......... May 13, 1992π ****************************************************************************}πPROCEDURE CsrOff; ASSEMBLER;πASMπ       MOV  AH, 1π       MOV  CX, 1400hπ       INT  10hπEND;ππ                                                    15     09-26-9308:49ALL                      MARTIN RICHARDSON        Turn cursor on (ASM)     IMPORT              5      .]"
  3.  {****************************************************************************π * Procedure ..... CsrOnπ * Purpose ....... To turn the cursor onπ * Parameters .... Noneπ * Returns ....... N/Aπ * Notes ......... Noneπ * Author ........ Martin Richardsonπ * Date .......... May 13, 1992π ****************************************************************************}πPROCEDURE CsrOn; ASSEMBLER;πASMπ       MOV  AH, 1π       MOV  CX, 0607hπ       INT  10hπEND;ππ                                                       16     09-26-9309:27ALL                      MARTIN RICHARDSON        Set CURSOR Shape         IMPORT              6      .]"s {****************************************************************************π * Procedure ..... SetCursor()π * Purpose ....... To set the cursor shapeπ * Parameters .... nTop       Top line of cursorπ *                 nBottom    Bottom line of cursorπ * Returns ....... N/Aπ * Notes ......... Noneπ * Author ........ Martin Richardsonπ * Date .......... May 13, 1992π ****************************************************************************}πPROCEDURE SetCursor( nTop, nBottom : INTEGER ); ASSEMBLER;πASMπ     MOV  AH, 1π     MOV  CH, BYTE PTR nTopπ     MOV  CL, BYTE PTR nBottomπ     INT  10hπEND;ππ                                  17     10-28-9311:29ALL                      LIM FUNG                 CURSOR Control           IMPORT              28     .]\- {===========================================================================πDate: 08-27-93 (14:17)πFrom: LIM FUNGπSubj: cursor controlππWD>Hi All,πWD>   Hey, someone put a couple of little proc. on here which control theπWD>cursor (turn it on/off) and they were written in assembler.  I had aπWD>brain fade and forgot to save the name of the person who created theseπWD>routines.  I was wondering if they might know how to get a big cursorπWD>also using assembler.  Also, do they work on monochrome monitors, or wasπWD>that what you meant about the 8x8 scan lines?ππOkay, a simple procedure to turn on and off the cursor would be asπfollows: }πππUses DOS;ππProcedure CursorOn;πBeginπ        asmπ                mov        ax,0100hπ                mov        cx,0607hπ                int        10hπ        end;πend;ππProcedure CursorOff;πBeginπ        asmπ                mov        ax,0100hπ                mov        cx,2020hπ                int        10hπ        end;πend;ππend.ππ===========================================================================π BBS: Canada Remote SystemsπDate: 10-23-93 (07:59)             Number: 9355πFrom: LOU DUCHEZ                   Refer#: NONEπ  To: JESSE MACGREGOR               Recvd: NO  πSubj: help                           Conf: (1617) L-Pascalπ---------------------------------------------------------------------------πJM>I need help I need a function that when I give it a screen coordianteπJM>and it returns the charachter at that coordinate on a text screenπJM>(80x25) and possibly the color...ππTry this:ππ-------------------------------------------------------------------------------ππtype  videolocation = record                  { video memory locations }π          videodata: char;                    { character displayed }π          videoattribute: byte;               { attributes }π          end;ππ---------------ππprocedure getvideodata(x, y: byte; var result: videolocation);ππ{ Returns the attribute byte of a video character. }ππvar vidptr: ^videolocation;πbeginπ  if memw[$0040:$0049] = 7 then vidptr := ptr($b000, 2*(80*(y-1) + (x-1)))π                           else vidptr := ptr($b800, 2*(80*(y-1) + (x-1)));π  result := vidptr^;π  end;ππ-------------------------------------------------------------------------------πππJM>also, a procedure to make that ickyπJM>cursor go away would be greatly appreciated...ππThere's not really a procedure to make it "go away", just to change it.πYou CAN change it so that it's undisplayable, but you'll want to storeπthe previous config first.  Like so:ππ-------------------------------------------------------------------------------ππvar crstyp: word;ππ---------------ππprocedure cursoff;πconst ffff: word = $ffff;ππ{ Turns the cursor off.  Stores its format for later redisplaying. }ππbeginπ  asmπ    mov ah, 03hπ    mov bh, 00hπ    int 10hπ    mov crstyp, cxπ    mov ah, 01hπ    mov cx, ffffπ    int 10hπ    end;π  end;ππ---------------ππprocedure curson;ππ{ Turns the cursor back on, using the cursor display previously stored. }ππbeginπ  asmπ    mov ah, 01hπ    mov cx, crstypπ    int 10hπ    end;π  end;ππ-------------------------------------------------------------------------------ππHow's that, o evil masters?π---π ■ KingQWK 1.05 # 182 ■ "Bob" -- the Doc Savage of holy menπ ■ RoseMail 2.10ß: ILink: PC-Ohio * Cleveland, OH * 216-381-3320π                                                                                                   18     11-02-9305:29ALL                      JEFF HLYWA               ASM Cursor Position      IMPORT              11     .]
  4. ∙ {πJEFF HLYWAππ> One more thing, how could I reWrite the GotoXY command For useπ> through the comport?ππOk.. if you are using the Fossil Driver routines you can do this.π}ππProcedure SetCursorPos(XPos, Ypos : Byte); Assembler;πAsmπ  SUB  XPos, 1     { Subtract 1 from X Position }π  SUB  YPos, 1          { Subtract 1 from Y Position }π  MOV  AH, $11π  MOV  DH, YPosπ  MOV  DL, XPosπ  INT  14hπend;ππ{ We subtracted 1 from both the X Position and Y Position because when youπuse the SetCursorPos the orgin ( upper left hand corner ) coordinates areπ0,0. Using the GotoXY the orgin coordinates are 1,1.  For example : if weπwanted to GotoXY (40,12) using the SetCursorPos Without the subtractionπcommands the cursor would be located at (41,13).  Pretty simple }ππ{ The follow Procedure gets the current cusor postion }ππProcedure GetCursorPos;π{ Returns then X Coordinate and Y Coordinate (almost like WhereX and WhereY).πYou must define X and Y as an Integer or Byte in the Var section of yourπProgram }πVarπ  XCord,π  YCord : Byte;      { Use temporary coordinates }πbeginπ  Asmπ    MOV  AH, $12π    INT  14hπ    MOV  YCord, DHπ    MOV  XCord, DLπ    ADD  YCord, 1  { Add 1 to the Y Coordinate }π  end;π  X := XCord;         { Set X and Y }π  Y := YCord;πend;ππ                               19     11-02-9317:47ALL                      JON JASIUNAS             Very GOOD Cursor Unit    IMPORT              38     .]▌ {πFrom: JON JASIUNASπSubj: Cursor StuffππHere's a bit of code that will hide / unhide the cursor, without usingπassembler: }ππusesπ  Dos;ππvarπ  R: Registers;ππprocedure HideCursor;πbegin   { HideCursor }π  R.AH := $03;    {- Current cursor status }π  Intr($10, R);π  R.AH := $01;    {- Set cursor }π  R.CH := R.Ch or $20;π  Intr($10, R);πend;    { HideCursor }ππprocedure ShowCursor;πbegin   { ShowCursor }π  R.AH := $03;π  Intr($10, R);π  R.AH := $01;π  R.CH := R.CH and $1F;π  Intr($10, R);πend;    { ShowCursor }ππ{ However, if you want to use assembler, you can, and you don't need theπ  DOS unit.  Here's my Cursor modification unit (in assembler), if you'reπ  interested. }ππ{****************************π *     CURSOR.PAS v1.0      *π *                          *π *  General purpose cursor  *π *  manipulation routines   *π ****************************ππ1992-93 - HyperDrive SoftwareπReleased into the Public Domain.}ππ{$S-,R-,D-}π{$IFOPT O+}π  {$F+}π{$ENDIF}ππunit Cursor;ππ{\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\}π                                   interfaceπ{/////////////////////////////////////////////////////////////////////////////}ππconstπ  csLine  = $01;π  csHalf  = $02;π  csBlock = $03;ππprocedure DefineCursor(Size: Byte);πprocedure GotoXy(X, Y: Byte);πprocedure RestoreCursor;πprocedure HideCursor;πprocedure ShowCursor;πfunction  CursorHidden: Boolean;ππ{\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\}π                                 implementationπ{/////////////////////////////////////////////////////////////////////////////}ππvarπ  dcStart, dcEnd: Byte;ππ{=============================================================================}ππprocedure DefineCursor(Size: Byte);  ASSEMBLER;πasm     { DefineCursor }π  mov   AH, $0Fπ  int   $10π  cmp   AL, $07π  jne   @Colorππ@Mono:π  mov   AH, $03π  int   $10π  cmp   Size, csLineπ  je    @MonoLπ  cmp   Size, csHalfπ  je    @MonoHπ  cmp   Size, csBlockπ  je    @MonoBπ@MonoL:π  mov   CH, $0Cπ  jmp   @MonoDoneπ@MonoH:π  mov   CH, $07π  jmp   @MonoDoneπ@MonoB:π  mov   CH, $00π@MonoDone:π  mov   CL, $0Dπ  jmp   @Doneππ@Color:π  mov   AH, $03π  int   $10π  cmp   Size, csLineπ  je    @ColorLπ  cmp   Size, csHalfπ  je    @ColorHπ  cmp   Size, csBlockπ  je    @ColorBπ@ColorL:π  mov   CH, $06π  jmp   @ColorDoneπ@ColorH:π  mov   CH, $04π  jmp   @ColorDoneπ@ColorB:π  mov   CH, $00π@ColorDone:π  mov   CL, $07ππ@Done:π  mov   AH, $01π  int   $10πend;    { DefineCursor }ππ{-----------------------------------------------------------------------------}ππprocedure GotoXy(X, Y: Byte);  ASSEMBLER;πasm     { GotoXy }π  mov   AH, $0Fπ  int   $10π  mov   AH, $02π  dec   Yπ  mov   DH, Yπ  dec   Xπ  mov   DL, Xπ  int   $10πend;    { GotoXy }ππ{-----------------------------------------------------------------------------}ππprocedure RestoreCursor;  ASSEMBLER;πasm     { RestoreCursor }π  mov   AH, $01π  mov   CH, dcStartπ  mov   CL, dcEndπ  int   $10πend;    { RestoreCursor }ππ{-----------------------------------------------------------------------------}ππprocedure HideCursor;  ASSEMBLER;πasm     { HideCursor }π  mov   AH, $03π  int   $10π  mov   AH, $01π  or    CH, $20π  int   $10πend;    { HideCursor }ππ{-----------------------------------------------------------------------------}ππprocedure ShowCursor;  ASSEMBLER;πasm     { ShowCursor }π  mov   AH, $03π  int   $10π  mov   AH, $01π  and   CH, $1Fπ  int   $10πend;    { ShowCursor }ππ{-----------------------------------------------------------------------------}ππfunction  CursorHidden: Boolean; ASSEMBLER;πasm     { CursorHidden }ππ  mov   AH, $03π  int   $10π  cmp   CH, $20π  je    @Hiddenπ  mov   AL, $00π  jmp   @Endπ@Hidden:π  mov   AL, $01;π@End:πend;    { CursorHidden }ππ{-----------------------------------------------------------------------------}π                                {** PRIVATE **}π{-----------------------------------------------------------------------------}ππprocedure SaveCursor;  ASSEMBLER;πasm     { SaveCursor }π  mov   AH, $03π  int   $10π  mov   dcStart, CHπ  mov   dcEnd, CLπend;    { SaveCursor }ππ{=============================================================================}π{$F+}ππvarπ  OldExitProc: Pointer;ππprocedure NewExitProc;πbeginπ  ExitProc := OldExitProc;π  RestoreCursor;               {- Restore startup cursor mode }πend;    { NewExitProc }ππ{$F-}π{=============================================================================}ππbegin   { Cursor }π  OldExitProc := ExitProc;π  ExitProc    := @NewExitProc;π  SaveCursor;                  {- Save startup cursor mode }πend.    { Cursor }π                                                                                            20     05-25-9408:03ALL                      GREG ESTABROOKS          cursor size attributes   SWAG9405            19     .]± π{π One way to do it is to change the cursor size attributes. Here are someπ routines I use and a little demo program I wrote for another user aπ while back(Gosh almost a year now<g>). Also if your doing a lot ofπ screen writing and either don't want the cursor to move or not beπ visible at all you might want to try looking into direct video memoryπ writes.π}ππPROGRAM CursorDemo;              (*  May 27/93, Greg Estabrooks     *)πUSES CRT;                        (*  For Readkey, Clrscr.           *)πCONSTπ     (* Define Cursor Value to make chaning cursor easier *)π    NoCursor      = $2000;π    DefaultCursor = $0607;π    BlockCursor   = $000A;πVARπ    Curs :WORD;                 (* Stores saved cursor value         *)π    Ch   :CHAR;ππPROCEDURE SetCursor( Cursor :WORD ); ASSEMBLER;π                     (* Routine to change the shape of the cursor    *)πASMπ  Mov AH,1                      (* Function to change cursor shape   *)π  Mov BH,0                      (* Set Page to 0                     *)π  Mov CX,Cursor                 (* Load new cursor Shape Value       *)π  Int $10                       (* Call Dos                          *)πEND;{SetCursor}ππFUNCTION GetCursor :WORD; ASSEMBLER;π                   (* Routine to return Cursor Shape                 *)πASMπ  Mov AH,3                      (* Function to return cursor shape   *)π  Mov BH,0                      (* Set Page to 0                     *)π  Int $10                       (* Call Dos                          *)π  Mov AX,CX                     (* Move Result to proper register    *)πEND;{GetCursor}ππBEGINπ  Clrscr;                       (* Clear the screen for demonstration*)π  Curs := GetCursor;            (* Save Current Cursor Value         *)π  Writeln('The Cursor is turned off');π  SetCursor( NoCursor );        (* Turn off the cursor               *)π  Ch := Readkey;                (* Pause to show user new cursor     *)π  Writeln('The Cursor is a block shape');π  SetCursor( BlockCursor );     (*  Set the cursor to a block        *)π  Ch := Readkey;π  Writeln('The Cursor is now the normal shape');π  SetCursor( DefaultCursor );   (* Set Default Cursor                *)π  Ch := Readkey;ππ  SetCursor( Curs );            (* Restore cursor to previous style  *)πEND.π                               21     05-25-9408:03ALL                      SEAN PALMER              Better Cursor Control    SWAG9405            9      .]P≈ {πA much better more reliable method is just to set the CURRENT cursor's bitπ5 to disable it, then mask it back off again...π}πunit cursor; {Public domain, by Sean Palmer}ππinterfaceππvar maxSize:byte;ππ procedure cursorOn;π procedure cursorOff;π procedure setSize(scans:byte);  {set size from bottom, or 0 for off}π procedure detect;     {get max scan lines by reading current cursor}ππimplementationππprocedure cursorOn;assembler;asmπ mov ah,3; mov bh,0; int $10; and ch,not $20; mov ah,1; int $10;π end;ππprocedure cursorOff;assembler;asmπ mov ah,3; mov bh,0; int $10; or ch,$20; mov ah,1; int $10;π end;ππprocedure setSize(scans:byte);var t:byte;beginπ if scans=0 then t:=$20 else t:=maxSize-scans;π asm mov ah,1; mov bh,0; mov ch,t; mov cl,maxSize; dec cl; int $10; end;π end;ππ{call whenever you change text cell height}πprocedure detect;assembler;asm  {do NOT call while cursor's hidden}π mov ah,3; mov bh,0; int $10; inc cl; mov maxSize,cl;π end;ππbeginπ detect;π end.π                                               22     05-25-9408:10ALL                      LOU DUCHEZ               cursor hiding            SWAG9405            5      .]4% πvar crstyp: word;ππprocedure cursoff;ππ{ Turns the cursor off.  Stores its format for later redisplaying. }ππbeginπ  asmπ    mov ah, 03hπ    mov bh, 00hπ    int 10hπ    mov crstyp, cxπ    mov ah, 01hπ    mov cx, 65535π    int 10hπ    end;π  end;ππprocedure curson;ππ{ Turns the cursor back on, using the cursor display previously stored. }ππbeginπ  asmπ    mov ah, 01hπ    mov cx, crstypπ    int 10hπ    end;π  end;ππ