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
23 jsr _gotoxy ; Set cursor, drop x
26 ; Plot a character - also used as internal function
28 _cputc: cmp #$0A ; CR?
32 beq plot ; Recalculate pointers
35 beq newline ; Recalculate pointers
37 ; Printable char of some sort
40 bcc cputdirect ; Other control char
46 bne cputdirect ; Branch always
50 jsr putchar ; Write the character to the screen
52 ; Advance cursor position
58 jsr newline ; new line
73 ; Handle character if high bit set
78 lda #$5E ; Load screen code for PI
81 bne cputdirect ; Branch always
83 ; Set cursor position, calculate RAM pointers
90 ; Write one character to the screen without doing anything else, return X
97 ora RVS ; Set revers bit
99 sta (CharPtr),y ; Set char