Browse Source

* optimizations in PutPixel16 that remove the slow 'mul' instruction

git-svn-id: trunk@40998 -
nickysn 6 years ago
parent
commit
83766c7462
1 changed files with 7 additions and 4 deletions
  1. 7 4
      packages/graph/src/msdos/graph.pp

+ 7 - 4
packages/graph/src/msdos/graph.pp

@@ -1629,11 +1629,14 @@ end;
         mov  cl, 3
         mov  cl, 3
         shr  si, cl
         shr  si, cl
         { determine the address }
         { determine the address }
-        mov  ax,80
         mov  bx,[Y]
         mov  bx,[Y]
-        mul  bx
-        add  ax,si
-        mov  di,ax
+        inc  cx               { CL=4 }
+        shl  bx, cl
+        mov  di, bx
+        shl  di, 1
+        shl  di, 1
+        add  di, bx
+        add  di, si
         add  di, [VideoOfs]
         add  di, [VideoOfs]
         { send the data through the display memory through set/reset }
         { send the data through the display memory through set/reset }
         mov  bl,es:[di]
         mov  bl,es:[di]