mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-24 23:29:15 +02:00
* rtl-console: on Amiga added a custom screen update call, to do partial screen updates. doing a full update can be very slow on low-end systems (checking the entire screen buffer every time), so software tuned for these can now request partial updates, when the updated already is already known
This commit is contained in:
parent
22cd8d5d62
commit
9894fe8082
@ -49,6 +49,7 @@ procedure GotInactiveWindow;
|
|||||||
function HasInactiveWindow: boolean;
|
function HasInactiveWindow: boolean;
|
||||||
procedure SetWindowTitle(const winTitle: AnsiString; const screenTitle: AnsiString);
|
procedure SetWindowTitle(const winTitle: AnsiString; const screenTitle: AnsiString);
|
||||||
procedure TranslateToCharXY(const X,Y: LongInt; var CX,CY: LongInt);
|
procedure TranslateToCharXY(const X,Y: LongInt; var CX,CY: LongInt);
|
||||||
|
procedure UpdateScreenPart(const X1,Y1,X2,Y2: Longint; Force: Boolean);
|
||||||
|
|
||||||
var
|
var
|
||||||
VideoWindow: PWindow;
|
VideoWindow: PWindow;
|
||||||
@ -562,13 +563,14 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure SysUpdateScreen(Force: Boolean);
|
|
||||||
|
procedure UpdateScreenPart(const X1,Y1,X2,Y2: Longint; Force: Boolean);
|
||||||
var
|
var
|
||||||
SmallForce: Boolean;
|
SmallForce: Boolean;
|
||||||
Counter, CounterX, CounterY: LongInt;
|
CounterX, CounterY: LongInt;
|
||||||
LocalRP: PRastPort;
|
LocalRP: PRastPort;
|
||||||
sY, sX: LongInt;
|
sY, sX: LongInt;
|
||||||
TmpCharData: Word;
|
BufStartOfs: LongInt;
|
||||||
{$ifdef VideoSpeedTest}
|
{$ifdef VideoSpeedTest}
|
||||||
NumChanged: Integer;
|
NumChanged: Integer;
|
||||||
t,ta: Double;
|
t,ta: Double;
|
||||||
@ -612,16 +614,17 @@ begin
|
|||||||
|
|
||||||
if Smallforce then
|
if Smallforce then
|
||||||
begin
|
begin
|
||||||
VBuf:=@VideoBuf^[0];
|
BufStartOfs:=y1 * ScreenWidth + x1;
|
||||||
OldVBuf:=@OldVideoBuf^[0];
|
VBuf:=@VideoBuf^[BufStartOfs];
|
||||||
|
OldVBuf:=@OldVideoBuf^[BufStartOfs];
|
||||||
{$ifdef VideoSpeedTest}
|
{$ifdef VideoSpeedTest}
|
||||||
t := now();
|
t := now();
|
||||||
{$endif}
|
{$endif}
|
||||||
sY := videoWindow^.borderTop;
|
sY := videoWindow^.borderTop + Y1 * VideoFontHeight;
|
||||||
for CounterY := 0 to ScreenHeight - 1 do
|
for CounterY := Y1 to Y2 do
|
||||||
begin
|
begin
|
||||||
sX := videoWindow^.borderLeft;
|
sX := videoWindow^.borderLeft + X1 * 8;
|
||||||
for CounterX := 0 to ScreenWidth - 1 do
|
for CounterX := X1 to X2 do
|
||||||
begin
|
begin
|
||||||
if (VBuf^ <> OldVBuf^) or Force then
|
if (VBuf^ <> OldVBuf^) or Force then
|
||||||
begin
|
begin
|
||||||
@ -663,6 +666,10 @@ begin
|
|||||||
{$endif}
|
{$endif}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure SysUpdateScreen(Force: Boolean);
|
||||||
|
begin
|
||||||
|
UpdateScreenPart(0,0,ScreenWidth-1,ScreenHeight-1,Force);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure SysSetCursorPos(NewCursorX, NewCursorY: Word);
|
procedure SysSetCursorPos(NewCursorX, NewCursorY: Word);
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user