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
28 jsr _gotoxy ; Set cursor, drop x
31 ; Plot a character - also used as internal function
40 ; Set cursor position, calculate RAM pointers
45 jmp soft80mono_kplot ; Set the new cursor
48 beq soft80mono_newline ; Recalculate pointers
50 ; shortcut for codes < $80 ... codes $20-$7f can be printed directly,
51 ; codes $00-$1f are control codes which are not printable and thus may
52 ; give undefined result.
56 ; codes $80-$ff must get converted like this:
57 ; $80-$9f -> dont care (control codes)
68 ; entry point for direct output of a character. the value passed in
69 ; akku must match the offset in the charset.
70 ; - the following may not modify tmp1
71 soft80mono_cputdirect:
72 jsr soft80mono_putchar ; Write the character to the screen
74 ; Advance cursor position
82 sta soft80mono_internal_cursorxlsb
99 ; - the following may not modify tmp1
114 ;-------------------------------------------------------------------------------
115 ; output one character in internal encoding without advancing cursor position
116 ; generic entry point
118 ; - the following may not modify tmp1
123 sta tmp3 ; save charcode
129 sta $01 ; enable RAM under I/O
131 ldy #$00 ; will be $00 from now on
133 ldx soft80mono_internal_cursorxlsb
148 ;ldy #0 ; is still $00
173 ; output inverted character
175 lda soft80mono_internal_nibble,x
178 ;ldy #0 ; is still $00
198 .byte <soft80_hi_charset
199 .byte <soft80_lo_charset
201 .byte >soft80_hi_charset
202 .byte >soft80_lo_charset