mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-10 03:07:40 +02:00
* perform the clipping in asm in PutPixelX
git-svn-id: trunk@41038 -
This commit is contained in:
parent
a55ee3b687
commit
abf98cf2cd
@ -2612,14 +2612,6 @@ const CrtAddress: word = 0;
|
|||||||
{$else asmgraph}
|
{$else asmgraph}
|
||||||
Procedure PutPixelX(X,Y: smallint; color:ColorType);
|
Procedure PutPixelX(X,Y: smallint; color: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
|
||||||
push ax
|
push ax
|
||||||
push bx
|
push bx
|
||||||
@ -2629,6 +2621,20 @@ const CrtAddress: word = 0;
|
|||||||
push di
|
push di
|
||||||
mov ax, [X]
|
mov ax, [X]
|
||||||
mov di, [Y] ; (* DI = Y coordinate *)
|
mov di, [Y] ; (* DI = Y coordinate *)
|
||||||
|
|
||||||
|
cmp byte ptr [ClipPixels], 0
|
||||||
|
je @@ClipDone
|
||||||
|
|
||||||
|
test ax, ax
|
||||||
|
js @@Done
|
||||||
|
test di, di
|
||||||
|
js @@Done
|
||||||
|
cmp ax, [ViewWidth]
|
||||||
|
jg @@Done
|
||||||
|
cmp di, [ViewHeight]
|
||||||
|
jg @@Done
|
||||||
|
|
||||||
|
@@ClipDone:
|
||||||
add di, [StartYViewPort]
|
add di, [StartYViewPort]
|
||||||
(* Multiply by 80 start *)
|
(* Multiply by 80 start *)
|
||||||
mov cl, 4
|
mov cl, 4
|
||||||
@ -2655,6 +2661,7 @@ const CrtAddress: word = 0;
|
|||||||
mov es,[SegA000]
|
mov es,[SegA000]
|
||||||
mov ax,[Color] ; { only lower byte is used. }
|
mov ax,[Color] ; { only lower byte is used. }
|
||||||
mov es:[di], al
|
mov es:[di], al
|
||||||
|
@@Done:
|
||||||
pop di
|
pop di
|
||||||
pop es
|
pop es
|
||||||
pop dx
|
pop dx
|
||||||
|
Loading…
Reference in New Issue
Block a user