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
53 stx ScrollSave ; Save scroll flag
55 stx SCROLL ; Disable scrolling
56 jsr PRINT ; Call kernal entry point
58 stx SCROLL ; Restore old scroll flag
61 ; Handle character if high bit set
66 lda #$5E ; Load screen code for PI
69 bne cputdirect ; Branch always
76 ; Set cursor position, calculate RAM pointers
81 jmp PLOT ; Set the new cursor
83 ; Write one character to the screen without doing anything else, return X
88 ;--------------------------------------------------------------------------
92 ScrollSave: .res 1 ; Save location for scroll byte