2022-01-09 23:58:37 -05:00
|
|
|
;=====================
|
|
|
|
;=====================
|
|
|
|
;=====================
|
2022-01-10 00:47:32 -05:00
|
|
|
; ay3 write regs
|
2022-01-09 23:58:37 -05:00
|
|
|
;=====================
|
|
|
|
;=====================
|
|
|
|
;=====================
|
2022-01-19 00:51:08 -05:00
|
|
|
; write all 13 registers at AY_REGS
|
2022-01-09 23:58:37 -05:00
|
|
|
|
2022-01-10 00:47:32 -05:00
|
|
|
ay3_write_regs:
|
|
|
|
|
2022-01-19 00:51:08 -05:00
|
|
|
ldx #12
|
2022-01-10 00:47:32 -05:00
|
|
|
ay3_write_reg_loop:
|
|
|
|
|
2022-01-09 23:58:37 -05:00
|
|
|
lda #MOCK_AY_LATCH_ADDR ; latch_address for PB1 ; 2
|
|
|
|
ldy #MOCK_AY_INACTIVE ; go inactive ; 2
|
|
|
|
|
|
|
|
stx MOCK_6522_ORA1 ; put address on PA1 ; 4
|
|
|
|
sta MOCK_6522_ORB1 ; latch_address on PB1 ; 4
|
|
|
|
sty MOCK_6522_ORB1 ; 4
|
|
|
|
|
|
|
|
; value
|
2022-01-11 02:59:52 -05:00
|
|
|
lda AY_REGS,X
|
2022-01-09 23:58:37 -05:00
|
|
|
sta MOCK_6522_ORA1 ; put value on PA1 ; 4
|
|
|
|
lda #MOCK_AY_WRITE ; ; 2
|
|
|
|
sta MOCK_6522_ORB1 ; write on PB1 ; 4
|
|
|
|
sty MOCK_6522_ORB1 ; 4
|
|
|
|
|
2022-01-10 00:47:32 -05:00
|
|
|
dex
|
|
|
|
bpl ay3_write_reg_loop
|
|
|
|
|