mirror of
https://github.com/cc65/cc65.git
synced 2025-01-10 03:30:05 +00:00
Used I/O mirror locations that avoid (redirected) zero-page accesses.
This commit is contained in:
parent
c39d07dd17
commit
203200e259
@ -34,11 +34,13 @@ VDC_LENR = 18 ; (DMA) Length Register
|
||||
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)
|
||||
|
||||
|
@ -16,9 +16,9 @@ rowloop:
|
||||
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
|
||||
|
@ -90,8 +90,8 @@ charloop:
|
||||
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
|
||||
|
@ -69,15 +69,15 @@ putchar:
|
||||
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
|
||||
|
||||
@ -87,7 +87,7 @@ putchar:
|
||||
asl a
|
||||
|
||||
ora #$02
|
||||
sta a:VDC_DATA_HI
|
||||
sta VDC_DATA_HI
|
||||
|
||||
rts
|
||||
|
||||
|
@ -32,7 +32,7 @@ IRQStub:
|
||||
|
||||
; Save the display-source flags (and, release the interrupt).
|
||||
;
|
||||
ldy a:VDC_CTRL
|
||||
ldy VDC_CTRL
|
||||
sty vdc_flags
|
||||
|
||||
ldy #<(__INTERRUPTOR_COUNT__ * 2)
|
||||
|
@ -7,7 +7,7 @@ HIRES = 1
|
||||
.export vdc_init
|
||||
|
||||
vdc_init:
|
||||
lda a:VDC_CTRL
|
||||
lda VDC_CTRL
|
||||
|
||||
VREG $00, $0000 ; MAWR
|
||||
VREG $01, $0000 ; MARR
|
||||
@ -37,5 +37,5 @@ vdc_init:
|
||||
|
||||
.endif
|
||||
|
||||
lda a:VDC_CTRL
|
||||
lda VDC_CTRL
|
||||
rts
|
||||
|
Loading…
x
Reference in New Issue
Block a user