From d6ce37ce7ecd9e680e33d5f1658e250002ec6b2c Mon Sep 17 00:00:00 2001 From: lilDavid <1337lilDavid@gmail.com> Date: Sun, 24 Jul 2022 08:48:06 -0500 Subject: [PATCH] Add option to allow the ocarina to be played faster (#903) * Add the ability to play the ocarina really fast like in MM3D * Clean up CVar condition * Rename Unlimited Ocarina Speed to Prevent Dropped Ocarina Inputs --- libultraship/libultraship/ImGuiImpl.cpp | 2 ++ soh/src/code/code_800EC960.c | 14 ++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/libultraship/libultraship/ImGuiImpl.cpp b/libultraship/libultraship/ImGuiImpl.cpp index 4fed3d115..95fc3f663 100644 --- a/libultraship/libultraship/ImGuiImpl.cpp +++ b/libultraship/libultraship/ImGuiImpl.cpp @@ -975,6 +975,8 @@ namespace SohImGui { Tooltip("The default response to Kaepora Gaebora is\nalways that you understood what he said"); EnhancementCheckbox("Fast Ocarina Playback", "gFastOcarinaPlayback"); Tooltip("Skip the part where the Ocarina playback is called when you play\na song"); + EnhancementCheckbox("Prevent Dropped Ocarina Inputs", "gDpadNoDropOcarinaInput"); + Tooltip("Prevent dropping inputs when playing the ocarina quickly"); EnhancementCheckbox("Instant Putaway", "gInstantPutaway"); Tooltip("Allow Link to put items away without having to wait around"); EnhancementCheckbox("Mask Select in Inventory", "gMaskSelect"); diff --git a/soh/src/code/code_800EC960.c b/soh/src/code/code_800EC960.c index c5d150984..cab454b13 100644 --- a/soh/src/code/code_800EC960.c +++ b/soh/src/code/code_800EC960.c @@ -1028,7 +1028,7 @@ s8 D_80131870 = 0; u8 D_80131874 = 0; u8 D_80131878 = 0; u8 D_8013187C = 0; -u8 D_80131880 = 0; +u8 sOcarinaDropInputTimer = 0; OcarinaNote sPierresSong[108] = { { 0xFF, 0, 0, 0, 0, 0, 0 }, @@ -1550,9 +1550,11 @@ void func_800ED458(s32 arg0) { u32 phi_v1_2; bool dpad = CVar_GetS32("gDpadOcarinaText", 0); - if (D_80130F3C != 0 && D_80131880 != 0) { - D_80131880--; - return; + if (D_80130F3C != 0 && sOcarinaDropInputTimer != 0) { + sOcarinaDropInputTimer--; + if (!CVar_GetS32("gDpadNoDropOcarinaInput", 0)) { + return; + } } if ((D_8016BA10 == 0) || @@ -2057,7 +2059,7 @@ void func_800EE6F4(void) { } if ((D_80130F3C != 0) && (sPrevOcarinaNoteVal != sCurOcarinaBtnVal)) { - D_80131880 = 1; + sOcarinaDropInputTimer = 1; } sPrevOcarinaNoteVal = sCurOcarinaBtnVal; @@ -2110,7 +2112,7 @@ void func_800EE930(void) { sRecordingStaff.noteIdx = OCARINA_NOTE_INVALID; sRecordingStaff.state = 0xFF; sRecordingStaff.pos = 0; - D_80131880 = 0; + sOcarinaDropInputTimer = 0; } f32 D_80131C8C = 0.0f;