2 ; Groepaz/Hitmen, 19.10.2015
4 ; Low level init code for the monochrome soft80 screen output/console input
7 .constructor soft80mono_init, 8
8 .destructor soft80mono_shutdown
10 .import soft80mono_kclrscr, soft80_charset
11 .export soft80mono_internal_bgcolor, soft80mono_internal_cellcolor
12 .export soft80mono_internal_cursorxlsb
13 .export soft80mono_internal_nibble
15 .importzp ptr1, ptr2, ptr3
21 lda soft80mono_first_init
25 ; the "color voodoo" in other parts of the code relies on the vram and
26 ; colorram being set up as expected, which is why we cant use the
27 ; _bgcolor and _textcolor functions here.
29 lda CHARCOLOR ; use current textcolor
30 and #$0f ; make sure the upper nibble is 0s
33 lda VIC_BG_COLOR0 ; use current bgcolor
35 sta soft80mono_internal_bgcolor
41 sta soft80mono_internal_cellcolor
52 jmp soft80mono_kclrscr
65 ; copy charset to RAM under I/O
72 inc soft80mono_first_init
78 lda #>soft80_lo_charset
80 lda #<soft80_lo_charset
82 lda #>soft80_hi_charset
84 lda #<soft80_hi_charset
106 ; copy the kplot tables to ram under I/O
109 lda soft80_tables_data_start,x
110 sta soft80_bitmapxlo,x
111 lda soft80_tables_data_start + (soft80_tables_data_end - soft80_tables_data_start - $100) ,x
112 sta soft80_bitmapxlo + (soft80_tables_data_end - soft80_tables_data_start - $100),x
121 ; the following tables take up 267 bytes, used by kplot
122 soft80_tables_data_start:
124 soft80_bitmapxlo_data:
128 soft80_bitmapxhi_data:
134 .byte <(soft80_vram+(row*40))
136 .byte 0,0,0,0,0,0,0 ; padding to next page
139 .byte >(soft80_vram+(row*40))
141 soft80_bitmapylo_data:
143 .byte <(soft80_bitmap+(row*40*8))
145 soft80_bitmapyhi_data:
147 .byte >(soft80_bitmap+(row*40*8))
150 soft80_tables_data_end:
152 ;-------------------------------------------------------------------------------
154 soft80mono_internal_cellcolor:
156 soft80mono_internal_bgcolor:
158 soft80mono_internal_cursorxlsb:
162 soft80mono_first_init:
163 .byte 0 ; flag to check first init, this really must be in .data
166 soft80mono_internal_nibble: