diff --git a/src/audio/external.c b/src/audio/external.c index 0fc3256d..54ad4077 100644 --- a/src/audio/external.c +++ b/src/audio/external.c @@ -12,6 +12,7 @@ #include "game/camera.h" #include "seq_ids.h" #include "dialog_ids.h" +#include "pc/configfile.h" #define EU_FLOAT(x) x // N.B. sound banks are different from the audio banks referred to in other @@ -565,6 +566,13 @@ void create_next_audio_buffer(s16 *samples, u32 num_samples) { * Called from threads: thread5_game_loop */ void play_sound(s32 soundBits, f32 *pos) { + u8 bank; + + bank = (soundBits & SOUNDARGS_MASK_BANK) >> SOUNDARGS_SHIFT_BANK; + + if (bank == SOUND_BANK_VOICE && !configVoicesEnabled) + return; + sSoundRequests[sSoundRequestCount].soundBits = soundBits; sSoundRequests[sSoundRequestCount].position = pos; sSoundRequestCount++; @@ -1764,7 +1772,7 @@ void stop_sounds_from_source(f32 *pos) { /** * Called from threads: thread3_main, thread5_game_loop */ -static void stop_sounds_in_bank(u8 bank) { +void stop_sounds_in_bank(u8 bank) { u8 soundIndex = sSoundBanks[bank][0].next; while (soundIndex != 0xff) { diff --git a/src/audio/external.h b/src/audio/external.h index d4237d2f..f65d7b36 100644 --- a/src/audio/external.h +++ b/src/audio/external.h @@ -40,6 +40,7 @@ void get_currently_playing_sound(u8 bank, u8 *numPlayingSounds, u8 *numSoundsInB void stop_sound(u32 soundBits, f32 *pos); void moon_stop_sound(u32 soundBits); void stop_sounds_from_source(f32 *pos); +void stop_sounds_in_bank(u8 bank); void stop_sounds_in_continuous_banks(void); void sound_banks_disable(u8 player, u16 bankMask); void sound_banks_enable(u8 player, u16 bankMask); diff --git a/src/moon/imgui/imgui_impl.cpp b/src/moon/imgui/imgui_impl.cpp index 056cdad1..f2b38ca2 100644 --- a/src/moon/imgui/imgui_impl.cpp +++ b/src/moon/imgui/imgui_impl.cpp @@ -81,8 +81,8 @@ using namespace std; SDL_Window* window = nullptr; ImGuiIO* io = nullptr; -#define SM64_WIDTH 640 -#define SM64_HEIGHT 480 +#define SM64_WIDTH 1280 +#define SM64_HEIGHT 960 // Helper to display a little (?) mark which shows a tooltip when hovered. static void HelpMarker(const char* desc) @@ -600,8 +600,8 @@ namespace MoonInternal { strcpy(cc_gameshark, global_color_to_cc().c_str()); } } - if (ImGui::BeginTabItem("CC GameShark")) { - ImGui::InputTextMultiline("###gameshark", cc_gameshark, IM_ARRAYSIZE(cc_gameshark), ImVec2(-FLT_MIN, ImGui::GetTextLineHeight() * 25), ImGuiInputTextFlags_CharsUppercase); + if (ImGui::BeginTabItem("GameShark")) { + ImGui::InputTextMultiline("###gameshark_box", cc_gameshark, IM_ARRAYSIZE(cc_gameshark), ImVec2(-FLT_MIN, ImGui::GetTextLineHeight() * 25), ImGuiInputTextFlags_CharsUppercase); ImGui::Dummy(ImVec2(0, 5)); @@ -672,6 +672,7 @@ namespace MoonInternal { ImGui::SliderInt("SFX", (int*)&configSfxVolume, 0, MAX_VOLUME); ImGui::SliderInt("Music", (int*)&configMusicVolume, 0, MAX_VOLUME); ImGui::SliderInt("Environment", (int*)&configEnvVolume, 0, MAX_VOLUME); + ImGui::Checkbox("Enable Voices", &configVoicesEnabled); } if (ImGui::CollapsingHeader("Gameplay")) { diff --git a/src/pc/configfile.c b/src/pc/configfile.c index 98c5febc..51ca6e92 100644 --- a/src/pc/configfile.c +++ b/src/pc/configfile.c @@ -78,6 +78,7 @@ unsigned int configMasterVolume = MAX_VOLUME; // 0 - MAX_VOLUME unsigned int configMusicVolume = 0; unsigned int configSfxVolume = MAX_VOLUME; unsigned int configEnvVolume = MAX_VOLUME; +bool configVoicesEnabled = false; // Keyboard mappings (VK_ values, by default keyboard/gamepad/mouse) unsigned int configKeyA[MAX_BINDS] = { 0x0026, 0x1000, 0x1103 }; @@ -140,6 +141,7 @@ static const struct ConfigOption options[] = { {.name = "music_volume", .type = CONFIG_TYPE_UINT, .uintValue = &configMusicVolume}, {.name = "sfx_volume", .type = CONFIG_TYPE_UINT, .uintValue = &configSfxVolume}, {.name = "env_volume", .type = CONFIG_TYPE_UINT, .uintValue = &configEnvVolume}, + {.name = "voices_enabled", .type = CONFIG_TYPE_BOOL, .boolValue = &configVoicesEnabled}, {.name = "key_a", .type = CONFIG_TYPE_BIND, .uintValue = configKeyA}, {.name = "key_b", .type = CONFIG_TYPE_BIND, .uintValue = configKeyB}, {.name = "key_start", .type = CONFIG_TYPE_BIND, .uintValue = configKeyStart}, @@ -184,7 +186,7 @@ static const struct ConfigOption options[] = { {.name = "s_toggles_win", .type = CONFIG_TYPE_BOOL, .boolValue = &configImGui.s_toggles}, {.name = "s_machinima", .type = CONFIG_TYPE_BOOL, .boolValue = &configImGui.s_machinima}, {.name = "s_appearance_win", .type = CONFIG_TYPE_BOOL, .boolValue = &configImGui.s_appearance}, - {.name = "s_options_win", .type = CONFIG_TYPE_BOOL, .boolValue = &configImGui.s_options}, + {.name = "s_options_win", .type = CONFIG_TYPE_BOOL, .boolValue = &configImGui.s_options}, {.name = "n64Mode", .type = CONFIG_TYPE_BOOL, .boolValue = &configImGui.n64Mode} }; diff --git a/src/pc/configfile.h b/src/pc/configfile.h index 5199e742..2a924f11 100644 --- a/src/pc/configfile.h +++ b/src/pc/configfile.h @@ -42,6 +42,7 @@ extern unsigned int configMasterVolume; extern unsigned int configMusicVolume; extern unsigned int configSfxVolume; extern unsigned int configEnvVolume; +extern bool configVoicesEnabled; extern unsigned int configKeyA[]; extern unsigned int configKeyB[]; extern unsigned int configKeyStart[];