2 ; Ullrich von Bassewitz, 06.08.1998
4 ; void cputcxy (unsigned char x, unsigned char y, char c);
8 .export _cputcxy, _cputc, cputdirect, putchar
9 .export advance, newline, plot
14 .include "../cbm/cbm.inc"
19 jsr _gotoxy ; Set cursor, drop x
22 ; Plot a character - also used as internal function
24 _cputc: cmp #$0A ; CR?
28 beq plot ; Recalculate pointers
34 bne 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
75 ; Handle character if high bit set
80 lda #$5E ; Load screen code for PI
87 ; Set cursor position, calculate RAM pointers
92 jmp PLOT ; Set the new cursor
96 ; Write one character to the screen without doing anything else, return X
100 ora revers ; Set revers bit
102 sta (SCREEN_PTR),y ; Set char
104 sta (CRAM_PTR),y ; Set color