Browse Source

* several i8086 fixes for 'data element too large' errors

git-svn-id: trunk@25532 -
nickysn 12 years ago
parent
commit
4d86d44e38
2 changed files with 24 additions and 24 deletions
  1. 4 4
      packages/graph/src/inc/graph.inc
  2. 20 20
      packages/graph/src/inc/graphh.inc

+ 4 - 4
packages/graph/src/inc/graph.inc

@@ -47,7 +47,7 @@ const
    StdBufferSize = 4096;   { Buffer size for FloodFill }
 
 type
-  tinttable = array[0..16383] of smallint;
+  tinttable = array[0..16382] of smallint;
   pinttable = ^tinttable;
 
   WordArray = Array [0..StdbufferSize] Of word;
@@ -1110,7 +1110,7 @@ end;
 
 Procedure DefaultPutImage(X,Y: smallint; var Bitmap; BitBlt: Word); {$ifndef fpc}far;{$endif fpc}
 type
-  pt = array[0..$fffffff] of word;
+  pt = array[0..{$ifdef cpu16}16382{$else}$fffffff{$endif}] of word;
   ptw = array[0..2] of longint;
 var
   k: longint;
@@ -1176,7 +1176,7 @@ end;
 
 Procedure DefaultGetImage(X1,Y1,X2,Y2: smallint; Var Bitmap); {$ifndef fpc}far;{$endif fpc}
 type
-  pt = array[0..$fffffff] of word;
+  pt = array[0..{$ifdef cpu16}16382{$else}$fffffff{$endif}] of word;
   ptw = array[0..2] of longint;
 var
   i,j: smallint;
@@ -1906,7 +1906,7 @@ end;
   procedure DrawPoly(numpoints : word;var polypoints);
     type
       ppointtype = ^pointtype;
-      pt = array[0..16000] of pointtype;
+      pt = array[0..8190] of pointtype;
     var
       i, j, LastPolygonStart: longint;
       Closing: boolean;

+ 20 - 20
packages/graph/src/inc/graphh.inc

@@ -191,7 +191,7 @@ type
 {$endif}
 
     TResolutionRec = record
-      x,y: longint;
+      x,y: {$ifdef cpu16}smallint{$else}longint{$endif};
     end;
 
     const
@@ -388,25 +388,25 @@ type
        { consecutive mode number for that, so they are generated on-the-fly }
        { starting from 1)                                                   }
 
-       detectMode = 30000;
-       m320x200 = 30001;
-       m320x256 = 30002; { amiga resolution (PAL) }
-       m320x400 = 30003; { amiga/atari resolution }
-       m512x384 = 30004; { mac resolution }
-       m640x200 = 30005; { vga resolution }
-       m640x256 = 30006; { amiga resolution (PAL) }
-       m640x350 = 30007; { vga resolution }
-       m640x400 = 30008;
-       m640x480 = 30009;
-       m800x600 = 30010;
-       m832x624 = 30011; { mac resolution }
-       m1024x768 = 30012;
-       m1280x1024 = 30013;
-       m1600x1200 = 30014;
-       m2048x1536 = 30015;
-
-       lowNewMode = 30001;
-       highNewMode = 30015;
+       detectMode = {$ifdef cpu16}3000{$else}30000{$endif};
+       m320x200   = detectMode +  1;
+       m320x256   = detectMode +  2; { amiga resolution (PAL) }
+       m320x400   = detectMode +  3; { amiga/atari resolution }
+       m512x384   = detectMode +  4; { mac resolution }
+       m640x200   = detectMode +  5; { vga resolution }
+       m640x256   = detectMode +  6; { amiga resolution (PAL) }
+       m640x350   = detectMode +  7; { vga resolution }
+       m640x400   = detectMode +  8;
+       m640x480   = detectMode +  9;
+       m800x600   = detectMode + 10;
+       m832x624   = detectMode + 11; { mac resolution }
+       m1024x768  = detectMode + 12;
+       m1280x1024 = detectMode + 13;
+       m1600x1200 = detectMode + 14;
+       m2048x1536 = detectMode + 15;
+
+       lowNewMode = m320x200;
+       highNewMode = m2048x1536;
 
        resolutions: array[lowNewMode..highNewMode] of TResolutionRec =
        ((x:320;y:200),