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);
9 .constructor initconio, 17
11 .export _cputcxy, _cputc
12 .export cputdirect, newline, putchar
13 .import popa, _gotoxy, VTABZ
21 sta SETALTCHAR ; Switch in alternate charset
22 bit LORES ; Limit SET80COL-HISCR to text
28 ; Plot a character - also used as internal function
37 cmp #$0D ; Test for \r = carrage return
39 cmp #$0A ; Test for \n = line feed
41 ora #$80 ; Turn on high bit
43 cmp #$E0 ; Test for lowercase
45 and #$DF ; Convert to uppercase
50 inc CH ; Bump to next column
54 left: lda #$00 ; Goto left edge of screen
59 inc CV ; Bump to next line
63 lda WNDTOP ; Goto top of screen
70 cpy #$FF ; Normal character display mode?
74 and #$7F ; Inverse lowercase
77 mask: and INVFLG ; Apply normal, inverse, flash
80 bit RD80VID ; In 80 column mode?
81 bpl col40 ; No, in 40 cols
87 bcs col40 ; Odd cols go in 40 col memory
88 bit HISCR ; Assume SET80COL
90 bit LOWSCR ; Assume SET80COL