2 ; Ullrich von Bassewitz, 06.08.1998
4 ; void cputcxy (unsigned char x, unsigned char y, char c);
8 .export _cputcxy, _cputc, cputdirect, putchar
14 .include "../plus4/plus4.inc"
20 jsr _gotoxy ; Set cursor, drop x
23 ; Plot a character - also used as internal function
25 _cputc: cmp #$0A ; CR?
29 beq plot ; Recalculate pointers
32 beq newline ; Recalculate pointers
34 ; Printable char of some sort
37 bcc cputdirect ; Other control char
43 bne cputdirect ; Branch always
47 jsr putchar ; Write the character to the screen
49 ; Advance cursor position
55 jsr newline ; new line
76 ; Handle character if high bit set
81 lda #$5E ; Load screen code for PI
88 ; Set cursor position, calculate RAM pointers
93 jmp PLOT ; Set the new cursor
97 ; Write one character to the screen without doing anything else, return X
101 ora RVS ; Set revers bit
103 sta (SCREEN_PTR),y ; Set char
105 sta (CRAM_PTR),y ; Set color