2 ; Ullrich von Bassewitz, 06.08.1998
4 ; void cputcxy (unsigned char x, unsigned char y, char c);
8 .export _cputcxy, _cputc, cputdirect, putchar
10 .exportzp CURS_X, CURS_Y
16 .include "../cbm/cbm.inc"
21 jsr _gotoxy ; Set cursor, drop x
24 ; Plot a character - also used as internal function
26 _cputc: cmp #$0A ; CR?
30 beq plot ; Recalculate pointers
33 beq newline ; Recalculate pointers
35 ; Printable char of some sort
38 bcc cputdirect ; Other control char
44 bne cputdirect ; Branch always
48 jsr putchar ; Write the character to the screen
50 ; Advance cursor position
56 jsr newline ; new line
71 ; Handle character if high bit set
76 lda #$5E ; Load screen code for PI
79 bne cputdirect ; Branch always
81 ; Set cursor position, calculate RAM pointers
88 ; Write one character to the screen without doing anything else, return X
95 ora revers ; Set revers bit
97 sta (CharPtr),y ; Set char