2 ; Ullrich von Bassewitz, 2000-08-06, 2002-12-21
3 ; Using lots of code from MagerValp, MagerValp@cling.gu.se
5 ; void cputcxy (unsigned char x, unsigned char y, char c);
9 .export _cputcxy, _cputc, cputdirect, putchar
18 ;--------------------------------------------------------------------------
25 jsr _gotoxy ; Set cursor, drop x
28 ; Plot a character - also used as internal function
30 _cputc: cmp #$0A ; CR?
35 jmp NEWLINE ; Update cursor position
37 ; Printable char of some sort
40 bcc cputdirect ; Other control char
46 bne cputdirect ; Branch always
49 ; Output one character to the screen. We will disable scrolling while doing so
52 tax ; Save output char
54 pha ; Save scroll flag
56 sta SCROLL ; Disable scrolling
57 txa ; Restore output char
60 sta SCROLL ; Restore old scroll flag
63 ; Handle character if high bit set
68 lda #$5E ; Load screen code for PI
71 bne cputdirect ; Branch always
78 ; Set cursor position, calculate RAM pointers
83 jmp PLOT ; Set the new cursor
85 ; Write one character to the screen without doing anything else, return X