From: Greg King Date: Tue, 29 Sep 2015 16:39:58 +0000 (-0400) Subject: Used I/O mirror locations that avoid (redirected) zero-page accesses. X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=203200e259054e4c6c4fd56eb94da5fac5ce11c7;p=cc65 Used I/O mirror locations that avoid (redirected) zero-page accesses. --- diff --git a/asminc/pce.inc b/asminc/pce.inc index 623ab4da8..86ed5232d 100644 --- a/asminc/pce.inc +++ b/asminc/pce.inc @@ -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) diff --git a/libsrc/pce/clrscr.s b/libsrc/pce/clrscr.s index e3f40bb8b..851c7e317 100644 --- a/libsrc/pce/clrscr.s +++ b/libsrc/pce/clrscr.s @@ -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 diff --git a/libsrc/pce/conio.s b/libsrc/pce/conio.s index 674b70279..d5b12c3fe 100644 --- a/libsrc/pce/conio.s +++ b/libsrc/pce/conio.s @@ -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 diff --git a/libsrc/pce/cputc.s b/libsrc/pce/cputc.s index cfe6a1a27..aaf67b298 100644 --- a/libsrc/pce/cputc.s +++ b/libsrc/pce/cputc.s @@ -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 diff --git a/libsrc/pce/irq.s b/libsrc/pce/irq.s index e0fb68556..60a7e22ba 100644 --- a/libsrc/pce/irq.s +++ b/libsrc/pce/irq.s @@ -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) diff --git a/libsrc/pce/vdc.s b/libsrc/pce/vdc.s index 878c79321..91d58bd51 100644 --- a/libsrc/pce/vdc.s +++ b/libsrc/pce/vdc.s @@ -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