pt3: pt3_mixer_val is copied direct to AY_regs, so make same var

This commit is contained in:
Vince Weaver 2019-06-19 00:40:10 -04:00
parent 4b9875f697
commit 8aa831782c
3 changed files with 26 additions and 25 deletions

View File

@ -28,6 +28,7 @@ Code Optimization
Fixes,zero init 2776 ?? 1C.10 28s 171s 16.3%
Qkumba-SuperSMC 2739 ?? 1B.15 27s 171s 15.8%
MoveNoteToZP 2650 ?? 1A.23 26s 171s 15.2%
MinorFixes 2418 + 143 1A.1F 26s 171s 15.2%
Times: Validated
BH.PT3: 10.0B 16 1:33 93 17.2%

View File

@ -409,7 +409,7 @@ zero_song_structs_loop:
sta pt3_envelope_delay_smc+1 ; 4
sta pt3_envelope_delay_orig_smc+1 ; 4
sta pt3_mixer_value_smc+1 ; 4
sta PT3_MIXER_VAL ; 3
sta current_pattern_smc+1 ; 4
sta current_line_smc+1 ; 4
@ -986,9 +986,9 @@ noise_slide_done:
lda sample_b1_smc+1 ; pt3->mixer_value = ((b1 >>1) & 0x48) | pt3->mixer_value;
lsr
and #$48
pt3_mixer_value_smc:
ora #$d1
sta pt3_mixer_value_smc+1
ora PT3_MIXER_VAL ; 3
sta PT3_MIXER_VAL ; 3
;========================
@ -1024,7 +1024,7 @@ done_note:
; set mixer value
; this is a bit complex (from original code)
; after 3 calls it is set up properly
lsr pt3_mixer_value_smc+1
lsr PT3_MIXER_VAL
handle_onoff:
ldy note_a+NOTE_ONOFF,X ;if (a->onoff>0) {
@ -1890,7 +1890,7 @@ do_frame:
; R14/R15 = I/O (ignored)
ldx #0 ; needed ; 2
stx pt3_mixer_value_smc+1 ; 4
stx PT3_MIXER_VAL ; 3
stx pt3_envelope_add_smc+1 ; 4
;;ldx #(NOTE_STRUCT_SIZE*0) ; Note A ; 2
@ -2067,17 +2067,16 @@ no_scale_n:
;=======================
; Mixer
lda pt3_mixer_value_smc+1 ; 4
sta AY_REGISTERS+7 ; 3
; PT3_MIXER_VAL is already in AY_REGISTERS+7
;=======================
; Amplitudes
lda note_a+NOTE_AMPLITUDE ; 4
lda note_a+NOTE_AMPLITUDE ; 3
sta AY_REGISTERS+8 ; 3
lda note_b+NOTE_AMPLITUDE ; 4
lda note_b+NOTE_AMPLITUDE ; 3
sta AY_REGISTERS+9 ; 3
lda note_c+NOTE_AMPLITUDE ; 4
lda note_c+NOTE_AMPLITUDE ; 3
sta AY_REGISTERS+10 ; 3
;======================================

View File

@ -45,20 +45,21 @@ SEEDH = $4F
;FILEMH = $65
AY_REGISTERS = $50
A_FINE_TONE = $50
A_COARSE_TONE = $51
B_FINE_TONE = $52
B_COARSE_TONE = $53
C_FINE_TONE = $54
C_COARSE_TONE = $55
NOISE = $56
ENABLE = $57
A_VOLUME = $58
B_VOLUME = $59
C_VOLUME = $5A
ENVELOPE_FINE = $5B
ENVELOPE_COARSE = $5C
ENVELOPE_SHAPE = $5D
A_FINE_TONE = $50
A_COARSE_TONE = $51
B_FINE_TONE = $52
B_COARSE_TONE = $53
C_FINE_TONE = $54
C_COARSE_TONE = $55
NOISE = $56
ENABLE = $57
PT3_MIXER_VAL = $57
A_VOLUME = $58
B_VOLUME = $59
C_VOLUME = $5A
ENVELOPE_FINE = $5B
ENVELOPE_COARSE = $5C
ENVELOPE_SHAPE = $5D
PATTERN_L = $00
PATTERN_H = $01