mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 19:29:39 +02:00
* rtl-console: slight refactor of how Amiga SysUpdateScreen() addresses the videobuf. this results in slightly more optimal code with less complex addressing, which helps low-end processors
This commit is contained in:
parent
5264e48d90
commit
cc7c328a7c
@ -564,19 +564,20 @@ end;
|
|||||||
|
|
||||||
procedure SysUpdateScreen(Force: Boolean);
|
procedure SysUpdateScreen(Force: Boolean);
|
||||||
var
|
var
|
||||||
BufCounter: Longint;
|
|
||||||
SmallForce: Boolean;
|
SmallForce: Boolean;
|
||||||
Counter, CounterX, CounterY: LongInt;
|
Counter, CounterX, CounterY: LongInt;
|
||||||
NumChanged: Integer;
|
|
||||||
LocalRP: PRastPort;
|
LocalRP: PRastPort;
|
||||||
sY, sX: LongInt;
|
sY, sX: LongInt;
|
||||||
TmpCharData: Word;
|
TmpCharData: Word;
|
||||||
{$ifdef VideoSpeedTest}
|
{$ifdef VideoSpeedTest}
|
||||||
|
NumChanged: Integer;
|
||||||
t,ta: Double;
|
t,ta: Double;
|
||||||
{$endif}
|
{$endif}
|
||||||
|
VBuf,OldVBuf: PWord;
|
||||||
begin
|
begin
|
||||||
{$ifdef VideoSpeedTest}
|
{$ifdef VideoSpeedTest}
|
||||||
ta := now();
|
ta := now();
|
||||||
|
NumChanged := 0;
|
||||||
{$endif}
|
{$endif}
|
||||||
SmallForce := False;
|
SmallForce := False;
|
||||||
|
|
||||||
@ -621,12 +622,10 @@ begin
|
|||||||
LocalRP := BufRp;
|
LocalRP := BufRp;
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
BufCounter:=0;
|
|
||||||
NumChanged:=0;
|
|
||||||
|
|
||||||
|
|
||||||
if Smallforce then
|
if Smallforce then
|
||||||
begin
|
begin
|
||||||
|
VBuf:=@VideoBuf^[0];
|
||||||
|
OldVBuf:=@OldVideoBuf^[0];
|
||||||
{$ifdef VideoSpeedTest}
|
{$ifdef VideoSpeedTest}
|
||||||
t := now();
|
t := now();
|
||||||
{$endif}
|
{$endif}
|
||||||
@ -636,15 +635,17 @@ begin
|
|||||||
sX := videoWindow^.borderLeft;
|
sX := videoWindow^.borderLeft;
|
||||||
for CounterX := 0 to ScreenWidth - 1 do
|
for CounterX := 0 to ScreenWidth - 1 do
|
||||||
begin
|
begin
|
||||||
if (VideoBuf^[BufCounter] <> OldVideoBuf^[BufCounter]) or Force then
|
if (VBuf^ <> OldVBuf^) or Force then
|
||||||
begin
|
begin
|
||||||
TmpCharData := VideoBuf^[BufCounter];
|
SetABPenDrMd(LocalRP, VideoPens[(VBuf^ shr 8) and %00001111], VideoPens[(VBuf^ shr 12) and %00000111], JAM2);
|
||||||
SetABPenDrMd(LocalRP, VideoPens[(TmpCharData shr 8) and %00001111], VideoPens[(TmpCharData shr 12) and %00000111], JAM2);
|
BltTemplate(CharPointers[VBuf^ and $FF], 0, SrcMod, LocalRP, sX, sY, 8, VideoFontHeight);
|
||||||
BltTemplate(CharPointers[TmpCharData and $FF], 0, SrcMod, LocalRP, sX, sY, 8, VideoFontHeight);
|
OldVBuf^:=VBuf^;
|
||||||
OldVideoBuf^[BufCounter] := VideoBuf^[BufCounter];
|
{$ifdef VideoSpeedTest}
|
||||||
Inc(NumChanged);
|
Inc(NumChanged);
|
||||||
|
{$endif}
|
||||||
end;
|
end;
|
||||||
Inc(BufCounter);
|
Inc(VBuf);
|
||||||
|
Inc(OldVBuf);
|
||||||
sX := sX + 8;
|
sX := sX + 8;
|
||||||
end;
|
end;
|
||||||
sY := sY + VideoFontHeight;
|
sY := sY + VideoFontHeight;
|
||||||
|
Loading…
Reference in New Issue
Block a user