;
-; Ullrich von Bassewitz, 22.06.2002
+; 2002-06-22, Ullrich von Bassewitz
+; 2018-07-27, Greg King
;
-; Helper function for getpixel/setpixel. Load X/Y from stack and check if
-; the coordinates are valid. Return carry clear if so.
+; Helper function for getpixel/setpixel. Load X/Y from arguments;
+; and, check if the co-ordinates are valid. Return carry clear if so.
;
.include "tgi-kernel.inc"
jsr tgi_popxy ; Pop X/Y into ptr1/ptr2
-; Are the coordinates out of range? First check if any coord is negative.
+; Are the co-ordinates out of range? First, check if any coord is negative.
- txa
- ora ptr2+1
+ txa ; (.X = ptr2+1 from tgi_popxy)
+ ora ptr1+1
+ sec ; Return carry set if number is negative
bmi @L9 ; Bail out if negative
-; Check if X is larger than the maximum x coord. If so, bail out
+; Check if X is larger than the maximum x coord. If so, bail out.
lda ptr1
cmp _tgi_xres
@L9: rts
.endproc
-
;
-; Ullrich von Bassewitz, 02.10.2002
+; 2002-10-02, Ullrich von Bassewitz
+; 2018-05-20, Christian Kruger
;
-; Helper function for tgi functions. Pops X/Y from stack into ptr1/ptr2
+; Helper function for TGI functions. Pops X/Y from arguments into ptr1/ptr2.
;
.include "tgi-kernel.inc"
.import popptr1
- .importzp ptr1, ptr2
+ .importzp ptr2
.proc tgi_popxy
jmp popptr1 ; X
.endproc
-
;
-; Piotr Fusik, 18.11.2001
+; 2001-11-18, Piotr Fusik
+; 2018-05-20, Christian Kruger
;
; unsigned long __fastcall__ adler32 (unsigned long adler, unsigned char* buf,
; unsigned len);
; return 1L
@L0: sta sreg
sta sreg+1
+ tax ; (popptr1 doesn't set .X)
lda #1
; ignore adler
jmp incsp4
;
-; Piotr Fusik, 14.11.2001
+; 2001-11-14, Piotr Fusik
+; 2018-05-20, Christian Kruger
;
; unsigned long __fastcall__ crc32 (unsigned long crc, unsigned char* buf,
; unsigned len);
; return 0L
@L0: sta sreg
sta sreg+1
+ tax ; (popptr1 doesn't set .X)
; ignore crc
jmp incsp4
table_1: .res 256
table_2: .res 256
table_3: .res 256
-
-