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% Fixes,zero init 2776 ?? 1C.10 28s 171s 16.3%
Qkumba-SuperSMC 2739 ?? 1B.15 27s 171s 15.8% Qkumba-SuperSMC 2739 ?? 1B.15 27s 171s 15.8%
MoveNoteToZP 2650 ?? 1A.23 26s 171s 15.2% MoveNoteToZP 2650 ?? 1A.23 26s 171s 15.2%
MinorFixes 2418 + 143 1A.1F 26s 171s 15.2%
Times: Validated Times: Validated
BH.PT3: 10.0B 16 1:33 93 17.2% 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_smc+1 ; 4
sta pt3_envelope_delay_orig_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_pattern_smc+1 ; 4
sta current_line_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; lda sample_b1_smc+1 ; pt3->mixer_value = ((b1 >>1) & 0x48) | pt3->mixer_value;
lsr lsr
and #$48 and #$48
pt3_mixer_value_smc:
ora #$d1 ora PT3_MIXER_VAL ; 3
sta pt3_mixer_value_smc+1 sta PT3_MIXER_VAL ; 3
;======================== ;========================
@ -1024,7 +1024,7 @@ done_note:
; set mixer value ; set mixer value
; this is a bit complex (from original code) ; this is a bit complex (from original code)
; after 3 calls it is set up properly ; after 3 calls it is set up properly
lsr pt3_mixer_value_smc+1 lsr PT3_MIXER_VAL
handle_onoff: handle_onoff:
ldy note_a+NOTE_ONOFF,X ;if (a->onoff>0) { ldy note_a+NOTE_ONOFF,X ;if (a->onoff>0) {
@ -1890,7 +1890,7 @@ do_frame:
; R14/R15 = I/O (ignored) ; R14/R15 = I/O (ignored)
ldx #0 ; needed ; 2 ldx #0 ; needed ; 2
stx pt3_mixer_value_smc+1 ; 4 stx PT3_MIXER_VAL ; 3
stx pt3_envelope_add_smc+1 ; 4 stx pt3_envelope_add_smc+1 ; 4
;;ldx #(NOTE_STRUCT_SIZE*0) ; Note A ; 2 ;;ldx #(NOTE_STRUCT_SIZE*0) ; Note A ; 2
@ -2067,17 +2067,16 @@ no_scale_n:
;======================= ;=======================
; Mixer ; Mixer
lda pt3_mixer_value_smc+1 ; 4 ; PT3_MIXER_VAL is already in AY_REGISTERS+7
sta AY_REGISTERS+7 ; 3
;======================= ;=======================
; Amplitudes ; Amplitudes
lda note_a+NOTE_AMPLITUDE ; 4 lda note_a+NOTE_AMPLITUDE ; 3
sta AY_REGISTERS+8 ; 3 sta AY_REGISTERS+8 ; 3
lda note_b+NOTE_AMPLITUDE ; 4 lda note_b+NOTE_AMPLITUDE ; 3
sta AY_REGISTERS+9 ; 3 sta AY_REGISTERS+9 ; 3
lda note_c+NOTE_AMPLITUDE ; 4 lda note_c+NOTE_AMPLITUDE ; 3
sta AY_REGISTERS+10 ; 3 sta AY_REGISTERS+10 ; 3
;====================================== ;======================================

View File

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