mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-22 00:32:32 +02:00
* implement the clipping in assembly instead of pascal in PutPixel16
git-svn-id: trunk@41003 -
This commit is contained in:
parent
0199177c21
commit
1533f1e218
@ -1589,17 +1589,22 @@ end;
|
|||||||
{$else asmgraph}
|
{$else asmgraph}
|
||||||
Procedure PutPixel16(X,Y : smallint; Pixel: ColorType);
|
Procedure PutPixel16(X,Y : smallint; Pixel: ColorType);
|
||||||
Begin
|
Begin
|
||||||
{ verify clipping and then convert to absolute coordinates...}
|
|
||||||
if ClipPixels then
|
|
||||||
begin
|
|
||||||
if (X < 0) or (X > ViewWidth) then
|
|
||||||
exit;
|
|
||||||
if (Y < 0) or (Y > ViewHeight) then
|
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
asm
|
asm
|
||||||
mov si, [X]
|
mov si, [X]
|
||||||
mov bx, [Y]
|
mov bx, [Y]
|
||||||
|
cmp byte ptr [ClipPixels], 0
|
||||||
|
je @@ClipDone
|
||||||
|
|
||||||
|
test si, si
|
||||||
|
js @@Done
|
||||||
|
test bx, bx
|
||||||
|
js @@Done
|
||||||
|
cmp si, [ViewWidth]
|
||||||
|
jg @@Done
|
||||||
|
cmp bx, [ViewHeight]
|
||||||
|
jg @@Done
|
||||||
|
|
||||||
|
@@ClipDone:
|
||||||
add si, [StartXViewPort]
|
add si, [StartXViewPort]
|
||||||
add bx, [StartYViewPort]
|
add bx, [StartYViewPort]
|
||||||
{$ifdef FPC_MM_HUGE}
|
{$ifdef FPC_MM_HUGE}
|
||||||
@ -1648,6 +1653,7 @@ end;
|
|||||||
{ restore enable set/reset register }
|
{ restore enable set/reset register }
|
||||||
mov ax,0001h
|
mov ax,0001h
|
||||||
out dx,ax
|
out dx,ax
|
||||||
|
@@Done:
|
||||||
end ['AX','BX','CX','DX','SI','DI'];
|
end ['AX','BX','CX','DX','SI','DI'];
|
||||||
end;
|
end;
|
||||||
{$endif asmgraph}
|
{$endif asmgraph}
|
||||||
|
Loading…
Reference in New Issue
Block a user