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 initconio
13 .import ppuinit, paletteinit, ppubuf_put
20 ;-----------------------------------------------------------------------------
26 jsr gotoxy ; Set cursor, drop x and y
29 ; Plot a character - also used as internal function
31 _cputc: cmp #$0d ; CR?
35 beq plot ; Recalculate pointers
38 beq newline ; Recalculate pointers
40 ; Printable char of some sort
43 jsr putchar ; Write the character to the screen
45 ; Advance cursor position
60 ; Set cursor position, calculate RAM pointers
64 jmp setcursor ; Set the new cursor
67 ; Write one character to the screen without doing anything else, return X
71 ora RVS ; Set revers bit
76 ;-----------------------------------------------------------------------------
77 ; Initialize the conio subsystem. Code goes into the ONCE segment, which may
78 ; be reused after startup.
91 jmp plot ; Set the cursor