Browse Source

* perform the clipping before initializing ES in PutPixel320, so it runs faster
when the pixel happens to be outside the viewport

git-svn-id: trunk@41005 -

nickysn 6 years ago
parent
commit
a854411e7c
1 changed files with 7 additions and 7 deletions
  1. 7 7
      packages/graph/src/msdos/graph.pp

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

@@ -2236,13 +2236,6 @@ End;
 {$else asmgraph}
  Procedure PutPixel320(X,Y : smallint; Pixel: ColorType); assembler;
   asm
-{$ifdef FPC_MM_HUGE}
-    mov    ax, SEG SegA000
-    mov    es, ax
-    mov    es, es:[SegA000]
-{$else FPC_MM_HUGE}
-    mov    es, [SegA000]
-{$endif FPC_MM_HUGE}
     mov    ax, [Y]
     mov    di, [X]
     cmp    byte ptr [ClipPixels], 0
@@ -2258,6 +2251,13 @@ End;
     jg     @@Done
 
 @@ClipDone:
+{$ifdef FPC_MM_HUGE}
+    mov    bx, SEG SegA000
+    mov    es, bx
+    mov    es, es:[SegA000]
+{$else FPC_MM_HUGE}
+    mov    es, [SegA000]
+{$endif FPC_MM_HUGE}
     add    ax, [StartYViewPort]
     add    di, [StartXViewPort]
     xchg   ah, al            { The value of Y must be in AH }