.import psg_init
.import vdc_init
- .export initconio
- .export _conio_init
-
.constructor initconio, 24
.macpack longbranch
ldx #0
@lp:
- .repeat 16
- lda colors,x
+ ldy #16
+@lp1:
+ lda colors,x
sta VCE_DATA_LO
- lda colors+1,x
+ lda colors+1,x
sta VCE_DATA_HI
- .endrepeat
+ dey
+ bne @lp1
inx
inx
- cpx #16*2
- jne @lp
+ cpx #16*2
+ jne @lp
stz VCE_ADDR_LO
stz VCE_ADDR_HI
stz VCE_DATA_LO
stz VCE_DATA_HI
- ; so it will get linked in
-_conio_init:
rts
;----------------------------------------------------------------------------
;
;----------------------------------------------------------------------------
- .importzp ptr1
+ .importzp ptr1, tmp1
conio_init:
; Load font
st0 #VDC_MAWR
st2 #>$2000
; ptr to font data
- lda #<font
- sta ptr1
- lda #>font
- sta ptr1+1
+ lda #<font
+ sta ptr1
+ lda #>font
+ sta ptr1+1
+
+ st0 #VDC_VWR ; VWR
+
+ lda #0
+ sta tmp1
+ jsr copy
+
+ lda #<font
+ sta ptr1
+ lda #>font
+ sta ptr1+1
+
+ lda #$ff
+ sta tmp1
+ jsr copy
- st0 #VDC_VWR ; VWR
+
+ ldx #0
+ stx BGCOLOR
+ inx
+ stx CHARCOLOR
+
+
+ rts
+
+copy:
ldy #$80 ; 128 chars
charloop: ldx #$08 ; 8 bytes/char
lineloop:
- lda (ptr1)
- staio VDC_DATA_LO ; bitplane 0
- stzio VDC_DATA_HI ; bitplane 1
+ lda (ptr1)
+ eor tmp1
+ sta a:VDC_DATA_LO ; bitplane 0
+ stz a:VDC_DATA_HI ; bitplane 1
clc ; increment font pointer
lda ptr1
dey
bne charloop ; next character
- ldx #0
- stx BGCOLOR
- inx
- stx CHARCOLOR
-
-
rts
.rodata