1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-13 19:29:34 +00:00

Used I/O mirror locations that avoid (redirected) zero-page accesses.

This commit is contained in:
Greg King 2015-09-29 12:39:58 -04:00 committed by Oliver Schmidt
parent c39d07dd17
commit 203200e259
6 changed files with 17 additions and 15 deletions

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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