move internal text/bgcolor variables into the file that also contains the init code for them. also rename them to avoid namespace pollution

This commit is contained in:
mrdudz
2015-10-12 15:04:55 +02:00
parent 07f1879f85
commit 7f2df8e8e6
4 changed files with 42 additions and 32 deletions

View File

@@ -8,7 +8,7 @@
.destructor soft80_shutdown
.import soft80_kclrscr, soft80_charset
.import __textcolor, __bgcolor
.export soft80_internal_textcolor, soft80_internal_bgcolor
.importzp ptr1, ptr2, ptr3
@@ -71,16 +71,16 @@ soft80_init:
lda 646 ; use current textcolor
and #$0f
sta __textcolor
sta soft80_internal_textcolor
lda VIC_BG_COLOR0 ; use current bgcolor
and #$0f
sta __bgcolor
sta soft80_internal_bgcolor
asl a
asl a
asl a
asl a
ora __textcolor
ora soft80_internal_textcolor
sta CHARCOLOR
jmp soft80_kclrscr
@@ -94,3 +94,14 @@ soft80_shutdown:
sta VIC_VIDEO_ADR
rts
;-------------------------------------------------------------------------------
; FIXME: when the code is fixed to use the "init" segment, these variables must
; be moved into a section other than .bss so they survive after the init
; code has been run.
.bss
soft80_internal_textcolor:
.res 1
soft80_internal_bgcolor:
.res 1