mirror of
https://github.com/deater/dos33fsprogs.git
synced 2024-07-04 08:29:30 +00:00
pt3_player: optimize mockingboard writes
This commit is contained in:
parent
fda47eda81
commit
26e7d2f990
@ -105,15 +105,14 @@ mb_not_13:
|
|||||||
; address
|
; address
|
||||||
stx MOCK_6522_ORA1 ; put address on PA1 ; 4
|
stx MOCK_6522_ORA1 ; put address on PA1 ; 4
|
||||||
stx MOCK_6522_ORA2 ; put address on PA2 ; 4
|
stx MOCK_6522_ORA2 ; put address on PA2 ; 4
|
||||||
lda #MOCK_AY_LATCH_ADDR ; latch_address for PB1 ; 2
|
ldy #MOCK_AY_LATCH_ADDR ; latch_address for PB1 ; 2
|
||||||
sta MOCK_6522_ORB1 ; latch_address on PB1 ; 4
|
sty MOCK_6522_ORB1 ; latch_address on PB1 ; 4
|
||||||
sta MOCK_6522_ORB2 ; latch_address on PB2 ; 4
|
sty MOCK_6522_ORB2 ; latch_address on PB2 ; 4
|
||||||
ldy #MOCK_AY_INACTIVE ; go inactive ; 2
|
ldy #MOCK_AY_INACTIVE ; go inactive ; 2
|
||||||
sty MOCK_6522_ORB1 ; 4
|
sty MOCK_6522_ORB1 ; 4
|
||||||
sty MOCK_6522_ORB2 ; 4
|
sty MOCK_6522_ORB2 ; 4
|
||||||
|
|
||||||
; value
|
; value
|
||||||
lda AY_REGISTERS,X ; load register value ; 4
|
|
||||||
sta MOCK_6522_ORA1 ; put value on PA1 ; 4
|
sta MOCK_6522_ORA1 ; put value on PA1 ; 4
|
||||||
sta MOCK_6522_ORA2 ; put value on PA2 ; 4
|
sta MOCK_6522_ORA2 ; put value on PA2 ; 4
|
||||||
lda #MOCK_AY_WRITE ; ; 2
|
lda #MOCK_AY_WRITE ; ; 2
|
||||||
@ -122,7 +121,7 @@ mb_not_13:
|
|||||||
sty MOCK_6522_ORB1 ; 4
|
sty MOCK_6522_ORB1 ; 4
|
||||||
sty MOCK_6522_ORB2 ; 4
|
sty MOCK_6522_ORB2 ; 4
|
||||||
;===========
|
;===========
|
||||||
; 60
|
; 56
|
||||||
mb_no_write:
|
mb_no_write:
|
||||||
inx ; point to next register ; 2
|
inx ; point to next register ; 2
|
||||||
cpx #14 ; if 14 we're done ; 2
|
cpx #14 ; if 14 we're done ; 2
|
||||||
|
@ -74,6 +74,15 @@ reset_ay_both:
|
|||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
;=======================================
|
||||||
|
; clear ay -- clear all 14 AY registers
|
||||||
|
; should silence the card
|
||||||
|
;=======================================
|
||||||
|
clear_ay_both:
|
||||||
|
ldx #14
|
||||||
|
lda #0
|
||||||
|
sta MB_VALUE
|
||||||
|
clear_ay_left_loop:
|
||||||
; Write sequence
|
; Write sequence
|
||||||
; Inactive -> Latch Address -> Inactive -> Write Data -> Inactive
|
; Inactive -> Latch Address -> Inactive -> Write Data -> Inactive
|
||||||
|
|
||||||
@ -104,19 +113,8 @@ write_ay_both:
|
|||||||
sty MOCK_6522_ORB1 ; 3
|
sty MOCK_6522_ORB1 ; 3
|
||||||
sty MOCK_6522_ORB2 ; 3
|
sty MOCK_6522_ORB2 ; 3
|
||||||
|
|
||||||
rts ; 6
|
|
||||||
;===========
|
;===========
|
||||||
; 51
|
; 45
|
||||||
;=======================================
|
|
||||||
; clear ay -- clear all 14 AY registers
|
|
||||||
; should silence the card
|
|
||||||
;=======================================
|
|
||||||
clear_ay_both:
|
|
||||||
ldx #14
|
|
||||||
lda #0
|
|
||||||
sta MB_VALUE
|
|
||||||
clear_ay_left_loop:
|
|
||||||
jsr write_ay_both
|
|
||||||
dex
|
dex
|
||||||
bpl clear_ay_left_loop
|
bpl clear_ay_left_loop
|
||||||
rts
|
rts
|
||||||
|
Loading…
Reference in New Issue
Block a user