2 ; Ullrich von Bassewitz, 06.08.1998
4 ; void cputcxy (unsigned char x, unsigned char y, char c);
8 .export _cputcxy, _cputc, cputdirect, putchar
18 jsr gotoxy ; Set cursor, drop x and y
21 ; Plot a character - also used as internal function
23 _cputc: cmp #$0A ; CR?
27 beq plot ; Recalculate pointers
30 beq newline ; Recalculate pointers
32 ; Printable char of some sort
35 bcc cputdirect ; Other control char
41 bne cputdirect ; Branch always
45 jsr putchar ; Write the character to the screen
47 ; Advance cursor position
53 jsr newline ; new line
74 ; Handle character if high bit set
79 lda #$5E ; Load screen code for PI
86 ; Set cursor position, calculate RAM pointers
91 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
103 sta (CRAM_PTR),y ; Set color