2 ; Groepaz/Hitmen, 19.10.2015
4 ; high level implementation for the monochrome soft80 implementation
6 ; void cputcxy (unsigned char x, unsigned char y, char c);
10 .export soft80mono_cputcxy, soft80mono_cputc
11 .export soft80mono_cputdirect, soft80mono_putchar
12 .export soft80mono_newline, soft80mono_plot
16 .import soft80mono_kplot
17 .import soft80mono_internal_bgcolor, soft80mono_internal_cellcolor
18 .import soft80mono_internal_cursorxlsb, soft80mono_internal_nibble
20 .importzp tmp4, tmp3, ptr2
27 jsr gotoxy ; Set cursor, drop x and y
30 ; Plot a character - also used as internal function
39 ; Set cursor position, calculate RAM pointers
44 jmp soft80mono_kplot ; Set the new cursor
47 beq soft80mono_newline ; Recalculate pointers
49 ; shortcut for codes < $80 ... codes $20-$7f can be printed directly,
50 ; codes $00-$1f are control codes which are not printable and thus may
51 ; give undefined result.
55 ; codes $80-$ff must get converted like this:
56 ; $80-$9f -> dont care (control codes)
67 ; entry point for direct output of a character. the value passed in
68 ; akku must match the offset in the charset.
69 ; - the following may not modify tmp1
70 soft80mono_cputdirect:
71 jsr soft80mono_putchar ; Write the character to the screen
73 ; Advance cursor position
81 sta soft80mono_internal_cursorxlsb
98 ; - the following may not modify tmp1
113 ;-------------------------------------------------------------------------------
114 ; output one character in internal encoding without advancing cursor position
115 ; generic entry point
117 ; - the following may not modify tmp1
122 sta tmp3 ; save charcode
128 sta $01 ; enable RAM under I/O
130 ldy #$00 ; will be $00 from now on
132 ldx soft80mono_internal_cursorxlsb
147 ;ldy #0 ; is still $00
172 ; output inverted character
174 lda soft80mono_internal_nibble,x
177 ;ldy #0 ; is still $00
197 .byte <soft80_hi_charset
198 .byte <soft80_lo_charset
200 .byte >soft80_hi_charset
201 .byte >soft80_lo_charset