2 ; 2017-07-05, Greg King
4 ; void cpeeks (char* s, unsigned length);
10 .importzp ptr1, ptr2, ptr3, tmp1, tmp2
14 ; Get a system-specific file.
15 ; Note: The cbm610, and c128 targets need special
16 ; versions that handle RAM banking and the 80-column VDC.
19 .include "plus4.inc" ; both C16 and Plus4
22 .elseif .def(__CBM510__)
23 .import CURS_X: zp, SCREEN_PTR: zp
27 .elseif .def(__VIC20__)
33 eor #<$FFFF ; counting a word upward is faster
34 sta ptr3 ; so, we use -(length + 1)
47 sta tmp1 ; (will be a .Y index)
51 bze L3 ; branch always
54 lda (ptr2),y ; get char
59 and #<~$80 ; remove reverse bit
61 ; Convert the screen code into a PetSCII code.
75 @sk2: ;clc ; both above cmp and adc clear carry flag
85 L3: inc ptr3 ; count length
90 txa ; terminate the string