diff options
| author | KiritoDv <kiritodev01@gmail.com> | 2025-01-31 18:20:12 -0600 |
|---|---|---|
| committer | KiritoDv <kiritodev01@gmail.com> | 2025-01-31 18:20:12 -0600 |
| commit | d824ec401b7deddb11fb79fb6a7ad70a2209a170 (patch) | |
| tree | 8a6971493abdb96d5fa3298d4b98b1635d0a45e4 /src/port | |
| parent | d4bda98c073e352b6ef98f76439ebe60cce67ced (diff) | |
Added support for EU audio
Diffstat (limited to 'src/port')
| -rw-r--r-- | src/port/Engine.cpp | 9 | ||||
| -rw-r--r-- | src/port/Engine.h | 8 | ||||
| -rw-r--r-- | src/port/extractor/GameExtractor.cpp | 2 | ||||
| -rw-r--r-- | src/port/ui/ImguiUI.cpp | 19 |
4 files changed, 38 insertions, 0 deletions
diff --git a/src/port/Engine.cpp b/src/port/Engine.cpp index 27c7fb1e..7cac8971 100644 --- a/src/port/Engine.cpp +++ b/src/port/Engine.cpp @@ -542,6 +542,15 @@ int GameEngine::ShowYesNoBox(const char* title, const char* box) { return ret; } +bool GameEngine::HasVersion(SF64Version ver){ + auto versions = Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions(); + return std::find(versions.begin(), versions.end(), ver) != versions.end(); +} + +extern "C" bool GameEngine_HasVersion(SF64Version ver) { + return GameEngine::HasVersion(ver); +} + extern "C" uint32_t GameEngine_GetSampleRate() { auto player = Ship::Context::GetInstance()->GetAudio()->GetAudioPlayer(); if (player == nullptr) { diff --git a/src/port/Engine.h b/src/port/Engine.h index e6cff565..999b7462 100644 --- a/src/port/Engine.h +++ b/src/port/Engine.h @@ -10,6 +10,12 @@ struct GamePool { void* memory; }; +typedef enum { + SF64_VER_US = 0x94F1D5A7, + SF64_VER_EU = 0x6EE9ADE7, + SF64_VER_JP = 0x3728D3E1 +} SF64Version; + #ifdef __cplusplus #include <vector> #include <SDL2/SDL.h> @@ -45,6 +51,7 @@ class GameEngine { static int ShowYesNoBox(const char* title, const char* box); static void ShowMessage(const char* title, const char* message, SDL_MessageBoxFlags type = SDL_MESSAGEBOX_ERROR); + static bool HasVersion(SF64Version ver); }; extern "C" void* GameEngine_Malloc(size_t size); @@ -56,6 +63,7 @@ extern "C" void* GameEngine_Malloc(size_t size); #else #include <stdint.h> +bool GameEngine_HasVersion(SF64Version ver); void GameEngine_ProcessGfxCommands(Gfx* commands); float GameEngine_GetAspectRatio(); uint8_t GameEngine_OTRSigCheck(char* imgData); diff --git a/src/port/extractor/GameExtractor.cpp b/src/port/extractor/GameExtractor.cpp index 359d70e9..e4c2864d 100644 --- a/src/port/extractor/GameExtractor.cpp +++ b/src/port/extractor/GameExtractor.cpp @@ -14,6 +14,8 @@ std::unordered_map<std::string, std::string> mGameList = { { "f7475fb11e7e6830f82883412638e8390791ab87", "Star Fox 64 (U) (V1.1) (Uncompressed)" }, { "9bd71afbecf4d0a43146e4e7a893395e19bf3220", "Star Fox 64 (J) (V1.0)" }, { "d064229a32cc05ab85e2381ce07744eb3ffaf530", "Star Fox 64 (J) (V1.0) (Uncompressed)" }, + { "05b307b8804f992af1a1e2fbafbd588501fdf799", "Star Fox 64 (E) (V1.0)" }, + { "09f5d5c14219fc77a36c5a6ad5e63f7abd8b3385", "Star Fox 64 (E) (V1.0) (Uncompressed)" }, }; bool GameExtractor::SelectGameFromUI() { diff --git a/src/port/ui/ImguiUI.cpp b/src/port/ui/ImguiUI.cpp index f20e7ca2..0b1aaf57 100644 --- a/src/port/ui/ImguiUI.cpp +++ b/src/port/ui/ImguiUI.cpp @@ -107,6 +107,10 @@ static const char* filters[3] = { "Linear", "None" }; +static const char* voiceLangs[] = { + "Original", /*"Japanese",*/ "Lylat" +}; + void DrawSettingsMenu(){ if(UIWidgets::BeginMenu("Settings")){ if (UIWidgets::BeginMenu("Audio")) { @@ -166,6 +170,21 @@ void DrawSettingsMenu(){ ImGui::EndMenu(); } + if(GameEngine::HasVersion(SF64_VER_EU)){ + UIWidgets::Spacer(0); + if (UIWidgets::BeginMenu("Language")) { + if (UIWidgets::CVarCombobox("Voices", "gVoiceLanguage", voiceLangs, + { + .tooltip = "Changes the language of the voice acting in the game", + .defaultIndex = 0, + })) { + Audio_SetVoiceLanguage(CVarGetInteger("gVoiceLanguage", 0)); + }; + ImGui::Dummy(ImVec2(ImGui::CalcTextSize(voiceLangs[0]).x + 55, 0.0f)); + ImGui::EndMenu(); + } + } + UIWidgets::Spacer(0); if (UIWidgets::BeginMenu("Controller")) { |
