2 ; Ullrich von Bassewitz, 14.09.2001
4 ; void cputcxy (unsigned char x, unsigned char y, char c);
8 .export _cputcxy, _cputc, cputdirect, putchar
16 ; ------------------------------------------------------------------------
22 jsr _gotoxy ; Set cursor, drop x
25 ; Plot a character - also used as internal function
27 _cputc: cmp #$0A ; CR?
31 beq plot ; Recalculate pointers
34 beq newline ; Recalculate pointers
36 ; Printable char of some sort
39 bcc cputdirect ; Other control char
45 bne cputdirect ; Branch always
49 jsr putchar ; Write the character to the screen
51 ; Advance cursor position
57 jsr newline ; new line
78 ; Handle character if high bit set
83 lda #$5E ; Load screen code for PI
88 ; Set cursor position, calculate RAM pointers
93 jmp PLOT ; Set the new cursor
95 ; Write one character to the screen without doing anything else, return X
99 ora RVS ; Set revers bit
101 sta (SCREEN_PTR),y ; Set char
106 sta (CRAM_PTR),y ; Set color