mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 18:49:15 +02:00
* another little optimization of UpdateScreen
This commit is contained in:
parent
4bf53f34e3
commit
67c9365e28
@ -436,88 +436,86 @@ begin
|
|||||||
if LockUpdateScreen = 0 then
|
if LockUpdateScreen = 0 then
|
||||||
begin
|
begin
|
||||||
if not (Force) then
|
if not (Force) then
|
||||||
begin
|
asm
|
||||||
|
cld
|
||||||
{$IFDEF BIT_32}
|
{$IFDEF BIT_32}
|
||||||
asm
|
mov esi, VideoBuf
|
||||||
cld
|
mov edi, OldVideoBuf
|
||||||
mov esi, VideoBuf
|
mov eax, VideoBufSize
|
||||||
mov edi, OldVideoBuf
|
mov ecx, eax
|
||||||
mov eax, VideoBufSize
|
shr ecx, 1
|
||||||
mov ecx, eax
|
shr ecx, 1
|
||||||
shr ecx
|
repe
|
||||||
shr ecx
|
cmpsd
|
||||||
repe
|
je @no_update
|
||||||
cmpsd
|
inc ecx
|
||||||
inc cx
|
mov edx, eax
|
||||||
mov SOfs, ecx
|
mov ebx, ecx
|
||||||
or ecx, ecx
|
shl ebx, 1
|
||||||
jz @no_update
|
shl ebx, 1
|
||||||
mov Force, 1
|
sub edx, ebx
|
||||||
std
|
mov SOfs, edx
|
||||||
mov edi, eax
|
mov Force, 1
|
||||||
mov esi, VideoBuf
|
std
|
||||||
add eax, esi
|
mov edi, eax
|
||||||
sub eax, 4
|
mov esi, VideoBuf
|
||||||
mov esi, eax
|
add eax, esi
|
||||||
mov eax, OldVideoBuf
|
sub eax, 4
|
||||||
add eax, edi
|
mov esi, eax
|
||||||
sub eax, 4
|
mov eax, OldVideoBuf
|
||||||
mov edi, eax
|
add eax, edi
|
||||||
repe
|
sub eax, 4
|
||||||
cmpsd
|
mov edi, eax
|
||||||
inc ecx
|
repe
|
||||||
shl ecx
|
cmpsd
|
||||||
shl ecx
|
inc ecx
|
||||||
mov CLen, ecx
|
shl ecx, 1
|
||||||
cld
|
shl ecx, 1
|
||||||
|
mov CLen, ecx
|
||||||
@no_update:
|
@no_update:
|
||||||
end;
|
|
||||||
SOfs := VideoBufSize - (SOfs shl 2);
|
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
asm
|
push ds
|
||||||
cld
|
lds si, VideoBuf
|
||||||
push ds
|
les di, OldVideoBuf
|
||||||
lds si, VideoBuf
|
mov ax, word ptr VideoBufSize
|
||||||
les di, OldVideoBuf
|
mov cx, ax
|
||||||
mov ax, word ptr VideoBufSize
|
shr cx, 1
|
||||||
mov cx, ax
|
repe
|
||||||
shr cx
|
cmpsw
|
||||||
repe
|
jz @no_update
|
||||||
cmpsw
|
inc cx
|
||||||
inc cx
|
mov dx, ax
|
||||||
mov SOfs, cx
|
mov bx, cx
|
||||||
or cx, cx
|
shl bx, 1
|
||||||
jz @no_update
|
sub dx, bx
|
||||||
mov Force, 1
|
mov SOfs, dx
|
||||||
std
|
mov Force, 1
|
||||||
mov di, ax
|
std
|
||||||
mov si, offset VideoBuf
|
mov di, ax
|
||||||
add ax, si
|
mov si, offset VideoBuf
|
||||||
dec ax
|
add ax, si
|
||||||
dec ax
|
dec ax
|
||||||
mov si, ax
|
dec ax
|
||||||
mov ax, offset OldVideoBuf
|
mov si, ax
|
||||||
add ax, di
|
mov ax, offset OldVideoBuf
|
||||||
dec ax
|
add ax, di
|
||||||
dec ax
|
dec ax
|
||||||
mov di, ax
|
dec ax
|
||||||
repe
|
mov di, ax
|
||||||
cmpsw
|
repe
|
||||||
inc cx
|
cmpsw
|
||||||
shl cx
|
inc cx
|
||||||
mov CLen, cx
|
shl cx, 1
|
||||||
cld
|
mov CLen, cx
|
||||||
@no_update:
|
@no_update:
|
||||||
pop ds
|
pop ds
|
||||||
end;
|
|
||||||
Inc (SOfs);
|
|
||||||
SOfs := VideoBufSize - (SOfs shl 1);
|
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end else
|
end
|
||||||
begin
|
else
|
||||||
SOfs := 0;
|
begin
|
||||||
CLen := VideoBufSize;
|
SOfs := 0;
|
||||||
end;
|
CLen := VideoBufSize;
|
||||||
|
end;
|
||||||
if Force then
|
if Force then
|
||||||
begin
|
begin
|
||||||
VioShowBuf (SOfs, CLen, 0);
|
VioShowBuf (SOfs, CLen, 0);
|
||||||
@ -531,7 +529,10 @@ end;
|
|||||||
{
|
{
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.11 2000-10-15 20:52:56 hajny
|
Revision 1.12 2001-01-23 20:21:45 hajny
|
||||||
|
* another little optimization of UpdateScreen
|
||||||
|
|
||||||
|
Revision 1.11 2000/10/15 20:52:56 hajny
|
||||||
* optimization of UpdateScreen finished
|
* optimization of UpdateScreen finished
|
||||||
|
|
||||||
Revision 1.10 2000/10/11 20:10:04 hajny
|
Revision 1.10 2000/10/11 20:10:04 hajny
|
||||||
|
@ -370,46 +370,50 @@ begin
|
|||||||
if LockUpdateScreen = 0 then
|
if LockUpdateScreen = 0 then
|
||||||
begin
|
begin
|
||||||
if not (Force) then
|
if not (Force) then
|
||||||
begin
|
if not (Force) then
|
||||||
asm
|
asm
|
||||||
cld
|
cld
|
||||||
mov esi, VideoBuf
|
{$IFDEF BIT_32}
|
||||||
mov edi, OldVideoBuf
|
mov esi, VideoBuf
|
||||||
mov eax, VideoBufSize
|
mov edi, OldVideoBuf
|
||||||
mov ecx, eax
|
mov eax, VideoBufSize
|
||||||
shr ecx
|
mov ecx, eax
|
||||||
shr ecx
|
shr ecx, 1
|
||||||
repe
|
shr ecx, 1
|
||||||
cmpsd
|
repe
|
||||||
je @no_update
|
cmpsd
|
||||||
inc cx
|
je @no_update
|
||||||
mov SOfs, ecx
|
inc ecx
|
||||||
mov Force, 1
|
mov edx, eax
|
||||||
std
|
mov ebx, ecx
|
||||||
mov edi, eax
|
shl ebx, 1
|
||||||
mov esi, VideoBuf
|
shl ebx, 1
|
||||||
add eax, esi
|
sub edx, ebx
|
||||||
sub eax, 4
|
mov SOfs, edx
|
||||||
mov esi, eax
|
mov Force, 1
|
||||||
mov eax, OldVideoBuf
|
std
|
||||||
add eax, edi
|
mov edi, eax
|
||||||
sub eax, 4
|
mov esi, VideoBuf
|
||||||
mov edi, eax
|
add eax, esi
|
||||||
repe
|
sub eax, 4
|
||||||
cmpsd
|
mov esi, eax
|
||||||
inc ecx
|
mov eax, OldVideoBuf
|
||||||
shl ecx
|
add eax, edi
|
||||||
shl ecx
|
sub eax, 4
|
||||||
mov CLen, ecx
|
mov edi, eax
|
||||||
cld
|
repe
|
||||||
|
cmpsd
|
||||||
|
inc ecx
|
||||||
|
shl ecx, 1
|
||||||
|
shl ecx, 1
|
||||||
|
mov CLen, ecx
|
||||||
@no_update:
|
@no_update:
|
||||||
end;
|
end
|
||||||
SOfs := VideoBufSize - (SOfs shl 2);
|
else
|
||||||
end else
|
begin
|
||||||
begin
|
SOfs := 0;
|
||||||
SOfs := 0;
|
CLen := VideoBufSize;
|
||||||
CLen := VideoBufSize;
|
end;
|
||||||
end;
|
|
||||||
if Force then
|
if Force then
|
||||||
begin
|
begin
|
||||||
VioShowBuf (SOfs, CLen, 0);
|
VioShowBuf (SOfs, CLen, 0);
|
||||||
@ -426,10 +430,13 @@ initialization
|
|||||||
finalization
|
finalization
|
||||||
UnRegisterVideoModes;
|
UnRegisterVideoModes;
|
||||||
end.
|
end.
|
||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.1 2001-01-13 11:03:58 peter
|
Revision 1.2 2001-01-23 20:23:56 hajny
|
||||||
|
* another little optimization of UpdateScreen
|
||||||
|
|
||||||
|
Revision 1.1 2001/01/13 11:03:58 peter
|
||||||
* API 2 RTL commit
|
* API 2 RTL commit
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user