mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 18:29:18 +02:00
* fixed lastmode at startup for > 25 lines
This commit is contained in:
parent
633fcc0bda
commit
ffe8f6235f
@ -1,10 +1,9 @@
|
|||||||
{$DEFINE SUPMONO} { SUPMONO highlights the support of Monochrome }
|
|
||||||
{
|
{
|
||||||
$Id$
|
$Id$
|
||||||
This file is part of the Free Pascal run time library.
|
This file is part of the Free Pascal run time library.
|
||||||
Copyright (c) 1993-98 by the Free Pascal development team.
|
Copyright (c) 1993-98 by the Free Pascal development team.
|
||||||
|
|
||||||
Borland Pascal 7 Compatible CRT Unit for Go32V1 and Go32V2
|
Borland Pascal 7 Compatible CRT Unit for Go32V2
|
||||||
|
|
||||||
See the file COPYING.FPC, included in this distribution,
|
See the file COPYING.FPC, included in this distribution,
|
||||||
for details about the copyright.
|
for details about the copyright.
|
||||||
@ -102,13 +101,10 @@ uses
|
|||||||
{$ASMMODE ATT}
|
{$ASMMODE ATT}
|
||||||
|
|
||||||
var
|
var
|
||||||
DelayCnt, { don't modify this var name, as it is hard coded }
|
DelayCnt,
|
||||||
ScreenWidth,
|
ScreenWidth,
|
||||||
ScreenHeight : longint;
|
ScreenHeight : longint;
|
||||||
{$IFDEF SUPMONO}
|
|
||||||
VidSeg : Word;
|
VidSeg : Word;
|
||||||
{$ENDIF}
|
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
definition of textrec is in textrec.inc
|
definition of textrec is in textrec.inc
|
||||||
@ -132,9 +128,8 @@ end;
|
|||||||
function GetScreenHeight : longint;
|
function GetScreenHeight : longint;
|
||||||
begin
|
begin
|
||||||
getscreenheight:=mem[$40:$84]+1;
|
getscreenheight:=mem[$40:$84]+1;
|
||||||
{$IFDEF SUPMONO}
|
If mem[$40:$84]=0 then
|
||||||
If mem[$40:$84]=0 then getscreenheight := 25;
|
getscreenheight := 25;
|
||||||
{$ENDIF}
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -334,19 +329,11 @@ var
|
|||||||
begin
|
begin
|
||||||
fil:=32 or (textattr shl 8);
|
fil:=32 or (textattr shl 8);
|
||||||
if FullWin then
|
if FullWin then
|
||||||
{$IFDEF SUPMONO}
|
|
||||||
DosmemFillWord(VidSeg,0,ScreenHeight*ScreenWidth,fil)
|
DosmemFillWord(VidSeg,0,ScreenHeight*ScreenWidth,fil)
|
||||||
{$ELSE}
|
|
||||||
DosmemFillWord($b800,0,ScreenHeight*ScreenWidth,fil)
|
|
||||||
{$ENDIF}
|
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
for y:=WinMinY to WinMaxY do
|
for y:=WinMinY to WinMaxY do
|
||||||
{$IFDEF SUPMONO}
|
|
||||||
DosmemFillWord(VidSeg,((y-1)*ScreenWidth+(WinMinX-1))*2,WinMaxX-WinMinX+1,fil);
|
DosmemFillWord(VidSeg,((y-1)*ScreenWidth+(WinMinX-1))*2,WinMaxX-WinMinX+1,fil);
|
||||||
{$ELSE}
|
|
||||||
DosmemFillWord($b800,((y-1)*ScreenWidth+(WinMinX-1))*2,WinMaxX-WinMinX+1,fil);
|
|
||||||
{$ENDIF}
|
|
||||||
end;
|
end;
|
||||||
Gotoxy(1,1);
|
Gotoxy(1,1);
|
||||||
end;
|
end;
|
||||||
@ -363,11 +350,7 @@ Begin
|
|||||||
GetScreenCursor(x,y);
|
GetScreenCursor(x,y);
|
||||||
fil:=32 or (textattr shl 8);
|
fil:=32 or (textattr shl 8);
|
||||||
if x<WinMaxX then
|
if x<WinMaxX then
|
||||||
{$IFDEF SUPMONO}
|
|
||||||
DosmemFillword(VidSeg,((y-1)*ScreenWidth+(x-1))*2,WinMaxX-x+1,fil);
|
DosmemFillword(VidSeg,((y-1)*ScreenWidth+(x-1))*2,WinMaxX-x+1,fil);
|
||||||
{$ELSE}
|
|
||||||
DosmemFillword($b800,((y-1)*ScreenWidth+(x-1))*2,WinMaxX-x+1,fil);
|
|
||||||
{$ENDIF}
|
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
|
||||||
@ -549,20 +532,11 @@ begin
|
|||||||
y:=WinMinY+y-1;
|
y:=WinMinY+y-1;
|
||||||
While (y<WinMaxY) do
|
While (y<WinMaxY) do
|
||||||
begin
|
begin
|
||||||
{$IFDEF SUPMONO}
|
|
||||||
dosmemmove(VidSeg,(y*ScreenWidth+(WinMinX-1))*2,
|
dosmemmove(VidSeg,(y*ScreenWidth+(WinMinX-1))*2,
|
||||||
VidSeg,((y-1)*ScreenWidth+(WinMinX-1))*2,(WinMaxX-WinMinX+1)*2);
|
VidSeg,((y-1)*ScreenWidth+(WinMinX-1))*2,(WinMaxX-WinMinX+1)*2);
|
||||||
{$ELSE}
|
|
||||||
dosmemmove($b800,(y*ScreenWidth+(WinMinX-1))*2,
|
|
||||||
$b800,((y-1)*ScreenWidth+(WinMinX-1))*2,(WinMaxX-WinMinX+1)*2);
|
|
||||||
{$ENDIF}
|
|
||||||
inc(y);
|
inc(y);
|
||||||
end;
|
end;
|
||||||
{$IFDEF SUPMONO}
|
|
||||||
dosmemfillword(VidSeg,((WinMaxY-1)*ScreenWidth+(WinMinX-1))*2,(WinMaxX-WinMinX+1),fil);
|
dosmemfillword(VidSeg,((WinMaxY-1)*ScreenWidth+(WinMinX-1))*2,(WinMaxX-WinMinX+1),fil);
|
||||||
{$ELSE}
|
|
||||||
dosmemfillword($b800,((WinMaxY-1)*ScreenWidth+(WinMinX-1))*2,(WinMaxX-WinMinX+1),fil);
|
|
||||||
{$ENDIF}
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -582,20 +556,11 @@ begin
|
|||||||
my:=WinMaxY-WinMinY;
|
my:=WinMaxY-WinMinY;
|
||||||
while (my>=y) do
|
while (my>=y) do
|
||||||
begin
|
begin
|
||||||
{$IFDEF SUPMONO}
|
|
||||||
dosmemmove(VidSeg,(((WinMinY+my-1)-1)*ScreenWidth+(WinMinX-1))*2,
|
dosmemmove(VidSeg,(((WinMinY+my-1)-1)*ScreenWidth+(WinMinX-1))*2,
|
||||||
VidSeg,(((WinMinY+my)-1)*ScreenWidth+(WinMinX-1))*2,(WinMaxX-WinMinX+1)*2);
|
VidSeg,(((WinMinY+my)-1)*ScreenWidth+(WinMinX-1))*2,(WinMaxX-WinMinX+1)*2);
|
||||||
{$ELSE}
|
|
||||||
dosmemmove($b800,(((WinMinY+my-1)-1)*ScreenWidth+(WinMinX-1))*2,
|
|
||||||
$b800,(((WinMinY+my)-1)*ScreenWidth+(WinMinX-1))*2,(WinMaxX-WinMinX+1)*2);
|
|
||||||
{$ENDIF}
|
|
||||||
dec(my);
|
dec(my);
|
||||||
end;
|
end;
|
||||||
{$IFDEF SUPMONO}
|
|
||||||
dosmemfillword(VidSeg,(((WinMinY+y-1)-1)*ScreenWidth+(WinMinX-1))*2,(WinMaxX-WinMinX+1),fil);
|
dosmemfillword(VidSeg,(((WinMinY+y-1)-1)*ScreenWidth+(WinMinX-1))*2,(WinMaxX-WinMinX+1),fil);
|
||||||
{$ELSE}
|
|
||||||
dosmemfillword($b800,(((WinMinY+y-1)-1)*ScreenWidth+(WinMinX-1))*2,(WinMaxX-WinMinX+1),fil);
|
|
||||||
{$ENDIF}
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -611,10 +576,10 @@ var
|
|||||||
begin
|
begin
|
||||||
regs.realeax:=$0100;
|
regs.realeax:=$0100;
|
||||||
regs.realecx:=$90A;
|
regs.realecx:=$90A;
|
||||||
{$IFDEF SUPMONO}
|
If VidSeg=$b800 then
|
||||||
If VidSeg=$b800 then regs.realecx:=$90A
|
regs.realecx:=$90A
|
||||||
else regs.realecx:=$b0d;
|
else
|
||||||
{$ENDIF}
|
regs.realecx:=$b0d;
|
||||||
realintr($10,regs);
|
realintr($10,regs);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -664,11 +629,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
{$IFDEF SUPMONO}
|
|
||||||
memw[VidSeg:((CurrY-1)*ScreenWidth+(CurrX-1))*2]:=(textattr shl 8) or byte(c);
|
memw[VidSeg:((CurrY-1)*ScreenWidth+(CurrX-1))*2]:=(textattr shl 8) or byte(c);
|
||||||
{$ELSE}
|
|
||||||
memw[$b800:((CurrY-1)*ScreenWidth+(CurrX-1))*2]:=(textattr shl 8) or byte(c);
|
|
||||||
{$ENDIF}
|
|
||||||
inc(CurrX);
|
inc(CurrX);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -829,20 +790,17 @@ begin
|
|||||||
{ Load startup values }
|
{ Load startup values }
|
||||||
ScreenWidth:=GetScreenWidth;
|
ScreenWidth:=GetScreenWidth;
|
||||||
ScreenHeight:=GetScreenHeight;
|
ScreenHeight:=GetScreenHeight;
|
||||||
{$IFDEF SUPMONO}
|
|
||||||
If ScreenHeight=0 then ScreenHeight:=24; { bug in my NEC BIOS }
|
|
||||||
{$ENDIF}
|
|
||||||
WindMax:=(ScreenWidth-1) or ((ScreenHeight-1) shl 8);
|
WindMax:=(ScreenWidth-1) or ((ScreenHeight-1) shl 8);
|
||||||
{ Load TextAttr }
|
{ Load TextAttr }
|
||||||
GetScreenCursor(x,y);
|
GetScreenCursor(x,y);
|
||||||
lastmode := mem[$40:$49];
|
lastmode := mem[$40:$49];
|
||||||
{$IFDEF SUPMONO}
|
if screenheight>25 then
|
||||||
If not(lastmode=Mono) then VidSeg := $b800
|
lastmode:=lastmode or $100;
|
||||||
else VidSeg := $b000;
|
If not(lastmode=Mono) then
|
||||||
|
VidSeg := $b800
|
||||||
|
else
|
||||||
|
VidSeg := $b000;
|
||||||
TextAttr:=mem[VidSeg:((y-1)*ScreenWidth+(x-1))*2+1];
|
TextAttr:=mem[VidSeg:((y-1)*ScreenWidth+(x-1))*2+1];
|
||||||
{$ELSE}
|
|
||||||
TextAttr:=mem[$b800:((y-1)*ScreenWidth+(x-1))*2+1];
|
|
||||||
{$ENDIF}
|
|
||||||
{ Redirect the standard output }
|
{ Redirect the standard output }
|
||||||
assigncrt(Output);
|
assigncrt(Output);
|
||||||
Rewrite(Output);
|
Rewrite(Output);
|
||||||
@ -856,12 +814,13 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.3 1999-02-03 09:56:17 florian
|
Revision 1.4 1999-03-26 00:00:17 peter
|
||||||
|
* fixed lastmode at startup for > 25 lines
|
||||||
|
|
||||||
|
Revision 1.3 1999/02/03 09:56:17 florian
|
||||||
+ added simple support for monochrome video cards (not cursors yet),
|
+ added simple support for monochrome video cards (not cursors yet),
|
||||||
thanks to Jeff Patterson
|
thanks to Jeff Patterson
|
||||||
|
|
||||||
Tue 02-02-99 08:36 am jeff
|
|
||||||
+ added simple support for monochrome video cards (not cursors yet)
|
|
||||||
Revision 1.2 1999/01/22 11:12:09 florian
|
Revision 1.2 1999/01/22 11:12:09 florian
|
||||||
+ support of font8x8 added
|
+ support of font8x8 added
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user