* Found out the LinerFrameBuffer problem

Was an alignment problem in VesaInfoBlock (see graph.pp file)
    Compile with -dDEBUG and answer 'y' to 'Use Linear ?' to test
This commit is contained in:
pierre 1998-11-20 10:16:00 +00:00
parent aaeb9b6a03
commit f17c6d2911
3 changed files with 63 additions and 65 deletions

View File

@ -287,17 +287,6 @@ begin
Write('Use linear ? '); Write('Use linear ? ');
readln(st); readln(st);
if st='y' then UseLinear:=true; if st='y' then UseLinear:=true;
if UseLinear then
begin
Write('Switch physical address (default true) ? ');
readln(st);
if st='y' then switch_physical_address:=true
else if st='n' then switch_physical_address:=false;
Write('Split physical address (default false) ? ');
readln(st);
if st='y' then split_physical_address:=true
else if st='n' then split_physical_address:=false;
end;
{$endif debug} {$endif debug}
{$endif go32v2} {$endif go32v2}
{$ifdef Linux} {$ifdef Linux}
@ -354,7 +343,12 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.2 1998-11-18 11:45:06 pierre Revision 1.3 1998-11-20 10:16:00 pierre
* Found out the LinerFrameBuffer problem
Was an alignment problem in VesaInfoBlock (see graph.pp file)
Compile with -dDEBUG and answer 'y' to 'Use Linear ?' to test
Revision 1.2 1998/11/18 11:45:06 pierre
* LinearFrameBuffer test added * LinearFrameBuffer test added
Revision 1.1 1998/11/17 18:17:53 pierre Revision 1.1 1998/11/17 18:17:53 pierre

View File

@ -159,9 +159,9 @@ function UnConvert(color:longint):longint;
{$ifdef Test_linear} {$ifdef Test_linear}
const const
UseLinear : boolean = false; UseLinear : boolean = false;
(* Bug was due to alignment problem in VesaInfoBlock !!
{ the two below are the settings the work for ATI 3D Rage Pro !! } { the two below are the settings the work for ATI 3D Rage Pro !! }
switch_physical_address : boolean = true; switch_physical_address : boolean = true;*)
split_physical_address : boolean = false;
{$endif Test_linear} {$endif Test_linear}
{$I MODES.PPI} {$I MODES.PPI}
@ -193,40 +193,46 @@ type
end; end;
VesaInfoBlock=record VesaInfoBlock=record
ModeAttributes : word; ModeAttributes : word; { pos 0 }
WinAAttributes : byte; WinAAttributes : byte; { pos 2 }
WinBAttributes : byte; WinBAttributes : byte; { pos 3 }
WinGranularity : word; WinGranularity : word; { pos 4 }
WinSize : word; WinSize : word; { pos 6 }
segWINA : word; segWINA : word; { pos 8 }
segWINB : word; segWINB : word; { pos $A }
RealWinFuncPtr : longint; RealWinFuncPtr : longint; { pos $C }
BPL : word; BPL : word; { pos $10 }
{ VESA 1.2 } { VESA 1.2 }
XResolution : word; XResolution : word; { pos $12 }
YResolution : word; YResolution : word; { pos $14 }
XCharSize : byte; XCharSize : byte; { pos $16 }
YCharSize : byte; YCharSize : byte; { pos $17 }
MumberOfPlanes : byte; MumberOfPlanes : byte; { pos $18 }
BitsPerPixel : byte; BitsPerPixel : byte; { pos $19 }
NumberOfBanks : byte; NumberOfBanks : byte; { pos $1A }
MemoryModel : byte; MemoryModel : byte; { pos $1B }
BankSize : byte; BankSize : byte; { pos $1C }
NumberOfPages : byte; NumberOfPages : byte; { pos $1D }
reserved : byte; reserved : byte; { pos $1E }
rm_size : byte; rm_size : byte; { pos $1F }
rf_pos : byte; rf_pos : byte; { pos $20 }
gm_size : byte; gm_size : byte; { pos $21 }
gf_pos : byte; gf_pos : byte; { pos $22 }
bm_size : byte; bm_size : byte; { pos $23 }
bf_pos : byte; bf_pos : byte; { pos $24 }
res_mask : word; (* res_mask : word; { pos $25 }
DirectColorInfo: byte; here there was an alignment problem !!
with default alignment
res_mask was shifted to $26
and after PhysAddress to $2A !!! PM *)
res_size : byte;
res_pos : byte;
DirectColorInfo: byte; { pos $27 }
{ VESA 2.0 } { VESA 2.0 }
PhysAddress : longint; PhysAddress : longint; { pos $28 }
OffscreenPtr : longint; OffscreenPtr : longint; { pos $2C }
OffscreenMem : word; OffscreenMem : word; { pos $30 }
reserved2 : Array[1..458]of Byte; reserved2 : Array[1..458]of Byte; { pos $32 }
end; end;
const const
@ -932,7 +938,12 @@ end.
{ {
$Log$ $Log$
Revision 1.9 1998-11-19 15:09:33 pierre Revision 1.10 1998-11-20 10:16:01 pierre
* Found out the LinerFrameBuffer problem
Was an alignment problem in VesaInfoBlock (see graph.pp file)
Compile with -dDEBUG and answer 'y' to 'Use Linear ?' to test
Revision 1.9 1998/11/19 15:09:33 pierre
* several bugfixes for sector/ellipse/floodfill * several bugfixes for sector/ellipse/floodfill
+ graphic driver mode const in interface G800x600x256... + graphic driver mode const in interface G800x600x256...
+ added backput mode as in linux graph.pp + added backput mode as in linux graph.pp

View File

@ -31,7 +31,7 @@ end;
function GetVESAInfo( Mode : WORD ):Boolean; function GetVESAInfo( Mode : WORD ):Boolean;
var Result_:longint; var Result_:longint;
Temp,ReadFrameBufferLinearAddress : longint; Temp : longint;
St : string; St : string;
w : word; w : word;
begin begin
@ -149,24 +149,15 @@ begin
LinearFrameBufferSupported:=false; LinearFrameBufferSupported:=false;
{$ifdef Test_linear} {$ifdef Test_linear}
(* bug was due to alignment problem in VesaInfoBlock !! PM
{ try to swap the FrameBuffer Physical Address } { try to swap the FrameBuffer Physical Address }
if switch_physical_address then if switch_physical_address then
begin begin
w:=VESAInfo.PhysAddress and $FFFF; w:=VESAInfo.PhysAddress and $FFFF;
VESAInfo.PhysAddress:=(w shl 16) or (VESAInfo.PhysAddress shr 16); VESAInfo.PhysAddress:=(w shl 16) or (VESAInfo.PhysAddress shr 16);
end; end; *)
if split_physical_address and not same_window then
begin
ReadFrameBufferLinearAddress:=Get_linear_addr(VESAInfo.PhysAddress and $FFFF0000,VGAInfo.TotalMem shl 16);
if int31error<>0 then
writeln(stderr,'Error in get linear address for ',hexstr(VESAInfo.PhysAddress and $FFFF0000,8));
FrameBufferLinearAddress:=Get_linear_addr((VESAInfo.PhysAddress and $FFFF) shl 16,VGAInfo.TotalMem shl 16);
if int31error<>0 then
writeln(stderr,'Error in get linear address for ',hexstr((VESAInfo.PhysAddress and $FFFF) shl 16,8));
end;
If LinearFrameBufferSupported then If LinearFrameBufferSupported then
begin begin
if same_window or not split_physical_address then
FrameBufferLinearAddress:=Get_linear_addr(VESAInfo.PhysAddress and $FFFF0000,VGAInfo.TotalMem shl 16); FrameBufferLinearAddress:=Get_linear_addr(VESAInfo.PhysAddress and $FFFF0000,VGAInfo.TotalMem shl 16);
if int31error<>0 then if int31error<>0 then
writeln(stderr,'Error in get linear address for ',hexstr(VESAInfo.PhysAddress,8)); writeln(stderr,'Error in get linear address for ',hexstr(VESAInfo.PhysAddress,8));
@ -184,9 +175,6 @@ begin
begin begin
set_segment_base_address(seg_write,FrameBufferLinearAddress); set_segment_base_address(seg_write,FrameBufferLinearAddress);
set_segment_limit(seg_write,(VGAInfo.TotalMem shl 16)-1); set_segment_limit(seg_write,(VGAInfo.TotalMem shl 16)-1);
if split_physical_address and not same_window then
set_segment_base_address(seg_read,ReadFrameBufferLinearAddress)
else
set_segment_base_address(seg_read,FrameBufferLinearAddress); set_segment_base_address(seg_read,FrameBufferLinearAddress);
set_segment_limit(seg_read,(VGAInfo.TotalMem shl 16)-1); set_segment_limit(seg_read,(VGAInfo.TotalMem shl 16)-1);
WinSize:=(VGAInfo.TotalMem shl 16); WinSize:=(VGAInfo.TotalMem shl 16);
@ -304,7 +292,12 @@ end;
{ {
$Log$ $Log$
Revision 1.4 1998-11-18 12:12:54 pierre Revision 1.5 1998-11-20 10:16:02 pierre
* Found out the LinerFrameBuffer problem
Was an alignment problem in VesaInfoBlock (see graph.pp file)
Compile with -dDEBUG and answer 'y' to 'Use Linear ?' to test
Revision 1.4 1998/11/18 12:12:54 pierre
* WinShift was wrong for LinearBuffer * WinShift was wrong for LinearBuffer
Revision 1.3 1998/11/18 09:31:35 pierre Revision 1.3 1998/11/18 09:31:35 pierre