From e6abf5643724a98fa4f35c8827baaea910a13c62 Mon Sep 17 00:00:00 2001 From: LittleCube Date: Fri, 18 Oct 2024 17:25:43 -0400 Subject: [PATCH] add honey and darling no sword fixes --- patches/input.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/patches/input.c b/patches/input.c index a0c5e24..2962204 100644 --- a/patches/input.c +++ b/patches/input.c @@ -541,6 +541,13 @@ RECOMP_EXPORT void recomp_set_no_bow_epona_fix(bool new_val) { no_bow_epona_fix = new_val; } +bool h_and_d_no_sword_fix = false; + +// @recomp_export void recomp_set_h_and_d_no_sword_fix(bool new_val): Set whether to enable the fix for playing Honey and Darling without a sword. +RECOMP_EXPORT void recomp_set_h_and_d_no_sword_fix(bool new_val) { + h_and_d_no_sword_fix = new_val; +} + extern s16 sPictoState; extern s16 sPictoPhotoBeingTaken; extern void* gWorkBuffer; @@ -549,6 +556,9 @@ u16 func_801A5100(void); #define ON_EPONA (player->stateFlags1 & PLAYER_STATE1_800000) #define EPONA_FIX_ACTIVE (no_bow_epona_fix && ON_EPONA) +#define AT_H_AND_D (play->sceneId == SCENE_BOWLING) +#define H_AND_D_FIX_ACTIVE (h_and_d_no_sword_fix && AT_H_AND_D) + // @recomp Patched to update status of extra buttons via set_extra_item_slot_status. RECOMP_PATCH void Interface_UpdateButtonsPart1(PlayState* play) { InterfaceContext* interfaceCtx = &play->interfaceCtx; @@ -689,6 +699,9 @@ RECOMP_PATCH void Interface_UpdateButtonsPart1(PlayState* play) { } else { BUTTON_ITEM_EQUIP(CUR_FORM, EQUIP_SLOT_B) = ITEM_BOW; } + if (h_and_d_no_sword_fix) { + BUTTON_STATUS(EQUIP_SLOT_B) = BTN_ENABLED; + } BUTTON_STATUS(EQUIP_SLOT_C_LEFT) = BTN_DISABLED; BUTTON_STATUS(EQUIP_SLOT_C_DOWN) = BTN_DISABLED; BUTTON_STATUS(EQUIP_SLOT_C_RIGHT) = BTN_DISABLED; @@ -707,7 +720,7 @@ RECOMP_PATCH void Interface_UpdateButtonsPart1(PlayState* play) { if (play->unk_1887C >= 2) { Interface_LoadItemIconImpl(play, EQUIP_SLOT_B); - } else if (gSaveContext.save.saveInfo.inventory.items[SLOT_BOW] == ITEM_NONE) { + } else if (gSaveContext.save.saveInfo.inventory.items[SLOT_BOW] == ITEM_NONE && !H_AND_D_FIX_ACTIVE) { // @recomp_use_export_var no_bow_epona_fix: Part of the no bow Epona fix. if (EPONA_FIX_ACTIVE) { gSaveContext.buttonStatus[EQUIP_SLOT_B] = BUTTON_ITEM_EQUIP(CUR_FORM, EQUIP_SLOT_B); @@ -732,7 +745,7 @@ RECOMP_PATCH void Interface_UpdateButtonsPart1(PlayState* play) { } // @recomp_use_export_var no_bow_epona_fix: If the B button does not contain the bow, don't disable the UI. - if (!no_bow_epona_fix || BUTTON_ITEM_EQUIP(CUR_FORM, EQUIP_SLOT_B) == ITEM_BOW) { + if ((!no_bow_epona_fix || BUTTON_ITEM_EQUIP(CUR_FORM, EQUIP_SLOT_B) == ITEM_BOW) && !H_AND_D_FIX_ACTIVE) { BUTTON_STATUS(EQUIP_SLOT_C_LEFT) = BTN_DISABLED; BUTTON_STATUS(EQUIP_SLOT_C_DOWN) = BTN_DISABLED; BUTTON_STATUS(EQUIP_SLOT_C_RIGHT) = BTN_DISABLED; @@ -758,6 +771,9 @@ RECOMP_PATCH void Interface_UpdateButtonsPart1(PlayState* play) { Interface_SetHudVisibility(HUD_VISIBILITY_A_B_MINIMAP); } else if (ON_EPONA) { Interface_SetHudVisibility(HUD_VISIBILITY_A_B_MINIMAP); + } else if (H_AND_D_FIX_ACTIVE) { + Interface_LoadItemIconImpl(play, EQUIP_SLOT_B); + Interface_SetHudVisibility(HUD_VISIBILITY_B); } } } else if (sPictoState != PICTO_BOX_STATE_OFF) {