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

View File

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