* 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 ? ');
readln(st);
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 go32v2}
{$ifdef Linux}
@ -354,7 +343,12 @@ begin
end.
{
$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
Revision 1.1 1998/11/17 18:17:53 pierre

View File

@ -159,9 +159,9 @@ function UnConvert(color:longint):longint;
{$ifdef Test_linear}
const
UseLinear : boolean = false;
(* Bug was due to alignment problem in VesaInfoBlock !!
{ the two below are the settings the work for ATI 3D Rage Pro !! }
switch_physical_address : boolean = true;
split_physical_address : boolean = false;
switch_physical_address : boolean = true;*)
{$endif Test_linear}
{$I MODES.PPI}
@ -193,40 +193,46 @@ type
end;
VesaInfoBlock=record
ModeAttributes : word;
WinAAttributes : byte;
WinBAttributes : byte;
WinGranularity : word;
WinSize : word;
segWINA : word;
segWINB : word;
RealWinFuncPtr : longint;
BPL : word;
ModeAttributes : word; { pos 0 }
WinAAttributes : byte; { pos 2 }
WinBAttributes : byte; { pos 3 }
WinGranularity : word; { pos 4 }
WinSize : word; { pos 6 }
segWINA : word; { pos 8 }
segWINB : word; { pos $A }
RealWinFuncPtr : longint; { pos $C }
BPL : word; { pos $10 }
{ VESA 1.2 }
XResolution : word;
YResolution : word;
XCharSize : byte;
YCharSize : byte;
MumberOfPlanes : byte;
BitsPerPixel : byte;
NumberOfBanks : byte;
MemoryModel : byte;
BankSize : byte;
NumberOfPages : byte;
reserved : byte;
rm_size : byte;
rf_pos : byte;
gm_size : byte;
gf_pos : byte;
bm_size : byte;
bf_pos : byte;
res_mask : word;
DirectColorInfo: byte;
XResolution : word; { pos $12 }
YResolution : word; { pos $14 }
XCharSize : byte; { pos $16 }
YCharSize : byte; { pos $17 }
MumberOfPlanes : byte; { pos $18 }
BitsPerPixel : byte; { pos $19 }
NumberOfBanks : byte; { pos $1A }
MemoryModel : byte; { pos $1B }
BankSize : byte; { pos $1C }
NumberOfPages : byte; { pos $1D }
reserved : byte; { pos $1E }
rm_size : byte; { pos $1F }
rf_pos : byte; { pos $20 }
gm_size : byte; { pos $21 }
gf_pos : byte; { pos $22 }
bm_size : byte; { pos $23 }
bf_pos : byte; { pos $24 }
(* res_mask : word; { pos $25 }
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 }
PhysAddress : longint;
OffscreenPtr : longint;
OffscreenMem : word;
reserved2 : Array[1..458]of Byte;
PhysAddress : longint; { pos $28 }
OffscreenPtr : longint; { pos $2C }
OffscreenMem : word; { pos $30 }
reserved2 : Array[1..458]of Byte; { pos $32 }
end;
const
@ -932,7 +938,12 @@ end.
{
$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
+ graphic driver mode const in interface G800x600x256...
+ added backput mode as in linux graph.pp

View File

@ -31,7 +31,7 @@ end;
function GetVESAInfo( Mode : WORD ):Boolean;
var Result_:longint;
Temp,ReadFrameBufferLinearAddress : longint;
Temp : longint;
St : string;
w : word;
begin
@ -149,25 +149,16 @@ begin
LinearFrameBufferSupported:=false;
{$ifdef Test_linear}
(* bug was due to alignment problem in VesaInfoBlock !! PM
{ try to swap the FrameBuffer Physical Address }
if switch_physical_address then
begin
w:=VESAInfo.PhysAddress and $FFFF;
VESAInfo.PhysAddress:=(w shl 16) or (VESAInfo.PhysAddress shr 16);
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;
end; *)
If LinearFrameBufferSupported then
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
writeln(stderr,'Error in get linear address for ',hexstr(VESAInfo.PhysAddress,8));
end
@ -184,10 +175,7 @@ begin
begin
set_segment_base_address(seg_write,FrameBufferLinearAddress);
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);
WinSize:=(VGAInfo.TotalMem shl 16);
WinLoMask:=(VGAInfo.TotalMem shl 16)-1;
@ -304,7 +292,12 @@ end;
{
$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
Revision 1.3 1998/11/18 09:31:35 pierre