chiptune: recent changes we were dropping the envelope; fix

This commit is contained in:
Vince Weaver 2018-03-10 23:46:15 -05:00
parent 254cd0b163
commit 58d864c033
3 changed files with 35 additions and 10 deletions

View File

@ -474,3 +474,6 @@ Timing:
Moved to load frame data at end of IRQ instead of begin Moved to load frame data at end of IRQ instead of begin
1029 = 13+2+(78*13) 1029 = 13+2+(78*13)
Moved to load frame data at end of IRQ instead of begin
873 = 13+2+(66*13)

View File

@ -29,7 +29,8 @@ NUM_FILES EQU 15
lda #$ff lda #$ff
sta RASTERBARS_ON sta RASTERBARS_ON
lda #10 ; start at SDEMO lda #7 ; start at LYRA
; lda #10 ; start at SDEMO
sta WHICH_FILE sta WHICH_FILE
; print detection message ; print detection message

View File

@ -55,26 +55,47 @@ mb_write_loop:
cpx #13 ; 2 cpx #13 ; 2
bne mb_not_13 ; 3/2nt bne mb_not_13 ; 3/2nt
bmi increment_offset ; 3/2nt cmp #$ff ; 2
beq mb_skip_13 ; 3/2nt
;============ ;============
; typ 9 ; typ 9
mb_not_13: mb_not_13:
sta MB_VALUE ; 3 sta MB_VALUE ; 3
; INLINE this (could save 72 cycles)
jsr write_ay_both ; assume 3 channel (not six) ; 6 ; inlined "write_ay_both" to save 12 cycles
; so write same to both
; left/right ; address
; 53 stx MOCK_6522_ORA1 ; put address on PA1 ; 3
stx MOCK_6522_ORA2 ; put address on PA2 ; 3
lda #MOCK_AY_LATCH_ADDR ; latch_address for PB1 ; 2
sta MOCK_6522_ORB1 ; latch_address on PB1 ; 3
sta MOCK_6522_ORB2 ; latch_address on PB2 ; 3
lda #MOCK_AY_INACTIVE ; go inactive ; 2
sta MOCK_6522_ORB1 ; 3
sta MOCK_6522_ORB2 ; 3
; value
lda MB_VALUE ; 3
sta MOCK_6522_ORA1 ; put value on PA1 ; 3
sta MOCK_6522_ORA2 ; put value on PA2 ; 3
lda #MOCK_AY_WRITE ; ; 2
sta MOCK_6522_ORB1 ; write on PB1 ; 3
sta MOCK_6522_ORB2 ; write on PB2 ; 3
lda #MOCK_AY_INACTIVE ; go inactive ; 2
sta MOCK_6522_ORB1 ; 3
sta MOCK_6522_ORB2 ; 3
; 50
;=========== ;===========
; 62 ; 50
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
bmi mb_write_loop ; otherwise, loop ; 3/2nt bmi mb_write_loop ; otherwise, loop ; 3/2nt
;============ ;============
; 7 ; 7
mb_skip_13:
@ -109,7 +130,7 @@ mb_load_loop:
sta INH ; 3 sta INH ; 3
inx ; point to next register ; 2 inx ; point to next register ; 2
cpx #13 ; if 14 we're done ; 2 cpx #14 ; if 14 we're done ; 2
bmi mb_load_loop ; otherwise, loop ; 3/2nt bmi mb_load_loop ; otherwise, loop ; 3/2nt
;============ ;============
; 18 ; 18