* another little optimization of UpdateScreen

This commit is contained in:
Tomas Hajny 2001-01-23 20:21:45 +00:00
parent 4bf53f34e3
commit 67c9365e28
2 changed files with 127 additions and 119 deletions

View File

@ -436,22 +436,25 @@ begin
if LockUpdateScreen = 0 then
begin
if not (Force) then
begin
{$IFDEF BIT_32}
asm
cld
{$IFDEF BIT_32}
mov esi, VideoBuf
mov edi, OldVideoBuf
mov eax, VideoBufSize
mov ecx, eax
shr ecx
shr ecx
shr ecx, 1
shr ecx, 1
repe
cmpsd
inc cx
mov SOfs, ecx
or ecx, ecx
jz @no_update
je @no_update
inc ecx
mov edx, eax
mov ebx, ecx
shl ebx, 1
shl ebx, 1
sub edx, ebx
mov SOfs, edx
mov Force, 1
std
mov edi, eax
@ -466,28 +469,26 @@ begin
repe
cmpsd
inc ecx
shl ecx
shl ecx
shl ecx, 1
shl ecx, 1
mov CLen, ecx
cld
@no_update:
end;
SOfs := VideoBufSize - (SOfs shl 2);
{$ELSE}
asm
cld
push ds
lds si, VideoBuf
les di, OldVideoBuf
mov ax, word ptr VideoBufSize
mov cx, ax
shr cx
shr cx, 1
repe
cmpsw
inc cx
mov SOfs, cx
or cx, cx
jz @no_update
inc cx
mov dx, ax
mov bx, cx
shl bx, 1
sub dx, bx
mov SOfs, dx
mov Force, 1
std
mov di, ax
@ -504,16 +505,13 @@ begin
repe
cmpsw
inc cx
shl cx
shl cx, 1
mov CLen, cx
cld
@no_update:
pop ds
end;
Inc (SOfs);
SOfs := VideoBufSize - (SOfs shl 1);
{$ENDIF}
end else
end
else
begin
SOfs := 0;
CLen := VideoBufSize;
@ -531,7 +529,10 @@ end;
{
$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
Revision 1.10 2000/10/11 20:10:04 hajny

View File

@ -370,20 +370,26 @@ begin
if LockUpdateScreen = 0 then
begin
if not (Force) then
begin
if not (Force) then
asm
cld
{$IFDEF BIT_32}
mov esi, VideoBuf
mov edi, OldVideoBuf
mov eax, VideoBufSize
mov ecx, eax
shr ecx
shr ecx
shr ecx, 1
shr ecx, 1
repe
cmpsd
je @no_update
inc cx
mov SOfs, ecx
inc ecx
mov edx, eax
mov ebx, ecx
shl ebx, 1
shl ebx, 1
sub edx, ebx
mov SOfs, edx
mov Force, 1
std
mov edi, eax
@ -398,14 +404,12 @@ begin
repe
cmpsd
inc ecx
shl ecx
shl ecx
shl ecx, 1
shl ecx, 1
mov CLen, ecx
cld
@no_update:
end;
SOfs := VideoBufSize - (SOfs shl 2);
end else
end
else
begin
SOfs := 0;
CLen := VideoBufSize;
@ -426,10 +430,13 @@ initialization
finalization
UnRegisterVideoModes;
end.
{
$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
}