diff --git a/assets/yaml/eu/rev0/ast_audio.yaml b/assets/yaml/eu/rev0/ast_audio.yaml index 1cacdc2d..2fb061df 100644 --- a/assets/yaml/eu/rev0/ast_audio.yaml +++ b/assets/yaml/eu/rev0/ast_audio.yaml @@ -27,5 +27,5 @@ audio_seq_table: audio_soundfont_table: { type: NAUDIO:V1:AUDIO_TABLE, format: SOUNDFONT, offset: 0xC51B0, symbol: gSoundFontTableInit } -audio_seq_font_table: # count may be wrong - { type: ARRAY, count: 283, array_type: u8, offset: 0xC53E0, symbol: gSeqFontTableInit } \ No newline at end of file +audio_seq_font_table: + { type: ARRAY, count: 287, array_type: u8, offset: 0xC53E0, symbol: gSeqFontTableInit } \ No newline at end of file diff --git a/config.yml b/config.yml index 5e3e0625..b2289bb6 100644 --- a/config.yml +++ b/config.yml @@ -1,5 +1,6 @@ # Supported Star Fox 64 Versions: US, JP +# US 1.1 09f0d105f476b00efa5303a3ebc42e60a7753b7a: name: Star Fox 64 (U) (V1.1) (Compressed) preprocess: @@ -29,6 +30,7 @@ f7475fb11e7e6830f82883412638e8390791ab87: # - include/sf64event.h # - include/sf64player.h +# US 1.0 d8b1088520f7c5f81433292a9258c1184afa1457: name: Star Fox 64 (U) (V1.0) (Compressed) preprocess: @@ -58,11 +60,12 @@ d8b1088520f7c5f81433292a9258c1184afa1457: # - include/sf64event.h # - include/sf64player.h +# JP 1.0 9bd71afbecf4d0a43146e4e7a893395e19bf3220: name: Star Fox 64 (JP) (V1.0) (Compressed) preprocess: decompress_mio0: - method: mio0-comptool + method: mioh0-comptool type: decompress target: d064229a32cc05ab85e2381ce07744eb3ffaf530 restart: true @@ -85,4 +88,34 @@ d064229a32cc05ab85e2381ce07744eb3ffaf530: # - include/sf64mesg.h # - include/sf64audio_external.h # - include/sf64event.h - # - include/sf64player.h \ No newline at end of file + # - include/sf64player. + +# EU 1.0 +05b307b8804f992af1a1e2fbafbd588501fdf799: + name: Star Fox 64 (EU) (V1.0) (Compressed) + preprocess: + decompress_mio0: + method: mioh0-comptool + type: decompress + target: 09f5d5c14219fc77a36c5a6ad5e63f7abd8b3385 + restart: true + +09f5d5c14219fc77a36c5a6ad5e63f7abd8b3385: + name: Star Fox 64 (EU) (V1.0) + path: assets/yaml/eu/rev0 + config: + gbi: F3DEX + sort: OFFSET + logging: INFO + output: + binary: ./mods/sf64eu.o2r + code: srceu/assets + headers: include/assets + modding: srceu/assets + # enums: + # - include/sf64object.h + # - include/sf64level.h + # - include/sf64mesg.h + # - include/sf64audio_external.h + # - include/sf64event.h + # - include/sf64player. \ No newline at end of file diff --git a/include/bgm.h b/include/bgm.h index 62f92d74..cd1703a6 100644 --- a/include/bgm.h +++ b/include/bgm.h @@ -81,12 +81,8 @@ typedef enum BgmSeqIds { /* 63 */ SEQ_ID_TRAINING, /* 64 */ SEQ_ID_VE_CLEAR, /* 65 */ SEQ_ID_BOSS_RESUME, -#ifdef VERSION_EU /* 66 */ SEQ_ID_VOICE_LYLAT, /* 67 */ SEQ_ID_MAX, -#else - /* 66 */ SEQ_ID_MAX, -#endif /* -1 */ SEQ_ID_NONE = 0xFFFF, } BgmSeqIds; diff --git a/include/sf64audio_provisional.h b/include/sf64audio_provisional.h index 952af4dc..b4d18620 100644 --- a/include/sf64audio_provisional.h +++ b/include/sf64audio_provisional.h @@ -6,6 +6,8 @@ #ifndef SF64_AUDIO_H #define SF64_AUDIO_H +#define AUDIO_EU 0 + #include #include "sf64audio_external.h" @@ -1234,6 +1236,7 @@ extern s16 gD_800DD200[]; extern f32 gHeadsetPanVolume[128]; extern f32 gStereoPanVolume[128]; extern f32 gDefaultPanVolume[128]; +extern u8 gVoiceLanguage; #ifdef __cplusplus } diff --git a/src/audio/audio_context.c b/src/audio/audio_context.c index 65d15a6f..c40327c7 100644 --- a/src/audio/audio_context.c +++ b/src/audio/audio_context.c @@ -101,7 +101,7 @@ s16 gAiBuffLengths[3]; u32 gAudioRandom; u32 D_80155D88; volatile u32 gAudioResetTimer; - +u8 gVoiceLanguage = 0; u64 gAudioContextEnd[2]; ReverbSettings D_800C74D0[2] = { { 1, 0x30, 0x3000, 0, 0 }, { 1, 0x40, 0x4000, 0xD000, 0x3000 } }; diff --git a/src/audio/audio_general.c b/src/audio/audio_general.c index bc2beb18..25284aa4 100644 --- a/src/audio/audio_general.c +++ b/src/audio/audio_general.c @@ -530,6 +530,11 @@ void Audio_SetSfxProperties(u8 bankId, u8 entryIndex, u8 channelId) { } break; case SFX_BANK_SYSTEM: + if (AUDIO_EU) { + if (entry->state == 2) { + AUDIOCMD_CHANNEL_SET_IO(SEQ_PLAYER_SFX, channelId, 1, gVoiceLanguage); + } + } if (sSfxChannelLayout == SFXCHAN_3) { if (entry->token != 4) { pan = (entry->token & 1) * 127; @@ -693,11 +698,10 @@ void Audio_ProcessSeqCmd(u32 seqCmd) { seqArgs = (seqCmd & 0xFF00) >> 8; fadeTimer = (seqCmd & 0xFF0000) >> 13; - seqArgs = 0; + seqArgs = 0; - //if (!sActiveSequences[seqPlayId].isWaitingForFonts) - if (true) - { + // if (!sActiveSequences[seqPlayId].isWaitingForFonts) + if (true) { if (seqArgs < 0x80) { Audio_StartSequence(seqPlayId, seqNumber, seqArgs, fadeTimer); } else { @@ -893,14 +897,11 @@ void Audio_ProcessSeqCmd(u32 seqCmd) { oldSpecId = sAudioSpecId; sAudioSpecId = specId; - if (oldSpecId != specId) - { + if (oldSpecId != specId) { AudioThread_ResetAudioHeap(specId); Audio_StartReset(oldSpecId); AUDIOCMD_GLOBAL_STOP_AUDIOCMDS(); - } - else - { + } else { Audio_StopSequence(SEQ_PLAYER_BGM, 1); Audio_StopSequence(SEQ_PLAYER_FANFARE, 1); } @@ -998,8 +999,7 @@ void Audio_UpdateActiveSequences(void) { for (seqPlayId = 0; seqPlayId < SEQ_PLAYER_MAX; seqPlayId++) { if (sActiveSequences[seqPlayId].isWaitingForFonts) { - switch ((s32) AudioThread_GetAsyncLoadStatus(&out)) - { + switch ((s32) AudioThread_GetAsyncLoadStatus(&out)) { case SEQ_PLAYER_BGM + 1: case SEQ_PLAYER_FANFARE + 1: case SEQ_PLAYER_SFX + 1: @@ -1896,7 +1896,7 @@ s32 Audio_GetCurrentVoice(void) { s32 Audio_GetCurrentVoiceStatus(void) { // LAudioTODO: Stub for now // return 1; - + SequenceChannel* channel = gSeqPlayers[SEQ_PLAYER_VOICE].channels[15]; SequenceLayer* layer = channel->layers[0]; @@ -2398,6 +2398,9 @@ void Audio_StopPlayerNoise(u8 playerId) { break; case FORM_LANDMASTER: sfxId = NA_SE_TANK_ENGIN; + if (AUDIO_EU) { + Audio_KillSfxBySourceAndId(gPlayer[playerId].sfx.srcPos, NA_SE_TANK_GO_UP); + } break; case FORM_BLUE_MARINE: sfxId = NA_SE_MARINE_ENGINE00; @@ -2579,7 +2582,7 @@ void Audio_SetBgmParam(s8 bgmParam) { } void Audio_PlaySequence(u8 seqPlayId, u16 seqId, u8 fadeinTime, u8 bgmParam) { - //seqId &= 0xFF; + // seqId &= 0xFF; SEQCMD_SET_SEQPLAYER_IO(seqPlayId, 0, bgmParam); SEQCMD_PLAY_SEQUENCE(seqPlayId, fadeinTime, 0, seqId); } @@ -2654,7 +2657,7 @@ void Audio_RestoreVolumeSettings(u8 audioType) { } } -void Audio_SetVolume(u8 audioType, u8 volume) { +void Audio_SetVolume(u8 audioType, u8 volume) { if (volume > 99) { volume = 99; } @@ -2724,6 +2727,17 @@ void Audio_KillAllSfx(void) { } } +void Audio_SetVoiceLanguage(u8 language) { + gVoiceLanguage = language; + + if (gVoiceLanguage == 0) { + Audio_StartSequence(SEQ_PLAYER_VOICE, NA_BGM_VO, -1, 1); + } else { + // 0x42 sets voice language to Lylat ? + Audio_StartSequence(SEQ_PLAYER_VOICE, NA_BGM_VO_LYLAT, -1, 1); + } +} + void Audio_SetAudioSpec(u8 unused, u16 specParam) { u8 sfxChannelLayout = ((specParam & 0xFF00) >> 8); u8 specId = specParam & 0xFF; @@ -2741,6 +2755,9 @@ void Audio_InitSounds(void) { Audio_ResetSfxChannelState(); Audio_ResetActiveSequencesAndVolume(); Audio_ResetSfx(); + if (AUDIO_EU) { + AUDIOCMD_GLOBAL_SYNC_LOAD_SEQ_PARTS(NA_BGM_VO_LYLAT, 0); + } Audio_StartSequence(SEQ_PLAYER_VOICE, NA_BGM_VO, -1, 1); Audio_StartSequence(SEQ_PLAYER_SFX, NA_BGM_SE, -1, 10); } @@ -2750,7 +2767,16 @@ void Audio_RestartSeqPlayers(void) { s32 pad2; u16 fadeIn = 1; - Audio_StartSequence(SEQ_PLAYER_VOICE, NA_BGM_VO, -1, 1); + if (AUDIO_EU) { + if (gVoiceLanguage == 0) { + Audio_StartSequence(SEQ_PLAYER_VOICE, NA_BGM_VO, -1, 1); + } else { + Audio_StartSequence(SEQ_PLAYER_VOICE, NA_BGM_VO_LYLAT, -1, 1); + } + } else { + Audio_StartSequence(SEQ_PLAYER_VOICE, NA_BGM_VO, -1, 1); + } + if (sAudioSpecId == AUDIOSPEC_AQ) { fadeIn = 360; } else if (sAudioSpecId < AUDIOSPEC_23) { diff --git a/tools/Torch b/tools/Torch index 2500008e..f5c2b795 160000 --- a/tools/Torch +++ b/tools/Torch @@ -1 +1 @@ -Subproject commit 2500008eb64822562a26d856ca56dc93a4c21dd3 +Subproject commit f5c2b7951df112879e141ab45140b5d8e6bc0d38