Skip to content

Commit

Permalink
Add option to allow the ocarina to be played faster (HarbourMasters#903)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
lilDavid authored Jul 24, 2022
1 parent d3c2c0e commit 62d9390
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions libultraship/libultraship/ImGuiImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
14 changes: 8 additions & 6 deletions soh/src/code/code_800EC960.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down Expand Up @@ -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) ||
Expand Down Expand Up @@ -2057,7 +2059,7 @@ void func_800EE6F4(void) {
}

if ((D_80130F3C != 0) && (sPrevOcarinaNoteVal != sCurOcarinaBtnVal)) {
D_80131880 = 1;
sOcarinaDropInputTimer = 1;
}

sPrevOcarinaNoteVal = sCurOcarinaBtnVal;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 62d9390

Please sign in to comment.