Skip to content

Commit

Permalink
Potential fix for unhandled fades-to-silence.
Browse files Browse the repository at this point in the history
Currently untested. Potential fix for #73, #38, part of #74, and maybe #32.
  • Loading branch information
Dizzy611 committed Apr 17, 2018
1 parent 6b81b9d commit 62857e1
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions patch/ff3msu.asm
Expand Up @@ -68,6 +68,13 @@
.DEFINE MSUControl_PlayLoop %00000011
.DEFINE MSUControl_Stop %00000000

; SPC Commands
.DEFINE SPCSubSong $82
.DEFINE SPCFade $81
.DEFINE SPCPlaySong $10
.DEFINE SPCInterrupt $14 ; TODO: Find out what this actually does. Is it a pause? A stop? Something else?
.DEFINE SPCSFX $18

; Subroutine hooks

.BANK 0
Expand Down Expand Up @@ -152,12 +159,20 @@ done\@:
; Main Code

CommandHandle:
; Are we being given command 82? (which appears to be switch subsong)
; Check for specific commands
lda PlayCommand
cmp #$82
beq +
jmp OriginalCommand
cmp #SPCSubSong
bne +
jmp SubSongHandle
+
cmp #SPCFade
bne +
jmp FadeHandle
+
jmp OriginalCommand
SubSongHandle:
; Are we currently playing a Dancing Mad part?
lda MSULastTrackSet
cmp #$65
Expand All @@ -179,6 +194,15 @@ setflag:
sta DancingFlag
jmp OriginalCommand
FadeHandle:
; We'll be doing a lot more here later, but for now, check for fades to volume 00, and silence the MSU-1 if found.
lda $1302
cmp #$00
bne +
stz MSUVolume
+
jmp OriginalCommand
DancingMadPart2:
; Play Part 2 of Dancing Mad
lda #$66
Expand Down

0 comments on commit 62857e1

Please sign in to comment.