chiptune_player: had timing of absolute store wrong :(

it's 4 cycles, not 3
This commit is contained in:
Vince Weaver 2018-03-12 13:49:15 -04:00
parent 47b441afb9
commit d85eda74bf
2 changed files with 19 additions and 20 deletions

View File

@ -467,17 +467,17 @@ Interrupt Timing / AY write latency:
==================================== ====================================
Originally roughly 1500 cycles from start of interrupt Originally roughly 1500 cycles from start of interrupt
to all AY registers being written. to all AY registers being written.
1500 1600
Moved clock to after, near the visualization stuff, more like Moved clock to after, near the visualization stuff, more like
1378 = 13+ (105*13) 1534 = 13+ (117*13)
Load frame data for next time at end of IRQ, instead of begin Load frame data for next time at end of IRQ, instead of begin
1029 = 13+2+(78*13) 1185 = 13+2+(90*13)
Inlined the mockingboard write routine Inlined the mockingboard write routine
873 = 13+2+(66*13) 1029 = 13+2+(78*13)
Only write registers that change. Added 6 cycles per loop Only write registers that change. Added 6 cycles per loop
951 worst case = 13+2+(10+5+50+7)*13 1107 worst case = 13+2+(10+5+62+7)*13
304 if only one reg changed = 13+2+(18*13)+55 316 if only one reg changed = 13+2+(18*13)+67

View File

@ -69,29 +69,28 @@ mb_not_13:
; inlined "write_ay_both" to save 12 cycles ; inlined "write_ay_both" to save 12 cycles
; address ; address
stx MOCK_6522_ORA1 ; put address on PA1 ; 3 stx MOCK_6522_ORA1 ; put address on PA1 ; 4
stx MOCK_6522_ORA2 ; put address on PA2 ; 3 stx MOCK_6522_ORA2 ; put address on PA2 ; 4
lda #MOCK_AY_LATCH_ADDR ; latch_address for PB1 ; 2 lda #MOCK_AY_LATCH_ADDR ; latch_address for PB1 ; 2
sta MOCK_6522_ORB1 ; latch_address on PB1 ; 3 sta MOCK_6522_ORB1 ; latch_address on PB1 ; 4
sta MOCK_6522_ORB2 ; latch_address on PB2 ; 3 sta MOCK_6522_ORB2 ; latch_address on PB2 ; 4
lda #MOCK_AY_INACTIVE ; go inactive ; 2 lda #MOCK_AY_INACTIVE ; go inactive ; 2
sta MOCK_6522_ORB1 ; 3 sta MOCK_6522_ORB1 ; 4
sta MOCK_6522_ORB2 ; 3 sta MOCK_6522_ORB2 ; 4
; value ; value
lda MB_VALUE ; 3 lda MB_VALUE ; 3
sta MOCK_6522_ORA1 ; put value on PA1 ; 3 sta MOCK_6522_ORA1 ; put value on PA1 ; 4
sta MOCK_6522_ORA2 ; put value on PA2 ; 3 sta MOCK_6522_ORA2 ; put value on PA2 ; 4
lda #MOCK_AY_WRITE ; ; 2 lda #MOCK_AY_WRITE ; ; 2
sta MOCK_6522_ORB1 ; write on PB1 ; 3 sta MOCK_6522_ORB1 ; write on PB1 ; 4
sta MOCK_6522_ORB2 ; write on PB2 ; 3 sta MOCK_6522_ORB2 ; write on PB2 ; 4
lda #MOCK_AY_INACTIVE ; go inactive ; 2 lda #MOCK_AY_INACTIVE ; go inactive ; 2
sta MOCK_6522_ORB1 ; 3 sta MOCK_6522_ORB1 ; 4
sta MOCK_6522_ORB2 ; 3 sta MOCK_6522_ORB2 ; 4
; 50
;=========== ;===========
; 50 ; 62
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