* CGA modes are now supported on a real CGA or EGA (tested with dosbox, machine=cga/ega)

git-svn-id: trunk@15967 -
This commit is contained in:
nickysn 2010-09-11 17:56:36 +00:00
parent 7ba956d121
commit ed5fa8daf0

View File

@ -3419,6 +3419,7 @@ const CrtAddress: word = 0;
var var
HGCDetected : Boolean; HGCDetected : Boolean;
CGADetected : Boolean; { TRUE means real CGA, *not* EGA or VGA }
EGADetected : Boolean; { TRUE means EGA or higher (VGA) } EGADetected : Boolean; { TRUE means EGA or higher (VGA) }
VGADetected : Boolean; VGADetected : Boolean;
mode: TModeInfo; mode: TModeInfo;
@ -3432,6 +3433,7 @@ const CrtAddress: word = 0;
HGCDetected := FALSE; HGCDetected := FALSE;
CGADetected := FALSE;
EGADetected := FALSE; EGADetected := FALSE;
VGADetected := FALSE; VGADetected := FALSE;
{ check if EGA adapter supPorted... } { check if EGA adapter supPorted... }
@ -3512,6 +3514,8 @@ const CrtAddress: word = 0;
begin begin
{ check if Hercules adapter supPorted ... } { check if Hercules adapter supPorted ... }
HGCDetected := Test6845($3B4); HGCDetected := Test6845($3B4);
{ check if CGA adapter supPorted ... }
CGADetected := Test6845($3D4);
end; end;
if HGCDetected then if HGCDetected then
begin begin
@ -3546,16 +3550,15 @@ const CrtAddress: word = 0;
mode.YAspect := 10000; mode.YAspect := 10000;
AddMode(mode); AddMode(mode);
end; end;
if VGADetected then if CGADetected or EGADetected then
begin begin
{ HACK:
until we create Save/RestoreStateCGA, we use Save/RestoreStateVGA
with the inWindows flag enabled (so we only save the mode number
and nothing else) }
inWindows := true;
SaveVideoState := @SaveStateVGA; SaveVideoState := @SaveStateVGA;
{$ifdef logging}
LogLn('Setting VGA SaveVideoState to '+strf(longint(SaveVideoState)));
{$endif logging}
RestoreVideoState := @RestoreStateVGA; RestoreVideoState := @RestoreStateVGA;
{$ifdef logging}
LogLn('Setting VGA RestoreVideoState to '+strf(longint(RestoreVideoState)));
{$endif logging}
{ now add all standard CGA modes... } { now add all standard CGA modes... }
InitMode(mode); InitMode(mode);
@ -3677,6 +3680,18 @@ const CrtAddress: word = 0;
mode.XAspect := 4167; mode.XAspect := 4167;
mode.YAspect := 10000; mode.YAspect := 10000;
AddMode(mode); AddMode(mode);
end;
if VGADetected then
begin
SaveVideoState := @SaveStateVGA;
{$ifdef logging}
LogLn('Setting VGA SaveVideoState to '+strf(longint(SaveVideoState)));
{$endif logging}
RestoreVideoState := @RestoreStateVGA;
{$ifdef logging}
LogLn('Setting VGA RestoreVideoState to '+strf(longint(RestoreVideoState)));
{$endif logging}
{ now add all standard MCGA modes... } { now add all standard MCGA modes... }
{ yes, most of these are the same as the CGA modes; this is TP7 { yes, most of these are the same as the CGA modes; this is TP7