Skip to content

Commit

Permalink
#538: Fixed MSU resume cancel after Samus Fanfare
Browse files Browse the repository at this point in the history
The comparisons were in the wrong order, so the cancel could only happen if the outgoing track were simultaneously equal to both Item Room and Samus Fanfare. This understandably never seemed to happen.
  • Loading branch information
CPColin committed Jul 7, 2024
1 parent 79c7605 commit 18aeaec
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions alttp_sm_combo_randomizer_rom/src/sm/msu.asm
Original file line number Diff line number Diff line change
Expand Up @@ -523,13 +523,12 @@ ComputeResumeAndVolume:
sep #$20 ; Return to 8-bit mode
bra .NoFade
.CheckResume
;; If the outgoing track is Item/Elevator Room, set the MSU volume low so we can fade in
;; But only if the incoming track is the one we set to resume above and we haven't timed out
lda.w !CURRENT_MSU_TRACK
CMP #!TRACK_ITEM_ROOM : BNE .NoFade
;; If the outgoing track is Samus Fanfare, never resume
lda.w !CURRENT_MSU_TRACK
CMP #!TRACK_SAMUS_FANFARE : BEQ .NoFade
CMP #!TRACK_SAMUS_FANFARE : BEQ .ResetResume
;; If the outgoing track is Item/Elevator Room, we might fade in
CMP #!TRACK_ITEM_ROOM : BNE .NoFade
;; Check if the incoming track is the one we set to resume above and we haven't timed out
pla ; Load the incoming track back into the accumulator...
pha ; ...but keep it on the stack because we need it again at the end of the block.
CMP !RESUME_MSU_TRACK : BNE .NoFade
Expand All @@ -540,7 +539,7 @@ ComputeResumeAndVolume:
cmp.w !NO_RESUME_AFTER_LO
+
sep #$20 ; Return to 8-bit mode
bcs .ResetResume ; Greater than or equal to
bcs .ResetResume ; Greater than or equal to means we timed out
.SetFade
lda.b #!MIN_VOLUME
bra .FadeDone
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<TargetFramework>net8.0-windows</TargetFramework>
<UseWPF>true</UseWPF>
<ApplicationIcon>chozo20.ico</ApplicationIcon>
<Version>9.8.0</Version>
<Version>9.8.1</Version>
<Title>SMZ3 Cas' Randomizer</Title>
<AssemblyTitle>SMZ3 Cas' Randomizer</AssemblyTitle>
<Authors>Vivelin</Authors>
Expand Down

0 comments on commit 18aeaec

Please sign in to comment.