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
11 .constructor initcputc
21 ;--------------------------------------------------------------------------
28 jsr _gotoxy ; Set cursor, drop x
31 ; Plot a character - also used as internal function
33 _cputc: cmp #$0A ; CR?
38 jmp NEWLINE ; Update cursor position
40 ; Printable char of some sort
43 bcc L4 ; Other control char
49 bne L4 ; Branch always
51 L4: jmp PRINT ; Output character
53 ; Handle character if high bit set
58 lda #$5E ; Load screen code for PI
61 bne L4 ; Branch always
68 ; Set cursor position, calculate RAM pointers
73 jmp PLOT ; Set the new cursor
75 ; Write one character to the screen without doing anything else, return X
80 ;--------------------------------------------------------------------------
81 ; Module constructor/destructor. Don't move the constructor into the INIT
82 ; segment, because it shares most of the code with the destructor.