* implement the clipping in assembly instead of pascal in PutPixel16

git-svn-id: trunk@41003 -
This commit is contained in:
nickysn 2019-01-22 16:23:47 +00:00
parent 0199177c21
commit 1533f1e218

View File

@ -1589,17 +1589,22 @@ end;
{$else asmgraph}
Procedure PutPixel16(X,Y : smallint; Pixel: ColorType);
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
mov si, [X]
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 bx, [StartYViewPort]
{$ifdef FPC_MM_HUGE}
@ -1648,6 +1653,7 @@ end;
{ restore enable set/reset register }
mov ax,0001h
out dx,ax
@@Done:
end ['AX','BX','CX','DX','SI','DI'];
end;
{$endif asmgraph}