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 cputdirect, newline, putchar, putchardirect
21 sta SETALTCHAR ; Switch in alternate charset
22 bit LORES ; Limit SET80COL-HISCR to text
28 ; Plot a character - also used as internal function
32 jsr gotoxy ; Call this one, will pop params
33 pla ; Restore C and run into _cputc
36 cmp #$0D ; Test for \r = carrage return
38 cmp #$0A ; Test for \n = line feed
40 ora #$80 ; Turn on high bit
42 cmp #$E0 ; Test for lowercase
44 and #$DF ; Convert to uppercase
49 inc CH ; Bump to next column
53 left: lda #$00 ; Goto left edge of screen
58 inc CV ; Bump to next line
62 lda WNDTOP ; Goto top of screen
69 cpy #$FF ; Normal character display mode?
73 and #$7F ; Inverse lowercase
76 mask: and INVFLG ; Apply normal, inverse, flash
82 bit RD80VID ; In 80 column mode?
83 bpl put ; No, just go ahead
87 bcs put ; Odd cols go in main memory
88 bit HISCR ; Assume SET80COL
90 put: lda (BASL),Y ; Get current character
91 tax ; Return old character for _cgetc
95 bit LOWSCR ; Doesn't hurt in 40 column mode