Browse Source

+ hlinevesa256 and vlinevesa256
+ support for not/xor/or/andput in vesamodes with 32k/64k colors
* lots of changes to avoid warnings under FPC

Jonas Maebe 26 years ago
parent
commit
4e43bad546
6 changed files with 652 additions and 124 deletions
  1. 10 5
      rtl/inc/graph/clip.inc
  2. 8 3
      rtl/inc/graph/fills.inc
  3. 59 34
      rtl/inc/graph/graph.inc
  4. 40 36
      rtl/inc/graph/graph.pp
  5. 7 2
      rtl/inc/graph/modes.inc
  6. 528 44
      rtl/inc/graph/vesa.inc

+ 10 - 5
rtl/inc/graph/clip.inc

@@ -104,25 +104,25 @@ const
              code:=code1;
              code:=code1;
             if (code and LEFT) <> 0 then
             if (code and LEFT) <> 0 then
               begin
               begin
-                newy:=y1+trunc((y2-y1)*(xmin-x1)/(x2-x1));
+                newy:=y1+(y2-y1)*(xmin-x1) div (x2-x1);
                 newx:=xmin;
                 newx:=xmin;
               end
               end
             else
             else
             if (code and RIGHT) <> 0 then
             if (code and RIGHT) <> 0 then
               begin
               begin
-                newy:=y1+trunc((y2-y1)*(xmax-x1)/(x2-x1));
+                newy:=y1+(y2-y1)*(xmax-x1) div (x2-x1);
                 newx:=xmax;
                 newx:=xmax;
               end
               end
             else
             else
             if (code and BOTTOM) <> 0 then
             if (code and BOTTOM) <> 0 then
               begin
               begin
-                newx:=x1+trunc((x2-x1)* ((ymax-y1) / (y2-y1)));
+                newx:=x1+(x2-x1)* ((ymax-y1) div (y2-y1));
                 newy:=ymax;
                 newy:=ymax;
               end
               end
             else
             else
             if (code and TOP) <> 0 then
             if (code and TOP) <> 0 then
               begin
               begin
-                newx:=x1+trunc((x2-x1)*(ymin-y1)/(y2-y1));
+                newx:=x1+(x2-x1)*(ymin-y1) div (y2-y1);
                 newy:=ymin;
                 newy:=ymin;
               end;
               end;
            if (code1 = code) then
            if (code1 = code) then
@@ -142,7 +142,12 @@ end;
 
 
 {
 {
 $Log$
 $Log$
-Revision 1.4  1999-09-12 17:28:59  jonas
+Revision 1.5  1999-09-18 22:21:09  jonas
+  + hlinevesa256 and vlinevesa256
+  + support for not/xor/or/andput in vesamodes with 32k/64k colors
+  * lots of changes to avoid warnings under FPC
+
+Revision 1.4  1999/09/12 17:28:59  jonas
   * several changes to internalellipse to make it faster
   * several changes to internalellipse to make it faster
     and to make sure it updates the ArcCall correctly
     and to make sure it updates the ArcCall correctly
     (not yet done for width = 3)
     (not yet done for width = 3)

+ 8 - 3
rtl/inc/graph/fills.inc

@@ -114,13 +114,13 @@ type
 var
 var
         ptable : ppointarray; { pointer to points list }
         ptable : ppointarray; { pointer to points list }
 
 
-function compare_ind(u, v : pointer) : graph_int; far;
+function compare_ind(u, v : pointer) : graph_int; {$ifndef fpc} far; {$endif fpc}
 begin
 begin
         if (ptable^[pint(u)^].y <= ptable^[pint(v)^].y) then compare_ind := -1
         if (ptable^[pint(u)^].y <= ptable^[pint(v)^].y) then compare_ind := -1
         else compare_ind := 1;
         else compare_ind := 1;
 end;
 end;
 
 
-function compare_active(u, v : pointer) : graph_int; far;
+function compare_active(u, v : pointer) : graph_int; {$ifndef fpc} far; {$endif fpc}
 begin
 begin
         if (pedge(u)^.x <= pedge(v)^.x) then compare_active := -1
         if (pedge(u)^.x <= pedge(v)^.x) then compare_active := -1
         else compare_active := 1;
         else compare_active := 1;
@@ -492,7 +492,12 @@ var
 
 
 {
 {
 $Log$
 $Log$
-Revision 1.7  1999-09-17 13:58:31  jonas
+Revision 1.8  1999-09-18 22:21:09  jonas
+  + hlinevesa256 and vlinevesa256
+  + support for not/xor/or/andput in vesamodes with 32k/64k colors
+  * lots of changes to avoid warnings under FPC
+
+Revision 1.7  1999/09/17 13:58:31  jonas
 * another fix for a case where internalellipsedefault went haywire
 * another fix for a case where internalellipsedefault went haywire
 * sector() and pieslice() fully implemented!
 * sector() and pieslice() fully implemented!
 * small change to prevent buffer overflow with floodfill
 * small change to prevent buffer overflow with floodfill

+ 59 - 34
rtl/inc/graph/graph.inc

@@ -145,7 +145,7 @@ CONST
  {*                     4-bit planar VGA mode routines                   *}
  {*                     4-bit planar VGA mode routines                   *}
  {************************************************************************}
  {************************************************************************}
 
 
-  Procedure Init640x200x16; far; assembler;
+  Procedure Init640x200x16; {$ifndef fpc}far;{$endif fpc} assembler;
   { must also clear the screen...}
   { must also clear the screen...}
    asm
    asm
      mov ax,000Eh
      mov ax,000Eh
@@ -159,7 +159,7 @@ CONST
    end;
    end;
 
 
 
 
-   Procedure Init640x350x16; far; assembler;
+   Procedure Init640x350x16; {$ifndef fpc}far;{$endif fpc} assembler;
   { must also clear the screen...}
   { must also clear the screen...}
     asm
     asm
       mov ax,0010h
       mov ax,0010h
@@ -172,7 +172,7 @@ CONST
 {$endif fpc}
 {$endif fpc}
     end;
     end;
 
 
-  procedure Init640x480x16; far; assembler;
+  procedure Init640x480x16; {$ifndef fpc}far;{$endif fpc} assembler;
   { must also clear the screen...}
   { must also clear the screen...}
     asm
     asm
       mov  ax,0012h
       mov  ax,0012h
@@ -185,7 +185,7 @@ CONST
 {$endif fpc}
 {$endif fpc}
     end;
     end;
 
 
- Procedure PutPixel16(X,Y : Integer; Pixel: Word); far;
+ Procedure PutPixel16(X,Y : Integer; Pixel: Word); {$ifndef fpc}far;{$endif fpc}
 {$ifndef asmgraph}
 {$ifndef asmgraph}
  var offset: word;
  var offset: word;
      dummy: byte;
      dummy: byte;
@@ -290,7 +290,7 @@ CONST
    end;
    end;
 
 
 
 
- Function GetPixel16(X,Y: Integer):word; far;
+ Function GetPixel16(X,Y: Integer):word; {$ifndef fpc}far;{$endif fpc}
 {$ifndef asmgraph}
 {$ifndef asmgraph}
  Var dummy, offset: Word;
  Var dummy, offset: Word;
      shift: byte;
      shift: byte;
@@ -448,7 +448,7 @@ CONST
   end;
   end;
 
 
 
 
- Procedure DirectPutPixel16(X,Y : Integer); far;
+ Procedure DirectPutPixel16(X,Y : Integer); {$ifndef fpc}far;{$endif fpc}
  { x,y -> must be in global coordinates. No clipping. }
  { x,y -> must be in global coordinates. No clipping. }
   var
   var
    color: word;
    color: word;
@@ -589,7 +589,7 @@ CONST
  end;
  end;
 
 
 {$ifndef tp}
 {$ifndef tp}
-  procedure HLine16(x,x2,y: integer); far;
+  procedure HLine16(x,x2,y: integer); {$ifndef fpc}far;{$endif fpc}
 
 
    var
    var
       xtmp: integer;
       xtmp: integer;
@@ -716,7 +716,7 @@ CONST
     port[$3cf]:=0;
     port[$3cf]:=0;
    end;
    end;
 
 
-  procedure VLine16(x,y,y2: integer); far;
+  procedure VLine16(x,y,y2: integer); {$ifndef fpc}far;{$endif fpc}
 
 
    var
    var
      ytmp: integer;
      ytmp: integer;
@@ -797,20 +797,20 @@ CONST
 {$endif tp}
 {$endif tp}
 
 
 
 
- procedure SetVisual480(page: word); far;
+ procedure SetVisual480(page: word); {$ifndef fpc}far;{$endif fpc}
  { no page flipping support in 640x480 mode }
  { no page flipping support in 640x480 mode }
   begin
   begin
     VideoOfs := 0;
     VideoOfs := 0;
   end;
   end;
 
 
- procedure SetActive480(page: word); far;
+ procedure SetActive480(page: word); {$ifndef fpc}far;{$endif fpc}
  { no page flipping support in 640x480 mode }
  { no page flipping support in 640x480 mode }
   begin
   begin
     VideoOfs := 0;
     VideoOfs := 0;
   end;
   end;
 
 
 
 
- procedure SetVisual200(page: word); far;
+ procedure SetVisual200(page: word); {$ifndef fpc}far;{$endif fpc}
   { two page support... }
   { two page support... }
   begin
   begin
     if page > HardwarePages then exit;
     if page > HardwarePages then exit;
@@ -839,7 +839,7 @@ CONST
     end;
     end;
   end;
   end;
 
 
- procedure SetActive200(page: word); far;
+ procedure SetActive200(page: word); {$ifndef fpc}far;{$endif fpc}
   { two page support... }
   { two page support... }
   begin
   begin
     case page of
     case page of
@@ -851,7 +851,7 @@ CONST
     end;
     end;
   end;
   end;
 
 
- procedure SetVisual350(page: word); far;
+ procedure SetVisual350(page: word); {$ifndef fpc}far;{$endif fpc}
   { one page support... }
   { one page support... }
   begin
   begin
     if page > HardwarePages then exit;
     if page > HardwarePages then exit;
@@ -868,7 +868,7 @@ CONST
     end;
     end;
   end;
   end;
 
 
- procedure SetActive350(page: word); far;
+ procedure SetActive350(page: word); {$ifndef fpc}far;{$endif fpc}
   { one page support... }
   { one page support... }
   begin
   begin
     case page of
     case page of
@@ -887,7 +887,7 @@ CONST
  {*                     320x200x256c Routines                            *}
  {*                     320x200x256c Routines                            *}
  {************************************************************************}
  {************************************************************************}
 
 
- Procedure Init320; far; assembler;
+ Procedure Init320; {$ifndef fpc}far;{$endif fpc} assembler;
   asm
   asm
     mov ax,0013h
     mov ax,0013h
 {$ifdef fpc}
 {$ifdef fpc}
@@ -899,7 +899,7 @@ CONST
 {$endif fpc}
 {$endif fpc}
   end;
   end;
 
 
- Procedure PutPixel320(X,Y : Integer; Pixel: Word); far;
+ Procedure PutPixel320(X,Y : Integer; Pixel: Word); {$ifndef fpc}far;{$endif fpc}
  { x,y -> must be in local coordinates. Clipping if required. }
  { x,y -> must be in local coordinates. Clipping if required. }
   Begin
   Begin
     X:= X + StartXViewPort;
     X:= X + StartXViewPort;
@@ -941,7 +941,7 @@ CONST
   end;
   end;
 
 
 
 
- Function GetPixel320(X,Y: Integer):word; far;
+ Function GetPixel320(X,Y: Integer):word; {$ifndef fpc}far;{$endif fpc}
   Begin
   Begin
    X:= X + StartXViewPort;
    X:= X + StartXViewPort;
    Y:= Y + StartYViewPort;
    Y:= Y + StartYViewPort;
@@ -975,7 +975,7 @@ CONST
   end;
   end;
 
 
 
 
- Procedure DirectPutPixel320(X,Y : Integer); far;
+ Procedure DirectPutPixel320(X,Y : Integer); {$ifndef fpc}far;{$endif fpc}
  { x,y -> must be in global coordinates. No clipping. }
  { x,y -> must be in global coordinates. No clipping. }
 {$ifndef asmgraph}
 {$ifndef asmgraph}
  var offset: word;
  var offset: word;
@@ -1027,12 +1027,12 @@ CONST
 {$endif asmgraph}
 {$endif asmgraph}
 
 
 
 
- procedure SetVisual320(page: word); far;
+ procedure SetVisual320(page: word); {$ifndef fpc}far;{$endif fpc}
   { no page support... }
   { no page support... }
   begin
   begin
   end;
   end;
 
 
- procedure SetActive320(page: word); far;
+ procedure SetActive320(page: word); {$ifndef fpc}far;{$endif fpc}
   { no page support... }
   { no page support... }
   begin
   begin
    VideoOfs := 0;
    VideoOfs := 0;
@@ -1043,7 +1043,7 @@ CONST
  {************************************************************************}
  {************************************************************************}
 const CrtAddress: word = 0;
 const CrtAddress: word = 0;
 
 
- procedure InitModeX; far;
+ procedure InitModeX; {$ifndef fpc}far;{$endif fpc}
   begin
   begin
    asm
    asm
      {see if we are using color-/monochorme display}
      {see if we are using color-/monochorme display}
@@ -1115,7 +1115,7 @@ const CrtAddress: word = 0;
  end;
  end;
 
 
 
 
- Function GetPixelX(X,Y: Integer): word; far;
+ Function GetPixelX(X,Y: Integer): word; {$ifndef fpc}far;{$endif fpc}
 {$ifndef asmgraph}
 {$ifndef asmgraph}
  var offset: word;
  var offset: word;
 {$endif asmgraph}
 {$endif asmgraph}
@@ -1182,7 +1182,7 @@ const CrtAddress: word = 0;
 {$endif asmgraph}
 {$endif asmgraph}
  end;
  end;
 
 
- procedure SetVisualX(page: word); far;
+ procedure SetVisualX(page: word); {$ifndef fpc}far;{$endif fpc}
   { 4 page support... }
   { 4 page support... }
 
 
    Procedure SetVisibleStart(AOffset: word); Assembler;
    Procedure SetVisibleStart(AOffset: word); Assembler;
@@ -1238,7 +1238,7 @@ const CrtAddress: word = 0;
     end;
     end;
   end;
   end;
 
 
- procedure SetActiveX(page: word); far;
+ procedure SetActiveX(page: word); {$ifndef fpc}far;{$endif fpc}
   { 4 page support... }
   { 4 page support... }
   begin
   begin
    case page of
    case page of
@@ -1251,7 +1251,7 @@ const CrtAddress: word = 0;
    end;
    end;
   end;
   end;
 
 
- Procedure PutPixelX(X,Y: Integer; color:word); far;
+ Procedure PutPixelX(X,Y: Integer; color:word); {$ifndef fpc}far;{$endif fpc}
 {$ifndef asmgraph}
 {$ifndef asmgraph}
  var offset: word;
  var offset: word;
      dummy: byte;
      dummy: byte;
@@ -1309,7 +1309,7 @@ const CrtAddress: word = 0;
   end;
   end;
 
 
 
 
- Procedure DirectPutPixelX(X,Y: Integer); far;
+ Procedure DirectPutPixelX(X,Y: Integer); {$ifndef fpc}far;{$endif fpc}
  { x,y -> must be in global coordinates. No clipping. }
  { x,y -> must be in global coordinates. No clipping. }
 {$ifndef asmgraph}
 {$ifndef asmgraph}
  Var offset: Word;
  Var offset: Word;
@@ -1375,7 +1375,7 @@ const CrtAddress: word = 0;
 {$IFDEF DPMI}
 {$IFDEF DPMI}
   RealStateSeg: word;    { Real segment of saved video state }
   RealStateSeg: word;    { Real segment of saved video state }
 
 
- Procedure SaveStateVGA;
+ Procedure SaveStateVGA; {$ifndef fpc}far;{$endif fpc}
  var
  var
   PtrLong: longint;
   PtrLong: longint;
   regs: TDPMIRegisters;
   regs: TDPMIRegisters;
@@ -1442,7 +1442,7 @@ const CrtAddress: word = 0;
       end;
       end;
   end;
   end;
 
 
- procedure RestoreStateVGA;
+ procedure RestoreStateVGA; {$ifndef fpc}far;{$endif fpc}
   var
   var
    regs:TDPMIRegisters;
    regs:TDPMIRegisters;
   begin
   begin
@@ -1493,7 +1493,7 @@ const CrtAddress: word = 0;
       {**************************************************************}
       {**************************************************************}
 
 
 
 
- Procedure SaveStateVGA; far;
+ Procedure SaveStateVGA; far; 
   begin
   begin
     SavePtr := nil;
     SavePtr := nil;
     SaveSupported := FALSE;
     SaveSupported := FALSE;
@@ -1568,7 +1568,7 @@ const CrtAddress: word = 0;
 
 
    { VGA is never a direct color mode, so no need to check ... }
    { VGA is never a direct color mode, so no need to check ... }
    Procedure SetVGARGBPalette(ColorNum, RedValue, GreenValue,
    Procedure SetVGARGBPalette(ColorNum, RedValue, GreenValue,
-      BlueValue : Integer); far; assembler;
+      BlueValue : Integer); {$ifndef fpc}far;{$endif fpc} assembler;
     asm
     asm
       { on some hardware - there is a snow like effect       }
       { on some hardware - there is a snow like effect       }
       { when changing the palette register directly          }
       { when changing the palette register directly          }
@@ -1609,7 +1609,7 @@ const CrtAddress: word = 0;
 
 
    { VGA is never a direct color mode, so no need to check ... }
    { VGA is never a direct color mode, so no need to check ... }
   Procedure GetVGARGBPalette(ColorNum: integer; Var
   Procedure GetVGARGBPalette(ColorNum: integer; Var
-      RedValue, GreenValue, BlueValue : integer); far;
+      RedValue, GreenValue, BlueValue : integer); {$ifndef fpc}far;{$endif fpc}
    begin
    begin
      Port[$03C7] := ColorNum;
      Port[$03C7] := ColorNum;
      { we must convert to lsb values... because the vga uses the 6 msb bits }
      { we must convert to lsb values... because the vga uses the 6 msb bits }
@@ -2015,6 +2015,8 @@ const CrtAddress: word = 0;
              mode.InitMode := Init640x400x256;
              mode.InitMode := Init640x400x256;
              mode.SetVisualPage := SetVisualVESA;
              mode.SetVisualPage := SetVisualVESA;
              mode.SetActivePage := SetActiveVESA;
              mode.SetActivePage := SetActiveVESA;
+             mode.hline := HLineVESA256;
+             mode.vline := VLineVESA256;
 {$else fpc}
 {$else fpc}
              mode.DirectPutPixel:=@DirectPutPixVESA256;
              mode.DirectPutPixel:=@DirectPutPixVESA256;
              mode.PutPixel:=@PutPixVESA256;
              mode.PutPixel:=@PutPixVESA256;
@@ -2024,6 +2026,8 @@ const CrtAddress: word = 0;
              mode.InitMode := @Init640x400x256;
              mode.InitMode := @Init640x400x256;
              mode.SetVisualPage := @SetVisualVESA;
              mode.SetVisualPage := @SetVisualVESA;
              mode.SetActivePage := @SetActiveVESA;
              mode.SetActivePage := @SetActiveVESA;
+             mode.hline := @HLineVESA256;
+             mode.vline := @VLineVESA256;
 {$endif fpc}
 {$endif fpc}
              mode.XAspect := 10000;
              mode.XAspect := 10000;
              mode.YAspect := 10000;
              mode.YAspect := 10000;
@@ -2051,6 +2055,8 @@ const CrtAddress: word = 0;
              mode.InitMode := Init640x480x256;
              mode.InitMode := Init640x480x256;
              mode.SetVisualPage := SetVisualVESA;
              mode.SetVisualPage := SetVisualVESA;
              mode.SetActivePage := SetActiveVESA;
              mode.SetActivePage := SetActiveVESA;
+             mode.hline := HLineVESA256;
+             mode.vline := VLineVESA256;
 {$else fpc}
 {$else fpc}
              mode.DirectPutPixel:=@DirectPutPixVESA256;
              mode.DirectPutPixel:=@DirectPutPixVESA256;
              mode.PutPixel:=@PutPixVESA256;
              mode.PutPixel:=@PutPixVESA256;
@@ -2060,6 +2066,8 @@ const CrtAddress: word = 0;
              mode.InitMode := @Init640x480x256;
              mode.InitMode := @Init640x480x256;
              mode.SetVisualPage := @SetVisualVESA;
              mode.SetVisualPage := @SetVisualVESA;
              mode.SetActivePage := @SetActiveVESA;
              mode.SetActivePage := @SetActiveVESA;
+             mode.hline := @HLineVESA256;
+             mode.hline := @HLineVESA256;
 {$endif fpc}
 {$endif fpc}
              mode.XAspect := 10000;
              mode.XAspect := 10000;
              mode.YAspect := 10000;
              mode.YAspect := 10000;
@@ -2199,6 +2207,8 @@ const CrtAddress: word = 0;
              mode.InitMode := Init800x600x256;
              mode.InitMode := Init800x600x256;
              mode.SetVisualPage := SetVisualVESA;
              mode.SetVisualPage := SetVisualVESA;
              mode.SetActivePage := SetActiveVESA;
              mode.SetActivePage := SetActiveVESA;
+             mode.hline := HLineVESA256;
+             mode.vline := VLineVESA256;
 {$else fpc}
 {$else fpc}
              mode.DirectPutPixel:=@DirectPutPixVESA256;
              mode.DirectPutPixel:=@DirectPutPixVESA256;
              mode.PutPixel:=@PutPixVESA256;
              mode.PutPixel:=@PutPixVESA256;
@@ -2208,6 +2218,8 @@ const CrtAddress: word = 0;
              mode.InitMode := @Init800x600x256;
              mode.InitMode := @Init800x600x256;
              mode.SetVisualPage := @SetVisualVESA;
              mode.SetVisualPage := @SetVisualVESA;
              mode.SetActivePage := @SetActiveVESA;
              mode.SetActivePage := @SetActiveVESA;
+             mode.hline := @HLineVESA256;
+             mode.vline := @VLineVESA256;
 {$endif fpc}
 {$endif fpc}
              mode.XAspect := 10000;
              mode.XAspect := 10000;
              mode.YAspect := 10000;
              mode.YAspect := 10000;
@@ -2347,6 +2359,8 @@ const CrtAddress: word = 0;
              mode.InitMode := Init1024x768x256;
              mode.InitMode := Init1024x768x256;
              mode.SetVisualPage := SetVisualVESA;
              mode.SetVisualPage := SetVisualVESA;
              mode.SetActivePage := SetActiveVESA;
              mode.SetActivePage := SetActiveVESA;
+             mode.hline := HLineVESA256;
+             mode.vline := VLineVESA256;
 {$else fpc}
 {$else fpc}
              mode.DirectPutPixel:=@DirectPutPixVESA256;
              mode.DirectPutPixel:=@DirectPutPixVESA256;
              mode.PutPixel:=@PutPixVESA256;
              mode.PutPixel:=@PutPixVESA256;
@@ -2356,6 +2370,8 @@ const CrtAddress: word = 0;
              mode.InitMode := @Init1024x768x256;
              mode.InitMode := @Init1024x768x256;
              mode.SetVisualPage := @SetVisualVESA;
              mode.SetVisualPage := @SetVisualVESA;
              mode.SetActivePage := @SetActiveVESA;
              mode.SetActivePage := @SetActiveVESA;
+             mode.vline := @VLineVESA256;
+             mode.hline := @HLineVESA256;
 {$endif fpc}
 {$endif fpc}
              mode.XAspect := 10000;
              mode.XAspect := 10000;
              mode.YAspect := 10000;
              mode.YAspect := 10000;
@@ -2495,6 +2511,8 @@ const CrtAddress: word = 0;
              mode.GetRGBPalette := GetVESARGBPalette;
              mode.GetRGBPalette := GetVESARGBPalette;
              mode.SetVisualPage := SetVisualVESA;
              mode.SetVisualPage := SetVisualVESA;
              mode.SetActivePage := SetActiveVESA;
              mode.SetActivePage := SetActiveVESA;
+             mode.hline := HLineVESA256;
+             mode.vline := VLineVESA256;
 {$else fpc}
 {$else fpc}
              mode.DirectPutPixel:=@DirectPutPixVESA256;
              mode.DirectPutPixel:=@DirectPutPixVESA256;
              mode.PutPixel:=@PutPixVESA256;
              mode.PutPixel:=@PutPixVESA256;
@@ -2504,6 +2522,8 @@ const CrtAddress: word = 0;
              mode.GetRGBPalette := @GetVESARGBPalette;
              mode.GetRGBPalette := @GetVESARGBPalette;
              mode.SetVisualPage := @SetVisualVESA;
              mode.SetVisualPage := @SetVisualVESA;
              mode.SetActivePage := @SetActiveVESA;
              mode.SetActivePage := @SetActiveVESA;
+             mode.vline := @VLineVESA256;
+             mode.hline := @HLineVESA256;
 {$endif fpc}
 {$endif fpc}
              mode.XAspect := 10000;
              mode.XAspect := 10000;
              mode.YAspect := 10000;
              mode.YAspect := 10000;
@@ -2588,7 +2608,12 @@ const CrtAddress: word = 0;
 
 
 {
 {
 $Log$
 $Log$
-Revision 1.13  1999-09-18 16:03:36  jonas
+Revision 1.14  1999-09-18 22:21:09  jonas
+  + hlinevesa256 and vlinevesa256
+  + support for not/xor/or/andput in vesamodes with 32k/64k colors
+  * lots of changes to avoid warnings under FPC
+
+Revision 1.13  1999/09/18 16:03:36  jonas
   * graph.pp: removed pieslice and sector from ToDo list
   * graph.pp: removed pieslice and sector from ToDo list
   * closegraph: exits now immidiately if isgraphmode = false (caused
   * closegraph: exits now immidiately if isgraphmode = false (caused
     RTE 204 with VESA enabled if you set exitproc to call closegraph
     RTE 204 with VESA enabled if you set exitproc to call closegraph
@@ -2622,7 +2647,7 @@ Revision 1.9  1999/08/01 14:50:51  jonas
 
 
 Revision 1.8  1999/07/18 15:07:19  jonas
 Revision 1.8  1999/07/18 15:07:19  jonas
   + xor-, and and- orput support for VESA256 modes
   + xor-, and and- orput support for VESA256 modes
-  * compile with -dlogging if you wnt some info to be logged to grlog.txt
+  * compile with -dlogging if you want some info to be logged to grlog.txt
 
 
 Revision 1.7  1999/07/14 18:18:02  florian
 Revision 1.7  1999/07/14 18:18:02  florian
   * cosmetic changes
   * cosmetic changes
@@ -2642,7 +2667,7 @@ Revision 1.4  1999/07/12 13:27:08  jonas
   * only dispose vesainfo at closegrph if a vesa card was detected
   * only dispose vesainfo at closegrph if a vesa card was detected
   * changed int32 to longint (int32 is not declared under FPC)
   * changed int32 to longint (int32 is not declared under FPC)
   * changed the declaration of almost every procedure in graph.inc to
   * changed the declaration of almost every procedure in graph.inc to
-    "far;" becquse otherwise you can't assign them to procvars under TP
+    "far;" because otherwise you can't assign them to procvars under TP
     real mode (but unexplainable "data segnment too large" errors prevent
     real mode (but unexplainable "data segnment too large" errors prevent
     it from working under real mode anyway)
     it from working under real mode anyway)
 
 

+ 40 - 36
rtl/inc/graph/graph.pp

@@ -37,8 +37,6 @@ Unit Graph;
 {    returns an error.                                  }
 {    returns an error.                                  }
 { - DrawPoly XORPut mode is not exactly the same as in  }
 { - DrawPoly XORPut mode is not exactly the same as in  }
 {   the TP graph unit.                                  }
 {   the TP graph unit.                                  }
-{ - FillEllipse does not support XORPut mode with a     }
-{   bounded FloodFill. Mode is always CopyPut mode.     }
 { - Imagesize returns a longint instead of a word       }
 { - Imagesize returns a longint instead of a word       }
 { - ImageSize cannot return an error value              }
 { - ImageSize cannot return an error value              }
 {-------------------------------------------------------}
 {-------------------------------------------------------}
@@ -48,7 +46,9 @@ Unit Graph;
 {   Pierre Mueller      - major bugfixes                }
 {   Pierre Mueller      - major bugfixes                }
 {   Carl Eric Codere    - complete rewrite              }
 {   Carl Eric Codere    - complete rewrite              }
 {   Thomas Schatzl      - optimizations,routines and    }
 {   Thomas Schatzl      - optimizations,routines and    }
-{ Credits (external):       suggestions.                }
+{                           suggestions.                }
+{   Jonas Maebe         - bugfixes and optimizations    }
+{ Credits (external):                                   }
 {   - Original FloodFill code by                        }
 {   - Original FloodFill code by                        }
 {        Menno Victor van der star                      }
 {        Menno Victor van der star                      }
 {     (the code has been heavily modified)              }
 {     (the code has been heavily modified)              }
@@ -810,7 +810,7 @@ var
 
 
   {$i clip.inc}
   {$i clip.inc}
 
 
-  procedure HLineDefault(x,x2,y: integer); far;
+  procedure HLineDefault(x,x2,y: integer); {$ifndef fpc}far;{$endif fpc}
 
 
    var
    var
     xtmp: integer;
     xtmp: integer;
@@ -838,7 +838,7 @@ var
    end;
    end;
 
 
 
 
-  procedure VLineDefault(x,y,y2: integer); far;
+  procedure VLineDefault(x,y,y2: integer); {$ifndef fpc}far;{$endif fpc}
 
 
    var
    var
     Col: word;
     Col: word;
@@ -865,7 +865,7 @@ var
   End;
   End;
 
 
 
 
-  procedure LineDefault(X1, Y1, X2, Y2: Integer); far;
+  procedure LineDefault(X1, Y1, X2, Y2: Integer); {$ifndef fpc}far;{$endif fpc}
 
 
   var X, Y :           Integer;
   var X, Y :           Integer;
       deltax, deltay : Integer;
       deltax, deltay : Integer;
@@ -1305,7 +1305,7 @@ var
   {********************************************************}
   {********************************************************}
 
 
   Procedure InternalEllipseDefault(X,Y: Integer;XRadius: word;
   Procedure InternalEllipseDefault(X,Y: Integer;XRadius: word;
-    YRadius:word; stAngle,EndAngle: word; pl: PatternLineProc); far;
+    YRadius:word; stAngle,EndAngle: word; pl: PatternLineProc); {$ifndef fpc}far;{$endif fpc}
    var
    var
     j, Delta, DeltaEnd: graph_float;
     j, Delta, DeltaEnd: graph_float;
     NumOfPixels: longint;
     NumOfPixels: longint;
@@ -1371,7 +1371,7 @@ var
    { quadrant, so divide the circumference value by 4 (JM)       }
    { quadrant, so divide the circumference value by 4 (JM)       }
    NumOfPixels:=(8 div 4)*Round(2*sqrt((sqr(XRadius)+sqr(YRadius)) div 2));
    NumOfPixels:=(8 div 4)*Round(2*sqrt((sqr(XRadius)+sqr(YRadius)) div 2));
    { Calculate the angle precision required }
    { Calculate the angle precision required }
-   Delta := 90 / (NumOfPixels);
+   Delta := 90.0 / (NumOfPixels);
    { Adjust for screen aspect ratio }
    { Adjust for screen aspect ratio }
    XRadius:=(longint(XRadius)*10000) div XAspect;
    XRadius:=(longint(XRadius)*10000) div XAspect;
    YRadius:=(longint(YRadius)*10000) div YAspect;
    YRadius:=(longint(YRadius)*10000) div YAspect;
@@ -1576,7 +1576,7 @@ Begin
   End;
   End;
 End;
 End;
   *)
   *)
-  procedure PatternLineDefault(x1,x2,y: integer); far;
+  procedure PatternLineDefault(x1,x2,y: integer); {$ifndef fpc}far;{$endif fpc}
   {********************************************************}
   {********************************************************}
   { Draws a horizontal patterned line according to the     }
   { Draws a horizontal patterned line according to the     }
   { current Fill Settings.                                 }
   { current Fill Settings.                                 }
@@ -1745,7 +1745,7 @@ End;
 {--------------------------------------------------------------------------}
 {--------------------------------------------------------------------------}
 
 
 
 
-Procedure ClearViewPortDefault; far;
+Procedure ClearViewPortDefault; {$ifndef fpc}far;{$endif fpc}
 var
 var
  j: integer;
  j: integer;
  OldWriteMode, OldCurColor: word;
  OldWriteMode, OldCurColor: word;
@@ -1843,7 +1843,7 @@ end;
 {--------------------------------------------------------------------------}
 {--------------------------------------------------------------------------}
 
 
 
 
-  Procedure GetScanlineDefault (Y : Integer; Var Data); far;
+  Procedure GetScanlineDefault (Y : Integer; Var Data); {$ifndef fpc}far;{$endif fpc}
   {**********************************************************}
   {**********************************************************}
   { Procedure GetScanLine()                                  }
   { Procedure GetScanLine()                                  }
   {----------------------------------------------------------}
   {----------------------------------------------------------}
@@ -1863,14 +1863,14 @@ end;
 
 
 
 
 
 
-Function DefaultImageSize(X1,Y1,X2,Y2: Integer): longint; far;
+Function DefaultImageSize(X1,Y1,X2,Y2: Integer): longint; {$ifndef fpc}far;{$endif fpc}
 Begin
 Begin
   { each pixel uses two bytes, to enable modes with colors up to 64K }
   { each pixel uses two bytes, to enable modes with colors up to 64K }
   { to work.                                                         }
   { to work.                                                         }
   DefaultImageSize := 12 + (((X2-X1)*(Y2-Y1))*2);
   DefaultImageSize := 12 + (((X2-X1)*(Y2-Y1))*2);
 end;
 end;
 
 
-Procedure DefaultPutImage(X,Y: Integer; var Bitmap; BitBlt: Word); far;
+Procedure DefaultPutImage(X,Y: Integer; var Bitmap; BitBlt: Word); {$ifndef fpc}far;{$endif fpc}
 type
 type
   pt = array[0..32000] of word;
   pt = array[0..32000] of word;
   ptw = array[0..3] of longint;
   ptw = array[0..3] of longint;
@@ -1905,7 +1905,7 @@ Begin
 end;
 end;
 
 
 
 
-Procedure DefaultGetImage(X1,Y1,X2,Y2: Integer; Var Bitmap); far;
+Procedure DefaultGetImage(X1,Y1,X2,Y2: Integer; Var Bitmap); {$ifndef fpc}far;{$endif fpc}
 type
 type
   pt = array[0..32000] of word;
   pt = array[0..32000] of word;
   ptw = array[0..3] of longint;
   ptw = array[0..3] of longint;
@@ -1947,12 +1947,12 @@ end;
    end;
    end;
 
 
 
 
-  procedure SetVisualPageDefault(page : word); far;
+  procedure SetVisualPageDefault(page : word); {$ifndef fpc}far;{$endif fpc}
    begin
    begin
    end;
    end;
 
 
 
 
-  procedure SetActivePageDefault(page : word); far;
+  procedure SetActivePageDefault(page : word); {$ifndef fpc}far;{$endif fpc}
    begin
    begin
    end;
    end;
 
 
@@ -2160,7 +2160,6 @@ end;
 
 
  procedure SectorPL(x1,x2,y: Integer); {$ifndef fpc}far;{$endif fpc}
  procedure SectorPL(x1,x2,y: Integer); {$ifndef fpc}far;{$endif fpc}
  var plx1, plx2: integer;
  var plx1, plx2: integer;
-{!!!!!!!!!!!!!!!}
 {$ifdef sectorpldebug}
 {$ifdef sectorpldebug}
      t : text;
      t : text;
 {$endif sectorpldebug}
 {$endif sectorpldebug}
@@ -2187,24 +2186,24 @@ end;
            If (ArcCall.YStart-ArcCall.Y) = 0 then
            If (ArcCall.YStart-ArcCall.Y) = 0 then
              begin
              begin
                append(t);
                append(t);
-               writeln('bug1');
+               writeln(t,'bug1');
                close(t);
                close(t);
                runerror(202);
                runerror(202);
              end;
              end;
 {$endif sectorpldebug}
 {$endif sectorpldebug}
-           plx1 := Round((y-ArcCall.Y)/(ArcCall.YStart-ArcCall.Y)*
-                   (ArcCall.XStart-ArcCall.X))+ArcCall.X;
+           plx1 := (y-ArcCall.Y)*(ArcCall.XStart-ArcCall.X)
+                   div (ArcCall.YStart-ArcCall.Y)+ArcCall.X;
 {$ifdef sectorpldebug}
 {$ifdef sectorpldebug}
            If (ArcCall.YEnd-ArcCall.Y) = 0 then
            If (ArcCall.YEnd-ArcCall.Y) = 0 then
              begin
              begin
                append(t);
                append(t);
-               writeln('bug2');
+               writeln(t,'bug2');
                close(t);
                close(t);
                runerror(202);
                runerror(202);
              end;
              end;
 {$endif sectorpldebug}
 {$endif sectorpldebug}
-           plx2 := Round((y-ArcCall.Y)/(ArcCall.YEnd-ArcCall.Y)*
-                   (ArcCall.XEnd-ArcCall.X))+ArcCall.X;
+           plx2 := (y-ArcCall.Y)*(ArcCall.XEnd-ArcCall.X)
+                   div (ArcCall.YEnd-ArcCall.Y)+ArcCall.X;
            If plx1 > plx2 then
            If plx1 > plx2 then
              begin
              begin
                plx1 := plx1 xor plx2;
                plx1 := plx1 xor plx2;
@@ -2230,13 +2229,13 @@ end;
              If (ArcCall.YEnd-ArcCall.Y) = 0 then
              If (ArcCall.YEnd-ArcCall.Y) = 0 then
                begin
                begin
                  append(t);
                  append(t);
-                 writeln('bug3');
+                 writeln(t,'bug3');
                  close(t);
                  close(t);
                  runerror(202);
                  runerror(202);
                end;
                end;
 {$endif sectorpldebug}
 {$endif sectorpldebug}
-             plx1 := Round((y-ArcCall.Y)/(ArcCall.YEnd-ArcCall.Y)*
-                     (ArcCall.XEnd-ArcCall.X))+ArcCall.X
+             plx1 := (y-ArcCall.Y)*(ArcCall.XEnd-ArcCall.X)
+                     div (ArcCall.YEnd-ArcCall.Y)+ArcCall.X
            end
            end
          else if (y > ArcCall.Y) then
          else if (y > ArcCall.Y) then
            begin
            begin
@@ -2244,13 +2243,13 @@ end;
              If (ArcCall.YStart-ArcCall.Y) = 0 then
              If (ArcCall.YStart-ArcCall.Y) = 0 then
                begin
                begin
                  append(t);
                  append(t);
-                 writeln('bug4');
+                 writeln(t,'bug4');
                  close(t);
                  close(t);
                  runerror(202);
                  runerror(202);
                end;
                end;
 {$endif sectorpldebug}
 {$endif sectorpldebug}
-             plx1 := Round((y-ArcCall.Y)/(ArcCall.YStart-ArcCall.Y)*
-                     (ArcCall.XStart-ArcCall.X))+ArcCall.X
+             plx1 := (y-ArcCall.Y)*(ArcCall.XStart-ArcCall.X)
+                     div (ArcCall.YStart-ArcCall.Y)+ArcCall.X
              end
              end
          else plx1 := ArcCall.X;
          else plx1 := ArcCall.X;
          plx2 := x2;
          plx2 := x2;
@@ -2272,13 +2271,13 @@ end;
              If (ArcCall.YStart-ArcCall.Y) = 0 then
              If (ArcCall.YStart-ArcCall.Y) = 0 then
                begin
                begin
                  append(t);
                  append(t);
-                 writeln('bug5');
+                 writeln(t,'bug5');
                  close(t);
                  close(t);
                  runerror(202);
                  runerror(202);
                end;
                end;
 {$endif sectorpldebug}
 {$endif sectorpldebug}
-             plx2 := Round((y-ArcCall.Y)/(ArcCall.YStart-ArcCall.Y)*
-                     (ArcCall.XStart-ArcCall.X))+ArcCall.X
+             plx2 := (y-ArcCall.Y)*(ArcCall.XStart-ArcCall.X)
+                     div (ArcCall.YStart-ArcCall.Y)+ArcCall.X
            end
            end
          else if (y > ArcCall.Y) then
          else if (y > ArcCall.Y) then
            begin
            begin
@@ -2286,13 +2285,13 @@ end;
              If (ArcCall.YEnd-ArcCall.Y) = 0 then
              If (ArcCall.YEnd-ArcCall.Y) = 0 then
                begin
                begin
                  append(t);
                  append(t);
-                 writeln('bug6');
+                 writeln(t,'bug6');
                  close(t);
                  close(t);
                  runerror(202);
                  runerror(202);
                end;
                end;
 {$endif sectorpldebug}
 {$endif sectorpldebug}
-             plx2 := Round((y-ArcCall.Y)/(ArcCall.YEnd-ArcCall.Y)*
-                     (ArcCall.XEnd-ArcCall.X))+ArcCall.X
+             plx2 := (y-ArcCall.Y)*(ArcCall.XEnd-ArcCall.X)
+                     div (ArcCall.YEnd-ArcCall.Y)+ArcCall.X
            end
            end
          else plx2 := ArcCall.X;
          else plx2 := ArcCall.X;
          plx1 := x1;
          plx1 := x1;
@@ -2877,7 +2876,12 @@ DetectGraph
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.24  1999-09-18 16:03:37  jonas
+  Revision 1.25  1999-09-18 22:21:10  jonas
+    + hlinevesa256 and vlinevesa256
+    + support for not/xor/or/andput in vesamodes with 32k/64k colors
+    * lots of changes to avoid warnings under FPC
+
+  Revision 1.24  1999/09/18 16:03:37  jonas
     * graph.pp: removed pieslice and sector from ToDo list
     * graph.pp: removed pieslice and sector from ToDo list
     * closegraph: exits now immidiately if isgraphmode = false (caused
     * closegraph: exits now immidiately if isgraphmode = false (caused
       RTE 204 with VESA enabled if you set exitproc to call closegraph
       RTE 204 with VESA enabled if you set exitproc to call closegraph

+ 7 - 2
rtl/inc/graph/modes.inc

@@ -87,7 +87,7 @@
     end;
     end;
 
 
 
 
-   procedure cleanmode;far;
+   procedure cleanmode; {$ifndef fpc}far;{$endif fpc}
   {********************************************************}
   {********************************************************}
   { Procedure CleanMode()                                  }
   { Procedure CleanMode()                                  }
   {--------------------------------------------------------}
   {--------------------------------------------------------}
@@ -317,7 +317,12 @@
 
 
 {
 {
 $Log$
 $Log$
-Revision 1.7  1999-07-12 13:27:14  jonas
+Revision 1.8  1999-09-18 22:21:11  jonas
+  + hlinevesa256 and vlinevesa256
+  + support for not/xor/or/andput in vesamodes with 32k/64k colors
+  * lots of changes to avoid warnings under FPC
+
+Revision 1.7  1999/07/12 13:27:14  jonas
   + added Log and Id tags
   + added Log and Id tags
   * added first FPC support, only VGA works to some extend for now
   * added first FPC support, only VGA works to some extend for now
   * use -dasmgraph to use assembler routines, otherwise Pascal
   * use -dasmgraph to use assembler routines, otherwise Pascal

+ 528 - 44
rtl/inc/graph/vesa.inc

@@ -400,7 +400,7 @@ end;
      { check if this is the current bank... if so do nothing. }
      { check if this is the current bank... if so do nothing. }
      if BankNr = CurrentReadBank then exit;
      if BankNr = CurrentReadBank then exit;
 {$ifdef logging}
 {$ifdef logging}
-     LogLn('Setting read bank to '+strf(BankNr));
+{     LogLn('Setting read bank to '+strf(BankNr));}
 {$endif logging}
 {$endif logging}
      CurrentReadBank := BankNr;          { save current bank number     }
      CurrentReadBank := BankNr;          { save current bank number     }
      BankNr := BankNr shl BankShift;     { adjust to window granularity }
      BankNr := BankNr shl BankShift;     { adjust to window granularity }
@@ -418,7 +418,7 @@ end;
      { check if this is the current bank... if so do nothing. }
      { check if this is the current bank... if so do nothing. }
      if BankNr = CurrentWriteBank then exit;
      if BankNr = CurrentWriteBank then exit;
 {$ifdef logging}
 {$ifdef logging}
-     LogLn('Setting write bank to '+strf(BankNr));
+{     LogLn('Setting write bank to '+strf(BankNr));}
 {$endif logging}
 {$endif logging}
      CurrentWriteBank := BankNr;          { save current bank number     }
      CurrentWriteBank := BankNr;          { save current bank number     }
      BankNr := BankNr shl BankShift;     { adjust to window granularity }
      BankNr := BankNr shl BankShift;     { adjust to window granularity }
@@ -435,7 +435,7 @@ end;
  {*                     8-bit pixels VESA mode routines                  *}
  {*                     8-bit pixels VESA mode routines                  *}
  {************************************************************************}
  {************************************************************************}
 
 
-  procedure PutPixVESA256(x, y : integer; color : word); far;
+  procedure PutPixVESA256(x, y : integer; color : word); {$ifndef fpc}far;{$endif fpc}
   var
   var
      bank : word;
      bank : word;
      offs : longint;
      offs : longint;
@@ -455,10 +455,11 @@ end;
      mem[WinWriteSeg : word(offs)] := byte(color)
      mem[WinWriteSeg : word(offs)] := byte(color)
   end;
   end;
 
 
-  procedure DirectPutPixVESA256(x, y : integer); far;
+  procedure DirectPutPixVESA256(x, y : integer); {$ifndef fpc}far;{$endif fpc}
   var
   var
      bank : word;
      bank : word;
      offs : longint;
      offs : longint;
+     col : byte;
   begin
   begin
      offs := longint(y) * BytesPerLine + x;
      offs := longint(y) * BytesPerLine + x;
      SetWriteBank(integer(offs shr 16));
      SetWriteBank(integer(offs shr 16));
@@ -477,14 +478,18 @@ end;
          Begin
          Begin
            SetReadBank(integer(offs shr 16));
            SetReadBank(integer(offs shr 16));
            mem[WinWriteSeg : word(offs)] := mem[WinReadSeg : word(offs)] or byte(currentcolor);
            mem[WinWriteSeg : word(offs)] := mem[WinReadSeg : word(offs)] or byte(currentcolor);
-         End;
-       NormalPut:
-         mem[WinWriteSeg : word(offs)] := byte(currentcolor)
-      else mem[WinWriteSeg : word(offs)] := byte(CurrentColor);
-   End;
+         End
+       else
+         Begin
+           If CurrentWriteMode <> NotPut then
+             col := Byte(CurrentColor)
+           else col := Not(Byte(CurrentColor));
+           mem[WinWriteSeg : word(offs)] := Col;
+         End
+     End;
   end;
   end;
 
 
-  function GetPixVESA256(x, y : integer): word; far;
+  function GetPixVESA256(x, y : integer): word; {$ifndef fpc}far;{$endif fpc}
   var
   var
      bank : word;
      bank : word;
      offs : longint;
      offs : longint;
@@ -496,11 +501,439 @@ end;
      GetPixVESA256:=mem[WinReadSeg : word(offs)];
      GetPixVESA256:=mem[WinReadSeg : word(offs)];
   end;
   end;
 
 
+  procedure HLineVESA256(x,x2,y: integer); {$ifndef fpc}far;{$endif fpc}
+
+   var Offs: Longint;
+       mask, l, bankrest: longint;
+       curbank, hlength: integer;
+   Begin
+    { must we swap the values? }
+    if x > x2 then
+      Begin
+        x := x xor x2;
+        x2 := x xor x2;
+        x:= x xor x2;
+      end;
+    { First convert to global coordinates }
+    X   := X + StartXViewPort;
+    X2  := X2 + StartXViewPort;
+    Y   := Y + StartYViewPort;
+    if ClipPixels then
+      Begin
+         if LineClipped(x,y,x2,y,StartXViewPort,StartYViewPort,
+                StartXViewPort+ViewWidth, StartYViewPort+ViewHeight) then
+            exit;
+      end;
+    {$ifdef logging}
+    LogLn('hline '+strf(x)+' - '+strf(x2)+' on '+strf(y)+' in mode '+strf(currentwritemode));
+    {$endif logging}
+    HLength := x2 - x + 1;
+    {$ifdef logging}
+    LogLn('length: '+strf(hlength));
+    {$endif logging}
+    if HLength>0 then
+      begin
+         Offs:=Longint(y)*bytesperline+x;
+         {$ifdef logging}
+         LogLn('Offs: '+strf(offs)+' -- '+hexstr(offs,8));
+         {$endif logging}
+         Mask := byte(CurrentColor)+byte(CurrentColor) shl 8;
+         Mask := Mask + Mask shl 16;
+         Case CurrentWriteMode of
+           AndPut:
+             Begin
+               Repeat
+                 curbank := integer(offs shr 16);
+                 SetWriteBank(curbank);
+                 SetReadBank(curbank);
+                 {$ifdef logging}
+                 LogLn('set bank '+strf(curbank)+' for offset '+hexstr(offs,8));
+                 {$endif logging}
+                 If HLength > 3 Then
+                 { allign target }
+                   Begin
+                     l := 0;
+                     If (offs and 3) <> 0 then
+                     { this cannot go past a window boundary bacause the }
+                     { size of a window is always a multiple of 4        }
+                       Begin
+                         {$ifdef logging}
+                         LogLn('Alligning by drawing '+strf(4-(offs and 3))+' pixels');
+                         {$endif logging}
+                         for l := 1 to 4-(offs and 3) do
+                           Mem[WinWriteSeg:word(offs)+l-1] :=
+                             Mem[WinReadSeg:word(offs)+l-1] And Byte(CurrentColor);
+                       End;
+                     Dec(HLength, l);
+                     inc(offs, l);
+                     {$ifdef logging}
+                     LogLn('Offset is now '+hexstr(offs,8)+', length left: '+strf(hlength));
+                     {$endif logging}
+                     { offs is now 4-bytes alligned }
+                     If HLength <= ($10000-(Offs and $ffff)) Then
+                        bankrest := HLength
+                     else {the rest won't fit anymore in the current window }
+                       bankrest := $10000 - (Offs and $ffff);
+                     {$ifdef logging}
+                     LogLn('Rest to be drawn in this window: '+strf(bankrest));
+                     {$endif logging}
+                     For l := 0 to (Bankrest div 4)-1 Do
+                       MemL[WinWriteSeg:word(offs)+l*4] :=
+                         MemL[WinReadSeg:word(offs)+l*4] And Mask;
+                     inc(offs,l*4+4);
+                     dec(hlength,l*4+4);
+                     {$ifdef logging}
+                     LogLn('Offset is now '+hexstr(offs,8)+', length left: '+strf(hlength));
+                     {$endif logging}
+                   End
+                 Else
+                   Begin
+                     {$ifdef logging}
+                     LogLn('Drawing leftover: '+strf(HLength)+' at offset '+hexstr(offs,8));
+                     {$endif logging}
+                     x := offs mod bytesperline;
+                     For l := 0 to HLength - 1 do
+                       DirectPutPixVESA256(x+l,y);
+                     HLength := 0
+                   End
+               Until HLength = 0;
+             End;
+           XorPut:
+             Begin
+               Repeat
+                 curbank := integer(offs shr 16);
+                 SetWriteBank(curbank);
+                 SetReadBank(curbank);
+                 {$ifdef logging}
+                 LogLn('set bank '+strf(curbank)+' for offset '+hexstr(offs,8));
+                 {$endif logging}
+                 If HLength > 3 Then
+                 { allign target }
+                   Begin
+                     l := 0;
+                     If (offs and 3) <> 0 then
+                     { this cannot go past a window boundary bacause the }
+                     { size of a window is always a multiple of 4        }
+                       Begin
+                         {$ifdef logging}
+                         LogLn('Alligning by drawing '+strf(4-(offs and 3))+' pixels');
+                         {$endif logging}
+                         for l := 1 to 4-(offs and 3) do
+                           Mem[WinWriteSeg:word(offs)+l-1] :=
+                             Mem[WinReadSeg:word(offs)+l-1] Xor Byte(CurrentColor);
+                       End;
+                     Dec(HLength, l);
+                     inc(offs, l);
+                     {$ifdef logging}
+                     LogLn('Offset is now '+hexstr(offs,8)+', length left: '+strf(hlength));
+                     {$endif logging}
+                     { offs is now 4-bytes alligned }
+                     If HLength <= ($10000-(Offs and $ffff)) Then
+                        bankrest := HLength
+                     else {the rest won't fit anymore in the current window }
+                       bankrest := $10000 - (Offs and $ffff);
+                     {$ifdef logging}
+                     LogLn('Rest to be drawn in this window: '+strf(bankrest));
+                     {$endif logging}
+                     For l := 0 to (Bankrest div 4)-1 Do
+                       MemL[WinWriteSeg:word(offs)+l*4] :=
+                         MemL[WinReadSeg:word(offs)+l*4] Xor Mask;
+                     inc(offs,l*4+4);
+                     dec(hlength,l*4+4);
+                     {$ifdef logging}
+                     LogLn('Offset is now '+hexstr(offs,8)+', length left: '+strf(hlength));
+                     {$endif logging}
+                   End
+                 Else
+                   Begin
+                     {$ifdef logging}
+                     LogLn('Drawing leftover: '+strf(HLength)+' at offset '+hexstr(offs,8));
+                     {$endif logging}
+                     x := offs mod bytesperline;
+                     For l := 0 to HLength - 1 do
+                       DirectPutPixVESA256(x+l,y);
+                     HLength := 0
+                   End
+               Until HLength = 0;
+             End;
+           OrPut:
+             Begin
+               Repeat
+                 curbank := integer(offs shr 16);
+                 SetWriteBank(curbank);
+                 SetReadBank(curbank);
+                 {$ifdef logging}
+                 LogLn('set bank '+strf(curbank)+' for offset '+hexstr(offs,8));
+                 {$endif logging}
+                 If HLength > 3 Then
+                 { allign target }
+                   Begin
+                     l := 0;
+                     If (offs and 3) <> 0 then
+                     { this cannot go past a window boundary bacause the }
+                     { size of a window is always a multiple of 4        }
+                       Begin
+                         {$ifdef logging}
+                         LogLn('Alligning by drawing '+strf(4-(offs and 3))+' pixels');
+                         {$endif logging}
+                         for l := 1 to 4-(offs and 3) do
+                           Mem[WinWriteSeg:word(offs)+l-1] :=
+                             Mem[WinReadSeg:word(offs)+l-1] Or Byte(CurrentColor);
+                       End;
+                     Dec(HLength, l);
+                     inc(offs, l);
+                     {$ifdef logging}
+                     LogLn('Offset is now '+hexstr(offs,8)+', length left: '+strf(hlength));
+                     {$endif logging}
+                     { offs is now 4-bytes alligned }
+                     If HLength <= ($10000-(Offs and $ffff)) Then
+                        bankrest := HLength
+                     else {the rest won't fit anymore in the current window }
+                       bankrest := $10000 - (Offs and $ffff);
+                     {$ifdef logging}
+                     LogLn('Rest to be drawn in this window: '+strf(bankrest));
+                     {$endif logging}
+                     For l := 0 to (Bankrest div 4)-1 Do
+                       MemL[WinWriteSeg:offs+l*4] :=
+                         MemL[WinReadSeg:word(offs)+l*4] Or Mask;
+                     inc(offs,l*4+4);
+                     dec(hlength,l*4+4);
+                     {$ifdef logging}
+                     LogLn('Offset is now '+hexstr(offs,8)+', length left: '+strf(hlength));
+                     {$endif logging}
+                   End
+                 Else
+                   Begin
+                     {$ifdef logging}
+                     LogLn('Drawing leftover: '+strf(HLength)+' at offset '+hexstr(offs,8));
+                     {$endif logging}
+                     x := offs mod bytesperline;
+                     For l := 0 to HLength - 1 do
+                       DirectPutPixVESA256(x+l,y);
+                     HLength := 0
+                   End
+               Until HLength = 0;
+             End
+           Else
+             Begin
+               If CurrentWriteMode = NotPut Then
+                 Mask := Not(Mask);
+               Repeat
+                 curbank := integer(offs shr 16);
+                 SetWriteBank(curbank);
+                 {$ifdef logging}
+                 LogLn('set bank '+strf(curbank)+' for offset '+hexstr(offs,8)+' -- '+strf(offs));
+                 {$endif logging}
+                 If HLength > 3 Then
+                 { allign target }
+                   Begin
+                     l := 0;
+                     If (offs and 3) <> 0 then
+                     { this cannot go past a window boundary bacause the }
+                     { size of a window is always a multiple of 4        }
+                       Begin
+                         {$ifdef logging}
+                         LogLn('Alligning by drawing '+strf(4-(offs and 3))+' pixels');
+                         {$endif logging}
+                         for l := 1 to 4-(offs and 3) do
+                           Mem[WinWriteSeg:word(offs)+l-1] := Byte(Mask);
+                       End;
+                     Dec(HLength, l);
+                     inc(offs, l);
+                     {$ifdef logging}
+                     LogLn('Offset is now '+hexstr(offs,8)+', length left: '+strf(hlength));
+                     {$endif logging}
+                     { offs is now 4-bytes alligned }
+                     If HLength <= ($10000-(Offs and $ffff)) Then
+                        bankrest := HLength
+                     else {the rest won't fit anymore in the current window }
+                       bankrest := $10000 - (Offs and $ffff);
+                     {$ifdef logging}
+                     LogLn('Rest to be drawn in this window: '+strf(bankrest)+' -- '+hexstr(bankrest,8));
+                     {$endif logging}
+                     For l := 0 to (Bankrest div 4)-1 Do
+                       MemL[WinWriteSeg:word(offs)+l*4] := Mask;
+                     inc(offs,l*4+4);
+                     dec(hlength,l*4+4);
+                     {$ifdef logging}
+                     LogLn('Offset is now '+hexstr(offs,8)+', length left: '+strf(hlength));
+                     {$endif logging}
+                   End
+                 Else
+                   Begin
+                     {$ifdef logging}
+                     LogLn('Drawing leftover: '+strf(HLength)+' at offset '+hexstr(offs,8));
+                     {$endif logging}
+                     x := offs mod bytesperline;
+                     For l := 0 to HLength - 1 do
+                       DirectPutPixVESA256(x+l,y);
+                     HLength := 0
+                   End
+               Until HLength = 0;
+             End;
+         End;
+       end;
+   end;
+
+  procedure VLineVESA256(x,y,y2: integer); {$ifndef fpc}far;{$endif fpc}
+
+   var Offs: Longint;
+       l, bankrest: longint;
+       curbank, vlength: integer;
+       col: byte;
+   Begin
+    { must we swap the values? }
+    if y > y2 then
+      Begin
+        y := y xor y2;
+        y2 := y xor y2;
+        y:= y xor y2;
+      end;
+    { First convert to global coordinates }
+    X   := X + StartXViewPort;
+    Y   := Y + StartYViewPort;
+    Y2  := Y2 + StartYViewPort;
+    if ClipPixels then
+      Begin
+         if LineClipped(x,y,x,y2,StartXViewPort,StartYViewPort,
+                StartXViewPort+ViewWidth, StartYViewPort+ViewHeight) then
+            exit;
+      end;
+    {$ifdef logging}
+    LogLn('vline '+strf(y)+' - '+strf(y2)+' on '+strf(x)+' in mode '+strf(currentwritemode));
+    {$endif logging}
+    VLength := y2 - y + 1;
+    {$ifdef logging}
+    LogLn('length: '+strf(vlength));
+    {$endif logging}
+    if VLength>0 then
+      begin
+         Offs:=Longint(y)*bytesperline+x;
+         {$ifdef logging}
+         LogLn('Offs: '+strf(offs)+' -- '+hexstr(offs,8));
+         {$endif logging}
+         Case CurrentWriteMode of
+           AndPut:
+             Begin
+               Repeat
+                 curbank := integer(offs shr 16);
+                 SetWriteBank(curbank);
+                 SetReadBank(curbank);
+                 {$ifdef logging}
+                 LogLn('set bank '+strf(curbank)+' for offset '+hexstr(offs,8));
+                 {$endif logging}
+                 If (VLength-1)*bytesperline <= ($10000-(Offs and $ffff)) Then
+                   bankrest := VLength
+                 else {the rest won't fit anymore in the current window }
+                   bankrest := (($10000 - (Offs and $ffff)) div bytesperline)+1;
+                 {$ifdef logging}
+                 LogLn('Rest to be drawn in this window: '+strf(bankrest));
+                 {$endif logging}
+                 For l := 0 to Bankrest-1 Do
+                   begin
+                     Mem[WinWriteSeg:word(offs)] :=
+                       Mem[WinReadSeg:word(offs)] And Byte(CurrentColor);
+                     inc(offs,bytesperline);
+                   end;
+                 dec(VLength,l+1);
+                 {$ifdef logging}
+                 LogLn('Offset is now '+hexstr(offs,8)+', length left: '+strf(hlength));
+                 {$endif logging}
+               Until VLength = 0;
+             End;
+           XorPut:
+             Begin
+               Repeat
+                 curbank := integer(offs shr 16);
+                 SetWriteBank(curbank);
+                 SetReadBank(curbank);
+                 {$ifdef logging}
+                 LogLn('set bank '+strf(curbank)+' for offset '+hexstr(offs,8));
+                 {$endif logging}
+                 If (VLength-1)*bytesperline <= ($10000-(Offs and $ffff)) Then
+                   bankrest := VLength
+                 else {the rest won't fit anymore in the current window }
+                   bankrest := (($10000 - (Offs and $ffff)) div bytesperline)+1;
+                 {$ifdef logging}
+                 LogLn('Rest to be drawn in this window: '+strf(bankrest));
+                 {$endif logging}
+                 For l := 0 to Bankrest-1 Do
+                   begin
+                     Mem[WinWriteSeg:word(offs)] :=
+                       Mem[WinReadSeg:word(offs)] Xor Byte(CurrentColor);
+                     inc(offs,bytesperline);
+                   end;
+                 dec(VLength,l+1);
+                 {$ifdef logging}
+                 LogLn('Offset is now '+hexstr(offs,8)+', length left: '+strf(hlength));
+                 {$endif logging}
+               Until VLength = 0;
+             End;
+           OrPut:
+             Begin
+               Repeat
+                 curbank := integer(offs shr 16);
+                 SetWriteBank(curbank);
+                 SetReadBank(curbank);
+                 {$ifdef logging}
+                 LogLn('set bank '+strf(curbank)+' for offset '+hexstr(offs,8));
+                 {$endif logging}
+                 If (VLength-1)*bytesperline <= ($10000-(Offs and $ffff)) Then
+                   bankrest := VLength
+                 else {the rest won't fit anymore in the current window }
+                   bankrest := (($10000 - (Offs and $ffff)) div bytesperline)+1;
+                 {$ifdef logging}
+                 LogLn('Rest to be drawn in this window: '+strf(bankrest));
+                 {$endif logging}
+                 For l := 0 to Bankrest-1 Do
+                   begin
+                     Mem[WinWriteSeg:word(offs)] :=
+                       Mem[WinReadSeg:word(offs)] Or Byte(CurrentColor);
+                     inc(offs,bytesperline);
+                   end;
+                 dec(VLength,l+1);
+                 {$ifdef logging}
+                 LogLn('Offset is now '+hexstr(offs,8)+', length left: '+strf(hlength));
+                 {$endif logging}
+               Until VLength = 0;
+             End;
+           Else
+             Begin
+               If CurrentWriteMode = NotPut Then
+                 Col := Not(CurrentColor);
+               Repeat
+                 curbank := integer(offs shr 16);
+                 SetWriteBank(curbank);
+                 {$ifdef logging}
+                 LogLn('set bank '+strf(curbank)+' for offset '+hexstr(offs,8));
+                 {$endif logging}
+                 If (VLength-1)*bytesperline <= ($10000-(Offs and $ffff)) Then
+                   bankrest := VLength
+                 else {the rest won't fit anymore in the current window }
+                   bankrest := (($10000 - (Offs and $ffff)) div bytesperline)+1;
+                 {$ifdef logging}
+                 LogLn('Rest to be drawn in this window: '+strf(bankrest));
+                 {$endif logging}
+                 For l := 0 to Bankrest-1 Do
+                   begin
+                     Mem[WinWriteSeg:word(offs)] := Col;
+                     inc(offs,bytesperline);
+                   end;
+                 dec(VLength,l+1);
+                 {$ifdef logging}
+                 LogLn('Offset is now '+hexstr(offs,8)+', length left: '+strf(hlength));
+                 {$endif logging}
+               Until VLength = 0;
+             End;
+         End;
+       end;
+   end;
+
  {************************************************************************}
  {************************************************************************}
  {*                    15/16bit pixels VESA mode routines                *}
  {*                    15/16bit pixels VESA mode routines                *}
  {************************************************************************}
  {************************************************************************}
 
 
-  procedure PutPixVESA32k(x, y : integer; color : word); far;
+  procedure PutPixVESA32k(x, y : integer; color : word); {$ifndef fpc}far;{$endif fpc}
   var
   var
      bank : word;
      bank : word;
      offs : longint;
      offs : longint;
@@ -520,7 +953,7 @@ end;
      memW[WinWriteSeg : word(offs)] := color;
      memW[WinWriteSeg : word(offs)] := color;
   end;
   end;
 
 
-  procedure PutPixVESA64k(x, y : integer; color : word); far;
+  procedure PutPixVESA64k(x, y : integer; color : word); {$ifndef fpc}far;{$endif fpc}
   var
   var
      bank : word;
      bank : word;
      offs : longint;
      offs : longint;
@@ -540,7 +973,7 @@ end;
     memW[WinWriteSeg : word(offs)] := color;
     memW[WinWriteSeg : word(offs)] := color;
   end;
   end;
 
 
-  function GetPixVESA32k(x, y : integer): word; far;
+  function GetPixVESA32k(x, y : integer): word; {$ifndef fpc}far;{$endif fpc}
   var
   var
      bank : word;
      bank : word;
      offs : longint;
      offs : longint;
@@ -552,7 +985,7 @@ end;
      GetPixVESA32k:=memW[WinReadSeg : word(offs)];
      GetPixVESA32k:=memW[WinReadSeg : word(offs)];
   end;
   end;
 
 
-  function GetPixVESA64k(x, y : integer): word; far;
+  function GetPixVESA64k(x, y : integer): word; {$ifndef fpc}far;{$endif fpc}
   var
   var
      bank : word;
      bank : word;
      offs : longint;
      offs : longint;
@@ -564,31 +997,77 @@ end;
      GetPixVESA64k:=memW[WinReadSeg : word(offs)];
      GetPixVESA64k:=memW[WinReadSeg : word(offs)];
   end;
   end;
 
 
-  procedure DirectPutPixVESA32k(x, y : integer); far;
+  procedure DirectPutPixVESA32k(x, y : integer); {$ifndef fpc}far;{$endif fpc}
   var
   var
-     bank : word;
+     bank, col : word;
      offs : longint;
      offs : longint;
   begin
   begin
      offs := longint(y) * BytesPerLine + 2*x;
      offs := longint(y) * BytesPerLine + 2*x;
      SetWriteBank(integer((offs shr 16) and $ff));
      SetWriteBank(integer((offs shr 16) and $ff));
-     memW[WinWriteSeg : word(offs)] := CurrentColor;
+     Case CurrentWriteMode of
+       XorPut:
+         Begin
+           SetReadBank(integer(offs shr 16));
+           memW[WinWriteSeg : word(offs)] := memW[WinReadSeg : word(offs)] xor currentcolor;
+         End;
+       AndPut:
+         Begin
+           SetReadBank(integer(offs shr 16));
+           memW[WinWriteSeg : word(offs)] := memW[WinReadSeg : word(offs)] And currentcolor;
+         End;
+       OrPut:
+         Begin
+           SetReadBank(integer(offs shr 16));
+           memW[WinWriteSeg : word(offs)] := memW[WinReadSeg : word(offs)] or currentcolor;
+         End
+       else
+         Begin
+           If CurrentWriteMode <> NotPut Then
+             col := Byte(CurrentColor)
+           Else col := Not(CurrentColor);
+           memW[WinWriteSeg : word(offs)] := Col;
+         End
+     End;
   end;
   end;
 
 
-  procedure DirectPutPixVESA64k(x, y : integer); far;
+  procedure DirectPutPixVESA64k(x, y : integer); {$ifndef fpc}far;{$endif fpc}
   var
   var
-     bank : word;
+     bank, Col : word;
      offs : longint;
      offs : longint;
   begin
   begin
      offs := longint(y) * BytesPerLine + 2*x;
      offs := longint(y) * BytesPerLine + 2*x;
      SetWriteBank(integer(offs shr 16));
      SetWriteBank(integer(offs shr 16));
-     memW[WinWriteSeg : word(offs)] := CurrentColor;
+     Case CurrentWriteMode of
+       XorPut:
+         Begin
+           SetReadBank(integer(offs shr 16));
+           memW[WinWriteSeg : word(offs)] := memW[WinReadSeg : word(offs)] xor currentcolor;
+         End;
+       AndPut:
+         Begin
+           SetReadBank(integer(offs shr 16));
+           memW[WinWriteSeg : word(offs)] := memW[WinReadSeg : word(offs)] And currentcolor;
+         End;
+       OrPut:
+         Begin
+           SetReadBank(integer(offs shr 16));
+           memW[WinWriteSeg : word(offs)] := memW[WinReadSeg : word(offs)] or currentcolor;
+         End
+       Else
+         Begin
+           If CurrentWriteMode <> NotPut Then
+             col := Byte(CurrentColor)
+           Else col := Not(CurrentColor);
+           memW[WinWriteSeg : word(offs)] := Col;
+         End
+     End;
   end;
   end;
 
 
  {************************************************************************}
  {************************************************************************}
  {*                     4-bit pixels VESA mode routines                  *}
  {*                     4-bit pixels VESA mode routines                  *}
  {************************************************************************}
  {************************************************************************}
 
 
-  procedure PutPixVESA16(x, y : integer; color : word); far;
+  procedure PutPixVESA16(x, y : integer; color : word); {$ifndef fpc}far;{$endif fpc}
     var
     var
      bank : word;
      bank : word;
      offs : longint;
      offs : longint;
@@ -621,7 +1100,7 @@ end;
      { }
      { }
   end;
   end;
 
 
-  procedure DirectPutPixVESA16(x, y : integer); far;
+  procedure DirectPutPixVESA16(x, y : integer); {$ifndef fpc}far;{$endif fpc}
     var
     var
      bank : word;
      bank : word;
      offs : longint;
      offs : longint;
@@ -1132,89 +1611,89 @@ end;
  {*                     VESA Modes inits                                 *}
  {*                     VESA Modes inits                                 *}
  {************************************************************************}
  {************************************************************************}
 
 
- procedure Init1280x1024x64k; far;
+ procedure Init1280x1024x64k; {$ifndef fpc}far;{$endif fpc}
   begin
   begin
     SetVesaMode(m1280x1024x64k);
     SetVesaMode(m1280x1024x64k);
   end;
   end;
 
 
- procedure Init1280x1024x32k; far;
+ procedure Init1280x1024x32k; {$ifndef fpc}far;{$endif fpc}
   begin
   begin
     SetVESAMode(m1280x1024x32k);
     SetVESAMode(m1280x1024x32k);
   end;
   end;
 
 
- procedure Init1280x1024x256; far;
+ procedure Init1280x1024x256; {$ifndef fpc}far;{$endif fpc}
   begin
   begin
     SetVESAMode(m1280x1024x256);
     SetVESAMode(m1280x1024x256);
   end;
   end;
 
 
 
 
- procedure Init1280x1024x16; far;
+ procedure Init1280x1024x16; {$ifndef fpc}far;{$endif fpc}
   begin
   begin
     SetVESAMode(m1280x1024x16);
     SetVESAMode(m1280x1024x16);
   end;
   end;
 
 
- procedure Init1024x768x64k; far;
+ procedure Init1024x768x64k; {$ifndef fpc}far;{$endif fpc}
   begin
   begin
     SetVESAMode(m1024x768x64k);
     SetVESAMode(m1024x768x64k);
   end;
   end;
 
 
- procedure Init640x480x32k; far;
+ procedure Init640x480x32k; {$ifndef fpc}far;{$endif fpc}
   begin
   begin
     SetVESAMode(m640x480x32k);
     SetVESAMode(m640x480x32k);
   end;
   end;
 
 
- procedure Init1024x768x256; far;
+ procedure Init1024x768x256; {$ifndef fpc}far;{$endif fpc}
   begin
   begin
     SetVESAMode(m1024x768x256);
     SetVESAMode(m1024x768x256);
   end;
   end;
 
 
- procedure Init1024x768x16; far;
+ procedure Init1024x768x16; {$ifndef fpc}far;{$endif fpc}
   begin
   begin
     SetVESAMode(m1024x768x16);
     SetVESAMode(m1024x768x16);
   end;
   end;
 
 
- procedure Init800x600x64k; far;
+ procedure Init800x600x64k; {$ifndef fpc}far;{$endif fpc}
   begin
   begin
     SetVESAMode(m800x600x64k);
     SetVESAMode(m800x600x64k);
   end;
   end;
 
 
- procedure Init800x600x32k; far;
+ procedure Init800x600x32k; {$ifndef fpc}far;{$endif fpc}
   begin
   begin
     SetVESAMode(m800x600x32k);
     SetVESAMode(m800x600x32k);
   end;
   end;
 
 
- procedure Init800x600x256; far;
+ procedure Init800x600x256; {$ifndef fpc}far;{$endif fpc}
   begin
   begin
     SetVESAMode(m800x600x256);
     SetVESAMode(m800x600x256);
   end;
   end;
 
 
- procedure Init800x600x16; far;
+ procedure Init800x600x16; {$ifndef fpc}far;{$endif fpc}
   begin
   begin
     SetVesaMode(m800x600x16);
     SetVesaMode(m800x600x16);
   end;
   end;
 
 
- procedure Init640x480x64k; far;
+ procedure Init640x480x64k; {$ifndef fpc}far;{$endif fpc}
   begin
   begin
     SetVESAMode(m640x480x64k);
     SetVESAMode(m640x480x64k);
   end;
   end;
 
 
 
 
- procedure Init640x480x256; far;
+ procedure Init640x480x256; {$ifndef fpc}far;{$endif fpc}
   begin
   begin
     SetVESAMode(m640x480x256);
     SetVESAMode(m640x480x256);
   end;
   end;
 
 
- procedure Init640x400x256; far;
+ procedure Init640x400x256; {$ifndef fpc}far;{$endif fpc}
   begin
   begin
     SetVESAMode(m640x400x256);
     SetVESAMode(m640x400x256);
   end;
   end;
 
 
- procedure Init320x200x64k; far;
+ procedure Init320x200x64k; {$ifndef fpc}far;{$endif fpc}
   begin
   begin
     SetVESAMode(m320x200x64k);
     SetVESAMode(m320x200x64k);
   end;
   end;
 
 
- procedure Init320x200x32k; far;
+ procedure Init320x200x32k; {$ifndef fpc}far;{$endif fpc}
   begin
   begin
     SetVESAMode(m320x200x32k);
     SetVESAMode(m320x200x32k);
   end;
   end;
@@ -1222,7 +1701,7 @@ end;
 
 
 {$IFDEF DPMI}
 {$IFDEF DPMI}
 
 
- Procedure SaveStateVESA;
+ Procedure SaveStateVESA; {$ifndef fpc}far;{$endif fpc}
  var
  var
   PtrLong: longint;
   PtrLong: longint;
   regs: TDPMIRegisters;
   regs: TDPMIRegisters;
@@ -1299,7 +1778,7 @@ end;
       end;
       end;
   end;
   end;
 
 
- procedure RestoreStateVESA;
+ procedure RestoreStateVESA; {$ifndef fpc}far;{$endif fpc}
   var
   var
    regs:TDPMIRegisters;
    regs:TDPMIRegisters;
   begin
   begin
@@ -1429,20 +1908,25 @@ end;
  { Note: These routines, according  to the VBE3 specification, will NOT   }
  { Note: These routines, according  to the VBE3 specification, will NOT   }
  { work with the 24 bpp modes, because of the alignment.                  }
  { work with the 24 bpp modes, because of the alignment.                  }
  {************************************************************************}
  {************************************************************************}
- procedure SetVisualVESA(page: word); far;
+ procedure SetVisualVESA(page: word); {$ifndef fpc}far;{$endif fpc}
   { two page support... }
   { two page support... }
   begin
   begin
     if page > HardwarePages then exit;
     if page > HardwarePages then exit;
   end;
   end;
 
 
- procedure SetActiveVESA(page: word); far;
+ procedure SetActiveVESA(page: word); {$ifndef fpc}far;{$endif fpc}
   { two page support... }
   { two page support... }
   begin
   begin
   end;
   end;
 
 
 {
 {
 $Log$
 $Log$
-Revision 1.11  1999-09-15 11:40:30  jonas
+Revision 1.12  1999-09-18 22:21:11  jonas
+  + hlinevesa256 and vlinevesa256
+  + support for not/xor/or/andput in vesamodes with 32k/64k colors
+  * lots of changes to avoid warnings under FPC
+
+Revision 1.11  1999/09/15 11:40:30  jonas
   * fixed PutPixVESA256
   * fixed PutPixVESA256
 
 
 Revision 1.10  1999/09/11 19:43:02  jonas
 Revision 1.10  1999/09/11 19:43:02  jonas