Browse Source

* custommouse define removed, i.e. code is always active
* the xor value for the mouse cursor must be $7f instead of $ff

florian 25 years ago
parent
commit
674c5c53c2
4 changed files with 33 additions and 63 deletions
  1. 15 49
      api/go32v2/mouse.inc
  2. 6 4
      api/go32v2/vesamode.pas
  3. 6 6
      api/go32v2/video.inc
  4. 6 4
      api/inc/mouse.pas

+ 15 - 49
api/go32v2/mouse.inc

@@ -5,10 +5,7 @@
 }
 
 uses
-{$ifdef custommouse}
-  video,
-{$endif custommouse}
-  go32;
+  video,go32;
 
 var
   RealSeg : Word;                                    { Real mode segment }
@@ -32,7 +29,6 @@ const
   MouseError   : longint = 0;
   CallCounter  : longint = 0;
 {$endif DEBUG}
-{$ifdef custommouse}
   drawmousecursor : boolean = false;
   mouseisvisible : boolean = false;
   { position where the mouse was drawn the last time }
@@ -57,7 +53,6 @@ procedure unlockmouse;
   begin
      mouselock:=false;
   end;
-{$endif custommouse}
 
 
 {$ASMMODE ATT}
@@ -68,7 +63,6 @@ asm
         movw    %dx,mousewherey
         shrw    $3,%cx
         shrw    $3,%dx
-{$ifdef custommouse}
         { should we draw the mouse cursor? }
         cmpb    $0,drawmousecursor
         je      .Lmouse_nocursor
@@ -80,7 +74,7 @@ asm
         { check lock }
         movb    $1,%al
         xchgb   mouselock,%al
-        orl     %al,%al
+        orb     %al,%al
         { don't update the cursor yet, because hide/showcursor is called }
         jne    .Ldont_draw
 
@@ -90,12 +84,12 @@ asm
         movw    dosmemselector,%fs
 
         { calculate address of old mouse cursor }
-        movzwl  oldmousey,%eax
+        movl    oldmousey,%eax
         imulw   screenwidth,%ax
-        addw    oldmousex,%ax
+        addl    oldmousex,%eax
         leal    1(%edi,%eax,2),%eax
         { remove old cursor }
-        xorb    $0xff,%fs:(%eax)
+        xorb    $0x7f,%fs:(%eax)
 
         { store position of old cursor }
         movw    %cx,oldmousex
@@ -107,7 +101,7 @@ asm
         addw    %cx,%ax
         leal    1(%edi,%eax,2),%eax
         { draw new cursor }
-        xorb    $0xff,%fs:(%eax)
+        xorb    $0x7f,%fs:(%eax)
 
         { unlock mouse }
         movb    $0,mouselock
@@ -117,7 +111,6 @@ asm
         popl    %eax
         popw    %fs
 .Lmouse_nocursor:
-{$endif custommouse}
         cmpb    MouseEventBufSize,PendingMouseEvents
         je      .Lmouse_exit
         movl    PendingMouseTail,%edi
@@ -145,7 +138,7 @@ ASM
    PUSH %DS;                                          { Save DS register }
    PUSHL %EDI;                                        { Save register }
    PUSHL %ESI;                                        { Save register }
-   ;{ caution : ds is not the selector for our data !! }
+   { ; caution : ds is not the selector for our data !! }
 {$ifdef DEBUG}
    MOVL  %EDI,%ES:EntryEDI
    MOVL  %ESI,%ES:EntryESI
@@ -363,12 +356,10 @@ begin
     end;
   If MouseCallBack=Nil then
     Mouse_Action($ffff, @MouseInt);                    { Set masks/interrupt }
-{$ifdef custommouse}
   drawmousecursor:=false;
   mouseisvisible:=false;
   if (screenwidth>80) or (screenheight>50) then
     DoCustomMouse(true);
-{$endif custommouse}
   ShowMouse;
 end;
 
@@ -401,7 +392,7 @@ end;
 
 
 procedure ShowMouse;
-{$ifdef custommouse}
+
 begin
    if drawmousecursor then
      begin
@@ -411,7 +402,7 @@ begin
              oldmousex:=getmousex-1;
              oldmousey:=getmousey-1;
              mem[videoseg:(((screenwidth*oldmousey)+oldmousex)*2)+1]:=
-               mem[videoseg:(((screenwidth*oldmousey)+oldmousex)*2)+1] xor $ff;
+               mem[videoseg:(((screenwidth*oldmousey)+oldmousex)*2)+1] xor $7f;
              mouseisvisible:=true;
           end;
         unlockmouse;
@@ -427,22 +418,9 @@ begin
      .LShowMouseExit:
      end;
 end;
-{$else custommouse}
-assembler;
-asm
-        cmpb    $1,MousePresent
-        jne     .LShowMouseExit
-        movl    $1,%eax
-        pushl   %ebp
-        int     $0x33
-        popl    %ebp
-.LShowMouseExit:
-end;
-{$endif custommouse}
 
 
 procedure HideMouse;
-{$ifdef custommouse}
 
 begin
    if drawmousecursor then
@@ -452,7 +430,7 @@ begin
           begin
              mouseisvisible:=false;
              mem[videoseg:(((screenwidth*oldmousey)+oldmousex)*2)+1]:=
-               mem[videoseg:(((screenwidth*oldmousey)+oldmousex)*2)+1] xor $ff;
+               mem[videoseg:(((screenwidth*oldmousey)+oldmousex)*2)+1] xor $7f;
              oldmousex:=-1;
              oldmousey:=-1;
           end;
@@ -469,18 +447,6 @@ begin
      .LHideMouseExit:
      end;
 end;
-{$else custommouse}
-assembler;
-asm
-        cmpb    $1,MousePresent
-        jne     .LHideMouseExit
-        movl    $2,%eax
-        pushl   %ebp
-        int     $0x33
-        popl    %ebp
-.LHideMouseExit:
-end;
-{$endif custommouse}
 
 
 function GetMouseX:word;assembler;
@@ -545,8 +511,6 @@ asm
 .LSetMouseXYExit:
 end;
 
-{$ifdef custommouse}
-
 Procedure SetMouseXRange (Min,Max:Longint);
 begin
   If Not(MousePresent) Then Exit;
@@ -592,8 +556,6 @@ procedure DoCustomMouse(b : boolean);
      unlockmouse;
   end;
 
-{$endif custommouse}
-
 const
   LastCallcounter : longint = 0;
 
@@ -644,7 +606,11 @@ end;
 
 {
   $Log$
-  Revision 1.2  2000-02-06 14:29:45  florian
+  Revision 1.3  2000-02-07 22:54:44  florian
+    * custommouse define removed, i.e. code is always active
+    * the xor value for the mouse cursor must be $7f instead of $ff
+
+  Revision 1.2  2000/02/06 14:29:45  florian
     * mouse support for vesa resolutions under go32v2, needs currently the define
       custommouse
 

+ 6 - 4
api/go32v2/vesamode.pas

@@ -91,9 +91,7 @@ unit vesamode;
               mem[$40:$4a]:=ScreenWidth;
               memw[$40:$4c]:=ScreenHeight*((ScreenWidth shl 1)-1);
               }
-{$ifdef custommouse}
               DoCustomMouse(true);
-{$endif custommouse}
            end;
       end;
 
@@ -134,7 +132,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.2  2000-02-06 14:29:45  florian
+  Revision 1.3  2000-02-07 22:54:44  florian
+    * custommouse define removed, i.e. code is always active
+    * the xor value for the mouse cursor must be $7f instead of $ff
+
+  Revision 1.2  2000/02/06 14:29:45  florian
     * mouse support for vesa resolutions under go32v2, needs currently the define
       custommouse
 
@@ -155,4 +157,4 @@ end.
   Revision 1.1  1999/03/13 17:29:39  florian
     + first implementation for VESA 1.x, only standard modes are supported
 
-}
+}

+ 6 - 6
api/go32v2/video.inc

@@ -179,9 +179,7 @@ begin
   regs.bx:=wordrec(Params).hi;
   realintr($10,regs);
   defaultvideomodeselector:=true;
-{$ifdef custommouse}
   DoCustomMouse(false);
-{$endif custommouse}
 end;
 
 function VideoModeSelector8x8(const VideoMode: TVideoMode; Params: Longint): Boolean;
@@ -202,9 +200,7 @@ begin
   ScreenColor:=true;
   ScreenWidth:=80;
   ScreenHeight:=50;
-{$ifdef custommouse}
   DoCustomMouse(false);
-{$endif custommouse}
 end;
 
 procedure ClearScreen;
@@ -270,7 +266,11 @@ end;
 
 {
   $Log$
-  Revision 1.2  2000-02-06 14:29:45  florian
+  Revision 1.3  2000-02-07 22:54:44  florian
+    * custommouse define removed, i.e. code is always active
+    * the xor value for the mouse cursor must be $7f instead of $ff
+
+  Revision 1.2  2000/02/06 14:29:45  florian
     * mouse support for vesa resolutions under go32v2, needs currently the define
       custommouse
 
@@ -340,4 +340,4 @@ end;
   Revision 1.1  1998/10/26 11:31:47  peter
     + inital include files
 
-}
+}

+ 6 - 4
api/inc/mouse.pas

@@ -111,10 +111,8 @@ function PollMouseEvent(var MouseEvent: TMouseEvent):boolean;
   event is pending, it returns 0 }
 
 {$ifdef go32v2}
-{$ifdef custommouse}
 { tells the mouse unit to draw the mouse cursor itself }
 procedure DoCustomMouse(b : boolean);
-{$endif custommouse}
 {$endif go32v2}
 
 implementation
@@ -143,7 +141,11 @@ end;
 end.
 {
   $Log$
-  Revision 1.2  2000-02-06 14:28:19  florian
+  Revision 1.3  2000-02-07 22:54:44  florian
+    * custommouse define removed, i.e. code is always active
+    * the xor value for the mouse cursor must be $7f instead of $ff
+
+  Revision 1.2  2000/02/06 14:28:19  florian
     * mouse support for vesa resolutions under go32v2, needs currently the define
       custommouse
 
@@ -181,4 +183,4 @@ end.
     + mouse
     + video.clearscreen, video.videobufsize
 
-}
+}