2 ; Ullrich von Bassewitz, 2003-04-13
4 ; void cputcxy (unsigned char x, unsigned char y, char c);
8 .export _cputcxy, _cputc
9 .export setscrptr, putchar
19 jsr popax ; Get X and Y
24 ; Plot a character - also used as internal function
26 _cputc: cmp #$0D ; CR?
29 sta CURS_X ; Carriage return
37 ; Output the character, then advance the cursor position
51 ; ------------------------------------------------------------------------
52 ; Set ptr2 to the screen, load the X offset into Y
57 ldy CURS_Y ; Get line number into Y
58 lda ScrTabLo,y ; Get low byte of line address
60 lda ScrTabHi,y ; Get high byte of line address
62 ldy CURS_X ; Get X offset
67 ; ------------------------------------------------------------------------
68 ; Write one character to the screen without doing anything else, return X
74 ora rvs ; Set revers bit
76 jsr setscrptr ; Set ptr2 to the screen
77 pla ; Restore the character
78 sta (ptr2),y ; Set char
83 ; ------------------------------------------------------------------------
84 ; Screen address table
89 .byte <(SCREEN + Line * 40)
94 .byte >(SCREEN + Line * 40)