Browse Source

* use only 8086/8088 compatible instructions in DirectPutPixelX

git-svn-id: trunk@41051 -
nickysn 6 years ago
parent
commit
126bf988a4
1 changed files with 8 additions and 5 deletions
  1. 8 5
      packages/graph/src/msdos/graph.pp

+ 8 - 5
packages/graph/src/msdos/graph.pp

@@ -2695,17 +2695,20 @@ const CrtAddress: word = 0;
  Procedure DirectPutPixelX(X,Y: smallint); assembler;
  Procedure DirectPutPixelX(X,Y: smallint); assembler;
  { note: still needs or/and/notput support !!!!! (JM) }
  { note: still needs or/and/notput support !!!!! (JM) }
  asm
  asm
-   mov cx, [X]
-   mov ax, cx
    mov di, [Y]                   ; (* DI = Y coordinate                 *)
    mov di, [Y]                   ; (* DI = Y coordinate                 *)
  (* Multiply by 80 start *)
  (* Multiply by 80 start *)
+   mov cl, 4
+   shl di, cl
    mov bx, di
    mov bx, di
-   shl di, 6                    ; (* Faster on 286/386/486 machines    *)
-   shl bx, 4
+   shl di, 1
+   shl di, 1
    add di, bx                   ;  (* Multiply Value by 80             *)
    add di, bx                   ;  (* Multiply Value by 80             *)
  (* End multiply by 80  *)
  (* End multiply by 80  *)
+   mov cx, [X]
+   mov ax, cx
   {DI = Y * LINESIZE, BX = X, coordinates admissible}
   {DI = Y * LINESIZE, BX = X, coordinates admissible}
-   shr ax, 2
+   shr ax, 1
+   shr ax, 1
    add di, ax                ; {DI = Y * LINESIZE + (X SHR 2) }
    add di, ax                ; {DI = Y * LINESIZE + (X SHR 2) }
    add di, [VideoOfs]        ; (* Pointing at start of Active page *)
    add di, [VideoOfs]        ; (* Pointing at start of Active page *)
  (* Select plane to use *)
  (* Select plane to use *)