From 275dba3b673ac1c0c3acbd0a8f17516aa131e72f Mon Sep 17 00:00:00 2001 From: engineer124 Date: Thu, 23 Dec 2021 04:11:32 +1100 Subject: [PATCH] More progress and docs --- include/functions.h | 14 +- include/variables.h | 2 +- include/z64.h | 46 ++++ src/code/z_parameter.c | 252 +++++++++++++++++- src/overlays/actors/ovl_En_Fsn/z_en_fsn.c | 14 +- src/overlays/actors/ovl_En_Fu/z_en_fu.c | 2 +- src/overlays/actors/ovl_En_Ossan/z_en_ossan.c | 20 +- src/overlays/actors/ovl_En_Sob1/z_en_sob1.c | 14 +- src/overlays/actors/ovl_En_Trt/z_en_trt.c | 20 +- tools/disasm/functions.txt | 6 +- tools/disasm/variables.txt | 2 +- tools/sizes/code_functions.csv | 6 +- 12 files changed, 334 insertions(+), 64 deletions(-) diff --git a/include/functions.h b/include/functions.h index 7f4312921..bc87eb42e 100644 --- a/include/functions.h +++ b/include/functions.h @@ -2073,19 +2073,19 @@ void Interface_LoadItemIcon(GlobalContext* globalCtx, u8 arg1); // void func_80112C0C(void); u32 Item_Give(GlobalContext* globalCtx, u8 param_2); // void func_801143CC(void); -UNK_TYPE func_80114978(UNK_TYPE arg0); -void func_801149A0(s32 arg0, s16 arg1); +s32 func_80114978(u8 arg0); +void func_801149A0(s16 arg0, s16 arg1); // void func_80114A9C(void); // void func_80114B84(void); // void func_80114CA0(void); -UNK_TYPE func_80114E90(void); -UNK_TYPE func_80114F2C(UNK_TYPE arg0); +s32 func_80114E90(void); +s32 func_80114F2C(u8 arg0); // void func_80114FD0(void); // void func_80115130(void); // void func_801152B8(void); // void func_801153C8(void); -// void func_80115428(void); -void func_8011552C(GlobalContext* globalCtx, s16 arg1); +// void Interface_LoadActionLabel(void); +void Interface_SetDoAction(GlobalContext* globalCtx, u16 arg1); // void func_801155B4(void); // void func_80115764(void); void func_80115844(GlobalContext* globalCtx, s16 param_2); @@ -2093,7 +2093,7 @@ s32 func_80115908(GlobalContext* globalCtx, u8 param_2); void func_801159c0(s16 param_1); void func_801159EC(s16 arg0); void func_80115A14(s32 arg0, s16 arg1); -void Parameter_AddMagic(GlobalContext* globalCtx, s16 arg1); +void Interface_AddMagic(GlobalContext* globalCtx, s16 arg1); void func_80115D5C(GameState* gamestate); // void func_80115DB4(void); // void func_80116088(void); diff --git a/include/variables.h b/include/variables.h index 35277bb80..d6754856f 100644 --- a/include/variables.h +++ b/include/variables.h @@ -1107,7 +1107,7 @@ extern UNK_PTR D_801BF5C0; // extern UNK_TYPE2 D_801BFA64; // extern UNK_TYPE2 D_801BFA74; // extern UNK_TYPE4 D_801BFA84; -// extern UNK_TYPE1 D_801BFAB0; +// extern UNK_TYPE1 sDoActionTextures; // extern UNK_TYPE1 D_801BFAB8; // extern UNK_TYPE1 D_801BFAC4; // extern UNK_TYPE1 D_801BFACC; diff --git a/include/z64.h b/include/z64.h index ff023590e..4adbf8733 100644 --- a/include/z64.h +++ b/include/z64.h @@ -602,6 +602,52 @@ typedef struct { /* 0x2CA */ s16 unk_2CA; } PauseContext; // size = 0x2D0 +typedef enum { + /* 0x00 */ DO_ACTION_UNK00, + /* 0x01 */ DO_ACTION_UNK01, + /* 0x02 */ DO_ACTION_UNK02, + /* 0x03 */ DO_ACTION_UNK03, + /* 0x04 */ DO_ACTION_UNK04, + /* 0x05 */ DO_ACTION_UNK05, + /* 0x06 */ DO_ACTION_DECIDE, + /* 0x07 */ DO_ACTION_UNK07, + /* 0x08 */ DO_ACTION_UNK08, + /* 0x09 */ DO_ACTION_UNK09, + /* 0x0A */ DO_ACTION_NONE, // in do_action_static, the texture at this position is NAVI, however this value is in practice the "No Action" value + /* 0x0B */ DO_ACTION_UNK0B, + /* 0x0C */ DO_ACTION_UNK0C, + /* 0x0D */ DO_ACTION_UNK0D, + /* 0x0E */ DO_ACTION_UNK0E, + /* 0x0F */ DO_ACTION_UNK0F, + /* 0x10 */ DO_ACTION_NEXT, + /* 0x11 */ DO_ACTION_UNK11, + /* 0x12 */ DO_ACTION_UNK12, + /* 0x13 */ DO_ACTION_UNK13, + /* 0x14 */ DO_ACTION_UNK14, + /* 0x15 */ DO_ACTION_UNK15, + /* 0x16 */ DO_ACTION_UNK16, + /* 0x17 */ DO_ACTION_UNK17, + /* 0x18 */ DO_ACTION_UNK18, + /* 0x19 */ DO_ACTION_UNK19, + /* 0x1A */ DO_ACTION_UNK1A, + /* 0x1B */ DO_ACTION_UNK1B, + /* 0x1C */ DO_ACTION_UNK1C, + /* 0x1D */ DO_ACTION_UNK1D, + /* 0x1E */ DO_ACTION_UNK1E, + /* 0x1F */ DO_ACTION_UNK1F, + /* 0x20 */ DO_ACTION_UNK20, + /* 0x21 */ DO_ACTION_UNK21, + /* 0x22 */ DO_ACTION_UNK22, + /* 0x23 */ DO_ACTION_UNK23, + /* 0x24 */ DO_ACTION_UNK24, + /* 0x25 */ DO_ACTION_UNK25, + /* 0x26 */ DO_ACTION_UNK26, + /* 0x27 */ DO_ACTION_UNK27, + /* 0x28 */ DO_ACTION_UNK28, + /* 0x29 */ DO_ACTION_UNK29, + /* 0x2A */ DO_ACTION_MAX +} DoAction; + typedef struct { /* 0x000 */ View view; /* 0x168 */ Vtx* actionVtx; diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index db40a9a4b..2c6a9175a 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -357,9 +357,9 @@ s32 D_801BFA84[] = { 0x00010005, 0x00010005, 0x000A0014, 0x00320064, 0x00C80000, }; -s32 D_801BFAB0[] = { - 0x09000000, - 0x09000180, +s32 sDoActionTextures[] = { + 0x09000000, // gAttackDoActionENGTex + 0x09000180, // gCheckDoActionENGTex }; s32 D_801BFAB8[] = { @@ -1737,33 +1737,218 @@ void func_80112BE4(GlobalContext* globalCtx, u8 arg1) { #pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/Item_Give.s") +s32 func_801143CC(u8); #pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_801143CC.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_80114978.s") +s32 func_80114978(u8 arg0) { + return func_801143CC(arg0); +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_801149A0.s") +void func_801149A0(s16 arg0, s16 arg1) { + s16 phi_v0; + s32 phi_a1; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_80114A9C.s") + gSaveContext.save.inventory.items[arg1] = 0xFF; + + for (phi_v0 = 1; phi_v0 < 4; phi_v0++) { + if (phi_v0 == 0) { + phi_a1 = gSaveContext.save.equips.buttonItems[CUR_FORM][phi_v0]; + } else { + phi_a1 = gSaveContext.save.equips.buttonItems[0][phi_v0]; + } + if (arg0 == (phi_a1 & 0xFF)) { + if (phi_v0 == 0) { + phi_a1 = CUR_FORM; + gSaveContext.save.equips.buttonItems[phi_a1][phi_v0] = 0xFF; + } else { + gSaveContext.save.equips.buttonItems[0][phi_v0] = 0xFF; + } + if (phi_v0 == 0) { + phi_a1 = CUR_FORM; + gSaveContext.save.equips.cButtonSlots[phi_a1][phi_v0] = 0xFF; + } else { + gSaveContext.save.equips.cButtonSlots[0][phi_v0] = 0xFF; + } + } + } +} + +void func_80114A9C(s16 arg0) { + s16 phi_v0; + s32 phi_a1; + + for (phi_v0 = 1; phi_v0 < 4; phi_v0++) { + if (phi_v0 == 0) { + phi_a1 = gSaveContext.save.equips.buttonItems[CUR_FORM][phi_v0]; + } else { + phi_a1 = gSaveContext.save.equips.buttonItems[0][phi_v0]; + } + if (arg0 == (phi_a1 & 0xFF)) { + if (phi_v0 == 0) { + phi_a1 = CUR_FORM; + gSaveContext.save.equips.buttonItems[phi_a1][phi_v0] = 0xFF; + } else { + gSaveContext.save.equips.buttonItems[0][phi_v0] = 0xFF; + } + if (phi_v0 == 0) { + phi_a1 = CUR_FORM; + gSaveContext.save.equips.cButtonSlots[phi_a1][phi_v0] = 0xFF; + } else { + gSaveContext.save.equips.cButtonSlots[0][phi_v0] = 0xFF; + } + } + } +} #pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_80114B84.s") +/* s32 func_80114B84(s32 arg0, u8 arg1, u8 arg2) { + u8 phi_a3; + s32 phi_a0; + u8 phi_a3_2; + for (phi_a3 = 0; phi_a3 < 24; phi_a3++) { + if (gSaveContext.save.inventory.items[phi_a3] == arg1) { + gSaveContext.save.inventory.items[phi_a3] = arg2; + for (phi_a3_2 = 1; phi_a3_2 < 4; phi_a3_2++) { + if (phi_a3_2 == 0) { + phi_a0 = gSaveContext.save.equips.buttonItems[CUR_FORM][phi_a3_2]; + } else { + phi_a0 = gSaveContext.save.equips.buttonItems[0][phi_a3_2]; + } + if (arg1 == (phi_a0 & 0xFF)) { + if (phi_a3_2 == 0) { + phi_a0 = CUR_FORM; + gSaveContext.save.equips.buttonItems[phi_a0][phi_a3_2] = arg2; + } else { + gSaveContext.save.equips.buttonItems[0][phi_a3_2] = arg2; + } + Interface_LoadItemIcon(arg0, phi_a3_2 & 0xFF); + return 1; + } + } + return 1; + } + } + return 0; +} */ #pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_80114CA0.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_80114E90.s") +s32 func_80114E90(void) { + s32 i; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_80114F2C.s") + for (i = 18; i < 24; i++) { + if (gSaveContext.save.inventory.items[i] == ITEM_BOTTLE) { + return true; + } + } + return false; +} + +s32 func_80114F2C(u8 arg0) { + s32 i; + + for (i = 18; i < 24; i++) { + if (gSaveContext.save.inventory.items[i] == arg0) { + return true; + } + } + return false; +} #pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_80114FD0.s") +/* void func_80114FD0(GlobalContext* globalCtx, u8 arg1, u8 arg2) { + u8 phi_v1; + s32 phi_a0; + if (arg2 == 0) { + phi_v1 = gSaveContext.save.equips.cButtonSlots[CUR_FORM][arg2]; + } else { + phi_v1 = gSaveContext.save.equips.cButtonSlots[0][arg2]; + } + gSaveContext.save.inventory.items[phi_v1] = arg1; + if (arg2 == 0) { + phi_a0 = CUR_FORM; + gSaveContext.save.equips.buttonItems[phi_a0][arg2] = arg1; + } else { + gSaveContext.save.equips.buttonItems[0][arg2] = arg1; + } + Interface_LoadItemIcon(globalCtx, arg2); + globalCtx->pauseCtx.cursorItem[0] = arg1; + gSaveContext.buttonStatus[arg2] = 0; + if (arg1 == 0x20) { + if (arg2 == 0) { + phi_a0 = CUR_FORM; + phi_v1 = gSaveContext.save.equips.cButtonSlots[phi_a0][arg2]; + } else { + phi_v1 = gSaveContext.save.equips.cButtonSlots[0][arg2]; + } + func_8012FB84(0x3C, phi_v1 - 0x12); + } +} */ #pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_80115130.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_801152B8.s") +/* void func_801152B8(GlobalContext* globalCtx, s16 arg1, s16 arg2) { + s16 phi_s0; + u8 phi_v1; + gSaveContext.save.inventory.items[arg1] = arg2; + for (phi_s0 = 1; phi_s0 < 4; phi_s0++) { + if (phi_s0 == 0) { + phi_v1 = gSaveContext.save.equips.cButtonSlots[CUR_FORM][phi_s0]; + } else { + phi_v1 = gSaveContext.save.equips.cButtonSlots[0][phi_s0]; + } + if (arg1 == (phi_v1 & 0xFF)) { + if (phi_s0 == 0) { + gSaveContext.save.equips.buttonItems[CUR_FORM][phi_s0] = arg2; + } else { + gSaveContext.save.equips.buttonItems[0][phi_s0] = arg2; + } + Interface_LoadItemIcon(globalCtx, phi_s0); + } + } +} */ -#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_801153C8.s") +void func_801153C8(s32* buf, s32 size) { + s32 i; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_80115428.s") + for (i = 0; i != size; i++) { + buf[i] = 0; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_8011552C.s") +void Interface_LoadActionLabel(InterfaceContext* interfaceCtx, u16 action, s16 loadOffset) { + if (action >= DO_ACTION_MAX) { + action = DO_ACTION_NONE; + } + + if (action != DO_ACTION_NONE) { + osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, 1); + DmaMgr_SendRequestImpl(&interfaceCtx->dmaRequest_184, (u32)interfaceCtx->doActionSegment + (loadOffset * 0x180), + (u32)_do_action_staticSegmentRomStart + (action * 0x180), 0x180, 0, + &interfaceCtx->loadQueue, 0); + osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK); + return; + } + + gSegments[0x09] = PHYSICAL_TO_VIRTUAL(interfaceCtx->doActionSegment); + func_801153C8(Lib_SegmentedToVirtual(sDoActionTextures[loadOffset]), 0x60); +} + +void Interface_SetDoAction(GlobalContext* globalCtx, u16 action) { + InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx; + PauseContext* pauseCtx = &globalCtx->pauseCtx; + + if (interfaceCtx->unk_214 != action) { + interfaceCtx->unk_214 = action; + interfaceCtx->unk_210 = 1; + interfaceCtx->unk_218 = 0.0f; + Interface_LoadActionLabel(interfaceCtx, action, 1); + if (pauseCtx->state != 0) { + interfaceCtx->unk_210 = 3; + } + } +} #pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_801155B4.s") @@ -1779,7 +1964,14 @@ void func_80112BE4(GlobalContext* globalCtx, u8 arg1) { #pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_80115A14.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/Parameter_AddMagic.s") +void Interface_AddMagic(GlobalContext* globalCtx, s16 arg1) { + if (gSaveContext.save.playerData.magic) {} + + if (gSaveContext.save.playerData.magic < gSaveContext.unk_3F2E) { + gSaveContext.unk_3F34 += arg1; + gSaveContext.unk_3F2A = 1; + } +} #pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_80115D5C.s") @@ -1835,9 +2027,41 @@ void func_80112BE4(GlobalContext* globalCtx, u8 arg1) { #pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/Interface_Draw.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_80120F90.s") +#ifdef NON_MATCHING +void func_80120F90(GlobalContext* globalCtx, s32 block) { + InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_80121064.s") + switch (interfaceCtx->unk_31C) { + case 0: + if (interfaceCtx->unk_33C == NULL) { + break; + } + osCreateMesgQueue(&interfaceCtx->unk_320, interfaceCtx->unk_338, 1); + DmaMgr_SendRequestImpl(&interfaceCtx->dmaRequest_184, interfaceCtx->unk_33C, interfaceCtx->unk_340, + interfaceCtx->unk_344, 0, &interfaceCtx->unk_320, NULL); + interfaceCtx->unk_31C = 1; + case 1: + if (osRecvMesg(&interfaceCtx->unk_320, NULL, block) == 0) { + interfaceCtx->unk_31C = 2; + } + break; + } +} +#else +#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_80120F90.s") +#endif + +void func_80121064(GlobalContext* globalCtx) { + InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx; + + interfaceCtx->unk_340 = (u32)_story_staticSegmentRomStart; + interfaceCtx->unk_344 = (u32)_story_staticSegmentRomEnd - (u32)_story_staticSegmentRomStart; + + if (interfaceCtx->unk_33C == NULL) { + interfaceCtx->unk_33C = ZeldaArena_Malloc(interfaceCtx->unk_344); + } + func_80120F90(globalCtx, 0); +} #pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/Interface_Update.s") diff --git a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c index 533f88d6c..22cca3e09 100644 --- a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c +++ b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c @@ -789,7 +789,7 @@ void EnFsn_BeginInteraction(EnFsn* this, GlobalContext* globalCtx) { ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); this->cutsceneState = 2; if (Player_GetMask(globalCtx) == PLAYER_MASK_NONE) { - func_8011552C(globalCtx, 16); + Interface_SetDoAction(globalCtx, DO_ACTION_NEXT); if (EnFsn_HasItemsToSell()) { this->actionFunc = EnFsn_AskBuyOrSell; } else { @@ -868,7 +868,7 @@ void EnFsn_AskBuyOrSell(EnFsn* this, GlobalContext* globalCtx) { } } } else if (talkState == 4) { - func_8011552C(globalCtx, 6); + Interface_SetDoAction(globalCtx, DO_ACTION_DECIDE); if (!EnFsn_TestEndInteraction(this, globalCtx, CONTROLLER1(globalCtx)) && func_80147624(globalCtx)) { u32 trueTmp = true; switch (globalCtx->msgCtx.choiceIndex) { @@ -1045,7 +1045,7 @@ void EnFsn_ResumeShoppingInteraction(EnFsn* this, GlobalContext* globalCtx) { } else if (this->actor.textId != 0x29D6) { this->actionFunc = EnFsn_AskCanBuyAterRunningOutOfItems; } else { - func_8011552C(globalCtx, 6); + Interface_SetDoAction(globalCtx, DO_ACTION_DECIDE); this->stickLeftPrompt.isEnabled = false; this->stickRightPrompt.isEnabled = true; this->actionFunc = EnFsn_FaceShopkeeperSelling; @@ -1096,7 +1096,7 @@ void EnFsn_BrowseShelf(EnFsn* this, GlobalContext* globalCtx) { this->stickLeftPrompt.isEnabled = true; EnFsn_UpdateCursorPos(this, globalCtx); if (talkstate == 5) { - func_8011552C(globalCtx, 6); + Interface_SetDoAction(globalCtx, DO_ACTION_DECIDE); if (!EnFsn_HasPlayerSelectedItem(this, globalCtx, CONTROLLER1(globalCtx))) { EnFsn_CursorLeftRight(this); if (this->cursorIdx != prevCursorIdx) { @@ -1198,7 +1198,7 @@ void EnFsn_SelectItem(EnFsn* this, GlobalContext* globalCtx) { u8 talkState = func_80152498(&globalCtx->msgCtx); if (EnFsn_TakeItemOffShelf(this) && talkState == 4) { - func_8011552C(globalCtx, 6); + Interface_SetDoAction(globalCtx, DO_ACTION_DECIDE); if (!EnFsn_TestCancelOption(this, globalCtx, CONTROLLER1(globalCtx)) && func_80147624(globalCtx)) { switch (globalCtx->msgCtx.choiceIndex) { case 0: @@ -1318,7 +1318,7 @@ void EnFsn_FaceShopkeeperSelling(EnFsn* this, GlobalContext* globalCtx) { u8 cursorIdx; if (talkState == 4) { - func_8011552C(globalCtx, 6); + Interface_SetDoAction(globalCtx, DO_ACTION_DECIDE); if (!EnFsn_TestEndInteraction(this, globalCtx, CONTROLLER1(globalCtx)) && (!func_80147624(globalCtx) || !EnFsn_FacingShopkeeperDialogResult(this, globalCtx)) && this->stickAccumX > 0) { @@ -1326,7 +1326,7 @@ void EnFsn_FaceShopkeeperSelling(EnFsn* this, GlobalContext* globalCtx) { if (cursorIdx != CURSOR_INVALID) { this->cursorIdx = cursorIdx; this->actionFunc = EnFsn_LookToShelf; - func_8011552C(globalCtx, 6); + Interface_SetDoAction(globalCtx, DO_ACTION_DECIDE); this->stickRightPrompt.isEnabled = false; play_sound(NA_SE_SY_CURSOR); } diff --git a/src/overlays/actors/ovl_En_Fu/z_en_fu.c b/src/overlays/actors/ovl_En_Fu/z_en_fu.c index 88ffa7f6c..130fce3dd 100644 --- a/src/overlays/actors/ovl_En_Fu/z_en_fu.c +++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.c @@ -660,7 +660,7 @@ void func_80962A10(EnFu* this, GlobalContext* globalCtx) { if ((gSaveContext.save.playerForm == PLAYER_FORM_DEKU) && gSaveContext.save.playerData.magicAcquired) { s16 temp = gSaveContext.unk_3F30; - Parameter_AddMagic(globalCtx, temp + (gSaveContext.save.playerData.doubleMagic * 48) + 48); + Interface_AddMagic(globalCtx, temp + (gSaveContext.save.playerData.doubleMagic * 48) + 48); } func_80962F10(this); diff --git a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c index a5244fc9a..26d431997 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -304,7 +304,7 @@ s32 EnOssan_TestCancelOption(EnOssan* this, GlobalContext* globalCtx, Input* inp } void EnOssan_SetupStartShopping(GlobalContext* globalCtx, EnOssan* this, u8 skipHello) { - func_8011552C(globalCtx, 0x10); + Interface_SetDoAction(globalCtx, DO_ACTION_NEXT); if (!skipHello) { EnOssan_SetupAction(this, EnOssan_Hello); } else { @@ -315,7 +315,7 @@ void EnOssan_SetupStartShopping(GlobalContext* globalCtx, EnOssan* this, u8 skip void EnOssan_StartShopping(GlobalContext* globalCtx, EnOssan* this) { EnOssan_SetupAction(this, EnOssan_FaceShopkeeper); func_80151938(globalCtx, 0x640); - func_8011552C(globalCtx, 6); + Interface_SetDoAction(globalCtx, DO_ACTION_DECIDE); this->stickRightPrompt.isEnabled = true; this->stickLeftPrompt.isEnabled = true; } @@ -568,7 +568,7 @@ s32 EnOssan_FacingShopkeeperDialogResult(EnOssan* this, GlobalContext* globalCtx } EnOssan_SetupAction(this, EnOssan_TalkToShopkeeper); func_80151938(globalCtx, sTalkOptionTextIds[this->actor.params]); - func_8011552C(globalCtx, 6); + Interface_SetDoAction(globalCtx, DO_ACTION_DECIDE); this->stickLeftPrompt.isEnabled = false; this->stickRightPrompt.isEnabled = false; return true; @@ -595,7 +595,7 @@ void EnOssan_FaceShopkeeper(EnOssan* this, GlobalContext* globalCtx) { this->cutsceneState = ENOSSAN_CUTSCENESTATE_WAITING; } else { if (talkState == 4) { - func_8011552C(globalCtx, 6); + Interface_SetDoAction(globalCtx, DO_ACTION_DECIDE); if (!EnOssan_TestEndInteraction(this, globalCtx, CONTROLLER1(globalCtx)) && (!func_80147624(globalCtx) || !EnOssan_FacingShopkeeperDialogResult(this, globalCtx))) { if (this->stickAccumX < 0) { @@ -603,7 +603,7 @@ void EnOssan_FaceShopkeeper(EnOssan* this, GlobalContext* globalCtx) { if (cursorIdx != CURSOR_INVALID) { this->cursorIdx = cursorIdx; EnOssan_SetupAction(this, EnOssan_LookToLeftShelf); - func_8011552C(globalCtx, 6); + Interface_SetDoAction(globalCtx, DO_ACTION_DECIDE); this->stickLeftPrompt.isEnabled = false; play_sound(NA_SE_SY_CURSOR); } @@ -612,7 +612,7 @@ void EnOssan_FaceShopkeeper(EnOssan* this, GlobalContext* globalCtx) { if (cursorIdx != CURSOR_INVALID) { this->cursorIdx = cursorIdx; EnOssan_SetupAction(this, EnOssan_LookToRightShelf); - func_8011552C(globalCtx, 6); + Interface_SetDoAction(globalCtx, DO_ACTION_DECIDE); this->stickRightPrompt.isEnabled = false; play_sound(NA_SE_SY_CURSOR); } @@ -818,7 +818,7 @@ void EnOssan_BrowseLeftShelf(EnOssan* this, GlobalContext* globalCtx) { this->stickRightPrompt.isEnabled = true; EnOssan_UpdateCursorPos(globalCtx, this); if (talkState == 5) { - func_8011552C(globalCtx, 6); + Interface_SetDoAction(globalCtx, DO_ACTION_DECIDE); if (!EnOssan_HasPlayerSelectedItem(globalCtx, this, CONTROLLER1(globalCtx))) { if (this->moveHorizontal) { if (this->stickAccumX > 0) { @@ -876,7 +876,7 @@ void EnOssan_BrowseRightShelf(EnOssan* this, GlobalContext* globalCtx) { this->stickLeftPrompt.isEnabled = true; EnOssan_UpdateCursorPos(globalCtx, this); if (talkState == 5) { - func_8011552C(globalCtx, 6); + Interface_SetDoAction(globalCtx, DO_ACTION_DECIDE); if (!EnOssan_HasPlayerSelectedItem(globalCtx, this, CONTROLLER1(globalCtx))) { if (this->moveHorizontal != 0) { if (this->stickAccumX < 0) { @@ -1017,7 +1017,7 @@ void EnOssan_SelectItem(EnOssan* this, GlobalContext* globalCtx) { u8 talkState = func_80152498(&globalCtx->msgCtx); if (EnOssan_TakeItemOffShelf(this) && talkState == 4) { - func_8011552C(globalCtx, 6); + Interface_SetDoAction(globalCtx, DO_ACTION_DECIDE); if (!EnOssan_TestCancelOption(this, globalCtx, CONTROLLER1(globalCtx)) && func_80147624(globalCtx)) { switch (globalCtx->msgCtx.choiceIndex) { case 0: @@ -1084,7 +1084,7 @@ void EnOssan_ContinueShopping(EnOssan* this, GlobalContext* globalCtx) { EnGirlA* item; if (talkState == 4) { - func_8011552C(globalCtx, 6); + Interface_SetDoAction(globalCtx, DO_ACTION_DECIDE); if (func_80147624(globalCtx)) { EnOssan_ResetItemPosition(this); item = this->items[this->cursorIdx]; diff --git a/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c b/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c index c16cae9d4..86efb6ab1 100644 --- a/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c +++ b/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c @@ -484,7 +484,7 @@ s32 EnSob1_TestCancelOption(EnSob1* this, GlobalContext* globalCtx, Input* input } void EnSob1_SetupStartShopping(GlobalContext* globalCtx, EnSob1* this, u8 skipHello) { - func_8011552C(globalCtx, 16); + Interface_SetDoAction(globalCtx, DO_ACTION_NEXT); if (!skipHello) { EnSob1_SetupAction(this, EnSob1_Hello); } else { @@ -495,7 +495,7 @@ void EnSob1_SetupStartShopping(GlobalContext* globalCtx, EnSob1* this, u8 skipHe void EnSob1_StartShopping(GlobalContext* globalCtx, EnSob1* this) { EnSob1_SetupAction(this, EnSob1_FaceShopkeeper); func_80151938(globalCtx, sFacingShopkeeperTextIds[this->shopType]); - func_8011552C(globalCtx, 6); + Interface_SetDoAction(globalCtx, DO_ACTION_DECIDE); this->stickLeftPrompt.isEnabled = false; this->stickRightPrompt.isEnabled = true; } @@ -504,7 +504,7 @@ void EnSob1_TalkToShopkeeper(GlobalContext* globalCtx, EnSob1* this) { EnSob1_SetupAction(this, EnSob1_TalkingToShopkeeper); this->talkOptionTextId = EnSob1_GetTalkOption(this, globalCtx); func_80151938(globalCtx, this->talkOptionTextId); - func_8011552C(globalCtx, 6); + Interface_SetDoAction(globalCtx, DO_ACTION_DECIDE); this->stickLeftPrompt.isEnabled = false; this->stickRightPrompt.isEnabled = false; } @@ -670,7 +670,7 @@ void EnSob1_FaceShopkeeper(EnSob1* this, GlobalContext* globalCtx) { this->cutsceneState = ENSOB1_CUTSCENESTATE_WAITING; } else { if (talkState == 4) { - func_8011552C(globalCtx, 6); + Interface_SetDoAction(globalCtx, DO_ACTION_DECIDE); if (!EnSob1_TestEndInteraction(this, globalCtx, CONTROLLER1(globalCtx))) { if (!func_80147624(globalCtx) || !EnSob1_FacingShopkeeperDialogResult(this, globalCtx)) { if (this->stickAccumX > 0) { @@ -678,7 +678,7 @@ void EnSob1_FaceShopkeeper(EnSob1* this, GlobalContext* globalCtx) { if (cursorIdx != CURSOR_INVALID) { this->cursorIdx = cursorIdx; EnSob1_SetupAction(this, EnSob1_LookToShelf); - func_8011552C(globalCtx, 6); + Interface_SetDoAction(globalCtx, DO_ACTION_DECIDE); this->stickRightPrompt.isEnabled = false; play_sound(NA_SE_SY_CURSOR); } @@ -924,7 +924,7 @@ void EnSob1_BrowseShelf(EnSob1* this, GlobalContext* globalCtx) { this->stickLeftPrompt.isEnabled = true; EnSob1_UpdateCursorPos(globalCtx, this); if (talkState == 5) { - func_8011552C(globalCtx, 6); + Interface_SetDoAction(globalCtx, DO_ACTION_DECIDE); if (!EnSob1_HasPlayerSelectedItem(globalCtx, this, CONTROLLER1(globalCtx))) { EnSob1_CursorLeftRight(globalCtx, this); cursorIdx = this->cursorIdx; @@ -1032,7 +1032,7 @@ void EnSob1_SelectItem(EnSob1* this, GlobalContext* globalCtx) { u8 talkState = func_80152498(&globalCtx->msgCtx); if (EnSob1_TakeItemOffShelf(this) && talkState == 4) { - func_8011552C(globalCtx, 6); + Interface_SetDoAction(globalCtx, DO_ACTION_DECIDE); if (!EnSob1_TestCancelOption(this, globalCtx, CONTROLLER1(globalCtx)) && func_80147624(globalCtx)) { switch (globalCtx->msgCtx.choiceIndex) { case 0: diff --git a/src/overlays/actors/ovl_En_Trt/z_en_trt.c b/src/overlays/actors/ovl_En_Trt/z_en_trt.c index e922e3a0e..ac49b3eda 100644 --- a/src/overlays/actors/ovl_En_Trt/z_en_trt.c +++ b/src/overlays/actors/ovl_En_Trt/z_en_trt.c @@ -250,7 +250,7 @@ s32 EnTrt_TestCancelOption(EnTrt* this, GlobalContext* globalCtx, Input* input) } void EnTrt_SetupStartShopping(GlobalContext* globalCtx, EnTrt* this, u8 skipHello) { - func_8011552C(globalCtx, 0x10); + Interface_SetDoAction(globalCtx, DO_ACTION_NEXT); if (!skipHello) { this->actionFunc = EnTrt_Hello; } else { @@ -260,7 +260,7 @@ void EnTrt_SetupStartShopping(GlobalContext* globalCtx, EnTrt* this, u8 skipHell void EnTrt_StartShopping(GlobalContext* globalCtx, EnTrt* this) { func_80151938(globalCtx, 0x83E); - func_8011552C(globalCtx, 6); + Interface_SetDoAction(globalCtx, DO_ACTION_DECIDE); this->stickLeftPrompt.isEnabled = false; this->stickRightPrompt.isEnabled = true; this->actionFunc = EnTrt_FaceShopkeeper; @@ -529,7 +529,7 @@ void EnTrt_FaceShopkeeper(EnTrt* this, GlobalContext* globalCtx) { ActorCutscene_SetIntentToPlay(this->cutscene); this->cutsceneState = ENTRT_CUTSCENESTATE_WAITING; } else if (talkState == 4) { - func_8011552C(globalCtx, 6); + Interface_SetDoAction(globalCtx, DO_ACTION_DECIDE); if (!EnTrt_TestEndInteraction(this, globalCtx, CONTROLLER1(globalCtx))) { if ((!func_80147624(globalCtx) || !EnTrt_FacingShopkeeperDialogResult(this, globalCtx)) && (this->stickAccumX > 0)) { @@ -537,7 +537,7 @@ void EnTrt_FaceShopkeeper(EnTrt* this, GlobalContext* globalCtx) { if (cursorIdx != CURSOR_INVALID) { this->cursorIdx = cursorIdx; this->actionFunc = EnTrt_LookToShelf; - func_8011552C(globalCtx, 6); + Interface_SetDoAction(globalCtx, DO_ACTION_DECIDE); this->stickRightPrompt.isEnabled = false; play_sound(NA_SE_SY_CURSOR); } @@ -631,7 +631,7 @@ void EnTrt_BrowseShelf(EnTrt* this, GlobalContext* globalCtx) { this->stickLeftPrompt.isEnabled = true; EnTrt_UpdateCursorPos(globalCtx, this); if (talkState == 5) { - func_8011552C(globalCtx, 6); + Interface_SetDoAction(globalCtx, DO_ACTION_DECIDE); if (!EnTrt_HasPlayerSelectedItem(globalCtx, this, CONTROLLER1(globalCtx))) { EnTrt_CursorLeftRight(globalCtx, this); if (this->cursorIdx != prevCursorIdx) { @@ -716,7 +716,7 @@ void EnTrt_SelectItem(EnTrt* this, GlobalContext* globalCtx) { if (EnTrt_TakeItemOffShelf(this)) { if (talkState == 4) { - func_8011552C(globalCtx, 6); + Interface_SetDoAction(globalCtx, DO_ACTION_DECIDE); if (!EnTrt_TestCancelOption(this, globalCtx, CONTROLLER1(globalCtx)) && func_80147624(globalCtx)) { switch (globalCtx->msgCtx.choiceIndex) { case 0: @@ -885,7 +885,7 @@ void EnTrt_BeginInteraction(EnTrt* this, GlobalContext* globalCtx) { case 0x834: if (!(gSaveContext.save.weekEventReg[0xC] & 8) && !(gSaveContext.save.weekEventReg[0x54] & 0x40) && !(gSaveContext.save.weekEventReg[0x10] & 0x10) && !(gSaveContext.save.weekEventReg[0x11] & 1)) { - func_8011552C(globalCtx, 6); + Interface_SetDoAction(globalCtx, DO_ACTION_DECIDE); this->stickLeftPrompt.isEnabled = false; this->stickRightPrompt.isEnabled = true; this->actionFunc = EnTrt_Hello; @@ -894,7 +894,7 @@ void EnTrt_BeginInteraction(EnTrt* this, GlobalContext* globalCtx) { } break; case 0x83E: - func_8011552C(globalCtx, 6); + Interface_SetDoAction(globalCtx, DO_ACTION_DECIDE); this->stickLeftPrompt.isEnabled = false; this->stickRightPrompt.isEnabled = true; this->actionFunc = EnTrt_FaceShopkeeper; @@ -1103,7 +1103,7 @@ void EnTrt_ContinueShopping(EnTrt* this, GlobalContext* globalCtx) { EnGirlA* item; if (talkState == 4) { - func_8011552C(globalCtx, 6); + Interface_SetDoAction(globalCtx, DO_ACTION_DECIDE); if (func_80147624(globalCtx)) { EnTrt_ResetItemPosition(this); item = this->items[this->cursorIdx]; @@ -1417,7 +1417,7 @@ void EnTrt_TalkToShopkeeper(EnTrt* this, GlobalContext* globalCtx) { void EnTrt_SetupTalkToShopkeeper(GlobalContext* globalCtx, EnTrt* this) { this->actionFunc = EnTrt_TalkToShopkeeper; func_80151938(globalCtx, this->talkOptionTextId); - func_8011552C(globalCtx, 6); + Interface_SetDoAction(globalCtx, DO_ACTION_DECIDE); this->stickLeftPrompt.isEnabled = false; this->stickRightPrompt.isEnabled = false; } diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index ea338f54f..256356e04 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -2125,8 +2125,8 @@ 0x80115130:("func_80115130",), 0x801152B8:("func_801152B8",), 0x801153C8:("func_801153C8",), - 0x80115428:("func_80115428",), - 0x8011552C:("func_8011552C",), + 0x80115428:("Interface_LoadActionLabel",), + 0x8011552C:("Interface_SetDoAction",), 0x801155B4:("func_801155B4",), 0x80115764:("func_80115764",), 0x80115844:("func_80115844",), @@ -2134,7 +2134,7 @@ 0x801159C0:("func_801159c0",), 0x801159EC:("func_801159EC",), 0x80115A14:("func_80115A14",), - 0x80115D14:("Parameter_AddMagic",), + 0x80115D14:("Interface_AddMagic",), 0x80115D5C:("func_80115D5C",), 0x80115DB4:("func_80115DB4",), 0x80116088:("func_80116088",), diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt index 5fd381bac..3e0f23377 100644 --- a/tools/disasm/variables.txt +++ b/tools/disasm/variables.txt @@ -1119,7 +1119,7 @@ 0x801BFA64:("D_801BFA64","UNK_TYPE2","",0x2), 0x801BFA74:("D_801BFA74","UNK_TYPE2","",0x2), 0x801BFA84:("D_801BFA84","UNK_TYPE4","",0x4), - 0x801BFAB0:("D_801BFAB0","UNK_TYPE1","",0x1), + 0x801BFAB0:("sDoActionTextures","UNK_TYPE1","",0x1), 0x801BFAB8:("D_801BFAB8","UNK_TYPE1","",0x1), 0x801BFAC4:("D_801BFAC4","UNK_TYPE1","",0x1), 0x801BFACC:("D_801BFACC","UNK_TYPE1","",0x1), diff --git a/tools/sizes/code_functions.csv b/tools/sizes/code_functions.csv index faeaada60..4cc77f525 100644 --- a/tools/sizes/code_functions.csv +++ b/tools/sizes/code_functions.csv @@ -1639,8 +1639,8 @@ asm/non_matchings/code/z_parameter/func_80114FD0.s,func_80114FD0,0x80114FD0,0x58 asm/non_matchings/code/z_parameter/func_80115130.s,func_80115130,0x80115130,0x62 asm/non_matchings/code/z_parameter/func_801152B8.s,func_801152B8,0x801152B8,0x44 asm/non_matchings/code/z_parameter/func_801153C8.s,func_801153C8,0x801153C8,0x18 -asm/non_matchings/code/z_parameter/func_80115428.s,func_80115428,0x80115428,0x41 -asm/non_matchings/code/z_parameter/func_8011552C.s,func_8011552C,0x8011552C,0x22 +asm/non_matchings/code/z_parameter/Interface_LoadActionLabel.s,Interface_LoadActionLabel,0x80115428,0x41 +asm/non_matchings/code/z_parameter/Interface_SetDoAction.s,Interface_SetDoAction,0x8011552C,0x22 asm/non_matchings/code/z_parameter/func_801155B4.s,func_801155B4,0x801155B4,0x6C asm/non_matchings/code/z_parameter/func_80115764.s,func_80115764,0x80115764,0x38 asm/non_matchings/code/z_parameter/func_80115844.s,func_80115844,0x80115844,0x31 @@ -1648,7 +1648,7 @@ asm/non_matchings/code/z_parameter/func_80115908.s,func_80115908,0x80115908,0x2E asm/non_matchings/code/z_parameter/func_801159c0.s,func_801159c0,0x801159C0,0xB asm/non_matchings/code/z_parameter/func_801159EC.s,func_801159EC,0x801159EC,0xA asm/non_matchings/code/z_parameter/func_80115A14.s,func_80115A14,0x80115A14,0xC0 -asm/non_matchings/code/z_parameter/Parameter_AddMagic.s,Parameter_AddMagic,0x80115D14,0x12 +asm/non_matchings/code/z_parameter/Interface_AddMagic.s,Interface_AddMagic,0x80115D14,0x12 asm/non_matchings/code/z_parameter/func_80115D5C.s,func_80115D5C,0x80115D5C,0x16 asm/non_matchings/code/z_parameter/func_80115DB4.s,func_80115DB4,0x80115DB4,0xB5 asm/non_matchings/code/z_parameter/func_80116088.s,func_80116088,0x80116088,0x23