2 ; Ullrich von Bassewitz, 06.08.1998
4 ; void __fastcall__ cputcxy (unsigned char x, unsigned char y, char c);
5 ; void __fastcall__ cputc (char c);
11 .export _cputcxy, _cputc
12 .export _gotoxy, cputdirect
13 .export newline, putchar
23 sta SETALTCHAR ; Switch in alternate charset
29 ; Plot a character - also used as internal function
38 cmp #$0D ; Test for \r = carrage return
40 cmp #$0A ; Test for \n = line feed
42 ora #$80 ; Turn on high bit
44 cmp #$E0 ; Test for lowercase
46 and #$DF ; Convert to uppercase
51 inc CH ; Bump to next column
55 left: lda #$00 ; Goto left edge of screen
60 inc CV ; Bump to next line
64 lda WNDTOP ; Goto top of screen
71 cpy #$FF ; Normal character display mode?
75 and #$7F ; Inverse lowercase
78 mask: and INVFLG ; Apply normal, inverse, flash
81 bit RD80VID ; In 80 column mode?
82 bpl col40 ; No, in 40 cols
88 bcs col40 ; Odd cols go in 40 col memory