summaryrefslogtreecommitdiff
path: root/packages/graph/src
diff options
context:
space:
mode:
authornickysn <nickysn@3ad0048d-3df7-0310-abae-a5850022a9f2>2010-08-10 00:01:06 +0000
committernickysn <nickysn@3ad0048d-3df7-0310-abae-a5850022a9f2>2010-08-10 00:01:06 +0000
commit5941fb38fb867f168e12bccf4e217c792f3bb2fa (patch)
tree51431e700993c97aa67e7b7e9ecb3ba84843e1d4 /packages/graph/src
parent21b70657286b24f134131bd01d9a7ed3a345721e (diff)
downloadfpc-5941fb38fb867f168e12bccf4e217c792f3bb2fa.tar.gz
VESA 3.0 support
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@15758 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'packages/graph/src')
-rw-r--r--packages/graph/src/go32v2/vesa.inc14
-rw-r--r--packages/graph/src/go32v2/vesah.inc17
2 files changed, 28 insertions, 3 deletions
diff --git a/packages/graph/src/go32v2/vesa.inc b/packages/graph/src/go32v2/vesa.inc
index 73dde9ee47..bbe38a37fe 100644
--- a/packages/graph/src/go32v2/vesa.inc
+++ b/packages/graph/src/go32v2/vesa.inc
@@ -1583,7 +1583,7 @@ end;
PortW[$3ce] := $0001; { Index 01 : Disable ops on all four planes. }
end;
-
+
procedure HLineVESA16(x,x2,y: smallint); {$ifndef fpc}far;{$endif fpc}
var
xtmp: smallint;
@@ -2122,6 +2122,12 @@ Const
function SetupLinear(var ModeInfo: TVESAModeInfo;mode : word) : boolean;
begin
SetUpLinear:=false;
+
+ if VESAInfo.Version >= $0300 then
+ BytesPerLine := VESAModeInfo.LinBytesPerScanLine
+ else
+ BytesPerLine := VESAModeInfo.BytesPerScanLine;
+
{$ifdef FPC}
case mode of
m320x200x32k,
@@ -2219,6 +2225,9 @@ Const
procedure SetupWindows(var ModeInfo: TVESAModeInfo);
begin
InLinear:=false;
+
+ BytesPerLine := VESAModeInfo.BytesPerScanLine;
+
{ now we check the windowing scheme ...}
if (ModeInfo.WinAAttr and WinSupported) <> 0 then
{ is this window supported ... }
@@ -2368,7 +2377,8 @@ Const
Inc(BankShift);
CurrentWriteBank := -1;
CurrentReadBank := -1;
- BytesPerLine := VESAModeInfo.BytesPerScanLine;
+{ nickysn: setting BytesPerLine moved to SetupLinear and SetupWindowed
+ BytesPerLine := VESAModeInfo.BytesPerScanLine;}
{ These are the window adresses ... }
WinWriteSeg := 0; { This is the segment to use for writes }
diff --git a/packages/graph/src/go32v2/vesah.inc b/packages/graph/src/go32v2/vesah.inc
index 8244fdf241..36a0e55e70 100644
--- a/packages/graph/src/go32v2/vesah.inc
+++ b/packages/graph/src/go32v2/vesah.inc
@@ -31,6 +31,7 @@ TYPE
end; { VESA standard because of bugs on }
{ some video cards. }
*)
+ { VESA 1.1 }
TotalMem : word;
{ VESA 2.0 }
OEMversion : word;
@@ -82,7 +83,21 @@ TYPE
PhysAddress : longint; { pos $28 }
OffscreenPtr : longint; { pos $2C }
OffscreenMem : word; { pos $30 }
- reserved2 : Array[1..458]of Byte; { pos $32 }
+ { VESA 3.0 }
+ LinBytesPerScanLine: Word; {bytes per scan line for linear modes}
+ BnkNumberOfImagePages: Byte; {number of images for banked modes}
+ LinNumberOfImagePages: Byte; {number of images for linear modes}
+ LinRedMaskSize: Byte; {size of direct color red mask (linear modes)}
+ LinRedFieldPosition: Byte; {bit position of lsb of red mask (linear modes)}
+ LinGreenMaskSize: Byte; {size of direct color green mask (linear modes)}
+ LinGreenFieldPosition: Byte; {bit position of lsb of green mask (linear modes)}
+ LinBlueMaskSize: Byte; {size of direct color blue mask (linear modes)}
+ LinBlueFieldPosition: Byte; {bit position of lsb of blue mask (linear modes)}
+ LinRsvdMaskSize: Byte; {size of direct color reserved mask (linear modes)}
+ LinRsvdFieldPosition: Byte; {bit position of lsb of reserved mask (linear modes)}
+ MaxPixelClock: longint; {maximum pixel clock (in Hz) for graphics mode}
+
+ reserved2: array [1..189] of Byte; {remainder of ModeInfoBlock}
end;