VDC_SATB = 19 ; Sprite Attribute Table
; VDC port
-; Note: absolute addressing mode must be used when writing to this port
+; Note: The zero-page addressing mode is redirected to page $20.
+; Therefore, absolute addressing mode must be used when writing to this port.
+; We force it by using mirror locations that are outside of zero page.
-VDC_CTRL = $0000
-VDC_DATA_LO = $0002
-VDC_DATA_HI = $0003
+VDC_CTRL := $0200
+VDC_DATA_LO := $0202
+VDC_DATA_HI := $0203
; huc6260 - Video Color Encoder (vce)
ldx #$80
colloop:
lda #' '
- sta a:VDC_DATA_LO
+ sta VDC_DATA_LO
lda #$02
- sta a:VDC_DATA_HI
+ sta VDC_DATA_HI
dex
bne colloop
lineloop:
lda (ptr1)
eor tmp1
- sta a:VDC_DATA_LO ; bitplane 0
- stz a:VDC_DATA_HI ; bitplane 1
+ sta VDC_DATA_LO ; bitplane 0
+ stz VDC_DATA_HI ; bitplane 1
clc ; increment font pointer
lda ptr1
st0 #VDC_MAWR ; Memory Adress Write
lda SCREEN_PTR
- sta a:VDC_DATA_LO
+ sta VDC_DATA_LO
lda SCREEN_PTR + 1
- sta a:VDC_DATA_HI
+ sta VDC_DATA_HI
st0 #VDC_VWR ; VWR
txa
- sta a:VDC_DATA_LO ; character
+ sta VDC_DATA_LO ; character
lda CHARCOLOR
asl a
ora #$02
- sta a:VDC_DATA_HI
+ sta VDC_DATA_HI
rts
; Save the display-source flags (and, release the interrupt).
;
- ldy a:VDC_CTRL
+ ldy VDC_CTRL
sty vdc_flags
ldy #<(__INTERRUPTOR_COUNT__ * 2)
.export vdc_init
vdc_init:
- lda a:VDC_CTRL
+ lda VDC_CTRL
VREG $00, $0000 ; MAWR
VREG $01, $0000 ; MARR
.endif
- lda a:VDC_CTRL
+ lda VDC_CTRL
rts