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
16 .include "zeropage.inc"
17 .include "../cbm/cbm.inc"
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
72 ; Handle character if high bit set
77 lda #$5E ; Load screen code for PI
80 bne cputdirect ; Branch always
82 ; Set cursor position, calculate RAM pointers
89 ; Write one character to the screen without doing anything else, return X
96 ora revers ; Set revers bit
98 sta (CharPtr),y ; Set char