Browse Source

* fixed the go32v2 mouse unit for 40 column modes

git-svn-id: trunk@29072 -
nickysn 10 years ago
parent
commit
537902c2fe
1 changed files with 12 additions and 1 deletions
  1. 12 1
      packages/rtl-console/src/go32v2/mouse.pp

+ 12 - 1
packages/rtl-console/src/go32v2/mouse.pp

@@ -101,6 +101,10 @@ asm
         movw    %dx,mousewherey
         movw    %dx,mousewherey
         shrw    $3,%cx
         shrw    $3,%cx
         shrw    $3,%dx
         shrw    $3,%dx
+        cmpw    $40,ScreenWidth
+        jne     .Lmorethan40cols
+        shrw    $1,%cx
+.Lmorethan40cols:
         { should we draw the mouse cursor? }
         { should we draw the mouse cursor? }
         cmpb    $0,drawmousecursor
         cmpb    $0,drawmousecursor
         je      .Lmouse_nocursor
         je      .Lmouse_nocursor
@@ -643,6 +647,10 @@ asm
         popl    %ebp
         popl    %ebp
         movzwl  %cx,%eax
         movzwl  %cx,%eax
         shrl    $3,%eax
         shrl    $3,%eax
+        cmpw    $40,ScreenWidth
+        jne     .Lmorethan40cols
+        shrl    $1,%eax
+.Lmorethan40cols:
         incl    %eax
         incl    %eax
         jmp .Lexit
         jmp .Lexit
 .LGetMouseXError:
 .LGetMouseXError:
@@ -738,7 +746,10 @@ procedure DoCustomMouse(b : boolean);
      CustomMouse_HideCount:=1;
      CustomMouse_HideCount:=1;
      oldmousex:=-1;
      oldmousex:=-1;
      oldmousey:=-1;
      oldmousey:=-1;
-     SetMouseXRange(0,(screenwidth-1)*8);
+     if ScreenWidth=40 then
+       SetMouseXRange(0,(screenwidth-1)*16)
+     else
+       SetMouseXRange(0,(screenwidth-1)*8);
      SetMouseYRange(0,(screenheight-1)*8);
      SetMouseYRange(0,(screenheight-1)*8);
      if b then
      if b then
        begin
        begin