From e6fc904e3c43776692a2bb27b1c7bb4f2bbb1bf5 Mon Sep 17 00:00:00 2001 From: Greg King Date: Fri, 27 Jul 2018 09:07:40 -0400 Subject: [PATCH] Fixed some code, to adapt to register-use changes caused by pull request #652. --- libsrc/tgi/tgi_getset.s | 17 +++++++++-------- libsrc/tgi/tgi_popxy.s | 8 ++++---- libsrc/zlib/adler32.s | 4 +++- libsrc/zlib/crc32.s | 6 +++--- 4 files changed, 19 insertions(+), 16 deletions(-) diff --git a/libsrc/tgi/tgi_getset.s b/libsrc/tgi/tgi_getset.s index aded19d71..152470503 100644 --- a/libsrc/tgi/tgi_getset.s +++ b/libsrc/tgi/tgi_getset.s @@ -1,8 +1,9 @@ ; -; 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" @@ -15,13 +16,14 @@ 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 @@ -38,4 +40,3 @@ @L9: rts .endproc - diff --git a/libsrc/tgi/tgi_popxy.s b/libsrc/tgi/tgi_popxy.s index 33ccc57f9..2d9ac5d05 100644 --- a/libsrc/tgi/tgi_popxy.s +++ b/libsrc/tgi/tgi_popxy.s @@ -1,13 +1,14 @@ ; -; 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 @@ -16,4 +17,3 @@ jmp popptr1 ; X .endproc - diff --git a/libsrc/zlib/adler32.s b/libsrc/zlib/adler32.s index ccfe2f167..8aa641a13 100644 --- a/libsrc/zlib/adler32.s +++ b/libsrc/zlib/adler32.s @@ -1,5 +1,6 @@ ; -; 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); @@ -78,6 +79,7 @@ _adler32: ; return 1L @L0: sta sreg sta sreg+1 + tax ; (popptr1 doesn't set .X) lda #1 ; ignore adler jmp incsp4 diff --git a/libsrc/zlib/crc32.s b/libsrc/zlib/crc32.s index 7f06dd383..f019736ad 100644 --- a/libsrc/zlib/crc32.s +++ b/libsrc/zlib/crc32.s @@ -1,5 +1,6 @@ ; -; 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); @@ -116,6 +117,7 @@ _crc32: ; return 0L @L0: sta sreg sta sreg+1 + tax ; (popptr1 doesn't set .X) ; ignore crc jmp incsp4 @@ -128,5 +130,3 @@ table_0: .res 256 table_1: .res 256 table_2: .res 256 table_3: .res 256 - -