diff options
| author | Garrett Cox <garrettjcox@gmail.com> | 2022-11-02 11:27:05 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-02 12:27:05 -0400 |
| commit | 897e70b6fcef8360c06848deb61257e49b4269f3 (patch) | |
| tree | bd7299f801895494595474e91bea9057fdecf987 /soh/src/code | |
| parent | fab52d323bb3bf48b64b660d1b84293ab754389d (diff) | |
Sfx Editor - 3rd Pass (#1873)
* First pass on SFX Editor
* Fix crash at night in Colossus (and probably other undocumented issues)
The SFX editor was swapping out the bytes corresponding to the sequence
to be played regardless of the audio command being issued. This fix
ensures the swap will only happen on commands which actually treat those
bytes as a sequence identifier.
* enabling a few more songs/fanfares
* Removing a few broken bgms, fixing the preview button returning to the wrong bgm
* Fixes restoration from miniboss music to previous one
* add timed minigame into the sounds pool
* A few small tweaks
* More cleanup and add instruments
* adjust usage of getReverseReplacementSeq
* Changes from feedback and prefix external methods with SfxEditor
Co-authored-by: RaelCappra <rael.cappra@gmail.com>
Diffstat (limited to 'soh/src/code')
| -rw-r--r-- | soh/src/code/code_800EC960.c | 7 | ||||
| -rw-r--r-- | soh/src/code/code_800F7260.c | 1 | ||||
| -rw-r--r-- | soh/src/code/code_800F9280.c | 10 |
3 files changed, 18 insertions, 0 deletions
diff --git a/soh/src/code/code_800EC960.c b/soh/src/code/code_800EC960.c index f5f1b980e..46cc63683 100644 --- a/soh/src/code/code_800EC960.c +++ b/soh/src/code/code_800EC960.c @@ -1698,6 +1698,12 @@ void Audio_OcaSetInstrument(u8 arg0) { return; } + u16 sfxEditorId = arg0 + 0x81; + u16 newArg0 = SfxEditor_GetReplacementSeq(sfxEditorId); + if (newArg0 != sfxEditorId) { + arg0 = newArg0 - 0x81; + } + Audio_SeqCmd8(SEQ_PLAYER_SFX, 1, SFX_PLAYER_CHANNEL_OCARINA, arg0); D_80130F10 = arg0; if (arg0 == 0) { @@ -4580,6 +4586,7 @@ s32 func_800F5A58(u8 arg0) { */ void func_800F5ACC(u16 seqId) { u16 curSeqId = func_800FA0B4(SEQ_PLAYER_BGM_MAIN); + curSeqId = SfxEditor_GetReverseReplacementSeq(curSeqId); if ((curSeqId & 0xFF) != NA_BGM_GANON_TOWER && (curSeqId & 0xFF) != NA_BGM_ESCAPE && curSeqId != seqId) { Audio_SetSequenceMode(SEQ_MODE_IGNORE); diff --git a/soh/src/code/code_800F7260.c b/soh/src/code/code_800F7260.c index 4a6189947..816550618 100644 --- a/soh/src/code/code_800F7260.c +++ b/soh/src/code/code_800F7260.c @@ -221,6 +221,7 @@ void Audio_ProcessSoundRequest(void) if (req->sfxId == 0) { return; } + req->sfxId = SfxEditor_GetReplacementSeq(req->sfxId); bankId = SFX_BANK(req->sfxId); if ((1 << bankId) & D_801333F0) { AudioDebug_ScrPrt((const s8*)D_80133340, req->sfxId); diff --git a/soh/src/code/code_800F9280.c b/soh/src/code/code_800F9280.c index 5fa3d50fa..66d3cec31 100644 --- a/soh/src/code/code_800F9280.c +++ b/soh/src/code/code_800F9280.c @@ -368,6 +368,16 @@ extern f32 D_80130F28; void Audio_QueueSeqCmd(u32 cmd) { + u8 op = cmd >> 28; + if (op == 0 || op == 2 || op == 12){ + u16 oldSeqId = cmd & 0xFFFF; + u16 newSeqId = SfxEditor_GetReplacementSeq(oldSeqId); + if (newSeqId != oldSeqId) { + cmd &= ~0xFFFF; + cmd |= newSeqId; + } + } + sAudioSeqCmds[sSeqCmdWrPos++] = cmd; } |
