2 ; Written by Groepaz/Hitmen <groepaz@gmx.net>
3 ; Cleanup by Ullrich von Bassewitz <uz@cc65.org>
5 ; void cputcxy (unsigned char x, unsigned char y, char c);
9 .export _cputcxy, _cputc, cputdirect, putchar
11 .constructor conioinit
13 .import ppuinit, paletteinit, ppubuf_put
20 ;-----------------------------------------------------------------------------
25 jsr _gotoxy ; Set cursor, drop x
28 ; Plot a character - also used as internal function
30 _cputc: cmp #$0d ; CR?
34 beq plot ; Recalculate pointers
37 beq newline ; Recalculate pointers
39 ; Printable char of some sort
42 jsr putchar ; Write the character to the screen
44 ; Advance cursor position
59 ; Set cursor position, calculate RAM pointers
63 jmp setcursor ; Set the new cursor
66 ; Write one character to the screen without doing anything else, return X
70 ora RVS ; Set revers bit
75 ;-----------------------------------------------------------------------------
76 ; Initialize the conio subsystem
87 jmp plot ; Set the cursor