From 0b375cadb0af6f2d95844cc674f84be0b148ae10 Mon Sep 17 00:00:00 2001 From: Derek Hensley Date: Fri, 14 Jun 2024 21:35:22 -0700 Subject: [PATCH] Msgevent OK (#1637) * Decompiled, some commands still unnamed * Use full weekevent reg names * Fix func_8094E69C * Fix Player_GetMask * Eventinf, mask worn, and item action argument formatting * decimal rupees * Times (day, hours, minutes) as decimal * msgEventScriptPos * Callbacks * Name final commands * Enum * Arrays * functions * Small cleanups * Clean up actors * Remove event from some variable names to make them shorter * Some more function renames * newline * Missed a few unks in commands * Update functions.txt * PlayerMask * MSGMODE_PAUSED * Script time macros * EnSob1_GetWelcome default * Whole bunch of renames * Format * Add CMD to commands * Update code_functions * structs for size * z64scripts.h * MsgEventCallback -> MsgScriptCallback * format * MsgEvent_RunScript stop * Remove cmd handler comment * cmd -> script in MsgEvent_RunScript --------- Co-authored-by: Thar0 <17233964+Thar0@users.noreply.github.com> --- docs/schedule_scripting_language.md | 4 +- include/functions.h | 53 - include/z64.h | 1 + include/z64msgevent.h | 516 ++++++ include/z64player.h | 2 +- include/z64schedule.h | 92 +- include/z64scripts.h | 24 + spec | 1 - src/code/cutscene_camera.c | 1 - src/code/z_bgcheck.c | 2 - src/code/z_collision_check.c | 1 - src/code/z_kankyo.c | 16 +- src/code/z_lifemeter.c | 1 - src/code/z_msgevent.c | 1208 ++++++++++++- src/code/z_player_lib.c | 2 +- src/code/z_schedule.c | 146 +- src/overlays/actors/ovl_Boss_03/z_boss_03.c | 1 + src/overlays/actors/ovl_Dm_Tag/z_dm_tag.c | 65 +- src/overlays/actors/ovl_Dm_Tag/z_dm_tag.h | 7 +- src/overlays/actors/ovl_En_Ah/z_en_ah.c | 41 +- src/overlays/actors/ovl_En_Ah/z_en_ah.h | 2 +- src/overlays/actors/ovl_En_Al/z_en_al.c | 407 ++++- src/overlays/actors/ovl_En_Al/z_en_al.h | 7 +- src/overlays/actors/ovl_En_An/z_en_an.c | 689 +++++++- src/overlays/actors/ovl_En_An/z_en_an.h | 6 +- src/overlays/actors/ovl_En_Baba/z_en_baba.c | 2 +- src/overlays/actors/ovl_En_Bjt/z_en_bjt.c | 67 +- src/overlays/actors/ovl_En_Bjt/z_en_bjt.h | 5 +- src/overlays/actors/ovl_En_Dai/z_en_dai.c | 30 +- src/overlays/actors/ovl_En_Dai/z_en_dai.h | 2 +- src/overlays/actors/ovl_En_Dnh/z_en_dnh.c | 223 ++- src/overlays/actors/ovl_En_Dnh/z_en_dnh.h | 7 +- src/overlays/actors/ovl_En_Dnp/z_en_dnp.c | 20 +- src/overlays/actors/ovl_En_Dnp/z_en_dnp.h | 2 +- src/overlays/actors/ovl_En_Dnq/z_en_dnq.c | 54 +- src/overlays/actors/ovl_En_Dnq/z_en_dnq.h | 4 +- src/overlays/actors/ovl_En_Dns/z_en_dns.c | 90 +- src/overlays/actors/ovl_En_Dns/z_en_dns.h | 7 +- .../actors/ovl_En_Fishing/z_en_fishing.c | 1 - src/overlays/actors/ovl_En_Gb2/z_en_gb2.c | 4 +- src/overlays/actors/ovl_En_Gm/z_en_gm.c | 290 ++- src/overlays/actors/ovl_En_Gm/z_en_gm.h | 7 +- src/overlays/actors/ovl_En_Go/z_en_go.c | 471 ++++- src/overlays/actors/ovl_En_Go/z_en_go.h | 5 +- src/overlays/actors/ovl_En_Ig/z_en_ig.c | 117 +- src/overlays/actors/ovl_En_Ig/z_en_ig.h | 7 +- src/overlays/actors/ovl_En_Ja/z_en_ja.c | 127 +- src/overlays/actors/ovl_En_Ja/z_en_ja.h | 12 +- src/overlays/actors/ovl_En_Nb/z_en_nb.c | 207 ++- src/overlays/actors/ovl_En_Nb/z_en_nb.h | 7 +- src/overlays/actors/ovl_En_Pm/z_en_pm.c | 320 +++- src/overlays/actors/ovl_En_Pm/z_en_pm.h | 7 +- src/overlays/actors/ovl_En_Pst/z_en_pst.c | 347 +++- src/overlays/actors/ovl_En_Pst/z_en_pst.h | 7 +- src/overlays/actors/ovl_En_Shn/z_en_shn.c | 409 ++++- src/overlays/actors/ovl_En_Shn/z_en_shn.h | 7 +- src/overlays/actors/ovl_En_Sob1/z_en_sob1.c | 3 + .../actors/ovl_En_Suttari/z_en_suttari.c | 4 +- src/overlays/actors/ovl_En_Tab/z_en_tab.c | 221 ++- src/overlays/actors/ovl_En_Tab/z_en_tab.h | 5 +- src/overlays/actors/ovl_En_Test3/z_en_test3.c | 8 +- src/overlays/actors/ovl_En_Tk/z_en_tk.c | 2 +- src/overlays/actors/ovl_En_Tru/z_en_tru.c | 125 +- src/overlays/actors/ovl_En_Tru/z_en_tru.h | 7 +- .../ovl_Obj_Flowerpot/z_obj_flowerpot.c | 2 +- .../actors/ovl_Obj_Hunsui/z_obj_hunsui.c | 1 + .../z_obj_takaraya_wall.c | 2 +- src/overlays/actors/ovl_Obj_Um/z_obj_um.c | 4 +- .../actors/ovl_player_actor/z_player.c | 1 - .../ovl_file_choose/z_file_nameset_NES.c | 1 - .../ovl_kaleido_scope/z_kaleido_scope_NES.c | 1 - tools/buildtools/schc.py | 4 +- tools/disasm/functions.txt | 142 +- tools/overlayhelpers/actor_symbols.py | 6 +- tools/overlayhelpers/mscriptdis.py | 1551 +++++++++++++++++ tools/overlayhelpers/scheduledis.py | 4 +- tools/sizes/code_functions.csv | 104 +- tools/weekeventregconvert.py | 2 +- 78 files changed, 7267 insertions(+), 1093 deletions(-) create mode 100644 include/z64msgevent.h create mode 100644 include/z64scripts.h create mode 100644 tools/overlayhelpers/mscriptdis.py diff --git a/docs/schedule_scripting_language.md b/docs/schedule_scripting_language.md index 1c92d7fe8a..7c8f4f6cfa 100644 --- a/docs/schedule_scripting_language.md +++ b/docs/schedule_scripting_language.md @@ -152,7 +152,7 @@ static ScheduleScript D_80BD3DB0[] = { /* 0x08 */ SCHEDULE_CMD_RET_VAL_L(1), /* 0x0B */ SCHEDULE_CMD_CHECK_NOT_IN_DAY_S(2, 0x20 - 0x0F), /* 0x0F */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(21, 0, 23, 0, 0x1D - 0x15), - /* 0x15 */ SCHEDULE_CMD_CHECK_FLAG_S(WEEKEVENTREG_HAD_MIDNIGHT_MEETING, 0x1C - 0x19), + /* 0x15 */ SCHEDULE_CMD_CHECK_WEEK_EVENT_REG_S(WEEKEVENTREG_HAD_MIDNIGHT_MEETING, 0x1C - 0x19), /* 0x19 */ SCHEDULE_CMD_RET_VAL_L(1), /* 0x1C */ SCHEDULE_CMD_RET_NONE(), /* 0x1D */ SCHEDULE_CMD_RET_VAL_L(3), @@ -261,7 +261,7 @@ static ScheduleScript D_80BD3DB0[] = { /* 0x08 */ SCHEDULE_CMD_RET_VAL_L(1), /* 0x0B */ SCHEDULE_CMD_CHECK_NOT_IN_DAY_S(2, 0x20 - 0x0F), /* 0x0F */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(21, 0, 23, 0, 0x1D - 0x15), - /* 0x15 */ SCHEDULE_CMD_CHECK_FLAG_S(WEEKEVENTREG_HAD_MIDNIGHT_MEETING, 0x1C - 0x19), + /* 0x15 */ SCHEDULE_CMD_CHECK_WEEK_EVENT_REG_S(WEEKEVENTREG_HAD_MIDNIGHT_MEETING, 0x1C - 0x19), /* 0x19 */ SCHEDULE_CMD_RET_VAL_L(1), /* 0x1C */ SCHEDULE_CMD_RET_NONE(), /* 0x1D */ SCHEDULE_CMD_RET_VAL_L(3), diff --git a/include/functions.h b/include/functions.h index 715a385bcf..e67742901b 100644 --- a/include/functions.h +++ b/include/functions.h @@ -334,59 +334,6 @@ void Map_Destroy(PlayState* play); void Map_Init(PlayState* play); void Minimap_Draw(PlayState* play); void Map_Update(PlayState* play); -// void func_8010A760(void); -// void func_8010A7CC(void); -// void func_8010A814(void); -// void func_8010A85C(void); -// void func_8010A8A4(void); -// void func_8010A8EC(void); -// void func_8010A990(void); -// void func_8010AA54(void); -// void func_8010AB30(void); -// void func_8010AB94(void); -// void func_8010AC00(void); -// void func_8010AD24(void); -// void func_8010ADD4(void); -// void func_8010AE48(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5); -// UNK_TYPE4 func_8010AECC(UNK_TYPE4 param_1, s32 param_2, s32* param_3); -// void func_8010AF20(void); -// void func_8010AF6C(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5); -// void func_8010AF94(void); -// void func_8010AFE0(void); -// void func_8010B010(void); -// void func_8010B06C(void); -// void func_8010B0B4(void); -// void func_8010B0DC(void); -// void func_8010B108(void); -// void func_8010B140(void); -// void func_8010B180(void); -// void func_8010B1BC(void); -// void func_8010B22C(void); -// void func_8010B284(void); -// void func_8010B2C0(void); -// void func_8010B300(void); -// void func_8010B434(void); -// void func_8010B4A4(void); -// void func_8010B520(void); -// void func_8010B664(void); -// void func_8010B7A8(void); -// void func_8010B828(void); -// void func_8010B878(void); -// void func_8010B8E4(void); -// void func_8010BB0C(void); -// void func_8010BB6C(void); -// void func_8010BBCC(void); -// void func_8010BC28(void); -// void func_8010BC7C(void); -// void func_8010BD48(void); -// void func_8010BD90(void); -// void func_8010BDDC(void); -// void func_8010BE78(void); -// void func_8010BEBC(void); -// void func_8010BEF0(void); -// void func_8010BF24(void); -s32 func_8010BF58(Actor* actor, PlayState* play, void* param_3, UNK_PTR param_4, s32* param_5); - f32 OLib_Vec3fDist(Vec3f* a, Vec3f* b); f32 OLib_Vec3fDistOutDiff(Vec3f* a, Vec3f* b, Vec3f* dest); f32 OLib_Vec3fDistXZ(Vec3f* a, Vec3f* b); diff --git a/include/z64.h b/include/z64.h index dab2bc7b32..0123ae2f9a 100644 --- a/include/z64.h +++ b/include/z64.h @@ -55,6 +55,7 @@ #include "z64map.h" #include "z64math.h" #include "z64message.h" +#include "z64msgevent.h" #include "z64object.h" #include "z64ocarina.h" #include "z64pause_menu.h" diff --git a/include/z64msgevent.h b/include/z64msgevent.h new file mode 100644 index 0000000000..69ca66debd --- /dev/null +++ b/include/z64msgevent.h @@ -0,0 +1,516 @@ +#ifndef Z64MSGEVENT_H +#define Z64MSGEVENT_H + +#include "z64scripts.h" + +struct PlayState; +struct Actor; + +typedef enum MsgScriptCommandId { + /* 0x00 */ MSCRIPT_CMD_ID_CHECK_WEEK_EVENT_REG, + /* 0x01 */ MSCRIPT_CMD_ID_CHECK_GORON, + /* 0x02 */ MSCRIPT_CMD_ID_CHECK_ZORA, + /* 0x03 */ MSCRIPT_CMD_ID_CHECK_DEKU, + /* 0x04 */ MSCRIPT_CMD_ID_CHECK_HUMAN, + /* 0x05 */ MSCRIPT_CMD_ID_CHECK_TEXT_CHOICE, + /* 0x06 */ MSCRIPT_CMD_ID_OFFER_ITEM, + /* 0x07 */ MSCRIPT_CMD_ID_AUTOTALK, + /* 0x08 */ MSCRIPT_CMD_ID_CHECK_RUPEES, + /* 0x09 */ MSCRIPT_CMD_ID_CHECK_CALLBACK, + /* 0x0A */ MSCRIPT_CMD_ID_CHECK_DAY, + /* 0x0B */ MSCRIPT_CMD_ID_AWAIT_TEXT_JUMP, + /* 0x0C */ MSCRIPT_CMD_ID_AWAIT_TEXT, + /* 0x0D */ MSCRIPT_CMD_ID_AWAIT_TEXT_END, + /* 0x0E */ MSCRIPT_CMD_ID_BEGIN_TEXT, + /* 0x0F */ MSCRIPT_CMD_ID_CONTINUE_TEXT, + /* 0x10 */ MSCRIPT_CMD_ID_DONE, + /* 0x11 */ MSCRIPT_CMD_ID_SET_WEEK_EVENT_REG, + /* 0x12 */ MSCRIPT_CMD_ID_CLOSE_TEXT, + /* 0x13 */ MSCRIPT_CMD_ID_SET_COLLECTIBLE, + /* 0x14 */ MSCRIPT_CMD_ID_CHANGE_RUPEES, + /* 0x15 */ MSCRIPT_CMD_ID_PAUSE, + /* 0x16 */ MSCRIPT_CMD_ID_UNSET_AUTOTALK, + /* 0x17 */ MSCRIPT_CMD_ID_FOCUS_TO_CHILD, + /* 0x18 */ MSCRIPT_CMD_ID_FOCUS_TO_SELF, + /* 0x19 */ MSCRIPT_CMD_ID_JUMP, + /* 0x1A */ MSCRIPT_CMD_ID_CHECK_QUEST_ITEM, + /* 0x1B */ MSCRIPT_CMD_ID_CHECK_EVENT_INF, + /* 0x1C */ MSCRIPT_CMD_ID_SET_EVENT_INF, + /* 0x1D */ MSCRIPT_CMD_ID_UNSET_EVENT_INF, + /* 0x1E */ MSCRIPT_CMD_ID_CHECK_ITEM_ACTION, + /* 0x1F */ MSCRIPT_CMD_ID_CHECK_HAS_SONG, + /* 0x20 */ MSCRIPT_CMD_ID_CHECK_WORN_MASK, + /* 0x21 */ MSCRIPT_CMD_ID_CHECK_AFTER_TIME, + /* 0x22 */ MSCRIPT_CMD_ID_CHECK_BEFORE_TIME, + /* 0x23 */ MSCRIPT_CMD_ID_CHECK_SWITCH_FLAG, + /* 0x24 */ MSCRIPT_CMD_ID_SET_SWITCH_FLAG, + /* 0x25 */ MSCRIPT_CMD_ID_CHECK_ITEM, + /* 0x26 */ MSCRIPT_CMD_ID_CHECK_BETWEEN_TIME, + /* 0x27 */ MSCRIPT_CMD_ID_CHECK_ON_DAY, + /* 0x28 */ MSCRIPT_CMD_ID_CHECK_CALLBACK_CONTINUE, + /* 0x29 */ MSCRIPT_CMD_ID_CHECK_HAS_POWDER_KEG, + /* 0x2A */ MSCRIPT_CMD_ID_DELETE_ITEM, + /* 0x2B */ MSCRIPT_CMD_ID_CHECK_CALLBACK_MULTI, + /* 0x2C */ MSCRIPT_CMD_ID_PLAYER_TALK, + /* 0x2D */ MSCRIPT_CMD_ID_NOTEBOOK_EVENT, + /* 0x2E */ MSCRIPT_CMD_ID_AWAIT_TEXT_DONE, + /* 0x2F */ MSCRIPT_CMD_ID_JUMP_3, + /* 0x30 */ MSCRIPT_CMD_ID_PLAY_DECIDE, + /* 0x31 */ MSCRIPT_CMD_ID_PLAY_CANCEL, + /* 0x32 */ MSCRIPT_CMD_ID_PLAY_ERROR, + /* 0x33 */ MSCRIPT_CMD_ID_MAX +} MsgScriptCommandId; + +typedef struct { + /* 0x0 */ u8 cmd; +} MsgScriptCmdBase; + +typedef struct { + /* 0x0 */ MsgScriptCmdBase base; + /* 0x1 */ u8 flagByte; + /* 0x2 */ u8 flagMask; + /* 0x3 */ u8 offsetH; + /* 0x4 */ u8 offsetL; +} MsgScriptCmdCheckWeekEventReg; // size = 0x5 + +typedef struct { + /* 0x0 */ MsgScriptCmdBase base; + /* 0x1 */ u8 offsetH; + /* 0x2 */ u8 offsetL; +} MsgScriptCmdCheckGoron; // size = 0x3 + +typedef struct { + /* 0x0 */ MsgScriptCmdBase base; + /* 0x1 */ u8 offsetH; + /* 0x2 */ u8 offsetL; +} MsgScriptCmdCheckZora; // size = 0x3 + +typedef struct { + /* 0x0 */ MsgScriptCmdBase base; + /* 0x1 */ u8 offsetH; + /* 0x2 */ u8 offsetL; +} MsgScriptCmdCheckDeku; // size = 0x3 + +typedef struct { + /* 0x0 */ MsgScriptCmdBase base; + /* 0x1 */ u8 offsetH; + /* 0x2 */ u8 offsetL; +} MsgScriptCmdCheckHuman; // size = 0x3 + +typedef struct { + /* 0x0 */ MsgScriptCmdBase base; + /* 0x1 */ u8 offset0H; + /* 0x2 */ u8 offset0L; + /* 0x3 */ u8 offset1H; + /* 0x4 */ u8 offset1L; + /* 0x5 */ u8 offset2H; + /* 0x6 */ u8 offset2L; +} MsgScriptCmdCheckTextChoice; // size = 0x7 + +typedef struct { + /* 0x0 */ MsgScriptCmdBase base; + /* 0x1 */ u8 itemIdH; + /* 0x2 */ u8 itemIdL; + /* 0x3 */ u8 offsetH; + /* 0x4 */ u8 offsetL; +} MsgScriptCmdOfferItem; // size = 0x5 + +typedef struct { + /* 0x0 */ MsgScriptCmdBase base; + /* 0x1 */ u8 offsetH; + /* 0x2 */ u8 offsetL; +} MsgScriptCmdAutotalk; // size = 0x3 + +typedef struct { + /* 0x0 */ MsgScriptCmdBase base; + /* 0x1 */ u8 rupeesH; + /* 0x2 */ u8 rupeesL; + /* 0x3 */ u8 offsetH; + /* 0x4 */ u8 offsetL; +} MsgScriptCmdCheckRupees; // size = 0x5 + +typedef struct { + /* 0x0 */ MsgScriptCmdBase base; + /* 0x1 */ u8 offsetH; + /* 0x2 */ u8 offsetL; +} MsgScriptCmdCheckCallback; // size = 0x3 + +typedef struct { + /* 0x0 */ MsgScriptCmdBase base; + /* 0x1 */ u8 offsetDay1H; + /* 0x2 */ u8 offsetDay1L; + /* 0x3 */ u8 offsetNight1H; + /* 0x4 */ u8 offsetNight1L; + /* 0x5 */ u8 offsetDay2H; + /* 0x6 */ u8 offsetDay2L; + /* 0x7 */ u8 offsetNight2H; + /* 0x8 */ u8 offsetNight2L; + /* 0x9 */ u8 offsetDay3H; + /* 0xA */ u8 offsetDay3L; + /* 0xB */ u8 offsetNight3H; + /* 0xC */ u8 offsetNight3L; +} MsgScriptCmdCheckDay; // size = 0xD + +typedef struct { + /* 0x0 */ MsgScriptCmdBase base; + /* 0x1 */ u8 offsetH; + /* 0x2 */ u8 offsetL; +} MsgScriptCmdAwaitTextJump; // size = 0x3 + +typedef struct { + /* 0x0 */ MsgScriptCmdBase base; + /* 0x1 */ u8 textIdH; + /* 0x2 */ u8 textIdL; +} MsgScriptCmdBeginText; // size = 0x3 + +typedef struct { + /* 0x0 */ MsgScriptCmdBase base; + /* 0x1 */ u8 textIdH; + /* 0x2 */ u8 textIdL; +} MsgScriptCmdContinueText; // size = 0x3 + +typedef struct { + /* 0x0 */ MsgScriptCmdBase base; + /* 0x1 */ u8 flagByte; + /* 0x2 */ u8 flagMask; +} MsgScriptCmdSetWeekEventReg; // size = 0x3 + +typedef struct { + /* 0x0 */ MsgScriptCmdBase base; + /* 0x1 */ u8 flagH; + /* 0x2 */ u8 flagL; +} MsgScriptCmdSetCollectible; // size = 0x3 + +typedef struct { + /* 0x0 */ MsgScriptCmdBase base; + /* 0x1 */ u8 rupeesH; + /* 0x2 */ u8 rupeesL; +} MsgScriptCmdChangeRupees; // size = 0x3 + +typedef struct { + /* 0x0 */ MsgScriptCmdBase base; + /* 0x1 */ u8 offsetH; + /* 0x2 */ u8 offsetL; +} MsgScriptCmdJump; // size = 0x3 + +typedef struct { + /* 0x0 */ MsgScriptCmdBase base; + /* 0x1 */ u8 questItemH; + /* 0x2 */ u8 questItemL; + /* 0x3 */ u8 offsetH; + /* 0x4 */ u8 offsetL; +} MsgScriptCmdCheckQuestItem; // size = 0x5 + +typedef struct { + /* 0x0 */ MsgScriptCmdBase base; + /* 0x1 */ u8 flagByte; + /* 0x2 */ u8 flagMask; + /* 0x3 */ u8 offsetH; + /* 0x4 */ u8 offsetL; +} MsgScriptCmdCheckEventInf; // size = 0x5 + +typedef struct { + /* 0x0 */ MsgScriptCmdBase base; + /* 0x1 */ u8 flagByte; + /* 0x2 */ u8 flagMask; +} MsgScriptCmdSetEventInf; // size = 0x3 + +typedef struct { + /* 0x0 */ MsgScriptCmdBase base; + /* 0x1 */ u8 flagByte; + /* 0x2 */ u8 flagMask; +} MsgScriptCmdUnsetEventInf; // size = 0x3 + +typedef struct { + /* 0x0 */ MsgScriptCmdBase base; + /* 0x1 */ u8 itemActionH; + /* 0x2 */ u8 itemActionL; + /* 0x3 */ u8 offsetEqualH; + /* 0x4 */ u8 offsetEqualL; + /* 0x5 */ u8 offsetDefaultH; + /* 0x6 */ u8 offsetDefaultL; + /* 0x7 */ u8 offsetContinueH; + /* 0x8 */ u8 offsetContinueL; +} MsgScriptCmdCheckItemAction; // size = 0x9 + +typedef struct { + /* 0x0 */ MsgScriptCmdBase base; + /* 0x1 */ u8 songH; + /* 0x2 */ u8 songL; + /* 0x3 */ u8 offsetH; + /* 0x4 */ u8 offsetL; +} MsgScriptCmdCheckHasSong; // size = 0x5 + +typedef struct { + /* 0x0 */ MsgScriptCmdBase base; + /* 0x1 */ u8 maskH; + /* 0x2 */ u8 maskL; + /* 0x3 */ u8 offsetH; + /* 0x4 */ u8 offsetL; +} MsgScriptCmdCheckWornMask; // size = 0x5 + +typedef struct { + /* 0x0 */ MsgScriptCmdBase base; + /* 0x1 */ u8 hr; + /* 0x2 */ u8 min; + /* 0x3 */ u8 offsetH; + /* 0x4 */ u8 offsetL; +} MsgScriptCmdCheckAfterTime; // size = 0x5 + +typedef struct { + /* 0x0 */ MsgScriptCmdBase base; + /* 0x1 */ u8 hr; + /* 0x2 */ u8 min; + /* 0x3 */ u8 offsetH; + /* 0x4 */ u8 offsetL; +} MsgScriptCmdCheckBeforeTime; // size = 0x5 + +typedef struct { + /* 0x0 */ MsgScriptCmdBase base; + /* 0x1 */ u8 flagH; + /* 0x2 */ u8 flagL; + /* 0x3 */ u8 offsetH; + /* 0x4 */ u8 offsetL; +} MsgScriptCmdCheckSwitchFlag; // size = 0x5 + +typedef struct { + /* 0x0 */ MsgScriptCmdBase base; + /* 0x1 */ u8 flagH; + /* 0x2 */ u8 flagL; +} MsgScriptCmdSetSwitchFlag; // size = 0x3 + +typedef struct { + /* 0x0 */ MsgScriptCmdBase base; + /* 0x1 */ u8 itemH; + /* 0x2 */ u8 itemL; + /* 0x3 */ u8 offsetH; + /* 0x4 */ u8 offsetL; +} MsgScriptCmdCheckItem; // size = 0x5 + +typedef struct { + /* 0x0 */ MsgScriptCmdBase base; + /* 0x1 */ u8 startHr; + /* 0x2 */ u8 startMin; + /* 0x3 */ u8 endHr; + /* 0x4 */ u8 endMin; + /* 0x5 */ u8 offsetH; + /* 0x6 */ u8 offsetL; +} MsgScriptCmdCheckBetweenTime; // size = 0x7 + +typedef struct { + /* 0x0 */ MsgScriptCmdBase base; + /* 0x1 */ u8 dayH; + /* 0x2 */ u8 dayL; + /* 0x3 */ u8 offsetH; + /* 0x4 */ u8 offsetL; +} MsgScriptCmdCheckOnDay; // size = 0x5 + +typedef struct { + /* 0x0 */ MsgScriptCmdBase base; + /* 0x1 */ u8 offsetH; + /* 0x2 */ u8 offsetL; +} MsgScriptCmdCheckCallbackContinue; // size = 0x3 + +typedef struct { + /* 0x0 */ MsgScriptCmdBase base; + /* 0x1 */ u8 offsetH; + /* 0x2 */ u8 offsetL; +} MsgScriptCmdCheckHasPowderKeg; // size = 0x3 + +typedef struct { + /* 0x0 */ MsgScriptCmdBase base; + /* 0x1 */ u8 itemH; + /* 0x2 */ u8 itemL; +} MsgScriptCmdDeleteItem; // size = 0x3 + +typedef struct { + /* 0x0 */ MsgScriptCmdBase base; + /* 0x1 */ u8 offset1H; + /* 0x2 */ u8 offset1L; + /* 0x3 */ u8 offset2H; + /* 0x4 */ u8 offset2L; + /* 0x5 */ u8 offset3H; + /* 0x6 */ u8 offset3L; +} MsgScriptCmdCheckCallbackMulti; // size = 0x7 + +typedef struct { + /* 0x0 */ MsgScriptCmdBase base; + /* 0x1 */ u8 textIdH; + /* 0x2 */ u8 textIdL; +} MsgScriptCmdPlayerTalk; // size = 0x3 + +typedef struct { + /* 0x0 */ MsgScriptCmdBase base; + /* 0x1 */ u8 eventH; + /* 0x2 */ u8 eventL; +} MsgScriptCmdBombersNotebook; // size = 0x3 + +typedef struct { + /* 0x0 */ MsgScriptCmdBase base; + /* 0x1 */ u8 offsetH; + /* 0x2 */ u8 offsetL; +} MsgScriptCmdJump3; // size = 0x3 + +#define MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(reg, skip) \ + MSCRIPT_CMD_ID_CHECK_WEEK_EVENT_REG, SCRIPT_UNPACK_16(reg), SCRIPT_UNPACK_16(skip) + +#define MSCRIPT_CMD_CHECK_GORON(skip) \ + MSCRIPT_CMD_ID_CHECK_GORON, SCRIPT_UNPACK_16(skip) + +#define MSCRIPT_CMD_CHECK_ZORA(skip) \ + MSCRIPT_CMD_ID_CHECK_ZORA, SCRIPT_UNPACK_16(skip) + +#define MSCRIPT_CMD_CHECK_DEKU(skip) \ + MSCRIPT_CMD_ID_CHECK_DEKU, SCRIPT_UNPACK_16(skip) + +#define MSCRIPT_CMD_CHECK_HUMAN(skip) \ + MSCRIPT_CMD_ID_CHECK_HUMAN, SCRIPT_UNPACK_16(skip) + +#define MSCRIPT_CMD_CHECK_TEXT_CHOICE(skip0, skip1, skip2) \ + MSCRIPT_CMD_ID_CHECK_TEXT_CHOICE, SCRIPT_UNPACK_16(skip0), SCRIPT_UNPACK_16(skip1), SCRIPT_UNPACK_16(skip2) + +#define MSCRIPT_CMD_OFFER_ITEM(item, skip) \ + MSCRIPT_CMD_ID_OFFER_ITEM, SCRIPT_UNPACK_16(item), SCRIPT_UNPACK_16(skip) + +#define MSCRIPT_CMD_AUTOTALK(skip) \ + MSCRIPT_CMD_ID_AUTOTALK, SCRIPT_UNPACK_16(skip) + +#define MSCRIPT_CMD_CHECK_RUPEES(rupees, skip) \ + MSCRIPT_CMD_ID_CHECK_RUPEES, SCRIPT_UNPACK_16(rupees), SCRIPT_UNPACK_16(skip) + +#define MSCRIPT_CMD_CHECK_CALLBACK(skip) \ + MSCRIPT_CMD_ID_CHECK_CALLBACK, SCRIPT_UNPACK_16(skip) + +#define MSCRIPT_CMD_CHECK_DAY(skipDay1, skipNight1, skipDay2, skipNight2, skipDay3, skipNight3) \ + MSCRIPT_CMD_ID_CHECK_DAY, \ + SCRIPT_UNPACK_16(skipDay1), SCRIPT_UNPACK_16(skipNight1), \ + SCRIPT_UNPACK_16(skipDay2), SCRIPT_UNPACK_16(skipNight2), \ + SCRIPT_UNPACK_16(skipDay3), SCRIPT_UNPACK_16(skipNight3) + +#define MSCRIPT_CMD_AWAIT_TEXT_JUMP(skip) \ + MSCRIPT_CMD_ID_AWAIT_TEXT_JUMP, SCRIPT_UNPACK_16(skip) + +#define MSCRIPT_CMD_AWAIT_TEXT() \ + MSCRIPT_CMD_ID_AWAIT_TEXT + +#define MSCRIPT_CMD_AWAIT_TEXT_END() \ + MSCRIPT_CMD_ID_AWAIT_TEXT_END + +#define MSCRIPT_CMD_BEGIN_TEXT(arg) \ + MSCRIPT_CMD_ID_BEGIN_TEXT, SCRIPT_UNPACK_16(arg) + +#define MSCRIPT_CMD_CONTINUE_TEXT(arg) \ + MSCRIPT_CMD_ID_CONTINUE_TEXT, SCRIPT_UNPACK_16(arg) + +#define MSCRIPT_CMD_DONE() \ + MSCRIPT_CMD_ID_DONE + +#define MSCRIPT_CMD_SET_WEEK_EVENT_REG(reg) \ + MSCRIPT_CMD_ID_SET_WEEK_EVENT_REG, SCRIPT_UNPACK_16(reg) + +#define MSCRIPT_CMD_CLOSE_TEXT() \ + MSCRIPT_CMD_ID_CLOSE_TEXT + +#define MSCRIPT_CMD_SET_COLLECTIBLE(collectFlag) \ + MSCRIPT_CMD_ID_SET_COLLECTIBLE, SCRIPT_UNPACK_16(collectFlag) + +#define MSCRIPT_CMD_CHANGE_RUPEES(num) \ + MSCRIPT_CMD_ID_CHANGE_RUPEES, SCRIPT_UNPACK_16(num) + +#define MSCRIPT_CMD_PAUSE() \ + MSCRIPT_CMD_ID_PAUSE + +#define MSCRIPT_CMD_UNSET_AUTOTALK() \ + MSCRIPT_CMD_ID_UNSET_AUTOTALK + +#define MSCRIPT_CMD_FOCUS_TO_CHILD() \ + MSCRIPT_CMD_ID_FOCUS_TO_CHILD + +#define MSCRIPT_CMD_FOCUS_TO_SELF() \ + MSCRIPT_CMD_ID_FOCUS_TO_SELF + +#define MSCRIPT_CMD_JUMP(skip) \ + MSCRIPT_CMD_ID_JUMP, SCRIPT_UNPACK_16(skip) + +#define MSCRIPT_CMD_CHECK_QUEST_ITEM(questItem, skip) \ + MSCRIPT_CMD_ID_CHECK_QUEST_ITEM, SCRIPT_UNPACK_16(questItem), SCRIPT_UNPACK_16(skip) + +#define MSCRIPT_CMD_CHECK_EVENT_INF(flag, skip) \ + MSCRIPT_CMD_ID_CHECK_EVENT_INF, SCRIPT_UNPACK_8(((flag) >> 4)), SCRIPT_UNPACK_8((1 << ((flag) & 0xF))), SCRIPT_UNPACK_16(skip) + +#define MSCRIPT_CMD_SET_EVENT_INF(flag) \ + MSCRIPT_CMD_ID_SET_EVENT_INF, SCRIPT_UNPACK_8(((flag) >> 4)), SCRIPT_UNPACK_8((1 << ((flag) & 0xF))) + +#define MSCRIPT_CMD_EVENT_INF(flag) \ + MSCRIPT_CMD_ID_UNSET_EVENT_INF, SCRIPT_UNPACK_8(((flag) >> 4)), SCRIPT_UNPACK_8((1 << ((flag) & 0xF))) + +#define MSCRIPT_CMD_CHECK_ITEM_ACTION(itemAction, skipEqual, skipDefault, skipContinue) \ + MSCRIPT_CMD_ID_CHECK_ITEM_ACTION, SCRIPT_UNPACK_16(itemAction), SCRIPT_UNPACK_16(skipEqual), SCRIPT_UNPACK_16(skipDefault), SCRIPT_UNPACK_16(skipContinue) + +#define MSCRIPT_CMD_CHECK_HAS_SONG(questItem, skip) \ + MSCRIPT_CMD_ID_CHECK_HAS_SONG, SCRIPT_UNPACK_16(questItem), SCRIPT_UNPACK_16(skip) + +#define MSCRIPT_CMD_CHECK_WORN_MASK(mask, skip) \ + MSCRIPT_CMD_ID_CHECK_WORN_MASK, SCRIPT_UNPACK_16(mask), SCRIPT_UNPACK_16(skip) + +#define MSCRIPT_CMD_CHECK_AFTER_TIME(hours, minutes, skip) \ + MSCRIPT_CMD_ID_CHECK_AFTER_TIME, SCRIPT_UNPACK_8(hours), SCRIPT_UNPACK_8(minutes), SCRIPT_UNPACK_16(skip) + +#define MSCRIPT_CMD_CHECK_BEFORE_TIME(hours, minutes, skip) \ + MSCRIPT_CMD_ID_CHECK_BEFORE_TIME, SCRIPT_UNPACK_8(hours), SCRIPT_UNPACK_8(minutes), SCRIPT_UNPACK_16(skip) + +#define MSCRIPT_CMD_CHECK_SWITCH_FLAG(switchFlag, skip) \ + MSCRIPT_CMD_ID_CHECK_SWITCH_FLAG, SCRIPT_UNPACK_16(switchFlag), SCRIPT_UNPACK_16(skip) + +#define MSCRIPT_CMD_SET_SWITCH_FLAG(switchFlag) \ + MSCRIPT_CMD_ID_SET_SWITCH_FLAG, SCRIPT_UNPACK_16(switchFlag) + +#define MSCRIPT_CMD_CHECK_ITEM(item, skip) \ + MSCRIPT_CMD_ID_CHECK_ITEM, SCRIPT_UNPACK_16(item), SCRIPT_UNPACK_16(skip) + +#define MSCRIPT_CMD_BETWEEN_TIME(hours1, minutes1, hours2, minutes2, skip) \ + MSCRIPT_CMD_ID_CHECK_BETWEEN_TIME, SCRIPT_UNPACK_8(hours1), SCRIPT_UNPACK_8(minutes1), SCRIPT_UNPACK_8(hours2), SCRIPT_UNPACK_8(minutes2), SCRIPT_UNPACK_16(skip) + +#define MSCRIPT_CMD_CHECK_IN_DAY(day, skip) \ + MSCRIPT_CMD_ID_CHECK_ON_DAY, SCRIPT_UNPACK_16(day), SCRIPT_UNPACK_16(skip) + +#define MSCRIPT_CMD_CHECK_CALLBACK_CONTINUE(skip) \ + MSCRIPT_CMD_ID_CHECK_CALLBACK_CONTINUE, SCRIPT_UNPACK_16(skip) + +#define MSCRIPT_CMD_CHECK_HAS_POWDER_KEG(skip) \ + MSCRIPT_CMD_ID_CHECK_HAS_POWDER_KEG, SCRIPT_UNPACK_16(skip) + +#define MSCRIPT_CMD_DELETE_ITEM(item) \ + MSCRIPT_CMD_ID_DELETE_ITEM, SCRIPT_UNPACK_16(item) + +#define MSCRIPT_CMD_CHECK_CALLBACK_MULTI(skip1, skip2, skip3) \ + MSCRIPT_CMD_ID_CHECK_CALLBACK_MULTI, SCRIPT_UNPACK_16(skip1), SCRIPT_UNPACK_16(skip2), SCRIPT_UNPACK_16(skip3) + +#define MSCRIPT_CMD_PLAYER_TALK(textId) \ + MSCRIPT_CMD_ID_PLAYER_TALK, SCRIPT_UNPACK_16(textId) + +#define MSCRIPT_CMD_NOTEBOOK_EVENT(event) \ + MSCRIPT_CMD_ID_NOTEBOOK_EVENT, SCRIPT_UNPACK_16(event) + +#define MSCRIPT_CMD_AWAIT_TEXT_DONE() \ + MSCRIPT_CMD_ID_AWAIT_TEXT_DONE + +#define MSCRIPT_CMD_JUMP_3(skip) \ + MSCRIPT_CMD_ID_JUMP_3, SCRIPT_UNPACK_16(skip) + +#define MSCRIPT_CMD_PLAY_DECIDE() \ + MSCRIPT_CMD_ID_PLAY_DECIDE + +#define MSCRIPT_CMD_PLAY_CANCEL() \ + MSCRIPT_CMD_ID_PLAY_CANCEL + +#define MSCRIPT_CMD_PLAY_ERROR() \ + MSCRIPT_CMD_ID_PLAY_ERROR + +typedef u8 MsgScript; + +typedef s32 (*MsgScriptCallback)(struct Actor* thisx, struct PlayState* play); + +s32 MsgEvent_RunScript(Actor* actor, struct PlayState* play, MsgScript* script, MsgScriptCallback callback, s32* pos); + +#endif diff --git a/include/z64player.h b/include/z64player.h index a5c531ca86..2f26507058 100644 --- a/include/z64player.h +++ b/include/z64player.h @@ -1388,7 +1388,7 @@ void func_80123E90(struct PlayState* play, Actor* actor); s32 func_80123F2C(struct PlayState* play, s32 ammo); bool Player_IsBurningStickInRange(struct PlayState* play, Vec3f* pos, f32 xzRange, f32 yRange); u8 Player_GetStrength(void); -u8 Player_GetMask(struct PlayState* play); +PlayerMask Player_GetMask(struct PlayState* play); void Player_RemoveMask(struct PlayState* play); bool Player_HasMirrorShieldEquipped(struct PlayState* play); bool Player_IsHoldingMirrorShield(struct PlayState* play); diff --git a/include/z64schedule.h b/include/z64schedule.h index 1fabc7c5d0..9db9379cd9 100644 --- a/include/z64schedule.h +++ b/include/z64schedule.h @@ -1,7 +1,7 @@ #ifndef Z64SCHEDULE_H #define Z64SCHEDULE_H -#include "ultra64.h" +#include "z64scripts.h" /** * Schedule is a subsystem that acts as a way to make decisions based on the @@ -29,33 +29,26 @@ struct PlayState; -// Macro to convert the time format used in the save struct into the format used in Schedule -#define SCHEDULE_CONVERT_TIME(time) ((s32)((time) - 0x10000 / 360 * 90)) - -#define SCHEDULE_TIME(hour, minute) SCHEDULE_CONVERT_TIME((((hour)*60.0f) + (minute)) * (0x10000 / 60 / 24.0f)) - -#define SCHEDULE_TIME_NOW SCHEDULE_CONVERT_TIME(CURRENT_TIME) - typedef enum ScheduleCommandId { - /* 0x00 */ SCHEDULE_CMD_ID_CHECK_FLAG_S, // Checks if a weekEventReg flag is set and branches if so, short range branch - /* 0x01 */ SCHEDULE_CMD_ID_CHECK_FLAG_L, // Checks if a weekEventReg flag is set and branches if so, long range branch - /* 0x02 */ SCHEDULE_CMD_ID_CHECK_TIME_RANGE_S, // Checks if the current time is within the range of the two provided times and branches if so, short range branch - /* 0x03 */ SCHEDULE_CMD_ID_CHECK_TIME_RANGE_L, // Checks if the current time is within the range of the two provided times and branches if so, long range branch - /* 0x04 */ SCHEDULE_CMD_ID_RET_VAL_L, // Ends script and returns 2-byte value (Note: bugged as the return value size is only 1 byte in the struct) - /* 0x05 */ SCHEDULE_CMD_ID_RET_NONE, // Ends script without returning anything - /* 0x06 */ SCHEDULE_CMD_ID_RET_EMPTY, // Ends script and indicates return without changing existing value - /* 0x07 */ SCHEDULE_CMD_ID_NOP, // No-Op - /* 0x08 */ SCHEDULE_CMD_ID_CHECK_MISC_S, // Special check based on items or masks and branches if check passes, short range branch - /* 0x09 */ SCHEDULE_CMD_ID_RET_VAL_S, // Ends script and returns byte value - /* 0x0A */ SCHEDULE_CMD_ID_CHECK_NOT_IN_SCENE_S, // Checks if the current scene is not SceneId and branches if so, short range branch - /* 0x0B */ SCHEDULE_CMD_ID_CHECK_NOT_IN_SCENE_L, // Checks if the current scene is not SceneId and branches if so, long range branch - /* 0x0C */ SCHEDULE_CMD_ID_CHECK_NOT_IN_DAY_S, // Checks if the current day is not Day and branches if so, short range branch - /* 0x0D */ SCHEDULE_CMD_ID_CHECK_NOT_IN_DAY_L, // Checks if the current day is not Day and branches if so, long range branch - /* 0x0E */ SCHEDULE_CMD_ID_RET_TIME, // Returns 2 time values - /* 0x0F */ SCHEDULE_CMD_ID_CHECK_BEFORE_TIME_S, // Branches if the current time is less than the command time, short range branch - /* 0x10 */ SCHEDULE_CMD_ID_CHECK_BEFORE_TIME_L, // Branches if the current time is less than the command time, long range branch - /* 0x11 */ SCHEDULE_CMD_ID_BRANCH_S, // Always branch, short range branch - /* 0x12 */ SCHEDULE_CMD_ID_BRANCH_L // Always branch, long range branch + /* 0x00 */ SCHEDULE_CMD_ID_CHECK_WEEK_EVENT_REG_S, // Checks if a weekEventReg flag is set and branches if so, short range branch + /* 0x01 */ SCHEDULE_CMD_ID_CHECK_WEEK_EVENT_REG_L, // Checks if a weekEventReg flag is set and branches if so, long range branch + /* 0x02 */ SCHEDULE_CMD_ID_CHECK_TIME_RANGE_S, // Checks if the current time is within the range of the two provided times and branches if so, short range branch + /* 0x03 */ SCHEDULE_CMD_ID_CHECK_TIME_RANGE_L, // Checks if the current time is within the range of the two provided times and branches if so, long range branch + /* 0x04 */ SCHEDULE_CMD_ID_RET_VAL_L, // Ends script and returns 2-byte value (Note: bugged as the return value size is only 1 byte in the struct) + /* 0x05 */ SCHEDULE_CMD_ID_RET_NONE, // Ends script without returning anything + /* 0x06 */ SCHEDULE_CMD_ID_RET_EMPTY, // Ends script and indicates return without changing existing value + /* 0x07 */ SCHEDULE_CMD_ID_NOP, // No-Op + /* 0x08 */ SCHEDULE_CMD_ID_CHECK_MISC_S, // Special check based on items or masks and branches if check passes, short range branch + /* 0x09 */ SCHEDULE_CMD_ID_RET_VAL_S, // Ends script and returns byte value + /* 0x0A */ SCHEDULE_CMD_ID_CHECK_NOT_IN_SCENE_S, // Checks if the current scene is not SceneId and branches if so, short range branch + /* 0x0B */ SCHEDULE_CMD_ID_CHECK_NOT_IN_SCENE_L, // Checks if the current scene is not SceneId and branches if so, long range branch + /* 0x0C */ SCHEDULE_CMD_ID_CHECK_NOT_IN_DAY_S, // Checks if the current day is not Day and branches if so, short range branch + /* 0x0D */ SCHEDULE_CMD_ID_CHECK_NOT_IN_DAY_L, // Checks if the current day is not Day and branches if so, long range branch + /* 0x0E */ SCHEDULE_CMD_ID_RET_TIME, // Returns 2 time values + /* 0x0F */ SCHEDULE_CMD_ID_CHECK_BEFORE_TIME_S, // Branches if the current time is less than the command time, short range branch + /* 0x10 */ SCHEDULE_CMD_ID_CHECK_BEFORE_TIME_L, // Branches if the current time is less than the command time, long range branch + /* 0x11 */ SCHEDULE_CMD_ID_BRANCH_S, // Always branch, short range branch + /* 0x12 */ SCHEDULE_CMD_ID_BRANCH_L // Always branch, long range branch } ScheduleCommandId; typedef enum { @@ -80,7 +73,7 @@ typedef struct { /* 0x1 */ u8 flagByte; /* 0x2 */ u8 flagMask; /* 0x3 */ s8 offset; -} ScheduleCmdCheckFlagS; // size = 0x4 +} ScheduleCmdCheckWeekEventRegS; // size = 0x4 typedef struct { /* 0x0 */ ScheduleCmdBase base; @@ -88,7 +81,7 @@ typedef struct { /* 0x2 */ u8 flagMask; /* 0x3 */ u8 offsetH; /* 0x4 */ u8 offsetL; -} ScheduleCmdCheckFlagL; // size = 0x5 +} ScheduleCmdCheckWeekEventRegL; // size = 0x5 typedef struct { /* 0x0 */ ScheduleCmdBase base; @@ -198,23 +191,20 @@ typedef struct { /* 0x2 */ u8 offsetL; } ScheduleCmdBranchL; // size = 0x3 -#define SCHEDULE_PACK_S16(val) \ - ((val) >> 8) & 0xFF, (val) & 0xFF +#define SCHEDULE_CMD_CHECK_WEEK_EVENT_REG_S(flag, offset) \ + SCHEDULE_CMD_ID_CHECK_WEEK_EVENT_REG_S, SCRIPT_UNPACK_16(flag), SCRIPT_UNPACK_8(offset) -#define SCHEDULE_CMD_CHECK_FLAG_S(flag, offset) \ - SCHEDULE_CMD_ID_CHECK_FLAG_S, SCHEDULE_PACK_S16(flag), (offset) - -#define SCHEDULE_CMD_CHECK_FLAG_L(flag, offset) \ - SCHEDULE_CMD_ID_CHECK_FLAG_L, SCHEDULE_PACK_S16(flag), SCHEDULE_PACK_S16(offset) +#define SCHEDULE_CMD_CHECK_WEEK_EVENT_REG_L(flag, offset) \ + SCHEDULE_CMD_ID_CHECK_WEEK_EVENT_REG_L, SCRIPT_UNPACK_16(flag), SCRIPT_UNPACK_16(offset) #define SCHEDULE_CMD_CHECK_TIME_RANGE_S(startHr, startMin, endHr, endMin, offset) \ - SCHEDULE_CMD_ID_CHECK_TIME_RANGE_S, (startHr), (startMin), (endHr), (endMin), (offset) + SCHEDULE_CMD_ID_CHECK_TIME_RANGE_S, SCRIPT_UNPACK_8(startHr), SCRIPT_UNPACK_8(startMin), SCRIPT_UNPACK_8(endHr), SCRIPT_UNPACK_8(endMin), SCRIPT_UNPACK_8(offset) #define SCHEDULE_CMD_CHECK_TIME_RANGE_L(startHr, startMin, endHr, endMin, offset) \ - SCHEDULE_CMD_ID_CHECK_TIME_RANGE_L, (startHr), (startMin), (endHr), (endMin), SCHEDULE_PACK_S16(offset) + SCHEDULE_CMD_ID_CHECK_TIME_RANGE_L, SCRIPT_UNPACK_8(startHr), SCRIPT_UNPACK_8(startMin), SCRIPT_UNPACK_8(endHr), SCRIPT_UNPACK_8(endMin), SCRIPT_UNPACK_16(offset) #define SCHEDULE_CMD_RET_VAL_L(result) \ - SCHEDULE_CMD_ID_RET_VAL_L, SCHEDULE_PACK_S16(result) + SCHEDULE_CMD_ID_RET_VAL_L, SCRIPT_UNPACK_16(result) #define SCHEDULE_CMD_RET_NONE() \ SCHEDULE_CMD_ID_RET_NONE @@ -223,40 +213,40 @@ typedef struct { SCHEDULE_CMD_ID_RET_EMPTY, #define SCHEDULE_CMD_NOP(unk0, unk1, unk2) \ - SCHEDULE_CMD_ID_NOP, (unk0), (unk1), (unk2) + SCHEDULE_CMD_ID_NOP, SCRIPT_UNPACK_8(unk0), SCRIPT_UNPACK_8(unk1), SCRIPT_UNPACK_8(unk2) #define SCHEDULE_CMD_CHECK_MISC_S(which, offset) \ - SCHEDULE_CMD_ID_CHECK_MISC_S, (which), (offset) + SCHEDULE_CMD_ID_CHECK_MISC_S, SCRIPT_UNPACK_8(which), SCRIPT_UNPACK_8(offset) #define SCHEDULE_CMD_RET_VAL_S(result) \ - SCHEDULE_CMD_ID_RET_VAL_S, (result) + SCHEDULE_CMD_ID_RET_VAL_S, SCRIPT_UNPACK_8(result) #define SCHEDULE_CMD_CHECK_NOT_IN_SCENE_S(scene, offset) \ - SCHEDULE_CMD_ID_CHECK_NOT_IN_SCENE_S, SCHEDULE_PACK_S16(scene), (offset) + SCHEDULE_CMD_ID_CHECK_NOT_IN_SCENE_S, SCRIPT_UNPACK_16(scene), SCRIPT_UNPACK_8(offset) #define SCHEDULE_CMD_CHECK_NOT_IN_SCENE_L(scene, offset) \ - SCHEDULE_CMD_ID_CHECK_NOT_IN_SCENE_L, SCHEDULE_PACK_S16(scene), SCHEDULE_PACK_S16(offset) + SCHEDULE_CMD_ID_CHECK_NOT_IN_SCENE_L, SCRIPT_UNPACK_16(scene), SCRIPT_UNPACK_16(offset) #define SCHEDULE_CMD_CHECK_NOT_IN_DAY_S(day, offset) \ - SCHEDULE_CMD_ID_CHECK_NOT_IN_DAY_S, SCHEDULE_PACK_S16(day), (offset) + SCHEDULE_CMD_ID_CHECK_NOT_IN_DAY_S, SCRIPT_UNPACK_16(day), SCRIPT_UNPACK_8(offset) #define SCHEDULE_CMD_CHECK_NOT_IN_DAY_L(day, offset) \ - SCHEDULE_CMD_ID_CHECK_NOT_IN_DAY_L, SCHEDULE_PACK_S16(day), SCHEDULE_PACK_S16(offset) + SCHEDULE_CMD_ID_CHECK_NOT_IN_DAY_L, SCRIPT_UNPACK_16(day), SCRIPT_UNPACK_16(offset) #define SCHEDULE_CMD_RET_TIME(time0Hr, time0Min, time1Hr, time1Min, result) \ - SCHEDULE_CMD_ID_RET_TIME, (time0Hr), (time0Min), (time1Hr), (time1Min), (result) + SCHEDULE_CMD_ID_RET_TIME, SCRIPT_UNPACK_8(time0Hr), SCRIPT_UNPACK_8(time0Min), SCRIPT_UNPACK_8(time1Hr), SCRIPT_UNPACK_8(time1Min), SCRIPT_UNPACK_8(result) #define SCHEDULE_CMD_CHECK_BEFORE_TIME_S(timeHr, timeMin, offset) \ - SCHEDULE_CMD_ID_CHECK_BEFORE_TIME_S, (timeHr), (timeMin), (offset) + SCHEDULE_CMD_ID_CHECK_BEFORE_TIME_S, SCRIPT_UNPACK_8(timeHr), SCRIPT_UNPACK_8(timeMin), SCRIPT_UNPACK_8(offset) #define SCHEDULE_CMD_CHECK_BEFORE_TIME_L(timeHr, timeMin, offset) \ - SCHEDULE_CMD_ID_CHECK_BEFORE_TIME_L, (timeHr), (timeMin), SCHEDULE_PACK_S16(offset) + SCHEDULE_CMD_ID_CHECK_BEFORE_TIME_L, SCRIPT_UNPACK_8(timeHr), SCRIPT_UNPACK_8(timeMin), SCRIPT_UNPACK_16(offset) #define SCHEDULE_CMD_BRANCH_S(offset) \ - SCHEDULE_CMD_ID_BRANCH_S, (offset) + SCHEDULE_CMD_ID_BRANCH_S, SCRIPT_UNPACK_8(offset) #define SCHEDULE_CMD_BRANCH_L(offset) \ - SCHEDULE_CMD_ID_BRANCH_L, SCHEDULE_PACK_S16(offset) + SCHEDULE_CMD_ID_BRANCH_L, SCRIPT_UNPACK_16(offset) typedef u8 ScheduleScript; diff --git a/include/z64scripts.h b/include/z64scripts.h new file mode 100644 index 0000000000..2b5c8a6a53 --- /dev/null +++ b/include/z64scripts.h @@ -0,0 +1,24 @@ +#ifndef Z64SCRIPTS_H +#define Z64SCRIPTS_H + +#include "PR/ultratypes.h" + +// Macros to convert the time format used in the save struct into the format used in scripts (Schedule or Message) +#define SCRIPT_CONVERT_TIME(time) ((s32)((time) - 0x10000 / 360 * 90)) + +#define SCRIPT_CALC_TIME(hour, minute, dest, temp) \ + (temp) = (hour)*60.0f; \ + (temp) += (minute); \ + (dest) = (temp) * (0x10000 / 60 / 24.0f); \ + (dest) = SCRIPT_CONVERT_TIME(dest) + +#define SCRIPT_TIME(hour, minute) SCRIPT_CONVERT_TIME((((hour)*60.0f) + (minute)) * (0x10000 / 60 / 24.0f)) + +#define SCRIPT_TIME_NOW SCRIPT_CONVERT_TIME(CURRENT_TIME) + +#define SCRIPT_PACK_16(h, l) (((h) << 8) | (l)) + +#define SCRIPT_UNPACK_8(v) (u8)(v) +#define SCRIPT_UNPACK_16(v) (u8)_SHIFTR(v, 8, 8), (u8)_SHIFTR(v, 0, 8) + +#endif diff --git a/spec b/spec index 1672e4092b..b0581f410c 100644 --- a/spec +++ b/spec @@ -500,7 +500,6 @@ beginseg include "$(BUILD_DIR)/src/code/z_map_data.o" include "$(BUILD_DIR)/src/code/z_map_exp.o" include "$(BUILD_DIR)/src/code/z_msgevent.o" - include "$(BUILD_DIR)/data/code/z_msgevent.data.o" include "$(BUILD_DIR)/src/code/z_nmi_buff.o" include "$(BUILD_DIR)/src/code/z_nulltask.o" include "$(BUILD_DIR)/src/code/z_olib.o" diff --git a/src/code/cutscene_camera.c b/src/code/cutscene_camera.c index 6eb782787f..20406e60a7 100644 --- a/src/code/cutscene_camera.c +++ b/src/code/cutscene_camera.c @@ -1,4 +1,3 @@ -#include "prevent_bss_reordering.h" #include "global.h" #include "string.h" diff --git a/src/code/z_bgcheck.c b/src/code/z_bgcheck.c index 3bf9107260..b27310b3f0 100644 --- a/src/code/z_bgcheck.c +++ b/src/code/z_bgcheck.c @@ -1,5 +1,3 @@ -#include "prevent_bss_reordering.h" - #include "z64bgcheck.h" #include "global.h" diff --git a/src/code/z_collision_check.c b/src/code/z_collision_check.c index 5b25e29b33..11c3865e1e 100644 --- a/src/code/z_collision_check.c +++ b/src/code/z_collision_check.c @@ -1,4 +1,3 @@ -#include "prevent_bss_reordering.h" #include "z64collision_check.h" #include "z64actor.h" diff --git a/src/code/z_kankyo.c b/src/code/z_kankyo.c index ae2487eccf..bdfb36183e 100644 --- a/src/code/z_kankyo.c +++ b/src/code/z_kankyo.c @@ -1674,27 +1674,27 @@ void func_800F88C4(u16 weekEventFlag) { } void func_800F8970(void) { - if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_27_40) && (SCHEDULE_TIME_NOW >= SCHEDULE_TIME(9, 31))) { + if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_27_40) && (SCRIPT_TIME_NOW >= SCRIPT_TIME(9, 31))) { SET_WEEKEVENTREG(WEEKEVENTREG_27_40); func_800F88C4(WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_SOUTH_UPPER_CLOCKTOWN); } - if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_27_80) && (SCHEDULE_TIME_NOW >= SCHEDULE_TIME(10, 3))) { + if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_27_80) && (SCRIPT_TIME_NOW >= SCRIPT_TIME(10, 3))) { SET_WEEKEVENTREG(WEEKEVENTREG_27_80); func_800F88C4(WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_NORTH_CLOCKTOWN); } - if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_28_01) && (SCHEDULE_TIME_NOW >= SCHEDULE_TIME(10, 35))) { + if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_28_01) && (SCRIPT_TIME_NOW >= SCRIPT_TIME(10, 35))) { SET_WEEKEVENTREG(WEEKEVENTREG_28_01); func_800F88C4(WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_EAST_UPPER_CLOCKTOWN); } - if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_28_02) && (SCHEDULE_TIME_NOW >= SCHEDULE_TIME(10, 53))) { + if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_28_02) && (SCRIPT_TIME_NOW >= SCRIPT_TIME(10, 53))) { SET_WEEKEVENTREG(WEEKEVENTREG_28_02); func_800F88C4(WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_EAST_LOWER_CLOCKTOWN); } - if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_28_04) && (SCHEDULE_TIME_NOW >= SCHEDULE_TIME(11, 25))) { + if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_28_04) && (SCRIPT_TIME_NOW >= SCRIPT_TIME(11, 25))) { SET_WEEKEVENTREG(WEEKEVENTREG_28_04); func_800F88C4(WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_SOUTH_LOWER_CLOCKTOWN); } @@ -1729,7 +1729,7 @@ void Environment_UpdatePostmanEvents(PlayState* play) { CLEAR_WEEKEVENTREG(WEEKEVENTREG_28_04); } - if ((SCHEDULE_TIME_NOW < SCHEDULE_TIME(9, 0)) || (SCHEDULE_TIME_NOW > SCHEDULE_TIME(12, 0))) { + if ((SCRIPT_TIME_NOW < SCRIPT_TIME(9, 0)) || (SCRIPT_TIME_NOW > SCRIPT_TIME(12, 0))) { CLEAR_WEEKEVENTREG(WEEKEVENTREG_90_08); } @@ -1738,14 +1738,14 @@ void Environment_UpdatePostmanEvents(PlayState* play) { if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_ROOM_KEY) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_55_02)) { if (((void)0, gSaveContext.save.day) >= 2) { SET_WEEKEVENTREG(WEEKEVENTREG_55_02); - } else if ((((void)0, gSaveContext.save.day) == 1) && (SCHEDULE_TIME_NOW >= SCHEDULE_TIME(16, 30))) { + } else if ((((void)0, gSaveContext.save.day) == 1) && (SCRIPT_TIME_NOW >= SCRIPT_TIME(16, 30))) { SET_WEEKEVENTREG(WEEKEVENTREG_55_02); } } if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_90_01)) { temp_a2_2 = CURRENT_TIME - D_801F4E78; - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_89_40) && ((u16)SCHEDULE_TIME_NOW >= (u16)SCHEDULE_TIME(5, 0))) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_89_40) && ((u16)SCRIPT_TIME_NOW >= (u16)SCRIPT_TIME(5, 0))) { SET_WEEKEVENTREG(WEEKEVENTREG_90_01); } else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_89_08) && (temp_a2_2 >= CLOCK_TIME(0, 23))) { SET_WEEKEVENTREG(WEEKEVENTREG_89_40); diff --git a/src/code/z_lifemeter.c b/src/code/z_lifemeter.c index ec2774b4b9..54ad13daeb 100644 --- a/src/code/z_lifemeter.c +++ b/src/code/z_lifemeter.c @@ -1,4 +1,3 @@ -#include "prevent_bss_reordering.h" #include "z64lifemeter.h" #include "global.h" diff --git a/src/code/z_msgevent.c b/src/code/z_msgevent.c index e3e45f9005..d43aa3891e 100644 --- a/src/code/z_msgevent.c +++ b/src/code/z_msgevent.c @@ -1,105 +1,1209 @@ #include "global.h" -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010A760.s") +/** + * Branch forward if the provided weekEventReg flag is set + * + * Command structure: + * 0:(u8) cmd + * 1:(u16) flag + * 3:(s16) skip + * Command size: 5 + */ +s32 MsgEvent_CheckWeekEventReg(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + MsgScriptCmdCheckWeekEventReg* cmd = (MsgScriptCmdCheckWeekEventReg*)*script; + u16 flag = SCRIPT_PACK_16(cmd->flagByte, cmd->flagMask); + s16 skip = SCRIPT_PACK_16(cmd->offsetH, cmd->offsetL); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010A7CC.s") + if (CHECK_WEEKEVENTREG(flag)) { + *script += skip; + } + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010A814.s") +/** + * Branch forward if the player is currently in goron form + * + * Command structure: + * 0:(u8) cmd + * 1:(s16) skip + * Command size: 3 + */ +s32 MsgEvent_CheckGoron(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + Player* player = GET_PLAYER(play); + MsgScriptCmdCheckGoron* cmd = (MsgScriptCmdCheckGoron*)*script; + s16 skip = SCRIPT_PACK_16(cmd->offsetH, cmd->offsetL); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010A85C.s") + if (player->transformation == PLAYER_FORM_GORON) { + *script += skip; + } + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010A8A4.s") +/** + * Branch forward if the player is currently in zora form + * + * Command structure: + * 0:(u8) cmd + * 1:(s16) skip + * Command size: 3 + */ +s32 MsgEvent_CheckZora(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + Player* player = GET_PLAYER(play); + MsgScriptCmdCheckZora* cmd = (MsgScriptCmdCheckZora*)*script; + s16 skip = SCRIPT_PACK_16(cmd->offsetH, cmd->offsetL); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010A8EC.s") + if (player->transformation == PLAYER_FORM_ZORA) { + *script += skip; + } + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010A990.s") +/** + * Branch forward if the player is currently in deku form + * + * Command structure: + * 0:(u8) cmd + * 1:(s16) skip + * Command size: 3 + */ +s32 MsgEvent_CheckDeku(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + Player* player = GET_PLAYER(play); + MsgScriptCmdCheckDeku* cmd = (MsgScriptCmdCheckDeku*)*script; + s16 skip = SCRIPT_PACK_16(cmd->offsetH, cmd->offsetL); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010AA54.s") + if (player->transformation == PLAYER_FORM_DEKU) { + *script += skip; + } + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010AB30.s") +/** + * Branch forward if the player is currently in human form + * + * Command structure: + * 0:(u8) cmd + * 1:(s16) skip + * Command size: 3 + */ +s32 MsgEvent_CheckHuman(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + Player* player = GET_PLAYER(play); + MsgScriptCmdCheckHuman* cmd = (MsgScriptCmdCheckHuman*)*script; + s16 skip = SCRIPT_PACK_16(cmd->offsetH, cmd->offsetL); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010AB94.s") + if (player->transformation == PLAYER_FORM_HUMAN) { + *script += skip; + } + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010AC00.s") +/** + * Branch forward depending on the message choice index + * + * Command structure: + * 0:(u8) cmd + * 1:(s16) skipChoice1 + * 3:(s16) skipChoice2 + * 5:(s16) skipChoice3 + * Command size: 7 + */ +s32 MsgEvent_CheckTextChoice(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + MsgScriptCmdCheckTextChoice* cmd = (MsgScriptCmdCheckTextChoice*)*script; + s16 skip = 0; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010AD24.s") + switch (play->msgCtx.choiceIndex) { + case 0: + skip = SCRIPT_PACK_16(cmd->offset0H, cmd->offset0L); + break; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010ADD4.s") + case 1: + skip = SCRIPT_PACK_16(cmd->offset1H, cmd->offset1L); + break; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010AE48.s") + case 2: + skip = SCRIPT_PACK_16(cmd->offset2H, cmd->offset2L); + break; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010AECC.s") + default: + break; + } + *script += skip; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010AF20.s") + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010AF6C.s") +/** + * Branch forward if the actor has a parent, else get item + * + * Command structure: + * 0:(u8) cmd + * 1:(s16) getItemId + * 3:(s16) skip + * Command size: 5 + */ +s32 MsgEvent_OfferItem(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + MsgScriptCmdOfferItem* cmd = (MsgScriptCmdOfferItem*)*script; + s32 getItemId = SCRIPT_PACK_16(cmd->itemIdH, cmd->itemIdL); + f32 xzRange = actor->xzDistToPlayer + 1.0f; + f32 yRange = fabsf(actor->playerHeightRel) + 1.0f; + s16 skip = SCRIPT_PACK_16(cmd->offsetH, cmd->offsetL); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010AF94.s") + if (Actor_HasParent(actor, play)) { + *script += skip; + } else { + Actor_OfferGetItem(actor, play, getItemId, xzRange, yRange); + return true; + } + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010AFE0.s") +/** + * Branch forward if there is a talk request, else autotalk + * + * Command structure: + * 0:(u8) cmd + * 1:(s16) skip + * Command size: 3 + */ +s32 MsgEvent_Autotalk(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + MsgScriptCmdAutotalk* cmd = (MsgScriptCmdAutotalk*)*script; + f32 xzRange = actor->xzDistToPlayer + 1.0f; + f32 yRange = fabsf(actor->playerHeightRel) + 1.0f; + f32 xzDist; + s16 skip = SCRIPT_PACK_16(cmd->offsetH, cmd->offsetL); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010B010.s") + if (Actor_TalkOfferAccepted(actor, &play->state)) { + *script += skip; + } else { + actor->flags |= ACTOR_FLAG_10000; + xzDist = actor->xzDistToPlayer; + actor->xzDistToPlayer = 0.0f; + Actor_OfferTalkExchange(actor, play, xzRange, yRange, PLAYER_IA_NONE); + actor->xzDistToPlayer = xzDist; + return true; + } + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010B06C.s") +/** + * Branch forward if the player currently has more rupees + * + * Command structure: + * 0:(u8) cmd + * 1:(s16) rupees + * 3:(s16) skip + * Command size: 5 + */ +s32 MsgEvent_CheckRupees(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + MsgScriptCmdCheckRupees* cmd = (MsgScriptCmdCheckRupees*)*script; + s16 rupees = SCRIPT_PACK_16(cmd->rupeesH, cmd->rupeesL); + s16 skip = SCRIPT_PACK_16(cmd->offsetH, cmd->offsetL); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010B0B4.s") + if (gSaveContext.save.saveInfo.playerData.rupees >= rupees) { + *script += skip; + } + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010B0DC.s") +/** + * Branch forward if the callback is null or returns non-zero + * + * Command structure: + * 0:(u8) cmd + * 1:(s16) skip + * Command size: 3 + */ +s32 MsgEvent_CheckCallback(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + MsgScriptCmdCheckCallback* cmd = (MsgScriptCmdCheckCallback*)*script; + s16 skip = SCRIPT_PACK_16(cmd->offsetH, cmd->offsetL); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010B108.s") + if ((callback == NULL) || (callback(actor, play) != 0)) { + *script += skip; + } else { + return true; + } + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010B140.s") +/** + * Branch forward based on time of day + * + * Command structure: + * 0:(u8) cmd + * 1:(s16) skipDay1 + * 3:(s16) skipNight1 + * 5:(s16) skipDay2 + * 7:(s16) skipNight2 + * 9:(s16) skipDay3 + * 11:(s16) skipNight3 + * Command size: 13 + */ +s32 MsgEvent_CheckDay(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + MsgScriptCmdCheckDay* cmd = (MsgScriptCmdCheckDay*)*script; + s16 skip = 0; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010B180.s") + switch (gSaveContext.save.day) { + case 1: + if (!gSaveContext.save.isNight) { + skip = SCRIPT_PACK_16(cmd->offsetDay1H, cmd->offsetDay1L); + } else { + skip = SCRIPT_PACK_16(cmd->offsetNight1H, cmd->offsetNight1L); + } + break; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010B1BC.s") + case 2: + if (!gSaveContext.save.isNight) { + skip = SCRIPT_PACK_16(cmd->offsetDay2H, cmd->offsetDay2L); + } else { + skip = SCRIPT_PACK_16(cmd->offsetNight2H, cmd->offsetNight2L); + } + break; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010B22C.s") + case 3: + if (!gSaveContext.save.isNight) { + skip = SCRIPT_PACK_16(cmd->offsetDay3H, cmd->offsetDay3L); + } else { + skip = SCRIPT_PACK_16(cmd->offsetNight3H, cmd->offsetNight3L); + } + break; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010B284.s") + default: + break; + } + *script += skip; + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010B2C0.s") +/** + * Wait on choice text, skip forward when text closes. + * + * Command structure: + * 0:(u8) cmd + * 1:(s16) skip + * Command size: 3 + */ +s32 MsgEvent_AwaitTextJump(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + MsgScriptCmdAwaitTextJump* cmd = (MsgScriptCmdAwaitTextJump*)*script; + s16 skip; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010B300.s") + switch (Message_GetState(&play->msgCtx)) { + case TEXT_STATE_CHOICE: + case TEXT_STATE_EVENT: + if (!Message_ShouldAdvance(play)) { + return true; + } + case TEXT_STATE_CLOSING: + skip = SCRIPT_PACK_16(cmd->offsetH, cmd->offsetL); + break; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010B434.s") + default: + return true; + } + *script += skip; + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010B4A4.s") +/** + * Waits for text to advance + * + * Command structure: + * 0:(u8) cmd + * Command size: 1 + */ +s32 MsgEvent_AwaitText(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + switch (Message_GetState(&play->msgCtx)) { + case TEXT_STATE_CHOICE: + case TEXT_STATE_EVENT: + if (!Message_ShouldAdvance(play)) { + return true; + } + break; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010B520.s") + case TEXT_STATE_CLOSING: + break; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010B664.s") + default: + return true; + } + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010B7A8.s") +/** + * Waits for text to end + * + * Command structure: + * 0:(u8) cmd + * Command size: 1 + */ +s32 MsgEvent_AwaitTextEnd(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + s32 state = Message_GetState(&play->msgCtx); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010B828.s") + *endScript = false; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010B878.s") + switch (state) { + case TEXT_STATE_CHOICE: + case TEXT_STATE_EVENT: + if (!Message_ShouldAdvance(play)) { + break; + } + case TEXT_STATE_CLOSING: + *endScript = true; + break; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010B8E4.s") + default: + return true; + } + return true; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010BB0C.s") +/** + * + * Command structure: + * 0:(u8) cmd + * 1:(u16) textId + * Command size: 3 + */ +s32 MsgEvent_BeginText(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + MsgScriptCmdBeginText* cmd = (MsgScriptCmdBeginText*)*script; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010BB6C.s") + Message_StartTextbox(play, SCRIPT_PACK_16(cmd->textIdH, cmd->textIdL), NULL); + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010BBCC.s") +/** + * + * Command structure: + * 0:(u8) cmd + * 1:(u16) textId + * Command size: 3 + */ +s32 MsgEvent_ContinueText(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + MsgScriptCmdContinueText* cmd = (MsgScriptCmdContinueText*)*script; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010BC28.s") + Message_ContinueTextbox(play, SCRIPT_PACK_16(cmd->textIdH, cmd->textIdL)); + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010BC7C.s") +/** + * Script Terminator + * + * Command structure: + * 0:(u8) cmd + * Command size: 1 + */ +s32 MsgEvent_Done(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + *endScript = true; + return true; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010BD48.s") +/** + * Sets weekEventReg flags + * + * Command structure: + * 0:(u8) cmd + * 1:(u16) flag + * Command size: 3 + */ +s32 MsgEvent_SetWeekEventReg(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + MsgScriptCmdSetWeekEventReg* cmd = (MsgScriptCmdSetWeekEventReg*)*script; + u16 flag = SCRIPT_PACK_16(cmd->flagByte, cmd->flagMask); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010BD90.s") + SET_WEEKEVENTREG(flag); + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010BDDC.s") +/** + * + * Command structure: + * 0:(u8) cmd + * Command size: 1 + */ +s32 MsgEvent_CloseText(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + Message_CloseTextbox(play); + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010BE78.s") +/** + * + * Command structure: + * 0:(u8) cmd + * 0:(u16) flag + * Command size: 3 + */ +s32 MsgEvent_SetCollectible(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + MsgScriptCmdSetCollectible* cmd = (MsgScriptCmdSetCollectible*)*script; + s32 flag = SCRIPT_PACK_16(cmd->flagH, cmd->flagL); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010BEBC.s") + if (!Flags_GetCollectible(play, flag)) { + Flags_SetCollectible(play, flag); + } + actor->parent = NULL; + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010BEF0.s") +/** + * + * Command structure: + * 0:(u8) cmd + * 0:(s16) rupees + * Command size: 3 + */ +s32 MsgEvent_ChangeRupees(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + MsgScriptCmdChangeRupees* cmd = (MsgScriptCmdChangeRupees*)*script; + s16 rupees = SCRIPT_PACK_16(cmd->rupeesH, cmd->rupeesL); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010BF24.s") + Rupees_ChangeBy(rupees); + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_msgevent/func_8010BF58.s") +/** + * Pause the message system + * + * Command structure: + * 0:(u8) cmd + * Command size: 1 + */ +s32 MsgEvent_Pause(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + play->msgCtx.msgMode = MSGMODE_PAUSED; + return false; +} + +/** + * Unsets ACTOR_FLAG_10000 for the actor executing the cmd + * + * Command structure: + * 0:(u8) cmd + * Command size: 1 + */ +s32 MsgEvent_UnsetAutotalk(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + actor->flags &= ~ACTOR_FLAG_10000; + return false; +} + +/** + * Sets player focus & talk actor to the child of the actor executing the cmd + * + * Command structure: + * 0:(u8) cmd + * Command size: 1 + */ +s32 MsgEvent_FocusToChild(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + if (actor->child != NULL) { + Actor_ChangeFocus(actor, play, actor->child); + } + return false; +} + +/** + * Sets player focus & talk actor to the actor executing the cmd + * + * Command structure: + * 0:(u8) cmd + * Command size: 1 + */ +s32 MsgEvent_FocusToSelf(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + if (actor->child != NULL) { + Actor_ChangeFocus(actor->child, play, actor); + } + return false; +} + +/** + * Unconditional branch by `skip` + * + * Command structure: + * 0:(u8) cmd + * 1:(s16) skip + * Command size: 3 + */ +s32 MsgEvent_Jump(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + MsgScriptCmdJump* cmd = (MsgScriptCmdJump*)*script; + s16 skip = SCRIPT_PACK_16(cmd->offsetH, cmd->offsetL); + + *script += skip; + return false; +} + +/** + * Branch forwards if the specified quest item is obtained + * + * Command structure: + * 0:(u8) cmd + * 1:(u16) questItem + * 3:(s16) skip + * Command size: 5 + */ +s32 MsgEvent_CheckQuestItem(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + MsgScriptCmdCheckQuestItem* cmd = (MsgScriptCmdCheckQuestItem*)*script; + u16 questItem = SCRIPT_PACK_16(cmd->questItemH, cmd->questItemL); + s16 skip = SCRIPT_PACK_16(cmd->offsetH, cmd->offsetL); + + if (CHECK_QUEST_ITEM(questItem)) { + *script += skip; + } + return false; +} + +/** + * Branch forwards if event_inf flag is set + * + * Command structure: + * 0:(u8) cmd + * 1:(u16) event_inf flag + * 3:(s16) skip + * Command size: 5 + */ +s32 MsgEvent_CheckEventInf(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + MsgScriptCmdCheckEventInf* cmd = (MsgScriptCmdCheckEventInf*)*script; + s16 skip = SCRIPT_PACK_16(cmd->offsetH, cmd->offsetL); + + if (gSaveContext.eventInf[cmd->flagByte] & cmd->flagMask) { + *script += skip; + } + return false; +} + +/** + * Sets event_inf flag + * + * Command structure: + * 0:(u8) cmd + * 1:(u16) event_inf flag + * Command size: 3 + */ +s32 MsgEvent_SetEventInf(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + MsgScriptCmdSetEventInf* cmd = (MsgScriptCmdSetEventInf*)*script; + + gSaveContext.eventInf[cmd->flagByte] |= cmd->flagMask; + return false; +} + +/** + * Unsets event_inf flag + * + * Command structure: + * 0:(u8) cmd + * 1:(u16) event_inf flag + * Command size: 3 + */ +s32 MsgEvent_UnsetEventInf(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + MsgScriptCmdUnsetEventInf* cmd = (MsgScriptCmdUnsetEventInf*)*script; + + gSaveContext.eventInf[cmd->flagByte] &= cmd->flagMask ^ 0xFF; + return false; +} + +/** + * + * Command structure: + * 0:(u8) cmd + * 1:(s16) input player item-action + * 3:(s16) skip if player item-action matches input player item-action + * 5:(s16) skip if player item-action does not match input player item-action + * 7:(s16) skip if player item-action is negative + * Command size: 9 + */ +s32 MsgEvent_CheckItemAction(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + MsgScriptCmdCheckItemAction* cmd = (MsgScriptCmdCheckItemAction*)*script; + PlayerItemAction checkItemAction = SCRIPT_PACK_16(cmd->itemActionH, cmd->itemActionL); + s16 skip; + PlayerItemAction curItemAction; + + switch (Message_GetState(&play->msgCtx)) { + case TEXT_STATE_CHOICE: + case TEXT_STATE_EVENT: + if (!Message_ShouldAdvance(play)) { + return true; + } + case TEXT_STATE_PAUSE_MENU: + curItemAction = func_80123810(play); + + if (curItemAction == PLAYER_IA_NONE) { + return true; + } else if (curItemAction < 0) { + skip = SCRIPT_PACK_16(cmd->offsetContinueH, cmd->offsetContinueL); + } else if (curItemAction == checkItemAction) { + skip = SCRIPT_PACK_16(cmd->offsetEqualH, cmd->offsetEqualL); + } else { + skip = SCRIPT_PACK_16(cmd->offsetDefaultH, cmd->offsetDefaultL); + } + break; + + default: + return true; + } + *script += skip; + return false; +} + +/** + * Branches forward if song is obtained + * + * Command structure: + * 0:(u8) cmd + * 1:(u16) song + * 3:(s16) skip + * Command size: 5 + */ +s32 MsgEvent_CheckHasSong(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + MsgScriptCmdCheckHasSong* cmd = (MsgScriptCmdCheckHasSong*)*script; + u16 song = SCRIPT_PACK_16(cmd->songH, cmd->songL); + s16 skip = SCRIPT_PACK_16(cmd->offsetH, cmd->offsetL); + + if (CHECK_QUEST_ITEM(QUEST_SONG_SONATA + song)) { + *script += skip; + } + return false; +} + +/** + * Branches forward if the player's current mask matches + * + * Command structure: + * 0:(u8) cmd + * 1:(s16) mask + * 3:(s16) skip + * Command size: 5 + */ +s32 MsgEvent_CheckWornMask(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + MsgScriptCmdCheckWornMask* cmd = (MsgScriptCmdCheckWornMask*)*script; + s32 mask = SCRIPT_PACK_16(cmd->maskH, cmd->maskL); + s16 skip = SCRIPT_PACK_16(cmd->offsetH, cmd->offsetL); + + if (Player_GetMask(play) == mask) { + *script += skip; + } + return false; +} + +/** + * Branches forward if the current time is greater than the provided time + * + * Command structure: + * 0:(u8) cmd + * 1:(u8) hour + * 1:(u8) min + * 3:(s16) skip + * Command size: 5 + */ +s32 MsgEvent_CheckAfterTime(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + MsgScriptCmdCheckAfterTime* cmd = (MsgScriptCmdCheckAfterTime*)*script; + s16 skip = SCRIPT_PACK_16(cmd->offsetH, cmd->offsetL); + f32 f; + u16 time; + u16 now; + + SCRIPT_CALC_TIME(cmd->hr, cmd->min, time, f); + now = SCRIPT_TIME_NOW; + + if (time < now) { + *script += skip; + } + return false; +} + +/** + * Branches forward if the current time is less or equal to the provided time + * + * Command structure: + * 0:(u8) cmd + * 1:(u8) hour + * 1:(u8) min + * 3:(s16) skip + * Command size: 5 + */ +s32 MsgEvent_CheckBeforeTime(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + MsgScriptCmdCheckBeforeTime* cmd = (MsgScriptCmdCheckBeforeTime*)*script; + s16 skip = SCRIPT_PACK_16(cmd->offsetH, cmd->offsetL); + f32 f; + u16 time; + u16 now; + + SCRIPT_CALC_TIME(cmd->hr, cmd->min, time, f); + now = SCRIPT_TIME_NOW; + + if (time >= now) { + *script += skip; + } + return false; +} + +/** + * Branches forward if switch flag is set + * + * Command structure: + * 0:(u8) cmd + * 1:(s16) flag + * 3:(s16) skip + * Command size: 5 + */ +s32 MsgEvent_CheckSwitchFlag(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + MsgScriptCmdCheckSwitchFlag* cmd = (MsgScriptCmdCheckSwitchFlag*)*script; + s16 flag = SCRIPT_PACK_16(cmd->flagH, cmd->flagL); + s16 skip = SCRIPT_PACK_16(cmd->offsetH, cmd->offsetL); + + if (Flags_GetSwitch(play, flag)) { + *script += skip; + } + return false; +} + +/** + * Sets switch flag + * + * Command structure: + * 0:(u8) cmd + * 1:(s16) flag + * Command size: 3 + */ +s32 MsgEvent_SetSwitchFlag(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + MsgScriptCmdSetSwitchFlag* cmd = (MsgScriptCmdSetSwitchFlag*)*script; + s16 flag = SCRIPT_PACK_16(cmd->flagH, cmd->flagL); + + Flags_SetSwitch(play, flag); + return false; +} + +/** + * Branches forward if item is in inventory + * + * Command structure: + * 0:(u8) cmd + * 1:(u16) item + * 3:(s16) skip + * Command size: 5 + */ +s32 MsgEvent_CheckItem(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + MsgScriptCmdCheckItem* cmd = (MsgScriptCmdCheckItem*)*script; + u16 item = SCRIPT_PACK_16(cmd->itemH, cmd->itemL); + s16 skip = SCRIPT_PACK_16(cmd->offsetH, cmd->offsetL); + + if (INV_CONTENT(item) == item) { + *script += skip; + } + return false; +} + +/** + * Branches forward if current time is within the specified interval + * + * Command structure: + * 0:(u8) cmd + * 1:(u16) startTime + * 3:(u16) endTime + * 5:(s16) skip + * Command size: 7 + */ +s32 MsgEvent_CheckBetweenTime(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + MsgScriptCmdCheckBetweenTime* cmd = (MsgScriptCmdCheckBetweenTime*)*script; + s16 skip = SCRIPT_PACK_16(cmd->offsetH, cmd->offsetL); + f32 f; + u16 startTime; + u16 endTime; + u16 now; + + SCRIPT_CALC_TIME(cmd->startHr, cmd->startMin, startTime, f); + SCRIPT_CALC_TIME(cmd->endHr, cmd->endMin, endTime, f); + endTime--; + now = SCRIPT_TIME_NOW; + + if ((startTime >= now) || (now >= endTime)) { + *script += skip; + } + return false; +} + +/** + * Branches forward if the current day matches + * + * Command structure: + * 0:(u8) cmd + * 1:(s16) day + * 3:(s16) skip + * Command size: 5 + */ +s32 MsgEvent_CheckOnDay(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + MsgScriptCmdCheckOnDay* cmd = (MsgScriptCmdCheckOnDay*)*script; + s16 day = SCRIPT_PACK_16(cmd->dayH, cmd->dayL); + s16 skip = SCRIPT_PACK_16(cmd->offsetH, cmd->offsetL); + + if (gSaveContext.save.day == day) { + *script += skip; + } + return false; +} + +/** + * Branches forward if callback exists and returns non-zero + * + * Command structure: + * 0:(u8) cmd + * 1:(s16) skip + * Command size: 3 + */ +s32 MsgEvent_CheckCallbackContinue(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, + s32* endScript) { + MsgScriptCmdCheckCallbackContinue* cmd = (MsgScriptCmdCheckCallbackContinue*)*script; + s16 skip = SCRIPT_PACK_16(cmd->offsetH, cmd->offsetL); + + if ((callback != NULL) && (callback(actor, play) != 0)) { + *script += skip; + } + return false; +} + +/** + * Skip forward if a powder keg is in inventory or if a powder keg actor exists + * + * Command structure: + * 0:(u8) cmd + * 1:(s16) skip + * Command size: 3 + */ +s32 MsgEvent_CheckHasPowderKeg(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + MsgScriptCmdCheckHasPowderKeg* cmd = (MsgScriptCmdCheckHasPowderKeg*)*script; + s16 skip = SCRIPT_PACK_16(cmd->offsetH, cmd->offsetL); + + if ((AMMO(ITEM_POWDER_KEG) != 0) || (play->actorCtx.flags & ACTORCTX_FLAG_0)) { + *script += skip; + } + return false; +} + +/** + * Deletes the specified item + * + * Command structure: + * 0:(u8) cmd + * 1:(s16) item + * Command size: 3 + */ +s32 MsgEvent_DeleteItem(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + MsgScriptCmdDeleteItem* cmd = (MsgScriptCmdDeleteItem*)*script; + s16 item = SCRIPT_PACK_16(cmd->itemH, cmd->itemL); + + Inventory_DeleteItem(item, SLOT(item)); + return false; +} + +/** + * Runs the callback and selects a skip based on the result, default skip is the first one + * + * Command structure: + * 0:(u8) cmd + * 1:(s16) skip + * 3:(s16) skip + * 5:(s16) skip + * Command size: 7 + */ +s32 MsgEvent_CheckCallbackMulti(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, + s32* endScript) { + MsgScriptCmdCheckCallbackMulti* cmd = (MsgScriptCmdCheckCallbackMulti*)*script; + s32 ret = 1; + s16 skip; + + if (callback != NULL) { + ret = callback(actor, play); + } + switch (ret) { + case 3: + skip = SCRIPT_PACK_16(cmd->offset3H, cmd->offset3L); + break; + + case 2: + skip = SCRIPT_PACK_16(cmd->offset2H, cmd->offset2L); + break; + + case 1: + skip = SCRIPT_PACK_16(cmd->offset1H, cmd->offset1L); + break; + + default: + return true; + } + *script += skip; + return false; +} + +/** + * Close the current textbox and set the player actor text id + * + * Command structure: + * 0:(u8) cmd + * 1:(u16) textId + * Command size: 3 + */ +s32 MsgEvent_PlayerTalk(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + Player* player = GET_PLAYER(play); + MsgScriptCmdPlayerTalk* cmd = (MsgScriptCmdPlayerTalk*)*script; + u16 textId = SCRIPT_PACK_16(cmd->textIdH, cmd->textIdL); + + player->actor.textId = textId; + Message_CloseTextbox(play); + return false; +} + +/** + * Queue a bomber's notebook event + * + * Command structure: + * 0:(u8) cmd + * 1:(u16) event + * Command size: 3 + */ +s32 MsgEvent_NotebookEvent(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + MsgScriptCmdBombersNotebook* cmd = (MsgScriptCmdBombersNotebook*)*script; + u16 event = SCRIPT_PACK_16(cmd->eventH, cmd->eventL); + + Message_BombersNotebookQueueEvent(play, event); + return false; +} + +/** + * + * + * Command structure: + * 0:(u8) cmd + * Command size: 1 + */ +s32 MsgEvent_AwaitTextDone(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + switch (Message_GetState(&play->msgCtx)) { + case TEXT_STATE_CLOSING: + break; + + case TEXT_STATE_CHOICE: + case TEXT_STATE_EVENT: + if (!Message_ShouldAdvance(play)) { + return true; + } + + case TEXT_STATE_DONE: + if (!Message_ShouldAdvance(play)) { + return true; + } + break; + + default: + return true; + } + return false; +} + +/** + * + * Command structure: + * 0:(u8) cmd + * 1:(s16) skip + * Command size: 3 + */ +s32 MsgEvent_Jump3(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + MsgScriptCmdJump3* cmd = (MsgScriptCmdJump3*)*script; + s16 skip = SCRIPT_PACK_16(cmd->offsetH, cmd->offsetL); + + *script += skip; + *script += 3; + return true; +} + +/** + * Plays Decide sfx + * + * Command structure: + * 0:(u8) cmd + * Command size: 1 + */ +s32 MsgEvent_PlayDecide(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + Audio_PlaySfx_MessageDecide(); + return false; +} + +/** + * Plays Cancel sfx + * + * Command structure: + * 0:(u8) cmd + * Command size: 1 + */ +s32 MsgEvent_PlayCancel(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + Audio_PlaySfx_MessageCancel(); + return false; +} + +/** + * Plays NA_SE_SY_ERROR sfx + * + * Command structure: + * 0:(u8) cmd + * Command size: 1 + */ +s32 MsgEvent_PlayError(Actor* actor, PlayState* play, u8** script, MsgScriptCallback callback, s32* endScript) { + Audio_PlaySfx(NA_SE_SY_ERROR); + return false; +} + +typedef s32 (*MsgScriptCmdHandler)(struct Actor*, struct PlayState*, u8**, MsgScriptCallback, s32*); + +MsgScriptCmdHandler sMsgScriptCmdHandlers[] = { + MsgEvent_CheckWeekEventReg, // MSCRIPT_CMD_ID_CHECK_WEEK_EVENT_REG + MsgEvent_CheckGoron, // MSCRIPT_CMD_ID_CHECK_GORON + MsgEvent_CheckZora, // MSCRIPT_CMD_ID_CHECK_ZORA + MsgEvent_CheckDeku, // MSCRIPT_CMD_ID_CHECK_DEKU + MsgEvent_CheckHuman, // MSCRIPT_CMD_ID_CHECK_HUMAN + MsgEvent_CheckTextChoice, // MSCRIPT_CMD_ID_CHECK_TEXT_CHOICE + MsgEvent_OfferItem, // MSCRIPT_CMD_ID_OFFER_ITEM + MsgEvent_Autotalk, // MSCRIPT_CMD_ID_AUTOTALK + MsgEvent_CheckRupees, // MSCRIPT_CMD_ID_CHECK_RUPEES + MsgEvent_CheckCallback, // MSCRIPT_CMD_ID_CHECK_CALLBACK + MsgEvent_CheckDay, // MSCRIPT_CMD_ID_CHECK_DAY + MsgEvent_AwaitTextJump, // MSCRIPT_CMD_ID_AWAIT_TEXT_JUMP + MsgEvent_AwaitText, // MSCRIPT_CMD_ID_AWAIT_TEXT + MsgEvent_AwaitTextEnd, // MSCRIPT_CMD_ID_AWAIT_TEXT_END + MsgEvent_BeginText, // MSCRIPT_CMD_ID_BEGIN_TEXT + MsgEvent_ContinueText, // MSCRIPT_CMD_ID_CONTINUE_TEXT + MsgEvent_Done, // MSCRIPT_CMD_ID_DONE + MsgEvent_SetWeekEventReg, // MSCRIPT_CMD_ID_SET_WEEK_EVENT_REG + MsgEvent_CloseText, // MSCRIPT_CMD_ID_CLOSE_TEXT + MsgEvent_SetCollectible, // MSCRIPT_CMD_ID_SET_COLLECTIBLE + MsgEvent_ChangeRupees, // MSCRIPT_CMD_ID_CHANGE_RUPEES + MsgEvent_Pause, // MSCRIPT_CMD_ID_PAUSE + MsgEvent_UnsetAutotalk, // MSCRIPT_CMD_ID_UNSET_AUTOTALK + MsgEvent_FocusToChild, // MSCRIPT_CMD_ID_FOCUS_TO_CHILD + MsgEvent_FocusToSelf, // MSCRIPT_CMD_ID_FOCUS_TO_SELF + MsgEvent_Jump, // MSCRIPT_CMD_ID_JUMP + MsgEvent_CheckQuestItem, // MSCRIPT_CMD_ID_CHECK_QUEST_ITEM + MsgEvent_CheckEventInf, // MSCRIPT_CMD_ID_CHECK_EVENT_INF + MsgEvent_SetEventInf, // MSCRIPT_CMD_ID_SET_EVENT_INF + MsgEvent_UnsetEventInf, // MSCRIPT_CMD_ID_UNSET_EVENT_INF + MsgEvent_CheckItemAction, // MSCRIPT_CMD_ID_CHECK_ITEM_ACTION + MsgEvent_CheckHasSong, // MSCRIPT_CMD_ID_CHECK_HAS_SONG + MsgEvent_CheckWornMask, // MSCRIPT_CMD_ID_CHECK_WORN_MASK + MsgEvent_CheckAfterTime, // MSCRIPT_CMD_ID_CHECK_AFTER_TIME + MsgEvent_CheckBeforeTime, // MSCRIPT_CMD_ID_CHECK_BEFORE_TIME + MsgEvent_CheckSwitchFlag, // MSCRIPT_CMD_ID_CHECK_SWITCH_FLAG + MsgEvent_SetSwitchFlag, // MSCRIPT_CMD_ID_SET_SWITCH_FLAG + MsgEvent_CheckItem, // MSCRIPT_CMD_ID_CHECK_ITEM + MsgEvent_CheckBetweenTime, // MSCRIPT_CMD_ID_CHECK_BETWEEN_TIME + MsgEvent_CheckOnDay, // MSCRIPT_CMD_ID_CHECK_ON_DAY + MsgEvent_CheckCallbackContinue, // MSCRIPT_CMD_ID_CHECK_CALLBACK_CONTINUE + MsgEvent_CheckHasPowderKeg, // MSCRIPT_CMD_ID_CHECK_HAS_POWDER_KEG + MsgEvent_DeleteItem, // MSCRIPT_CMD_ID_DELETE_ITEM + MsgEvent_CheckCallbackMulti, // MSCRIPT_CMD_ID_CHECK_CALLBACK_MULTI + MsgEvent_PlayerTalk, // MSCRIPT_CMD_ID_PLAYER_TALK + MsgEvent_NotebookEvent, // MSCRIPT_CMD_ID_NOTEBOOK_EVENT + MsgEvent_AwaitTextDone, // MSCRIPT_CMD_ID_AWAIT_TEXT_DONE + MsgEvent_Jump3, // MSCRIPT_CMD_ID_JUMP_3 + MsgEvent_PlayDecide, // MSCRIPT_CMD_ID_PLAY_DECIDE + MsgEvent_PlayCancel, // MSCRIPT_CMD_ID_PLAY_CANCEL + MsgEvent_PlayError, // MSCRIPT_CMD_ID_PLAY_ERROR +}; + +u8 sMsgScriptCmdSizes[] = { + sizeof(MsgScriptCmdCheckWeekEventReg), // MSCRIPT_CMD_ID_CHECK_WEEK_EVENT_REG + sizeof(MsgScriptCmdCheckGoron), // MSCRIPT_CMD_ID_CHECK_GORON + sizeof(MsgScriptCmdCheckZora), // MSCRIPT_CMD_ID_CHECK_ZORA + sizeof(MsgScriptCmdCheckDeku), // MSCRIPT_CMD_ID_CHECK_DEKU + sizeof(MsgScriptCmdCheckHuman), // MSCRIPT_CMD_ID_CHECK_HUMAN + sizeof(MsgScriptCmdCheckTextChoice), // MSCRIPT_CMD_ID_CHECK_TEXT_CHOICE + sizeof(MsgScriptCmdOfferItem), // MSCRIPT_CMD_ID_OFFER_ITEM + sizeof(MsgScriptCmdAutotalk), // MSCRIPT_CMD_ID_AUTOTALK + sizeof(MsgScriptCmdCheckRupees), // MSCRIPT_CMD_ID_CHECK_RUPEES + sizeof(MsgScriptCmdCheckCallback), // MSCRIPT_CMD_ID_CHECK_CALLBACK + sizeof(MsgScriptCmdCheckDay), // MSCRIPT_CMD_ID_CHECK_DAY, + sizeof(MsgScriptCmdAwaitTextJump), // MSCRIPT_CMD_ID_AWAIT_TEXT_JUMP + sizeof(MsgScriptCmdBase), // MSCRIPT_CMD_ID_AWAIT_TEXT + sizeof(MsgScriptCmdBase), // MSCRIPT_CMD_ID_AWAIT_TEXT_END + sizeof(MsgScriptCmdBeginText), // MSCRIPT_CMD_ID_BEGIN_TEXT + sizeof(MsgScriptCmdContinueText), // MSCRIPT_CMD_ID_CONTINUE_TEXT + sizeof(MsgScriptCmdBase), // MSCRIPT_CMD_ID_DONE + sizeof(MsgScriptCmdSetWeekEventReg), // MSCRIPT_CMD_ID_SET_WEEK_EVENT_REG + sizeof(MsgScriptCmdBase), // MSCRIPT_CMD_ID_CLOSE_TEXT + sizeof(MsgScriptCmdSetCollectible), // MSCRIPT_CMD_ID_SET_COLLECTIBLE + sizeof(MsgScriptCmdChangeRupees), // MSCRIPT_CMD_ID_CHANGE_RUPEES + sizeof(MsgScriptCmdBase), // MSCRIPT_CMD_ID_PAUSE + sizeof(MsgScriptCmdBase), // MSCRIPT_CMD_ID_UNSET_AUTOTALK + sizeof(MsgScriptCmdBase), // MSCRIPT_CMD_ID_FOCUS_TO_CHILD + sizeof(MsgScriptCmdBase), // MSCRIPT_CMD_ID_FOCUS_TO_SELF + sizeof(MsgScriptCmdJump), // MSCRIPT_CMD_ID_JUMP + sizeof(MsgScriptCmdCheckQuestItem), // MSCRIPT_CMD_ID_CHECK_QUEST_ITEM + sizeof(MsgScriptCmdCheckEventInf), // MSCRIPT_CMD_ID_CHECK_EVENT_INF + sizeof(MsgScriptCmdSetEventInf), // MSCRIPT_CMD_ID_SET_EVENT_INF + sizeof(MsgScriptCmdUnsetEventInf), // MSCRIPT_CMD_ID_UNSET_EVENT_INF + sizeof(MsgScriptCmdCheckItemAction), // MSCRIPT_CMD_ID_CHECK_ITEM_ACTION + sizeof(MsgScriptCmdCheckHasSong), // MSCRIPT_CMD_ID_CHECK_HAS_SONG + sizeof(MsgScriptCmdCheckWornMask), // MSCRIPT_CMD_ID_CHECK_WORN_MASK + sizeof(MsgScriptCmdCheckAfterTime), // MSCRIPT_CMD_ID_CHECK_AFTER_TIME + sizeof(MsgScriptCmdCheckBeforeTime), // MSCRIPT_CMD_ID_CHECK_BEFORE_TIME + sizeof(MsgScriptCmdCheckSwitchFlag), // MSCRIPT_CMD_ID_CHECK_SWITCH_FLAG + sizeof(MsgScriptCmdSetSwitchFlag), // MSCRIPT_CMD_ID_SET_SWITCH_FLAG + sizeof(MsgScriptCmdCheckItem), // MSCRIPT_CMD_ID_CHECK_ITEM + sizeof(MsgScriptCmdCheckBetweenTime), // MSCRIPT_CMD_ID_CHECK_BETWEEN_TIME + sizeof(MsgScriptCmdCheckOnDay), // MSCRIPT_CMD_ID_CHECK_ON_DAY + sizeof(MsgScriptCmdCheckCallbackContinue), // MSCRIPT_CMD_ID_CHECK_CALLBACK_CONTINUE + sizeof(MsgScriptCmdCheckHasPowderKeg), // MSCRIPT_CMD_ID_CHECK_HAS_POWDER_KEG + sizeof(MsgScriptCmdDeleteItem), // MSCRIPT_CMD_ID_DELETE_ITEM + sizeof(MsgScriptCmdCheckCallbackMulti), // MSCRIPT_CMD_ID_CHECK_CALLBACK_MULTI + sizeof(MsgScriptCmdPlayerTalk), // MSCRIPT_CMD_ID_PLAYER_TALK + sizeof(MsgScriptCmdBombersNotebook), // MSCRIPT_CMD_ID_NOTEBOOK_EVENT + sizeof(MsgScriptCmdBase), // MSCRIPT_CMD_ID_AWAIT_TEXT_DONE + sizeof(MsgScriptCmdJump3), // MSCRIPT_CMD_ID_JUMP_3 + sizeof(MsgScriptCmdBase), // MSCRIPT_CMD_ID_PLAY_DECIDE + sizeof(MsgScriptCmdBase), // MSCRIPT_CMD_ID_PLAY_CANCEL + sizeof(MsgScriptCmdBase), // MSCRIPT_CMD_ID_PLAY_ERROR +}; + +/** + * Runs a message event script + * + * @param actor The actor associated with the cmd + * @param play Play game state + * @param script The script to run + * @param callback Callback function used by various commands for different purposes + * @param[in,out] pos Position to resume the cmd from, the point at which the cmd stops executing is also + * written out here + * @return s32 Whether the cmd has reached an endpoint + */ +s32 MsgEvent_RunScript(Actor* actor, PlayState* play, MsgScript* script, MsgScriptCallback callback, s32* pos) { + u8* start; + u8* cur; + s32 scriptDone = false; + s32 i; + s32 cmdLen; + u8 cmdId; + s32 stop; + + start = script; + script += *pos; + + if (sREG(95) != 0) {} + + cmdLen = 0; + do { + // Skip data from previous command + script += cmdLen; + + // Get command id + cmdId = *script; + + // Get command length + if (cmdId < ARRAY_COUNTU(sMsgScriptCmdSizes)) { + cmdLen = sMsgScriptCmdSizes[cmdId]; + } else { + cmdLen = -1; + //! @bug command handler still runs even if cmdId is invalid + } + + // Debug loop? + if (sREG(95) != 0) { + for (i = 0; i < cmdLen; i++) {} + } + + stop = sMsgScriptCmdHandlers[cmdId](actor, play, &script, callback, &scriptDone); + } while (!stop); + + cur = script; + if (!scriptDone) { + *pos = cur - start; + } else { + *pos = 0; + } + return scriptDone; +} diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index f08a1f4b57..d4ab778998 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -1383,7 +1383,7 @@ u8 Player_GetStrength(void) { return sPlayerStrengths[GET_PLAYER_FORM]; } -u8 Player_GetMask(PlayState* play) { +PlayerMask Player_GetMask(PlayState* play) { Player* player = GET_PLAYER(play); return player->currentMask; diff --git a/src/code/z_schedule.c b/src/code/z_schedule.c index 716111ff1f..243516c950 100644 --- a/src/code/z_schedule.c +++ b/src/code/z_schedule.c @@ -1,14 +1,8 @@ #include "global.h" -#define SCHEDULE_CALC_TIME(hour, minute, dest, temp) \ - (temp) = (hour)*60.0f; \ - (temp) += (minute); \ - (dest) = (temp) * (0x10000 / 60 / 24.0f); \ - (dest) = SCHEDULE_CONVERT_TIME(dest) - -s32 Schedule_CheckFlagS(PlayState* play, u8** script, ScheduleOutput* output) { - ScheduleCmdCheckFlagS* cmd = (ScheduleCmdCheckFlagS*)*script; - u16 flag = PACK_WEEKEVENTREG_FLAG(cmd->flagByte, cmd->flagMask); +s32 Schedule_CheckWeekEventRegS(PlayState* play, u8** script, ScheduleOutput* output) { + ScheduleCmdCheckWeekEventRegS* cmd = (ScheduleCmdCheckWeekEventRegS*)*script; + u16 flag = SCRIPT_PACK_16(cmd->flagByte, cmd->flagMask); if (CHECK_WEEKEVENTREG(flag)) { *script += cmd->offset; @@ -17,12 +11,12 @@ s32 Schedule_CheckFlagS(PlayState* play, u8** script, ScheduleOutput* output) { return false; } -s32 Schedule_CheckFlagL(PlayState* play, u8** script, ScheduleOutput* output) { - ScheduleCmdCheckFlagL* cmd = (ScheduleCmdCheckFlagL*)*script; - u16 flag = PACK_WEEKEVENTREG_FLAG(cmd->flagByte, cmd->flagMask); +s32 Schedule_CheckWeekEventRegL(PlayState* play, u8** script, ScheduleOutput* output) { + ScheduleCmdCheckWeekEventRegL* cmd = (ScheduleCmdCheckWeekEventRegL*)*script; + u16 flag = SCRIPT_PACK_16(cmd->flagByte, cmd->flagMask); if (CHECK_WEEKEVENTREG(flag)) { - *script += (s16)((cmd->offsetH << 8) | cmd->offsetL); + *script += (s16)SCRIPT_PACK_16(cmd->offsetH, cmd->offsetL); } return false; @@ -36,12 +30,12 @@ s32 Schedule_CheckTimeRangeS(PlayState* play, u8** script, ScheduleOutput* outpu u16 end; u16 now; - SCHEDULE_CALC_TIME(cmd->startHr, cmd->startMin, start, f); + SCRIPT_CALC_TIME(cmd->startHr, cmd->startMin, start, f); - SCHEDULE_CALC_TIME(cmd->endHr, cmd->endMin, end, f); + SCRIPT_CALC_TIME(cmd->endHr, cmd->endMin, end, f); end--; - now = SCHEDULE_TIME_NOW; + now = SCRIPT_TIME_NOW; if ((start <= now) && (now <= end)) { inRange = true; @@ -62,19 +56,19 @@ s32 Schedule_CheckTimeRangeL(PlayState* play, u8** script, ScheduleOutput* outpu u16 end; u16 now; - SCHEDULE_CALC_TIME(cmd->startHr, cmd->startMin, start, f); + SCRIPT_CALC_TIME(cmd->startHr, cmd->startMin, start, f); - SCHEDULE_CALC_TIME(cmd->endHr, cmd->endMin, end, f); + SCRIPT_CALC_TIME(cmd->endHr, cmd->endMin, end, f); end--; - now = SCHEDULE_TIME_NOW; + now = SCRIPT_TIME_NOW; if ((start <= now) && (now <= end)) { inRange = true; } if (inRange == true) { - *script += (s16)((cmd->offsetH << 8) | cmd->offsetL); + *script += (s16)SCRIPT_PACK_16(cmd->offsetH, cmd->offsetL); } return false; @@ -84,7 +78,7 @@ s32 Schedule_ReturnValueL(PlayState* play, u8** script, ScheduleOutput* output) ScheduleCmdReturnValueL* cmd = (ScheduleCmdReturnValueL*)*script; //! @bug result is a u8, value is truncated - output->result = (cmd->retH << 8) | cmd->retL; + output->result = SCRIPT_PACK_16(cmd->retH, cmd->retL); output->hasResult = true; return true; @@ -130,7 +124,7 @@ s32 Schedule_ReturnValueS(PlayState* play, u8** script, ScheduleOutput* output) s32 Schedule_CheckNotInSceneS(PlayState* play, u8** script, ScheduleOutput* output) { ScheduleCmdCheckNotInSceneS* cmd = (ScheduleCmdCheckNotInSceneS*)*script; - s16 sceneId = (cmd->sceneIdH << 8) | cmd->sceneIdL; + s16 sceneId = SCRIPT_PACK_16(cmd->sceneIdH, cmd->sceneIdL); if (sceneId != play->sceneId) { *script += cmd->offset; @@ -141,10 +135,10 @@ s32 Schedule_CheckNotInSceneS(PlayState* play, u8** script, ScheduleOutput* outp s32 Schedule_CheckNotInSceneL(PlayState* play, u8** script, ScheduleOutput* output) { ScheduleCmdCheckNotInSceneL* cmd = (ScheduleCmdCheckNotInSceneL*)*script; - s16 sceneId = (cmd->sceneIdH << 8) | cmd->sceneIdL; + s16 sceneId = SCRIPT_PACK_16(cmd->sceneIdH, cmd->sceneIdL); if (sceneId != play->sceneId) { - *script = *script + (s16)((cmd->offsetH << 8) | cmd->offsetL); + *script += (s16)SCRIPT_PACK_16(cmd->offsetH, cmd->offsetL); } return false; @@ -152,7 +146,7 @@ s32 Schedule_CheckNotInSceneL(PlayState* play, u8** script, ScheduleOutput* outp s32 Schedule_CheckNotInDayS(PlayState* play, u8** script, ScheduleOutput* output) { ScheduleCmdCheckNotInDayS* cmd = (ScheduleCmdCheckNotInDayS*)*script; - s16 day = (cmd->dayH << 8) | cmd->dayL; + s16 day = SCRIPT_PACK_16(cmd->dayH, cmd->dayL); if (day != (s16)gSaveContext.save.day) { *script += cmd->offset; @@ -163,10 +157,10 @@ s32 Schedule_CheckNotInDayS(PlayState* play, u8** script, ScheduleOutput* output s32 Schedule_CheckNotInDayL(PlayState* play, u8** script, ScheduleOutput* output) { ScheduleCmdCheckNotInDayL* cmd = (ScheduleCmdCheckNotInDayL*)*script; - s16 day = (cmd->dayH << 8) | cmd->dayL; + s16 day = SCRIPT_PACK_16(cmd->dayH, cmd->dayL); if (day != (s16)gSaveContext.save.day) { - *script += (s16)((cmd->offsetH << 8) | cmd->offsetL); + *script += (s16)SCRIPT_PACK_16(cmd->offsetH, cmd->offsetL); } return false; @@ -178,9 +172,9 @@ s32 Schedule_ReturnTime(PlayState* play, u8** script, ScheduleOutput* output) { u16 time0; u16 time1; - SCHEDULE_CALC_TIME(cmd->time0Hr, cmd->time0Min, time0, f); + SCRIPT_CALC_TIME(cmd->time0Hr, cmd->time0Min, time0, f); - SCHEDULE_CALC_TIME(cmd->time1Hr, cmd->time1Min, time1, f); + SCRIPT_CALC_TIME(cmd->time1Hr, cmd->time1Min, time1, f); time1--; output->result = cmd->result; @@ -197,9 +191,9 @@ s32 Schedule_CheckBeforeTimeS(PlayState* play, u8** script, ScheduleOutput* outp u16 testTime; u16 now; - SCHEDULE_CALC_TIME(cmd->timeHr, cmd->timeMin, testTime, f); + SCRIPT_CALC_TIME(cmd->timeHr, cmd->timeMin, testTime, f); - now = SCHEDULE_TIME_NOW; + now = SCRIPT_TIME_NOW; if (now < testTime) { *script += cmd->offset; @@ -214,12 +208,12 @@ s32 Schedule_CheckBeforeTimeL(PlayState* play, u8** script, ScheduleOutput* outp u16 testTime; u16 now; - SCHEDULE_CALC_TIME(cmd->timeHr, cmd->timeMin, testTime, f); + SCRIPT_CALC_TIME(cmd->timeHr, cmd->timeMin, testTime, f); - now = SCHEDULE_TIME_NOW; + now = SCRIPT_TIME_NOW; if (now < testTime) { - *script += (s16)((cmd->offsetH << 8) | cmd->offsetL); + *script += (s16)SCRIPT_PACK_16(cmd->offsetH, cmd->offsetL); } return false; @@ -235,54 +229,54 @@ s32 Schedule_BranchS(PlayState* play, u8** script, ScheduleOutput* output) { s32 Schedule_BranchL(PlayState* play, u8** script, ScheduleOutput* output) { ScheduleCmdBranchL* cmd = (ScheduleCmdBranchL*)*script; - *script += (s16)((cmd->offsetH << 8) | cmd->offsetL); + *script += (s16)SCRIPT_PACK_16(cmd->offsetH, cmd->offsetL); return false; } -typedef s32 (*ScheduleCmdFunc)(PlayState*, u8**, ScheduleOutput*); +typedef s32 (*ScheduleCmdHandler)(PlayState*, u8**, ScheduleOutput*); -static ScheduleCmdFunc sScheduleCmdFuncs[] = { - Schedule_CheckFlagS, // SCHEDULE_CMD_ID_CHECK_FLAG_S - Schedule_CheckFlagL, // SCHEDULE_CMD_ID_CHECK_FLAG_L - Schedule_CheckTimeRangeS, // SCHEDULE_CMD_ID_CHECK_TIME_RANGE_S - Schedule_CheckTimeRangeL, // SCHEDULE_CMD_ID_CHECK_TIME_RANGE_L - Schedule_ReturnValueL, // SCHEDULE_CMD_ID_RET_VAL_L - Schedule_ReturnNone, // SCHEDULE_CMD_ID_RET_NONE - Schedule_ReturnEmpty, // SCHEDULE_CMD_ID_RET_EMPTY - Schedule_Nop, // SCHEDULE_CMD_ID_NOP - Schedule_CheckMiscS, // SCHEDULE_CMD_ID_CHECK_MISC_S - Schedule_ReturnValueS, // SCHEDULE_CMD_ID_RET_VAL_S - Schedule_CheckNotInSceneS, // SCHEDULE_CMD_ID_CHECK_NOT_IN_SCENE_S - Schedule_CheckNotInSceneL, // SCHEDULE_CMD_ID_CHECK_NOT_IN_SCENE_L - Schedule_CheckNotInDayS, // SCHEDULE_CMD_ID_CHECK_NOT_IN_DAY_S - Schedule_CheckNotInDayL, // SCHEDULE_CMD_ID_CHECK_NOT_IN_DAY_L - Schedule_ReturnTime, // SCHEDULE_CMD_ID_RET_TIME - Schedule_CheckBeforeTimeS, // SCHEDULE_CMD_ID_CHECK_BEFORE_TIME_S - Schedule_CheckBeforeTimeL, // SCHEDULE_CMD_ID_CHECK_BEFORE_TIME_L - Schedule_BranchS, // SCHEDULE_CMD_ID_BRANCH_S - Schedule_BranchL, // SCHEDULE_CMD_ID_BRANCH_L +static ScheduleCmdHandler sScheduleCmdHandlers[] = { + Schedule_CheckWeekEventRegS, // SCHEDULE_CMD_ID_CHECK_WEEK_EVENT_REG_S + Schedule_CheckWeekEventRegL, // SCHEDULE_CMD_ID_CHECK_WEEK_EVENT_REG_L + Schedule_CheckTimeRangeS, // SCHEDULE_CMD_ID_CHECK_TIME_RANGE_S + Schedule_CheckTimeRangeL, // SCHEDULE_CMD_ID_CHECK_TIME_RANGE_L + Schedule_ReturnValueL, // SCHEDULE_CMD_ID_RET_VAL_L + Schedule_ReturnNone, // SCHEDULE_CMD_ID_RET_NONE + Schedule_ReturnEmpty, // SCHEDULE_CMD_ID_RET_EMPTY + Schedule_Nop, // SCHEDULE_CMD_ID_NOP + Schedule_CheckMiscS, // SCHEDULE_CMD_ID_CHECK_MISC_S + Schedule_ReturnValueS, // SCHEDULE_CMD_ID_RET_VAL_S + Schedule_CheckNotInSceneS, // SCHEDULE_CMD_ID_CHECK_NOT_IN_SCENE_S + Schedule_CheckNotInSceneL, // SCHEDULE_CMD_ID_CHECK_NOT_IN_SCENE_L + Schedule_CheckNotInDayS, // SCHEDULE_CMD_ID_CHECK_NOT_IN_DAY_S + Schedule_CheckNotInDayL, // SCHEDULE_CMD_ID_CHECK_NOT_IN_DAY_L + Schedule_ReturnTime, // SCHEDULE_CMD_ID_RET_TIME + Schedule_CheckBeforeTimeS, // SCHEDULE_CMD_ID_CHECK_BEFORE_TIME_S + Schedule_CheckBeforeTimeL, // SCHEDULE_CMD_ID_CHECK_BEFORE_TIME_L + Schedule_BranchS, // SCHEDULE_CMD_ID_BRANCH_S + Schedule_BranchL, // SCHEDULE_CMD_ID_BRANCH_L }; static u8 sScheduleCmdSizes[] = { - sizeof(ScheduleCmdCheckFlagS), // SCHEDULE_CMD_ID_CHECK_FLAG_S - sizeof(ScheduleCmdCheckFlagL), // SCHEDULE_CMD_ID_CHECK_FLAG_L - sizeof(ScheduleCmdCheckTimeRangeS), // SCHEDULE_CMD_ID_CHECK_TIME_RANGE_S - sizeof(ScheduleCmdCheckTimeRangeL), // SCHEDULE_CMD_ID_CHECK_TIME_RANGE_L - sizeof(ScheduleCmdReturnValueL), // SCHEDULE_CMD_ID_RET_VAL_L - sizeof(ScheduleCmdBase), // SCHEDULE_CMD_ID_RET_NONE - sizeof(ScheduleCmdBase), // SCHEDULE_CMD_ID_RET_EMPTY - sizeof(ScheduleCmdNop), // SCHEDULE_CMD_ID_NOP - sizeof(ScheduleCmdCheckMiscS), // SCHEDULE_CMD_ID_CHECK_MISC_S - sizeof(ScheduleCmdReturnValueS), // SCHEDULE_CMD_ID_RET_VAL_S - sizeof(ScheduleCmdCheckNotInSceneS), // SCHEDULE_CMD_ID_CHECK_NOT_IN_SCENE_S - sizeof(ScheduleCmdCheckNotInSceneL), // SCHEDULE_CMD_ID_CHECK_NOT_IN_SCENE_L - sizeof(ScheduleCmdCheckNotInDayS), // SCHEDULE_CMD_ID_CHECK_NOT_IN_DAY_S - sizeof(ScheduleCmdCheckNotInDayL), // SCHEDULE_CMD_ID_CHECK_NOT_IN_DAY_L - sizeof(ScheduleCmdReturnTime), // SCHEDULE_CMD_ID_RET_TIME - sizeof(ScheduleCmdCheckBeforeTimeS), // SCHEDULE_CMD_ID_CHECK_BEFORE_TIME_S - sizeof(ScheduleCmdCheckBeforeTimeL), // SCHEDULE_CMD_ID_CHECK_BEFORE_TIME_L - sizeof(ScheduleCmdBranchS), // SCHEDULE_CMD_ID_BRANCH_S - sizeof(ScheduleCmdBranchL), // SCHEDULE_CMD_ID_BRANCH_L + sizeof(ScheduleCmdCheckWeekEventRegS), // SCHEDULE_CMD_ID_CHECK_WEEK_EVENT_REG_S + sizeof(ScheduleCmdCheckWeekEventRegL), // SCHEDULE_CMD_ID_CHECK_WEEK_EVENT_REG_L + sizeof(ScheduleCmdCheckTimeRangeS), // SCHEDULE_CMD_ID_CHECK_TIME_RANGE_S + sizeof(ScheduleCmdCheckTimeRangeL), // SCHEDULE_CMD_ID_CHECK_TIME_RANGE_L + sizeof(ScheduleCmdReturnValueL), // SCHEDULE_CMD_ID_RET_VAL_L + sizeof(ScheduleCmdBase), // SCHEDULE_CMD_ID_RET_NONE + sizeof(ScheduleCmdBase), // SCHEDULE_CMD_ID_RET_EMPTY + sizeof(ScheduleCmdNop), // SCHEDULE_CMD_ID_NOP + sizeof(ScheduleCmdCheckMiscS), // SCHEDULE_CMD_ID_CHECK_MISC_S + sizeof(ScheduleCmdReturnValueS), // SCHEDULE_CMD_ID_RET_VAL_S + sizeof(ScheduleCmdCheckNotInSceneS), // SCHEDULE_CMD_ID_CHECK_NOT_IN_SCENE_S + sizeof(ScheduleCmdCheckNotInSceneL), // SCHEDULE_CMD_ID_CHECK_NOT_IN_SCENE_L + sizeof(ScheduleCmdCheckNotInDayS), // SCHEDULE_CMD_ID_CHECK_NOT_IN_DAY_S + sizeof(ScheduleCmdCheckNotInDayL), // SCHEDULE_CMD_ID_CHECK_NOT_IN_DAY_L + sizeof(ScheduleCmdReturnTime), // SCHEDULE_CMD_ID_RET_TIME + sizeof(ScheduleCmdCheckBeforeTimeS), // SCHEDULE_CMD_ID_CHECK_BEFORE_TIME_S + sizeof(ScheduleCmdCheckBeforeTimeL), // SCHEDULE_CMD_ID_CHECK_BEFORE_TIME_L + sizeof(ScheduleCmdBranchS), // SCHEDULE_CMD_ID_BRANCH_S + sizeof(ScheduleCmdBranchL), // SCHEDULE_CMD_ID_BRANCH_L }; s32 Schedule_RunScript(PlayState* play, ScheduleScript* script, ScheduleOutput* output) { @@ -291,7 +285,7 @@ s32 Schedule_RunScript(PlayState* play, ScheduleScript* script, ScheduleOutput* do { size = sScheduleCmdSizes[*script]; - stop = sScheduleCmdFuncs[*script](play, &script, output); + stop = sScheduleCmdHandlers[*script](play, &script, output); script += size; } while (!stop); diff --git a/src/overlays/actors/ovl_Boss_03/z_boss_03.c b/src/overlays/actors/ovl_Boss_03/z_boss_03.c index 0d79182ba4..3c3f1d2072 100644 --- a/src/overlays/actors/ovl_Boss_03/z_boss_03.c +++ b/src/overlays/actors/ovl_Boss_03/z_boss_03.c @@ -49,6 +49,7 @@ * - Seaweed */ +#include "prevent_bss_reordering.h" #include "z_boss_03.h" #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" #include "overlays/actors/ovl_En_Water_Effect/z_en_water_effect.h" diff --git a/src/overlays/actors/ovl_Dm_Tag/z_dm_tag.c b/src/overlays/actors/ovl_Dm_Tag/z_dm_tag.c index 24c03bb1ee..6b07d8856a 100644 --- a/src/overlays/actors/ovl_Dm_Tag/z_dm_tag.c +++ b/src/overlays/actors/ovl_Dm_Tag/z_dm_tag.c @@ -30,20 +30,43 @@ ActorInit Dm_Tag_InitVars = { /**/ NULL, }; -s32 D_80C22BF0[] = { - 0x0E28F00C, - 0x15090000, - 0x10000000, +MsgScript D_80C22BF0[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28F0), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x01 */ MSCRIPT_CMD_PAUSE(), + /* 0x0005 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0008 0x01 */ MSCRIPT_CMD_DONE(), }; -s32 D_80C22BFC[] = { - 0x0900000E, 0x28F10C09, 0x00000E28, 0xF20C0900, 0x000E28F3, 0x0C090000, 0x0E28F40C, - 0x0900000E, 0x28F50C09, 0x00000E28, 0xF60C1511, 0x55040900, 0x00100000, +MsgScript D_80C22BFC[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0003 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28F1), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x000A 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28F2), + /* 0x000D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000E 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0011 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28F3), + /* 0x0014 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0015 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0018 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28F4), + /* 0x001B 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001C 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x001F 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28F5), + /* 0x0022 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0023 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0026 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28F6), + /* 0x0029 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x002A 0x01 */ MSCRIPT_CMD_PAUSE(), + /* 0x002B 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_85_04), + /* 0x002E 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0031 0x01 */ MSCRIPT_CMD_DONE(), }; -s32 D_80C22C30[] = { - 0x0E28EF0C, - 0x10000000, +MsgScript D_80C22C30[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28EF), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x01 */ MSCRIPT_CMD_DONE(), }; Actor* DmTag_FindActor(DmTag* this, PlayState* play, u8 actorCategory, s16 actorId) { @@ -95,8 +118,8 @@ s16 func_80C2247C(DmTag* this, s32 numCutscenes) { return csId; } -s32 func_80C224D8(DmTag* this, PlayState* play) { - s32 pad; +s32 func_80C224D8(Actor* thisx, PlayState* play) { + DmTag* this = THIS; Actor* sp30; Actor* sp2C; s16 csId = this->actor.csId; @@ -173,7 +196,9 @@ s32 func_80C224D8(DmTag* this, PlayState* play) { return ret; } -s32 func_80C227E8(DmTag* this, PlayState* play) { +s32 func_80C227E8(Actor* thisx, PlayState* play) { + DmTag* this = THIS; + if (this->unk_1A4 == 0) { Player_SetCsActionWithHaltedActors(play, &this->actor, PLAYER_CSACTION_WAIT); play->nextEntrance = ENTRANCE(STOCK_POT_INN, 4); @@ -186,22 +211,22 @@ s32 func_80C227E8(DmTag* this, PlayState* play) { return false; } -s32* func_80C22880(DmTag* this, PlayState* play) { +MsgScript* DmTag_GetMsgScript(DmTag* this, PlayState* play) { s32 time; switch (this->unk_18E) { case 1: - time = SCHEDULE_TIME_NOW; - if ((time >= SCHEDULE_TIME(21, 30)) && (time < SCHEDULE_TIME(23, 0))) { + time = SCRIPT_TIME_NOW; + if ((time >= SCRIPT_TIME(21, 30)) && (time < SCRIPT_TIME(23, 0))) { if (gSaveContext.save.day == 2) { - this->msgEventCallback = func_80C227E8; + this->msgScriptCallback = func_80C227E8; return D_80C22BF0; } } return D_80C22C30; case 2: - this->msgEventCallback = func_80C224D8; + this->msgScriptCallback = func_80C224D8; return D_80C22BFC; default: @@ -218,7 +243,7 @@ s32 func_80C2291C(DmTag* this, PlayState* play) { Actor_TalkOfferAccepted(&this->actor, &play->state)) { this->unk_18C |= 8; SubS_SetOfferMode(&this->unk_18C, SUBS_OFFER_MODE_NONE, SUBS_OFFER_MODE_MASK); - this->msgEventScript = func_80C22880(this, play); + this->msgScript = DmTag_GetMsgScript(this, play); this->actionFunc = func_80C229FC; ret = true; } @@ -234,7 +259,7 @@ void DmTag_DoNothing(DmTag* this, PlayState* play) { } void func_80C229FC(DmTag* this, PlayState* play) { - if (func_8010BF58(&this->actor, play, this->msgEventScript, this->msgEventCallback, &this->msgEventArg4)) { + if (MsgEvent_RunScript(&this->actor, play, this->msgScript, this->msgScriptCallback, &this->msgScriptPos)) { this->actionFunc = func_80C229AC; } } diff --git a/src/overlays/actors/ovl_Dm_Tag/z_dm_tag.h b/src/overlays/actors/ovl_Dm_Tag/z_dm_tag.h index eec741df6d..1f4dff95c2 100644 --- a/src/overlays/actors/ovl_Dm_Tag/z_dm_tag.h +++ b/src/overlays/actors/ovl_Dm_Tag/z_dm_tag.h @@ -6,7 +6,6 @@ struct DmTag; typedef void (*DmTagActionFunc)(struct DmTag*, PlayState*); -typedef s32 (*DmTagMsgEventFunc)(struct DmTag*, PlayState*); typedef struct DmTag { /* 0x000 */ Actor actor; @@ -14,11 +13,11 @@ typedef struct DmTag { /* 0x188 */ DmTagActionFunc actionFunc; /* 0x18C */ u16 unk_18C; /* 0x18E */ u8 unk_18E; - /* 0x190 */ s32* msgEventScript; - /* 0x194 */ s32 msgEventArg4; + /* 0x190 */ MsgScript* msgScript; + /* 0x194 */ s32 msgScriptPos; /* 0x198 */ UNK_TYPE1 pad198[0xC]; /* 0x1A4 */ s16 unk_1A4; - /* 0x1A8 */ DmTagMsgEventFunc msgEventCallback; + /* 0x1A8 */ MsgScriptCallback msgScriptCallback; } DmTag; // size = 0x1AC #endif // Z_DM_TAG_H diff --git a/src/overlays/actors/ovl_En_Ah/z_en_ah.c b/src/overlays/actors/ovl_En_Ah/z_en_ah.c index 52fc5d2e46..6a73f3ff8a 100644 --- a/src/overlays/actors/ovl_En_Ah/z_en_ah.c +++ b/src/overlays/actors/ovl_En_Ah/z_en_ah.c @@ -20,13 +20,36 @@ void func_80BD3768(EnAh* this, PlayState* play); #include "src/overlays/actors/ovl_En_Ah/scheduleScripts.schl.inc" -s32 D_80BD3DE8[] = { 0x0E28FF0C, 0x10000000 }; +MsgScript D_80BD3DE8[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28FF), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x01 */ MSCRIPT_CMD_DONE(), +}; -s32 D_80BD3DF0[] = { 0x0E29000C, 0x10000000 }; +MsgScript D_80BD3DF0[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2900), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x01 */ MSCRIPT_CMD_DONE(), +}; -s32 D_80BD3DF8[] = { 0x00330100, 0x050E28FE, 0x0C100E28, -0x03F3F000 }; +MsgScript D_80BD3DF8[] = { + /* 0x0000 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_DELIVERED_PENDANT_OF_MEMORIES, 0x000A - 0x0005), + /* 0x0005 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28FE), + /* 0x0008 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0009 0x01 */ MSCRIPT_CMD_DONE(), -s32 D_80BD3E08[] = { 0x0E28FD0C, 0x0F29540C, 0x10000000 }; + /* 0x000A 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28FC), + /* 0x000D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000E 0x01 */ MSCRIPT_CMD_DONE(), +}; + +MsgScript D_80BD3E08[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28FD), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2954), + /* 0x0007 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0008 0x01 */ MSCRIPT_CMD_DONE(), +}; ActorInit En_Ah_InitVars = { /**/ ACTOR_EN_AH, @@ -346,10 +369,8 @@ s32 func_80BD3198(EnAh* this, PlayState* play) { return false; } -s32* func_80BD3294(EnAh* this, PlayState* play) { - s32 mask = Player_GetMask(play); - - if (PLAYER_MASK_KAFEIS_MASK == mask) { +MsgScript* EnAh_GetMsgScript(EnAh* this, PlayState* play) { + if (Player_GetMask(play) == PLAYER_MASK_KAFEIS_MASK) { return D_80BD3E08; } @@ -497,12 +518,12 @@ void func_80BD3768(EnAh* this, PlayState* play) { Vec3f sp40; Vec3f sp34; - if (func_8010BF58(&this->actor, play, func_80BD3294(this, play), NULL, &this->unk_1E0)) { + if (MsgEvent_RunScript(&this->actor, play, EnAh_GetMsgScript(this, play), NULL, &this->msgScriptPos)) { SubS_SetOfferMode(&this->unk_2D8, SUBS_OFFER_MODE_ONSCREEN, SUBS_OFFER_MODE_MASK); this->unk_2D8 &= ~8; this->unk_2D8 |= 0x80; this->unk_2F4 = 20; - this->unk_1E0 = 0; + this->msgScriptPos = 0; this->actionFunc = func_80BD36B8; } else if (this->unk_1DC != 2) { if (this->unk_1E4 != NULL) { diff --git a/src/overlays/actors/ovl_En_Ah/z_en_ah.h b/src/overlays/actors/ovl_En_Ah/z_en_ah.h index d03e01199e..4f0b6d3524 100644 --- a/src/overlays/actors/ovl_En_Ah/z_en_ah.h +++ b/src/overlays/actors/ovl_En_Ah/z_en_ah.h @@ -16,7 +16,7 @@ typedef struct EnAh { /* 0x18C */ EnAhUnkFunc unk_18C; /* 0x190 */ ColliderCylinder collider; /* 0x1DC */ u8 unk_1DC; - /* 0x1E0 */ s32 unk_1E0; + /* 0x1E0 */ s32 msgScriptPos; /* 0x1E4 */ Actor* unk_1E4; /* 0x1E8 */ Vec3f unk_1E8[2]; /* 0x200 */ Vec3s unk_200[2]; diff --git a/src/overlays/actors/ovl_En_Al/z_en_al.c b/src/overlays/actors/ovl_En_Al/z_en_al.c index 5418ad15a1..8e9cec7618 100644 --- a/src/overlays/actors/ovl_En_Al/z_en_al.c +++ b/src/overlays/actors/ovl_En_Al/z_en_al.c @@ -19,52 +19,360 @@ void func_80BDF6C4(EnAl* this, PlayState* play); #include "src/overlays/actors/ovl_En_Al/scheduleScripts.schl.inc" -s32 D_80BDFCBC[] = { - 0x09000017, 0x0E27A50C, 0x09000018, 0x0E27A60C, 0x09000017, 0x0E27A70C, 0x09000018, 0x0E27A80C, - 0x09000017, 0x0E27A90C, 0x09000018, 0x0E27AA0C, 0x09000017, 0x0E27AB0C, 0x09000018, 0x0E27AC0C, - 0x09000017, 0x0E27AD2D, 0x000B2D00, 0x080C1159, 0x08090000, 0x10000000, +MsgScript D_80BDFCBC[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0003 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0004 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x27A5), + /* 0x0007 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0008 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x000B 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x000C 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x27A6), + /* 0x000F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0010 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0013 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0014 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x27A7), + /* 0x0017 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0018 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x001B 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x001C 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x27A8), + /* 0x001F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0020 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0023 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0024 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x27A9), + /* 0x0027 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0028 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x002B 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x002C 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x27AA), + /* 0x002F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0030 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0033 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0034 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x27AB), + /* 0x0037 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0038 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x003B 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x003C 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x27AC), + /* 0x003F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0040 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0043 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0044 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x27AD), + /* 0x0047 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_POSTMAN), + /* 0x004A 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_MADAME_AROMA), + /* 0x004D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x004E 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_89_08), + /* 0x0051 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0054 0x01 */ MSCRIPT_CMD_DONE(), }; -s32 D_80BDFD14[] = { - 0x00562000, 0xA2090000, 0x170E2AA6, 0x0C090000, 0x180E2AA7, 0x0C090000, 0x170E2AA8, 0x0C090000, - 0x180E2AA9, 0x0C090000, 0x170E2AAA, 0x0C090000, 0x180E2AAB, 0x0C090000, 0x170E2AAC, 0x0C090000, - 0x170E2AAD, 0x0C0F2AAE, 0x0C090000, 0x180E2AAF, 0x0C090000, 0x170E2AB0, 0x0C090000, 0x170E2AB1, - 0x0C090000, 0x180E2AB2, 0x0C090000, 0x170E2AB3, 0x0C090000, 0x180E2AB4, 0x0C090000, 0x170E2AB5, - 0x0C090000, 0x180E2AB6, 0x0C090000, 0x170E2AB7, 0x0C090000, 0x180E2AB8, 0x2D00082D, 0x00092D00, - 0x0A0C1156, 0x20121009, 0x0000170E, 0x2AEA0C09, 0x0000180E, 0x2AEB0C09, 0x00001210, +MsgScript D_80BDFD14[] = { + /* 0x0000 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_86_20, 0x00A7 - 0x0005), + /* 0x0005 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0008 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0009 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AA6), + /* 0x000C 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000D 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0010 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x0011 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AA7), + /* 0x0014 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0015 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0018 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0019 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AA8), + /* 0x001C 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001D 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0020 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x0021 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AA9), + /* 0x0024 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0025 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0028 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0029 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AAA), + /* 0x002C 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x002D 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0030 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x0031 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AAB), + /* 0x0034 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0035 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0038 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0039 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AAC), + /* 0x003C 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x003D 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0040 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0041 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AAD), + /* 0x0044 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0045 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2AAE), + /* 0x0048 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0049 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x004C 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x004D 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AAF), + /* 0x0050 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0051 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0054 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0055 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AB0), + /* 0x0058 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0059 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x005C 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x005D 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AB1), + /* 0x0060 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0061 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0064 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x0065 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AB2), + /* 0x0068 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0069 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x006C 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x006D 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AB3), + /* 0x0070 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0071 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0074 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x0075 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AB4), + /* 0x0078 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0079 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x007C 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x007D 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AB5), + /* 0x0080 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0081 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0084 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x0085 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AB6), + /* 0x0088 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0089 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x008C 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x008D 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AB7), + /* 0x0090 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0091 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0094 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x0095 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AB8), + /* 0x0098 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_MADAME_AROMA), + /* 0x009B 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_TOTO), + /* 0x009E 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_GORMAN), + /* 0x00A1 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00A2 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_86_20), + /* 0x00A5 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x00A6 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x00A7 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x00AA 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x00AB 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AEA), + /* 0x00AE 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00AF 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x00B2 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x00B3 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AEB), + /* 0x00B6 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00B7 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x00BA 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x00BB 0x01 */ MSCRIPT_CMD_DONE(), }; -s32 D_80BDFDD0[] = { 0x005C0800, 0x0B0E2AE5, 0x2D000811, 0x5C080C10, 0x0E2AE62D, 0x00080C10 }; +MsgScript D_80BDFDD0[] = { + /* 0x0000 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_92_08, 0x0010 - 0x0005), + /* 0x0005 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AE5), + /* 0x0008 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_MADAME_AROMA), + /* 0x000B 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_92_08), + /* 0x000E 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000F 0x01 */ MSCRIPT_CMD_DONE(), -s32 D_80BDFDE8[] = { 0x0900000E, 0x2B192D00, 0x080C1509, 0x00001210 }; - -s32 D_80BDFDF8[] = { - 0x09000000, 0x39040071, 0x0E2B1A0C, 0x0F00FF1E, 0x00330018, 0x000D0000, 0x0E2B1B2D, 0x00080C15, 0x09000012, - 0x102C2B1C, 0x0C2F0000, 0x0C19FFDC, 0x2C2B1D0C, 0x2F00000C, 0x0F2B1E0C, 0x0F2B1F0C, 0x122A002E, 0x00390800, - 0x1306006F, 0x00001300, 0x6F2F0000, 0x2E2D0023, 0x0C07000C, 0x06000500, 0x00130005, 0x0C070000, 0x0E2B202D, - 0x00080C16, 0x11390411, 0x390819FF, 0xA60E2B3C, 0x2D00080C, 0x19FF9C00, + /* 0x0010 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AE6), + /* 0x0013 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_MADAME_AROMA), + /* 0x0016 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0017 0x01 */ MSCRIPT_CMD_DONE(), }; -s32 D_80BDFE7C[] = { 0x0E2A9C2D, 0x00080C10 }; - -s32 D_80BDFE84[] = { 0x0E2A9D2D, 0x00080C10 }; - -s32 D_80BDFE8C[] = { - 0x00390200, 0x0F0E2A9E, 0x0C0F2A9F, 0x0C0F2AA0, 0x0C190004, 0x0E2AA00C, 0x05000000, 0x1A001A30, 0x0E2AA20C, - 0x1206008F, 0x00001300, 0x8F2F0000, 0x2E2D002C, 0x2D00080C, 0x10310E2A, 0xA12D0008, 0x0C113902, 0x10000000, +MsgScript D_80BDFDE8[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0003 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2B19), + /* 0x0006 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_MADAME_AROMA), + /* 0x0009 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000A 0x01 */ MSCRIPT_CMD_PAUSE(), + /* 0x000B 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x000E 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x000F 0x01 */ MSCRIPT_CMD_DONE(), }; -s32 D_80BDFED4[] = { - 0x0900002C, 0x2B1D0C2F, 0x00000C0F, 0x2B1E0C0F, 0x2B1F0C12, 0x2A002E00, 0x39080013, - 0x06006F00, 0x0013006F, 0x2F00002E, 0x2D00230C, 0x07000C06, 0x00050000, 0x1300050C, - 0x0700000E, 0x2B202D00, 0x080C1611, 0x39041139, 0x08150900, 0x00121000, +MsgScript D_80BDFDF8[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0003 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_57_04, 0x0079 - 0x0008), + /* 0x0008 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2B1A), + /* 0x000B 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000C 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x00FF), + /* 0x000F 0x09 */ MSCRIPT_CMD_CHECK_ITEM_ACTION(PLAYER_IA_LETTER_MAMA, 0x0030 - 0x0018, 0x0025 - 0x0018, 0x0), + /* 0x0018 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2B1B), + /* 0x001B 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_MADAME_AROMA), + /* 0x001E 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001F 0x01 */ MSCRIPT_CMD_PAUSE(), + /* 0x0020 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0023 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0024 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0025 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x2B1C), + /* 0x0028 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0029 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x002C 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x002D 0x03 */ MSCRIPT_CMD_JUMP(0x000C - 0x0030), + + /* 0x0030 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x2B1D), + /* 0x0033 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0034 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x0037 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0038 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2B1E), + /* 0x003B 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x003C 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2B1F), + /* 0x003F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0040 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0041 0x03 */ MSCRIPT_CMD_DELETE_ITEM(ITEM_LETTER_MAMA), + /* 0x0044 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_57_08, 0x005C - 0x0049), + /* 0x0049 0x05 */ MSCRIPT_CMD_OFFER_ITEM(GI_CHATEAU_BOTTLE, 0x0), + /* 0x004E 0x03 */ MSCRIPT_CMD_SET_COLLECTIBLE(0x006F), + /* 0x0051 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x0054 0x01 */ MSCRIPT_CMD_AWAIT_TEXT_DONE(), + /* 0x0055 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_DELIVERED_PRIORITY_MAIL), + /* 0x0058 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0059 0x03 */ MSCRIPT_CMD_AUTOTALK(0x0068 - 0x005C), + /* 0x005C 0x05 */ MSCRIPT_CMD_OFFER_ITEM(GI_RUPEE_PURPLE, 0x0), + /* 0x0061 0x03 */ MSCRIPT_CMD_SET_COLLECTIBLE(0x0005), + /* 0x0064 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0065 0x03 */ MSCRIPT_CMD_AUTOTALK(0x0), + /* 0x0068 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2B20), + /* 0x006B 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_MADAME_AROMA), + /* 0x006E 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x006F 0x01 */ MSCRIPT_CMD_UNSET_AUTOTALK(), + /* 0x0070 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_57_04), + /* 0x0073 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_57_08), + /* 0x0076 0x03 */ MSCRIPT_CMD_JUMP(0x001F - 0x0079), + + /* 0x0079 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2B3C), + /* 0x007C 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_MADAME_AROMA), + /* 0x007F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0080 0x03 */ MSCRIPT_CMD_JUMP(0x001F - 0x0083), }; -s32 D_80BDFF24[] = { - 0x0900002C, 0x2B1C0C0F, 0x00FF1E00, 0x33000DFF, 0xF000000E, 0x2B1B2D00, 0x080C1509, 0x00001210, - 0x2C2B1D0C, 0x2F00000C, 0x0F2B1E0C, 0x0F2B1F0C, 0x122A002E, 0x00390800, 0x1306006F, 0x00001300, - 0x6F2F0000, 0x2E2D0023, 0x0C07000C, 0x06000500, 0x00130005, 0x0C070000, 0x0E2B202D, 0x00080C16, - 0x11390411, 0x390819FF, 0xB10E2B3C, 0x2D00080C, 0x19FFA700, +MsgScript D_80BDFE7C[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2A9C), + /* 0x0003 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_MADAME_AROMA), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x01 */ MSCRIPT_CMD_DONE(), +}; + +MsgScript D_80BDFE84[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2A9D), + /* 0x0003 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_MADAME_AROMA), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x01 */ MSCRIPT_CMD_DONE(), +}; + +MsgScript D_80BDFE8C[] = { + /* 0x0000 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_57_02, 0x0014 - 0x0005), + /* 0x0005 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2A9E), + /* 0x0008 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0009 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2A9F), + /* 0x000C 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000D 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2AA0), + /* 0x0010 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0011 0x03 */ MSCRIPT_CMD_JUMP(0x0018 - 0x0014), + /* 0x0014 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AA0), + /* 0x0017 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0018 0x07 */ MSCRIPT_CMD_CHECK_TEXT_CHOICE(0x0, 0x0039 - 0x001F, 0x0039 - 0x001F), + /* 0x001F 0x01 */ MSCRIPT_CMD_PLAY_DECIDE(), + /* 0x0020 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AA2), + /* 0x0023 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0024 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0025 0x05 */ MSCRIPT_CMD_OFFER_ITEM(GI_MASK_KAFEIS_MASK, 0x0), + /* 0x002A 0x03 */ MSCRIPT_CMD_SET_COLLECTIBLE(0x008F), + /* 0x002D 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x0030 0x01 */ MSCRIPT_CMD_AWAIT_TEXT_DONE(), + /* 0x0031 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_RECEIVED_KAFEIS_MASK), + /* 0x0034 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_MADAME_AROMA), + /* 0x0037 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0038 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0039 0x01 */ MSCRIPT_CMD_PLAY_CANCEL(), + /* 0x003A 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AA1), + /* 0x003D 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_MADAME_AROMA), + /* 0x0040 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0041 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_57_02), + /* 0x0044 0x01 */ MSCRIPT_CMD_DONE(), +}; + +MsgScript D_80BDFED4[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0003 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x2B1D), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x000A 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000B 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2B1E), + /* 0x000E 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000F 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2B1F), + /* 0x0012 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0013 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0014 0x03 */ MSCRIPT_CMD_DELETE_ITEM(ITEM_LETTER_MAMA), + /* 0x0017 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_57_08, 0x002F - 0x001C), + /* 0x001C 0x05 */ MSCRIPT_CMD_OFFER_ITEM(GI_CHATEAU_BOTTLE, 0x0), + /* 0x0021 0x03 */ MSCRIPT_CMD_SET_COLLECTIBLE(0x006F), + /* 0x0024 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x0027 0x01 */ MSCRIPT_CMD_AWAIT_TEXT_DONE(), + /* 0x0028 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_DELIVERED_PRIORITY_MAIL), + /* 0x002B 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x002C 0x03 */ MSCRIPT_CMD_AUTOTALK(0x003B - 0x002F), + /* 0x002F 0x05 */ MSCRIPT_CMD_OFFER_ITEM(GI_RUPEE_PURPLE, 0x0), + /* 0x0034 0x03 */ MSCRIPT_CMD_SET_COLLECTIBLE(0x0005), + /* 0x0037 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0038 0x03 */ MSCRIPT_CMD_AUTOTALK(0x0), + /* 0x003B 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2B20), + /* 0x003E 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_MADAME_AROMA), + /* 0x0041 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0042 0x01 */ MSCRIPT_CMD_UNSET_AUTOTALK(), + /* 0x0043 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_57_04), + /* 0x0046 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_57_08), + /* 0x0049 0x01 */ MSCRIPT_CMD_PAUSE(), + /* 0x004A 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x004D 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x004E 0x01 */ MSCRIPT_CMD_DONE(), +}; + +MsgScript D_80BDFF24[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0003 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x2B1C), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x00FF), + /* 0x000A 0x09 */ MSCRIPT_CMD_CHECK_ITEM_ACTION(PLAYER_IA_LETTER_MAMA, 0x0020 - 0x0013, 0x0003 - 0x0013, 0x0), + /* 0x0013 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2B1B), + /* 0x0016 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_MADAME_AROMA), + /* 0x0019 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001A 0x01 */ MSCRIPT_CMD_PAUSE(), + /* 0x001B 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x001E 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x001F 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0020 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x2B1D), + /* 0x0023 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0024 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x0027 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0028 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2B1E), + /* 0x002B 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x002C 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2B1F), + /* 0x002F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0030 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0031 0x03 */ MSCRIPT_CMD_DELETE_ITEM(ITEM_LETTER_MAMA), + /* 0x0034 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_57_08, 0x004C - 0x0039), + /* 0x0039 0x05 */ MSCRIPT_CMD_OFFER_ITEM(GI_CHATEAU_BOTTLE, 0x0), + /* 0x003E 0x03 */ MSCRIPT_CMD_SET_COLLECTIBLE(0x006F), + /* 0x0041 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x0044 0x01 */ MSCRIPT_CMD_AWAIT_TEXT_DONE(), + /* 0x0045 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_DELIVERED_PRIORITY_MAIL), + /* 0x0048 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0049 0x03 */ MSCRIPT_CMD_AUTOTALK(0x0058 - 0x004C), + /* 0x004C 0x05 */ MSCRIPT_CMD_OFFER_ITEM(GI_RUPEE_PURPLE, 0x0), + /* 0x0051 0x03 */ MSCRIPT_CMD_SET_COLLECTIBLE(0x0005), + /* 0x0054 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0055 0x03 */ MSCRIPT_CMD_AUTOTALK(0x0), + /* 0x0058 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2B20), + /* 0x005B 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_MADAME_AROMA), + /* 0x005E 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x005F 0x01 */ MSCRIPT_CMD_UNSET_AUTOTALK(), + /* 0x0060 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_57_04), + /* 0x0063 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_57_08), + /* 0x0066 0x03 */ MSCRIPT_CMD_JUMP(0x001A - 0x0069), + + // Unreachable + /* 0x0069 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2B3C), + /* 0x006C 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_MADAME_AROMA), + /* 0x006F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0070 0x03 */ MSCRIPT_CMD_JUMP(0x001A - 0x0073), }; ActorInit En_Al_InitVars = { @@ -312,8 +620,8 @@ s32 func_80BDE678(EnAl* this, s16* arg1, s16 arg2) { return ret; } -s32 func_80BDE7FC(EnAl* this, PlayState* play) { - s32 pad; +s32 func_80BDE7FC(Actor* thisx, PlayState* play) { + EnAl* this = THIS; s16 csId = func_80BDE484(this, 0); s32 pad2; s32 sp20 = false; @@ -357,8 +665,9 @@ s32 func_80BDE7FC(EnAl* this, PlayState* play) { return sp20; } -s32 func_80BDE92C(EnAl* this, PlayState* play) { - s32 pad[2]; +s32 func_80BDE92C(Actor* thisx, PlayState* play) { + s32 pad; + EnAl* this = THIS; Actor* sp1C = EnAl_FindActor(this, play, ACTORCAT_NPC, ACTOR_EN_GM); Actor* temp_v0 = EnAl_FindActor(this, play, ACTORCAT_NPC, ACTOR_EN_TOTO); @@ -404,8 +713,8 @@ s32 func_80BDE92C(EnAl* this, PlayState* play) { return true; } -s32 func_80BDEA14(EnAl* this, PlayState* play) { - s32 pad; +s32 func_80BDEA14(Actor* thisx, PlayState* play) { + EnAl* this = THIS; s32 sp18 = false; switch (this->unk_4E6) { @@ -431,11 +740,11 @@ s32 func_80BDEA14(EnAl* this, PlayState* play) { return sp18; } -s32* func_80BDEABC(EnAl* this, PlayState* play) { +MsgScript* EnAl_GetMsgScript(EnAl* this, PlayState* play) { Player* player = GET_PLAYER(play); if (this->unk_35C == 3) { - this->unk_4EC = func_80BDE92C; + this->msgScriptCallback = func_80BDE92C; return D_80BDFD14; } @@ -456,11 +765,11 @@ s32* func_80BDEABC(EnAl* this, PlayState* play) { case 2: if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_89_08) && CHECK_WEEKEVENTREG(WEEKEVENTREG_85_80)) { - this->unk_4EC = func_80BDE7FC; + this->msgScriptCallback = func_80BDE7FC; return D_80BDFCBC; } - this->unk_4EC = func_80BDEA14; + this->msgScriptCallback = func_80BDEA14; if (Player_GetMask(play) != PLAYER_MASK_KAFEIS_MASK) { return D_80BDFDE8; } @@ -495,9 +804,9 @@ s32 func_80BDEC2C(EnAl* this, PlayState* play) { } SubS_SetOfferMode(&this->unk_4C2, SUBS_OFFER_MODE_NONE, SUBS_OFFER_MODE_MASK); this->unk_4E6 = 0; - this->unk_4EC = 0; + this->msgScriptCallback = NULL; this->actor.child = this->unk_368; - this->unk_360 = func_80BDEABC(this, play); + this->msgScript = EnAl_GetMsgScript(this, play); this->unk_4C2 |= 0x20; this->actionFunc = func_80BDF6C4; ret = true; @@ -780,13 +1089,13 @@ void func_80BDF5E8(EnAl* this, PlayState* play) { } void func_80BDF6C4(EnAl* this, PlayState* play) { - if (func_8010BF58(&this->actor, play, this->unk_360, this->unk_4EC, &this->unk_364)) { + if (MsgEvent_RunScript(&this->actor, play, this->msgScript, this->msgScriptCallback, &this->msgScriptPos)) { SubS_SetOfferMode(&this->unk_4C2, SUBS_OFFER_MODE_ONSCREEN, SUBS_OFFER_MODE_MASK); this->unk_4C2 &= ~0x20; this->unk_4C2 |= 0x200; this->actor.child = NULL; this->unk_4E2 = 20; - this->unk_364 = 0; + this->msgScriptPos = 0; this->actionFunc = func_80BDF5E8; } else { Math_ApproachS(&this->actor.shape.rot.y, this->actor.world.rot.y, 3, 0x2AA8); diff --git a/src/overlays/actors/ovl_En_Al/z_en_al.h b/src/overlays/actors/ovl_En_Al/z_en_al.h index de63902873..ef36245928 100644 --- a/src/overlays/actors/ovl_En_Al/z_en_al.h +++ b/src/overlays/actors/ovl_En_Al/z_en_al.h @@ -7,7 +7,6 @@ struct EnAl; typedef void (*EnAlActionFunc)(struct EnAl*, PlayState*); -typedef s32 (*EnAlUnkFunc)(struct EnAl*, PlayState*); typedef void (*EnAlUnkFunc2)(struct EnAl*, PlayState*); typedef struct EnAl { @@ -18,8 +17,8 @@ typedef struct EnAl { /* 0x190 */ MtxF unk_190[6]; /* 0x310 */ ColliderCylinder unk_310; /* 0x35C */ u8 unk_35C; - /* 0x360 */ s32* unk_360; - /* 0x364 */ s32 unk_364; + /* 0x360 */ MsgScript* msgScript; + /* 0x364 */ s32 msgScriptPos; /* 0x368 */ Actor* unk_368; /* 0x36C */ Vec3f unk_36C; /* 0x378 */ Vec3s unk_378; @@ -39,7 +38,7 @@ typedef struct EnAl { /* 0x4E6 */ s16 unk_4E6; /* 0x4E8 */ s16 unk_4E8; /* 0x4EA */ s16 unk_4EA; - /* 0x4EC */ EnAlUnkFunc unk_4EC; + /* 0x4EC */ MsgScriptCallback msgScriptCallback; /* 0x4F0 */ s32 unk_4F0; /* 0x4F4 */ s32 unk_4F4; /* 0x4F8 */ s32 animIndex; diff --git a/src/overlays/actors/ovl_En_An/z_en_an.c b/src/overlays/actors/ovl_En_An/z_en_an.c index 5a53eb19ac..5bab2d9a87 100644 --- a/src/overlays/actors/ovl_En_An/z_en_an.c +++ b/src/overlays/actors/ovl_En_An/z_en_an.c @@ -227,103 +227,614 @@ static s32 sSearchTimePathLimit[ANJU_SCH_MAX] = { 3, // ANJU_SCH_WALKING_63 }; -s32 sAnjuMsgScript_SchReceiveLetterFromPostman[0x1B] = { - 0x00560800, 0x44090000, 0x0E28BA0C, 0x09000017, 0x0E28BB0C, 0x09000018, 0x0E28BC0C, 0x09000017, 0x0E28BD0C, - 0x09000018, 0x0E28BE0C, 0x09000017, 0x0E28BF0C, 0x09000018, 0x0E28C02D, 0x00012D00, 0x0B0C0900, 0x00115608, - 0x10090000, 0x0E295C0C, 0x09000017, 0x0E295D0C, 0x09000018, 0x0E295E2D, 0x00012D00, 0x0B0C0900, 0x00100000, +MsgScript sAnjuMsgScript_SchReceiveLetterFromPostman[] = { + /* 0x0000 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_LISTENED_ANJU_POSTMAN_CONVERSATION, + 0x0049 - 0x0005), + /* 0x0005 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0008 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28BA), + /* 0x000B 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000C 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x000F 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0010 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28BB), + /* 0x0013 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0014 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0017 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x0018 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28BC), + /* 0x001B 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001C 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x001F 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0020 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28BD), + /* 0x0023 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0024 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0027 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x0028 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28BE), + /* 0x002B 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x002C 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x002F 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0030 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28BF), + /* 0x0033 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0034 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0037 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x0038 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28C0), + /* 0x003B 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x003E 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_POSTMAN), + /* 0x0041 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0042 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0045 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_LISTENED_ANJU_POSTMAN_CONVERSATION), + /* 0x0048 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0049 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x004C 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x295C), + /* 0x004F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0050 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0053 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0054 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x295D), + /* 0x0057 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0058 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x005B 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x005C 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x295E), + /* 0x005F 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x0062 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_POSTMAN), + /* 0x0065 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0066 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0069 0x01 */ MSCRIPT_CMD_DONE(), }; -s32 sAnjuMsgScript_SchAttendGoron[0x21] = { - 0x09000000, 0x4B10001E, 0x0E28B10C, 0x09000017, 0x0E28B20C, 0x09000018, 0x0E28B32D, 0x00011137, 0x020C0900, - 0x00100056, 0x10002E0E, 0x28B10C09, 0x0000170E, 0x28B50C09, 0x0000180E, 0x28B60C09, 0x0000170E, 0x28B70C09, - 0x0000180E, 0x28B82D00, 0x010C0900, 0x00115610, 0x10090000, 0x170E2956, 0x0C090000, 0x180E2957, 0x0C090000, - 0x170E2958, 0x0C090000, 0x180E2959, 0x2D00010C, 0x09000012, 0x10000000, +MsgScript sAnjuMsgScript_SchAttendGoron[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0003 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_RECEIVED_ROOM_KEY, 0x0026 - 0x0008), + /* 0x0008 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28B1), + /* 0x000B 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000C 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x000F 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0010 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28B2), + /* 0x0013 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0014 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0017 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x0018 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28B3), + /* 0x001B 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x001E 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_55_02), + /* 0x0021 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0022 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0025 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0026 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_86_10, 0x0059 - 0x002B), + /* 0x002B 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28B1), + /* 0x002E 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x002F 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0032 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0033 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28B5), + /* 0x0036 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0037 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x003A 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x003B 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28B6), + /* 0x003E 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x003F 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0042 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0043 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28B7), + /* 0x0046 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0047 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x004A 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x004B 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28B8), + /* 0x004E 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x0051 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0052 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0055 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_86_10), + /* 0x0058 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0059 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x005C 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x005D 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2956), + /* 0x0060 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0061 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0064 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x0065 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2957), + /* 0x0068 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0069 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x006C 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x006D 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2958), + /* 0x0070 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0071 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0074 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x0075 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2959), + /* 0x0078 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x007B 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x007C 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x007F 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0080 0x01 */ MSCRIPT_CMD_DONE(), }; -s32 sAnjuMsgScript_SchGiveLunchToGranny[0x15] = { - 0x09000017, 0x0E28C70C, 0x09000018, 0x0E28C80C, 0x09000017, 0x0E28C90C, 0x09000018, - 0x0E28CA0C, 0x09000017, 0x0E28CB0C, 0x09000018, 0x0E28CC0C, 0x09000017, 0x0E28CD0C, - 0x09000018, 0x0E28CE0C, 0x09000017, 0x0E28CF2D, 0x12D00, 0x0E0C0900, 0x100000, +MsgScript sAnjuMsgScript_SchGiveLunchToGranny[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0003 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0004 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28C7), + /* 0x0007 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0008 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x000B 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x000C 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28C8), + /* 0x000F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0010 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0013 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0014 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28C9), + /* 0x0017 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0018 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x001B 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x001C 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28CA), + /* 0x001F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0020 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0023 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0024 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28CB), + /* 0x0027 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0028 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x002B 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x002C 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28CC), + /* 0x002F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0030 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0033 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0034 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28CD), + /* 0x0037 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0038 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x003B 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x003C 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28CE), + /* 0x003F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0040 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0043 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0044 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28CF), + /* 0x0047 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x004A 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJUS_GRANDMOTHER), + /* 0x004D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x004E 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0051 0x01 */ MSCRIPT_CMD_DONE(), }; -s32 sAnjuMsgScript_ReceptionistDay1[0x37] = { - 0x220B0000, 0x69002020, 0x64004B, 0x1000B700, 0x370100AA, 0x370200, 0x550E28A0, 0x0C090000, - 0x0F28A80C, 0x05000000, 0x30000030, 0x0E28A90C, 0x0F28AA0C, 0x0F28AB0C, 0x120600A0, 0x1300, - 0xA02F0000, 0x2E2D0014, 0x0C114B10, 0x0700000E, 0x28AD2D00, 0x010C2400, 0x41161031, 0x0E28A30C, - 0x0900000F, 0x28A52D00, 0x010C1137, 0x01100020, 0x2000340E, 0x28A00C09, 0xF28, 0xA10C0500, - 0xF00, 0x300E28, 0xA20C0900, 0xF28A3, 0x0C190008, 0x310E28A4, 0x0C090000, 0x0F28A52D, - 0x10C11, 0x20201023, 0x400012, 0x0E28A00C, 0x0900000F, 0x28A62D00, 0x010C2400, 0x40100E28, - 0xA72D0001, 0x0C102300, 0x41000B0E, 0x28AC2D00, 0x010C2400, 0x41100E28, 0xAD0C1000, +MsgScript sAnjuMsgScript_ReceptionistDay1[] = { + /* 0x0000 0x05 */ MSCRIPT_CMD_CHECK_BEFORE_TIME(11, 0, 0x006E - 0x0005), + /* 0x0005 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_32_20, 0x006E - 0x000A), + /* 0x000A 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_RECEIVED_ROOM_KEY, 0x00C6 - 0x000F), + /* 0x000F 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_55_01, 0x00BE - 0x0014), + /* 0x0014 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_55_02, 0x006E - 0x0019), + /* 0x0019 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28A0), + /* 0x001C 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001D 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0020 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x28A8), + /* 0x0023 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0024 0x07 */ MSCRIPT_CMD_CHECK_TEXT_CHOICE(0x0, 0x005B - 0x002B, 0x0), + /* 0x002B 0x01 */ MSCRIPT_CMD_PLAY_DECIDE(), + /* 0x002C 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28A9), + /* 0x002F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0030 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x28AA), + /* 0x0033 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0034 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x28AB), + /* 0x0037 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0038 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0039 0x05 */ MSCRIPT_CMD_OFFER_ITEM(GI_ROOM_KEY, 0x0), + /* 0x003E 0x03 */ MSCRIPT_CMD_SET_COLLECTIBLE(0x00A0), + /* 0x0041 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x0044 0x01 */ MSCRIPT_CMD_AWAIT_TEXT_DONE(), + /* 0x0045 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_RECEIVED_ROOM_KEY), + /* 0x0048 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0049 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_RECEIVED_ROOM_KEY), + /* 0x004C 0x03 */ MSCRIPT_CMD_AUTOTALK(0x0), + /* 0x004F 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28AD), + /* 0x0052 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x0055 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0056 0x03 */ MSCRIPT_CMD_SET_SWITCH_FLAG(0x0041), + /* 0x0059 0x01 */ MSCRIPT_CMD_UNSET_AUTOTALK(), + /* 0x005A 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x005B 0x01 */ MSCRIPT_CMD_PLAY_CANCEL(), + /* 0x005C 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28A3), + /* 0x005F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0060 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0063 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x28A5), + /* 0x0066 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x0069 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x006A 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_55_01), + /* 0x006D 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x006E 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_32_20, 0x00A7 - 0x0073), + /* 0x0073 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28A0), + /* 0x0076 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0077 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x007A 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x28A1), + /* 0x007D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x007E 0x07 */ MSCRIPT_CMD_CHECK_TEXT_CHOICE(0x0, 0x0094 - 0x0085, 0x0), + /* 0x0085 0x01 */ MSCRIPT_CMD_PLAY_DECIDE(), + /* 0x0086 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28A2), + /* 0x0089 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x008A 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x008D 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x28A3), + /* 0x0090 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0091 0x03 */ MSCRIPT_CMD_JUMP(0x009C - 0x0094), + /* 0x0094 0x01 */ MSCRIPT_CMD_PLAY_CANCEL(), + /* 0x0095 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28A4), + /* 0x0098 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0099 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x009C 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x28A5), + /* 0x009F 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x00A2 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00A3 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_32_20), + /* 0x00A6 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x00A7 0x05 */ MSCRIPT_CMD_CHECK_SWITCH_FLAG(0x0040, 0x00BE - 0x00AC), + /* 0x00AC 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28A0), + /* 0x00AF 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00B0 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x00B3 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x28A6), + /* 0x00B6 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x00B9 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00BA 0x03 */ MSCRIPT_CMD_SET_SWITCH_FLAG(0x0040), + /* 0x00BD 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x00BE 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28A7), + /* 0x00C1 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x00C4 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00C5 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x00C6 0x05 */ MSCRIPT_CMD_CHECK_SWITCH_FLAG(0x0041, 0x00D6 - 0x00CB), + /* 0x00CB 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28AC), + /* 0x00CE 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x00D1 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00D2 0x03 */ MSCRIPT_CMD_SET_SWITCH_FLAG(0x0041), + /* 0x00D5 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x00D6 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28AD), + /* 0x00D9 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00DA 0x01 */ MSCRIPT_CMD_DONE(), }; -s32 sAnjuMsgScript_InnCloseTime[3] = { 0x0E18852D, 0x10C12, 0x10000000 }; - -s32 sAnjuMsgScript_80B58944[2] = { 0x0E28AF2D, 0x10C10 }; - -s32 sAnjuMsgScript_80B5894C[2] = { 0x0E28C12D, 0x10C10 }; - -s32 sAnjuMsgScript_SchCooking[0xB] = { - 0x350100, 0x1C0E28C3, 0x0C0F28C4, 0x0C150900, 0xE28C5, 0x2D00010C, - 0x15090000, 0x11350112, 0x100E28C2, 0x2D00010C, 0x10000000, +MsgScript sAnjuMsgScript_InnCloseTime[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x1885), + /* 0x0003 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0008 0x01 */ MSCRIPT_CMD_DONE(), }; -s32 sAnjuMsgScript_80B58980[2] = { 0x0E28C62D, 0x10C10 }; - -s32 sAnjuMsgScript_SchSweeping[3] = { 0x0E28F70C, 0x0F28F82D, 0x10C10 }; - -s32 sAnjuMsgScript_80B58994[2] = { 0x0E28F82D, 0x10C10 }; - -s32 sAnjuMsgScript_SchRanch[4] = { 0x0E28F90C, 0x0F28FA0C, 0x0F28FB2D, 0x10C10 }; - -s32 sAnjuMsgScript_SchMidnightMeeting[0x14] = { - 0x0E28D70C, 0x0F28D80C, 0x0F28D90C, 0x0F28DA0C, 0x0F28DB0C, 0x05000700, 0x731, - 0x0E28D919, -0x16CFF2, 0x28DC0C11, 0x32201132, 0x10120600, 0xAA000013, 0xAA2F00, - 0x2E2D00, 0x012D0017, 0x2D00160C, 0x0700000E, 0x28DE0C15, 0x09000010, +MsgScript sAnjuMsgScript_80B58944[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28AF), + /* 0x0003 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x01 */ MSCRIPT_CMD_DONE(), }; -// Surprised: nevermind -s32 sAnjuMsgScript_80B589FC[2] = { 0x0E28D62D, 0x10C10 }; - -s32 sAnjuMsgScript_DekuDefault[8] = { - 0x522000, 0x100E294F, 0x0C0F2950, 0x2D00010C, 0x12115220, 0x100E2951, 0x2D00010C, 0x12100000, +MsgScript sAnjuMsgScript_80B5894C[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28C1), + /* 0x0003 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x01 */ MSCRIPT_CMD_DONE(), }; -s32 sAnjuMsgScript_SchLaundryPoolDeku[6] = { 0x524000, 0x0B0E2952, 0x2D00010C, 0x11524010, 0x0E29532D, 0x10C10 }; +MsgScript sAnjuMsgScript_SchCooking[] = { + /* 0x0000 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_53_01, 0x0021 - 0x0005), + /* 0x0005 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28C3), + /* 0x0008 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0009 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x28C4), + /* 0x000C 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000D 0x01 */ MSCRIPT_CMD_PAUSE(), + /* 0x000E 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0011 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28C5), + /* 0x0014 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x0017 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0018 0x01 */ MSCRIPT_CMD_PAUSE(), + /* 0x0019 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x001C 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_53_01), + /* 0x001F 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0020 0x01 */ MSCRIPT_CMD_DONE(), -s32 sAnjuMsgScript_Receptionist[2] = { 0x0E28E02D, 0x10C10 }; - -s32 sAnjuMsgScript_80B58A44[0x1E] = { - 0x320800, 0x080E28D5, 0x2D00010C, 0x10003220, 0x80E28, -0x2BD2FFFF, 0x0C100033, 0x01001A25, - 0x30001D, 0x27000300, 0x080E28E3, 0x2D00010C, 0x100E28E2, 0x2D00010C, 0x100E28E1, 0x2D00010C, - 0x100E28E4, 0x0C0E00FF, 0x1E003600, 0x0E000000, 0x0C2C28E7, 0x0C2F0000, 0x2D00010C, 0x1012102C, - 0x28E50C2F, 0xC2A, 0x300F28, -0x19D2FFFF, 0x2D001A0C, 0x11330110, + /* 0x0021 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28C2), + /* 0x0024 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x0027 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0028 0x01 */ MSCRIPT_CMD_DONE(), }; -s32 sAnjuMsgScript_80B58ABC[2] = { 0x0E28D02D, 0x10C10 }; - -s32 sAnjuMsgScript_80B58AC4[9] = { - 0x320800, 0x160E28D1, 0x0C0F28D2, 0x0C0F28D3, 0x2D00152D, 0x10C11, 0x3208100E, 0x28D32D00, 0x010C1000, +MsgScript sAnjuMsgScript_80B58980[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28C6), + /* 0x0003 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x01 */ MSCRIPT_CMD_DONE(), }; -s32 sAnjuMsgScript_SchWaitingForKafei[3] = { 0x0E28DF2D, 0x10C12, 0x10000000 }; - -s32 sAnjuMsgScript_SchLaundryPoolDefault[0x12] = { - 0x372000, 0x29003208, 0x2A0E28, -0x17F3EAF7, 0xE28, -0x16F3F0D8, -0x15F3EAF7, 0xE28, -0x14F3F0D8, - -0x13D2FFFF, 0x0C121137, 0x20100E28, -0x13F3EDF0, 0x0E28EE0C, 0x0F28EB0C, 0x0F28EC2D, 0x10C12, 0x11372010, +MsgScript sAnjuMsgScript_SchSweeping[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28F7), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x28F8), + /* 0x0007 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x000A 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000B 0x01 */ MSCRIPT_CMD_DONE(), }; -s32 sAnjuMsgScript_SchLaundryPoolKafeiMask[0x10] = { - 0x372000, 0x21003208, 0x220E28, -0x17F3F0D8, -0x12F3EAF7, 0xE28, -0x14F3F0D8, -0x13D2FFFF, - 0x0C121137, 0x20100E28, -0x13F3EDF0, 0x0E28EE0C, 0x0F28EB0C, 0x0F28EC2D, 0x10C12, 0x11372010, +MsgScript sAnjuMsgScript_80B58994[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28F8), + /* 0x0003 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x01 */ MSCRIPT_CMD_DONE(), }; -// Anju says the Inn is full and tell the player to tell that to his mother -s32 sAnjuMsgScript_80B58B7C[3] = { 0x0E29512D, 0x10C12, 0x10000000 }; +MsgScript sAnjuMsgScript_SchRanch[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28F9), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x28FA), + /* 0x0007 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0008 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x28FB), + /* 0x000B 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x000E 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000F 0x01 */ MSCRIPT_CMD_DONE(), +}; -// Tells player that they should talk in the kitchen instead -s32 sAnjuMsgScript_80B58B88[2] = { 0x0E29612D, 0x10C10 }; +MsgScript sAnjuMsgScript_SchMidnightMeeting[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28D7), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x28D8), + /* 0x0007 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0008 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x28D9), + /* 0x000B 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000C 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x28DA), + /* 0x000F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0010 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x28DB), + /* 0x0013 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0014 0x07 */ MSCRIPT_CMD_CHECK_TEXT_CHOICE(0x0022 - 0x001B, 0x0, 0x0022 - 0x001B), + /* 0x001B 0x01 */ MSCRIPT_CMD_PLAY_CANCEL(), + /* 0x001C 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28D9), + /* 0x001F 0x03 */ MSCRIPT_CMD_JUMP(0x000B - 0x0022), -s32 sAnjuMsgScript_SchWithKafei[3] = { 0x0E291B2D, 0x10C12, 0x10000000 }; + /* 0x0022 0x01 */ MSCRIPT_CMD_PLAY_DECIDE(), + /* 0x0023 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28DC), + /* 0x0026 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0027 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_HAD_MIDNIGHT_MEETING), + /* 0x002A 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_50_10), + /* 0x002D 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x002E 0x05 */ MSCRIPT_CMD_OFFER_ITEM(GI_LETTER_TO_KAFEI, 0x0), + /* 0x0033 0x03 */ MSCRIPT_CMD_SET_COLLECTIBLE(0x00AA), + /* 0x0036 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x0039 0x01 */ MSCRIPT_CMD_AWAIT_TEXT_DONE(), + /* 0x003A 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x003D 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_RECEIVED_LETTER_TO_KAFEI), + /* 0x0040 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_PROMISED_TO_MEET_KAFEI), + /* 0x0043 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0044 0x03 */ MSCRIPT_CMD_AUTOTALK(0x0), + /* 0x0047 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28DE), + /* 0x004A 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x004B 0x01 */ MSCRIPT_CMD_PAUSE(), + /* 0x004C 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x004F 0x01 */ MSCRIPT_CMD_DONE(), +}; + +MsgScript sAnjuMsgScript_80B589FC[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28D6), + /* 0x0003 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x01 */ MSCRIPT_CMD_DONE(), +}; + +MsgScript sAnjuMsgScript_DekuDefault[] = { + /* 0x0000 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_82_20, 0x0015 - 0x0005), + /* 0x0005 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x294F), + /* 0x0008 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0009 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2950), + /* 0x000C 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x000F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0010 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0011 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_82_20), + /* 0x0014 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0015 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2951), + /* 0x0018 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x001B 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001C 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x001D 0x01 */ MSCRIPT_CMD_DONE(), +}; + +MsgScript sAnjuMsgScript_SchLaundryPoolDeku[] = { + /* 0x0000 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_82_40, 0x0010 - 0x0005), + /* 0x0005 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2952), + /* 0x0008 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x000B 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000C 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_82_40), + /* 0x000F 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0010 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2953), + /* 0x0013 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x0016 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0017 0x01 */ MSCRIPT_CMD_DONE(), +}; + +MsgScript sAnjuMsgScript_Receptionist[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28E0), + /* 0x0003 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x01 */ MSCRIPT_CMD_DONE(), +}; + +MsgScript sAnjuMsgScript_80B58A44[] = { + /* 0x0000 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_PROMISED_MIDNIGHT_MEETING, 0x000D - 0x0005), + /* 0x0005 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28D5), + /* 0x0008 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x000B 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000C 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x000D 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_HAD_MIDNIGHT_MEETING, 0x001A - 0x0012), + /* 0x0012 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28D4), + /* 0x0015 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x0018 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0019 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x001A 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_DELIVERED_PENDANT_OF_MEMORIES, 0x0039 - 0x001F), + /* 0x001F 0x05 */ MSCRIPT_CMD_CHECK_ITEM(ITEM_PENDANT_OF_MEMORIES, 0x0041 - 0x0024), + /* 0x0024 0x05 */ MSCRIPT_CMD_CHECK_IN_DAY(3, 0x0031 - 0x0029), + /* 0x0029 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28E3), + /* 0x002C 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x002F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0030 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0031 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28E2), + /* 0x0034 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x0037 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0038 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0039 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28E1), + /* 0x003C 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x003F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0040 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0041 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28E4), + /* 0x0044 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0045 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x00FF), + /* 0x0048 0x09 */ + MSCRIPT_CMD_CHECK_ITEM_ACTION(PLAYER_IA_PENDANT_OF_MEMORIES, 0x005F - 0x0051, 0x0, 0x005D - 0x0051), + /* 0x0051 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x28E7), + /* 0x0054 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0055 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x0058 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x005B 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x005C 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x005D 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x005E 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x005F 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x28E5), + /* 0x0062 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0063 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x0066 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0067 0x03 */ MSCRIPT_CMD_DELETE_ITEM(ITEM_PENDANT_OF_MEMORIES), + /* 0x006A 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x28E6), + /* 0x006D 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x0070 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_DELIVERED_PENDANT_OF_MEMORIES), + /* 0x0073 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0074 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_DELIVERED_PENDANT_OF_MEMORIES), + /* 0x0077 0x01 */ MSCRIPT_CMD_DONE(), +}; + +MsgScript sAnjuMsgScript_80B58ABC[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28D0), + /* 0x0003 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x01 */ MSCRIPT_CMD_DONE(), +}; + +MsgScript sAnjuMsgScript_80B58AC4[] = { + /* 0x0000 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_PROMISED_MIDNIGHT_MEETING, 0x001B - 0x0005), + /* 0x0005 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28D1), + /* 0x0008 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0009 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x28D2), + /* 0x000C 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000D 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x28D3), + /* 0x0010 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_PROMISED_MIDNIGHT_MEETING), + /* 0x0013 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x0016 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0017 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_PROMISED_MIDNIGHT_MEETING), + /* 0x001A 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x001B 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28D3), + /* 0x001E 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x0021 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0022 0x01 */ MSCRIPT_CMD_DONE(), +}; + +MsgScript sAnjuMsgScript_SchWaitingForKafei[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28DF), + /* 0x0003 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0008 0x01 */ MSCRIPT_CMD_DONE(), +}; + +MsgScript sAnjuMsgScript_SchLaundryPoolDefault[] = { + /* 0x0000 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_TALKED_ANJU_IN_LAUNDRY_POOL, 0x002E - 0x0005), + /* 0x0005 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_PROMISED_MIDNIGHT_MEETING, 0x0034 - 0x000A), + /* 0x000A 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28E8), + /* 0x000D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000E 0x01 */ MSCRIPT_CMD_PAUSE(), + /* 0x000F 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0012 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28E9), + /* 0x0015 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0016 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x28EA), + /* 0x0019 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001A 0x01 */ MSCRIPT_CMD_PAUSE(), + /* 0x001B 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x001E 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28EB), + /* 0x0021 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0022 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x28EC), + /* 0x0025 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x0028 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0029 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x002A 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_TALKED_ANJU_IN_LAUNDRY_POOL), + /* 0x002D 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x002E 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28EC), + /* 0x0031 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0032 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0033 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0034 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28EE), + /* 0x0037 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0038 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x28EB), + /* 0x003B 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x003C 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x28EC), + /* 0x003F 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x0042 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0043 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0044 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_TALKED_ANJU_IN_LAUNDRY_POOL), + /* 0x0047 0x01 */ MSCRIPT_CMD_DONE(), +}; + +MsgScript sAnjuMsgScript_SchLaundryPoolKafeiMask[] = { + /* 0x0000 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_TALKED_ANJU_IN_LAUNDRY_POOL, 0x0026 - 0x0005), + /* 0x0005 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_PROMISED_MIDNIGHT_MEETING, 0x002C - 0x000A), + /* 0x000A 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28E8), + /* 0x000D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000E 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x28ED), + /* 0x0011 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0012 0x01 */ MSCRIPT_CMD_PAUSE(), + /* 0x0013 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0016 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28EB), + /* 0x0019 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001A 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x28EC), + /* 0x001D 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x0020 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0021 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0022 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_TALKED_ANJU_IN_LAUNDRY_POOL), + /* 0x0025 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0026 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28EC), + /* 0x0029 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x002A 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x002B 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x002C 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28EE), + /* 0x002F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0030 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x28EB), + /* 0x0033 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0034 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x28EC), + /* 0x0037 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x003A 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x003B 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x003C 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_TALKED_ANJU_IN_LAUNDRY_POOL), + /* 0x003F 0x01 */ MSCRIPT_CMD_DONE(), +}; + +MsgScript sAnjuMsgScript_80B58B7C[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2951), + /* 0x0003 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0008 0x01 */ MSCRIPT_CMD_DONE(), +}; + +MsgScript sAnjuMsgScript_80B58B88[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2961), + /* 0x0003 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x01 */ MSCRIPT_CMD_DONE(), +}; + +MsgScript sAnjuMsgScript_SchWithKafei[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x291B), + /* 0x0003 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0008 0x01 */ MSCRIPT_CMD_DONE(), +}; ActorInit En_An_InitVars = { /**/ ACTOR_EN_AN, @@ -1158,24 +1669,24 @@ s32 EnAn_MsgEvent_LaundryPool(Actor* thisx, PlayState* play) { return ret; } -s32* EnAn_GetMsgEventScript(EnAn* this, PlayState* play) { +MsgScript* EnAn_GetMsgScript(EnAn* this, PlayState* play) { Player* player = GET_PLAYER(play); switch (this->scheduleResult) { case ANJU_SCH_GIVE_LUNCH_TO_GRANNY: - this->msgEventFunc = EnAn_MsgEvent_GiveLunchToGranny; + this->msgScriptCallback = EnAn_MsgEvent_GiveLunchToGranny; return sAnjuMsgScript_SchGiveLunchToGranny; case ANJU_SCH_RECEIVE_LETTER_FROM_POSTMAN: - this->msgEventFunc = EnAn_MsgEvent_ReceiveLetterFromPostman; + this->msgScriptCallback = EnAn_MsgEvent_ReceiveLetterFromPostman; return sAnjuMsgScript_SchReceiveLetterFromPostman; case ANJU_SCH_ATTEND_GORON: - this->msgEventFunc = EnAn_MsgEvent_AttendGoron; + this->msgScriptCallback = EnAn_MsgEvent_AttendGoron; return sAnjuMsgScript_SchAttendGoron; case ANJU_SCH_COOKING: - this->msgEventFunc = EnAn_MsgEvent_Cooking; + this->msgScriptCallback = EnAn_MsgEvent_Cooking; return sAnjuMsgScript_SchCooking; case ANJU_SCH_RANCH: @@ -1218,12 +1729,12 @@ s32* EnAn_GetMsgEventScript(EnAn* this, PlayState* play) { } if (this->scheduleResult == ANJU_SCH_MIDNIGHT_MEETING) { - this->msgEventFunc = EnAn_MsgEvent_MidnightMeeting; + this->msgScriptCallback = EnAn_MsgEvent_MidnightMeeting; return sAnjuMsgScript_SchMidnightMeeting; } if (this->scheduleResult == ANJU_SCH_LAUNDRY_POOL_SIT) { - this->msgEventFunc = EnAn_MsgEvent_LaundryPool; + this->msgScriptCallback = EnAn_MsgEvent_LaundryPool; return sAnjuMsgScript_SchLaundryPoolKafeiMask; } @@ -1231,7 +1742,7 @@ s32* EnAn_GetMsgEventScript(EnAn* this, PlayState* play) { return sAnjuMsgScript_80B58A44; } - if (SCHEDULE_TIME_NOW < SCHEDULE_TIME(14, 18)) { + if (SCRIPT_TIME_NOW < SCRIPT_TIME(14, 18)) { return sAnjuMsgScript_80B58ABC; } @@ -1240,12 +1751,12 @@ s32* EnAn_GetMsgEventScript(EnAn* this, PlayState* play) { if ((player->transformation == PLAYER_FORM_HUMAN) && CHECK_WEEKEVENTREG(WEEKEVENTREG_PROMISED_MIDNIGHT_MEETING)) { if (this->scheduleResult == ANJU_SCH_MIDNIGHT_MEETING) { - this->msgEventFunc = EnAn_MsgEvent_MidnightMeeting; + this->msgScriptCallback = EnAn_MsgEvent_MidnightMeeting; return sAnjuMsgScript_SchMidnightMeeting; } if (this->scheduleResult == ANJU_SCH_LAUNDRY_POOL_SIT) { - this->msgEventFunc = EnAn_MsgEvent_LaundryPool; + this->msgScriptCallback = EnAn_MsgEvent_LaundryPool; return sAnjuMsgScript_SchLaundryPoolDefault; } @@ -1268,7 +1779,7 @@ s32* EnAn_GetMsgEventScript(EnAn* this, PlayState* play) { return sAnjuMsgScript_80B58980; case ANJU_SCH_LAUNDRY_POOL_SIT: - this->msgEventFunc = EnAn_MsgEvent_LaundryPool; + this->msgScriptCallback = EnAn_MsgEvent_LaundryPool; return sAnjuMsgScript_SchLaundryPoolDefault; case ANJU_SCH_RECEPTIONIST_IDLE: @@ -1316,9 +1827,9 @@ s32 EnAn_CheckTalk(EnAn* this, PlayState* play) { SubS_SetOfferMode(&this->stateFlags, SUBS_OFFER_MODE_NONE, SUBS_OFFER_MODE_MASK); this->unk_3C4 = 0; this->msgEventState = 0; - this->msgEventFunc = NULL; + this->msgScriptCallback = NULL; this->actor.child = this->lookAtActor; - this->msgEventScript = EnAn_GetMsgEventScript(this, play); + this->msgScript = EnAn_GetMsgScript(this, play); if ((this->scheduleResult == ANJU_SCH_WAITING_FOR_KAFEI) || (this->scheduleResult == ANJU_SCH_LAUNDRY_POOL_SIT) || @@ -1923,7 +2434,7 @@ s32 EnAn_ProcessSchedule_GiveLunchToGranny(EnAn* this, PlayState* play, Schedule } s32 EnAn_ProcessSchedule_Door(EnAn* this, PlayState* play, ScheduleOutput* scheduleOutput) { - u16 now = SCHEDULE_TIME_NOW; + u16 now = SCRIPT_TIME_NOW; u8 pathIndex = ENAN_GET_PATH_INDEX(&this->actor); EnDoor* door; Vec3s* points; @@ -2009,7 +2520,7 @@ s32 EnAn_ProcessSchedule_Door(EnAn* this, PlayState* play, ScheduleOutput* sched } s32 EnAn_ProcessSchedule_Walking(EnAn* this, PlayState* play, ScheduleOutput* scheduleOutput) { - u16 now = SCHEDULE_TIME_NOW; + u16 now = SCRIPT_TIME_NOW; u16 startTime; u8 pathIndex = ENAN_GET_PATH_INDEX(&this->actor); s32 pad; @@ -2786,7 +3297,7 @@ void EnAn_FollowSchedule(EnAn* this, PlayState* play) { } void EnAn_Talk(EnAn* this, PlayState* play) { - if (func_8010BF58(&this->actor, play, this->msgEventScript, this->msgEventFunc, &this->msgScriptResumePos)) { + if (MsgEvent_RunScript(&this->actor, play, this->msgScript, this->msgScriptCallback, &this->msgScriptPos)) { // Message event script is done SubS_SetOfferMode(&this->stateFlags, SUBS_OFFER_MODE_ONSCREEN, SUBS_OFFER_MODE_MASK); @@ -2794,7 +3305,7 @@ void EnAn_Talk(EnAn* this, PlayState* play) { this->stateFlags &= ~ENAN_STATE_ENGAGED; this->stateFlags |= ENAN_STATE_LOST_ATTENTION; this->loseAttentionTimer = 20; - this->msgScriptResumePos = 0; + this->msgScriptPos = 0; this->actionFunc = EnAn_FollowSchedule; return; diff --git a/src/overlays/actors/ovl_En_An/z_en_an.h b/src/overlays/actors/ovl_En_An/z_en_an.h index 86a357d665..9273523b05 100644 --- a/src/overlays/actors/ovl_En_An/z_en_an.h +++ b/src/overlays/actors/ovl_En_An/z_en_an.h @@ -43,13 +43,13 @@ typedef struct EnAn { /* 0x1F8 */ s32 timePathWaypoint; /* 0x1FC */ s32 timePathElapsedTime; /* 0x200 */ u8 scheduleResult; - /* 0x204 */ s32* msgEventScript; + /* 0x204 */ MsgScript* msgScript; /* 0x208 */ s8 an2ObjectSlot; /* 0x209 */ s8 an3ObjectSlot; /* 0x20A */ s8 maskKerfayObjectSlot; /* 0x20B */ s8 an4ObjectSlot; /* 0x20C */ s8 msmoObjectSlot; - /* 0x210 */ s32 msgScriptResumePos; + /* 0x210 */ s32 msgScriptPos; /* 0x214 */ s8 roomNum; /* 0x215 */ s8 doorOpenTimer; /* 0x218 */ Actor* lookAtActor; // interactActor @@ -87,7 +87,7 @@ typedef struct EnAn { /* 0x392 */ s16 mouthTexIndex; /* 0x394 */ s16 msgEventState; /* 0x396 */ s16 dialogueFuncState; - /* 0x398 */ MsgEventFunc msgEventFunc; + /* 0x398 */ MsgEventFunc msgScriptCallback; /* 0x39C */ s32 animIndex; // EnAnAnimation enum /* 0x3A0 */ UNK_TYPE1 unk_3A0[0x8]; /* 0x3A8 */ u32 trayTexScrollTimer1; // TwoTexScroll diff --git a/src/overlays/actors/ovl_En_Baba/z_en_baba.c b/src/overlays/actors/ovl_En_Baba/z_en_baba.c index fdd425131a..0b194ad3e9 100644 --- a/src/overlays/actors/ovl_En_Baba/z_en_baba.c +++ b/src/overlays/actors/ovl_En_Baba/z_en_baba.c @@ -361,7 +361,7 @@ void EnBaba_UpdateModel(EnBaba* this, PlayState* play) { } s32 EnBaba_InitTimePath(EnBaba* this, PlayState* play, ScheduleOutput* scheduleOutput) { - u16 now = SCHEDULE_TIME_NOW; + u16 now = SCRIPT_TIME_NOW; u16 startTime; u8 pathIndex = BOMB_SHOP_LADY_GET_PATH_INDEX(&this->actor); u16 numWaypoints; diff --git a/src/overlays/actors/ovl_En_Bjt/z_en_bjt.c b/src/overlays/actors/ovl_En_Bjt/z_en_bjt.c index aa96a74257..e7cd7e70dd 100644 --- a/src/overlays/actors/ovl_En_Bjt/z_en_bjt.c +++ b/src/overlays/actors/ovl_En_Bjt/z_en_bjt.c @@ -31,13 +31,58 @@ typedef enum { #include "src/overlays/actors/ovl_En_Bjt/scheduleScripts.schl.inc" -static u8 sMsgEventScript[] = { - 0x0E, 0x29, 0x48, 0x0C, 0x0E, 0x00, 0xFF, 0x2B, 0x00, 0x00, 0x00, 0x52, 0x00, 0x5F, 0x2C, 0x29, 0x4A, 0x0C, 0x2F, - 0x00, 0x00, 0x0C, 0x15, 0x09, 0x00, 0x00, 0x0E, 0x29, 0x4B, 0x0C, 0x15, 0x09, 0x00, 0x00, 0x0E, 0x29, 0x4C, 0x0C, - 0x12, 0x00, 0x49, 0x08, 0x00, 0x1D, 0x09, 0x00, 0x00, 0x06, 0x00, 0x0C, 0x00, 0x00, 0x13, 0x00, 0x0C, 0x2F, 0x00, - 0x00, 0x2E, 0x2D, 0x00, 0x28, 0x2D, 0x00, 0x0D, 0x0C, 0x11, 0x49, 0x08, 0x11, 0x5A, 0x80, 0x10, 0x09, 0x00, 0x00, - 0x06, 0x00, 0x02, 0x00, 0x00, 0x13, 0x00, 0x02, 0x2F, 0x00, 0x00, 0x2E, 0x2D, 0x00, 0x0D, 0x0C, 0x11, 0x5A, 0x80, - 0x10, 0x2C, 0x29, 0x49, 0x0C, 0x2F, 0x00, 0x00, 0x0C, 0x2D, 0x00, 0x0D, 0x12, 0x10, 0x2D, 0x00, 0x0D, 0x12, 0x10, +static MsgScript sMsgScript[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2948), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x00FF), + /* 0x0007 0x07 */ MSCRIPT_CMD_CHECK_CALLBACK_MULTI(0x0, 0x0060 - 0x000E, 0x006D - 0x000E), + /* 0x000E 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x294A), + /* 0x0011 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0012 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x0015 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0016 0x01 */ MSCRIPT_CMD_PAUSE(), + /* 0x0017 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x001A 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x294B), + /* 0x001D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001E 0x01 */ MSCRIPT_CMD_PAUSE(), + /* 0x001F 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0022 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x294C), + /* 0x0025 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0026 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0027 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_73_08, 0x0049 - 0x002C), + /* 0x002C 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x002F 0x05 */ MSCRIPT_CMD_OFFER_ITEM(GI_HEART_PIECE, 0x0), + /* 0x0034 0x03 */ MSCRIPT_CMD_SET_COLLECTIBLE(0x000C), + /* 0x0037 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x003A 0x01 */ MSCRIPT_CMD_AWAIT_TEXT_DONE(), + /* 0x003B 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_RECEIVED_TOILET_HAND_HP), + /* 0x003E 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_TOLIET_HAND), + /* 0x0041 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0042 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_73_08), + /* 0x0045 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_90_80), + /* 0x0048 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0049 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x004C 0x05 */ MSCRIPT_CMD_OFFER_ITEM(GI_RUPEE_BLUE, 0x0), + /* 0x0051 0x03 */ MSCRIPT_CMD_SET_COLLECTIBLE(0x0002), + /* 0x0054 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x0057 0x01 */ MSCRIPT_CMD_AWAIT_TEXT_DONE(), + /* 0x0058 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_TOLIET_HAND), + /* 0x005B 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x005C 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_90_80), + /* 0x005F 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0060 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x2949), + /* 0x0063 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0064 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x0067 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0068 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_TOLIET_HAND), + /* 0x006B 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x006C 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x006D 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_TOLIET_HAND), + /* 0x0070 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0071 0x01 */ MSCRIPT_CMD_DONE(), }; ActorInit En_Bjt_InitVars = { @@ -318,7 +363,7 @@ s32 EnBjt_CheckTalk(EnBjt* this, PlayState* play) { Actor_TalkOfferAccepted(&this->actor, &play->state)) { this->stateFlags |= TOILET_HAND_STATE_TALKING; SubS_SetOfferMode(&this->stateFlags, SUBS_OFFER_MODE_NONE, SUBS_OFFER_MODE_MASK); - this->msgEventCallback = EnBjt_ChooseBehaviour; + this->msgScriptCallback = EnBjt_ChooseBehaviour; this->behaviour = 0; this->actionFunc = EnBjt_Talk; ret = true; @@ -358,11 +403,11 @@ s32 EnBjt_ChooseAnimation(EnBjt* this, PlayState* play) { void EnBjt_Talk(EnBjt* this, PlayState* play) { s16 yaw = this->actor.yawTowardsPlayer; - if (func_8010BF58(&this->actor, play, sMsgEventScript, this->msgEventCallback, &this->msgEventArg4)) { + if (MsgEvent_RunScript(&this->actor, play, sMsgScript, this->msgScriptCallback, &this->msgScriptPos)) { this->actor.flags &= ~ACTOR_FLAG_TALK; SubS_SetOfferMode(&this->stateFlags, SUBS_OFFER_MODE_ONSCREEN, SUBS_OFFER_MODE_MASK); this->stateFlags &= ~TOILET_HAND_STATE_TALKING; - this->msgEventArg4 = 0; + this->msgScriptPos = 0; this->actionFunc = EnBjt_FollowSchedule; } else { Math_ApproachS(&this->actor.shape.rot.y, yaw, 4, 0x2AA8); @@ -405,7 +450,7 @@ void EnBjt_FollowSchedule(EnBjt* this, PlayState* play) { this->actor.flags |= ACTOR_FLAG_CANT_LOCK_ON; Actor_SetScale(&this->actor, 0.0f); this->stateFlags = 0; - this->msgEventCallback = NULL; + this->msgScriptCallback = NULL; this->scheduleResult = TOILET_HAND_SCH_NONE; } } diff --git a/src/overlays/actors/ovl_En_Bjt/z_en_bjt.h b/src/overlays/actors/ovl_En_Bjt/z_en_bjt.h index 9ce5adf0e9..696b6a17cf 100644 --- a/src/overlays/actors/ovl_En_Bjt/z_en_bjt.h +++ b/src/overlays/actors/ovl_En_Bjt/z_en_bjt.h @@ -7,7 +7,6 @@ struct EnBjt; typedef void (*EnBjtActionFunc)(struct EnBjt*, PlayState*); -typedef s32 (*MsgEventFunc)(Actor*, PlayState*); typedef struct EnBjt { /* 0x000 */ Actor actor; @@ -15,7 +14,7 @@ typedef struct EnBjt { /* 0x188 */ EnBjtActionFunc actionFunc; /* 0x18C */ ColliderCylinder collider; /* 0x1D8 */ u8 scheduleResult; - /* 0x1DC */ s32 msgEventArg4; + /* 0x1DC */ s32 msgScriptPos; /* 0x1E0 */ Vec3s jointTable[TOILET_HAND_LIMB_MAX]; /* 0x20A */ Vec3s morphTable[TOILET_HAND_LIMB_MAX]; /* 0x234 */ u16 stateFlags; @@ -26,7 +25,7 @@ typedef struct EnBjt { /* 0x242 */ s16 timer; /* 0x244 */ UNK_TYPE1 unk_244[4]; /* 0x248 */ s32 playedSfx; // to only play once - /* 0x24C */ MsgEventFunc msgEventCallback; + /* 0x24C */ MsgScriptCallback msgScriptCallback; /* 0x250 */ s32 animIndex; /* 0x254 */ UNK_TYPE1 pad_254[8]; } EnBjt; // size = 0x25C diff --git a/src/overlays/actors/ovl_En_Dai/z_en_dai.c b/src/overlays/actors/ovl_En_Dai/z_en_dai.c index 0b57e9d1ac..46e806a6d2 100644 --- a/src/overlays/actors/ovl_En_Dai/z_en_dai.c +++ b/src/overlays/actors/ovl_En_Dai/z_en_dai.c @@ -246,10 +246,28 @@ void func_80B3E834(EnDai* this) { } } -// Some kind of struct? -static s32 D_80B3FC8C[] = { - 0x0100060E, 0x0C900C12, 0x10005520, 0x00110E0C, 0x910C0F0C, - 0x920C0F0C, 0x930C1211, 0x5520100E, 0x0C940C12, 0x10000000, +static MsgScript sMsgScript[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_CHECK_GORON(0x0009 - 0x0003), + /* 0x0003 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0C90), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0008 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0009 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_85_20, 0x001F - 0x000E), + /* 0x000E 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0C91), + /* 0x0011 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0012 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0C92), + /* 0x0015 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0016 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0C93), + /* 0x0019 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001A 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x001B 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_85_20), + /* 0x001E 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x001F 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0C94), + /* 0x0022 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0023 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0024 0x01 */ MSCRIPT_CMD_DONE(), }; static f32 D_80B3FCB4[] = { @@ -443,9 +461,9 @@ void func_80B3EEDC(EnDai* this, PlayState* play) { } void func_80B3EF90(EnDai* this, PlayState* play) { - if (func_8010BF58(&this->actor, play, D_80B3FC8C, NULL, &this->unk_1D0)) { + if (MsgEvent_RunScript(&this->actor, play, sMsgScript, NULL, &this->msgScriptPos)) { SubS_SetOfferMode(&this->unk_1CE, SUBS_OFFER_MODE_ONSCREEN, SUBS_OFFER_MODE_MASK); - this->unk_1D0 = 0; + this->msgScriptPos = 0; this->actionFunc = func_80B3F00C; } else { Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 0x2AA8); diff --git a/src/overlays/actors/ovl_En_Dai/z_en_dai.h b/src/overlays/actors/ovl_En_Dai/z_en_dai.h index 90456b833d..dd91dac242 100644 --- a/src/overlays/actors/ovl_En_Dai/z_en_dai.h +++ b/src/overlays/actors/ovl_En_Dai/z_en_dai.h @@ -30,7 +30,7 @@ typedef struct EnDai { /* 0x1CC */ u8 cueId; /* 0x1CD */ u8 unk_1CD; /* 0x1CE */ u16 unk_1CE; - /* 0x1D0 */ s32 unk_1D0; + /* 0x1D0 */ s32 msgScriptPos; /* 0x1D4 */ s16 unk_1D4; /* 0x1D6 */ s16 unk_1D6; /* 0x1D8 */ s16 unk_1D8; diff --git a/src/overlays/actors/ovl_En_Dnh/z_en_dnh.c b/src/overlays/actors/ovl_En_Dnh/z_en_dnh.c index c6514f56af..47bd47b0ca 100644 --- a/src/overlays/actors/ovl_En_Dnh/z_en_dnh.c +++ b/src/overlays/actors/ovl_En_Dnh/z_en_dnh.c @@ -18,28 +18,203 @@ void EnDnh_Draw(Actor* thisx, PlayState* play); void func_80A50F38(EnDnh* this, PlayState* play); void EnDnh_DoNothing(EnDnh* this, PlayState* play); -UNK_TYPE D_80A51250[] = { - 0x000C0800, 0x080E0862, 0x0C111101, 0x10040005, 0x0E08670C, 0x10001402, 0x007A0019, 0x1000300E, 0x08590C25, - 0x000D0018, 0x0F08630C, 0x12060043, 0x00001300, 0x430C0700, 0x000E088D, 0x0C190007, 0x0F088D0C, 0x19000012, - 0x11191009, 0x00001000, 0x1A100016, 0x0E085A11, 0x1A100C0F, 0x085B0C0F, 0x085C0C05, 0x00060024, 0x00060E08, - 0x5B19FFEE, 0x300F085E, 0x0C08000A, 0x00050F08, 0x750C1014, 0xFFF60F08, 0x600C1211, 0x19100900, 0x0010310F, - 0x085F0C10, 0x00192000, 0x49001A10, 0x003D0E08, 0x68111A10, 0x0C0F0869, 0x0C0F086A, 0x0C0F086B, 0x0C0F086C, - 0x0C050000, 0x00190000, 0x300E086E, 0x1119201C, 0x03201D03, 0x401D0380, 0x1D04010C, 0x12090000, 0x10310E08, - 0x6D0C100E, 0x08700C19, 0xFFCB0019, 0x2000070E, 0x08710C19, 0xFFBB0E08, 0x720C0F08, 0x730C0500, 0x00001700, - 0x0008000A, 0x0006320F, 0x08750C10, 0x3014FFF6, 0x001A4000, 0x0919FFA8, 0x310E0874, 0x0C100E08, 0x76111920, - 0x1C03201D, 0x03401D03, 0x801D0401, 0x0C120900, 0x00100000, +MsgScript D_80A51250[] = { + /* 0x0000 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_SAVED_KOUME, 0x000D - 0x0005), + /* 0x0005 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0862), + /* 0x0008 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0009 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_TALKED_KOUME_KIOSK_EMPTY), + /* 0x000C 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x000D 0x03 */ MSCRIPT_CMD_CHECK_HUMAN(0x0015 - 0x0010), + /* 0x0010 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0867), + /* 0x0013 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0014 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0015 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE, 0x0094 - 0x001A), + /* 0x001A 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_25_10, 0x004F - 0x001F), + /* 0x001F 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0859), + /* 0x0022 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0023 0x05 */ MSCRIPT_CMD_CHECK_ITEM(ITEM_PICTOGRAPH_BOX, 0x0040 - 0x0028), + /* 0x0028 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0863), + /* 0x002B 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x002C 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x002D 0x05 */ MSCRIPT_CMD_OFFER_ITEM(GI_PICTOGRAPH_BOX, 0x0), + /* 0x0032 0x03 */ MSCRIPT_CMD_SET_COLLECTIBLE(0x0043), + /* 0x0035 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0036 0x03 */ MSCRIPT_CMD_AUTOTALK(0x0), + /* 0x0039 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x088D), + /* 0x003C 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x003D 0x03 */ MSCRIPT_CMD_JUMP(0x0047 - 0x0040), + /* 0x0040 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x088D), + /* 0x0043 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0044 0x03 */ MSCRIPT_CMD_JUMP(0x0), + /* 0x0047 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0048 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_25_10), + /* 0x004B 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x004E 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x004F 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_26_10, 0x006A - 0x0054), + /* 0x0054 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x085A), + /* 0x0057 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_26_10), + /* 0x005A 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x005B 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x085B), + /* 0x005E 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x005F 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x085C), + /* 0x0062 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0063 0x07 */ MSCRIPT_CMD_CHECK_TEXT_CHOICE(0x0070 - 0x006A, 0x008E - 0x006A, 0x0070 - 0x006A), + /* 0x006A 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x085B), + /* 0x006D 0x03 */ MSCRIPT_CMD_JUMP(0x005E - 0x0070), + + /* 0x0070 0x01 */ MSCRIPT_CMD_PLAY_DECIDE(), + /* 0x0071 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x085E), + /* 0x0074 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0075 0x05 */ MSCRIPT_CMD_CHECK_RUPEES(10, 0x007F - 0x007A), + /* 0x007A 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0875), + /* 0x007D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x007E 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x007F 0x03 */ MSCRIPT_CMD_CHANGE_RUPEES(-10), + /* 0x0082 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0860), + /* 0x0085 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0086 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0087 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_25_10), + /* 0x008A 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x008D 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x008E 0x01 */ MSCRIPT_CMD_PLAY_CANCEL(), + /* 0x008F 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x085F), + /* 0x0092 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0093 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0094 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_25_20, 0x00E2 - 0x0099), + /* 0x0099 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_26_10, 0x00DB - 0x009E), + /* 0x009E 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0868), + /* 0x00A1 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_26_10), + /* 0x00A4 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00A5 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0869), + /* 0x00A8 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00A9 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x086A), + /* 0x00AC 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00AD 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x086B), + /* 0x00B0 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00B1 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x086C), + /* 0x00B4 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00B5 0x07 */ MSCRIPT_CMD_CHECK_TEXT_CHOICE(0x0, 0x00D5 - 0x00BC, 0x0), + /* 0x00BC 0x01 */ MSCRIPT_CMD_PLAY_DECIDE(), + /* 0x00BD 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x086E), + /* 0x00C0 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_25_20), + /* 0x00C3 0x03 */ MSCRIPT_CMD_SET_EVENT_INF(EVENTINF_35), + /* 0x00C6 0x03 */ MSCRIPT_CMD_EVENT_INF(EVENTINF_36), + /* 0x00C9 0x03 */ MSCRIPT_CMD_EVENT_INF(EVENTINF_37), + /* 0x00CC 0x03 */ MSCRIPT_CMD_EVENT_INF(EVENTINF_40), + /* 0x00CF 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00D0 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x00D1 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x00D4 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x00D5 0x01 */ MSCRIPT_CMD_PLAY_CANCEL(), + /* 0x00D6 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x086D), + /* 0x00D9 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00DA 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x00DB 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0870), + /* 0x00DE 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00DF 0x03 */ MSCRIPT_CMD_JUMP(0x00AD - 0x00E2), + + /* 0x00E2 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_25_20, 0x00EE - 0x00E7), + /* 0x00E7 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0871), + /* 0x00EA 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00EB 0x03 */ MSCRIPT_CMD_JUMP(0x00A9 - 0x00EE), + + /* 0x00EE 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0872), + /* 0x00F1 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00F2 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0873), + /* 0x00F5 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00F6 0x07 */ MSCRIPT_CMD_CHECK_TEXT_CHOICE(0x0, 0x0114 - 0x00FD, 0x0), + /* 0x00FD 0x05 */ MSCRIPT_CMD_CHECK_RUPEES(10, 0x0108 - 0x0102), + /* 0x0102 0x01 */ MSCRIPT_CMD_PLAY_ERROR(), + /* 0x0103 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0875), + /* 0x0106 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0107 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0108 0x01 */ MSCRIPT_CMD_PLAY_DECIDE(), + /* 0x0109 0x03 */ MSCRIPT_CMD_CHANGE_RUPEES(-10), + /* 0x010C 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_26_40, 0x011A - 0x0111), + /* 0x0111 0x03 */ MSCRIPT_CMD_JUMP(0x00BC - 0x0114), + + /* 0x0114 0x01 */ MSCRIPT_CMD_PLAY_CANCEL(), + /* 0x0115 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0874), + /* 0x0118 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0119 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x011A 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0876), + /* 0x011D 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_25_20), + /* 0x0120 0x03 */ MSCRIPT_CMD_SET_EVENT_INF(EVENTINF_35), + /* 0x0123 0x03 */ MSCRIPT_CMD_EVENT_INF(EVENTINF_36), + /* 0x0126 0x03 */ MSCRIPT_CMD_EVENT_INF(EVENTINF_37), + /* 0x0129 0x03 */ MSCRIPT_CMD_EVENT_INF(EVENTINF_40), + /* 0x012C 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x012D 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x012E 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0131 0x01 */ MSCRIPT_CMD_DONE(), }; -UNK_TYPE D_80A51384[] = { - 0x0E08610C, - 0x16100000, +MsgScript D_80A51384[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0861), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x01 */ MSCRIPT_CMD_UNSET_AUTOTALK(), + /* 0x0005 0x01 */ MSCRIPT_CMD_DONE(), }; -UNK_TYPE D_80A5138C[] = { - 0x1B034000, 0x67001A40, 0x003A1B03, 0x80001A0E, 0x087C0C00, 0x5B20000A, 0x0F087E0C, 0x115B2019, - 0x004E0F08, 0x7B0C1900, 0x470E087D, 0x0C120600, 0x0C000013, 0x000C0C07, 0x00000E08, 0x7E0C111A, - 0x4019002C, 0x1B038000, 0x0B0E087A, 0x0C0F087B, 0x0C19001C, 0x0E08780C, 0x12060005, 0x00001300, - 0x050C0700, 0x000E0879, 0x0C190004, 0x0E08770C, 0x1D03201D, 0x03401D03, 0x801D0401, 0x16100000, +MsgScript D_80A5138C[] = { + /* 0x0000 0x05 */ MSCRIPT_CMD_CHECK_EVENT_INF(EVENTINF_36, 0x006C - 0x0005), + /* 0x0005 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_26_40, 0x0044 - 0x000A), + /* 0x000A 0x05 */ MSCRIPT_CMD_CHECK_EVENT_INF(EVENTINF_37, 0x0029 - 0x000F), + /* 0x000F 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x087C), + /* 0x0012 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0013 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_91_20, 0x0022 - 0x0018), + /* 0x0018 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x087E), + /* 0x001B 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001C 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_91_20), + /* 0x001F 0x03 */ MSCRIPT_CMD_JUMP(0x0070 - 0x0022), + /* 0x0022 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x087B), + /* 0x0025 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0026 0x03 */ MSCRIPT_CMD_JUMP(0x0070 - 0x0029), + /* 0x0029 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x087D), + /* 0x002C 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x002D 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x002E 0x05 */ MSCRIPT_CMD_OFFER_ITEM(GI_HEART_PIECE, 0x0), + /* 0x0033 0x03 */ MSCRIPT_CMD_SET_COLLECTIBLE(0x000C), + /* 0x0036 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0037 0x03 */ MSCRIPT_CMD_AUTOTALK(0x0), + /* 0x003A 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x087E), + /* 0x003D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x003E 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_26_40), + /* 0x0041 0x03 */ MSCRIPT_CMD_JUMP(0x0070 - 0x0044), + /* 0x0044 0x05 */ MSCRIPT_CMD_CHECK_EVENT_INF(EVENTINF_37, 0x0054 - 0x0049), + /* 0x0049 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x087A), + /* 0x004C 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x004D 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x087B), + /* 0x0050 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0051 0x03 */ MSCRIPT_CMD_JUMP(0x0070 - 0x0054), + /* 0x0054 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0878), + /* 0x0057 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0058 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0059 0x05 */ MSCRIPT_CMD_OFFER_ITEM(GI_RUPEE_PURPLE, 0x0), + /* 0x005E 0x03 */ MSCRIPT_CMD_SET_COLLECTIBLE(0x0005), + /* 0x0061 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0062 0x03 */ MSCRIPT_CMD_AUTOTALK(0x0), + /* 0x0065 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0879), + /* 0x0068 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0069 0x03 */ MSCRIPT_CMD_JUMP(0x0070 - 0x006C), + /* 0x006C 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0877), + /* 0x006F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0070 0x03 */ MSCRIPT_CMD_EVENT_INF(EVENTINF_35), + /* 0x0073 0x03 */ MSCRIPT_CMD_EVENT_INF(EVENTINF_36), + /* 0x0076 0x03 */ MSCRIPT_CMD_EVENT_INF(EVENTINF_37), + /* 0x0079 0x03 */ MSCRIPT_CMD_EVENT_INF(EVENTINF_40), + /* 0x007C 0x01 */ MSCRIPT_CMD_UNSET_AUTOTALK(), + /* 0x007D 0x01 */ MSCRIPT_CMD_DONE(), }; ActorInit En_Dnh_InitVars = { @@ -86,7 +261,7 @@ s32 func_80A50D40(Actor* actor, PlayState* play) { return 1; } -void* func_80A50DF8(EnDnh* this, PlayState* play) { +MsgScript* EnDnh_GetMsgScript(EnDnh* this, PlayState* play) { switch (this->unk198) { case 1: return D_80A51384; @@ -105,7 +280,7 @@ s32 func_80A50E40(EnDnh* this, PlayState* play) { return 0; } SubS_SetOfferMode(&this->unk18C, SUBS_OFFER_MODE_NONE, SUBS_OFFER_MODE_MASK); - this->msgEventScript = func_80A50DF8(this, play); + this->msgScript = EnDnh_GetMsgScript(this, play); this->actionFunc = func_80A50F38; return 1; } @@ -121,9 +296,9 @@ void func_80A50EC0(EnDnh* this) { } void func_80A50F38(EnDnh* this, PlayState* play) { - if (func_8010BF58(&this->actor, play, this->msgEventScript, this->msgEventCallback, &this->unk194)) { + if (MsgEvent_RunScript(&this->actor, play, this->msgScript, this->msgScriptCallback, &this->msgScriptPos)) { SubS_SetOfferMode(&this->unk18C, SUBS_OFFER_MODE_ONSCREEN, SUBS_OFFER_MODE_MASK); - this->unk194 = 0; + this->msgScriptPos = 0; this->unk198 = 0; this->actionFunc = EnDnh_DoNothing; } @@ -153,8 +328,8 @@ void EnDnh_Init(Actor* thisx, PlayState* play) { this->actor.draw = NULL; } - this->msgEventCallback = func_80A50D40; - this->unk194 = 0; + this->msgScriptCallback = func_80A50D40; + this->msgScriptPos = 0; this->actionFunc = EnDnh_DoNothing; } diff --git a/src/overlays/actors/ovl_En_Dnh/z_en_dnh.h b/src/overlays/actors/ovl_En_Dnh/z_en_dnh.h index 90f49b84d8..135fdd4809 100644 --- a/src/overlays/actors/ovl_En_Dnh/z_en_dnh.h +++ b/src/overlays/actors/ovl_En_Dnh/z_en_dnh.h @@ -7,20 +7,19 @@ struct EnDnh; typedef void (*EnDnhActionFunc)(struct EnDnh*, PlayState*); -typedef s32 (*MsgEventFunc)(Actor*, PlayState*); typedef struct EnDnh { /* 0x000 */ Actor actor; /* 0x144 */ EnDnhActionFunc actionFunc; /* 0x148 */ SkelAnime skelAnime; /* 0x18C */ u16 unk18C; - /* 0x190 */ s32* msgEventScript; - /* 0x194 */ s32 unk194; + /* 0x190 */ MsgScript* msgScript; + /* 0x194 */ s32 msgScriptPos; /* 0x198 */ s16 unk198; /* 0x19A */ UNK_TYPE1 pad19A[0x2]; /* 0x19C */ s16 blinkTimer; /* 0x19E */ s16 eyeTexIndex; - /* 0x1A0 */ MsgEventFunc msgEventCallback; + /* 0x1A0 */ MsgScriptCallback msgScriptCallback; /* 0x1A4 */ Vec3s jointTable[KOUME_KIOSK_LIMB_MAX]; /* 0x1B0 */ Vec3s morphTable[KOUME_KIOSK_LIMB_MAX]; } EnDnh; // size = 0x1BC diff --git a/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c b/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c index de02c52980..fddb24063e 100644 --- a/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c +++ b/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c @@ -126,8 +126,22 @@ static AnimationInfoS sAnimationInfo[DEKU_PRINCESS_ANIM_MAX] = { { &gDekuPrincessGlareLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, // DEKU_PRINCESS_ANIM_GLARE_LOOP }; -static s32 D_80B3DE58[] = { - 0x00172000, 0x0D040005, 0x0E09670C, 0x100E0968, 0x0C100E09, 0x6F0C0F09, 0x700C1000, +static MsgScript sMsgScript[] = { + /* 0x0000 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_23_20, 0x0012 - 0x0005), + /* 0x0005 0x03 */ MSCRIPT_CMD_CHECK_HUMAN(0x000D - 0x0008), + /* 0x0008 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0967), + /* 0x000B 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000C 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x000D 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0968), + /* 0x0010 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0011 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0012 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x096F), + /* 0x0015 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0016 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0970), + /* 0x0019 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001A 0x01 */ MSCRIPT_CMD_DONE(), }; s32 func_80B3CA20(EnDnp* this) { @@ -367,7 +381,7 @@ void func_80B3D338(EnDnp* this, PlayState* play) { } void func_80B3D3F8(EnDnp* this, PlayState* play) { - if (func_8010BF58(&this->actor, play, D_80B3DE58, NULL, &this->unk_328)) { + if (MsgEvent_RunScript(&this->actor, play, sMsgScript, NULL, &this->msgScriptPos)) { SubS_SetOfferMode(&this->unk_322, SUBS_OFFER_MODE_ONSCREEN, SUBS_OFFER_MODE_MASK); this->unk_322 &= ~8; this->actionFunc = func_80B3D2D4; diff --git a/src/overlays/actors/ovl_En_Dnp/z_en_dnp.h b/src/overlays/actors/ovl_En_Dnp/z_en_dnp.h index 4bd0fe14c1..0be2d1f3c1 100644 --- a/src/overlays/actors/ovl_En_Dnp/z_en_dnp.h +++ b/src/overlays/actors/ovl_En_Dnp/z_en_dnp.h @@ -29,7 +29,7 @@ typedef struct EnDnp { /* 0x286 */ Vec3s morphTable[DEKU_PRINCESS_LIMB_MAX]; /* 0x322 */ u16 unk_322; /* 0x324 */ u8 cueId; - /* 0x328 */ s32 unk_328; + /* 0x328 */ s32 msgScriptPos; /* 0x32C */ UNK_TYPE1 unk_32C[0x2]; /* 0x32E */ s16 unk_32E; /* 0x330 */ s16 unk_330; diff --git a/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c b/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c index 8e3422ab9f..762f8de74e 100644 --- a/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c +++ b/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c @@ -20,9 +20,45 @@ void EnDnq_Draw(Actor* thisx, PlayState* play); void func_80A52FB8(EnDnq* this, PlayState* play); -static s32 D_80A53400[] = { - 0x00120100, 0x150E0899, 0x0C120F08, 0x9A0C0F08, 0x9B0C0F08, 0x9C0C1112, 0x01100E08, 0x980C1000, 0x00120200, - 0x0C0E089D, 0x0C0F089E, 0x0C111202, 0x100E089F, 0x0C100000, 0x0E08A10C, 0x0F08A20C, 0x10000000, +static MsgScript D_80A53400[] = { + /* 0x0000 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_18_01, 0x001A - 0x0005), + /* 0x0005 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0899), + /* 0x0008 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0009 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x000A 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x089A), + /* 0x000D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000E 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x089B), + /* 0x0011 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0012 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x089C), + /* 0x0015 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0016 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_18_01), + /* 0x0019 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x001A 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0898), + /* 0x001D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001E 0x01 */ MSCRIPT_CMD_DONE(), +}; + +static MsgScript D_80A53420[] = { + /* 0x0000 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_18_02, 0x0011 - 0x0005), + /* 0x0005 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x089D), + /* 0x0008 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0009 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x089E), + /* 0x000C 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000D 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_18_02), + /* 0x0010 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0011 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x089F), + /* 0x0014 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0015 0x01 */ MSCRIPT_CMD_DONE(), +}; + +static MsgScript D_80A53438[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x08A1), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x08A2), + /* 0x0007 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0008 0x01 */ MSCRIPT_CMD_DONE(), }; ActorInit En_Dnq_InitVars = { @@ -340,16 +376,16 @@ void func_80A52C6C(EnDnq* this, PlayState* play) { this->picto.actor.xzDistToPlayer = Math_Vec3f_DistXZ(&sp28, &sp1C); } -s32* func_80A52CF8(EnDnq* this, PlayState* play) { +MsgScript* EnDnq_GetMsgScript(EnDnq* this, PlayState* play) { if (CHECK_WEEKEVENTREG(WEEKEVENTREG_23_20)) { - return &D_80A53400[14]; + return D_80A53438; } if (this->unk_3A4 != 0) { - return &D_80A53400[8]; + return D_80A53420; } - return &D_80A53400[0]; + return D_80A53400; } s32 func_80A52D44(EnDnq* this, PlayState* play) { @@ -358,7 +394,7 @@ s32 func_80A52D44(EnDnq* this, PlayState* play) { if (((this->unk_37C & SUBS_OFFER_MODE_MASK) != SUBS_OFFER_MODE_NONE) && Actor_TalkOfferAccepted(&this->picto.actor, &play->state)) { SubS_SetOfferMode(&this->unk_37C, SUBS_OFFER_MODE_NONE, SUBS_OFFER_MODE_MASK); - this->unk_380 = func_80A52CF8(this, play); + this->msgScript = EnDnq_GetMsgScript(this, play); this->actionFunc = func_80A52FB8; ret = true; } @@ -411,7 +447,7 @@ void func_80A52DC8(EnDnq* this, PlayState* play) { void func_80A52FB8(EnDnq* this, PlayState* play) { s16 sp2E = this->picto.actor.yawTowardsPlayer; - if (func_8010BF58(&this->picto.actor, play, this->unk_380, NULL, &this->unk_1E0)) { + if (MsgEvent_RunScript(&this->picto.actor, play, this->msgScript, NULL, &this->msgScriptPos)) { SubS_SetOfferMode(&this->unk_37C, SUBS_OFFER_MODE_ONSCREEN, SUBS_OFFER_MODE_MASK); this->unk_386 = 0; this->actionFunc = func_80A52DC8; diff --git a/src/overlays/actors/ovl_En_Dnq/z_en_dnq.h b/src/overlays/actors/ovl_En_Dnq/z_en_dnq.h index ddb6616a28..661c06060a 100644 --- a/src/overlays/actors/ovl_En_Dnq/z_en_dnq.h +++ b/src/overlays/actors/ovl_En_Dnq/z_en_dnq.h @@ -15,13 +15,13 @@ typedef struct EnDnq { /* 0x18C */ EnDnqActionFunc actionFunc; /* 0x190 */ ColliderCylinder collider; /* 0x1DC */ u8 cueId; - /* 0x1E0 */ s32 unk_1E0; + /* 0x1E0 */ s32 msgScriptPos; /* 0x1E4 */ Vec3s jointTable[DEKU_KING_LIMB_MAX]; /* 0x2AA */ Vec3s morphTable[DEKU_KING_LIMB_MAX]; /* 0x370 */ Vec3f unk_370; /* 0x37C */ u16 unk_37C; /* 0x37E */ s16 unk_37E; - /* 0x380 */ s32* unk_380; + /* 0x380 */ MsgScript* msgScript; /* 0x384 */ s16 unk_384; /* 0x386 */ s16 unk_386; /* 0x388 */ s16 unk_388; diff --git a/src/overlays/actors/ovl_En_Dns/z_en_dns.c b/src/overlays/actors/ovl_En_Dns/z_en_dns.c index 0b1076a275..2c41acb897 100644 --- a/src/overlays/actors/ovl_En_Dns/z_en_dns.c +++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.c @@ -19,10 +19,64 @@ void func_8092D330(EnDns* this, PlayState* play); void EnDns_DoNothing(EnDns* this, PlayState* play); void func_8092D4D8(EnDns* this, PlayState* play); -static s32 D_8092DCB0[] = { - 0x00172000, 0x050E082F, 0x0C100E08, 0x200C1000, 0x00172000, 0x050E0830, 0x0C100E08, 0x210C1000, - 0x00172000, 0x050E0831, 0x0C100E08, 0x220C1000, 0x00172000, 0x050E0832, 0x0C100E08, 0x230C1000, - 0x0E08330C, 0x09000015, 0x1C014016, 0x10000000, 0x0E082E0C, 0x10000000, +static MsgScript D_8092DCB0[] = { + /* 0x0000 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_23_20, 0x000A - 0x0005), + /* 0x0005 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x082F), + /* 0x0008 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0009 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x000A 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0820), + /* 0x000D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000E 0x01 */ MSCRIPT_CMD_DONE(), +}; + +static MsgScript D_8092DCC0[] = { + /* 0x0000 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_23_20, 0x000A - 0x0005), + /* 0x0005 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0830), + /* 0x0008 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0009 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x000A 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0821), + /* 0x000D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000E 0x01 */ MSCRIPT_CMD_DONE(), +}; + +static MsgScript D_8092DCD0[] = { + /* 0x0000 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_23_20, 0x000A - 0x0005), + /* 0x0005 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0831), + /* 0x0008 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0009 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x000A 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0822), + /* 0x000D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000E 0x01 */ MSCRIPT_CMD_DONE(), +}; + +static MsgScript D_8092DCE0[] = { + /* 0x0000 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_23_20, 0x000A - 0x0005), + /* 0x0005 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0832), + /* 0x0008 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0009 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x000A 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0823), + /* 0x000D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000E 0x01 */ MSCRIPT_CMD_DONE(), +}; + +static MsgScript D_8092DCF0[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0833), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0007 0x01 */ MSCRIPT_CMD_PAUSE(), + /* 0x0008 0x03 */ MSCRIPT_CMD_SET_EVENT_INF(EVENTINF_16), + /* 0x000B 0x01 */ MSCRIPT_CMD_UNSET_AUTOTALK(), + /* 0x000C 0x01 */ MSCRIPT_CMD_DONE(), +}; + +static MsgScript D_8092DD00[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x082E), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x01 */ MSCRIPT_CMD_DONE(), }; ActorInit En_Dns_InitVars = { @@ -178,29 +232,29 @@ void func_8092C934(EnDns* this) { } } -s32* func_8092C9BC(EnDns* this, PlayState* play) { +MsgScript* EnDns_GetMsgScript(EnDns* this, PlayState* play) { Player* player = GET_PLAYER(play); if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_23_20)) { if (player->transformation != PLAYER_FORM_DEKU) { - return &D_8092DCB0[16]; + return D_8092DCF0; } else if (this->unk_2FC != 0) { - return &D_8092DCB0[20]; + return D_8092DD00; } } switch (ENDNS_GET_7(&this->actor)) { case ENDNS_GET_7_0: - return &D_8092DCB0[0]; + return D_8092DCB0; case ENDNS_GET_7_1: - return &D_8092DCB0[4]; + return D_8092DCC0; case ENDNS_GET_7_2: - return &D_8092DCB0[8]; + return D_8092DCD0; case ENDNS_GET_7_3: - return &D_8092DCB0[12]; + return D_8092DCE0; default: return NULL; @@ -241,7 +295,7 @@ s32 func_8092CAD0(EnDns* this, PlayState* play) { } this->unk_2DA = this->actor.world.rot.y; } - this->unk_1E0 = func_8092C9BC(this, play); + this->msgScript = EnDns_GetMsgScript(this, play); this->actionFunc = func_8092D4D8; ret = true; } @@ -285,9 +339,9 @@ s32 func_8092CC68(PlayState* play) { return ret; } -s32 func_8092CCEC(EnDns* this, PlayState* play) { +s32 func_8092CCEC(Actor* thisx, PlayState* play) { Player* player = GET_PLAYER(play); - s32 pad; + EnDns* this = THIS; Vec3f sp3C = player->actor.world.pos; Vec3f sp30 = this->actor.world.pos; s16 sp2E; @@ -406,11 +460,11 @@ void func_8092D1B8(EnDns* this, PlayState* play) { SubS_SetOfferMode(&this->unk_2C6, SUBS_OFFER_MODE_AUTO, SUBS_OFFER_MODE_MASK); Audio_PlaySfx(NA_SE_SY_FOUND); SET_EVENTINF(EVENTINF_15); - this->unk_2F4 = func_8092CCEC; + this->msgScriptCallback = func_8092CCEC; EnDns_ChangeAnim(this, EN_DNS_ANIM_WALK); this->actionFunc = EnDns_DoNothing; } else if (CHECK_EVENTINF(EVENTINF_16)) { - func_8092CCEC(this, play); + func_8092CCEC(&this->actor, play); EnDns_ChangeAnim(this, EN_DNS_ANIM_WALK); this->actionFunc = func_8092D330; } @@ -455,9 +509,9 @@ void func_8092D4D8(EnDns* this, PlayState* play) { if (func_8092CE38(this)) { EnDns_ChangeAnim(this, EN_DNS_ANIM_WALK); } - } else if (func_8010BF58(&this->actor, play, this->unk_1E0, this->unk_2F4, &this->unk_1DC)) { + } else if (MsgEvent_RunScript(&this->actor, play, this->msgScript, this->msgScriptCallback, &this->msgScriptPos)) { SubS_SetOfferMode(&this->unk_2C6, SUBS_OFFER_MODE_ONSCREEN, SUBS_OFFER_MODE_MASK); - this->unk_2F4 = NULL; + this->msgScriptCallback = NULL; if (ENDNS_GET_4000(&this->actor)) { if (!CHECK_EVENTINF(EVENTINF_15)) { this->skelAnime.curFrame = this->animCurFrame; diff --git a/src/overlays/actors/ovl_En_Dns/z_en_dns.h b/src/overlays/actors/ovl_En_Dns/z_en_dns.h index 5b926f9db8..d585d62b2a 100644 --- a/src/overlays/actors/ovl_En_Dns/z_en_dns.h +++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.h @@ -7,7 +7,6 @@ struct EnDns; typedef void (*EnDnsActionFunc)(struct EnDns*, PlayState*); -typedef s32 (*EnDnsFunc)(struct EnDns*, PlayState*); #define ENDNS_GET_7(thisx) ((thisx)->params & 7) #define ENDNS_GET_4000(thisx) ((thisx)->params & 0x4000) @@ -26,8 +25,8 @@ typedef struct EnDns { /* 0x188 */ EnDnsActionFunc actionFunc; /* 0x18C */ ColliderCylinder collider; /* 0x1D8 */ u8 cueId; - /* 0x1DC */ s32 unk_1DC; - /* 0x1E0 */ s32* unk_1E0; + /* 0x1DC */ s32 msgScriptPos; + /* 0x1E0 */ MsgScript* msgScript; /* 0x1E4 */ Gfx* unk_1E4[KINGS_CHAMBER_DEKU_GUARD_LIMB_MAX]; /* 0x218 */ Vec3f unk_218; /* 0x224 */ Vec3s unk_224; @@ -51,7 +50,7 @@ typedef struct EnDns { /* 0x2E8 */ UNK_TYPE1 unk_2E8[0x4]; /* 0x2EC */ f32 unk_2EC; /* 0x2F0 */ f32 animCurFrame; - /* 0x2F4 */ EnDnsFunc unk_2F4; + /* 0x2F4 */ MsgScriptCallback msgScriptCallback; /* 0x2F8 */ s32 animIndex; /* 0x2FC */ s32 unk_2FC; } EnDns; // size = 0x300 diff --git a/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c b/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c index 48f85871c4..265899e364 100644 --- a/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c +++ b/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c @@ -4,7 +4,6 @@ * Description: Fishing Pond Elements (Owner, Fish, Props, Effects...) */ -#include "prevent_bss_reordering.h" #include "z_en_fishing.h" #include "z64rumble.h" #include "z64shrink_window.h" diff --git a/src/overlays/actors/ovl_En_Gb2/z_en_gb2.c b/src/overlays/actors/ovl_En_Gb2/z_en_gb2.c index 60472c2eb1..dbb9a21130 100644 --- a/src/overlays/actors/ovl_En_Gb2/z_en_gb2.c +++ b/src/overlays/actors/ovl_En_Gb2/z_en_gb2.c @@ -697,9 +697,7 @@ void func_80B10A48(EnGb2* this, PlayState* play) { } void func_80B10B5C(EnGb2* this, PlayState* play) { - s32 mask = Player_GetMask(play); - - if (this->unk_28C != mask) { + if (Player_GetMask(play) != this->unk_28C) { this->unk_28C = Player_GetMask(play); this->unk_26C &= ~0x80; this->unk_26C &= ~0x20; diff --git a/src/overlays/actors/ovl_En_Gm/z_en_gm.c b/src/overlays/actors/ovl_En_Gm/z_en_gm.c index fed5040cc8..4cf65f82f6 100644 --- a/src/overlays/actors/ovl_En_Gm/z_en_gm.c +++ b/src/overlays/actors/ovl_En_Gm/z_en_gm.c @@ -25,38 +25,234 @@ static s32 D_80951A0C[] = { -1, 1, 4, 1, -1, 1, -1, -1, -1, 0, 2, 3, 5, 6, 8, 1, 0, 8, 3, 6, 0, 1, 4, 7, 0, 1, 2, 4, 5, 7, 1, }; -static s32 D_80951A88[] = { 0x0E2AB92D, 0x000A0C10 }; - -static s32 D_80951A90[] = { 0x0E2ABA2D, 0x000A0C10 }; - -static s32 D_80951A98[] = { - 0x00564000, 0x1A090000, 0x0E2AA40C, 0x09000017, 0x0E2AA52D, 0x000A0C09, 0x00001211, 0x56401009, - 0x00000E2A, 0xEC0C0900, 0x00170E2A, 0xED0C0900, 0x00180E2A, 0xEE2D000A, 0x0C090000, 0x12100000, +static MsgScript D_80951A88[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AB9), + /* 0x0003 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_GORMAN), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x01 */ MSCRIPT_CMD_DONE(), }; -static s32 D_80951AD8[] = { - 0x00562000, 0xA1090000, 0x0E2AA60C, 0x09000017, 0x0E2AA70C, 0x09000018, 0x0E2AA80C, 0x09000017, - 0x0E2AA90C, 0x09000018, 0x0E2AAA0C, 0x09000017, 0x0E2AAB0C, 0x09000018, 0x0E2AAC0C, 0x09000017, - 0x0E2AAD0C, 0x0F2AAE0C, 0x09000017, 0x0E2AAF0C, 0x09000017, 0x0E2AB00C, 0x09000018, 0x0E2AB10C, - 0x09000017, 0x0E2AB20C, 0x09000017, 0x0E2AB30C, 0x09000017, 0x0E2AB40C, 0x09000018, 0x0E2AB50C, - 0x09000017, 0x0E2AB60C, 0x09000018, 0x0E2AB70C, 0x09000017, 0x0E2AB82D, 0x00082D00, 0x092D000A, - 0x0C115620, 0x12100900, 0x000E2AEA, 0x0C090000, 0x170E2AEB, 0x2D00082D, 0x000A0C09, 0x00001210, +static MsgScript D_80951A90[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2ABA), + /* 0x0003 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_GORMAN), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x01 */ MSCRIPT_CMD_DONE(), }; -static s32 D_80951B98[] = { - 0x004B0100, 0x42090000, 0x0900000E, 0x2B010C09, 0x0000170E, 0x2B020C09, 0x0000180E, - 0x2B030C09, 0x0000170E, 0x2B040C0F, 0x2B050C09, 0x0000180E, 0x2B060C09, 0x0000170E, - 0x2B072D00, 0x0A0C114B, 0x01150900, 0x0012100E, 0x2B082D00, 0x0A0C1210, +static MsgScript D_80951A98[] = { + /* 0x0000 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_86_40, 0x001F - 0x0005), + /* 0x0005 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0008 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AA4), + /* 0x000B 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000C 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x000F 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0010 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AA5), + /* 0x0013 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_GORMAN), + /* 0x0016 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0017 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x001A 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x001B 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_86_40), + /* 0x001E 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x001F 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0022 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AEC), + /* 0x0025 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0026 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0029 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x002A 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AED), + /* 0x002D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x002E 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0031 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x0032 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AEE), + /* 0x0035 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_GORMAN), + /* 0x0038 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0039 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x003C 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x003D 0x01 */ MSCRIPT_CMD_DONE(), }; -static s32 D_80951BE8[] = { - 0x09000000, 0x32010031, 0x00338000, 0x2C004B02, 0x000D0E2B, 0x132D000A, 0x0C114B02, 0x1900150E, 0x2B140C0F, - 0x2B150C0F, 0x2B160C0F, 0x2B170C0F, 0x2B180C15, 0x09000012, 0x100E2B12, 0x2D000A0C, 0x10000000, +static MsgScript D_80951AD8[] = { + /* 0x0000 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_86_20, 0x00A6 - 0x0005), + /* 0x0005 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0008 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AA6), + /* 0x000B 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000C 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x000F 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0010 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AA7), + /* 0x0013 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0014 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0017 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x0018 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AA8), + /* 0x001B 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001C 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x001F 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0020 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AA9), + /* 0x0023 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0024 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0027 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x0028 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AAA), + /* 0x002B 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x002C 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x002F 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0030 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AAB), + /* 0x0033 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0034 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0037 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x0038 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AAC), + /* 0x003B 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x003C 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x003F 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0040 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AAD), + /* 0x0043 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0044 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2AAE), + /* 0x0047 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0048 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x004B 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x004C 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AAF), + /* 0x004F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0050 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0053 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0054 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AB0), + /* 0x0057 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0058 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x005B 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x005C 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AB1), + /* 0x005F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0060 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0063 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0064 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AB2), + /* 0x0067 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0068 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x006B 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x006C 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AB3), + /* 0x006F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0070 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0073 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0074 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AB4), + /* 0x0077 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0078 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x007B 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x007C 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AB5), + /* 0x007F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0080 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0083 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0084 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AB6), + /* 0x0087 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0088 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x008B 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x008C 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AB7), + /* 0x008F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0090 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0093 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0094 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AB8), + /* 0x0097 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_MADAME_AROMA), + /* 0x009A 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_TOTO), + /* 0x009D 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_GORMAN), + /* 0x00A0 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00A1 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_86_20), + /* 0x00A4 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x00A5 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x00A6 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x00A9 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AEA), + /* 0x00AC 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00AD 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x00B0 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x00B1 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AEB), + /* 0x00B4 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_MADAME_AROMA), + /* 0x00B7 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_GORMAN), + /* 0x00BA 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00BB 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x00BE 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x00BF 0x01 */ MSCRIPT_CMD_DONE(), }; -static s32 D_80951C2C[] = { 0x0E295A2D, 0x000A0C10 }; +static MsgScript D_80951B98[] = { + /* 0x0000 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_75_01, 0x0047 - 0x0005), + /* 0x0005 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0008 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x000B 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2B01), + /* 0x000E 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000F 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0012 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0013 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2B02), + /* 0x0016 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0017 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x001A 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x001B 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2B03), + /* 0x001E 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001F 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0022 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0023 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2B04), + /* 0x0026 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0027 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2B05), + /* 0x002A 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x002B 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x002E 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x002F 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2B06), + /* 0x0032 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0033 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0036 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0037 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2B07), + /* 0x003A 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_GORMAN), + /* 0x003D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x003E 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_75_01), + /* 0x0041 0x01 */ MSCRIPT_CMD_PAUSE(), + /* 0x0042 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0045 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0046 0x01 */ MSCRIPT_CMD_DONE(), -static s32 D_80951C34[] = { 0x0E29622D, 0x000A0C10 }; + /* 0x0047 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2B08), + /* 0x004A 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_GORMAN), + /* 0x004D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x004E 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x004F 0x01 */ MSCRIPT_CMD_DONE(), +}; + +static MsgScript D_80951BE8[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0003 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_50_01, 0x0039 - 0x0008), + /* 0x0008 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_51_80, 0x0039 - 0x000D), + /* 0x000D 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_75_02, 0x001F - 0x0012), + /* 0x0012 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2B13), + /* 0x0015 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_GORMAN), + /* 0x0018 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0019 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_75_02), + /* 0x001C 0x03 */ MSCRIPT_CMD_JUMP(0x0034 - 0x001F), + /* 0x001F 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2B14), + /* 0x0022 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0023 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2B15), + /* 0x0026 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0027 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2B16), + /* 0x002A 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x002B 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2B17), + /* 0x002E 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x002F 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2B18), + /* 0x0032 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0033 0x01 */ MSCRIPT_CMD_PAUSE(), + /* 0x0034 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0037 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0038 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0039 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2B12), + /* 0x003C 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_GORMAN), + /* 0x003F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0040 0x01 */ MSCRIPT_CMD_DONE(), +}; + +static MsgScript D_80951C2C[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x295A), + /* 0x0003 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_GORMAN), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x01 */ MSCRIPT_CMD_DONE(), +}; + +static MsgScript D_80951C34[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2962), + /* 0x0003 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_GORMAN), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x01 */ MSCRIPT_CMD_DONE(), +}; ActorInit En_Gm_InitVars = { /**/ ACTOR_EN_GM, @@ -372,8 +568,8 @@ s16 func_8094E4D0(EnGm* this, s32 numCutscenes) { return csId; } -s32 func_8094E52C(EnGm* this, PlayState* play) { - s32 pad; +s32 func_8094E52C(Actor* thisx, PlayState* play) { + EnGm* this = THIS; s16 csId = func_8094E4D0(this, 0); s32 ret = false; @@ -415,8 +611,8 @@ s32 func_8094E52C(EnGm* this, PlayState* play) { return ret; } -s32 func_8094E69C(EnGm* this, PlayState* play) { - Camera* subCam; +s32 func_8094E69C(Actor* thisx, PlayState* play) { + EnGm* this = (EnGm*)thisx; s16 csId = func_8094E4D0(this, 0); s16 sp48; Vec3f sp3C; @@ -458,8 +654,8 @@ s32 func_8094E69C(EnGm* this, PlayState* play) { if (func_8094E454(this, csId)) { case 4: case 6: - subCam = Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(csId)); - Camera_SetTargetActor(subCam, &this->actor); + sp48 = CutsceneManager_GetCurrentSubCamId(csId); + Camera_SetTargetActor(Play_GetCamera(play, sp48), &this->actor); this->unk_3E0++; ret = true; } @@ -469,8 +665,8 @@ s32 func_8094E69C(EnGm* this, PlayState* play) { case 5: case 7: if ((this->actor.child != NULL) && (this->actor.child->update != NULL)) { - subCam = Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(csId)); - Camera_SetTargetActor(subCam, this->actor.child); + sp48 = CutsceneManager_GetCurrentSubCamId(csId); + Camera_SetTargetActor(Play_GetCamera(play, sp48), this->actor.child); } this->unk_3E0++; ret = true; @@ -504,8 +700,9 @@ s32 func_8094E69C(EnGm* this, PlayState* play) { return ret; } -s32 func_8094EA34(EnGm* this, PlayState* play) { - s32 pad[2]; +s32 func_8094EA34(Actor* thisx, PlayState* play) { + EnGm* this = THIS; + s32 pad; Actor* al; Actor* toto; @@ -554,8 +751,9 @@ s32 func_8094EA34(EnGm* this, PlayState* play) { return true; } -s32 func_8094EB1C(EnGm* this, PlayState* play) { - s32 pad[2]; +s32 func_8094EB1C(Actor* thisx, PlayState* play) { + EnGm* this = THIS; + s32 pad; s32 ret = false; s16 oldYaw; @@ -608,22 +806,22 @@ s32 func_8094EB1C(EnGm* this, PlayState* play) { return ret; } -s32* func_8094EDBC(EnGm* this, PlayState* play) { +MsgScript* EnGm_GetMsgScript(EnGm* this, PlayState* play) { switch (this->unk_258) { case 1: - this->unk_3E4 = func_8094E52C; + this->msgScriptCallback = func_8094E52C; return D_80951A98; case 2: - this->unk_3E4 = func_8094EA34; + this->msgScriptCallback = func_8094EA34; return D_80951AD8; case 3: - this->unk_3E4 = func_8094E69C; + this->msgScriptCallback = func_8094E69C; return D_80951B98; case 5: - this->unk_3E4 = func_8094EB1C; + this->msgScriptCallback = func_8094EB1C; return D_80951BE8; case 7: @@ -664,9 +862,9 @@ s32 func_8094EE84(EnGm* this, PlayState* play) { Actor_TalkOfferAccepted(&this->actor, &play->state)) { SubS_SetOfferMode(&this->unk_3A4, SUBS_OFFER_MODE_NONE, SUBS_OFFER_MODE_MASK); this->unk_3E0 = 0; - this->unk_3E4 = NULL; + this->msgScriptCallback = NULL; this->actor.child = this->unk_268; - this->unk_264 = func_8094EDBC(this, play); + this->msgScript = EnGm_GetMsgScript(this, play); if ((this->unk_258 == 5) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_50_01) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_51_80) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_75_02)) { @@ -933,7 +1131,7 @@ s32 func_8094F7D0(EnGm* this, PlayState* play, ScheduleOutput* scheduleOutput, u } s32 func_8094F904(EnGm* this, PlayState* play, ScheduleOutput* scheduleOutput) { - u16 sp56 = SCHEDULE_TIME_NOW; + u16 sp56 = SCRIPT_TIME_NOW; u8 pathIndex = ENGM_GET_PATH_INDEX(&this->actor); EnDoor* door; Vec3s* sp4C; @@ -979,7 +1177,7 @@ s32 func_8094F904(EnGm* this, PlayState* play, ScheduleOutput* scheduleOutput) { } s32 func_8094FAC4(EnGm* this, PlayState* play, ScheduleOutput* scheduleOutput) { - u16 sp2E = SCHEDULE_TIME_NOW; + u16 sp2E = SCRIPT_TIME_NOW; u16 phi_v1; u8 pathIndex = ENGM_GET_PATH_INDEX(&this->actor); u16 tmp; @@ -1540,7 +1738,7 @@ void func_80950DB8(EnGm* this, PlayState* play) { Vec3f sp34; Actor* al; - if (func_8010BF58(&this->actor, play, this->unk_264, this->unk_3E4, &this->unk_25C)) { + if (MsgEvent_RunScript(&this->actor, play, this->msgScript, this->msgScriptCallback, &this->msgScriptPos)) { SubS_SetOfferMode(&this->unk_3A4, SUBS_OFFER_MODE_ONSCREEN, SUBS_OFFER_MODE_MASK); al = EnGm_FindActor(this, play, ACTORCAT_NPC, ACTOR_EN_AL); if ((this->unk_258 == 2) && (al != NULL) && (al->update != NULL)) { @@ -1551,7 +1749,7 @@ void func_80950DB8(EnGm* this, PlayState* play) { } this->unk_3A4 |= 0x200; this->unk_3C6 = 20; - this->unk_25C = 0; + this->msgScriptPos = 0; this->actionFunc = func_80950CDC; } else if ((this->unk_258 != 1) && (this->unk_258 != 2) && (this->unk_258 != 3) && (this->unk_258 != 5) && (this->unk_258 != 7)) { diff --git a/src/overlays/actors/ovl_En_Gm/z_en_gm.h b/src/overlays/actors/ovl_En_Gm/z_en_gm.h index e5785d837b..51b9cb780a 100644 --- a/src/overlays/actors/ovl_En_Gm/z_en_gm.h +++ b/src/overlays/actors/ovl_En_Gm/z_en_gm.h @@ -7,7 +7,6 @@ struct EnGm; typedef void (*EnGmActionFunc)(struct EnGm*, PlayState*); -typedef s32 (*EnGmUnkFunc)(struct EnGm*, PlayState*); typedef void (*EnGmUnkFunc2)(struct EnGm*, PlayState*); #define ENGM_GET_PATH_INDEX(thisx) ((thisx)->params & 0xFF) @@ -30,11 +29,11 @@ typedef struct EnGm { /* 0x254 */ s32 timePathElapsedTime; /* 0x258 */ u8 unk_258; /* 0x259 */ u8 cueId; - /* 0x25C */ s32 unk_25C; + /* 0x25C */ s32 msgScriptPos; /* 0x260 */ s8 unk_260; /* 0x261 */ s8 unk_261; /* 0x262 */ s8 objectSlot; - /* 0x264 */ s32* unk_264; + /* 0x264 */ MsgScript* msgScript; /* 0x268 */ Actor* unk_268; /* 0x26C */ UNK_TYPE1 unk_26C[0xC]; /* 0x278 */ Vec3f unk_278; @@ -69,7 +68,7 @@ typedef struct EnGm { /* 0x3DE */ s16 unk_3DE; /* 0x3E0 */ s16 unk_3E0; /* 0x3E2 */ s16 unk_3E2; - /* 0x3E4 */ EnGmUnkFunc unk_3E4; + /* 0x3E4 */ MsgScriptCallback msgScriptCallback; /* 0x3E8 */ s32 animIndex; /* 0x3EC */ UNK_TYPE1 unk3EC[0x4]; /* 0x3F0 */ s32 prevTalkState; diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.c b/src/overlays/actors/ovl_En_Go/z_en_go.c index f1f0ee365e..985cef84bb 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -124,70 +124,455 @@ void EnGo_Snowball(EnGo* this, PlayState* play); void EnGo_Talk(EnGo* this, PlayState* play); // MsgEvent script for the Goron who made Darmani's grave in the mountain village. -static s32 sMsgScriptGoronGravemaker[] = { - 0x00150800, 0x40010022, 0x00150200, 0x180E0E10, 0x0C0F0E11, 0x0C0F0E12, 0x0C0F0E13, 0x0C0F0E14, 0x0C111502, - 0x100E0E15, 0x0C100015, 0x0400110E, 0x0E160C0F, 0x0E170C0F, 0x0E180C11, 0x15041610, 0x0E0E190C, 0x10001504, - 0x000D0100, 0x050E0E31, 0x0C100E0E, 0x2F0C1001, 0x00050E0E, 0x2D0C100E, 0x0E2B0C10, +static MsgScript sMsgScriptGoronGravemaker[] = { + /* 0x0000 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_TALKED_THAWED_GRAVEYARD_GORON, 0x0045 - 0x0005), + /* 0x0005 0x03 */ MSCRIPT_CMD_CHECK_GORON(0x002A - 0x0008), + /* 0x0008 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_21_02, 0x0025 - 0x000D), + /* 0x000D 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0E10), + /* 0x0010 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0011 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0E11), + /* 0x0014 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0015 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0E12), + /* 0x0018 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0019 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0E13), + /* 0x001C 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001D 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0E14), + /* 0x0020 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0021 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_21_02), + /* 0x0024 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0025 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0E15), + /* 0x0028 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0029 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x002A 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_TALKED_GORON_GRAVEMAKER_AS_GORON, 0x0040 - 0x002F), + /* 0x002F 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0E16), + /* 0x0032 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0033 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0E17), + /* 0x0036 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0037 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0E18), + /* 0x003A 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x003B 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_TALKED_GORON_GRAVEMAKER_AS_GORON), + /* 0x003E 0x01 */ MSCRIPT_CMD_UNSET_AUTOTALK(), + /* 0x003F 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0040 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0E19), + /* 0x0043 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0044 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0045 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_TALKED_GORON_GRAVEMAKER_AS_GORON, 0x0057 - 0x004A), + /* 0x004A 0x03 */ MSCRIPT_CMD_CHECK_GORON(0x0052 - 0x004D), + /* 0x004D 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0E31), + /* 0x0050 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0051 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0052 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0E2F), + /* 0x0055 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0056 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0057 0x03 */ MSCRIPT_CMD_CHECK_GORON(0x005F - 0x005A), + /* 0x005A 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0E2D), + /* 0x005D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x005E 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x005F 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0E2B), + /* 0x0062 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0063 0x01 */ MSCRIPT_CMD_DONE(), }; // MsgEvent script for the frozen Goron aside the gravemaker in the mountain village. -static s32 sMsgScriptGoronFrozen[] = { - 0x00150800, 0x7E01004D, 0x00150400, 0x180E0E1A, 0x0C170F0E, 0x230C180F, 0x0E240C0F, 0x0E250C12, 0x16111508, - 0x100E0E1A, 0x0C170F0E, 0x230C180F, 0x0E240C0F, 0x0E250C17, 0x0F0E260C, 0x180F0E27, 0x0C170F0E, 0x280C180F, - 0x0E290C17, 0x0F0E2A0C, 0x16111508, 0x100E0E1A, 0x0C170F0E, 0x1B0C180F, 0x0E1C0C0F, 0x0E1D0C0F, 0x0E1E0C17, - 0x0F0E1F0C, 0x180F0E20, 0x0C170F0E, 0x210C0F0E, 0x220C1611, 0x15081000, 0x1504000D, 0x0100050E, 0x0E320C10, - 0x0E0E300C, 0x10010005, 0x0E0E2E0C, 0x100E0E2C, 0x0C100000, +static MsgScript sMsgScriptGoronFrozen[] = { + /* 0x0000 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_TALKED_THAWED_GRAVEYARD_GORON, 0x0083 - 0x0005), + /* 0x0005 0x03 */ MSCRIPT_CMD_CHECK_GORON(0x0055 - 0x0008), + /* 0x0008 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_TALKED_GORON_GRAVEMAKER_AS_GORON, 0x0025 - 0x000D), + /* 0x000D 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0E1A), + /* 0x0010 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0011 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0012 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0E23), + /* 0x0015 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0016 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x0017 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0E24), + /* 0x001A 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001B 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0E25), + /* 0x001E 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001F 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0020 0x01 */ MSCRIPT_CMD_UNSET_AUTOTALK(), + /* 0x0021 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_TALKED_THAWED_GRAVEYARD_GORON), + /* 0x0024 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0025 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0E1A), + /* 0x0028 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0029 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x002A 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0E23), + /* 0x002D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x002E 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x002F 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0E24), + /* 0x0032 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0033 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0E25), + /* 0x0036 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0037 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0038 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0E26), + /* 0x003B 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x003C 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x003D 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0E27), + /* 0x0040 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0041 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0042 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0E28), + /* 0x0045 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0046 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x0047 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0E29), + /* 0x004A 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x004B 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x004C 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0E2A), + /* 0x004F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0050 0x01 */ MSCRIPT_CMD_UNSET_AUTOTALK(), + /* 0x0051 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_TALKED_THAWED_GRAVEYARD_GORON), + /* 0x0054 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0055 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0E1A), + /* 0x0058 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0059 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x005A 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0E1B), + /* 0x005D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x005E 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x005F 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0E1C), + /* 0x0062 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0063 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0E1D), + /* 0x0066 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0067 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0E1E), + /* 0x006A 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x006B 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x006C 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0E1F), + /* 0x006F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0070 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x0071 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0E20), + /* 0x0074 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0075 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0076 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0E21), + /* 0x0079 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x007A 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0E22), + /* 0x007D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x007E 0x01 */ MSCRIPT_CMD_UNSET_AUTOTALK(), + /* 0x007F 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_TALKED_THAWED_GRAVEYARD_GORON), + /* 0x0082 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0083 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_TALKED_GORON_GRAVEMAKER_AS_GORON, 0x0095 - 0x0088), + /* 0x0088 0x03 */ MSCRIPT_CMD_CHECK_GORON(0x0090 - 0x008B), + /* 0x008B 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0E32), + /* 0x008E 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x008F 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0090 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0E30), + /* 0x0093 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0094 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0095 0x03 */ MSCRIPT_CMD_CHECK_GORON(0x009D - 0x0098), + /* 0x0098 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0E2E), + /* 0x009B 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x009C 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x009D 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0E2C), + /* 0x00A0 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00A1 0x01 */ MSCRIPT_CMD_DONE(), }; // MsgEvent script for the shrine Goron standing aside the store. -static s32 sMsgScriptGoronAsideStore[] = { 0xE0E520C, 0x10000000 }; +static MsgScript sMsgScriptGoronAsideStore[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0E52), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x01 */ MSCRIPT_CMD_DONE(), +}; // MsgEvent script for the shrine Goron standing aside the Elder's son. -static s32 sMsgScriptGoronAsideEldersSon[] = { - 0x160400, 0x38010010, 0xE0E430C, 0xF0E440C, 0xF0E450C, 0x11188010, 0x160800, 0x1B0E0E46, 0xC0F0E47, - 0xC0F0E48, 0xC0F0E49, 0xC0F0E4A, 0xC111608, 0x11188010, 0xE0E4B0C, 0x100E0E42, 0xC100000, +static MsgScript sMsgScriptGoronAsideEldersSon[] = { + /* 0x0000 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_CALMED_GORON_ELDERS_SON, 0x003D - 0x0005), + /* 0x0005 0x03 */ MSCRIPT_CMD_CHECK_GORON(0x0018 - 0x0008), + /* 0x0008 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0E43), + /* 0x000B 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000C 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0E44), + /* 0x000F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0010 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0E45), + /* 0x0013 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0014 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_24_80), + /* 0x0017 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0018 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_22_08, 0x0038 - 0x001D), + /* 0x001D 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0E46), + /* 0x0020 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0021 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0E47), + /* 0x0024 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0025 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0E48), + /* 0x0028 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0029 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0E49), + /* 0x002C 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x002D 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0E4A), + /* 0x0030 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0031 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_22_08), + /* 0x0034 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_24_80), + /* 0x0037 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0038 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0E4B), + /* 0x003B 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x003C 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x003D 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0E42), + /* 0x0040 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0041 0x01 */ MSCRIPT_CMD_DONE(), }; // MsgEvent script for the shrine Goron standing aside the Elder's room. -static s32 sMsgScriptGoronAsideEldersRoom[] = { - 0x160400, 0x22010009, 0xE0E4D0C, 0xF0E4E0C, 0x10001701, 0xC0E0E, - 0x4F0C0F0E, 0x500C1117, 0x1100E0E, 0x510C100E, 0xE4C0C10, +static MsgScript sMsgScriptGoronAsideEldersRoom[] = { + /* 0x0000 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_CALMED_GORON_ELDERS_SON, 0x0027 - 0x0005), + /* 0x0005 0x03 */ MSCRIPT_CMD_CHECK_GORON(0x0011 - 0x0008), + /* 0x0008 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0E4D), + /* 0x000B 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000C 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0E4E), + /* 0x000F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0010 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0011 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_23_01, 0x0022 - 0x0016), + /* 0x0016 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0E4F), + /* 0x0019 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001A 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0E50), + /* 0x001D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001E 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_23_01), + /* 0x0021 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0022 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0E51), + /* 0x0025 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0026 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0027 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0E4C), + /* 0x002A 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x002B 0x01 */ MSCRIPT_CMD_DONE(), }; // MsgEvent script for the Goron in Goron Village who sells Powder Kegs. -static s32 sMsgScriptGoronMedigoron[] = { - 0x1001200, 0x12200008, 0xE0C8E0C, 0x11122010, 0xE0C8F0C, 0x10001240, 0x1D0E0C, 0x800C1112, 0x40001280, - 0x742500, 0xC006F00, 0x13010045, 0xF0C810C, 0x19001300, 0x1280005E, 0x25000C00, 0x59001301, 0x2F0E0C, - 0x810C0F0C, 0x820C0500, 0x1A00, 0x1A300E0C, 0x830C1209, 0x700, 0xE0C84, 0x160C1113, 0x1100E0C, - 0x840C1031, 0xE0C850C, 0x1029FFF2, 0x130200, 0xF0E0C88, 0xC0F0C89, 0xC05000A, 0xFFE3FFE3, 0xE0C860C, - 0x11128019, 0x213019, 0xFFC02900, 0x2C0E0C8C, 0xC050000, 0x50000, 0x8006400, 0x6320E0C, 0x8D0C1030, - 0x14FF9C12, 0x6003400, 0x130034, 0x700000E, 0xC870C16, 0x100E0C8B, 0xC100000, +static MsgScript sMsgScriptGoronMedigoron[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_CHECK_GORON(0x0015 - 0x0003), + /* 0x0003 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_18_20, 0x0010 - 0x0008), + /* 0x0008 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0C8E), + /* 0x000B 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000C 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_18_20), + /* 0x000F 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0010 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0C8F), + /* 0x0013 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0014 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0015 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_18_40, 0x0037 - 0x001A), + /* 0x001A 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0C80), + /* 0x001D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001E 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_18_40), + /* 0x0021 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_HAS_POWDERKEG_PRIVILEGES, 0x009A - 0x0026), + /* 0x0026 0x05 */ MSCRIPT_CMD_CHECK_ITEM(ITEM_POWDER_KEG, 0x009A - 0x002B), + /* 0x002B 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_19_01, 0x0075 - 0x0030), + /* 0x0030 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0C81), + /* 0x0033 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0034 0x03 */ MSCRIPT_CMD_JUMP(0x004A - 0x0037), + /* 0x0037 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_HAS_POWDERKEG_PRIVILEGES, 0x009A - 0x003C), + /* 0x003C 0x05 */ MSCRIPT_CMD_CHECK_ITEM(ITEM_POWDER_KEG, 0x009A - 0x0041), + /* 0x0041 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_19_01, 0x0075 - 0x0046), + /* 0x0046 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0C81), + /* 0x0049 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x004A 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0C82), + /* 0x004D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x004E 0x07 */ MSCRIPT_CMD_CHECK_TEXT_CHOICE(0x0, 0x006F - 0x0055, 0x006F - 0x0055), + /* 0x0055 0x01 */ MSCRIPT_CMD_PLAY_DECIDE(), + /* 0x0056 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0C83), + /* 0x0059 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x005A 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x005B 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x005E 0x03 */ MSCRIPT_CMD_AUTOTALK(0x0), + /* 0x0061 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0C84), + /* 0x0064 0x01 */ MSCRIPT_CMD_UNSET_AUTOTALK(), + /* 0x0065 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0066 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_19_01), + /* 0x0069 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x006A 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0C84), + /* 0x006D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x006E 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x006F 0x01 */ MSCRIPT_CMD_PLAY_CANCEL(), + /* 0x0070 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0C85), + /* 0x0073 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0074 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0075 0x03 */ MSCRIPT_CMD_CHECK_HAS_POWDER_KEG(0x006A - 0x0078), + + /* 0x0078 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_19_02, 0x008C - 0x007D), + /* 0x007D 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0C88), + /* 0x0080 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0081 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0C89), + /* 0x0084 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0085 0x07 */ MSCRIPT_CMD_CHECK_TEXT_CHOICE(0x0096 - 0x008C, 0x006F - 0x008C, 0x006F - 0x008C), + + /* 0x008C 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0C86), + /* 0x008F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0090 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_HAS_POWDERKEG_PRIVILEGES), + /* 0x0093 0x03 */ MSCRIPT_CMD_JUMP(0x00B7 - 0x0096), + /* 0x0096 0x01 */ MSCRIPT_CMD_PLAY_DECIDE(), + /* 0x0097 0x03 */ MSCRIPT_CMD_JUMP(0x005A - 0x009A), + + /* 0x009A 0x03 */ MSCRIPT_CMD_CHECK_HAS_POWDER_KEG(0x00C9 - 0x009D), + /* 0x009D 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0C8C), + /* 0x00A0 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00A1 0x07 */ MSCRIPT_CMD_CHECK_TEXT_CHOICE(0x0, 0x00AD - 0x00A8, 0x0), + /* 0x00A8 0x05 */ MSCRIPT_CMD_CHECK_RUPEES(100, 0x00B3 - 0x00AD), + /* 0x00AD 0x01 */ MSCRIPT_CMD_PLAY_ERROR(), + /* 0x00AE 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0C8D), + /* 0x00B1 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00B2 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x00B3 0x01 */ MSCRIPT_CMD_PLAY_DECIDE(), + /* 0x00B4 0x03 */ MSCRIPT_CMD_CHANGE_RUPEES(-100), + /* 0x00B7 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x00B8 0x05 */ MSCRIPT_CMD_OFFER_ITEM(GI_POWDER_KEG, 0x0), + /* 0x00BD 0x03 */ MSCRIPT_CMD_SET_COLLECTIBLE(0x0034), + /* 0x00C0 0x03 */ MSCRIPT_CMD_AUTOTALK(0x0), + /* 0x00C3 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0C87), + /* 0x00C6 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00C7 0x01 */ MSCRIPT_CMD_UNSET_AUTOTALK(), + /* 0x00C8 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x00C9 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0C8B), + /* 0x00CC 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00CD 0x01 */ MSCRIPT_CMD_DONE(), }; // MsgEvent script for the gatekeeper Goron in Goron Village who opens the shrine gate. -static s32 sMsgScriptGoronGatekeeper[] = { - 0x584000, 0x2903000E, 0x2001301, 0x180058, 0x80005119, 0x1E0059, 0x1004919, 0x160059, 0x2004119, - 0xE0059, 0x4003919, 0x2F0E0D, 0x4D0C1210, 0xE0D480C, 0xF0D490C, 0xF0D4A0C, 0x5000000, 0xF000F30, - 0xE0D4B0C, 0x15090000, 0xE0D4D0C, 0x1210310E, 0xD4C0C12, 0x100E0D4E, 0xC19FFD8, 0xE0D4F0C, 0x19FFD500, +static MsgScript sMsgScriptGoronGatekeeper[] = { + /* 0x0000 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_GATEKEEPER_OPENED_GORON_SHRINE, 0x002E - 0x0005), + /* 0x0005 0x03 */ MSCRIPT_CMD_CHECK_DEKU(0x0016 - 0x0008), + /* 0x0008 0x03 */ MSCRIPT_CMD_CHECK_ZORA(0x001E - 0x000B), + /* 0x000B 0x03 */ MSCRIPT_CMD_CHECK_GORON(0x0026 - 0x000E), + /* 0x000E 0x05 */ + MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_GATEKEEPER_OPENED_GORON_SHRINE_FOR_HUMAN, 0x0064 - 0x0013), + /* 0x0013 0x03 */ MSCRIPT_CMD_JUMP(0x0034 - 0x0016), + /* 0x0016 0x05 */ + MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_GATEKEEPER_OPENED_GORON_SHRINE_FOR_DEKU, 0x0064 - 0x001B), + /* 0x001B 0x03 */ MSCRIPT_CMD_JUMP(0x0034 - 0x001E), + /* 0x001E 0x05 */ + MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_GATEKEEPER_OPENED_GORON_SHRINE_FOR_ZORA, 0x0064 - 0x0023), + /* 0x0023 0x03 */ MSCRIPT_CMD_JUMP(0x0034 - 0x0026), + /* 0x0026 0x05 */ + MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_GATEKEEPER_OPENED_GORON_SHRINE_FOR_GORON, 0x0064 - 0x002B), + /* 0x002B 0x03 */ MSCRIPT_CMD_JUMP(0x005D - 0x002E), + /* 0x002E 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0D4D), + /* 0x0031 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0032 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0033 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0034 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0D48), + /* 0x0037 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0038 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0D49), + /* 0x003B 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x003C 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0D4A), + /* 0x003F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0040 0x07 */ MSCRIPT_CMD_CHECK_TEXT_CHOICE(0x0, 0x0056 - 0x0047, 0x0056 - 0x0047), + /* 0x0047 0x01 */ MSCRIPT_CMD_PLAY_DECIDE(), + /* 0x0048 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0D4B), + /* 0x004B 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x004C 0x01 */ MSCRIPT_CMD_PAUSE(), + /* 0x004D 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0050 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0D4D), + /* 0x0053 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0054 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0055 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0056 0x01 */ MSCRIPT_CMD_PLAY_CANCEL(), + /* 0x0057 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0D4C), + /* 0x005A 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x005B 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x005C 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x005D 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0D4E), + /* 0x0060 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0061 0x03 */ MSCRIPT_CMD_JUMP(0x003C - 0x0064), + + /* 0x0064 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0D4F), + /* 0x0067 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0068 0x03 */ MSCRIPT_CMD_JUMP(0x0040 - 0x006B), }; // MsgEvent script for one of the Goron stretchers at the racetrack (Initially stretching side to side while squatting). -static s32 sMsgScriptGoronAthleticA[] = { 0x100060E, 0xDFE0C12, 0x100E0DFF, 0xC121000 }; +static MsgScript sMsgScriptGoronAthleticA[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_CHECK_GORON(0x0009 - 0x0003), + /* 0x0003 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0DFE), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0008 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0009 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0DFF), + /* 0x000C 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000D 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x000E 0x01 */ MSCRIPT_CMD_DONE(), +}; // MsgEvent script for one of the Goron stretchers at the racetrack (Initially doing sidebend stretches with one arm). -static s32 sMsgScriptGoronAthleticB[] = { 0x100060E, 0xE000C12, 0x100E0E01, 0xC121000 }; +static MsgScript sMsgScriptGoronAthleticB[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_CHECK_GORON(0x0009 - 0x0003), + /* 0x0003 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0E00), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0008 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0009 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0E01), + /* 0x000C 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000D 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x000E 0x01 */ MSCRIPT_CMD_DONE(), +}; // MsgEvent script for one of the Goron stretchers at the racetrack (Initially shaking out their limbs). -static s32 sMsgScriptGoronAthleticC[] = { 0x100060E, 0xE020C12, 0x100E0E03, 0xC121000 }; +static MsgScript sMsgScriptGoronAthleticC[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_CHECK_GORON(0x0009 - 0x0003), + /* 0x0003 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0E02), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0008 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0009 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0E03), + /* 0x000C 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000D 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x000E 0x01 */ MSCRIPT_CMD_DONE(), +}; // MsgEvent script for one of the Goron stretchers (Initially doing sidebend stretches with both arms). -static s32 sMsgScriptGoronAthleticD[] = { 0x100060E, 0xE040C12, 0x100E0E05, 0xC121000 }; +static MsgScript sMsgScriptGoronAthleticD[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_CHECK_GORON(0x0009 - 0x0003), + /* 0x0003 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0E04), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0008 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0009 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0E05), + /* 0x000C 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000D 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x000E 0x01 */ MSCRIPT_CMD_DONE(), +}; // MsgEvent script for the pair of Gorons stretching one Goron's hamstrings. -static s32 sMsgScriptGoronAthleticHamstring[] = { 0x100060E, 0xE060C12, 0x100E0E07, 0xC121000 }; +static MsgScript sMsgScriptGoronAthleticHamstring[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_CHECK_GORON(0x0009 - 0x0003), + /* 0x0003 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0E06), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0008 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0009 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0E07), + /* 0x000C 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000D 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x000E 0x01 */ MSCRIPT_CMD_DONE(), +}; // MsgEvent script for any sleeping Goron. -static s32 sMsgScriptGoronSleeping[] = { 0xE023A0C, 0x12100000 }; +static MsgScript sMsgScriptGoronSleeping[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x023A), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0005 0x01 */ MSCRIPT_CMD_DONE(), +}; ActorInit En_Go_InitVars = { /**/ ACTOR_EN_GO, @@ -1822,11 +2207,11 @@ void EnGo_SetupGatekeeper(EnGo* this, PlayState* play) { } EnGo_ChangeToSnowballAnimation(this, play); this->actionFunc = EnGo_Snowball; - this->msgEventFunc = EnGo_HandleOpenShrineCutscene; + this->msgScriptCallback = EnGo_HandleOpenShrineCutscene; } else { EnGo_ChangeToShiveringAnimation(this, play); this->actionFunc = EnGo_Idle; - this->msgEventFunc = EnGo_HandleOpenShrineCutscene; + this->msgScriptCallback = EnGo_HandleOpenShrineCutscene; } } @@ -1883,7 +2268,7 @@ void EnGo_SetupMedigoron(EnGo* this, PlayState* play) { SubS_SetOfferMode(&this->actionFlags, SUBS_OFFER_MODE_ONSCREEN, SUBS_OFFER_MODE_MASK); this->actionFlags |= ENGO_FLAG_LOST_ATTENTION; this->actionFlags |= ENGO_FLAG_EYES_OPEN; - this->msgEventFunc = EnGo_HandleGivePowderKegCutscene; + this->msgScriptCallback = EnGo_HandleGivePowderKegCutscene; this->actionFunc = EnGo_Idle; } @@ -1910,7 +2295,7 @@ void EnGo_SetupInitialAction(EnGo* this, PlayState* play) { this->actor.targetMode = TARGET_MODE_1; this->scaleFactor = ENGO_NORMAL_SCALE; - this->msgEventFunc = NULL; + this->msgScriptCallback = NULL; switch (ENGO_GET_TYPE(&this->actor)) { case ENGO_ATHLETIC: @@ -2317,8 +2702,8 @@ void EnGo_Snowball(EnGo* this, PlayState* play) { /** * Return the MsgEvent script appropriate for the actor. */ -s32* EnGo_GetMsgEventScript(EnGo* this, PlayState* play) { - static s32* sMsgScriptGraveyard[] = { +MsgScript* EnGo_GetMsgScript(EnGo* this, PlayState* play) { + static MsgScript* sMsgScriptGraveyard[] = { sMsgScriptGoronGravemaker, sMsgScriptGoronFrozen, }; @@ -2384,8 +2769,8 @@ void EnGo_Talk(EnGo* this, PlayState* play) { Vec3f targetPos; Vec3f thisPos; - if (!func_8010BF58(&this->actor, play, EnGo_GetMsgEventScript(this, play), this->msgEventFunc, - &this->msgScriptResumePos)) { + if (!MsgEvent_RunScript(&this->actor, play, EnGo_GetMsgScript(this, play), this->msgScriptCallback, + &this->msgScriptPos)) { if ((ENGO_GET_TYPE(&this->actor) != ENGO_ATHLETIC) && !(this->actionFlags & ENGO_FLAG_ROLLED_UP)) { Math_Vec3f_Copy(&targetPos, &this->attentionTarget->world.pos); Math_Vec3f_Copy(&thisPos, &this->actor.world.pos); @@ -2404,7 +2789,7 @@ void EnGo_Talk(EnGo* this, PlayState* play) { this->actionFlags &= ~ENGO_FLAG_ENGAGED; SubS_SetOfferMode(&this->actionFlags, SUBS_OFFER_MODE_ONSCREEN, SUBS_OFFER_MODE_MASK); - this->msgScriptResumePos = 0; + this->msgScriptPos = 0; this->actionFlags |= ENGO_FLAG_LOST_ATTENTION; this->actionFunc = this->interruptedActionFunc; } diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.h b/src/overlays/actors/ovl_En_Go/z_en_go.h index f8c60b759a..ee9e0b85fa 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.h +++ b/src/overlays/actors/ovl_En_Go/z_en_go.h @@ -7,7 +7,6 @@ struct EnGo; typedef void (*EnGoActionFunc)(struct EnGo*, PlayState*); -typedef s32 (*MsgEventFunc)(Actor*, PlayState*); #define ENGO_GET_TYPE(thisx) (((thisx)->params & 0xF) & 0xFF) #define ENGO_GET_SUBTYPE(thisx) ((((thisx)->params & 0x70) >> 4) & 0xFF) @@ -95,7 +94,7 @@ typedef struct EnGo { /* 0x284 */ Path* gatekeeperPath; /* 0x288 */ s8 taisouObjectSlot; /* 0x289 */ s8 hakuginDemoObjectSlot; - /* 0x28C */ s32 msgScriptResumePos; + /* 0x28C */ s32 msgScriptPos; /* 0x290 */ Vec3f headPos; /* 0x29C */ Vec3f bodyPos; /* 0x2A8 */ Vec3s headRot; @@ -131,7 +130,7 @@ typedef struct EnGo { /* 0x3C8 */ s16 fidgetTableZ[ENGO_FIDGET_TABLE_LEN]; /* 0x3CE */ s16 fidgetTableY[ENGO_FIDGET_TABLE_LEN]; /* 0x3D4 */ s16 surprisePhase; - /* 0x3D8 */ MsgEventFunc msgEventFunc; + /* 0x3D8 */ MsgScriptCallback msgScriptCallback; /* 0x3DC */ s32 animIndex; /* 0x3E0 */ UNK_TYPE1 unk3E0[0x4]; /* 0x3E4 */ s32 indexPathPoint; diff --git a/src/overlays/actors/ovl_En_Ig/z_en_ig.c b/src/overlays/actors/ovl_En_Ig/z_en_ig.c index aae7ea47db..f4dcd4e37c 100644 --- a/src/overlays/actors/ovl_En_Ig/z_en_ig.c +++ b/src/overlays/actors/ovl_En_Ig/z_en_ig.c @@ -23,31 +23,94 @@ void func_80BF2BD4(EnIg* this, PlayState* play); static s32 D_80BF3318[] = { -1, -1, 3, 1, 3, 1, 2, 0, 3, 5, 0, 3, 1, 2, 4 }; -static s32 D_80BF3354[] = { - 0x0E28B00C, - 0x10000000, +static MsgScript D_80BF3354[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28B0), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x01 */ MSCRIPT_CMD_DONE(), }; -static s32 D_80BF335C[] = { - 0x09000000, 0x4B10001F, 0x170E28B1, 0x0C090000, 0x180E28B2, 0x0C090000, 0x170E28B3, 0x2D000111, 0x37020C09, - 0x00001000, 0x5610002F, 0x170E28B1, 0x0C090000, 0x180E28B5, 0x0C090000, 0x170E28B6, 0x0C090000, 0x180E28B7, - 0x0C090000, 0x170E28B8, 0x2D00010C, 0x09000011, 0x56101009, 0x0000180E, 0x29560C09, 0x0000170E, 0x29570C09, - 0x0000180E, 0x29580C09, 0x0000170E, 0x29592D00, 0x010C0900, 0x00121000, +static MsgScript D_80BF335C[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0003 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_RECEIVED_ROOM_KEY, 0x0027 - 0x0008), + /* 0x0008 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0009 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28B1), + /* 0x000C 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000D 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0010 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x0011 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28B2), + /* 0x0014 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0015 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0018 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0019 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28B3), + /* 0x001C 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x001F 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_55_02), + /* 0x0022 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0023 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0026 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0027 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_86_10, 0x005B - 0x002C), + /* 0x002C 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x002D 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28B1), + /* 0x0030 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0031 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0034 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x0035 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28B5), + /* 0x0038 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0039 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x003C 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x003D 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28B6), + /* 0x0040 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0041 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0044 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x0045 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28B7), + /* 0x0048 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0049 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x004C 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x004D 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28B8), + /* 0x0050 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x0053 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0054 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0057 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_86_10), + /* 0x005A 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x005B 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x005E 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x005F 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2956), + /* 0x0062 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0063 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0066 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0067 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2957), + /* 0x006A 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x006B 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x006E 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x006F 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2958), + /* 0x0072 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0073 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0076 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0077 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2959), + /* 0x007A 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x007D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x007E 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0081 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0082 0x01 */ MSCRIPT_CMD_DONE(), }; -static s32 D_80BF33E0[] = { - 0x0E28B90C, - 0x10000000, +static MsgScript D_80BF33E0[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28B9), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x01 */ MSCRIPT_CMD_DONE(), }; -static s32 D_80BF33E8[] = { - 0x0E28B40C, - 0x10000000, +static MsgScript D_80BF33E8[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28B4), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x01 */ MSCRIPT_CMD_DONE(), }; -static s32 D_80BF33F0[] = { - 0x0E295B0C, - 0x10000000, +static MsgScript D_80BF33F0[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x295B), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x01 */ MSCRIPT_CMD_DONE(), }; ActorInit En_Ig_InitVars = { @@ -323,8 +386,8 @@ s16 func_80BF1744(EnIg* this, s32 numCutscenes) { return csId; } -s32 func_80BF17BC(EnIg* this, PlayState* play) { - s32 pad; +s32 func_80BF17BC(Actor* thisx, PlayState* play) { + EnIg* this = THIS; s16 csId; s32 ret; @@ -371,10 +434,10 @@ s32 func_80BF17BC(EnIg* this, PlayState* play) { return ret; } -s32* func_80BF1920(EnIg* this, PlayState* play) { +MsgScript* EnIg_GetMsgScript(EnIg* this, PlayState* play) { switch (this->scheduleResult) { case 3: - this->unk_3F8 = func_80BF17BC; + this->msgScriptCallback = func_80BF17BC; return D_80BF335C; case 4: @@ -404,9 +467,9 @@ s32 func_80BF19A0(EnIg* this, PlayState* play) { Actor_TalkOfferAccepted(&this->actor, &play->state)) { SubS_SetOfferMode(&this->unk_3D0, SUBS_OFFER_MODE_NONE, SUBS_OFFER_MODE_MASK); this->unk_3F6 = 0; - this->unk_3F8 = NULL; + this->msgScriptCallback = NULL; this->actor.child = this->unk_2A8; - this->unk_29C = func_80BF1920(this, play); + this->msgScript = EnIg_GetMsgScript(this, play); if ((this->scheduleResult != 2) && (this->scheduleResult != 3) && (this->scheduleResult != 4)) { this->unk_3D0 |= 0x20; } @@ -525,7 +588,7 @@ s32 func_80BF1D78(EnIg* this, PlayState* play, ScheduleOutput* scheduleOutput) { } s32 func_80BF1DF4(EnIg* this, PlayState* play, ScheduleOutput* scheduleOutput) { - u16 sp56 = SCHEDULE_TIME_NOW; + u16 sp56 = SCRIPT_TIME_NOW; u8 pathIndex = ENIG_GET_PATH_INDEX(&this->actor); EnDoor* door; Vec3s* sp4C; @@ -570,7 +633,7 @@ s32 func_80BF1DF4(EnIg* this, PlayState* play, ScheduleOutput* scheduleOutput) { } s32 func_80BF1FA8(EnIg* this, PlayState* play, ScheduleOutput* scheduleOutput) { - u16 sp2E = SCHEDULE_TIME_NOW; + u16 sp2E = SCRIPT_TIME_NOW; u16 phi_v1; u8 pathIndex = ENIG_GET_PATH_INDEX(&this->actor); u16 tmp; @@ -892,12 +955,12 @@ void func_80BF2BD4(EnIg* this, PlayState* play) { Vec3f sp38; Vec3f sp2C; - if (func_8010BF58(&this->actor, play, this->unk_29C, this->unk_3F8, &this->unk_2A0)) { + if (MsgEvent_RunScript(&this->actor, play, this->msgScript, this->msgScriptCallback, &this->msgScriptPos)) { SubS_SetOfferMode(&this->unk_3D0, SUBS_OFFER_MODE_ONSCREEN, SUBS_OFFER_MODE_MASK); this->unk_3D0 &= ~0x20; this->unk_3D0 |= 0x200; this->unk_3EE = 20; - this->unk_2A0 = 0; + this->msgScriptPos = 0; this->actionFunc = func_80BF2AF8; } else if (((this->scheduleResult != 2) && (this->scheduleResult != 4)) && ((this->unk_2A8 != NULL) && (this->unk_2A8->update != NULL))) { diff --git a/src/overlays/actors/ovl_En_Ig/z_en_ig.h b/src/overlays/actors/ovl_En_Ig/z_en_ig.h index 71c7c509d3..f1dda67dbe 100644 --- a/src/overlays/actors/ovl_En_Ig/z_en_ig.h +++ b/src/overlays/actors/ovl_En_Ig/z_en_ig.h @@ -7,7 +7,6 @@ struct EnIg; typedef void (*EnIgActionFunc)(struct EnIg*, PlayState*); -typedef s32 (*EnIgUnkFunc)(struct EnIg*, PlayState*); typedef void (*EnIgUnkFunc2)(struct EnIg*, PlayState*); #define ENIG_GET_PATH_INDEX(thisx) ((thisx)->params & 0xFF) @@ -28,8 +27,8 @@ typedef struct EnIg { /* 0x290 */ s32 timePathWaypoint; /* 0x294 */ s32 timePathElapsedTime; /* 0x298 */ u8 scheduleResult; - /* 0x29C */ s32* unk_29C; - /* 0x2A0 */ s32 unk_2A0; + /* 0x29C */ MsgScript* msgScript; + /* 0x2A0 */ s32 msgScriptPos; /* 0x2A4 */ s8 unk_2A4; /* 0x2A8 */ Actor* unk_2A8; /* 0x2AC */ UNK_TYPE1 unk2AC[0x4]; @@ -57,7 +56,7 @@ typedef struct EnIg { /* 0x3F2 */ s16 unk_3F2; /* 0x3F4 */ s16 unk_3F4; /* 0x3F6 */ s16 unk_3F6; - /* 0x3F8 */ EnIgUnkFunc unk_3F8; + /* 0x3F8 */ MsgScriptCallback msgScriptCallback; /* 0x3FC */ s32 animIndex; /* 0x400 */ UNK_TYPE1 unk400[0x8]; /* 0x408 */ s32 unk_408; diff --git a/src/overlays/actors/ovl_En_Ja/z_en_ja.c b/src/overlays/actors/ovl_En_Ja/z_en_ja.c index cde5ec71c1..821cb33af9 100644 --- a/src/overlays/actors/ovl_En_Ja/z_en_ja.c +++ b/src/overlays/actors/ovl_En_Ja/z_en_ja.c @@ -23,20 +23,84 @@ void func_80BC3594(EnJa* this, PlayState* play); #include "src/overlays/actors/ovl_En_Ja/scheduleScripts.schl.inc" -s32 D_80BC360C[] = { - 0x0E29370C, 0x170E2938, 0x0C180E29, 0x390C170E, 0x293A0C09, 0x0000180E, 0x293B0C09, 0x00001000, +MsgScript D_80BC360C[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2937), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0005 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2938), + /* 0x0008 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0009 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x000A 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2939), + /* 0x000D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000E 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x000F 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x293A), + /* 0x0012 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0013 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0016 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x0017 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x293B), + /* 0x001A 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001B 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x001E 0x01 */ MSCRIPT_CMD_DONE(), }; -s32 D_80BC362C[] = { - 0x0E29400C, 0x170E2941, 0x0C180E29, 0x420C170E, 0x29430C09, 0x0000180E, 0x293B0C09, 0x00001000, +MsgScript D_80BC362C[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2940), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0005 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2941), + /* 0x0008 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0009 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x000A 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2942), + /* 0x000D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000E 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x000F 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2943), + /* 0x0012 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0013 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0016 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x0017 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x293B), + /* 0x001A 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001B 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x001E 0x01 */ MSCRIPT_CMD_DONE(), }; -s32 D_80BC364C[] = { - 0x0E293C0C, 0x170E293D, 0x0C180E29, 0x3E0C170E, 0x293F0C09, 0x0000180E, 0x293B0C09, 0x00001000, +MsgScript D_80BC364C[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x293C), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0005 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x293D), + /* 0x0008 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0009 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x000A 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x293E), + /* 0x000D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000E 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x000F 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x293F), + /* 0x0012 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0013 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0016 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x0017 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x293B), + /* 0x001A 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001B 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x001E 0x01 */ MSCRIPT_CMD_DONE(), }; -s32 D_80BC366C[] = { - 0x0E29440C, 0x170E2945, 0x0C180E29, 0x460C170E, 0x29470C09, 0x0000180E, 0x293B0C09, 0x00001000, +MsgScript D_80BC366C[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2944), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0005 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2945), + /* 0x0008 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0009 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x000A 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2946), + /* 0x000D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000E 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x000F 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2947), + /* 0x0012 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0013 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0016 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x0017 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x293B), + /* 0x001A 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001B 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x001E 0x01 */ MSCRIPT_CMD_DONE(), }; ActorInit En_Ja_InitVars = { @@ -161,8 +225,8 @@ Actor* func_80BC1AE0(EnJa* this, PlayState* play) { return this->actor.child; } -Player* func_80BC1B50(EnJa* this, PlayState* play) { - return GET_PLAYER(play); +Actor* func_80BC1B50(EnJa* this, PlayState* play) { + return &GET_PLAYER(play)->actor; } s32 func_80BC1B60(EnJa* this, PlayState* play) { @@ -171,7 +235,7 @@ s32 func_80BC1B60(EnJa* this, PlayState* play) { Vec3f sp34; s16 sp32; - Math_Vec3f_Copy(&sp40, &this->unk_1D8.player->actor.world.pos); + Math_Vec3f_Copy(&sp40, &this->unk_1E0->world.pos); Math_Vec3f_Copy(&sp34, &this->actor.world.pos); sp32 = Math_Vec3f_Yaw(&sp34, &sp40); Math_ApproachS(&this->unk_356, (sp32 - this->unk_35A) - this->actor.shape.rot.y, 4, 0x2AA8); @@ -180,10 +244,10 @@ s32 func_80BC1B60(EnJa* this, PlayState* play) { Math_ApproachS(&this->unk_35A, (sp32 - this->unk_356) - this->actor.shape.rot.y, 4, 0x2AA8); this->unk_35A = CLAMP(this->unk_35A, -0x1C70, 0x1C70); - if (this->unk_1D8.player->actor.id == ACTOR_PLAYER) { - sp40.y = this->unk_1D8.player->bodyPartsPos[PLAYER_BODYPART_HEAD].y + 3.0f; + if (this->unk_1E0->id == ACTOR_PLAYER) { + sp40.y = ((Player*)this->unk_1E0)->bodyPartsPos[PLAYER_BODYPART_HEAD].y + 3.0f; } else { - Math_Vec3f_Copy(&sp40, &this->unk_1D8.player->actor.focus.pos); + Math_Vec3f_Copy(&sp40, &this->unk_1E0->focus.pos); } Math_Vec3f_Copy(&sp34, &this->actor.focus.pos); @@ -198,8 +262,8 @@ s32 func_80BC1B60(EnJa* this, PlayState* play) { s32 func_80BC1D70(EnJa* this, PlayState* play) { if (this->unk_340 & 8) { - this->unk_1D8.player = func_80BC1B50(this, play); - if (this->unk_1D8.player != NULL) { + this->unk_1E0 = func_80BC1B50(this, play); + if (this->unk_1E0 != NULL) { func_80BC1B60(this, play); } this->unk_340 &= ~0x10; @@ -300,7 +364,7 @@ s32 func_80BC213C(EnJa* this, PlayState* play) { } void func_80BC2150(EnJa* this, PlayState* play) { - if ((this->unk_1D8.unk_00 == 1) || (this->unk_1D8.unk_00 == 2)) { + if ((this->unk_1D8 == 1) || (this->unk_1D8 == 2)) { func_80BC213C(this, play); } Math_ApproachS(&this->actor.shape.rot.y, this->actor.world.rot.y, 4, 0x1554); @@ -311,7 +375,7 @@ void func_80BC21A8(EnJa* this, PlayState* play) { this->unk_35C = R_TIME_SPEED + ((void)0, gSaveContext.save.timeSpeedOffset); if (!Schedule_RunScript(play, D_80BC35F0, &sp18) || - ((this->unk_1D8.unk_00 != sp18.result) && !func_80BC20D0(this, play, &sp18))) { + ((this->unk_1D8 != sp18.result) && !func_80BC20D0(this, play, &sp18))) { this->actor.shape.shadowDraw = NULL; this->actor.flags &= ~ACTOR_FLAG_TARGETABLE; sp18.result = 0; @@ -319,12 +383,12 @@ void func_80BC21A8(EnJa* this, PlayState* play) { this->actor.shape.shadowDraw = ActorShadow_DrawCircle; this->actor.flags |= ACTOR_FLAG_TARGETABLE; } - this->unk_1D8.unk_00 = sp18.result; + this->unk_1D8 = sp18.result; func_80BC2150(this, play); } -s32* func_80BC2274(EnJa* this, PlayState* play) { - switch (this->unk_1D8.unk_00) { +MsgScript* EnJa_GetMsgScript(EnJa* this, PlayState* play) { + switch (this->unk_1D8) { case 1: if (ENJA_GET_3(&this->actor) == 0) { return D_80BC360C; @@ -343,10 +407,11 @@ s32* func_80BC2274(EnJa* this, PlayState* play) { } void func_80BC22F4(EnJa* this, PlayState* play) { - if (func_8010BF58(&this->actor, play, func_80BC2274(this, play), this->unk_368, &this->unk_1D8.unk_04)) { + if (MsgEvent_RunScript(&this->actor, play, EnJa_GetMsgScript(this, play), this->msgScriptCallback, + &this->msgScriptPos)) { this->unk_340 &= ~8; SubS_SetOfferMode(&this->unk_340, SUBS_OFFER_MODE_ONSCREEN, SUBS_OFFER_MODE_MASK); - this->unk_1D8.unk_04 = 0; + this->msgScriptPos = 0; this->unk_340 |= 0x10; this->actor.shape.rot.y = this->actor.world.rot.y; this->actionFunc = func_80BC21A8; @@ -369,8 +434,8 @@ void EnJa_Init(Actor* thisx, PlayState* play) { this->actor.gravity = 0.0f; SubS_SetOfferMode(&this->unk_340, SUBS_OFFER_MODE_NONE, SUBS_OFFER_MODE_MASK); this->unk_340 |= 0x10; - this->unk_1D8.unk_00 = 0; - this->unk_368 = NULL; + this->unk_1D8 = 0; + this->msgScriptCallback = NULL; this->actionFunc = func_80BC21A8; } @@ -389,7 +454,7 @@ void EnJa_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); - if (this->unk_1D8.unk_00 != 0) { + if (this->unk_1D8 != 0) { EnJa_UpdateSkelAnime(this); func_80BC1A68(this); func_80BC1D70(this, play); @@ -398,14 +463,14 @@ void EnJa_Update(Actor* thisx, PlayState* play) { height = this->collider.dim.height + 10; SubS_Offer(&this->actor, play, radius, height, PLAYER_IA_NONE, this->unk_340 & SUBS_OFFER_MODE_MASK); - if (this->unk_1D8.unk_00 != 2) { + if (this->unk_1D8 != 2) { Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 30.0f, 12.0f, 0.0f, UPDBGCHECKINFO_FLAG_4); } func_80BC1984(this, play); } - if (this->unk_1D8.unk_00 == 1) { + if (this->unk_1D8 == 1) { func_80BC32D8(this, play); } } @@ -446,7 +511,7 @@ void EnJa_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, CLOSE_DISPS(play->state.gfxCtx); } - if (this->unk_1D8.unk_00 == 1) { + if (this->unk_1D8 == 1) { if ((limbIndex == OBJECT_BOJ_LIMB_0B) && (((this->skelAnime.curFrame >= 0.0f) && (this->skelAnime.curFrame <= 6.0f)) || ((this->skelAnime.curFrame >= 35.0f) && (this->skelAnime.curFrame <= 47.0f)))) { @@ -608,7 +673,7 @@ void EnJa_Draw(Actor* thisx, PlayState* play) { phi_t2 = 1; } - if (this->unk_1D8.unk_00 != 0) { + if (this->unk_1D8 != 0) { OPEN_DISPS(play->state.gfxCtx); Gfx_SetupDL25_Opa(play->state.gfxCtx); @@ -629,7 +694,7 @@ void EnJa_Draw(Actor* thisx, PlayState* play) { CLOSE_DISPS(play->state.gfxCtx); } - if (this->unk_1D8.unk_00 == 1) { + if (this->unk_1D8 == 1) { func_80BC3594(this, play); } } diff --git a/src/overlays/actors/ovl_En_Ja/z_en_ja.h b/src/overlays/actors/ovl_En_Ja/z_en_ja.h index fcbbf485f8..f0927cb669 100644 --- a/src/overlays/actors/ovl_En_Ja/z_en_ja.h +++ b/src/overlays/actors/ovl_En_Ja/z_en_ja.h @@ -16,18 +16,14 @@ typedef struct { /* 0x0E */ s16 unk_0E; } EnJaStruct; // size = 0x10 -typedef struct { - /* 0x00 */ u8 unk_00; - /* 0x04 */ s32 unk_04; - /* 0x08 */ Player* player; -} EnJaStruct2; // size = 0x10 - typedef struct EnJa { /* 0x000 */ Actor actor; /* 0x144 */ SkelAnime skelAnime; /* 0x188 */ EnJaActionFunc actionFunc; /* 0x18C */ ColliderCylinder collider; - /* 0x1D8 */ EnJaStruct2 unk_1D8; + /* 0x1D8 */ u8 unk_1D8; + /* 0x1DC */ s32 msgScriptPos; + /* 0x1E0 */ Actor* unk_1E0; /* 0x1E4 */ Vec3s unk_1E4; /* 0x1EC */ Vec3f unk_1EC; /* 0x1F8 */ Vec3f unk_1F8; @@ -55,7 +51,7 @@ typedef struct EnJa { /* 0x362 */ s16 unk_362; /* 0x364 */ s16 unk_364; /* 0x366 */ s16 unk_366; - /* 0x368 */ void* unk_368; + /* 0x368 */ MsgScriptCallback msgScriptCallback; /* 0x36C */ s32 animIndex; /* 0x370 */ UNK_TYPE1 unk_370[4]; /* 0x374 */ s32 prevTalkState; diff --git a/src/overlays/actors/ovl_En_Nb/z_en_nb.c b/src/overlays/actors/ovl_En_Nb/z_en_nb.c index 8ede3029dd..ea668fded6 100644 --- a/src/overlays/actors/ovl_En_Nb/z_en_nb.c +++ b/src/overlays/actors/ovl_En_Nb/z_en_nb.c @@ -38,34 +38,177 @@ typedef enum EnNbScheduleResult { #include "src/overlays/actors/ovl_En_Nb/scheduleScripts.schl.inc" -u8 D_80BC1464[] = { - 0x1B, 0x04, 0x08, 0x00, 0x6A, 0x0A, 0x00, 0x10, 0x00, 0x08, 0x00, 0x10, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x0E, - 0x29, 0x12, 0x2D, 0x00, 0x0E, 0x0C, 0x10, 0x0E, 0x29, 0x01, 0x2D, 0x00, 0x0E, 0x0C, 0x10, 0x0E, 0x29, 0x02, 0x0C, - 0x0F, 0x29, 0x03, 0x0C, 0x05, 0x00, 0x00, 0x00, 0x06, 0x00, 0x22, 0x31, 0x2D, 0x00, 0x0E, 0x12, 0x10, 0x30, 0x1C, - 0x04, 0x04, 0x0E, 0x29, 0x04, 0x0C, 0x20, 0x00, 0x03, 0x00, 0x04, 0x15, 0x09, 0x00, 0xC4, 0x09, 0x00, 0x00, 0x0F, - 0x29, 0x05, 0x0C, 0x15, 0x09, 0x00, 0xB9, 0x30, 0x1D, 0x04, 0x04, 0x0E, 0x29, 0x0B, 0x0C, 0x20, 0x00, 0x03, 0x00, - 0x04, 0x15, 0x09, 0x00, 0xA8, 0x09, 0x00, 0x00, 0x0F, 0x29, 0x0C, 0x0C, 0x15, 0x09, 0x00, 0x9D, 0x20, 0x00, 0x03, - 0x00, 0x17, 0x1B, 0x04, 0x04, 0x00, 0x09, 0x0E, 0x29, 0x11, 0x2D, 0x00, 0x0E, 0x0C, 0x16, 0x10, 0x0E, 0x29, 0x0A, - 0x2D, 0x00, 0x0E, 0x0C, 0x16, 0x10, 0x1B, 0x04, 0x04, 0x00, 0x3B, 0x0E, 0x29, 0x0D, 0x0C, 0x05, 0x00, 0x00, 0x00, - 0x0A, 0x00, 0x00, 0x0E, 0x29, 0x10, 0x2D, 0x00, 0x0E, 0x0C, 0x12, 0x16, 0x10, 0x0E, 0x29, 0x0E, 0x00, 0x32, 0x04, - 0x00, 0x59, 0x0C, 0x0F, 0x29, 0x0F, 0x0C, 0x12, 0x06, 0x00, 0x0C, 0x00, 0x00, 0x13, 0x00, 0x0C, 0x2F, 0x00, 0x00, - 0x2E, 0x2D, 0x00, 0x2A, 0x2D, 0x00, 0x0E, 0x11, 0x32, 0x04, 0x0C, 0x16, 0x10, 0x0E, 0x29, 0x06, 0x0C, 0x05, 0x00, - 0x0A, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x29, 0x07, 0x2D, 0x00, 0x0E, 0x0C, 0x12, 0x16, 0x10, 0x0E, 0x29, 0x08, 0x00, - 0x32, 0x02, 0x00, 0x1E, 0x0C, 0x0F, 0x29, 0x09, 0x0C, 0x12, 0x06, 0x00, 0x0C, 0x00, 0x00, 0x13, 0x00, 0x0C, 0x2F, - 0x00, 0x00, 0x2E, 0x2D, 0x00, 0x29, 0x2D, 0x00, 0x0E, 0x11, 0x32, 0x02, 0x0C, 0x16, 0x10, 0x2D, 0x00, 0x0E, 0x0C, - 0x12, 0x16, 0x10, 0x00, 0x00, 0x00, +MsgScript D_80BC1464[] = { + /* 0x0000 0x05 */ MSCRIPT_CMD_CHECK_EVENT_INF(EVENTINF_43, 0x006F - 0x0005), + /* 0x0005 0x0D */ + MSCRIPT_CMD_CHECK_DAY(0x0022 - 0x0012, 0x001A - 0x0012, 0x0022 - 0x0012, 0x001A - 0x0012, 0x0, 0x001A - 0x0012), + /* 0x0012 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2912), + /* 0x0015 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJUS_GRANDMOTHER), + /* 0x0018 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0019 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x001A 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2901), + /* 0x001D 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJUS_GRANDMOTHER), + /* 0x0020 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0021 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0022 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2902), + /* 0x0025 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0026 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2903), + /* 0x0029 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x002A 0x07 */ MSCRIPT_CMD_CHECK_TEXT_CHOICE(0x0, 0x0037 - 0x0031, 0x0053 - 0x0031), + /* 0x0031 0x01 */ MSCRIPT_CMD_PLAY_CANCEL(), + /* 0x0032 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJUS_GRANDMOTHER), + /* 0x0035 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0036 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0037 0x01 */ MSCRIPT_CMD_PLAY_DECIDE(), + /* 0x0038 0x03 */ MSCRIPT_CMD_SET_EVENT_INF(EVENTINF_42), + /* 0x003B 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2904), + /* 0x003E 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x003F 0x05 */ MSCRIPT_CMD_CHECK_WORN_MASK(PLAYER_MASK_ALL_NIGHT, 0x0048 - 0x0044), + /* 0x0044 0x01 */ MSCRIPT_CMD_PAUSE(), + /* 0x0045 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x010C - 0x0048), + /* 0x0048 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x004B 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2905), + /* 0x004E 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x004F 0x01 */ MSCRIPT_CMD_PAUSE(), + /* 0x0050 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x010C - 0x0053), + /* 0x0053 0x01 */ MSCRIPT_CMD_PLAY_DECIDE(), + /* 0x0054 0x03 */ MSCRIPT_CMD_EVENT_INF(EVENTINF_42), + /* 0x0057 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x290B), + /* 0x005A 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x005B 0x05 */ MSCRIPT_CMD_CHECK_WORN_MASK(PLAYER_MASK_ALL_NIGHT, 0x0064 - 0x0060), + /* 0x0060 0x01 */ MSCRIPT_CMD_PAUSE(), + /* 0x0061 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x010C - 0x0064), + /* 0x0064 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0067 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x290C), + /* 0x006A 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x006B 0x01 */ MSCRIPT_CMD_PAUSE(), + /* 0x006C 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x010C - 0x006F), + /* 0x006F 0x05 */ MSCRIPT_CMD_CHECK_WORN_MASK(PLAYER_MASK_ALL_NIGHT, 0x008B - 0x0074), + /* 0x0074 0x05 */ MSCRIPT_CMD_CHECK_EVENT_INF(EVENTINF_42, 0x0082 - 0x0079), + /* 0x0079 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2911), + /* 0x007C 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJUS_GRANDMOTHER), + /* 0x007F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0080 0x01 */ MSCRIPT_CMD_UNSET_AUTOTALK(), + /* 0x0081 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0082 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x290A), + /* 0x0085 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJUS_GRANDMOTHER), + /* 0x0088 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0089 0x01 */ MSCRIPT_CMD_UNSET_AUTOTALK(), + /* 0x008A 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x008B 0x05 */ MSCRIPT_CMD_CHECK_EVENT_INF(EVENTINF_42, 0x00CB - 0x0090), + /* 0x0090 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x290D), + /* 0x0093 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0094 0x07 */ MSCRIPT_CMD_CHECK_TEXT_CHOICE(0x0, 0x00A5 - 0x009B, 0x0), + /* 0x009B 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2910), + /* 0x009E 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJUS_GRANDMOTHER), + /* 0x00A1 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00A2 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x00A3 0x01 */ MSCRIPT_CMD_UNSET_AUTOTALK(), + /* 0x00A4 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x00A5 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x290E), + /* 0x00A8 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_50_04, 0x0106 - 0x00AD), + /* 0x00AD 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00AE 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x290F), + /* 0x00B1 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00B2 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x00B3 0x05 */ MSCRIPT_CMD_OFFER_ITEM(GI_HEART_PIECE, 0x0), + /* 0x00B8 0x03 */ MSCRIPT_CMD_SET_COLLECTIBLE(0x000C), + /* 0x00BB 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x00BE 0x01 */ MSCRIPT_CMD_AWAIT_TEXT_DONE(), + /* 0x00BF 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_RECEIVED_GRANDMA_LONG_STORY_HP), + /* 0x00C2 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJUS_GRANDMOTHER), + /* 0x00C5 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_50_04), + /* 0x00C8 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00C9 0x01 */ MSCRIPT_CMD_UNSET_AUTOTALK(), + /* 0x00CA 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x00CB 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2906), + /* 0x00CE 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00CF 0x07 */ MSCRIPT_CMD_CHECK_TEXT_CHOICE(0x00E0 - 0x00D6, 0x0, 0x0), + /* 0x00D6 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2907), + /* 0x00D9 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJUS_GRANDMOTHER), + /* 0x00DC 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00DD 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x00DE 0x01 */ MSCRIPT_CMD_UNSET_AUTOTALK(), + /* 0x00DF 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x00E0 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2908), + /* 0x00E3 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_50_02, 0x0106 - 0x00E8), + /* 0x00E8 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00E9 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2909), + /* 0x00EC 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00ED 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x00EE 0x05 */ MSCRIPT_CMD_OFFER_ITEM(GI_HEART_PIECE, 0x0), + /* 0x00F3 0x03 */ MSCRIPT_CMD_SET_COLLECTIBLE(0x000C), + /* 0x00F6 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x00F9 0x01 */ MSCRIPT_CMD_AWAIT_TEXT_DONE(), + /* 0x00FA 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_RECEIVED_GRANDMA_SHORT_STORY_HP), + /* 0x00FD 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJUS_GRANDMOTHER), + /* 0x0100 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_50_02), + /* 0x0103 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0104 0x01 */ MSCRIPT_CMD_UNSET_AUTOTALK(), + /* 0x0105 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0106 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJUS_GRANDMOTHER), + /* 0x0109 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x010A 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x010B 0x01 */ MSCRIPT_CMD_UNSET_AUTOTALK(), + /* 0x010C 0x01 */ MSCRIPT_CMD_DONE(), }; -u8 D_80BC1574[] = { - 0x09, 0x00, 0x00, 0x0E, 0x28, 0xC7, 0x0C, 0x09, 0x00, 0x00, 0x17, 0x0E, 0x28, 0xC8, 0x0C, 0x09, 0x00, - 0x00, 0x18, 0x0E, 0x28, 0xC9, 0x0C, 0x09, 0x00, 0x00, 0x17, 0x0E, 0x28, 0xCA, 0x0C, 0x09, 0x00, 0x00, - 0x18, 0x0E, 0x28, 0xCB, 0x0C, 0x09, 0x00, 0x00, 0x17, 0x0E, 0x28, 0xCC, 0x0C, 0x09, 0x00, 0x00, 0x18, - 0x0E, 0x28, 0xCD, 0x0C, 0x09, 0x00, 0x00, 0x17, 0x0E, 0x28, 0xCE, 0x0C, 0x09, 0x00, 0x00, 0x18, 0x0E, - 0x28, 0xCF, 0x2D, 0x00, 0x01, 0x2D, 0x00, 0x0E, 0x0C, 0x09, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, +MsgScript D_80BC1574[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0003 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28C7), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x000A 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x000B 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28C8), + /* 0x000E 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000F 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0012 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x0013 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28C9), + /* 0x0016 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0017 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x001A 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x001B 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28CA), + /* 0x001E 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001F 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0022 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x0023 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28CB), + /* 0x0026 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0027 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x002A 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x002B 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28CC), + /* 0x002E 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x002F 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0032 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x0033 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28CD), + /* 0x0036 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0037 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x003A 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x003B 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28CE), + /* 0x003E 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x003F 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0042 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x0043 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28CF), + /* 0x0046 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x0049 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJUS_GRANDMOTHER), + /* 0x004C 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x004D 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0050 0x01 */ MSCRIPT_CMD_DONE(), }; -u8 D_80BC15C8[] = { - 0x0E, 0x23, 0x62, 0x2D, 0x00, 0x0E, 0x0C, 0x10, +MsgScript D_80BC15C8[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2362), + /* 0x0003 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJUS_GRANDMOTHER), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x01 */ MSCRIPT_CMD_DONE(), }; ActorInit En_Nb_InitVars = { @@ -343,17 +486,17 @@ s32 func_80BC01DC(Actor* thisx, PlayState* play) { return ret; } -u8* func_80BC045C(EnNb* this, PlayState* play) { +MsgScript* EnNb_GetMsgScript(EnNb* this, PlayState* play) { if (CHECK_EVENTINF(EVENTINF_43)) { - this->msgEventCallback = func_80BC01DC; + this->msgScriptCallback = func_80BC01DC; return D_80BC1464; } else if (this->scheduleResult == EN_NB_SCH_2) { - this->msgEventCallback = func_80BC00AC; + this->msgScriptCallback = func_80BC00AC; return D_80BC1574; } else if (Player_GetMask(play) == PLAYER_MASK_KAFEIS_MASK) { return D_80BC15C8; } else { - this->msgEventCallback = func_80BC01DC; + this->msgScriptCallback = func_80BC01DC; return D_80BC1464; } } @@ -366,9 +509,9 @@ s32 func_80BC04FC(EnNb* this, PlayState* play) { this->stateFlags |= EN_NB_FLAG_20; SubS_SetOfferMode(&this->stateFlags, SUBS_OFFER_MODE_NONE, SUBS_OFFER_MODE_MASK); this->behaviour = ENNB_BEHAVIOUR_0; - this->msgEventCallback = NULL; + this->msgScriptCallback = NULL; this->actor.child = this->unk_1E8; - this->msgEventScript = func_80BC045C(this, play); + this->msgScript = EnNb_GetMsgScript(this, play); this->stateFlags |= EN_NB_FLAG_20; this->actionFunc = func_80BC0EAC; ret = true; @@ -622,7 +765,7 @@ void EnNb_FollowSchedule(EnNb* this, PlayState* play) { } void func_80BC0EAC(EnNb* this, PlayState* play) { - if (func_8010BF58(&this->actor, play, this->msgEventScript, this->msgEventCallback, &this->msgEventArg4)) { + if (MsgEvent_RunScript(&this->actor, play, this->msgScript, this->msgScriptCallback, &this->msgScriptPos)) { if (CHECK_EVENTINF(EVENTINF_43)) { CLEAR_EVENTINF(EVENTINF_42); CLEAR_EVENTINF(EVENTINF_43); @@ -636,7 +779,7 @@ void func_80BC0EAC(EnNb* this, PlayState* play) { this->actor.child = NULL; this->stateFlags |= EN_NB_FLAG_400; this->unk_282 = 20; - this->msgEventArg4 = 0; + this->msgScriptPos = 0; this->actionFunc = EnNb_FollowSchedule; } } diff --git a/src/overlays/actors/ovl_En_Nb/z_en_nb.h b/src/overlays/actors/ovl_En_Nb/z_en_nb.h index c4986372fb..2bc134b3d9 100644 --- a/src/overlays/actors/ovl_En_Nb/z_en_nb.h +++ b/src/overlays/actors/ovl_En_Nb/z_en_nb.h @@ -7,7 +7,6 @@ struct EnNb; typedef void (*EnNbActionFunc)(struct EnNb*, PlayState*); -typedef s32 (*EnNbUnkFunc)(Actor*, PlayState*); typedef void (*EnNbUnkFunc2)(struct EnNb*, PlayState*); typedef enum EnNbAnimation { @@ -28,8 +27,8 @@ typedef struct EnNb { /* 0x18C */ EnNbUnkFunc2 unk_18C; /* 0x190 */ ColliderCylinder collider; /* 0x1DC */ u8 scheduleResult; - /* 0x1E0 */ u8* msgEventScript; - /* 0x1E4 */ s32 msgEventArg4; + /* 0x1E0 */ MsgScript* msgScript; + /* 0x1E4 */ s32 msgScriptPos; /* 0x1E8 */ Actor* unk_1E8; /* 0x1EC */ UNK_TYPE1 unk_1EC[4]; /* 0x1F0 */ Vec3f headComputedPos; @@ -50,7 +49,7 @@ typedef struct EnNb { /* 0x284 */ s16 unk_284; // storyState? /* 0x286 */ s16 storyTimer; /* 0x288 */ s16 behaviour; - /* 0x28C */ EnNbUnkFunc msgEventCallback; + /* 0x28C */ MsgScriptCallback msgScriptCallback; /* 0x290 */ EnNbAnimation animIndex; /* 0x294 */ UNK_TYPE1 unk_294[4]; /* 0x294 */ TextState prevTalkState; diff --git a/src/overlays/actors/ovl_En_Pm/z_en_pm.c b/src/overlays/actors/ovl_En_Pm/z_en_pm.c index 62ba14d1ce..bf54ec6d4e 100644 --- a/src/overlays/actors/ovl_En_Pm/z_en_pm.c +++ b/src/overlays/actors/ovl_En_Pm/z_en_pm.c @@ -28,89 +28,269 @@ static s32 D_80AFB430[] = { 2, 1, 0, 6, 7, 9, 8, -1, 0, 1, 10, 3, 1, 0, 11, 12, 8, 2, 2, 3, 0, 1, 1, 0, 6, 9, 1, 2, 12, 13, }; -// Game scripts -static UNK_TYPE D_80AFB5A0[] = { - 0x00560800, 0x45090000, 0x170E28BA, 0x0C090000, 0x180E28BB, 0x0C090000, 0x170E28BC, 0x0C090000, 0x180E28BD, - 0x0C090000, 0x170E28BE, 0x0C090000, 0x180E28BF, 0x0C090000, 0x170E28C0, 0x2D00012D, 0x000B0C09, 0x00001156, - 0x08100900, 0x00170E29, 0x5C0C0900, 0x00180E29, 0x5D0C0900, 0x00170E29, 0x5E2D0001, 0x2D000B0C, 0x09000010, +static MsgScript D_80AFB5A0[] = { + /* 0x0000 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_LISTENED_ANJU_POSTMAN_CONVERSATION, + 0x004A - 0x0005), + /* 0x0005 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0008 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0009 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28BA), + /* 0x000C 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000D 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0010 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x0011 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28BB), + /* 0x0014 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0015 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0018 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0019 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28BC), + /* 0x001C 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001D 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0020 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x0021 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28BD), + /* 0x0024 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0025 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0028 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0029 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28BE), + /* 0x002C 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x002D 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0030 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x0031 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28BF), + /* 0x0034 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0035 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0038 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x0039 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x28C0), + /* 0x003C 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x003F 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_POSTMAN), + /* 0x0042 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0043 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0046 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_LISTENED_ANJU_POSTMAN_CONVERSATION), + /* 0x0049 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x004A 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x004D 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x004E 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x295C), + /* 0x0051 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0052 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0055 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x0056 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x295D), + /* 0x0059 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x005A 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x005D 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x005E 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x295E), + /* 0x0061 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_ANJU), + /* 0x0064 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_POSTMAN), + /* 0x0067 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0068 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x006B 0x01 */ MSCRIPT_CMD_DONE(), }; -static UNK_TYPE D_80AFB60C[] = { - 0x0E27742D, - 0x000B0C10, +static MsgScript D_80AFB60C[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2774), + /* 0x0003 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_POSTMAN), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x01 */ MSCRIPT_CMD_DONE(), }; -static UNK_TYPE D_80AFB614[] = { - 0x0E27752D, - 0x000B0C10, +static MsgScript D_80AFB614[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2775), + /* 0x0003 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_POSTMAN), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x01 */ MSCRIPT_CMD_DONE(), }; -static UNK_TYPE D_80AFB61C[] = { - 0x0E27772D, - 0x000B0C10, +static MsgScript D_80AFB61C[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2777), + /* 0x0003 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_POSTMAN), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x01 */ MSCRIPT_CMD_DONE(), }; -static UNK_TYPE D_80AFB624[] = { - 0x0E27782D, - 0x000B0C10, +static MsgScript D_80AFB624[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2778), + /* 0x0003 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_POSTMAN), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x01 */ MSCRIPT_CMD_DONE(), }; -static UNK_TYPE D_80AFB62C[] = { - 0x0E27792D, - 0x000B0C10, +static MsgScript D_80AFB62C[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2779), + /* 0x0003 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_POSTMAN), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x01 */ MSCRIPT_CMD_DONE(), }; -static UNK_TYPE D_80AFB634[] = { - 0x0E27812D, - 0x000B0C10, +static MsgScript D_80AFB634[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2781), + /* 0x0003 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_POSTMAN), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x01 */ MSCRIPT_CMD_DONE(), }; -static UNK_TYPE D_80AFB63C[] = { - 0x0E277A2D, - 0x000B0C10, +static MsgScript D_80AFB63C[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x277A), + /* 0x0003 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_POSTMAN), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x01 */ MSCRIPT_CMD_DONE(), }; -static UNK_TYPE D_80AFB644[] = { - 0x0E27822D, - 0x000B0C11, - 0x58021000, +static MsgScript D_80AFB644[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2782), + /* 0x0003 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_POSTMAN), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_88_02), + /* 0x000A 0x01 */ MSCRIPT_CMD_DONE(), }; -static UNK_TYPE D_80AFB650[] = { - 0x0E27832D, - 0x000B0C10, +static MsgScript D_80AFB650[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2783), + /* 0x0003 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_POSTMAN), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x01 */ MSCRIPT_CMD_DONE(), }; -static UNK_TYPE D_80AFB658[] = { - 0x25002E00, 0x1A005280, 0x000C0E27, 0x7C2D000B, 0x0C115280, 0x12100E27, 0x7D2D000B, 0x0C12100E, 0x277C0C0E, - 0x00FF1E00, 0x33000000, 0x1800282C, 0xFFFF0900, 0x000E277E, 0x2D000B0C, 0x11528011, 0x56012A00, 0x2E12102C, - 0x277D0C2F, 0x00002D00, 0x0B0C1152, 0x8012100E, 0x277D2D00, 0x0B0C1152, 0x80121000, +static MsgScript D_80AFB658[] = { + /* 0x0000 0x05 */ MSCRIPT_CMD_CHECK_ITEM(ITEM_LETTER_MAMA, 0x001F - 0x0005), + /* 0x0005 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_82_80, 0x0016 - 0x000A), + /* 0x000A 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x277C), + /* 0x000D 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_POSTMAN), + /* 0x0010 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0011 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_82_80), + /* 0x0014 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0015 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0016 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x277D), + /* 0x0019 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_POSTMAN), + /* 0x001C 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001D 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x001E 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x001F 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x277C), + /* 0x0022 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0023 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x00FF), + /* 0x0026 0x09 */ MSCRIPT_CMD_CHECK_ITEM_ACTION(PLAYER_IA_LETTER_MAMA, 0x0, 0x0047 - 0x002F, 0x0057 - 0x002F), + /* 0x002F 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0xFFFF), + /* 0x0032 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0035 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x277E), + /* 0x0038 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_POSTMAN), + /* 0x003B 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x003C 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_82_80), + /* 0x003F 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_86_01), + /* 0x0042 0x03 */ MSCRIPT_CMD_DELETE_ITEM(ITEM_LETTER_MAMA), + /* 0x0045 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0046 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0047 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x277D), + /* 0x004A 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x004B 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x004E 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_POSTMAN), + /* 0x0051 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0052 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_82_80), + /* 0x0055 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0056 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0057 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x277D), + /* 0x005A 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_POSTMAN), + /* 0x005D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x005E 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_82_80), + /* 0x0061 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0062 0x01 */ MSCRIPT_CMD_DONE(), }; -static UNK_TYPE D_80AFB6BC[] = { - 0x0900000E, 0x27A50C09, 0x0000170E, 0x27A60C09, 0x0000180E, 0x27A70C09, 0x0000170E, - 0x27A80C09, 0x0000180E, 0x27A90C09, 0x0000170E, 0x27AA0C09, 0x0000180E, 0x27AB0C09, - 0x0000170E, 0x27AC0C09, 0x0000180E, 0x27AD2D00, 0x0B2D0008, 0x0C115908, 0x09000010, +static MsgScript D_80AFB6BC[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0003 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x27A5), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x000A 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x000B 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x27A6), + /* 0x000E 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000F 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0012 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x0013 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x27A7), + /* 0x0016 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0017 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x001A 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x001B 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x27A8), + /* 0x001E 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001F 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0022 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x0023 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x27A9), + /* 0x0026 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0027 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x002A 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x002B 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x27AA), + /* 0x002E 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x002F 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0032 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x0033 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x27AB), + /* 0x0036 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0037 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x003A 0x01 */ MSCRIPT_CMD_FOCUS_TO_CHILD(), + /* 0x003B 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x27AC), + /* 0x003E 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x003F 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0042 0x01 */ MSCRIPT_CMD_FOCUS_TO_SELF(), + /* 0x0043 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x27AD), + /* 0x0046 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_POSTMAN), + /* 0x0049 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_MADAME_AROMA), + /* 0x004C 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x004D 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_89_08), + /* 0x0050 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0053 0x01 */ MSCRIPT_CMD_DONE(), }; -static UNK_TYPE D_80AFB710[] = { - 0x25003E00, 0x230E2780, 0x0C0F27AE, 0x0C120600, 0x84000013, 0x0084115A, 0x042F0000, - 0x2E2D000B, 0x2D00310C, 0x115A0110, 0x0E27802D, 0x000B0C11, 0x5A011210, +static MsgScript D_80AFB710[] = { + /* 0x0000 0x05 */ MSCRIPT_CMD_CHECK_ITEM(ITEM_MASK_POSTMAN, 0x0028 - 0x0005), + /* 0x0005 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2780), + /* 0x0008 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0009 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x27AE), + /* 0x000C 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000D 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x000E 0x05 */ MSCRIPT_CMD_OFFER_ITEM(GI_MASK_POSTMAN, 0x0), + /* 0x0013 0x03 */ MSCRIPT_CMD_SET_COLLECTIBLE(0x0084), + /* 0x0016 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_90_04), + /* 0x0019 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x001C 0x01 */ MSCRIPT_CMD_AWAIT_TEXT_DONE(), + /* 0x001D 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_POSTMAN), + /* 0x0020 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_RECEIVED_POSTMANS_HAT), + /* 0x0023 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0024 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_90_01), + /* 0x0027 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0028 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2780), + /* 0x002B 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_POSTMAN), + /* 0x002E 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x002F 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_90_01), + /* 0x0032 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0033 0x01 */ MSCRIPT_CMD_DONE(), }; -static UNK_TYPE D_80AFB744[] = { - 0x0E23692D, - 0x000B0C10, +static MsgScript D_80AFB744[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2369), + /* 0x0003 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_POSTMAN), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x01 */ MSCRIPT_CMD_DONE(), }; -static UNK_TYPE D_80AFB74C[] = { - 0x2CFFFF09, 0x00000E27, 0x7E2D000B, 0x0C115280, 0x1156012A, 0x002E1210, +static MsgScript D_80AFB74C[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0xFFFF), + /* 0x0003 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0006 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x277E), + /* 0x0009 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_POSTMAN), + /* 0x000C 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000D 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_82_80), + /* 0x0010 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_86_01), + /* 0x0013 0x03 */ MSCRIPT_CMD_DELETE_ITEM(ITEM_LETTER_MAMA), + /* 0x0016 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0017 0x01 */ MSCRIPT_CMD_DONE(), }; -static UNK_TYPE D_80AFB764[] = { - 0x2C277D2D, - 0x000B0C11, - 0x52801210, +static MsgScript D_80AFB764[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x277D), + /* 0x0003 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_MET_POSTMAN), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_82_80), + /* 0x000A 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x000B 0x01 */ MSCRIPT_CMD_DONE(), }; ActorInit En_Pm_InitVars = { @@ -453,8 +633,8 @@ s16 func_80AF8170(EnPm* this, s32 numCutscenes) { return csId; } -s32 func_80AF81E8(EnPm* this, PlayState* play) { - s32 pad; +s32 func_80AF81E8(Actor* thisx, PlayState* play) { + EnPm* this = THIS; s16 csId = func_80AF8170(this, 0); s32 ret = false; @@ -496,8 +676,8 @@ s32 func_80AF81E8(EnPm* this, PlayState* play) { return ret; } -s32 func_80AF8348(EnPm* this, PlayState* play) { - s32 pad; +s32 func_80AF8348(Actor* thisx, PlayState* play) { + EnPm* this = THIS; s16 csId = func_80AF8170(this, 0); s32 ret = false; @@ -538,8 +718,8 @@ s32 func_80AF8348(EnPm* this, PlayState* play) { return ret; } -s32 func_80AF8478(EnPm* this, PlayState* play) { - s32 pad; +s32 func_80AF8478(Actor* thisx, PlayState* play) { + EnPm* this = THIS; s32 ret = false; switch (this->unk_378) { @@ -563,17 +743,17 @@ s32 func_80AF8478(EnPm* this, PlayState* play) { return ret; } -UNK_TYPE* func_80AF8540(EnPm* this, PlayState* play) { +MsgScript* EnPm_GetMsgScript(EnPm* this, PlayState* play) { switch (this->unk_258) { case 28: - this->unk_37C = func_80AF8348; + this->msgScriptCallback = func_80AF8348; return D_80AFB6BC; case 29: return D_80AFB710; case 16: - this->unk_37C = func_80AF81E8; + this->msgScriptCallback = func_80AF81E8; return D_80AFB5A0; case 17: @@ -581,12 +761,12 @@ UNK_TYPE* func_80AF8540(EnPm* this, PlayState* play) { case 24: if (this->unk_356 & 0x2000) { - this->unk_37C = func_80AF8478; + this->msgScriptCallback = func_80AF8478; return D_80AFB74C; } else if (this->unk_356 & 0x4000) { return D_80AFB764; } else { - this->unk_37C = func_80AF8478; + this->msgScriptCallback = func_80AF8478; return D_80AFB658; } break; @@ -639,9 +819,9 @@ s32 func_80AF86F0(EnPm* this, PlayState* play) { SubS_SetOfferMode(&this->unk_356, SUBS_OFFER_MODE_NONE, SUBS_OFFER_MODE_MASK); this->unk_398 = 0; this->unk_378 = 0; - this->unk_37C = NULL; + this->msgScriptCallback = NULL; this->actor.child = this->unk_268; - this->unk_25C = func_80AF8540(this, play); + this->msgScript = EnPm_GetMsgScript(this, play); if ((this->unk_258 != 24) && (this->unk_258 != 9) && (this->unk_258 != 20) && (this->unk_258 != 21) && (this->unk_258 != 22)) { this->unk_356 |= 0x20; @@ -867,7 +1047,7 @@ s32 func_80AF8ED4(EnPm* this, PlayState* play, ScheduleOutput* scheduleOutput, u } s32 func_80AF9008(EnPm* this, PlayState* play, ScheduleOutput* scheduleOutput) { - u16 sp56 = SCHEDULE_TIME_NOW; + u16 sp56 = SCRIPT_TIME_NOW; u8 pathIndex = ENPM_GET_PATH_INDEX(&this->actor); EnDoor* door; Vec3s* sp4C; @@ -915,7 +1095,7 @@ s32 func_80AF9008(EnPm* this, PlayState* play, ScheduleOutput* scheduleOutput) { } s32 func_80AF91E8(EnPm* this, PlayState* play, ScheduleOutput* scheduleOutput) { - u16 sp2E = SCHEDULE_TIME_NOW; + u16 sp2E = SCRIPT_TIME_NOW; u16 phi_v1; u8 pathIndex = ENPM_GET_PATH_INDEX(&this->actor); u16 tmp; @@ -1659,13 +1839,13 @@ void func_80AFA5FC(EnPm* this, PlayState* play) { Vec3f sp38; Vec3f sp2C; - if (func_8010BF58(&this->actor, play, this->unk_25C, this->unk_37C, &this->unk_264)) { + if (MsgEvent_RunScript(&this->actor, play, this->msgScript, this->msgScriptCallback, &this->msgScriptPos)) { SubS_SetOfferMode(&this->unk_356, SUBS_OFFER_MODE_ONSCREEN, SUBS_OFFER_MODE_MASK); this->unk_356 &= ~0x20; this->unk_356 |= 0x200; this->actor.child = NULL; this->unk_376 = 20; - this->unk_264 = 0; + this->msgScriptPos = 0; this->actionFunc = func_80AFA4D0; return; } diff --git a/src/overlays/actors/ovl_En_Pm/z_en_pm.h b/src/overlays/actors/ovl_En_Pm/z_en_pm.h index bf7bbe8597..e3341f2b23 100644 --- a/src/overlays/actors/ovl_En_Pm/z_en_pm.h +++ b/src/overlays/actors/ovl_En_Pm/z_en_pm.h @@ -6,7 +6,6 @@ struct EnPm; typedef void (*EnPmActionFunc)(struct EnPm*, PlayState*); -typedef s32 (*EnPmFunc)(struct EnPm*, PlayState*); typedef s32 (*EnPmFunc2)(struct EnPm*, PlayState*); #define ENPM_GET_PATH_INDEX(thisx) ((thisx)->params & 0xFF) @@ -26,9 +25,9 @@ typedef struct EnPm { /* 0x250 */ s32 timePathWaypoint; /* 0x254 */ s32 timePathElapsedTime; /* 0x258 */ u8 unk_258; - /* 0x25C */ UNK_TYPE* unk_25C; + /* 0x25C */ MsgScript* msgScript; /* 0x260 */ s8 unk_260; - /* 0x264 */ s32 unk_264; + /* 0x264 */ s32 msgScriptPos; /* 0x268 */ Actor* unk_268; /* 0x26C */ Vec3f unk_26C; /* 0x278 */ Vec3f unk_278; @@ -49,7 +48,7 @@ typedef struct EnPm { /* 0x374 */ s16 timePathTimeSpeed; /* 0x376 */ s16 unk_376; /* 0x378 */ s16 unk_378; - /* 0x37C */ EnPmFunc unk_37C; + /* 0x37C */ MsgScriptCallback msgScriptCallback; /* 0x380 */ s32 unk_380; /* 0x384 */ s32 unk_384; /* 0x388 */ s32 prevTalkState; diff --git a/src/overlays/actors/ovl_En_Pst/z_en_pst.c b/src/overlays/actors/ovl_En_Pst/z_en_pst.c index 459c68cc76..655b4c42b7 100644 --- a/src/overlays/actors/ovl_En_Pst/z_en_pst.c +++ b/src/overlays/actors/ovl_En_Pst/z_en_pst.c @@ -30,64 +30,329 @@ typedef enum { #include "src/overlays/actors/ovl_En_Pst/scheduleScripts.schl.inc" -s32 D_80B2C23C[] = { - 0x0E27840C, 0x0E00FF2B, 0x00000031, 0x00392800, 0x0A122C27, 0xA40C2F00, 0x000C1012, - 0x2C27870C, 0x2F00000C, 0x111B022A, 0x002F001B, 0x4000080F, 0x27882D00, 0x180C100F, - 0x27892D00, 0x180C1012, 0x2C27850C, 0x2FFFD20E, 0x27860C10, +MsgScript D_80B2C23C[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2784), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x00FF), + /* 0x0007 0x07 */ MSCRIPT_CMD_CHECK_CALLBACK_MULTI(0x0, 0x003F - 0x000E, 0x0047 - 0x000E), + /* 0x000E 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK_CONTINUE(0x001B - 0x0011), + /* 0x0011 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0012 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x27A4), + /* 0x0015 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0016 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x0019 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001A 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x001B 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x001C 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x2787), + /* 0x001F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0020 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x0023 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0024 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_SOUTH_UPPER_CLOCKTOWN), + /* 0x0027 0x03 */ MSCRIPT_CMD_DELETE_ITEM(ITEM_LETTER_TO_KAFEI), + /* 0x002A 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_27_40, 0x0037 - 0x002F), + /* 0x002F 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2788), + /* 0x0032 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_DEPOSITED_LETTER_TO_KAFEI), + /* 0x0035 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0036 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0037 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2789), + /* 0x003A 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_DEPOSITED_LETTER_TO_KAFEI), + /* 0x003D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x003E 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x003F 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0040 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x2785), + /* 0x0043 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0044 0x03 */ MSCRIPT_CMD_JUMP_3(0x0019 - 0x0047), + + /* 0x0047 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2786), + /* 0x004A 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x004B 0x01 */ MSCRIPT_CMD_DONE(), }; -s32 D_80B2C288[] = { - 0x0E27840C, 0x0E00FF2B, 0x00000031, 0x00392800, 0x0A122C27, 0xA40C2F00, 0x000C1012, - 0x2C27870C, 0x2F00000C, 0x111B042A, 0x002F001B, 0x8000080F, 0x27882D00, 0x180C100F, - 0x27892D00, 0x180C1012, 0x2C27850C, 0x2FFFD20E, 0x27860C10, +MsgScript D_80B2C288[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2784), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x00FF), + /* 0x0007 0x07 */ MSCRIPT_CMD_CHECK_CALLBACK_MULTI(0x0, 0x003F - 0x000E, 0x0047 - 0x000E), + /* 0x000E 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK_CONTINUE(0x001B - 0x0011), + /* 0x0011 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0012 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x27A4), + /* 0x0015 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0016 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x0019 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001A 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x001B 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x001C 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x2787), + /* 0x001F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0020 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x0023 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0024 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_NORTH_CLOCKTOWN), + /* 0x0027 0x03 */ MSCRIPT_CMD_DELETE_ITEM(ITEM_LETTER_TO_KAFEI), + /* 0x002A 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_27_80, 0x0037 - 0x002F), + /* 0x002F 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2788), + /* 0x0032 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_DEPOSITED_LETTER_TO_KAFEI), + /* 0x0035 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0036 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0037 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2789), + /* 0x003A 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_DEPOSITED_LETTER_TO_KAFEI), + /* 0x003D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x003E 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x003F 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0040 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x2785), + /* 0x0043 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0044 0x03 */ MSCRIPT_CMD_JUMP_3(0x0019 - 0x0047), + + /* 0x0047 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2786), + /* 0x004A 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x004B 0x01 */ MSCRIPT_CMD_DONE(), }; -s32 D_80B2C2D4[] = { - 0x0E27840C, 0x0E00FF2B, 0x00000031, 0x00392800, 0x0A122C27, 0xA40C2F00, 0x000C1012, - 0x2C27870C, 0x2F00000C, 0x111B082A, 0x002F001C, 0x0100080F, 0x27882D00, 0x180C100F, - 0x27892D00, 0x180C1012, 0x2C27850C, 0x2FFFD20E, 0x27860C10, +MsgScript D_80B2C2D4[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2784), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x00FF), + /* 0x0007 0x07 */ MSCRIPT_CMD_CHECK_CALLBACK_MULTI(0x0, 0x003F - 0x000E, 0x0047 - 0x000E), + /* 0x000E 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK_CONTINUE(0x001B - 0x0011), + /* 0x0011 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0012 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x27A4), + /* 0x0015 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0016 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x0019 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001A 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x001B 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x001C 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x2787), + /* 0x001F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0020 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x0023 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0024 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_EAST_UPPER_CLOCKTOWN), + /* 0x0027 0x03 */ MSCRIPT_CMD_DELETE_ITEM(ITEM_LETTER_TO_KAFEI), + /* 0x002A 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_28_01, 0x0037 - 0x002F), + /* 0x002F 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2788), + /* 0x0032 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_DEPOSITED_LETTER_TO_KAFEI), + /* 0x0035 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0036 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0037 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2789), + /* 0x003A 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_DEPOSITED_LETTER_TO_KAFEI), + /* 0x003D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x003E 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x003F 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0040 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x2785), + /* 0x0043 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0044 0x03 */ MSCRIPT_CMD_JUMP_3(0x0019 - 0x0047), + + /* 0x0047 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2786), + /* 0x004A 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x004B 0x01 */ MSCRIPT_CMD_DONE(), }; -s32 D_80B2C320[] = { - 0x0E27840C, 0x0E00FF2B, 0x00000031, 0x00392800, 0x0A122C27, 0xA40C2F00, 0x000C1012, - 0x2C27870C, 0x2F00000C, 0x111B102A, 0x002F001C, 0x0200080F, 0x27882D00, 0x180C100F, - 0x27892D00, 0x180C1012, 0x2C27850C, 0x2FFFD20E, 0x27860C10, +MsgScript D_80B2C320[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2784), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x00FF), + /* 0x0007 0x07 */ MSCRIPT_CMD_CHECK_CALLBACK_MULTI(0x0, 0x003F - 0x000E, 0x0047 - 0x000E), + /* 0x000E 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK_CONTINUE(0x001B - 0x0011), + /* 0x0011 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0012 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x27A4), + /* 0x0015 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0016 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x0019 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001A 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x001B 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x001C 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x2787), + /* 0x001F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0020 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x0023 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0024 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_EAST_LOWER_CLOCKTOWN), + /* 0x0027 0x03 */ MSCRIPT_CMD_DELETE_ITEM(ITEM_LETTER_TO_KAFEI), + /* 0x002A 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_28_02, 0x0037 - 0x002F), + /* 0x002F 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2788), + /* 0x0032 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_DEPOSITED_LETTER_TO_KAFEI), + /* 0x0035 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0036 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0037 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2789), + /* 0x003A 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_DEPOSITED_LETTER_TO_KAFEI), + /* 0x003D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x003E 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x003F 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0040 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x2785), + /* 0x0043 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0044 0x03 */ MSCRIPT_CMD_JUMP_3(0x0019 - 0x0047), + + /* 0x0047 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2786), + /* 0x004A 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x004B 0x01 */ MSCRIPT_CMD_DONE(), }; -s32 D_80B2C36C[] = { - 0x0E27840C, 0x0E00FF2B, 0x00000031, 0x00392800, 0x0A122C27, 0xA40C2F00, 0x000C1012, - 0x2C27870C, 0x2F00000C, 0x111B202A, 0x002F001C, 0x0400080F, 0x27882D00, 0x180C100F, - 0x27892D00, 0x180C1012, 0x2C27850C, 0x2FFFD20E, 0x27860C10, +MsgScript D_80B2C36C[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2784), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x00FF), + /* 0x0007 0x07 */ MSCRIPT_CMD_CHECK_CALLBACK_MULTI(0x0, 0x003F - 0x000E, 0x0047 - 0x000E), + /* 0x000E 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK_CONTINUE(0x001B - 0x0011), + /* 0x0011 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0012 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x27A4), + /* 0x0015 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0016 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x0019 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001A 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x001B 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x001C 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x2787), + /* 0x001F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0020 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x0023 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0024 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_SOUTH_LOWER_CLOCKTOWN), + /* 0x0027 0x03 */ MSCRIPT_CMD_DELETE_ITEM(ITEM_LETTER_TO_KAFEI), + /* 0x002A 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_28_04, 0x0037 - 0x002F), + /* 0x002F 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2788), + /* 0x0032 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_DEPOSITED_LETTER_TO_KAFEI), + /* 0x0035 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0036 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0037 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2789), + /* 0x003A 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_DEPOSITED_LETTER_TO_KAFEI), + /* 0x003D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x003E 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x003F 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0040 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x2785), + /* 0x0043 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0044 0x03 */ MSCRIPT_CMD_JUMP_3(0x0019 - 0x0047), + + /* 0x0047 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2786), + /* 0x004A 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x004B 0x01 */ MSCRIPT_CMD_DONE(), }; -s32 D_80B2C3B8[] = { - 0x0E27A10C, 0x0F27A20C, 0x12005108, 0x000F0600, 0x0C000013, 0x000C0C11, - 0x51080700, 0x0C060001, 0x00001300, 0x010C0700, 0x000E27A3, 0x0C161000, +MsgScript D_80B2C3B8[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x27A1), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x27A2), + /* 0x0007 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0008 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0009 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_81_08, 0x001D - 0x000E), + /* 0x000E 0x05 */ MSCRIPT_CMD_OFFER_ITEM(GI_HEART_PIECE, 0x0), + /* 0x0013 0x03 */ MSCRIPT_CMD_SET_COLLECTIBLE(0x000C), + /* 0x0016 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0017 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_81_08), + /* 0x001A 0x03 */ MSCRIPT_CMD_AUTOTALK(0x0029 - 0x001D), + /* 0x001D 0x05 */ MSCRIPT_CMD_OFFER_ITEM(GI_RUPEE_GREEN, 0x0), + /* 0x0022 0x03 */ MSCRIPT_CMD_SET_COLLECTIBLE(0x0001), + /* 0x0025 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0026 0x03 */ MSCRIPT_CMD_AUTOTALK(0x0), + /* 0x0029 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x27A3), + /* 0x002C 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x002D 0x01 */ MSCRIPT_CMD_UNSET_AUTOTALK(), + /* 0x002E 0x01 */ MSCRIPT_CMD_DONE(), }; -s32 D_80B2C3E8[] = { - 0x2C27870C, 0x111B022A, 0x002F001B, 0x4000080F, 0x27882D00, 0x180C100F, 0x27892D00, 0x180C1000, +MsgScript D_80B2C3E8[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x2787), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_SOUTH_UPPER_CLOCKTOWN), + /* 0x0007 0x03 */ MSCRIPT_CMD_DELETE_ITEM(ITEM_LETTER_TO_KAFEI), + /* 0x000A 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_27_40, 0x0017 - 0x000F), + /* 0x000F 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2788), + /* 0x0012 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_DEPOSITED_LETTER_TO_KAFEI), + /* 0x0015 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0016 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0017 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2789), + /* 0x001A 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_DEPOSITED_LETTER_TO_KAFEI), + /* 0x001D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001E 0x01 */ MSCRIPT_CMD_DONE(), }; -s32 D_80B2C408[] = { - 0x2C27870C, 0x111B042A, 0x002F001B, 0x8000080F, 0x27882D00, 0x180C100F, 0x27892D00, 0x180C1000, +MsgScript D_80B2C408[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x2787), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_NORTH_CLOCKTOWN), + /* 0x0007 0x03 */ MSCRIPT_CMD_DELETE_ITEM(ITEM_LETTER_TO_KAFEI), + /* 0x000A 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_27_80, 0x0017 - 0x000F), + /* 0x000F 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2788), + /* 0x0012 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_DEPOSITED_LETTER_TO_KAFEI), + /* 0x0015 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0016 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0017 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2789), + /* 0x001A 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_DEPOSITED_LETTER_TO_KAFEI), + /* 0x001D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001E 0x01 */ MSCRIPT_CMD_DONE(), }; -s32 D_80B2C428[] = { - 0x2C27870C, 0x111B082A, 0x002F001C, 0x0100080F, 0x27882D00, 0x180C100F, 0x27892D00, 0x180C1000, +MsgScript D_80B2C428[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x2787), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_EAST_UPPER_CLOCKTOWN), + /* 0x0007 0x03 */ MSCRIPT_CMD_DELETE_ITEM(ITEM_LETTER_TO_KAFEI), + /* 0x000A 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_28_01, 0x0017 - 0x000F), + /* 0x000F 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2788), + /* 0x0012 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_DEPOSITED_LETTER_TO_KAFEI), + /* 0x0015 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0016 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0017 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2789), + /* 0x001A 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_DEPOSITED_LETTER_TO_KAFEI), + /* 0x001D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001E 0x01 */ MSCRIPT_CMD_DONE(), }; -s32 D_80B2C448[] = { - 0x2C27870C, 0x111B102A, 0x002F001C, 0x0200080F, 0x27882D00, 0x180C100F, 0x27892D00, 0x180C1000, +MsgScript D_80B2C448[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x2787), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_EAST_LOWER_CLOCKTOWN), + /* 0x0007 0x03 */ MSCRIPT_CMD_DELETE_ITEM(ITEM_LETTER_TO_KAFEI), + /* 0x000A 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_28_02, 0x0017 - 0x000F), + /* 0x000F 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2788), + /* 0x0012 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_DEPOSITED_LETTER_TO_KAFEI), + /* 0x0015 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0016 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0017 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2789), + /* 0x001A 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_DEPOSITED_LETTER_TO_KAFEI), + /* 0x001D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001E 0x01 */ MSCRIPT_CMD_DONE(), }; -s32 D_80B2C468[] = { - 0x2C27870C, 0x111B202A, 0x002F001C, 0x0400080F, 0x27882D00, 0x180C100F, 0x27892D00, 0x180C1000, +MsgScript D_80B2C468[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x2787), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_SOUTH_LOWER_CLOCKTOWN), + /* 0x0007 0x03 */ MSCRIPT_CMD_DELETE_ITEM(ITEM_LETTER_TO_KAFEI), + /* 0x000A 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_28_04, 0x0017 - 0x000F), + /* 0x000F 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2788), + /* 0x0012 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_DEPOSITED_LETTER_TO_KAFEI), + /* 0x0015 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0016 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0017 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2789), + /* 0x001A 0x03 */ MSCRIPT_CMD_NOTEBOOK_EVENT(BOMBERS_NOTEBOOK_EVENT_DEPOSITED_LETTER_TO_KAFEI), + /* 0x001D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001E 0x01 */ MSCRIPT_CMD_DONE(), }; -s32 D_80B2C488[] = { 0x2C27A40C, 0x10000000 }; +MsgScript D_80B2C488[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x27A4), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x01 */ MSCRIPT_CMD_DONE(), +}; -s32 D_80B2C490[] = { 0x2C27850C, 0x10000000 }; +MsgScript D_80B2C490[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x2785), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x01 */ MSCRIPT_CMD_DONE(), +}; ActorInit En_Pst_InitVars = { /**/ ACTOR_EN_PST, @@ -226,7 +491,7 @@ s32 EnPst_ChooseBehaviour(Actor* thisx, PlayState* play) { return scriptBranch; } -s32* EnPst_GetMsgEventScript(EnPst* this, PlayState* play) { +MsgScript* EnPst_GetMsgScript(EnPst* this, PlayState* play) { if (Player_GetMask(play) == PLAYER_MASK_POSTMAN) { return D_80B2C3B8; } @@ -261,7 +526,7 @@ s32* EnPst_GetMsgEventScript(EnPst* this, PlayState* play) { } } - this->msgEventCallback = EnPst_ChooseBehaviour; + this->msgScriptCallback = EnPst_ChooseBehaviour; switch (this->actor.params) { case POSTBOX_SOUTH_UPPER_CLOCKTOWN: @@ -302,9 +567,9 @@ s32 EnPst_CheckTalk(EnPst* this, PlayState* play) { this->isLetterToKafeiDeposited = EnPst_HandleLetterDay1(this); SubS_SetOfferMode(&this->stateFlags, SUBS_OFFER_MODE_NONE, SUBS_OFFER_MODE_MASK); this->behaviour = 0; - this->msgEventCallback = NULL; + this->msgScriptCallback = NULL; this->stateFlags |= 0x40; - this->msgEventScript = EnPst_GetMsgEventScript(this, play); + this->msgScript = EnPst_GetMsgScript(this, play); this->actionFunc = EnPst_Talk; ret = true; } @@ -364,7 +629,7 @@ void EnPst_FollowSchedule(EnPst* this, PlayState* play) { } void EnPst_Talk(EnPst* this, PlayState* play) { - if (func_8010BF58(&this->actor, play, this->msgEventScript, this->msgEventCallback, &this->msgEventArg4)) { + if (MsgEvent_RunScript(&this->actor, play, this->msgScript, this->msgScriptCallback, &this->msgScriptPos)) { if (EnPst_HandleLetterDay1(this) != this->isLetterToKafeiDeposited) { switch (gSaveContext.save.day) { case 1: @@ -385,7 +650,7 @@ void EnPst_Talk(EnPst* this, PlayState* play) { } } SubS_SetOfferMode(&this->stateFlags, SUBS_OFFER_MODE_ONSCREEN, SUBS_OFFER_MODE_MASK); - this->msgEventArg4 = 0; + this->msgScriptPos = 0; this->actionFunc = EnPst_FollowSchedule; } } diff --git a/src/overlays/actors/ovl_En_Pst/z_en_pst.h b/src/overlays/actors/ovl_En_Pst/z_en_pst.h index 9a47181e8e..eecd1a8e70 100644 --- a/src/overlays/actors/ovl_En_Pst/z_en_pst.h +++ b/src/overlays/actors/ovl_En_Pst/z_en_pst.h @@ -15,7 +15,6 @@ typedef enum { struct EnPst; typedef void (*EnPstActionFunc)(struct EnPst*, PlayState*); -typedef s32 (*MsgEventFunc)(Actor*, PlayState*); typedef struct EnPst { /* 0x000 */ Actor actor; @@ -23,14 +22,14 @@ typedef struct EnPst { /* 0x188 */ EnPstActionFunc actionFunc; /* 0x18C */ ColliderCylinder collider; /* 0x1D8 */ u8 scheduleResult; - /* 0x1DC */ s32* msgEventScript; - /* 0x1E0 */ s32 msgEventArg4; + /* 0x1DC */ MsgScript* msgScript; + /* 0x1E0 */ s32 msgScriptPos; /* 0x1E4 */ Vec3s jointTable[POSTBOX_LIMB_MAX]; /* 0x1F6 */ Vec3s morphTable[POSTBOX_LIMB_MAX]; /* 0x208 */ u16 stateFlags; /* 0x20A */ UNK_TYPE1 pad20A[4]; /* 0x20E */ s16 behaviour; - /* 0x210 */ MsgEventFunc msgEventCallback; + /* 0x210 */ MsgScriptCallback msgScriptCallback; /* 0x214 */ s32 unk214; // Set and not used /* 0x218 */ s32 exchangeItemAction; /* 0x21C */ s32 isLetterToKafeiDeposited; diff --git a/src/overlays/actors/ovl_En_Shn/z_en_shn.c b/src/overlays/actors/ovl_En_Shn/z_en_shn.c index 53bccc2194..fe030be78a 100644 --- a/src/overlays/actors/ovl_En_Shn/z_en_shn.c +++ b/src/overlays/actors/ovl_En_Shn/z_en_shn.c @@ -19,37 +19,378 @@ void EnShn_Draw(Actor* thisx, PlayState* play); void func_80AE6A64(EnShn* this, PlayState* play); -// Could be something related to text/dialogue? -static UNK_TYPE D_80AE6F00[] = { - 0x00170800, 0x0B0E09C4, 0x0C0F09C5, 0x0C111708, 0x03018C04, 0x018E1901, 0x860F00FF, 0x1E001300, 0x00011501, - 0x47280012, 0x28001928, 0x002D2800, 0x5D280093, 0x28003319, 0x00472C09, 0xE70C2F00, 0x000C1210, 0x2C09CB0C, - 0x2F00000C, 0x0F09CC0C, 0x0F09CD0C, 0x0500A500, 0xCB00CB2C, 0x09D10C2F, 0x00000C0F, 0x09D20C19, 0xFFE62C09, - 0xD30C2F00, 0x000C0F09, 0xD40C0F09, 0xD50C0500, 0x9200B200, 0xB22C09D9, 0x0C2F0000, 0x0C0F09DA, 0x0C102C09, - 0xE80C2F00, 0x000C0F09, 0xE90C0F09, 0xEA0C0057, 0x04001712, 0x06000C00, 0x0013000C, 0x0C115704, 0x0700000E, - 0x09EB0C12, 0x16101206, 0x00060000, 0x1300060C, 0x07FFEC2C, 0x09EC0C2F, 0x00000C0F, 0x09ED0C0F, 0x09EE0C00, - 0x57040017, 0x1206000C, 0x00001300, 0x0C0C1157, 0x04070000, 0x0E09EF0C, 0x12161012, 0x06000600, 0x00130006, - 0x0C07FFEC, 0x12060004, 0x00001300, 0x040C0700, 0x000E09CE, 0x0C161012, 0x06000200, 0x00130002, 0x0C070000, - 0x0E09D80C, 0x16100C0F, 0x09CF0C1C, 0x05011509, 0x0000100E, 0x09D60C19, 0xFFF10037, 0x40001C2C, 0x09DB0C2F, - 0x00000C0F, 0x09DC0C0F, 0x09DD0C0F, 0x09DE0C0F, 0x09DF0C11, 0x3740102C, 0x09E00C2F, 0x00000C0F, 0x09E10C0F, - 0x09E20C10, 0x00374000, 0x180E09DB, 0x0C0F09DC, 0x0C0F09DD, 0x0C0F09DE, 0x0C0F09DF, 0x0C113740, 0x100E09E0, - 0x0C0F09E1, 0x0C0F09E2, 0x0C100E09, 0xC90C0F09, 0xCA0C100E, 0x09C60C10, 0x001402FF, 0xED0E09C8, 0x0C19FE69 +static MsgScript D_80AE6F00[] = { + /* 0x0000 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_23_08, 0x0010 - 0x0005), + /* 0x0005 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x09C4), + /* 0x0008 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0009 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09C5), + /* 0x000C 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000D 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_23_08), + /* 0x0010 0x03 */ MSCRIPT_CMD_CHECK_DEKU(0x019F - 0x0013), + /* 0x0013 0x03 */ MSCRIPT_CMD_CHECK_HUMAN(0x01A4 - 0x0016), + /* 0x0016 0x03 */ MSCRIPT_CMD_JUMP(0x019F - 0x0019), + /* 0x0019 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x00FF), + /* 0x001C 0x09 */ MSCRIPT_CMD_CHECK_ITEM_ACTION(PLAYER_IA_PICTOGRAPH_BOX, 0x0, 0x013A - 0x0025, 0x016C - 0x0025), + /* 0x0025 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK_CONTINUE(0x003A - 0x0028), + /* 0x0028 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK_CONTINUE(0x0044 - 0x002B), + /* 0x002B 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK_CONTINUE(0x005B - 0x002E), + /* 0x002E 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK_CONTINUE(0x008E - 0x0031), + /* 0x0031 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK_CONTINUE(0x00C7 - 0x0034), + /* 0x0034 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK_CONTINUE(0x006A - 0x0037), + /* 0x0037 0x03 */ MSCRIPT_CMD_JUMP(0x0081 - 0x003A), + /* 0x003A 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x09E7), + /* 0x003D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x003E 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x0041 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0042 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0043 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0044 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x09CB), + /* 0x0047 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0048 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x004B 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x004C 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09CC), + /* 0x004F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0050 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09CD), + /* 0x0053 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0054 0x07 */ MSCRIPT_CMD_CHECK_TEXT_CHOICE(0x0100 - 0x005B, 0x0126 - 0x005B, 0x0126 - 0x005B), + /* 0x005B 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x09D1), + /* 0x005E 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x005F 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x0062 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0063 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09D2), + /* 0x0066 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0067 0x03 */ MSCRIPT_CMD_JUMP(0x0050 - 0x006A), + + /* 0x006A 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x09D3), + /* 0x006D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x006E 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x0071 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0072 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09D4), + /* 0x0075 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0076 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09D5), + /* 0x0079 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x007A 0x07 */ MSCRIPT_CMD_CHECK_TEXT_CHOICE(0x0113 - 0x0081, 0x0133 - 0x0081, 0x0133 - 0x0081), + /* 0x0081 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x09D9), + /* 0x0084 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0085 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x0088 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0089 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09DA), + /* 0x008C 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x008D 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x008E 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x09E8), + /* 0x0091 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0092 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x0095 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0096 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09E9), + /* 0x0099 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x009A 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09EA), + /* 0x009D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x009E 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_87_04, 0x00BA - 0x00A3), + /* 0x00A3 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x00A4 0x05 */ MSCRIPT_CMD_OFFER_ITEM(GI_HEART_PIECE, 0x0), + /* 0x00A9 0x03 */ MSCRIPT_CMD_SET_COLLECTIBLE(0x000C), + /* 0x00AC 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00AD 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_87_04), + /* 0x00B0 0x03 */ MSCRIPT_CMD_AUTOTALK(0x0), + /* 0x00B3 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x09EB), + /* 0x00B6 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00B7 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x00B8 0x01 */ MSCRIPT_CMD_UNSET_AUTOTALK(), + /* 0x00B9 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x00BA 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x00BB 0x05 */ MSCRIPT_CMD_OFFER_ITEM(GI_RUPEE_SILVER, 0x0), + /* 0x00C0 0x03 */ MSCRIPT_CMD_SET_COLLECTIBLE(0x0006), + /* 0x00C3 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00C4 0x03 */ MSCRIPT_CMD_AUTOTALK(0x00B3 - 0x00C7), + + /* 0x00C7 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x09EC), + /* 0x00CA 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00CB 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x00CE 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00CF 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09ED), + /* 0x00D2 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00D3 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09EE), + /* 0x00D6 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00D7 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_87_04, 0x00F3 - 0x00DC), + /* 0x00DC 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x00DD 0x05 */ MSCRIPT_CMD_OFFER_ITEM(GI_HEART_PIECE, 0x0), + /* 0x00E2 0x03 */ MSCRIPT_CMD_SET_COLLECTIBLE(0x000C), + /* 0x00E5 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00E6 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_87_04), + /* 0x00E9 0x03 */ MSCRIPT_CMD_AUTOTALK(0x0), + /* 0x00EC 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x09EF), + /* 0x00EF 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00F0 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x00F1 0x01 */ MSCRIPT_CMD_UNSET_AUTOTALK(), + /* 0x00F2 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x00F3 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x00F4 0x05 */ MSCRIPT_CMD_OFFER_ITEM(GI_RUPEE_SILVER, 0x0), + /* 0x00F9 0x03 */ MSCRIPT_CMD_SET_COLLECTIBLE(0x0006), + /* 0x00FC 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00FD 0x03 */ MSCRIPT_CMD_AUTOTALK(0x00EC - 0x0100), + + /* 0x0100 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0101 0x05 */ MSCRIPT_CMD_OFFER_ITEM(GI_RUPEE_RED, 0x0), + /* 0x0106 0x03 */ MSCRIPT_CMD_SET_COLLECTIBLE(0x0004), + /* 0x0109 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x010A 0x03 */ MSCRIPT_CMD_AUTOTALK(0x0), + /* 0x010D 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x09CE), + /* 0x0110 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0111 0x01 */ MSCRIPT_CMD_UNSET_AUTOTALK(), + /* 0x0112 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0113 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0114 0x05 */ MSCRIPT_CMD_OFFER_ITEM(GI_RUPEE_BLUE, 0x0), + /* 0x0119 0x03 */ MSCRIPT_CMD_SET_COLLECTIBLE(0x0002), + /* 0x011C 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x011D 0x03 */ MSCRIPT_CMD_AUTOTALK(0x0), + /* 0x0120 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x09D8), + /* 0x0123 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0124 0x01 */ MSCRIPT_CMD_UNSET_AUTOTALK(), + /* 0x0125 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0126 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0127 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09CF), + /* 0x012A 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x012B 0x03 */ MSCRIPT_CMD_SET_EVENT_INF(EVENTINF_50), + /* 0x012E 0x01 */ MSCRIPT_CMD_PAUSE(), + /* 0x012F 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0132 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0133 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x09D6), + /* 0x0136 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0137 0x03 */ MSCRIPT_CMD_JUMP(0x012B - 0x013A), + + /* 0x013A 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_55_40, 0x015B - 0x013F), + /* 0x013F 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x09DB), + /* 0x0142 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0143 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x0146 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0147 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09DC), + /* 0x014A 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x014B 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09DD), + /* 0x014E 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x014F 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09DE), + /* 0x0152 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0153 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09DF), + /* 0x0156 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0157 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_55_40), + /* 0x015A 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x015B 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x09E0), + /* 0x015E 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x015F 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x0162 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0163 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09E1), + /* 0x0166 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0167 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09E2), + /* 0x016A 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x016B 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x016C 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_55_40, 0x0189 - 0x0171), + /* 0x0171 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x09DB), + /* 0x0174 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0175 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09DC), + /* 0x0178 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0179 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09DD), + /* 0x017C 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x017D 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09DE), + /* 0x0180 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0181 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09DF), + /* 0x0184 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0185 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_55_40), + /* 0x0188 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0189 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x09E0), + /* 0x018C 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x018D 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09E1), + /* 0x0190 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0191 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09E2), + /* 0x0194 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0195 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0196 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x09C9), + /* 0x0199 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x019A 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09CA), + /* 0x019D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x019E 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x019F 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x09C6), + /* 0x01A2 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x01A3 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x01A4 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE, 0x0196 - 0x01A9), + /* 0x01A9 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x09C8), + /* 0x01AC 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x01AD 0x03 */ MSCRIPT_CMD_JUMP(0x0019 - 0x01B0), }; -static UNK_TYPE D_80AE70B0[] = { 0x0E09D00C, 0x16100000 }; - -static UNK_TYPE D_80AE70B8[] = { - 0x28001228, 0x00152800, 0x28280055, 0x28008A28, 0x002D1900, 0x402C09E7, 0x0C12102C, 0x09CB2F00, 0x000C0F09, - 0xCC0C0F09, 0xCD0C0500, 0xA000C600, 0xC62C09D1, 0x2F00000C, 0x0F09D20C, 0x19FFE72C, 0x09D32F00, 0x000C0F09, - 0xD40C0F09, 0xD50C0500, 0x8F00AF00, 0xAF2C09D9, 0x2F00000C, 0x0F09DA0C, 0x102C09E8, 0x2F00000C, 0x0F09E90C, - 0x0F09EA0C, 0x00570400, 0x17120600, 0x0C000013, 0x000C0C11, 0x57040700, 0x000E09EB, 0x0C121610, 0x12060006, - 0x00001300, 0x060C07FF, 0xEC2C09EC, 0x2F00000C, 0x0F09ED0C, 0x0F09EE0C, 0x00570800, 0x17120600, 0x0C000013, - 0x000C0C11, 0x57080700, 0x000E09EF, 0x0C121610, 0x12060006, 0x00001300, 0x060C07FF, 0xEC120600, 0x04000013, - 0x00040C07, 0x00000E09, 0xCE0C1610, 0x12060002, 0x00001300, 0x020C0700, 0x000E09D8, 0x0C16100C, 0x0F09CF0C, - 0x1C050115, 0x09000010, 0x0E09D60C, 0x19FFF100, +static MsgScript D_80AE70B0[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x09D0), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x01 */ MSCRIPT_CMD_UNSET_AUTOTALK(), + /* 0x0005 0x01 */ MSCRIPT_CMD_DONE(), }; -static UNK_TYPE D_80AE71C4[] = { 0x00374000, 0x1C2C09DB, 0x0C2F0000, 0x0C0F09DC, 0x0C0F09DD, 0x0C0F09DE, 0x0C0F09DF, - 0x0C113740, 0x102C09E0, 0x0C2F0000, 0x0C0F09E1, 0x0C0F09E2, 0x0C100000 }; +static MsgScript D_80AE70B8[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK_CONTINUE(0x0015 - 0x0003), + /* 0x0003 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK_CONTINUE(0x001B - 0x0006), + /* 0x0006 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK_CONTINUE(0x0031 - 0x0009), + /* 0x0009 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK_CONTINUE(0x0061 - 0x000C), + /* 0x000C 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK_CONTINUE(0x0099 - 0x000F), + /* 0x000F 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK_CONTINUE(0x003F - 0x0012), + /* 0x0012 0x03 */ MSCRIPT_CMD_JUMP(0x0055 - 0x0015), + /* 0x0015 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x09E7), + /* 0x0018 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0019 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x001A 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x001B 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x09CB), + /* 0x001E 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x0021 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0022 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09CC), + /* 0x0025 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0026 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09CD), + /* 0x0029 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x002A 0x07 */ MSCRIPT_CMD_CHECK_TEXT_CHOICE(0x00D1 - 0x0031, 0x00F7 - 0x0031, 0x00F7 - 0x0031), + /* 0x0031 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x09D1), + /* 0x0034 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x0037 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0038 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09D2), + /* 0x003B 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x003C 0x03 */ MSCRIPT_CMD_JUMP(0x0026 - 0x003F), + + /* 0x003F 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x09D3), + /* 0x0042 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x0045 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0046 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09D4), + /* 0x0049 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x004A 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09D5), + /* 0x004D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x004E 0x07 */ MSCRIPT_CMD_CHECK_TEXT_CHOICE(0x00E4 - 0x0055, 0x0104 - 0x0055, 0x0104 - 0x0055), + /* 0x0055 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x09D9), + /* 0x0058 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x005B 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x005C 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09DA), + /* 0x005F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0060 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0061 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x09E8), + /* 0x0064 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x0067 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0068 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09E9), + /* 0x006B 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x006C 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09EA), + /* 0x006F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0070 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_87_04, 0x008C - 0x0075), + /* 0x0075 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0076 0x05 */ MSCRIPT_CMD_OFFER_ITEM(GI_HEART_PIECE, 0x0), + /* 0x007B 0x03 */ MSCRIPT_CMD_SET_COLLECTIBLE(0x000C), + /* 0x007E 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x007F 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_87_04), + /* 0x0082 0x03 */ MSCRIPT_CMD_AUTOTALK(0x0), + /* 0x0085 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x09EB), + /* 0x0088 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0089 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x008A 0x01 */ MSCRIPT_CMD_UNSET_AUTOTALK(), + /* 0x008B 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x008C 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x008D 0x05 */ MSCRIPT_CMD_OFFER_ITEM(GI_RUPEE_SILVER, 0x0), + /* 0x0092 0x03 */ MSCRIPT_CMD_SET_COLLECTIBLE(0x0006), + /* 0x0095 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0096 0x03 */ MSCRIPT_CMD_AUTOTALK(0x0085 - 0x0099), + + /* 0x0099 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x09EC), + /* 0x009C 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x009F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00A0 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09ED), + /* 0x00A3 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00A4 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09EE), + /* 0x00A7 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00A8 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_87_08, 0x00C4 - 0x00AD), + /* 0x00AD 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x00AE 0x05 */ MSCRIPT_CMD_OFFER_ITEM(GI_HEART_PIECE, 0x0), + /* 0x00B3 0x03 */ MSCRIPT_CMD_SET_COLLECTIBLE(0x000C), + /* 0x00B6 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00B7 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_87_08), + /* 0x00BA 0x03 */ MSCRIPT_CMD_AUTOTALK(0x0), + /* 0x00BD 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x09EF), + /* 0x00C0 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00C1 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x00C2 0x01 */ MSCRIPT_CMD_UNSET_AUTOTALK(), + /* 0x00C3 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x00C4 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x00C5 0x05 */ MSCRIPT_CMD_OFFER_ITEM(GI_RUPEE_SILVER, 0x0), + /* 0x00CA 0x03 */ MSCRIPT_CMD_SET_COLLECTIBLE(0x0006), + /* 0x00CD 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00CE 0x03 */ MSCRIPT_CMD_AUTOTALK(0x00BD - 0x00D1), + + /* 0x00D1 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x00D2 0x05 */ MSCRIPT_CMD_OFFER_ITEM(GI_RUPEE_RED, 0x0), + /* 0x00D7 0x03 */ MSCRIPT_CMD_SET_COLLECTIBLE(0x0004), + /* 0x00DA 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00DB 0x03 */ MSCRIPT_CMD_AUTOTALK(0x0), + /* 0x00DE 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x09CE), + /* 0x00E1 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00E2 0x01 */ MSCRIPT_CMD_UNSET_AUTOTALK(), + /* 0x00E3 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x00E4 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x00E5 0x05 */ MSCRIPT_CMD_OFFER_ITEM(GI_RUPEE_BLUE, 0x0), + /* 0x00EA 0x03 */ MSCRIPT_CMD_SET_COLLECTIBLE(0x0002), + /* 0x00ED 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00EE 0x03 */ MSCRIPT_CMD_AUTOTALK(0x0), + /* 0x00F1 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x09D8), + /* 0x00F4 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00F5 0x01 */ MSCRIPT_CMD_UNSET_AUTOTALK(), + /* 0x00F6 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x00F7 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00F8 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09CF), + /* 0x00FB 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x00FC 0x03 */ MSCRIPT_CMD_SET_EVENT_INF(EVENTINF_50), + /* 0x00FF 0x01 */ MSCRIPT_CMD_PAUSE(), + /* 0x0100 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0103 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0104 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x09D6), + /* 0x0107 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0108 0x03 */ MSCRIPT_CMD_JUMP(0x00FC - 0x010B), +}; + +static MsgScript D_80AE71C4[] = { + /* 0x0000 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_55_40, 0x0021 - 0x0005), + /* 0x0005 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x09DB), + /* 0x0008 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0009 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x000C 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000D 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09DC), + /* 0x0010 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0011 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09DD), + /* 0x0014 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0015 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09DE), + /* 0x0018 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0019 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09DF), + /* 0x001C 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001D 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_55_40), + /* 0x0020 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0021 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x09E0), + /* 0x0024 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0025 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x0028 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0029 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09E1), + /* 0x002C 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x002D 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x09E2), + /* 0x0030 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0031 0x01 */ MSCRIPT_CMD_DONE(), +}; ActorInit En_Shn_InitVars = { /**/ ACTOR_EN_SHN, @@ -287,18 +628,18 @@ s32 func_80AE6704(Actor* thisx, PlayState* play) { return ret; } -UNK_TYPE* func_80AE6880(EnShn* this, PlayState* play) { +MsgScript* EnShn_GetMsgScript(EnShn* this, PlayState* play) { if (this->unk_2BE != 0) { return D_80AE70B0; } if (this->unk_1D8 & 0x80) { - this->unk_2D8 = func_80AE6704; + this->msgScriptCallback = func_80AE6704; return D_80AE70B8; } if (this->unk_1D8 & 0x100) { return D_80AE71C4; } - this->unk_2D8 = func_80AE6704; + this->msgScriptCallback = func_80AE6704; return D_80AE6F00; } @@ -317,7 +658,7 @@ s32 func_80AE68F0(EnShn* this, PlayState* play) { this->unk_2E4 = player->exchangeItemAction; } SubS_SetOfferMode(&this->unk_1D8, SUBS_OFFER_MODE_NONE, SUBS_OFFER_MODE_MASK); - this->unk_1DC = func_80AE6880(this, play); + this->msgScript = EnShn_GetMsgScript(this, play); this->unk_2C6 = 0; if (CHECK_WEEKEVENTREG(WEEKEVENTREG_23_08)) { this->unk_1D8 |= 8; @@ -342,12 +683,12 @@ void func_80AE6A64(EnShn* this, PlayState* play) { Vec3f playerPos; Vec3f shnPos; - if (func_8010BF58(&this->actor, play, this->unk_1DC, this->unk_2D8, &this->unk_1E0)) { + if (MsgEvent_RunScript(&this->actor, play, this->msgScript, this->msgScriptCallback, &this->msgScriptPos)) { SubS_SetOfferMode(&this->unk_1D8, SUBS_OFFER_MODE_ONSCREEN, SUBS_OFFER_MODE_MASK); this->unk_1D8 &= ~8; this->unk_1D8 |= 0x20; this->unk_2CA = 20; - this->unk_1E0 = 0; + this->msgScriptPos = 0; this->unk_2BE = 0; this->actionFunc = func_80AE69E8; } else if (this->shnPlayerRef != 0) { @@ -375,7 +716,7 @@ void EnShn_Init(Actor* thisx, PlayState* play) { this->actor.targetMode = TARGET_MODE_6; Actor_SetScale(&this->actor, 0.01f); this->unk_2E0 = 0; - this->unk_2D8 = 0; + this->msgScriptCallback = NULL; this->unk_1D8 = 0; if (gSaveContext.save.entrance != ENTRANCE(TOURIST_INFORMATION, 2)) { SubS_SetOfferMode(&this->unk_1D8, SUBS_OFFER_MODE_ONSCREEN, SUBS_OFFER_MODE_MASK); diff --git a/src/overlays/actors/ovl_En_Shn/z_en_shn.h b/src/overlays/actors/ovl_En_Shn/z_en_shn.h index e2bef2f10f..96fb05b24e 100644 --- a/src/overlays/actors/ovl_En_Shn/z_en_shn.h +++ b/src/overlays/actors/ovl_En_Shn/z_en_shn.h @@ -7,7 +7,6 @@ struct EnShn; typedef void (*EnShnActionFunc)(struct EnShn*, PlayState*); -typedef s32 (*MsgEventFunc)(Actor*, PlayState*); typedef struct EnShn { /* 0x000 */ Actor actor; @@ -16,8 +15,8 @@ typedef struct EnShn { /* 0x18C */ UNK_TYPE1 pad_18C[0x4C]; /* 0x1D8 */ u16 unk_1D8; /* 0x1DA */ u16 unk_1DA; - /* 0x1DC */ UNK_TYPE* unk_1DC; - /* 0x1E0 */ s32 unk_1E0; + /* 0x1DC */ MsgScript* msgScript; + /* 0x1E0 */ s32 msgScriptPos; /* 0x1E4 */ Player* shnPlayerRef; /* 0x1E8 */ Vec3f unk_1E8; /* 0x1F4 */ Vec3s unk_1F4; @@ -35,7 +34,7 @@ typedef struct EnShn { /* 0x2CC */ f32 animPlaySpeed; /* 0x2D0 */ f32 unk_2D0; /* 0x2D4 */ f32 unk_2D4; - /* 0x2D8 */ MsgEventFunc unk_2D8; + /* 0x2D8 */ MsgScriptCallback msgScriptCallback; /* 0x2DC */ s32 prevTalkState; /* 0x2E0 */ s32 unk_2E0; /* 0x2E4 */ s32 unk_2E4; 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 45f263baed..7c825e5f72 100644 --- a/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c +++ b/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c @@ -267,6 +267,9 @@ u16 EnSob1_GetWelcome(EnSob1* this, PlayState* play) { case PLAYER_MASK_KAFEIS_MASK: return 0x68A; + + default: + break; } } else if (this->shopType == ZORA_SHOP) { switch (player->transformation) { diff --git a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c index 44282ef407..a5b49b6b59 100644 --- a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c +++ b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c @@ -685,7 +685,7 @@ void func_80BABB90(EnSuttari* this, s32 arg1) { } s32 func_80BABC48(EnSuttari* this, PlayState* play, ScheduleOutput* scheduleOutput) { - u16 sp26 = SCHEDULE_TIME_NOW; + u16 sp26 = SCRIPT_TIME_NOW; u16 phi_a0; u8 pathIndex = ENSUTTARI_GET_PATH_INDEX(&this->actor); u16 tmp; @@ -719,7 +719,7 @@ s32 func_80BABDD8(EnSuttari* this, PlayState* play, ScheduleOutput* scheduleOutp s32 pad; EnDoor* door; u8 pathIndex = ENSUTTARI_GET_PATH_INDEX(&this->actor); - u16 sp44 = SCHEDULE_TIME_NOW; + u16 sp44 = SCRIPT_TIME_NOW; Vec3f sp38; Vec3f sp2C; Vec3s* sp28; diff --git a/src/overlays/actors/ovl_En_Tab/z_en_tab.c b/src/overlays/actors/ovl_En_Tab/z_en_tab.c index 479ea6f123..23579142d2 100644 --- a/src/overlays/actors/ovl_En_Tab/z_en_tab.c +++ b/src/overlays/actors/ovl_En_Tab/z_en_tab.c @@ -22,32 +22,194 @@ void func_80BE1348(EnTab* this, PlayState* play); #include "src/overlays/actors/ovl_En_Tab/scheduleScripts.schl.inc" -s32 D_80BE1914[] = { - 0x003A0200, 0x080E2AF9, 0x0C113A02, 0x100E2AFA, 0x0C150900, 0x000E2AFB, - 0x0C003401, 0x00090F2A, 0xFD0C0F2A, 0xFE0C100F, 0x2AFC0C10, +MsgScript D_80BE1914[] = { + /* 0x0000 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_58_02, 0x000D - 0x0005), + /* 0x0005 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AF9), + /* 0x0008 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0009 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_58_02), + /* 0x000C 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x000D 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AFA), + /* 0x0010 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0011 0x01 */ MSCRIPT_CMD_PAUSE(), + /* 0x0012 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0015 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AFB), + /* 0x0018 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0019 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_ESCORTED_CREMIA, 0x0027 - 0x001E), + /* 0x001E 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2AFD), + /* 0x0021 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0022 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2AFE), + /* 0x0025 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0026 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0027 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2AFC), + /* 0x002A 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x002B 0x01 */ MSCRIPT_CMD_DONE(), }; -s32 D_80BE1940[] = { - 0x003F0400, 0x080E2B3D, 0x0C113F04, 0x100E2B3E, 0x0C0F2AFA, 0x0C150900, - 0x000E2AFB, 0x0C003401, 0x00090F2A, 0xFD0C0F2A, 0xFE0C100F, 0x2AFC0C10, +MsgScript D_80BE1940[] = { + /* 0x0000 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_63_04, 0x000D - 0x0005), + /* 0x0005 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2B3D), + /* 0x0008 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0009 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_63_04), + /* 0x000C 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x000D 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2B3E), + /* 0x0010 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0011 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2AFA), + /* 0x0014 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0015 0x01 */ MSCRIPT_CMD_PAUSE(), + /* 0x0016 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0019 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AFB), + /* 0x001C 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001D 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_ESCORTED_CREMIA, 0x002B - 0x0022), + /* 0x0022 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2AFD), + /* 0x0025 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0026 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2AFE), + /* 0x0029 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x002A 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x002B 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x2AFC), + /* 0x002E 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x002F 0x01 */ MSCRIPT_CMD_DONE(), }; -s32 D_80BE1970[] = { 0x003A0100, 0x080E2AFF, 0x0C113A01, 0x100E2B00, 0x0C100000 }; +MsgScript D_80BE1970[] = { + /* 0x0000 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_58_01, 0x000D - 0x0005), + /* 0x0005 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2AFF), + /* 0x0008 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0009 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_58_01), + /* 0x000C 0x01 */ MSCRIPT_CMD_DONE(), -s32 D_80BE1984[] = { 0x00500100, 0x080E2B3F, 0x0C115001, 0x100E2B40, 0x0C100000 }; - -s32 D_80BE1998[] = { 0x0E2B090C, 0x10000000 }; - -s32 D_80BE19A0[] = { - 0x0E2B0A0C, 0x05004E00, 0x00004E30, 0x2800050E, 0x2B0E0C10, 0x0E2B0B0C, 0x05000000, 0x08001008, 0x00140026, - 0x19000E08, 0x00C8000F, 0x19000631, 0x0E2B0D0C, 0x10320E2B, 0x0C0C1030, 0x1214FF38, 0x06009100, 0x00130091, - 0x0C103012, 0x14FFEC06, 0x00920000, 0x1300920C, 0x10300034, 0x0100050E, 0x2B0F0C10, 0x0E2B110C, 0x10000000, + /* 0x000D 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2B00), + /* 0x0010 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0011 0x01 */ MSCRIPT_CMD_DONE(), }; -s32 D_80BE1A0C[] = { - 0x0E2B0A0C, 0x05004E00, 0x00004E30, 0x2800050E, 0x2B0E0C10, 0x0E2B0B0C, 0x05000000, 0x08001008, 0x00140026, - 0x19000E08, 0x00C8000F, 0x19000631, 0x0E2B0D0C, 0x10320E2B, 0x0C0C1030, 0x1214FF38, 0x06009100, 0x00130091, - 0x0C103012, 0x14FFEC06, 0x00920000, 0x1300920C, 0x10300034, 0x0100050E, 0x2B100C10, 0x0E2B110C, 0x10000000, +MsgScript D_80BE1984[] = { + /* 0x0000 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_80_01, 0x000D - 0x0005), + /* 0x0005 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2B3F), + /* 0x0008 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0009 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_80_01), + /* 0x000C 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x000D 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2B40), + /* 0x0010 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0011 0x01 */ MSCRIPT_CMD_DONE(), +}; + +MsgScript D_80BE1998[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2B09), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x01 */ MSCRIPT_CMD_DONE(), +}; + +MsgScript D_80BE19A0[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2B0A), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x07 */ MSCRIPT_CMD_CHECK_TEXT_CHOICE(0x0059 - 0x000B, 0x0, 0x0059 - 0x000B), + /* 0x000B 0x01 */ MSCRIPT_CMD_PLAY_DECIDE(), + /* 0x000C 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK_CONTINUE(0x0014 - 0x000F), + /* 0x000F 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2B0E), + /* 0x0012 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0013 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0014 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2B0B), + /* 0x0017 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0018 0x07 */ MSCRIPT_CMD_CHECK_TEXT_CHOICE(0x0, 0x0027 - 0x001F, 0x002F - 0x001F), + /* 0x001F 0x05 */ MSCRIPT_CMD_CHECK_RUPEES(20, 0x004A - 0x0024), + /* 0x0024 0x03 */ MSCRIPT_CMD_JUMP(0x0035 - 0x0027), + /* 0x0027 0x05 */ MSCRIPT_CMD_CHECK_RUPEES(200, 0x003B - 0x002C), + /* 0x002C 0x03 */ MSCRIPT_CMD_JUMP(0x0035 - 0x002F), + /* 0x002F 0x01 */ MSCRIPT_CMD_PLAY_CANCEL(), + /* 0x0030 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2B0D), + /* 0x0033 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0034 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0035 0x01 */ MSCRIPT_CMD_PLAY_ERROR(), + /* 0x0036 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2B0C), + /* 0x0039 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x003A 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x003B 0x01 */ MSCRIPT_CMD_PLAY_DECIDE(), + /* 0x003C 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x003D 0x03 */ MSCRIPT_CMD_CHANGE_RUPEES(-200), + /* 0x0040 0x05 */ MSCRIPT_CMD_OFFER_ITEM(GI_CHATEAU, 0x0), + /* 0x0045 0x03 */ MSCRIPT_CMD_SET_COLLECTIBLE(0x0091), + /* 0x0048 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0049 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x004A 0x01 */ MSCRIPT_CMD_PLAY_DECIDE(), + /* 0x004B 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x004C 0x03 */ MSCRIPT_CMD_CHANGE_RUPEES(-20), + /* 0x004F 0x05 */ MSCRIPT_CMD_OFFER_ITEM(GI_MILK, 0x0), + /* 0x0054 0x03 */ MSCRIPT_CMD_SET_COLLECTIBLE(0x0092), + /* 0x0057 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0058 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0059 0x01 */ MSCRIPT_CMD_PLAY_DECIDE(), + /* 0x005A 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_ESCORTED_CREMIA, 0x0064 - 0x005F), + /* 0x005F 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2B0F), + /* 0x0062 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0063 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0064 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2B11), + /* 0x0067 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0068 0x01 */ MSCRIPT_CMD_DONE(), +}; + +MsgScript D_80BE1A0C[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2B0A), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x07 */ MSCRIPT_CMD_CHECK_TEXT_CHOICE(0x0059 - 0x000B, 0x0, 0x0059 - 0x000B), + /* 0x000B 0x01 */ MSCRIPT_CMD_PLAY_DECIDE(), + /* 0x000C 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK_CONTINUE(0x0014 - 0x000F), + /* 0x000F 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2B0E), + /* 0x0012 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0013 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0014 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2B0B), + /* 0x0017 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0018 0x07 */ MSCRIPT_CMD_CHECK_TEXT_CHOICE(0x0, 0x0027 - 0x001F, 0x002F - 0x001F), + /* 0x001F 0x05 */ MSCRIPT_CMD_CHECK_RUPEES(20, 0x004A - 0x0024), + /* 0x0024 0x03 */ MSCRIPT_CMD_JUMP(0x0035 - 0x0027), + /* 0x0027 0x05 */ MSCRIPT_CMD_CHECK_RUPEES(200, 0x003B - 0x002C), + /* 0x002C 0x03 */ MSCRIPT_CMD_JUMP(0x0035 - 0x002F), + /* 0x002F 0x01 */ MSCRIPT_CMD_PLAY_CANCEL(), + /* 0x0030 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2B0D), + /* 0x0033 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0034 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0035 0x01 */ MSCRIPT_CMD_PLAY_ERROR(), + /* 0x0036 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2B0C), + /* 0x0039 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x003A 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x003B 0x01 */ MSCRIPT_CMD_PLAY_DECIDE(), + /* 0x003C 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x003D 0x03 */ MSCRIPT_CMD_CHANGE_RUPEES(-200), + /* 0x0040 0x05 */ MSCRIPT_CMD_OFFER_ITEM(GI_CHATEAU, 0x0), + /* 0x0045 0x03 */ MSCRIPT_CMD_SET_COLLECTIBLE(0x0091), + /* 0x0048 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0049 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x004A 0x01 */ MSCRIPT_CMD_PLAY_DECIDE(), + /* 0x004B 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x004C 0x03 */ MSCRIPT_CMD_CHANGE_RUPEES(-20), + /* 0x004F 0x05 */ MSCRIPT_CMD_OFFER_ITEM(GI_MILK, 0x0), + /* 0x0054 0x03 */ MSCRIPT_CMD_SET_COLLECTIBLE(0x0092), + /* 0x0057 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0058 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0059 0x01 */ MSCRIPT_CMD_PLAY_DECIDE(), + /* 0x005A 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_ESCORTED_CREMIA, 0x0064 - 0x005F), + /* 0x005F 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2B10), + /* 0x0062 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0063 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0064 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x2B11), + /* 0x0067 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0068 0x01 */ MSCRIPT_CMD_DONE(), }; ActorInit En_Tab_InitVars = { @@ -176,7 +338,7 @@ s32 func_80BE06DC(EnTab* this, PlayState* play) { SubS_SetOfferMode(&this->unk_2FC, SUBS_OFFER_MODE_NONE, SUBS_OFFER_MODE_MASK); ret = true; this->unk_320 = 0; - this->unk_328 = NULL; + this->msgScriptCallback = NULL; this->actor.child = &GET_PLAYER(play)->actor; this->unk_2FC |= 8; this->actionFunc = func_80BE1348; @@ -299,12 +461,12 @@ s32 func_80BE0C04(EnTab* this, Actor* actor, f32 arg2) { return ret; } -s32 func_80BE0D38(EnTab* this, PlayState* play) { +s32 func_80BE0D38(Actor* thisx, PlayState* play) { return Inventory_HasEmptyBottle(); } -s32 func_80BE0D60(EnTab* this, PlayState* play) { - s32 pad; +s32 func_80BE0D60(Actor* thisx, PlayState* play) { + EnTab* this = THIS; s32 ret = false; this->unk_320++; @@ -318,7 +480,7 @@ s32 func_80BE0D60(EnTab* this, PlayState* play) { return ret; } -s32* func_80BE0E04(EnTab* this, PlayState* play) { +MsgScript* EnTab_GetMsgScript(EnTab* this, PlayState* play) { Player* player = GET_PLAYER(play); if (player->transformation == PLAYER_FORM_DEKU) { @@ -327,7 +489,7 @@ s32* func_80BE0E04(EnTab* this, PlayState* play) { switch (this->unk_1D8) { case 2: - this->unk_328 = func_80BE0D38; + this->msgScriptCallback = func_80BE0D38; if (Player_GetMask(play) != PLAYER_MASK_ROMANI) { return D_80BE1998; } @@ -338,7 +500,7 @@ s32* func_80BE0E04(EnTab* this, PlayState* play) { return D_80BE19A0; case 1: - this->unk_328 = func_80BE0D60; + this->msgScriptCallback = func_80BE0D60; if (Player_GetMask(play) == PLAYER_MASK_ROMANI) { return D_80BE1940; } @@ -479,12 +641,13 @@ void func_80BE1348(EnTab* this, PlayState* play) { Vec3f sp40; Vec3f sp34; - if (func_8010BF58(&this->actor, play, func_80BE0E04(this, play), this->unk_328, &this->unk_1DC)) { + if (MsgEvent_RunScript(&this->actor, play, EnTab_GetMsgScript(this, play), this->msgScriptCallback, + &this->msgScriptPos)) { SubS_SetOfferMode(&this->unk_2FC, SUBS_OFFER_MODE_ONSCREEN, SUBS_OFFER_MODE_MASK); this->unk_2FC &= ~8; this->unk_2FC |= 0x40; this->unk_324 = 20; - this->unk_1DC = 0; + this->msgScriptPos = 0; this->actionFunc = func_80BE127C; } else if (this->unk_1E0 != 0) { Math_Vec3f_Copy(&sp40, &this->unk_1E0->world.pos); @@ -505,7 +668,7 @@ void EnTab_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->actor, 0.01f); this->unk_1D8 = 0; - this->unk_328 = NULL; + this->msgScriptCallback = NULL; this->unk_2FC = 0; this->unk_2FC |= 0x40; this->actor.gravity = -1.0f; diff --git a/src/overlays/actors/ovl_En_Tab/z_en_tab.h b/src/overlays/actors/ovl_En_Tab/z_en_tab.h index 6bb0503a77..c19ffa0fed 100644 --- a/src/overlays/actors/ovl_En_Tab/z_en_tab.h +++ b/src/overlays/actors/ovl_En_Tab/z_en_tab.h @@ -7,7 +7,6 @@ struct EnTab; typedef void (*EnTabActionFunc)(struct EnTab*, PlayState*); -typedef s32 (*EnTabUnkFunc)(struct EnTab*, PlayState*); typedef struct EnTab { /* 0x000 */ Actor actor; @@ -15,7 +14,7 @@ typedef struct EnTab { /* 0x188 */ EnTabActionFunc actionFunc; /* 0x18C */ ColliderCylinder collider; /* 0x1D8 */ u8 unk_1D8; - /* 0x1DC */ s32 unk_1DC; + /* 0x1DC */ s32 msgScriptPos; /* 0x1E0 */ Actor* unk_1E0; /* 0x1E4 */ EnGm* unk_1E4; /* 0x1E8 */ Vec3f unk_1E8[2]; @@ -38,7 +37,7 @@ typedef struct EnTab { /* 0x320 */ s16 unk_320; /* 0x322 */ s16 unk_322; /* 0x324 */ s16 unk_324; - /* 0x328 */ EnTabUnkFunc unk_328; + /* 0x328 */ MsgScriptCallback msgScriptCallback; /* 0x32C */ s32 unk_32C; /* 0x330 */ UNK_TYPE1 unk330[4]; /* 0x334 */ s32 prevTalkState; diff --git a/src/overlays/actors/ovl_En_Test3/z_en_test3.c b/src/overlays/actors/ovl_En_Test3/z_en_test3.c index af9840373f..cf396f45f4 100644 --- a/src/overlays/actors/ovl_En_Test3/z_en_test3.c +++ b/src/overlays/actors/ovl_En_Test3/z_en_test3.c @@ -629,7 +629,7 @@ s32 func_80A3F9A4(EnTest3* this, PlayState* play) { } s32 func_80A3F9E4(EnTest3* this, PlayState* play, struct_80A41828* arg2, ScheduleOutput* scheduleOutput) { - scheduleOutput->time0 = (u16)SCHEDULE_TIME_NOW; + scheduleOutput->time0 = (u16)SCRIPT_TIME_NOW; scheduleOutput->time1 = (u16)(scheduleOutput->time0 + 70); func_80A40098(this, play, arg2, scheduleOutput); if (this->player.actor.xzDistToPlayer < 300.0f) { @@ -657,7 +657,7 @@ s32 func_80A3FA58(EnTest3* this, PlayState* play) { if (cond || this->unk_D8A <= 0) { func_80A3F114(this, play); sp40.unk_1_0 = 5; - scheduleOutput.time0 = (u16)SCHEDULE_TIME_NOW; + scheduleOutput.time0 = (u16)SCRIPT_TIME_NOW; scheduleOutput.time1 = (u16)(scheduleOutput.time0 + (cond ? 80 : 140)); func_80A40098(this, play, &sp40, &scheduleOutput); @@ -733,7 +733,7 @@ s32 func_80A3FE20(EnTest3* this, PlayState* play) { if (D_80A41D64 == 0) { if (func_80A3E9DC(this, play)) { sp2C.unk_1_0 = 2; - scheduleOutput.time0 = (u16)SCHEDULE_TIME_NOW; + scheduleOutput.time0 = (u16)SCRIPT_TIME_NOW; scheduleOutput.time1 = (u16)(scheduleOutput.time0 + 1000); func_80A40098(this, play, &sp2C, &scheduleOutput); D_80A41D64 = 1; @@ -792,7 +792,7 @@ s32 func_80A3FFD0(EnTest3* this, PlayState* play2) { } s32 func_80A40098(EnTest3* this, PlayState* play, struct_80A41828* arg2, ScheduleOutput* scheduleOutput) { - u16 now = SCHEDULE_TIME_NOW; + u16 now = SCRIPT_TIME_NOW; u16 startTime; u16 numWaypoints; diff --git a/src/overlays/actors/ovl_En_Tk/z_en_tk.c b/src/overlays/actors/ovl_En_Tk/z_en_tk.c index 7a74754774..7b10a1aa40 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -498,7 +498,7 @@ s32 func_80AED354(EnTk* this, PlayState* play, ScheduleOutput* scheduleOutput) { } s32 func_80AED38C(EnTk* this, PlayState* play, ScheduleOutput* scheduleOutput) { - u16 sp1E = SCHEDULE_TIME_NOW; + u16 sp1E = SCRIPT_TIME_NOW; u8 pathIndex = ENTK_GET_PATH_INDEX(&this->actor); u16 phi_a1; s32 index = scheduleOutput->result - 1; diff --git a/src/overlays/actors/ovl_En_Tru/z_en_tru.c b/src/overlays/actors/ovl_En_Tru/z_en_tru.c index 9c8b3d8389..89ba305efc 100644 --- a/src/overlays/actors/ovl_En_Tru/z_en_tru.c +++ b/src/overlays/actors/ovl_En_Tru/z_en_tru.c @@ -44,36 +44,99 @@ typedef enum { /* 0x10 */ KOUME_ANIM_MAX } KoumeAnimation; -static UNK_TYPE D_80A88910[] = { - 0x0E08520C, - 0x16100000, +static MsgScript D_80A88910[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0852), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x01 */ MSCRIPT_CMD_UNSET_AUTOTALK(), + /* 0x0005 0x01 */ MSCRIPT_CMD_DONE(), }; -static UNK_TYPE D_80A88918[] = { - 0x0900000E, - 0x08630C12, - 0x16100000, +static MsgScript D_80A88918[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0003 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0863), + /* 0x0006 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0007 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0008 0x01 */ MSCRIPT_CMD_UNSET_AUTOTALK(), + /* 0x0009 0x01 */ MSCRIPT_CMD_DONE(), }; -static UNK_TYPE D_80A88924[] = { - 0x0E08660C, - 0x10000000, +static MsgScript D_80A88924[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0866), + /* 0x0003 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0004 0x01 */ MSCRIPT_CMD_DONE(), }; -static UNK_TYPE D_80A8892C[] = { - 0x09000004, 0x00050E08, 0x650C1000, 0x1010000B, 0x0E08530C, 0x0F08540C, 0x1900040E, 0x08560C11, - 0x10100E00, 0xFF2B0000, 0x001E0027, 0x2C08640C, 0x2F00000C, 0x15090000, 0x0E08570C, 0x15090000, - 0x0E08580C, 0x15090000, 0x12102C08, 0x550C2F00, 0x000C100E, 0x08550C10, +static MsgScript D_80A8892C[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0003 0x03 */ MSCRIPT_CMD_CHECK_HUMAN(0x000B - 0x0006), + /* 0x0006 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0865), + /* 0x0009 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000A 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x000B 0x05 */ MSCRIPT_CMD_CHECK_WEEK_EVENT_REG(WEEKEVENTREG_TALKED_KOUME_INJURED, 0x001B - 0x0010), + /* 0x0010 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0853), + /* 0x0013 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0014 0x03 */ MSCRIPT_CMD_CONTINUE_TEXT(0x0854), + /* 0x0017 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0018 0x03 */ MSCRIPT_CMD_JUMP(0x001F - 0x001B), + /* 0x001B 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0856), + /* 0x001E 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001F 0x03 */ MSCRIPT_CMD_SET_WEEK_EVENT_REG(WEEKEVENTREG_TALKED_KOUME_INJURED), + /* 0x0022 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x00FF), + /* 0x0025 0x07 */ MSCRIPT_CMD_CHECK_CALLBACK_MULTI(0x0, 0x004A - 0x002C, 0x0053 - 0x002C), + /* 0x002C 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x0864), + /* 0x002F 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0030 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x0033 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0034 0x01 */ MSCRIPT_CMD_PAUSE(), + /* 0x0035 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0038 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0857), + /* 0x003B 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x003C 0x01 */ MSCRIPT_CMD_PAUSE(), + /* 0x003D 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0040 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0858), + /* 0x0043 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0044 0x01 */ MSCRIPT_CMD_PAUSE(), + /* 0x0045 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0048 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x0049 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x004A 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0x0855), + /* 0x004D 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x004E 0x03 */ MSCRIPT_CMD_JUMP_3(0x0), + /* 0x0051 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0052 0x01 */ MSCRIPT_CMD_DONE(), + + /* 0x0053 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0855), + /* 0x0056 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0057 0x01 */ MSCRIPT_CMD_DONE(), }; -static UNK_TYPE D_80A88984[] = { - 0x2CFFFF09, 0x00000E08, 0x640C1509, 0x00000E08, 0x570C1509, 0x00000E08, 0x580C1509, 0x00001210, +static MsgScript D_80A88984[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0xFFFF), + /* 0x0003 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0006 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0864), + /* 0x0009 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000A 0x01 */ MSCRIPT_CMD_PAUSE(), + /* 0x000B 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x000E 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0857), + /* 0x0011 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x0012 0x01 */ MSCRIPT_CMD_PAUSE(), + /* 0x0013 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0016 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0858), + /* 0x0019 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x001A 0x01 */ MSCRIPT_CMD_PAUSE(), + /* 0x001B 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x001E 0x01 */ MSCRIPT_CMD_CLOSE_TEXT(), + /* 0x001F 0x01 */ MSCRIPT_CMD_DONE(), }; -static UNK_TYPE D_80A889A4[] = { - 0x2CFFFF09, - 0x00000E08, - 0x550C1000, +static MsgScript D_80A889A4[] = { + /* 0x0000 0x03 */ MSCRIPT_CMD_PLAYER_TALK(0xFFFF), + /* 0x0003 0x03 */ MSCRIPT_CMD_CHECK_CALLBACK(0x0), + /* 0x0006 0x03 */ MSCRIPT_CMD_BEGIN_TEXT(0x0855), + /* 0x0009 0x01 */ MSCRIPT_CMD_AWAIT_TEXT(), + /* 0x000A 0x01 */ MSCRIPT_CMD_DONE(), }; ActorInit En_Tru_InitVars = { @@ -652,7 +715,7 @@ s32 func_80A86DB8(EnTru* this) { return false; } -UNK_TYPE* func_80A871E0(EnTru* this, PlayState* play) { +MsgScript* EnTru_GetMsgScript(EnTru* this, PlayState* play) { if (this->unk_34E & 0x2000) { if (this->unk_38C == 35) { this->unk_390 = 1; @@ -700,10 +763,10 @@ s32 func_80A872AC(EnTru* this, PlayState* play) { this->unk_34E |= 0x4000; } - this->unk_378 = func_80A875AC; + this->msgScriptCallback = func_80A875AC; this->unk_390 = 0; this->unk_364 = 0; - this->unk_354 = func_80A871E0(this, play); + this->msgScript = EnTru_GetMsgScript(this, play); SubS_SetOfferMode(&this->unk_34E, SUBS_OFFER_MODE_NONE, SUBS_OFFER_MODE_MASK); this->actionFunc = func_80A881E0; ret = true; @@ -813,9 +876,9 @@ s32 func_80A875AC(Actor* thisx, PlayState* play) { if (ret == true) { if (this->unk_390 != 0) { this->unk_34E |= 8; - this->unk_378 = func_80A87880; + this->msgScriptCallback = func_80A87880; } else { - this->unk_378 = func_80A8777C; + this->msgScriptCallback = func_80A8777C; } this->unk_364 = 0; } @@ -845,7 +908,7 @@ s32 func_80A8777C(Actor* thisx, PlayState* play) { } else { this->unk_390 = 2; } - this->unk_378 = func_80A87880; + this->msgScriptCallback = func_80A87880; this->unk_364 = 0; ret = 1; } else if (itemAction <= PLAYER_IA_MINUS1) { @@ -926,7 +989,7 @@ s32 func_80A87880(Actor* thisx, PlayState* play) { } if (ret == true) { - this->unk_378 = func_80A87B48; + this->msgScriptCallback = func_80A87B48; this->unk_364 = 0; } @@ -985,7 +1048,7 @@ s32 func_80A87B48(Actor* thisx, PlayState* play) { } if (ret == true) { - this->unk_378 = func_80A87DC0; + this->msgScriptCallback = func_80A87DC0; this->unk_364 = 0; } @@ -1048,7 +1111,7 @@ s32 func_80A87DC0(Actor* thisx, PlayState* play) { if (ret == true) { this->actor.flags &= ~ACTOR_FLAG_TARGETABLE; this->actor.draw = NULL; - this->unk_378 = NULL; + this->msgScriptCallback = NULL; this->unk_34E = 0; this->unk_364 = 0; } @@ -1096,7 +1159,7 @@ void func_80A87FD0(EnTru* this, PlayState* play) { void func_80A881E0(EnTru* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (func_8010BF58(&this->actor, play, this->unk_354, this->unk_378, &this->unk_1E8)) { + if (MsgEvent_RunScript(&this->actor, play, this->msgScript, this->msgScriptCallback, &this->msgScriptPos)) { if (player->transformation != PLAYER_FORM_HUMAN) { this->unk_34E |= 0x80; } @@ -1119,7 +1182,7 @@ void func_80A881E0(EnTru* this, PlayState* play) { this->unk_34E |= 0x10; this->actor.shape.rot.y = this->actor.world.rot.y; this->actor.flags &= ~ACTOR_FLAG_TALK; - this->unk_1E8 = 0; + this->msgScriptPos = 0; this->actionFunc = func_80A87FD0; } } diff --git a/src/overlays/actors/ovl_En_Tru/z_en_tru.h b/src/overlays/actors/ovl_En_Tru/z_en_tru.h index e7c06e1278..b420624ce6 100644 --- a/src/overlays/actors/ovl_En_Tru/z_en_tru.h +++ b/src/overlays/actors/ovl_En_Tru/z_en_tru.h @@ -7,7 +7,6 @@ struct EnTru; typedef void (*EnTruActionFunc)(struct EnTru*, PlayState*); -typedef s32 (*EnTruUnkFunc)(Actor*, PlayState*); #define ENTRU_GET_PATH_INDEX(thisx) ((thisx)->params & 0xFF) @@ -30,7 +29,7 @@ typedef struct EnTru { /* 0x188 */ EnTruActionFunc actionFunc; /* 0x18C */ ColliderSphere collider; /* 0x1E4 */ Path* path; - /* 0x1E8 */ s32 unk_1E8; + /* 0x1E8 */ s32 msgScriptPos; /* 0x1EC */ Vec3f unk_1EC; /* 0x1F8 */ Vec3f unk_1F8; /* 0x204 */ Vec3s unk_204; @@ -38,7 +37,7 @@ typedef struct EnTru { /* 0x2AC */ Vec3s morphTable[KOUME_LIMB_MAX]; /* 0x34E */ u16 unk_34E; /* 0x350 */ UNK_TYPE1 unk350[0x4]; - /* 0x354 */ s32* unk_354; + /* 0x354 */ MsgScript* msgScript; /* 0x358 */ f32 playSpeed; /* 0x35C */ f32 unk_35C; /* 0x360 */ s16 unk_360; @@ -52,7 +51,7 @@ typedef struct EnTru { /* 0x370 */ s16 unk_370; /* 0x372 */ s16 unk_372; /* 0x374 */ s16 csId; - /* 0x378 */ EnTruUnkFunc unk_378; + /* 0x378 */ MsgScriptCallback msgScriptCallback; /* 0x37C */ s32 animIndex; /* 0x380 */ UNK_TYPE1 unk380[0x4]; /* 0x384 */ s32 unk_384; diff --git a/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c b/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c index 2c1f843fb3..396fa68445 100644 --- a/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c +++ b/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c @@ -3,7 +3,7 @@ * Overlay: ovl_Obj_Flowerpot * Description: Breakable Pot With Grass */ - +#include "prevent_bss_reordering.h" #include "z_obj_flowerpot.h" #include "objects/object_flowerpot/object_flowerpot.h" diff --git a/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.c b/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.c index 5f15c41cf1..3bb3be7f7b 100644 --- a/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.c +++ b/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.c @@ -4,6 +4,7 @@ * Description: Switch-Activated Geyser */ +#include "prevent_bss_reordering.h" #include "z_obj_hunsui.h" #include "objects/object_hunsui/object_hunsui.h" diff --git a/src/overlays/actors/ovl_Obj_Takaraya_Wall/z_obj_takaraya_wall.c b/src/overlays/actors/ovl_Obj_Takaraya_Wall/z_obj_takaraya_wall.c index 4e593f30e8..3218c3050d 100644 --- a/src/overlays/actors/ovl_Obj_Takaraya_Wall/z_obj_takaraya_wall.c +++ b/src/overlays/actors/ovl_Obj_Takaraya_Wall/z_obj_takaraya_wall.c @@ -23,7 +23,7 @@ * Front * */ -#include "prevent_bss_reordering.h" + #include "z_obj_takaraya_wall.h" #include "objects/object_takaraya_objects/object_takaraya_objects.h" diff --git a/src/overlays/actors/ovl_Obj_Um/z_obj_um.c b/src/overlays/actors/ovl_Obj_Um/z_obj_um.c index 4f22964b94..2f636bb53a 100644 --- a/src/overlays/actors/ovl_Obj_Um/z_obj_um.c +++ b/src/overlays/actors/ovl_Obj_Um/z_obj_um.c @@ -298,14 +298,12 @@ s32 func_80B781DC(ObjUm* this, EnHorse* bandit1, EnHorse* bandit2, PlayState* pl s32 phi_s2 = 0; f32 phi_f20 = 0.0f; s32 i; - s32 mask; for (i = 0; i < ARRAY_COUNT(D_80B7C164); i++) { if (bandit1->unk_550 == D_80B7C164[i].unk_00) { if (bandit2->unk_550 != D_80B7C164[i].unk_04) { if (D_80B7C164[i].unk_00 != 3) { - if ((D_80B7C164[i].unk_04 != 3) || - ((mask = Player_GetMask(play)), PLAYER_MASK_CIRCUS_LEADER != mask)) { + if ((D_80B7C164[i].unk_04 != 3) || (Player_GetMask(play) != PLAYER_MASK_CIRCUS_LEADER)) { phi_s3 = D_80B7C164[i].unk_04; phi_s4 = D_80B7C164[i].unk_08; phi_f20 = D_80B7C164[i].unk_0C; diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index b1d04291be..8f4728b24f 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -4,7 +4,6 @@ * Description: Player */ -#include "prevent_bss_reordering.h" #include "global.h" #include "z64horse.h" #include "z64lifemeter.h" diff --git a/src/overlays/gamestates/ovl_file_choose/z_file_nameset_NES.c b/src/overlays/gamestates/ovl_file_choose/z_file_nameset_NES.c index 8edfe04ae9..ed4af43e82 100644 --- a/src/overlays/gamestates/ovl_file_choose/z_file_nameset_NES.c +++ b/src/overlays/gamestates/ovl_file_choose/z_file_nameset_NES.c @@ -4,7 +4,6 @@ * Description: Entering name on a new file, selecting options from the options menu */ -#include "prevent_bss_reordering.h" #include "z_file_select.h" #include "z64rumble.h" #include "misc/title_static/title_static.h" diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c index f29d2fb14f..c595ad73ac 100644 --- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c +++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c @@ -4,7 +4,6 @@ * Description: Pause Menu */ -#include "prevent_bss_reordering.h" #include "z_kaleido_scope.h" #include "sys_cmpdma.h" diff --git a/tools/buildtools/schc.py b/tools/buildtools/schc.py index 87ea17e4a1..e99fc5da2c 100755 --- a/tools/buildtools/schc.py +++ b/tools/buildtools/schc.py @@ -147,8 +147,8 @@ class TokenProperties: tokenPropertiesDict: dict[TokenType, TokenProperties] = { # Schedule commands - TokenType.IF_WEEKEVENTREG_S: TokenProperties(macro="SCHEDULE_CMD_CHECK_FLAG_S", cmdLength=0x04, isConditionalBranch=True, hasArguments=True, needsToInvert=True, isShort=True, shortVersion=TokenType.IF_WEEKEVENTREG_S, longVersion=TokenType.IF_WEEKEVENTREG_L), - TokenType.IF_WEEKEVENTREG_L: TokenProperties(macro="SCHEDULE_CMD_CHECK_FLAG_L", cmdLength=0x05, isConditionalBranch=True, hasArguments=True, needsToInvert=True, shortVersion=TokenType.IF_WEEKEVENTREG_S, longVersion=TokenType.IF_WEEKEVENTREG_L), + TokenType.IF_WEEKEVENTREG_S: TokenProperties(macro="SCHEDULE_CMD_CHECK_WEEK_EVENT_REG_S", cmdLength=0x04, isConditionalBranch=True, hasArguments=True, needsToInvert=True, isShort=True, shortVersion=TokenType.IF_WEEKEVENTREG_S, longVersion=TokenType.IF_WEEKEVENTREG_L), + TokenType.IF_WEEKEVENTREG_L: TokenProperties(macro="SCHEDULE_CMD_CHECK_WEEK_EVENT_REG_L", cmdLength=0x05, isConditionalBranch=True, hasArguments=True, needsToInvert=True, shortVersion=TokenType.IF_WEEKEVENTREG_S, longVersion=TokenType.IF_WEEKEVENTREG_L), TokenType.IF_TIMERANGE_S: TokenProperties(macro="SCHEDULE_CMD_CHECK_TIME_RANGE_S", cmdLength=0x06, isConditionalBranch=True, hasArguments=True, needsToInvert=True, isShort=True, shortVersion=TokenType.IF_TIMERANGE_S, longVersion=TokenType.IF_TIMERANGE_L), TokenType.IF_TIMERANGE_L: TokenProperties(macro="SCHEDULE_CMD_CHECK_TIME_RANGE_L", cmdLength=0x07, isConditionalBranch=True, hasArguments=True, needsToInvert=True, shortVersion=TokenType.IF_TIMERANGE_S, longVersion=TokenType.IF_TIMERANGE_L), TokenType.RETURN_S: TokenProperties(macro="SCHEDULE_CMD_RET_VAL_S", cmdLength=0x02, hasArguments=True, isShort=True), diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index 0f1be1fdee..6e63662fad 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -2009,58 +2009,58 @@ 0x8010A430:("Map_Init",), 0x8010A54C:("Minimap_Draw",), 0x8010A580:("Map_Update",), - 0x8010A760:("func_8010A760",), - 0x8010A7CC:("func_8010A7CC",), - 0x8010A814:("func_8010A814",), - 0x8010A85C:("func_8010A85C",), - 0x8010A8A4:("func_8010A8A4",), - 0x8010A8EC:("func_8010A8EC",), - 0x8010A990:("func_8010A990",), - 0x8010AA54:("func_8010AA54",), - 0x8010AB30:("func_8010AB30",), - 0x8010AB94:("func_8010AB94",), - 0x8010AC00:("func_8010AC00",), - 0x8010AD24:("func_8010AD24",), - 0x8010ADD4:("func_8010ADD4",), - 0x8010AE48:("func_8010AE48",), - 0x8010AECC:("func_8010AECC",), - 0x8010AF20:("func_8010AF20",), - 0x8010AF6C:("func_8010AF6C",), - 0x8010AF94:("func_8010AF94",), - 0x8010AFE0:("func_8010AFE0",), - 0x8010B010:("func_8010B010",), - 0x8010B06C:("func_8010B06C",), - 0x8010B0B4:("func_8010B0B4",), - 0x8010B0DC:("func_8010B0DC",), - 0x8010B108:("func_8010B108",), - 0x8010B140:("func_8010B140",), - 0x8010B180:("func_8010B180",), - 0x8010B1BC:("func_8010B1BC",), - 0x8010B22C:("func_8010B22C",), - 0x8010B284:("func_8010B284",), - 0x8010B2C0:("func_8010B2C0",), - 0x8010B300:("func_8010B300",), - 0x8010B434:("func_8010B434",), - 0x8010B4A4:("func_8010B4A4",), - 0x8010B520:("func_8010B520",), - 0x8010B664:("func_8010B664",), - 0x8010B7A8:("func_8010B7A8",), - 0x8010B828:("func_8010B828",), - 0x8010B878:("func_8010B878",), - 0x8010B8E4:("func_8010B8E4",), - 0x8010BB0C:("func_8010BB0C",), - 0x8010BB6C:("func_8010BB6C",), - 0x8010BBCC:("func_8010BBCC",), - 0x8010BC28:("func_8010BC28",), - 0x8010BC7C:("func_8010BC7C",), - 0x8010BD48:("func_8010BD48",), - 0x8010BD90:("func_8010BD90",), - 0x8010BDDC:("func_8010BDDC",), - 0x8010BE78:("func_8010BE78",), - 0x8010BEBC:("func_8010BEBC",), - 0x8010BEF0:("func_8010BEF0",), - 0x8010BF24:("func_8010BF24",), - 0x8010BF58:("func_8010BF58",), + 0x8010A760:("MsgEvent_CheckWeekEventReg",), + 0x8010A7CC:("MsgEvent_CheckGoron",), + 0x8010A814:("MsgEvent_CheckZora",), + 0x8010A85C:("MsgEvent_CheckDeku",), + 0x8010A8A4:("MsgEvent_CheckHuman",), + 0x8010A8EC:("MsgEvent_CheckTextChoice",), + 0x8010A990:("MsgEvent_OfferItem",), + 0x8010AA54:("MsgEvent_Autotalk",), + 0x8010AB30:("MsgEvent_CheckRupees",), + 0x8010AB94:("MsgEvent_CheckCallback",), + 0x8010AC00:("MsgEvent_CheckDay",), + 0x8010AD24:("MsgEvent_AwaitTextJump",), + 0x8010ADD4:("MsgEvent_AwaitText",), + 0x8010AE48:("MsgEvent_AwaitTextEnd",), + 0x8010AECC:("MsgEvent_BeginText",), + 0x8010AF20:("MsgEvent_ContinueText",), + 0x8010AF6C:("MsgEvent_Done",), + 0x8010AF94:("MsgEvent_SetWeekEventReg",), + 0x8010AFE0:("MsgEvent_CloseText",), + 0x8010B010:("MsgEvent_SetCollectible",), + 0x8010B06C:("MsgEvent_ChangeRupees",), + 0x8010B0B4:("MsgEvent_Pause",), + 0x8010B0DC:("MsgEvent_UnsetAutotalk",), + 0x8010B108:("MsgEvent_FocusToChild",), + 0x8010B140:("MsgEvent_FocusToSelf",), + 0x8010B180:("MsgEvent_Jump",), + 0x8010B1BC:("MsgEvent_CheckQuestItem",), + 0x8010B22C:("MsgEvent_CheckEventInf",), + 0x8010B284:("MsgEvent_SetEventInf",), + 0x8010B2C0:("MsgEvent_UnsetEventInf",), + 0x8010B300:("MsgEvent_CheckItemAction",), + 0x8010B434:("MsgEvent_CheckHasSong",), + 0x8010B4A4:("MsgEvent_CheckWornMask",), + 0x8010B520:("MsgEvent_CheckAfterTime",), + 0x8010B664:("MsgEvent_CheckBeforeTime",), + 0x8010B7A8:("MsgEvent_CheckSwitchFlag",), + 0x8010B828:("MsgEvent_SetSwitchFlag",), + 0x8010B878:("MsgEvent_CheckItem",), + 0x8010B8E4:("MsgEvent_CheckBetweenTime",), + 0x8010BB0C:("MsgEvent_CheckOnDay",), + 0x8010BB6C:("MsgEvent_CheckCallbackContinue",), + 0x8010BBCC:("MsgEvent_CheckHasPowderKeg",), + 0x8010BC28:("MsgEvent_DeleteItem",), + 0x8010BC7C:("MsgEvent_CheckCallbackMulti",), + 0x8010BD48:("MsgEvent_PlayerTalk",), + 0x8010BD90:("MsgEvent_NotebookEvent",), + 0x8010BDDC:("MsgEvent_AwaitTextDone",), + 0x8010BE78:("MsgEvent_Jump3",), + 0x8010BEBC:("MsgEvent_PlayDecide",), + 0x8010BEF0:("MsgEvent_PlayCancel",), + 0x8010BF24:("MsgEvent_PlayError",), + 0x8010BF58:("MsgEvent_RunScript",), 0x8010C0C0:("Nmi_Init",), 0x8010C164:("Nmi_SetPrenmiStart",), 0x8010C19C:("Nmi_GetPrenmiHasStarted",), @@ -2499,8 +2499,8 @@ 0x80132338:("Entrance_GetSceneIdAbsolute",), 0x80132374:("Entrance_GetSpawnNum",), 0x801323A0:("Entrance_GetTransitionFlags",), - 0x801323D0:("Schedule_CheckFlagS",), - 0x80132428:("Schedule_CheckFlagL",), + 0x801323D0:("Schedule_CheckWeekEventRegS",), + 0x80132428:("Schedule_CheckWeekEventRegL",), 0x80132494:("Schedule_CheckTimeRangeS",), 0x801326B8:("Schedule_CheckTimeRangeL",), 0x801328F0:("Schedule_ReturnValueL",), @@ -7123,7 +7123,7 @@ 0x8092C740:("func_8092C740",), 0x8092C86C:("func_8092C86C",), 0x8092C934:("func_8092C934",), - 0x8092C9BC:("func_8092C9BC",), + 0x8092C9BC:("EnDns_GetMsgScript",), 0x8092CA74:("EnDns_GetCueType",), 0x8092CAD0:("func_8092CAD0",), 0x8092CB98:("func_8092CB98",), @@ -7592,7 +7592,7 @@ 0x8094E69C:("func_8094E69C",), 0x8094EA34:("func_8094EA34",), 0x8094EB1C:("func_8094EB1C",), - 0x8094EDBC:("func_8094EDBC",), + 0x8094EDBC:("EnGm_GetMsgScript",), 0x8094EE84:("func_8094EE84",), 0x8094EFC4:("func_8094EFC4",), 0x8094F074:("func_8094F074",), @@ -9736,7 +9736,7 @@ 0x80A14EB0:("EnGo_Thaw",), 0x80A14FC8:("EnGo_HandleSpringArrivalCutscene",), 0x80A153FC:("EnGo_Snowball",), - 0x80A15684:("EnGo_GetMsgEventScript",), + 0x80A15684:("EnGo_GetMsgScript",), 0x80A157C4:("EnGo_Talk",), 0x80A1590C:("EnGo_Init",), 0x80A15960:("EnGo_Destroy",), @@ -10564,7 +10564,7 @@ 0x80A5086C:("func_80A5086C",), 0x80A50950:("func_80A50950",), 0x80A50D40:("func_80A50D40",), - 0x80A50DF8:("func_80A50DF8",), + 0x80A50DF8:("EnDnh_GetMsgScript",), 0x80A50E40:("func_80A50E40",), 0x80A50EC0:("func_80A50EC0",), 0x80A50F38:("func_80A50F38",), @@ -10600,7 +10600,7 @@ 0x80A52A78:("func_80A52A78",), 0x80A52B68:("func_80A52B68",), 0x80A52C6C:("func_80A52C6C",), - 0x80A52CF8:("func_80A52CF8",), + 0x80A52CF8:("EnDnq_GetMsgScript",), 0x80A52D44:("func_80A52D44",), 0x80A52DC8:("func_80A52DC8",), 0x80A52FB8:("func_80A52FB8",), @@ -11233,7 +11233,7 @@ 0x80A86B0C:("func_80A86B0C",), 0x80A86BAC:("func_80A86BAC",), 0x80A86DB8:("func_80A86DB8",), - 0x80A871E0:("func_80A871E0",), + 0x80A871E0:("EnTru_GetMsgScript",), 0x80A872AC:("func_80A872AC",), 0x80A873B8:("func_80A873B8",), 0x80A87400:("func_80A87400",), @@ -12468,7 +12468,7 @@ 0x80AE6488:("func_80AE6488",), 0x80AE65F4:("func_80AE65F4",), 0x80AE6704:("func_80AE6704",), - 0x80AE6880:("func_80AE6880",), + 0x80AE6880:("EnShn_GetMsgScript",), 0x80AE68F0:("func_80AE68F0",), 0x80AE69E8:("func_80AE69E8",), 0x80AE6A64:("func_80AE6A64",), @@ -12740,7 +12740,7 @@ 0x80AF81E8:("func_80AF81E8",), 0x80AF8348:("func_80AF8348",), 0x80AF8478:("func_80AF8478",), - 0x80AF8540:("func_80AF8540",), + 0x80AF8540:("EnPm_GetMsgScript",), 0x80AF86F0:("func_80AF86F0",), 0x80AF87C4:("func_80AF87C4",), 0x80AF8890:("func_80AF8890",), @@ -13376,7 +13376,7 @@ 0x80B2B874:("EnPst_HandleLetterDay1",), 0x80B2B8F4:("EnPst_HandleLetterDay2",), 0x80B2B974:("EnPst_ChooseBehaviour",), - 0x80B2BAA4:("EnPst_GetMsgEventScript",), + 0x80B2BAA4:("EnPst_GetMsgScript",), 0x80B2BBFC:("EnPst_CheckTalk",), 0x80B2BCF8:("EnPst_SetOfferItemModeOnScreen",), 0x80B2BD30:("EnPst_ProcessScheduleOutput",), @@ -14025,7 +14025,7 @@ 0x80B54BC4:("EnAn_MsgEvent_MidnightMeeting",), 0x80B54C5C:("EnAn_MsgEvent_Cooking",), 0x80B54D18:("EnAn_MsgEvent_LaundryPool",), - 0x80B54DF4:("EnAn_GetMsgEventScript",), + 0x80B54DF4:("EnAn_GetMsgScript",), 0x80B55180:("EnAn_CheckTalk",), 0x80B552E4:("EnAn_IsCouplesMaskCsPlaying",), 0x80B553AC:("EnAn_UpdateHeadRot",), @@ -15460,7 +15460,7 @@ 0x80BC0050:("func_80BC0050",), 0x80BC00AC:("func_80BC00AC",), 0x80BC01DC:("func_80BC01DC",), - 0x80BC045C:("func_80BC045C",), + 0x80BC045C:("EnNb_GetMsgScript",), 0x80BC04FC:("func_80BC04FC",), 0x80BC05A8:("func_80BC05A8",), 0x80BC06C4:("func_80BC06C4",), @@ -15498,7 +15498,7 @@ 0x80BC213C:("func_80BC213C",), 0x80BC2150:("func_80BC2150",), 0x80BC21A8:("func_80BC21A8",), - 0x80BC2274:("func_80BC2274",), + 0x80BC2274:("EnJa_GetMsgScript",), 0x80BC22F4:("func_80BC22F4",), 0x80BC2388:("EnJa_Init",), 0x80BC2498:("EnJa_Destroy",), @@ -15745,7 +15745,7 @@ 0x80BD30C0:("func_80BD30C0",), 0x80BD3118:("func_80BD3118",), 0x80BD3198:("func_80BD3198",), - 0x80BD3294:("func_80BD3294",), + 0x80BD3294:("EnAh_GetMsgScript",), 0x80BD3320:("func_80BD3320",), 0x80BD3374:("func_80BD3374",), 0x80BD33FC:("func_80BD33FC",), @@ -16011,7 +16011,7 @@ 0x80BDE7FC:("func_80BDE7FC",), 0x80BDE92C:("func_80BDE92C",), 0x80BDEA14:("func_80BDEA14",), - 0x80BDEABC:("func_80BDEABC",), + 0x80BDEABC:("EnAl_GetMsgScript",), 0x80BDEC2C:("func_80BDEC2C",), 0x80BDED20:("func_80BDED20",), 0x80BDEE5C:("func_80BDEE5C",), @@ -16046,7 +16046,7 @@ 0x80BE0C04:("func_80BE0C04",), 0x80BE0D38:("func_80BE0D38",), 0x80BE0D60:("func_80BE0D60",), - 0x80BE0E04:("func_80BE0E04",), + 0x80BE0E04:("EnTab_GetMsgScript",), 0x80BE0F04:("func_80BE0F04",), 0x80BE0FC4:("func_80BE0FC4",), 0x80BE1060:("func_80BE1060",), @@ -16293,7 +16293,7 @@ 0x80BF16C8:("func_80BF16C8",), 0x80BF1744:("func_80BF1744",), 0x80BF17BC:("func_80BF17BC",), - 0x80BF1920:("func_80BF1920",), + 0x80BF1920:("EnIg_GetMsgScript",), 0x80BF19A0:("func_80BF19A0",), 0x80BF1A60:("func_80BF1A60",), 0x80BF1AE0:("func_80BF1AE0",), @@ -17054,7 +17054,7 @@ 0x80C2247C:("func_80C2247C",), 0x80C224D8:("func_80C224D8",), 0x80C227E8:("func_80C227E8",), - 0x80C22880:("func_80C22880",), + 0x80C22880:("DmTag_GetMsgScript",), 0x80C2291C:("func_80C2291C",), 0x80C229AC:("func_80C229AC",), 0x80C229EC:("DmTag_DoNothing",), diff --git a/tools/overlayhelpers/actor_symbols.py b/tools/overlayhelpers/actor_symbols.py index 67ea7b6516..4c0613679e 100755 --- a/tools/overlayhelpers/actor_symbols.py +++ b/tools/overlayhelpers/actor_symbols.py @@ -710,7 +710,7 @@ def null_or_ptr(w): # (name, vrom_st, vrom_end, vram_st, vram_end) def read_actor_ovl_tbl(): actortbl = [] - with open(repo + "baseroms/n64-us/code","rb") as codefile: + with open(repo + "extracted/n64-us/baserom/code","rb") as codefile: codefile.seek(0x109510) # actor overlay table offset into code entry = as_word_list(codefile.read(0x20)) i = 0 @@ -731,10 +731,10 @@ def resolve_symbol(address): for entry in actor_tbl: if address >= 0x80000000: if entry[3] <= address < entry[4]: - return repo + "baserom" + os.sep + entry[0], address - entry[3] + return repo + "extracted/n64-us/baserom" + os.sep + entry[0], address - entry[3] else: if entry[1] <= address < entry[2]: - return repo + "baserom" + os.sep + entry[0], address - entry[1] + return repo + "extracted/n64-us/baserom" + os.sep + entry[0], address - entry[1] else: raise RuntimeError('Symbol not found in actor overlay table file ranges. Are you sure the file is an actor overlay?') diff --git a/tools/overlayhelpers/mscriptdis.py b/tools/overlayhelpers/mscriptdis.py new file mode 100644 index 0000000000..ff2e1d4bc8 --- /dev/null +++ b/tools/overlayhelpers/mscriptdis.py @@ -0,0 +1,1551 @@ +#!/usr/bin/env python3 +# +# Message Event Script Disassembler +# + +import argparse, math, os, struct +from actor_symbols import resolve_symbol + +cmd_info = [ + ('MSCRIPT_CMD_CHECK_WEEK_EVENT_REG', 0x05, '', '>Hh', (1,)), + ('MSCRIPT_CMD_CHECK_GORON', 0x03, '', '>h', (0,)), + ('MSCRIPT_CMD_CHECK_ZORA', 0x03, '', '>h', (0,)), + ('MSCRIPT_CMD_CHECK_DEKU', 0x03, '', '>h', (0,)), + ('MSCRIPT_CMD_CHECK_HUMAN', 0x03, '', '>h', (0,)), + ('MSCRIPT_CMD_CHECK_TEXT_CHOICE', 0x07, '', '>hhh', (0,1,2)), + ('MSCRIPT_CMD_OFFER_ITEM', 0x05, '', '>Hh', (1,)), + ('MSCRIPT_CMD_AUTOTALK', 0x03, '', '>h', (0,)), + ('MSCRIPT_CMD_CHECK_RUPEES', 0x05, '', '>Hh', (1,)), + ('MSCRIPT_CMD_CHECK_CALLBACK', 0x03, '', '>h', (0,)), + ('MSCRIPT_CMD_CHECK_DAY', 0x0d, '', '>hhhhhh', (0,1,2,3,4,5)), + ('MSCRIPT_CMD_AWAIT_TEXT_JUMP', 0x03, '', '>h', (0,)), + ('MSCRIPT_CMD_AWAIT_TEXT', 0x01, '', '', ()), + ('MSCRIPT_CMD_AWAIT_TEXT_END', 0x01, '', '', ()), + ('MSCRIPT_CMD_BEGIN_TEXT', 0x03, '', '>H', ()), + ('MSCRIPT_CMD_CONTINUE_TEXT', 0x03, '', '>H', ()), + ('MSCRIPT_CMD_DONE', 0x01, '', '', ()), + ('MSCRIPT_CMD_SET_WEEK_EVENT_REG', 0x03, '', '>H', ()), + ('MSCRIPT_CMD_CLOSE_TEXT', 0x01, '', '', ()), + ('MSCRIPT_CMD_SET_COLLECTIBLE', 0x03, '', '>H', ()), + ('MSCRIPT_CMD_CHANGE_RUPEES', 0x03, '', '>H', ()), + ('MSCRIPT_CMD_PAUSE', 0x01, '', '', ()), + ('MSCRIPT_CMD_UNSET_AUTOTALK', 0x01, '', '', ()), + ('MSCRIPT_CMD_FOCUS_TO_CHILD', 0x01, '', '', ()), + ('MSCRIPT_CMD_FOCUS_TO_SELF', 0x01, '', '', ()), + ('MSCRIPT_CMD_JUMP', 0x03, '', '>h', (0,)), + ('MSCRIPT_CMD_CHECK_QUEST_ITEM', 0x05, '', '>Hh', (1,)), + ('MSCRIPT_CMD_CHECK_EVENT_INF', 0x05, '', '>Hh', (1,)), + ('MSCRIPT_CMD_SET_EVENT_INF', 0x03, '', '>H', ()), + ('MSCRIPT_CMD_EVENT_INF', 0x03, '', '>H', ()), + ('MSCRIPT_CMD_CHECK_ITEM_ACTION', 0x09, '', '>Hhhh', (1,2,3)), + ('MSCRIPT_CMD_CHECK_HAS_SONG', 0x05, '', '>Hh', (1,)), + ('MSCRIPT_CMD_CHECK_WORN_MASK', 0x05, '', '>Hh', (1,)), + ('MSCRIPT_CMD_CHECK_AFTER_TIME', 0x05, '', '>BBh', (2,)), + ('MSCRIPT_CMD_CHECK_BEFORE_TIME', 0x05, '', '>BBh', (2,)), + ('MSCRIPT_CMD_CHECK_SWITCH_FLAG', 0x05, '', '>Hh', (1,)), + ('MSCRIPT_CMD_SET_SWITCH_FLAG', 0x03, '', '>H', ()), + ('MSCRIPT_CMD_CHECK_ITEM', 0x05, '', '>Hh', (1,)), + ('MSCRIPT_CMD_BETWEEN_TIME', 0x07, '', '>BBBBh', (4,)), + ('MSCRIPT_CMD_CHECK_IN_DAY', 0x05, '', '>Hh', (1,)), + ('MSCRIPT_CMD_CHECK_CALLBACK_CONTINUE', 0x03, '', '>h', (0,)), + ('MSCRIPT_CMD_CHECK_HAS_POWDER_KEG', 0x03, '', '>h', (0,)), + ('MSCRIPT_CMD_DELETE_ITEM', 0x03, '', '>h', ()), + ('MSCRIPT_CMD_CHECK_CALLBACK_MULTI', 0x07, '', '>hhh', (0,1,2)), + ('MSCRIPT_CMD_PLAYER_TALK', 0x03, '', '>H', ()), + ('MSCRIPT_CMD_NOTEBOOK_EVENT', 0x03, '', '>H', ()), + ('MSCRIPT_CMD_AWAIT_TEXT_DONE', 0x01, '', '', ()), + ('MSCRIPT_CMD_JUMP_3', 0x03, '', '>h', (0,)), + ('MSCRIPT_CMD_PLAY_DECIDE', 0x01, '', '', ()), + ('MSCRIPT_CMD_PLAY_CANCEL', 0x01, '', '', ()), + ('MSCRIPT_CMD_PLAY_ERROR', 0x01, '', '', ()), +] + +week_event_reg = { + ( 0 << 8) | 0x01: "WEEKEVENTREG_00_01", + ( 0 << 8) | 0x02: "WEEKEVENTREG_ENTERED_TERMINA_FIELD", + ( 0 << 8) | 0x04: "WEEKEVENTREG_ENTERED_IKANA_GRAVEYARD", + ( 0 << 8) | 0x08: "WEEKEVENTREG_ENTERED_ROMANI_RANCH", + ( 0 << 8) | 0x10: "WEEKEVENTREG_ENTERED_GORMAN_TRACK", + ( 0 << 8) | 0x20: "WEEKEVENTREG_ENTERED_MOUNTAIN_VILLAGE_WINTER", + ( 0 << 8) | 0x40: "WEEKEVENTREG_ENTERED_GORON_SHRINE", + ( 0 << 8) | 0x80: "WEEKEVENTREG_ENTERED_SNOWHEAD", + ( 1 << 8) | 0x01: "WEEKEVENTREG_ENTERED_SOUTHERN_SWAMP_POISONED", + ( 1 << 8) | 0x02: "WEEKEVENTREG_ENTERED_WOODFALL", + ( 1 << 8) | 0x04: "WEEKEVENTREG_ENTERED_DEKU_PALACE", + ( 1 << 8) | 0x08: "WEEKEVENTREG_ENTERED_GREAT_BAY_COAST", + ( 1 << 8) | 0x10: "WEEKEVENTREG_ENTERED_PIRATES_FORTRESS", + ( 1 << 8) | 0x20: "WEEKEVENTREG_ENTERED_ZORA_HALL", + ( 1 << 8) | 0x40: "WEEKEVENTREG_ENTERED_WATERFALL_RAPIDS", + ( 1 << 8) | 0x80: "WEEKEVENTREG_ENTERED_IKANA_CANYON", + ( 2 << 8) | 0x01: "WEEKEVENTREG_ENTERED_IKANA_CASTLE", + ( 2 << 8) | 0x02: "WEEKEVENTREG_ENTERED_STONE_TOWER", + ( 2 << 8) | 0x04: "WEEKEVENTREG_ENTERED_STONE_TOWER_INVERTED", + ( 2 << 8) | 0x08: "WEEKEVENTREG_ENTERED_EAST_CLOCK_TOWN", + ( 2 << 8) | 0x10: "WEEKEVENTREG_ENTERED_WEST_CLOCK_TOWN", + ( 2 << 8) | 0x20: "WEEKEVENTREG_ENTERED_NORTH_CLOCK_TOWN", + ( 2 << 8) | 0x40: "WEEKEVENTREG_ENTERED_WOODFALL_TEMPLE", + ( 2 << 8) | 0x80: "WEEKEVENTREG_ENTERED_SNOWHEAD_TEMPLE", + ( 3 << 8) | 0x01: "WEEKEVENTREG_ENTERED_PIRATES_FORTRESS_EXTERIOR", + ( 3 << 8) | 0x02: "WEEKEVENTREG_ENTERED_STONE_TOWER_TEMPLE", + ( 3 << 8) | 0x04: "WEEKEVENTREG_ENTERED_STONE_TOWER_TEMPLE_INVERTED", + ( 3 << 8) | 0x08: "WEEKEVENTREG_ENTERED_THE_MOON", + ( 3 << 8) | 0x10: "WEEKEVENTREG_ENTERED_MOON_DEKU_TRIAL", + ( 3 << 8) | 0x20: "WEEKEVENTREG_ENTERED_MOON_GORON_TRIAL", + ( 3 << 8) | 0x40: "WEEKEVENTREG_ENTERED_MOON_ZORA_TRIAL", + ( 3 << 8) | 0x80: "WEEKEVENTREG_03_80", + ( 4 << 8) | 0x01: "WEEKEVENTREG_04_01", + ( 4 << 8) | 0x02: "WEEKEVENTREG_04_02", + ( 4 << 8) | 0x04: "WEEKEVENTREG_04_04", + ( 4 << 8) | 0x08: "WEEKEVENTREG_04_08", + ( 4 << 8) | 0x10: "WEEKEVENTREG_04_10", + ( 4 << 8) | 0x20: "WEEKEVENTREG_04_20", + ( 4 << 8) | 0x40: "WEEKEVENTREG_04_40", + ( 4 << 8) | 0x80: "WEEKEVENTREG_04_80", + ( 5 << 8) | 0x01: "WEEKEVENTREG_05_01", + ( 5 << 8) | 0x02: "WEEKEVENTREG_05_02", + ( 5 << 8) | 0x04: "WEEKEVENTREG_05_04", + ( 5 << 8) | 0x08: "WEEKEVENTREG_05_08", + ( 5 << 8) | 0x10: "WEEKEVENTREG_05_10", + ( 5 << 8) | 0x20: "WEEKEVENTREG_05_20", + ( 5 << 8) | 0x40: "WEEKEVENTREG_05_40", + ( 5 << 8) | 0x80: "WEEKEVENTREG_05_80", + ( 6 << 8) | 0x01: "WEEKEVENTREG_06_01", + ( 6 << 8) | 0x02: "WEEKEVENTREG_06_02", + ( 6 << 8) | 0x04: "WEEKEVENTREG_06_04", + ( 6 << 8) | 0x08: "WEEKEVENTREG_06_08", + ( 6 << 8) | 0x10: "WEEKEVENTREG_06_10", + ( 6 << 8) | 0x20: "WEEKEVENTREG_06_20", + ( 6 << 8) | 0x40: "WEEKEVENTREG_06_40", + ( 6 << 8) | 0x80: "WEEKEVENTREG_06_80", + ( 7 << 8) | 0x01: "WEEKEVENTREG_07_01", + ( 7 << 8) | 0x02: "WEEKEVENTREG_07_02", + ( 7 << 8) | 0x04: "WEEKEVENTREG_07_04", + ( 7 << 8) | 0x08: "WEEKEVENTREG_07_08", + ( 7 << 8) | 0x10: "WEEKEVENTREG_07_10", + ( 7 << 8) | 0x20: "WEEKEVENTREG_07_20", + ( 7 << 8) | 0x40: "WEEKEVENTREG_07_40", + ( 7 << 8) | 0x80: "WEEKEVENTREG_ENTERED_WOODFALL_TEMPLE_PRISON", + ( 8 << 8) | 0x01: "WEEKEVENTREG_08_01", + ( 8 << 8) | 0x02: "WEEKEVENTREG_08_02", + ( 8 << 8) | 0x04: "WEEKEVENTREG_08_04", + ( 8 << 8) | 0x08: "WEEKEVENTREG_08_08", + ( 8 << 8) | 0x10: "WEEKEVENTREG_08_10", + ( 8 << 8) | 0x20: "WEEKEVENTREG_RECEIVED_DOGGY_RACETRACK_HEART_PIECE", + ( 8 << 8) | 0x40: "WEEKEVENTREG_CLOCK_TOWER_OPENED", + ( 8 << 8) | 0x80: "WEEKEVENTREG_08_80", + ( 9 << 8) | 0x01: "WEEKEVENTREG_09_01", + ( 9 << 8) | 0x02: "WEEKEVENTREG_09_02", + ( 9 << 8) | 0x04: "WEEKEVENTREG_09_04", + ( 9 << 8) | 0x08: "WEEKEVENTREG_09_08", + ( 9 << 8) | 0x10: "WEEKEVENTREG_09_10", + ( 9 << 8) | 0x20: "WEEKEVENTREG_09_20", + ( 9 << 8) | 0x40: "WEEKEVENTREG_09_40", + ( 9 << 8) | 0x80: "WEEKEVENTREG_09_80", + (10 << 8) | 0x01: "WEEKEVENTREG_TALKED_TINGLE", + (10 << 8) | 0x02: "WEEKEVENTREG_10_02", + (10 << 8) | 0x04: "WEEKEVENTREG_10_04", + (10 << 8) | 0x08: "WEEKEVENTREG_RECEIVED_BANK_WALLET_UPGRADE", + (10 << 8) | 0x10: "WEEKEVENTREG_10_10", + (10 << 8) | 0x20: "WEEKEVENTREG_10_20", + (10 << 8) | 0x40: "WEEKEVENTREG_10_40", + (10 << 8) | 0x80: "WEEKEVENTREG_10_80", + (11 << 8) | 0x01: "WEEKEVENTREG_11_01", + (11 << 8) | 0x02: "WEEKEVENTREG_11_02", + (11 << 8) | 0x04: "WEEKEVENTREG_11_04", + (11 << 8) | 0x08: "WEEKEVENTREG_11_08", + (11 << 8) | 0x10: "WEEKEVENTREG_11_10", + (11 << 8) | 0x20: "WEEKEVENTREG_11_20", + (11 << 8) | 0x40: "WEEKEVENTREG_11_40", + (11 << 8) | 0x80: "WEEKEVENTREG_11_80", + (12 << 8) | 0x01: "WEEKEVENTREG_12_01", + (12 << 8) | 0x02: "WEEKEVENTREG_12_02", + (12 << 8) | 0x04: "WEEKEVENTREG_12_04", + (12 << 8) | 0x08: "WEEKEVENTREG_SAVED_KOUME", + (12 << 8) | 0x10: "WEEKEVENTREG_RECEIVED_KOTAKE_BOTTLE", + (12 << 8) | 0x20: "WEEKEVENTREG_12_20", + (12 << 8) | 0x40: "WEEKEVENTREG_12_40", + (12 << 8) | 0x80: "WEEKEVENTREG_12_80", + (13 << 8) | 0x01: "WEEKEVENTREG_13_01", + (13 << 8) | 0x02: "WEEKEVENTREG_13_02", + (13 << 8) | 0x04: "WEEKEVENTREG_13_04", + (13 << 8) | 0x08: "WEEKEVENTREG_13_08", + (13 << 8) | 0x10: "WEEKEVENTREG_13_10", + (13 << 8) | 0x20: "WEEKEVENTREG_OCEANSIDE_SPIDER_HOUSE_BUYER_MOVED_IN", + (13 << 8) | 0x40: "WEEKEVENTREG_RECEIVED_OCEANSIDE_WALLET_UPGRADE", + (13 << 8) | 0x80: "WEEKEVENTREG_OCEANSIDE_SPIDER_HOUSE_COLLECTED_REWARD", + (14 << 8) | 0x01: "WEEKEVENTREG_14_01", + (14 << 8) | 0x02: "WEEKEVENTREG_14_02", + (14 << 8) | 0x04: "WEEKEVENTREG_14_04", + (14 << 8) | 0x08: "WEEKEVENTREG_DRANK_CHATEAU_ROMANI", + (14 << 8) | 0x10: "WEEKEVENTREG_WON_DEKU_PLAYGROUND_DAY_1", + (14 << 8) | 0x20: "WEEKEVENTREG_WON_DEKU_PLAYGROUND_DAY_2", + (14 << 8) | 0x40: "WEEKEVENTREG_WON_DEKU_PLAYGROUND_DAY_3", + (14 << 8) | 0x80: "WEEKEVENTREG_RECEIVED_DEKU_PLAYGROUND_HEART_PIECE", + (15 << 8) | 0x01: "WEEKEVENTREG_15_01", + (15 << 8) | 0x02: "WEEKEVENTREG_15_02", + (15 << 8) | 0x04: "WEEKEVENTREG_15_04", + (15 << 8) | 0x08: "WEEKEVENTREG_15_08", + (15 << 8) | 0x10: "WEEKEVENTREG_15_10", + (15 << 8) | 0x20: "WEEKEVENTREG_15_20", + (15 << 8) | 0x40: "WEEKEVENTREG_15_40", + (15 << 8) | 0x80: "WEEKEVENTREG_15_80", + (16 << 8) | 0x01: "WEEKEVENTREG_16_01", + (16 << 8) | 0x02: "WEEKEVENTREG_16_02", + (16 << 8) | 0x04: "WEEKEVENTREG_16_04", + (16 << 8) | 0x08: "WEEKEVENTREG_16_08", + (16 << 8) | 0x10: "WEEKEVENTREG_TALKED_KOUME_INJURED", + (16 << 8) | 0x20: "WEEKEVENTREG_16_20", + (16 << 8) | 0x40: "WEEKEVENTREG_16_40", + (16 << 8) | 0x80: "WEEKEVENTREG_16_80", + (17 << 8) | 0x01: "WEEKEVENTREG_TALKED_KOUME_KIOSK_EMPTY", + (17 << 8) | 0x02: "WEEKEVENTREG_17_02", + (17 << 8) | 0x04: "WEEKEVENTREG_17_04", + (17 << 8) | 0x08: "WEEKEVENTREG_17_08", + (17 << 8) | 0x10: "WEEKEVENTREG_17_10", + (17 << 8) | 0x20: "WEEKEVENTREG_17_20", + (17 << 8) | 0x40: "WEEKEVENTREG_17_40", + (17 << 8) | 0x80: "WEEKEVENTREG_RECEIVED_LAND_TITLE_DEED", + (18 << 8) | 0x01: "WEEKEVENTREG_18_01", + (18 << 8) | 0x02: "WEEKEVENTREG_18_02", + (18 << 8) | 0x04: "WEEKEVENTREG_TALKED_CURIOSITY_SHOP_MAN_AS_GORON", + (18 << 8) | 0x08: "WEEKEVENTREG_TALKED_CURIOSITY_SHOP_MAN_AS_ZORA", + (18 << 8) | 0x10: "WEEKEVENTREG_TALKED_CURIOSITY_SHOP_MAN_AS_DEKU", + (18 << 8) | 0x20: "WEEKEVENTREG_18_20", + (18 << 8) | 0x40: "WEEKEVENTREG_18_40", + (18 << 8) | 0x80: "WEEKEVENTREG_HAS_POWDERKEG_PRIVILEGES", + (19 << 8) | 0x01: "WEEKEVENTREG_19_01", + (19 << 8) | 0x02: "WEEKEVENTREG_19_02", + (19 << 8) | 0x04: "WEEKEVENTREG_19_04", + (19 << 8) | 0x08: "WEEKEVENTREG_19_08", + (19 << 8) | 0x10: "WEEKEVENTREG_19_10", + (19 << 8) | 0x20: "WEEKEVENTREG_19_20", + (19 << 8) | 0x40: "WEEKEVENTREG_19_40", + (19 << 8) | 0x80: "WEEKEVENTREG_19_80", + (20 << 8) | 0x01: "WEEKEVENTREG_20_01", + (20 << 8) | 0x02: "WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE", + (20 << 8) | 0x04: "WEEKEVENTREG_20_04", + (20 << 8) | 0x08: "WEEKEVENTREG_20_08", + (20 << 8) | 0x10: "WEEKEVENTREG_20_10", + (20 << 8) | 0x20: "WEEKEVENTREG_20_20", + (20 << 8) | 0x40: "WEEKEVENTREG_20_40", + (20 << 8) | 0x80: "WEEKEVENTREG_20_80", + (21 << 8) | 0x01: "WEEKEVENTREG_21_01", + (21 << 8) | 0x02: "WEEKEVENTREG_21_02", + (21 << 8) | 0x04: "WEEKEVENTREG_TALKED_GORON_GRAVEMAKER_AS_GORON", + (21 << 8) | 0x08: "WEEKEVENTREG_TALKED_THAWED_GRAVEYARD_GORON", + (21 << 8) | 0x10: "WEEKEVENTREG_21_10", + (21 << 8) | 0x20: "WEEKEVENTREG_PROMISED_TO_HELP_WITH_ALIENS", + (21 << 8) | 0x40: "WEEKEVENTREG_21_40", + (21 << 8) | 0x80: "WEEKEVENTREG_21_80", + (22 << 8) | 0x01: "WEEKEVENTREG_DEFENDED_AGAINST_ALIENS", + (22 << 8) | 0x02: "WEEKEVENTREG_RECEIVED_ALIENS_BOTTLE", + (22 << 8) | 0x04: "WEEKEVENTREG_CALMED_GORON_ELDERS_SON", + (22 << 8) | 0x08: "WEEKEVENTREG_22_08", + (22 << 8) | 0x10: "WEEKEVENTREG_22_10", + (22 << 8) | 0x20: "WEEKEVENTREG_22_20", + (22 << 8) | 0x40: "WEEKEVENTREG_22_40", + (22 << 8) | 0x80: "WEEKEVENTREG_RECEIVED_HONEY_AND_DARLING_HEART_PIECE", + (23 << 8) | 0x01: "WEEKEVENTREG_23_01", + (23 << 8) | 0x02: "WEEKEVENTREG_RECEIVED_GREAT_SPIN_ATTACK", + (23 << 8) | 0x04: "WEEKEVENTREG_23_04", + (23 << 8) | 0x08: "WEEKEVENTREG_23_08", + (23 << 8) | 0x10: "WEEKEVENTREG_23_10", + (23 << 8) | 0x20: "WEEKEVENTREG_23_20", + (23 << 8) | 0x40: "WEEKEVENTREG_23_40", + (23 << 8) | 0x80: "WEEKEVENTREG_RECEIVED_BEAVER_RACE_BOTTLE", + (24 << 8) | 0x01: "WEEKEVENTREG_24_01", + (24 << 8) | 0x02: "WEEKEVENTREG_24_02", + (24 << 8) | 0x04: "WEEKEVENTREG_24_04", + (24 << 8) | 0x08: "WEEKEVENTREG_24_08", + (24 << 8) | 0x10: "WEEKEVENTREG_24_10", + (24 << 8) | 0x20: "WEEKEVENTREG_24_20", + (24 << 8) | 0x40: "WEEKEVENTREG_24_40", + (24 << 8) | 0x80: "WEEKEVENTREG_24_80", + (25 << 8) | 0x01: "WEEKEVENTREG_RECEIVED_BEAVER_BROS_HEART_PIECE", + (25 << 8) | 0x02: "WEEKEVENTREG_25_02", + (25 << 8) | 0x04: "WEEKEVENTREG_25_04", + (25 << 8) | 0x08: "WEEKEVENTREG_25_08", + (25 << 8) | 0x10: "WEEKEVENTREG_25_10", + (25 << 8) | 0x20: "WEEKEVENTREG_25_20", + (25 << 8) | 0x40: "WEEKEVENTREG_25_40", + (25 << 8) | 0x80: "WEEKEVENTREG_25_80", + (26 << 8) | 0x01: "WEEKEVENTREG_26_01", + (26 << 8) | 0x02: "WEEKEVENTREG_26_02", + (26 << 8) | 0x04: "WEEKEVENTREG_26_04", + (26 << 8) | 0x08: "WEEKEVENTREG_26_08", + (26 << 8) | 0x10: "WEEKEVENTREG_26_10", + (26 << 8) | 0x20: "WEEKEVENTREG_26_20", + (26 << 8) | 0x40: "WEEKEVENTREG_26_40", + (26 << 8) | 0x80: "WEEKEVENTREG_26_80", + (27 << 8) | 0x01: "WEEKEVENTREG_27_01", + (27 << 8) | 0x02: "WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_SOUTH_UPPER_CLOCKTOWN", + (27 << 8) | 0x04: "WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_NORTH_CLOCKTOWN", + (27 << 8) | 0x08: "WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_EAST_UPPER_CLOCKTOWN", + (27 << 8) | 0x10: "WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_EAST_LOWER_CLOCKTOWN", + (27 << 8) | 0x20: "WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_SOUTH_LOWER_CLOCKTOWN", + (27 << 8) | 0x40: "WEEKEVENTREG_27_40", + (27 << 8) | 0x80: "WEEKEVENTREG_27_80", + (28 << 8) | 0x01: "WEEKEVENTREG_28_01", + (28 << 8) | 0x02: "WEEKEVENTREG_28_02", + (28 << 8) | 0x04: "WEEKEVENTREG_28_04", + (28 << 8) | 0x08: "WEEKEVENTREG_28_08", + (28 << 8) | 0x10: "WEEKEVENTREG_28_10", + (28 << 8) | 0x20: "WEEKEVENTREG_28_20", + (28 << 8) | 0x40: "WEEKEVENTREG_28_40", + (28 << 8) | 0x80: "WEEKEVENTREG_28_80", + (29 << 8) | 0x01: "WEEKEVENTREG_29_01", + (29 << 8) | 0x02: "WEEKEVENTREG_29_02", + (29 << 8) | 0x04: "WEEKEVENTREG_29_04", + (29 << 8) | 0x08: "WEEKEVENTREG_29_08", + (29 << 8) | 0x10: "WEEKEVENTREG_29_10", + (29 << 8) | 0x20: "WEEKEVENTREG_29_20", + (29 << 8) | 0x40: "WEEKEVENTREG_29_40", + (29 << 8) | 0x80: "WEEKEVENTREG_29_80", + (30 << 8) | 0x01: "WEEKEVENTREG_30_01", + (30 << 8) | 0x02: "WEEKEVENTREG_30_02", + (30 << 8) | 0x04: "WEEKEVENTREG_30_04", + (30 << 8) | 0x08: "WEEKEVENTREG_30_08", + (30 << 8) | 0x10: "WEEKEVENTREG_30_10", + (30 << 8) | 0x20: "WEEKEVENTREG_30_20", + (30 << 8) | 0x40: "WEEKEVENTREG_30_40", + (30 << 8) | 0x80: "WEEKEVENTREG_30_80", + (31 << 8) | 0x01: "WEEKEVENTREG_31_01", + (31 << 8) | 0x02: "WEEKEVENTREG_31_02", + (31 << 8) | 0x04: "WEEKEVENTREG_31_04", + (31 << 8) | 0x08: "WEEKEVENTREG_31_08", + (31 << 8) | 0x10: "WEEKEVENTREG_31_10", + (31 << 8) | 0x20: "WEEKEVENTREG_31_20", + (31 << 8) | 0x40: "WEEKEVENTREG_31_40", + (31 << 8) | 0x80: "WEEKEVENTREG_31_80", + (32 << 8) | 0x01: "WEEKEVENTREG_RECEIVED_SEAHORSE_HEART_PIECE", + (32 << 8) | 0x02: "WEEKEVENTREG_RECEIVED_SWAMP_SHOOTING_GALLERY_HEART_PIECE", + (32 << 8) | 0x04: "WEEKEVENTREG_RECEIVED_TOWN_SHOOTING_GALLERY_HEART_PIECE", + (32 << 8) | 0x08: "WEEKEVENTREG_32_08", + (32 << 8) | 0x10: "WEEKEVENTREG_32_10", + (32 << 8) | 0x20: "WEEKEVENTREG_32_20", + (32 << 8) | 0x40: "WEEKEVENTREG_32_40", + (32 << 8) | 0x80: "WEEKEVENTREG_32_80", + (33 << 8) | 0x01: "WEEKEVENTREG_33_01", + (33 << 8) | 0x02: "WEEKEVENTREG_33_02", + (33 << 8) | 0x04: "WEEKEVENTREG_BOUGHT_CURIOSITY_SHOP_SPECIAL_ITEM", + (33 << 8) | 0x08: "WEEKEVENTREG_RECOVERED_STOLEN_BOMB_BAG", + (33 << 8) | 0x10: "WEEKEVENTREG_33_10", + (33 << 8) | 0x20: "WEEKEVENTREG_33_20", + (33 << 8) | 0x40: "WEEKEVENTREG_33_40", + (33 << 8) | 0x80: "WEEKEVENTREG_CLEARED_SNOWHEAD_TEMPLE", + (34 << 8) | 0x01: "WEEKEVENTREG_34_01", + (34 << 8) | 0x02: "WEEKEVENTREG_34_02", + (34 << 8) | 0x04: "WEEKEVENTREG_34_04", + (34 << 8) | 0x08: "WEEKEVENTREG_TALKED_SWAMP_SPIDER_HOUSE_MAN", + (34 << 8) | 0x10: "WEEKEVENTREG_34_10", + (34 << 8) | 0x20: "WEEKEVENTREG_34_20", + (34 << 8) | 0x40: "WEEKEVENTREG_RECEIVED_MASK_OF_TRUTH", + (34 << 8) | 0x80: "WEEKEVENTREG_34_80", + (35 << 8) | 0x01: "WEEKEVENTREG_TINGLE_MAP_BOUGHT_CLOCK_TOWN", + (35 << 8) | 0x02: "WEEKEVENTREG_TINGLE_MAP_BOUGHT_WOODFALL", + (35 << 8) | 0x04: "WEEKEVENTREG_TINGLE_MAP_BOUGHT_SNOWHEAD", + (35 << 8) | 0x08: "WEEKEVENTREG_TINGLE_MAP_BOUGHT_ROMANI_RANCH", + (35 << 8) | 0x10: "WEEKEVENTREG_TINGLE_MAP_BOUGHT_GREAT_BAY", + (35 << 8) | 0x20: "WEEKEVENTREG_TINGLE_MAP_BOUGHT_STONE_TOWER", + (35 << 8) | 0x40: "WEEKEVENTREG_35_40", + (35 << 8) | 0x80: "WEEKEVENTREG_RECEIVED_FROG_CHOIR_HEART_PIECE", + (36 << 8) | 0x01: "WEEKEVENTREG_36_01", + (36 << 8) | 0x02: "WEEKEVENTREG_36_02", + (36 << 8) | 0x04: "WEEKEVENTREG_36_04", + (36 << 8) | 0x08: "WEEKEVENTREG_36_08", + (36 << 8) | 0x10: "WEEKEVENTREG_36_10", + (36 << 8) | 0x20: "WEEKEVENTREG_36_20", + (36 << 8) | 0x40: "WEEKEVENTREG_36_40", + (36 << 8) | 0x80: "WEEKEVENTREG_36_80", + (37 << 8) | 0x01: "WEEKEVENTREG_37_01", + (37 << 8) | 0x02: "WEEKEVENTREG_37_02", + (37 << 8) | 0x04: "WEEKEVENTREG_37_04", + (37 << 8) | 0x08: "WEEKEVENTREG_37_08", + (37 << 8) | 0x10: "WEEKEVENTREG_37_10", + (37 << 8) | 0x20: "WEEKEVENTREG_37_20", + (37 << 8) | 0x40: "WEEKEVENTREG_37_40", + (37 << 8) | 0x80: "WEEKEVENTREG_37_80", + (38 << 8) | 0x01: "WEEKEVENTREG_38_01", + (38 << 8) | 0x02: "WEEKEVENTREG_38_02", + (38 << 8) | 0x04: "WEEKEVENTREG_38_04", + (38 << 8) | 0x08: "WEEKEVENTREG_38_08", + (38 << 8) | 0x10: "WEEKEVENTREG_38_10", + (38 << 8) | 0x20: "WEEKEVENTREG_38_20", + (38 << 8) | 0x40: "WEEKEVENTREG_38_40", + (38 << 8) | 0x80: "WEEKEVENTREG_38_80", + (39 << 8) | 0x01: "WEEKEVENTREG_39_01", + (39 << 8) | 0x02: "WEEKEVENTREG_39_02", + (39 << 8) | 0x04: "WEEKEVENTREG_39_04", + (39 << 8) | 0x08: "WEEKEVENTREG_39_08", + (39 << 8) | 0x10: "WEEKEVENTREG_39_10", + (39 << 8) | 0x20: "WEEKEVENTREG_RECEIVED_EVAN_HEART_PIECE", + (39 << 8) | 0x40: "WEEKEVENTREG_39_40", + (39 << 8) | 0x80: "WEEKEVENTREG_39_80", + (40 << 8) | 0x01: "WEEKEVENTREG_40_01", + (40 << 8) | 0x02: "WEEKEVENTREG_40_02", + (40 << 8) | 0x04: "WEEKEVENTREG_40_04", + (40 << 8) | 0x08: "WEEKEVENTREG_40_08", + (40 << 8) | 0x10: "WEEKEVENTREG_40_10", + (40 << 8) | 0x20: "WEEKEVENTREG_40_20", + (40 << 8) | 0x40: "WEEKEVENTREG_40_40", + (40 << 8) | 0x80: "WEEKEVENTREG_40_80", + (41 << 8) | 0x01: "WEEKEVENTREG_41_01", + (41 << 8) | 0x02: "WEEKEVENTREG_41_02", + (41 << 8) | 0x04: "WEEKEVENTREG_41_04", + (41 << 8) | 0x08: "WEEKEVENTREG_RECEIVED_GORON_RACE_BOTTLE", + (41 << 8) | 0x10: "WEEKEVENTREG_41_10", + (41 << 8) | 0x20: "WEEKEVENTREG_41_20", + (41 << 8) | 0x40: "WEEKEVENTREG_41_40", + (41 << 8) | 0x80: "WEEKEVENTREG_41_80", + (42 << 8) | 0x01: "WEEKEVENTREG_42_01", + (42 << 8) | 0x02: "WEEKEVENTREG_42_02", + (42 << 8) | 0x04: "WEEKEVENTREG_42_04", + (42 << 8) | 0x08: "WEEKEVENTREG_42_08", + (42 << 8) | 0x10: "WEEKEVENTREG_42_10", + (42 << 8) | 0x20: "WEEKEVENTREG_42_20", + (42 << 8) | 0x40: "WEEKEVENTREG_42_40", + (42 << 8) | 0x80: "WEEKEVENTREG_42_80", + (43 << 8) | 0x01: "WEEKEVENTREG_43_01", + (43 << 8) | 0x02: "WEEKEVENTREG_43_02", + (43 << 8) | 0x04: "WEEKEVENTREG_43_04", + (43 << 8) | 0x08: "WEEKEVENTREG_43_08", + (43 << 8) | 0x10: "WEEKEVENTREG_43_10", + (43 << 8) | 0x20: "WEEKEVENTREG_43_20", + (43 << 8) | 0x40: "WEEKEVENTREG_43_40", + (43 << 8) | 0x80: "WEEKEVENTREG_43_80", + (44 << 8) | 0x01: "WEEKEVENTREG_44_01", + (44 << 8) | 0x02: "WEEKEVENTREG_44_02", + (44 << 8) | 0x04: "WEEKEVENTREG_44_04", + (44 << 8) | 0x08: "WEEKEVENTREG_44_08", + (44 << 8) | 0x10: "WEEKEVENTREG_44_10", + (44 << 8) | 0x20: "WEEKEVENTREG_44_20", + (44 << 8) | 0x40: "WEEKEVENTREG_44_40", + (44 << 8) | 0x80: "WEEKEVENTREG_44_80", + (45 << 8) | 0x01: "WEEKEVENTREG_45_01", + (45 << 8) | 0x02: "WEEKEVENTREG_45_02", + (45 << 8) | 0x04: "WEEKEVENTREG_45_04", + (45 << 8) | 0x08: "WEEKEVENTREG_45_08", + (45 << 8) | 0x10: "WEEKEVENTREG_45_10", + (45 << 8) | 0x20: "WEEKEVENTREG_45_20", + (45 << 8) | 0x40: "WEEKEVENTREG_45_40", + (45 << 8) | 0x80: "WEEKEVENTREG_45_80", + (46 << 8) | 0x01: "WEEKEVENTREG_46_01", + (46 << 8) | 0x02: "WEEKEVENTREG_46_02", + (46 << 8) | 0x04: "WEEKEVENTREG_46_04", + (46 << 8) | 0x08: "WEEKEVENTREG_46_08", + (46 << 8) | 0x10: "WEEKEVENTREG_46_10", + (46 << 8) | 0x20: "WEEKEVENTREG_46_20", + (46 << 8) | 0x40: "WEEKEVENTREG_46_40", + (46 << 8) | 0x80: "WEEKEVENTREG_46_80", + (47 << 8) | 0x01: "WEEKEVENTREG_47_01", + (47 << 8) | 0x02: "WEEKEVENTREG_47_02", + (47 << 8) | 0x04: "WEEKEVENTREG_47_04", + (47 << 8) | 0x08: "WEEKEVENTREG_47_08", + (47 << 8) | 0x10: "WEEKEVENTREG_47_10", + (47 << 8) | 0x20: "WEEKEVENTREG_47_20", + (47 << 8) | 0x40: "WEEKEVENTREG_47_40", + (47 << 8) | 0x80: "WEEKEVENTREG_47_80", + (48 << 8) | 0x01: "WEEKEVENTREG_48_01", + (48 << 8) | 0x02: "WEEKEVENTREG_48_02", + (48 << 8) | 0x04: "WEEKEVENTREG_48_04", + (48 << 8) | 0x08: "WEEKEVENTREG_48_08", + (48 << 8) | 0x10: "WEEKEVENTREG_48_10", + (48 << 8) | 0x20: "WEEKEVENTREG_48_20", + (48 << 8) | 0x40: "WEEKEVENTREG_48_40", + (48 << 8) | 0x80: "WEEKEVENTREG_48_80", + (49 << 8) | 0x01: "WEEKEVENTREG_49_01", + (49 << 8) | 0x02: "WEEKEVENTREG_49_02", + (49 << 8) | 0x04: "WEEKEVENTREG_49_04", + (49 << 8) | 0x08: "WEEKEVENTREG_49_08", + (49 << 8) | 0x10: "WEEKEVENTREG_49_10", + (49 << 8) | 0x20: "WEEKEVENTREG_49_20", + (49 << 8) | 0x40: "WEEKEVENTREG_49_40", + (49 << 8) | 0x80: "WEEKEVENTREG_49_80", + (50 << 8) | 0x01: "WEEKEVENTREG_50_01", + (50 << 8) | 0x02: "WEEKEVENTREG_50_02", + (50 << 8) | 0x04: "WEEKEVENTREG_50_04", + (50 << 8) | 0x08: "WEEKEVENTREG_PROMISED_MIDNIGHT_MEETING", + (50 << 8) | 0x10: "WEEKEVENTREG_50_10", + (50 << 8) | 0x20: "WEEKEVENTREG_HAD_MIDNIGHT_MEETING", + (50 << 8) | 0x40: "WEEKEVENTREG_50_40", + (50 << 8) | 0x80: "WEEKEVENTREG_RECEIVED_PENDANT_OF_MEMORIES", + (51 << 8) | 0x01: "WEEKEVENTREG_DELIVERED_PENDANT_OF_MEMORIES", + (51 << 8) | 0x02: "WEEKEVENTREG_51_02", + (51 << 8) | 0x04: "WEEKEVENTREG_51_04", + (51 << 8) | 0x08: "WEEKEVENTREG_51_08", + (51 << 8) | 0x10: "WEEKEVENTREG_51_10", + (51 << 8) | 0x20: "WEEKEVENTREG_ESCAPED_SAKONS_HIDEOUT", + (51 << 8) | 0x40: "WEEKEVENTREG_COUPLES_MASK_CUTSCENE_FINISHED", + (51 << 8) | 0x80: "WEEKEVENTREG_51_80", + (52 << 8) | 0x01: "WEEKEVENTREG_ESCORTED_CREMIA", + (52 << 8) | 0x02: "WEEKEVENTREG_52_02", + (52 << 8) | 0x04: "WEEKEVENTREG_52_04", + (52 << 8) | 0x08: "WEEKEVENTREG_52_08", + (52 << 8) | 0x10: "WEEKEVENTREG_52_10", + (52 << 8) | 0x20: "WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE", + (52 << 8) | 0x40: "WEEKEVENTREG_52_40", + (52 << 8) | 0x80: "WEEKEVENTREG_52_80", + (53 << 8) | 0x01: "WEEKEVENTREG_53_01", + (53 << 8) | 0x02: "WEEKEVENTREG_RECEIVED_BUSINESS_SCRUB_HEART_PIECE", + (53 << 8) | 0x04: "WEEKEVENTREG_53_04", + (53 << 8) | 0x08: "WEEKEVENTREG_GAVE_KOTAKE_MUSHROOM", + (53 << 8) | 0x10: "WEEKEVENTREG_RECEIVED_FREE_BLUE_POTION", + (53 << 8) | 0x20: "WEEKEVENTREG_53_20", + (53 << 8) | 0x40: "WEEKEVENTREG_53_40", + (53 << 8) | 0x80: "WEEKEVENTREG_53_80", + (54 << 8) | 0x01: "WEEKEVENTREG_54_01", + (54 << 8) | 0x02: "WEEKEVENTREG_54_02", + (54 << 8) | 0x04: "WEEKEVENTREG_54_04", + (54 << 8) | 0x08: "WEEKEVENTREG_54_08", + (54 << 8) | 0x10: "WEEKEVENTREG_TALKED_ROMANI_ON_NIGHT_1", + (54 << 8) | 0x20: "WEEKEVENTREG_54_20", + (54 << 8) | 0x40: "WEEKEVENTREG_RECEIVED_SPIRIT_HOUSE_HEART_PIECE", + (54 << 8) | 0x80: "WEEKEVENTREG_54_80", + (55 << 8) | 0x01: "WEEKEVENTREG_55_01", + (55 << 8) | 0x02: "WEEKEVENTREG_55_02", + (55 << 8) | 0x04: "WEEKEVENTREG_TALKED_PART_TIMER_AS_GORON", + (55 << 8) | 0x08: "WEEKEVENTREG_TALKED_PART_TIMER_AS_ZORA", + (55 << 8) | 0x10: "WEEKEVENTREG_TALKED_PART_TIMER_AS_DEKU", + (55 << 8) | 0x20: "WEEKEVENTREG_TALKED_ANJU_IN_LAUNDRY_POOL", + (55 << 8) | 0x40: "WEEKEVENTREG_55_40", + (55 << 8) | 0x80: "WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE", + (56 << 8) | 0x01: "WEEKEVENTREG_56_01", + (56 << 8) | 0x02: "WEEKEVENTREG_RECEIVED_MARINE_RESEARCH_LAB_FISH_HEART_PIECE", + (56 << 8) | 0x04: "WEEKEVENTREG_56_04", + (56 << 8) | 0x08: "WEEKEVENTREG_56_08", + (56 << 8) | 0x10: "WEEKEVENTREG_56_10", + (56 << 8) | 0x20: "WEEKEVENTREG_56_20", + (56 << 8) | 0x40: "WEEKEVENTREG_56_40", + (56 << 8) | 0x80: "WEEKEVENTREG_56_80", + (57 << 8) | 0x01: "WEEKEVENTREG_57_01", + (57 << 8) | 0x02: "WEEKEVENTREG_57_02", + (57 << 8) | 0x04: "WEEKEVENTREG_57_04", + (57 << 8) | 0x08: "WEEKEVENTREG_57_08", + (57 << 8) | 0x10: "WEEKEVENTREG_TALKED_ZORA_SHOPKEEPER_AS_HUMAN", + (57 << 8) | 0x20: "WEEKEVENTREG_TALKED_ZORA_SHOPKEEPER_AS_DEKU", + (57 << 8) | 0x40: "WEEKEVENTREG_TALKED_ZORA_SHOPKEEPER_AS_GORON", + (57 << 8) | 0x80: "WEEKEVENTREG_TALKED_ZORA_SHOPKEEPER_AS_ZORA", + (58 << 8) | 0x01: "WEEKEVENTREG_58_01", + (58 << 8) | 0x02: "WEEKEVENTREG_58_02", + (58 << 8) | 0x04: "WEEKEVENTREG_TALKED_GORON_SHOPKEEPER_AS_NON_GORON", + (58 << 8) | 0x08: "WEEKEVENTREG_TALKED_GORON_SHOPKEEPER_AS_GORON", + (58 << 8) | 0x10: "WEEKEVENTREG_TALKED_GORON_SHOPKEEPER_SPRING_AS_NON_GORON", + (58 << 8) | 0x20: "WEEKEVENTREG_TALKED_GORON_SHOPKEEPER_SPRING_AS_GORON", + (58 << 8) | 0x40: "WEEKEVENTREG_58_40", + (58 << 8) | 0x80: "WEEKEVENTREG_58_80", + (59 << 8) | 0x01: "WEEKEVENTREG_59_01", + (59 << 8) | 0x02: "WEEKEVENTREG_59_02", + (59 << 8) | 0x08: "WEEKEVENTREG_RECEIVED_BANK_HEART_PIECE", + (59 << 8) | 0x04: "WEEKEVENTREG_59_04", + (59 << 8) | 0x10: "WEEKEVENTREG_RECEIVED_SWAMP_SHOOTING_GALLERY_QUIVER_UPGRADE", + (59 << 8) | 0x20: "WEEKEVENTREG_RECEIVED_TOWN_SHOOTING_GALLERY_QUIVER_UPGRADE", + (59 << 8) | 0x40: "WEEKEVENTREG_59_40", + (59 << 8) | 0x80: "WEEKEVENTREG_59_80", + (60 << 8) | 0x01: "WEEKEVENTREG_60_01", + (60 << 8) | 0x02: "WEEKEVENTREG_60_02", + (60 << 8) | 0x04: "WEEKEVENTREG_60_04", + (60 << 8) | 0x08: "WEEKEVENTREG_60_08", + (60 << 8) | 0x10: "WEEKEVENTREG_60_10", + (60 << 8) | 0x20: "WEEKEVENTREG_60_20", + (60 << 8) | 0x40: "WEEKEVENTREG_60_40", + (60 << 8) | 0x80: "WEEKEVENTREG_60_80", + (61 << 8) | 0x01: "WEEKEVENTREG_61_01", + (61 << 8) | 0x02: "WEEKEVENTREG_61_02", + (61 << 8) | 0x04: "WEEKEVENTREG_61_04", + (61 << 8) | 0x08: "WEEKEVENTREG_61_08", + (61 << 8) | 0x10: "WEEKEVENTREG_61_10", + (61 << 8) | 0x20: "WEEKEVENTREG_61_20", + (61 << 8) | 0x40: "WEEKEVENTREG_61_40", + (61 << 8) | 0x80: "WEEKEVENTREG_61_80", + (62 << 8) | 0x01: "WEEKEVENTREG_62_01", + (62 << 8) | 0x02: "WEEKEVENTREG_62_02", + (62 << 8) | 0x04: "WEEKEVENTREG_62_04", + (62 << 8) | 0x08: "WEEKEVENTREG_62_08", + (62 << 8) | 0x10: "WEEKEVENTREG_62_10", + (62 << 8) | 0x20: "WEEKEVENTREG_62_20", + (62 << 8) | 0x40: "WEEKEVENTREG_62_40", + (62 << 8) | 0x80: "WEEKEVENTREG_62_80", + (63 << 8) | 0x01: "WEEKEVENTREG_KICKOUT_WAIT", + (63 << 8) | 0x02: "WEEKEVENTREG_KICKOUT_TIME_PASSED", + (63 << 8) | 0x04: "WEEKEVENTREG_63_04", + (63 << 8) | 0x08: "WEEKEVENTREG_63_08", + (63 << 8) | 0x10: "WEEKEVENTREG_63_10", + (63 << 8) | 0x20: "WEEKEVENTREG_RECEIVED_SWORDSMANS_SCHOOL_HEART_PIECE", + (63 << 8) | 0x40: "WEEKEVENTREG_63_40", + (63 << 8) | 0x80: "WEEKEVENTREG_63_80", + (64 << 8) | 0x01: "WEEKEVENTREG_64_01", + (64 << 8) | 0x02: "WEEKEVENTREG_64_02", + (64 << 8) | 0x04: "WEEKEVENTREG_64_04", + (64 << 8) | 0x08: "WEEKEVENTREG_TINGLE_RECOGNIZED_PLAYER_FORM_LOW_BIT", + (64 << 8) | 0x10: "WEEKEVENTREG_TINGLE_RECOGNIZED_PLAYER_FORM_HIGH_BIT", + (64 << 8) | 0x20: "WEEKEVENTREG_64_20", + (64 << 8) | 0x40: "WEEKEVENTREG_64_40", + (64 << 8) | 0x80: "WEEKEVENTREG_TALKED_DOGGY_RACETRACK_OWNER_DAY_1", + (65 << 8) | 0x01: "WEEKEVENTREG_TALKED_DOGGY_RACETRACK_OWNER_NIGHT_1", + (65 << 8) | 0x02: "WEEKEVENTREG_TALKED_DOGGY_RACETRACK_OWNER_DAY_2", + (65 << 8) | 0x04: "WEEKEVENTREG_TALKED_DOGGY_RACETRACK_OWNER_NIGHT_2", + (65 << 8) | 0x08: "WEEKEVENTREG_TALKED_DOGGY_RACETRACK_OWNER_DAY_3", + (65 << 8) | 0x10: "WEEKEVENTREG_TALKED_DOGGY_RACETRACK_OWNER_NIGHT_3", + (65 << 8) | 0x20: "WEEKEVENTREG_65_20", + (65 << 8) | 0x40: "WEEKEVENTREG_65_40", + (65 << 8) | 0x80: "WEEKEVENTREG_65_80", + (66 << 8) | 0x01: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_ANJU", + (66 << 8) | 0x02: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_KAFEI", + (66 << 8) | 0x04: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_CURIOSITY_SHOP_MAN", + (66 << 8) | 0x08: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_BOMB_SHOP_LADY", + (66 << 8) | 0x10: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_ROMANI", + (66 << 8) | 0x20: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_CREMIA", + (66 << 8) | 0x40: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_MAYOR_DOTOUR", + (66 << 8) | 0x80: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_MADAOME_AROMA", + (67 << 8) | 0x01: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_TOTO", + (67 << 8) | 0x02: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_GORMAN", + (67 << 8) | 0x04: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_POSTMAN", + (67 << 8) | 0x08: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_ROSA_SISTERS", + (67 << 8) | 0x10: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_TOILET_HAND", + (67 << 8) | 0x20: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_ANJUS_GRANDMOTHER", + (67 << 8) | 0x40: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_KAMARO", + (67 << 8) | 0x80: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_GROG", + (68 << 8) | 0x01: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_GORMAN_BROTHERS", + (68 << 8) | 0x02: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_SHIRO", + (68 << 8) | 0x04: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_GURU_GURU", + (68 << 8) | 0x08: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_BOMBERS", + (68 << 8) | 0x10: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_ROOM_KEY", + (68 << 8) | 0x20: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_PROMISED_MIDNIGHT_MEETING", + (68 << 8) | 0x40: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_PROMISED_TO_MEET_KAFEI", + (68 << 8) | 0x80: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_LETTER_TO_KAFEI", + (69 << 8) | 0x01: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_DEPOSITED_LETTER_TO_KAFEI", + (69 << 8) | 0x02: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_PENDANT_OF_MEMORIES", + (69 << 8) | 0x04: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_DELIVERED_PENDANT_OF_MEMORIES", + (69 << 8) | 0x08: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_ESCAPED_SAKONS_HIDEOUT", + (69 << 8) | 0x10: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_PROMISED_TO_HELP_WITH_ALIENS", + (69 << 8) | 0x20: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_DEFENDED_AGAINST_ALIENS", + (69 << 8) | 0x40: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_ALIENS_BOTTLE", + (69 << 8) | 0x80: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_ESCORTED_CREMIA", + (70 << 8) | 0x01: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_ROMANIS_MASK", + (70 << 8) | 0x02: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_KEATON_MASK", + (70 << 8) | 0x04: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_PRIORITY_MAIL", + (70 << 8) | 0x08: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_DELIVERED_PRIORITY_MAIL", + (70 << 8) | 0x10: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_LEARNED_SECRET_CODE", + (70 << 8) | 0x20: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_BOMBERS_NOTEBOOK", + (70 << 8) | 0x40: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_MAYOR_HP", + (70 << 8) | 0x80: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_ROSA_SISTERS_HP", + (71 << 8) | 0x01: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_TOILET_HAND_HP", + (71 << 8) | 0x02: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_GRANDMA_SHORT_STORY_HP", + (71 << 8) | 0x04: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_GRANDMA_LONG_STORY_HP", + (71 << 8) | 0x08: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_POSTMAN_HP", + (71 << 8) | 0x10: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_KAFEIS_MASK", + (71 << 8) | 0x20: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_ALL_NIGHT_MASK", + (71 << 8) | 0x40: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_BUNNY_HOOD", + (71 << 8) | 0x80: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_GAROS_MASK", + (72 << 8) | 0x01: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_CIRCUS_LEADERS_MASK", + (72 << 8) | 0x02: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_POSTMANS_HAT", + (72 << 8) | 0x04: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_COUPLES_MASK", + (72 << 8) | 0x08: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_BLAST_MASK", + (72 << 8) | 0x10: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_KAMAROS_MASK", + (72 << 8) | 0x20: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_STONE_MASK", + (72 << 8) | 0x40: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_BREMEN_MASK", + (72 << 8) | 0x80: "WEEKEVENTREG_72_80", + (73 << 8) | 0x01: "WEEKEVENTREG_73_01", + (73 << 8) | 0x02: "WEEKEVENTREG_73_02", + (73 << 8) | 0x04: "WEEKEVENTREG_73_04", + (73 << 8) | 0x08: "WEEKEVENTREG_73_08", + (73 << 8) | 0x10: "WEEKEVENTREG_73_10", + (73 << 8) | 0x20: "WEEKEVENTREG_73_20", + (73 << 8) | 0x40: "WEEKEVENTREG_73_40", + (73 << 8) | 0x80: "WEEKEVENTREG_73_80", + (74 << 8) | 0x01: "WEEKEVENTREG_74_01", + (74 << 8) | 0x02: "WEEKEVENTREG_74_02", + (74 << 8) | 0x04: "WEEKEVENTREG_74_04", + (74 << 8) | 0x08: "WEEKEVENTREG_74_08", + (74 << 8) | 0x10: "WEEKEVENTREG_74_10", + (74 << 8) | 0x20: "WEEKEVENTREG_74_20", + (74 << 8) | 0x40: "WEEKEVENTREG_74_40", + (74 << 8) | 0x80: "WEEKEVENTREG_74_80", + (75 << 8) | 0x01: "WEEKEVENTREG_75_01", + (75 << 8) | 0x02: "WEEKEVENTREG_75_02", + (75 << 8) | 0x04: "WEEKEVENTREG_75_04", + (75 << 8) | 0x08: "WEEKEVENTREG_75_08", + (75 << 8) | 0x10: "WEEKEVENTREG_RECEIVED_ROOM_KEY", + (75 << 8) | 0x20: "WEEKEVENTREG_75_20", + (75 << 8) | 0x40: "WEEKEVENTREG_75_40", + (75 << 8) | 0x80: "WEEKEVENTREG_RECEIVED_ROSA_SISTERS_HEART_PIECE", + (76 << 8) | 0x01: "WEEKEVENTREG_76_01", + (76 << 8) | 0x02: "WEEKEVENTREG_76_02", + (76 << 8) | 0x04: "WEEKEVENTREG_76_04", + (76 << 8) | 0x08: "WEEKEVENTREG_76_08", + (76 << 8) | 0x10: "WEEKEVENTREG_76_10", + (76 << 8) | 0x20: "WEEKEVENTREG_76_20", + (76 << 8) | 0x40: "WEEKEVENTREG_76_40", + (76 << 8) | 0x80: "WEEKEVENTREG_76_80", + (77 << 8) | 0x01: "WEEKEVENTREG_RECEIVED_POSTMAN_COUNTING_GAME_HEART_PIECE", + (77 << 8) | 0x02: "WEEKEVENTREG_77_02", + (77 << 8) | 0x04: "WEEKEVENTREG_77_04", + (77 << 8) | 0x08: "WEEKEVENTREG_77_08", + (77 << 8) | 0x10: "WEEKEVENTREG_77_10", + (77 << 8) | 0x20: "WEEKEVENTREG_77_20", + (77 << 8) | 0x40: "WEEKEVENTREG_77_40", + (77 << 8) | 0x80: "WEEKEVENTREG_77_80", + (78 << 8) | 0x01: "WEEKEVENTREG_78_01", + (78 << 8) | 0x02: "WEEKEVENTREG_78_02", + (78 << 8) | 0x04: "WEEKEVENTREG_78_04", + (78 << 8) | 0x08: "WEEKEVENTREG_78_08", + (78 << 8) | 0x10: "WEEKEVENTREG_78_10", + (78 << 8) | 0x20: "WEEKEVENTREG_78_20", + (78 << 8) | 0x40: "WEEKEVENTREG_78_40", + (78 << 8) | 0x80: "WEEKEVENTREG_78_80", + (79 << 8) | 0x01: "WEEKEVENTREG_79_01", + (79 << 8) | 0x02: "WEEKEVENTREG_79_02", + (79 << 8) | 0x04: "WEEKEVENTREG_79_04", + (79 << 8) | 0x08: "WEEKEVENTREG_79_08", + (79 << 8) | 0x10: "WEEKEVENTREG_79_10", + (79 << 8) | 0x20: "WEEKEVENTREG_79_20", + (79 << 8) | 0x40: "WEEKEVENTREG_SAKON_DEAD", + (79 << 8) | 0x80: "WEEKEVENTREG_RECEIVED_KEATON_HEART_PIECE", + (80 << 8) | 0x01: "WEEKEVENTREG_80_01", + (80 << 8) | 0x02: "WEEKEVENTREG_80_02", + (80 << 8) | 0x04: "WEEKEVENTREG_80_04", + (80 << 8) | 0x08: "WEEKEVENTREG_80_08", + (80 << 8) | 0x10: "WEEKEVENTREG_RECEIVED_PRIORITY_MAIL", + (80 << 8) | 0x20: "WEEKEVENTREG_80_20", + (80 << 8) | 0x40: "WEEKEVENTREG_80_40", + (80 << 8) | 0x80: "WEEKEVENTREG_80_80", + (81 << 8) | 0x01: "WEEKEVENTREG_81_01", + (81 << 8) | 0x02: "WEEKEVENTREG_81_02", + (81 << 8) | 0x04: "WEEKEVENTREG_81_04", + (81 << 8) | 0x08: "WEEKEVENTREG_81_08", + (81 << 8) | 0x10: "WEEKEVENTREG_81_10", + (81 << 8) | 0x20: "WEEKEVENTREG_81_20", + (81 << 8) | 0x40: "WEEKEVENTREG_81_40", + (81 << 8) | 0x80: "WEEKEVENTREG_81_80", + (82 << 8) | 0x01: "WEEKEVENTREG_82_01", + (82 << 8) | 0x02: "WEEKEVENTREG_82_02", + (82 << 8) | 0x04: "WEEKEVENTREG_82_04", + (82 << 8) | 0x08: "WEEKEVENTREG_82_08", + (82 << 8) | 0x10: "WEEKEVENTREG_RECEIVED_FISHERMANS_JUMPING_GAME_HEART_PIECE", + (82 << 8) | 0x20: "WEEKEVENTREG_82_20", + (82 << 8) | 0x40: "WEEKEVENTREG_82_40", + (82 << 8) | 0x80: "WEEKEVENTREG_82_80", + (83 << 8) | 0x01: "WEEKEVENTREG_83_01", + (83 << 8) | 0x02: "WEEKEVENTREG_83_02", + (83 << 8) | 0x04: "WEEKEVENTREG_83_04", + (83 << 8) | 0x08: "WEEKEVENTREG_83_08", + (83 << 8) | 0x10: "WEEKEVENTREG_83_10", + (83 << 8) | 0x20: "WEEKEVENTREG_83_20", + (83 << 8) | 0x40: "WEEKEVENTREG_83_40", + (83 << 8) | 0x80: "WEEKEVENTREG_83_80", + (84 << 8) | 0x01: "WEEKEVENTREG_84_01", + (84 << 8) | 0x02: "WEEKEVENTREG_84_02", + (84 << 8) | 0x04: "WEEKEVENTREG_84_04", + (84 << 8) | 0x08: "WEEKEVENTREG_84_08", + (84 << 8) | 0x10: "WEEKEVENTREG_84_10", + (84 << 8) | 0x20: "WEEKEVENTREG_84_20", + (84 << 8) | 0x40: "WEEKEVENTREG_RECEIVED_RED_POTION_FOR_KOUME", + (84 << 8) | 0x80: "WEEKEVENTREG_84_80", + (85 << 8) | 0x01: "WEEKEVENTREG_85_01", + (85 << 8) | 0x02: "WEEKEVENTREG_85_02", + (85 << 8) | 0x04: "WEEKEVENTREG_85_04", + (85 << 8) | 0x08: "WEEKEVENTREG_FAILED_RECEIVED_RED_POTION_FOR_KOUME_SHOP", + (85 << 8) | 0x10: "WEEKEVENTREG_FAILED_RECEIVED_RED_POTION_FOR_KOUME_WOODS", + (85 << 8) | 0x20: "WEEKEVENTREG_85_20", + (85 << 8) | 0x40: "WEEKEVENTREG_85_40", + (85 << 8) | 0x80: "WEEKEVENTREG_85_80", + (86 << 8) | 0x01: "WEEKEVENTREG_86_01", + (86 << 8) | 0x02: "WEEKEVENTREG_86_02", + (86 << 8) | 0x04: "WEEKEVENTREG_86_04", + (86 << 8) | 0x08: "WEEKEVENTREG_LISTENED_ANJU_POSTMAN_CONVERSATION", + (86 << 8) | 0x10: "WEEKEVENTREG_86_10", + (86 << 8) | 0x20: "WEEKEVENTREG_86_20", + (86 << 8) | 0x40: "WEEKEVENTREG_86_40", + (86 << 8) | 0x80: "WEEKEVENTREG_86_80", + (87 << 8) | 0x01: "WEEKEVENTREG_TALKING_TO_COW_WITH_VOICE", + (87 << 8) | 0x02: "WEEKEVENTREG_COUPLES_MASK_CUTSCENE_STARTED", + (87 << 8) | 0x04: "WEEKEVENTREG_87_04", + (87 << 8) | 0x08: "WEEKEVENTREG_87_08", + (87 << 8) | 0x10: "WEEKEVENTREG_87_10", + (87 << 8) | 0x20: "WEEKEVENTREG_87_20", + (87 << 8) | 0x40: "WEEKEVENTREG_87_40", + (87 << 8) | 0x80: "WEEKEVENTREG_87_80", + (88 << 8) | 0x01: "WEEKEVENTREG_88_01", + (88 << 8) | 0x02: "WEEKEVENTREG_88_02", + (88 << 8) | 0x04: "WEEKEVENTREG_88_04", + (88 << 8) | 0x08: "WEEKEVENTREG_88_08", + (88 << 8) | 0x10: "WEEKEVENTREG_88_10", + (88 << 8) | 0x20: "WEEKEVENTREG_88_20", + (88 << 8) | 0x40: "WEEKEVENTREG_GATEKEEPER_OPENED_GORON_SHRINE", + (88 << 8) | 0x80: "WEEKEVENTREG_GATEKEEPER_OPENED_GORON_SHRINE_FOR_HUMAN", + (89 << 8) | 0x01: "WEEKEVENTREG_GATEKEEPER_OPENED_GORON_SHRINE_FOR_DEKU", + (89 << 8) | 0x02: "WEEKEVENTREG_GATEKEEPER_OPENED_GORON_SHRINE_FOR_ZORA", + (89 << 8) | 0x04: "WEEKEVENTREG_GATEKEEPER_OPENED_GORON_SHRINE_FOR_GORON", + (89 << 8) | 0x08: "WEEKEVENTREG_89_08", + (89 << 8) | 0x10: "WEEKEVENTREG_FAILED_TO_DEFEND_AGAINST_ALIENS", + (89 << 8) | 0x20: "WEEKEVENTREG_89_20", + (89 << 8) | 0x40: "WEEKEVENTREG_89_40", + (89 << 8) | 0x80: "WEEKEVENTREG_89_80", + (90 << 8) | 0x01: "WEEKEVENTREG_90_01", + (90 << 8) | 0x02: "WEEKEVENTREG_90_02", + (90 << 8) | 0x04: "WEEKEVENTREG_90_04", + (90 << 8) | 0x08: "WEEKEVENTREG_90_08", + (90 << 8) | 0x10: "WEEKEVENTREG_RECEIVED_GOSSIP_STONE_GROTTO_HEART_PIECE", + (90 << 8) | 0x20: "WEEKEVENTREG_90_20", + (90 << 8) | 0x40: "WEEKEVENTREG_90_40", + (90 << 8) | 0x80: "WEEKEVENTREG_90_80", + (91 << 8) | 0x01: "WEEKEVENTREG_91_01", + (91 << 8) | 0x02: "WEEKEVENTREG_91_02", + (91 << 8) | 0x04: "WEEKEVENTREG_91_04", + (91 << 8) | 0x08: "WEEKEVENTREG_91_08", + (91 << 8) | 0x10: "WEEKEVENTREG_91_10", + (91 << 8) | 0x20: "WEEKEVENTREG_91_20", + (91 << 8) | 0x40: "WEEKEVENTREG_91_40", + (91 << 8) | 0x80: "WEEKEVENTREG_91_80", + (92 << 8) | 0x01: "WEEKEVENTREG_92_01", + (92 << 8) | 0x02: "WEEKEVENTREG_92_02", + (92 << 8) | 0x04: "WEEKEVENTREG_92_04", + (92 << 8) | 0x08: "WEEKEVENTREG_92_08", + (92 << 8) | 0x10: "WEEKEVENTREG_92_10", + (92 << 8) | 0x20: "WEEKEVENTREG_92_20", + (92 << 8) | 0x40: "WEEKEVENTREG_92_40", + (92 << 8) | 0x80: "WEEKEVENTREG_92_80", + (93 << 8) | 0x01: "WEEKEVENTREG_93_01", + (93 << 8) | 0x02: "WEEKEVENTREG_93_02", + (93 << 8) | 0x04: "WEEKEVENTREG_93_04", + (93 << 8) | 0x08: "WEEKEVENTREG_93_08", + (93 << 8) | 0x10: "WEEKEVENTREG_93_10", + (93 << 8) | 0x20: "WEEKEVENTREG_93_20", + (93 << 8) | 0x40: "WEEKEVENTREG_93_40", + (93 << 8) | 0x80: "WEEKEVENTREG_93_80", + (94 << 8) | 0x01: "WEEKEVENTREG_94_01", + (94 << 8) | 0x02: "WEEKEVENTREG_94_02", + (94 << 8) | 0x04: "WEEKEVENTREG_94_04", + (94 << 8) | 0x08: "WEEKEVENTREG_94_08", + (94 << 8) | 0x10: "WEEKEVENTREG_94_10", + (94 << 8) | 0x20: "WEEKEVENTREG_94_20", + (94 << 8) | 0x40: "WEEKEVENTREG_94_40", + (94 << 8) | 0x80: "WEEKEVENTREG_94_80", + (95 << 8) | 0x01: "WEEKEVENTREG_95_01", + (95 << 8) | 0x02: "WEEKEVENTREG_95_02", + (95 << 8) | 0x04: "WEEKEVENTREG_95_04", + (95 << 8) | 0x08: "WEEKEVENTREG_95_08", + (95 << 8) | 0x10: "WEEKEVENTREG_95_10", + (95 << 8) | 0x20: "WEEKEVENTREG_95_20", + (95 << 8) | 0x40: "WEEKEVENTREG_95_40", + (95 << 8) | 0x80: "WEEKEVENTREG_95_80", + (96 << 8) | 0x01: "WEEKEVENTREG_96_01", + (96 << 8) | 0x02: "WEEKEVENTREG_96_02", + (96 << 8) | 0x04: "WEEKEVENTREG_96_04", + (96 << 8) | 0x08: "WEEKEVENTREG_96_08", + (96 << 8) | 0x10: "WEEKEVENTREG_96_10", + (96 << 8) | 0x20: "WEEKEVENTREG_96_20", + (96 << 8) | 0x40: "WEEKEVENTREG_96_40", + (96 << 8) | 0x80: "WEEKEVENTREG_96_80", + (97 << 8) | 0x01: "WEEKEVENTREG_97_01", + (97 << 8) | 0x02: "WEEKEVENTREG_97_02", + (97 << 8) | 0x04: "WEEKEVENTREG_97_04", + (97 << 8) | 0x08: "WEEKEVENTREG_97_08", + (97 << 8) | 0x10: "WEEKEVENTREG_97_10", + (97 << 8) | 0x20: "WEEKEVENTREG_97_20", + (97 << 8) | 0x40: "WEEKEVENTREG_97_40", + (97 << 8) | 0x80: "WEEKEVENTREG_97_80", + (98 << 8) | 0x01: "WEEKEVENTREG_98_01", + (98 << 8) | 0x02: "WEEKEVENTREG_98_02", + (98 << 8) | 0x04: "WEEKEVENTREG_98_04", + (98 << 8) | 0x08: "WEEKEVENTREG_98_08", + (98 << 8) | 0x10: "WEEKEVENTREG_98_10", + (98 << 8) | 0x20: "WEEKEVENTREG_98_20", + (98 << 8) | 0x40: "WEEKEVENTREG_98_40", + (98 << 8) | 0x80: "WEEKEVENTREG_98_80", + (99 << 8) | 0x01: "WEEKEVENTREG_99_01", + (99 << 8) | 0x02: "WEEKEVENTREG_99_02", + (99 << 8) | 0x04: "WEEKEVENTREG_99_04", + (99 << 8) | 0x08: "WEEKEVENTREG_99_08", + (99 << 8) | 0x10: "WEEKEVENTREG_99_10", + (99 << 8) | 0x20: "WEEKEVENTREG_99_20", + (99 << 8) | 0x40: "WEEKEVENTREG_99_40", + (99 << 8) | 0x80: "WEEKEVENTREG_99_80", +} + +item_names = ( + "ITEM_OCARINA", + "ITEM_BOW", + "ITEM_ARROW_FIRE", + "ITEM_ARROW_ICE", + "ITEM_ARROW_LIGHT", + "ITEM_OCARINA_FAIRY", + "ITEM_BOMB", + "ITEM_BOMBCHU", + "ITEM_STICK", + "ITEM_NUT", + "ITEM_MAGIC_BEANS", + "ITEM_SLINGSHOT", + "ITEM_POWDER_KEG", + "ITEM_PICTOGRAPH_BOX", + "ITEM_LENS", + "ITEM_HOOKSHOT", + "ITEM_SWORD_GREAT_FAIRY", + "ITEM_LONGSHOT", + "ITEM_BOTTLE", + "ITEM_POTION_RED", + "ITEM_POTION_GREEN", + "ITEM_POTION_BLUE", + "ITEM_FAIRY", + "ITEM_DEKU_PRINCESS", + "ITEM_MILK_BOTTLE", + "ITEM_MILK_HALF", + "ITEM_FISH", + "ITEM_BUG", + "ITEM_BLUE_FIRE", + "ITEM_POE", + "ITEM_BIG_POE", + "ITEM_SPRING_WATER", + "ITEM_HOT_SPRING_WATER", + "ITEM_ZORA_EGG", + "ITEM_GOLD_DUST", + "ITEM_MUSHROOM", + "ITEM_SEA_HORSE", + "ITEM_CHATEAU", + "ITEM_HYLIAN_LOACH", + "ITEM_OBABA_DRINK", + "ITEM_MOON_TEAR", + "ITEM_DEED_LAND", + "ITEM_DEED_SWAMP", + "ITEM_DEED_MOUNTAIN", + "ITEM_DEED_OCEAN", + "ITEM_ROOM_KEY", + "ITEM_LETTER_MAMA", + "ITEM_LETTER_TO_KAFEI", + "ITEM_PENDANT_OF_MEMORIES", + "ITEM_TINGLE_MAP", + "ITEM_MASK_DEKU", + "ITEM_MASK_GORON", + "ITEM_MASK_ZORA", + "ITEM_MASK_FIERCE_DEITY", + "ITEM_MASK_TRUTH", + "ITEM_MASK_KAFEIS_MASK", + "ITEM_MASK_ALL_NIGHT", + "ITEM_MASK_BUNNY", + "ITEM_MASK_KEATON", + "ITEM_MASK_GARO", + "ITEM_MASK_ROMANI", + "ITEM_MASK_CIRCUS_LEADER", + "ITEM_MASK_POSTMAN", + "ITEM_MASK_COUPLE", + "ITEM_MASK_GREAT_FAIRY", + "ITEM_MASK_GIBDO", + "ITEM_MASK_DON_GERO", + "ITEM_MASK_KAMARO", + "ITEM_MASK_CAPTAIN", + "ITEM_MASK_STONE", + "ITEM_MASK_BREMEN", + "ITEM_MASK_BLAST", + "ITEM_MASK_SCENTS", + "ITEM_MASK_GIANT", + "ITEM_BOW_ARROW_FIRE", + "ITEM_BOW_ARROW_ICE", + "ITEM_BOW_ARROW_LIGHT", + "ITEM_SWORD_KOKIRI", + "ITEM_SWORD_RAZOR", + "ITEM_SWORD_GILDED", + "ITEM_SWORD_DEITY", + "ITEM_SHIELD_HERO", + "ITEM_SHIELD_MIRROR", + "ITEM_QUIVER_30", + "ITEM_QUIVER_40", + "ITEM_QUIVER_50", + "ITEM_BOMB_BAG_20", + "ITEM_BOMB_BAG_30", + "ITEM_BOMB_BAG_40", + "ITEM_WALLET_DEFAULT", + "ITEM_WALLET_ADULT", + "ITEM_WALLET_GIANT", + "ITEM_FISHING_POLE", + "ITEM_REMAINS_ODOLWA", + "ITEM_REMAINS_GOHT", + "ITEM_REMAINS_GYORG", + "ITEM_REMAINS_TWINMOLD", + "ITEM_SONG_SONATA", + "ITEM_SONG_LULLABY", + "ITEM_SONG_NOVA", + "ITEM_SONG_ELEGY", + "ITEM_SONG_OATH", + "ITEM_SONG_SARIA", + "ITEM_SONG_TIME", + "ITEM_SONG_HEALING", + "ITEM_SONG_EPONA", + "ITEM_SONG_SOARING", + "ITEM_SONG_STORMS", + "ITEM_SONG_SUN", + "ITEM_BOMBERS_NOTEBOOK", + "ITEM_SKULL_TOKEN", + "ITEM_HEART_CONTAINER", + "ITEM_HEART_PIECE", + None, + None, + "ITEM_SONG_LULLABY_INTRO", + "ITEM_KEY_BOSS", + "ITEM_COMPASS", + "ITEM_DUNGEON_MAP", + "ITEM_STRAY_FAIRIES", + "ITEM_KEY_SMALL", + "ITEM_MAGIC_SMALL", + "ITEM_MAGIC_LARGE", + "ITEM_HEART_PIECE_2", + "ITEM_INVALID_1", + "ITEM_INVALID_2", + "ITEM_INVALID_3", + "ITEM_INVALID_4", + "ITEM_INVALID_5", + "ITEM_INVALID_6", + "ITEM_INVALID_7", + "ITEM_HEART", + "ITEM_RUPEE_GREEN", + "ITEM_RUPEE_BLUE", + "ITEM_RUPEE_10", + "ITEM_RUPEE_RED", + "ITEM_RUPEE_PURPLE", + "ITEM_RUPEE_SILVER", + "ITEM_RUPEE_HUGE", + "ITEM_STICKS_5", + "ITEM_STICKS_10", + "ITEM_NUTS_5", + "ITEM_NUTS_10", + "ITEM_BOMBS_5", + "ITEM_BOMBS_10", + "ITEM_BOMBS_20", + "ITEM_BOMBS_30", + "ITEM_ARROWS_10", + "ITEM_ARROWS_30", + "ITEM_ARROWS_40", + "ITEM_ARROWS_50", + "ITEM_BOMBCHUS_20", + "ITEM_BOMBCHUS_10", + "ITEM_BOMBCHUS_1", + "ITEM_BOMBCHUS_5", + "ITEM_STICK_UPGRADE_20", + "ITEM_STICK_UPGRADE_30", + "ITEM_NUT_UPGRADE_30", + "ITEM_NUT_UPGRADE_40", + "ITEM_CHATEAU_2", + "ITEM_MILK", + "ITEM_GOLD_DUST_2", + "ITEM_HYLIAN_LOACH_2", + "ITEM_SEA_HORSE_CAUGHT", +) + +gi_names = ( + "GI_NONE", + "GI_RUPEE_GREEN", + "GI_RUPEE_BLUE", + "GI_RUPEE_10", + "GI_RUPEE_RED", + "GI_RUPEE_PURPLE", + "GI_RUPEE_SILVER", + "GI_RUPEE_HUGE", + "GI_WALLET_ADULT", + "GI_WALLET_GIANT", + "GI_RECOVERY_HEART", + None, + "GI_HEART_PIECE", + "GI_HEART_CONTAINER", + "GI_MAGIC_SMALL", + "GI_MAGIC_LARGE", + None, + "GI_STRAY_FAIRY", + None, + None, + "GI_BOMBS_1", + "GI_BOMBS_5", + "GI_BOMBS_10", + "GI_BOMBS_20", + "GI_BOMBS_30", + "GI_STICKS_1", + "GI_BOMBCHUS_10", + "GI_BOMB_BAG_20", + "GI_BOMB_BAG_30", + "GI_BOMB_BAG_40", + "GI_ARROWS_10", + "GI_ARROWS_30", + "GI_ARROWS_40", + "GI_ARROWS_50", + "GI_QUIVER_30", + "GI_QUIVER_40", + "GI_QUIVER_50", + "GI_ARROW_FIRE", + "GI_ARROW_ICE", + "GI_ARROW_LIGHT", + "GI_NUTS_1", + "GI_NUTS_5", + "GI_NUTS_10", + None, + None, + None, + "GI_BOMBCHUS_20", + None, + None, + None, + "GI_SHIELD_HERO", + "GI_SHIELD_MIRROR", + "GI_POWDER_KEG", + "GI_MAGIC_BEANS", + "GI_BOMBCHUS_1", + "GI_SWORD_KOKIRI", + "GI_SWORD_RAZOR", + "GI_SWORD_GILDED", + "GI_BOMBCHUS_5", + "GI_SWORD_GREAT_FAIRY", + "GI_KEY_SMALL", + "GI_KEY_BOSS", + "GI_MAP", + "GI_COMPASS", + "GI_40", + "GI_HOOKSHOT", + "GI_LENS", + "GI_PICTOGRAPH_BOX", + None, + None, + None, + None, + None, + None, + None, + None, + "GI_OCARINA", + None, + None, + None, + "GI_BOMBERS_NOTEBOOK", + None, + "GI_SKULL_TOKEN", + None, + None, + "GI_REMAINS_ODOLWA", + "GI_REMAINS_GOHT", + "GI_REMAINS_GYORG", + "GI_REMAINS_TWINMOLD", + "GI_POTION_RED_BOTTLE", + "GI_BOTTLE", + "GI_POTION_RED", + "GI_POTION_GREEN", + "GI_POTION_BLUE", + "GI_FAIRY", + "GI_DEKU_PRINCESS", + "GI_MILK_BOTTLE", + "GI_MILK_HALF", + "GI_FISH", + "GI_BUG", + "GI_BLUE_FIRE", + "GI_POE", + "GI_BIG_POE", + "GI_SPRING_WATER", + "GI_HOT_SPRING_WATER", + "GI_ZORA_EGG", + "GI_GOLD_DUST", + "GI_MUSHROOM", + "GI_6C", + "GI_6D", + "GI_SEAHORSE", + "GI_CHATEAU_BOTTLE", + "GI_HYLIAN_LOACH", + None, + None, + None, + None, + "GI_75", + "GI_ICE_TRAP", + None, + "GI_MASK_DEKU", + "GI_MASK_GORON", + "GI_MASK_ZORA", + "GI_MASK_FIERCE_DEITY", + "GI_MASK_CAPTAIN", + "GI_MASK_GIANT", + "GI_MASK_ALL_NIGHT", + "GI_MASK_BUNNY", + "GI_MASK_KEATON", + "GI_MASK_GARO", + "GI_MASK_ROMANI", + "GI_MASK_CIRCUS_LEADER", + "GI_MASK_POSTMAN", + "GI_MASK_COUPLE", + "GI_MASK_GREAT_FAIRY", + "GI_MASK_GIBDO", + "GI_MASK_DON_GERO", + "GI_MASK_KAMARO", + "GI_MASK_TRUTH", + "GI_MASK_STONE", + "GI_MASK_BREMEN", + "GI_MASK_BLAST", + "GI_MASK_SCENTS", + "GI_MASK_KAFEIS_MASK", + "GI_90", + "GI_CHATEAU", + "GI_MILK", + "GI_GOLD_DUST_2", + "GI_HYLIAN_LOACH_2", + "GI_SEAHORSE_CAUGHT", + "GI_MOON_TEAR", + "GI_DEED_LAND", + "GI_DEED_SWAMP", + "GI_DEED_MOUNTAIN", + "GI_DEED_OCEAN", + "GI_SWORD_GREAT_FAIRY_STOLEN", + "GI_SWORD_KOKIRI_STOLEN", + "GI_SWORD_RAZOR_STOLEN", + "GI_SWORD_GILDED_STOLEN", + "GI_SHIELD_HERO_STOLEN", + "GI_ROOM_KEY", + "GI_LETTER_TO_MAMA", + "GI_A2", + "GI_A3", + "GI_A4", + "GI_A5", + "GI_A6", + "GI_A7", + "GI_A8", + "GI_BOTTLE_STOLEN", + "GI_LETTER_TO_KAFEI", + "GI_PENDANT_OF_MEMORIES", + "GI_TINGLE_MAP_CLOCK_TOWN", + "GI_TINGLE_MAP_WOODFALL", + "GI_TINGLE_MAP_SNOWHEAD", + "GI_TINGLE_MAP_ROMANI_RANCH", + "GI_TINGLE_MAP_GREAT_BAY", + "GI_TINGLE_MAP_STONE_TOWER", + "GI_MAX", +) + +notebook_event = ( + "BOMBERS_NOTEBOOK_EVENT_MET_BOMBERS", + "BOMBERS_NOTEBOOK_EVENT_MET_ANJU", + "BOMBERS_NOTEBOOK_EVENT_MET_KAFEI", + "BOMBERS_NOTEBOOK_EVENT_MET_CURIOSITY_SHOP_MAN", + "BOMBERS_NOTEBOOK_EVENT_MET_BOMB_SHOP_LADY", + "BOMBERS_NOTEBOOK_EVENT_MET_ROMANI", + "BOMBERS_NOTEBOOK_EVENT_MET_CREMIA", + "BOMBERS_NOTEBOOK_EVENT_MET_MAYOR_DOTOUR", + "BOMBERS_NOTEBOOK_EVENT_MET_MADAME_AROMA", + "BOMBERS_NOTEBOOK_EVENT_MET_TOTO", + "BOMBERS_NOTEBOOK_EVENT_MET_GORMAN", + "BOMBERS_NOTEBOOK_EVENT_MET_POSTMAN", + "BOMBERS_NOTEBOOK_EVENT_MET_ROSA_SISTERS", + "BOMBERS_NOTEBOOK_EVENT_MET_TOLIET_HAND", + "BOMBERS_NOTEBOOK_EVENT_MET_ANJUS_GRANDMOTHER", + "BOMBERS_NOTEBOOK_EVENT_MET_KAMARO", + "BOMBERS_NOTEBOOK_EVENT_MET_GROG", + "BOMBERS_NOTEBOOK_EVENT_MET_GORMAN_BROTHERS", + "BOMBERS_NOTEBOOK_EVENT_MET_SHIRO", + "BOMBERS_NOTEBOOK_EVENT_MET_GURU_GURU", + + "BOMBERS_NOTEBOOK_EVENT_RECEIVED_ROOM_KEY", + "BOMBERS_NOTEBOOK_EVENT_PROMISED_MIDNIGHT_MEETING", + "BOMBERS_NOTEBOOK_EVENT_PROMISED_TO_MEET_KAFEI", + "BOMBERS_NOTEBOOK_EVENT_RECEIVED_LETTER_TO_KAFEI", + "BOMBERS_NOTEBOOK_EVENT_DEPOSITED_LETTER_TO_KAFEI", + "BOMBERS_NOTEBOOK_EVENT_RECEIVED_PENDANT_OF_MEMORIES", + "BOMBERS_NOTEBOOK_EVENT_DELIVERED_PENDANT_OF_MEMORIES", + "BOMBERS_NOTEBOOK_EVENT_ESCAPED_SAKONS_HIDEOUT", + "BOMBERS_NOTEBOOK_EVENT_PROMISED_TO_HELP_WITH_THEM", + "BOMBERS_NOTEBOOK_EVENT_DEFENDED_AGAINST_THEM", + "BOMBERS_NOTEBOOK_EVENT_RECEIVED_MILK_BOTTLE", + "BOMBERS_NOTEBOOK_EVENT_ESCORTED_CREMIA", + "BOMBERS_NOTEBOOK_EVENT_RECEIVED_ROMANIS_MASK", + "BOMBERS_NOTEBOOK_EVENT_RECEIVED_KEATON_MASK", + "BOMBERS_NOTEBOOK_EVENT_RECEIVED_PRIORITY_MAIL", + "BOMBERS_NOTEBOOK_EVENT_DELIVERED_PRIORITY_MAIL", + "BOMBERS_NOTEBOOK_EVENT_LEARNED_SECRET_CODE", + "BOMBERS_NOTEBOOK_EVENT_RECEIVED_BOMBERS_NOTEBOOK", + "BOMBERS_NOTEBOOK_EVENT_RECEIVED_MAYOR_HP", + "BOMBERS_NOTEBOOK_EVENT_RECEIVED_ROSA_SISTERS_HP", + "BOMBERS_NOTEBOOK_EVENT_RECEIVED_TOILET_HAND_HP", + "BOMBERS_NOTEBOOK_EVENT_RECEIVED_GRANDMA_SHORT_STORY_HP", + "BOMBERS_NOTEBOOK_EVENT_RECEIVED_GRANDMA_LONG_STORY_HP", + "BOMBERS_NOTEBOOK_EVENT_RECEIVED_POSTMAN_HP", + "BOMBERS_NOTEBOOK_EVENT_RECEIVED_KAFEIS_MASK", + "BOMBERS_NOTEBOOK_EVENT_RECEIVED_ALL_NIGHT_MASK", + "BOMBERS_NOTEBOOK_EVENT_RECEIVED_BUNNY_HOOD", + "BOMBERS_NOTEBOOK_EVENT_RECEIVED_GAROS_MASK", + "BOMBERS_NOTEBOOK_EVENT_RECEIVED_CIRCUS_LEADERS_MASK", + "BOMBERS_NOTEBOOK_EVENT_RECEIVED_POSTMANS_HAT", + "BOMBERS_NOTEBOOK_EVENT_RECEIVED_COUPLES_MASK", + "BOMBERS_NOTEBOOK_EVENT_RECEIVED_BLAST_MASK", + "BOMBERS_NOTEBOOK_EVENT_RECEIVED_KAMAROS_MASK", + "BOMBERS_NOTEBOOK_EVENT_RECEIVED_STONE_MASK", + "BOMBERS_NOTEBOOK_EVENT_RECEIVED_BREMEN_MASK", +) + +mask_names = ( + "PLAYER_MASK_NONE", + "PLAYER_MASK_TRUTH", + "PLAYER_MASK_KAFEIS_MASK", + "PLAYER_MASK_ALL_NIGHT", + "PLAYER_MASK_BUNNY", + "PLAYER_MASK_KEATON", + "PLAYER_MASK_GARO", + "PLAYER_MASK_ROMANI", + "PLAYER_MASK_CIRCUS_LEADER", + "PLAYER_MASK_POSTMAN", + "PLAYER_MASK_COUPLE", + "PLAYER_MASK_GREAT_FAIRY", + "PLAYER_MASK_GIBDO", + "PLAYER_MASK_DON_GERO", + "PLAYER_MASK_KAMARO", + "PLAYER_MASK_CAPTAIN", + "PLAYER_MASK_STONE", + "PLAYER_MASK_BREMEN", + "PLAYER_MASK_BLAST", + "PLAYER_MASK_SCENTS", + "PLAYER_MASK_GIANT", + "PLAYER_MASK_FIERCE_DEITY", + "PLAYER_MASK_GORON", + "PLAYER_MASK_ZORA", + "PLAYER_MASK_DEKU", + "PLAYER_MASK_MAX" +) + +item_action_names = ( + "PLAYER_IA_NONE", + "PLAYER_IA_LAST_USED", + "PLAYER_IA_FISHING_ROD", + "PLAYER_IA_SWORD_KOKIRI", + "PLAYER_IA_SWORD_RAZOR", + "PLAYER_IA_SWORD_GILDED", + "PLAYER_IA_SWORD_TWO_HANDED", + "PLAYER_IA_DEKU_STICK", + "PLAYER_IA_ZORA_FINS", + "PLAYER_IA_BOW", + "PLAYER_IA_BOW_FIRE", + "PLAYER_IA_BOW_ICE", + "PLAYER_IA_BOW_LIGHT", + "PLAYER_IA_HOOKSHOT", + "PLAYER_IA_BOMB", + "PLAYER_IA_POWDER_KEG", + "PLAYER_IA_BOMBCHU", + "PLAYER_IA_11", + "PLAYER_IA_DEKU_NUT", + "PLAYER_IA_PICTOGRAPH_BOX", + "PLAYER_IA_OCARINA", + "PLAYER_IA_BOTTLE_EMPTY", + "PLAYER_IA_BOTTLE_FISH", + "PLAYER_IA_BOTTLE_SPRING_WATER", + "PLAYER_IA_BOTTLE_HOT_SPRING_WATER", + "PLAYER_IA_BOTTLE_ZORA_EGG", + "PLAYER_IA_BOTTLE_DEKU_PRINCESS", + "PLAYER_IA_BOTTLE_GOLD_DUST", + "PLAYER_IA_BOTTLE_1C", + "PLAYER_IA_BOTTLE_SEAHORSE", + "PLAYER_IA_BOTTLE_MUSHROOM", + "PLAYER_IA_BOTTLE_HYLIAN_LOACH", + "PLAYER_IA_BOTTLE_BUG", + "PLAYER_IA_BOTTLE_POE", + "PLAYER_IA_BOTTLE_BIG_POE", + "PLAYER_IA_BOTTLE_POTION_RED", + "PLAYER_IA_BOTTLE_POTION_BLUE", + "PLAYER_IA_BOTTLE_POTION_GREEN", + "PLAYER_IA_BOTTLE_MILK", + "PLAYER_IA_BOTTLE_MILK_HALF", + "PLAYER_IA_BOTTLE_CHATEAU", + "PLAYER_IA_BOTTLE_FAIRY", + "PLAYER_IA_MOONS_TEAR", + "PLAYER_IA_DEED_LAND", + "PLAYER_IA_ROOM_KEY", + "PLAYER_IA_LETTER_TO_KAFEI", + "PLAYER_IA_MAGIC_BEANS", + "PLAYER_IA_DEED_SWAMP", + "PLAYER_IA_DEED_MOUNTAIN", + "PLAYER_IA_DEED_OCEAN", + "PLAYER_IA_32", + "PLAYER_IA_LETTER_MAMA", + "PLAYER_IA_34", + "PLAYER_IA_35", + "PLAYER_IA_PENDANT_OF_MEMORIES", + "PLAYER_IA_37", + "PLAYER_IA_38", + "PLAYER_IA_39", + "PLAYER_IA_MASK_TRUTH", + "PLAYER_IA_MASK_KAFEIS_MASK", + "PLAYER_IA_MASK_ALL_NIGHT", + "PLAYER_IA_MASK_BUNNY", + "PLAYER_IA_MASK_KEATON", + "PLAYER_IA_MASK_GARO", + "PLAYER_IA_MASK_ROMANI", + "PLAYER_IA_MASK_CIRCUS_LEADER", + "PLAYER_IA_MASK_POSTMAN", + "PLAYER_IA_MASK_COUPLE", + "PLAYER_IA_MASK_GREAT_FAIRY", + "PLAYER_IA_MASK_GIBDO", + "PLAYER_IA_MASK_DON_GERO", + "PLAYER_IA_MASK_KAMARO", + "PLAYER_IA_MASK_CAPTAIN", + "PLAYER_IA_MASK_STONE", + "PLAYER_IA_MASK_BREMEN", + "PLAYER_IA_MASK_BLAST", + "PLAYER_IA_MASK_SCENTS", + "PLAYER_IA_MASK_GIANT", + "PLAYER_IA_MASK_FIERCE_DEITY", + "PLAYER_IA_MASK_GORON", + "PLAYER_IA_MASK_ZORA", + "PLAYER_IA_MASK_DEKU", + "PLAYER_IA_MASK_MAX", + "PLAYER_IA_LENS_OF_TRUTH", + "PLAYER_IA_MAX" +) + +def getFlagMacro(flag) -> str: + index = flag >> 8 + mask = flag & 0xFF + return f"EVENTINF_{index}{int(math.log2(mask))}" + +def read_bytes(data_file, offset, len): + with open(data_file,"rb") as infile: + infile.seek(offset) + return bytearray(infile.read(len)) + +def disassemble_msg_script(data_file, script_start, offset, length): + out = "" + cmd = None + branch_targets = [] + + # Keep trying to disassemble until it hits the terminator and no commands branch past it + while any([branch >= offset for branch in branch_targets]) or cmd != 0x10: + # print(offset) + cmd = read_bytes(data_file, script_start + offset, 1)[0] + # print(cmd) + + cmd_name = cmd_info[cmd][0] + cmd_len = cmd_info[cmd][1] + cmd_args = cmd_info[cmd][3] + + is_branch = False + + args_formatted = [] + if len(cmd_args) > 1: # handle args + raw_args = read_bytes(data_file, script_start + offset + 1, cmd_len - 1) + arg_values = struct.unpack(cmd_args, raw_args) + + # print(len(raw_args) + 1, f"0x{cmd:02X}", [f"0x{b:02X}" for b in raw_args]) + + for i,(arg_value,arg_type) in enumerate(zip(arg_values, cmd_args[1:]),0): + arg_formatted = "" + + if cmd == 0 and i == 0: + arg_formatted = week_event_reg[arg_value] + assert arg_formatted is not None + elif cmd == 6 and i == 0: + arg_formatted = gi_names[arg_value] + assert arg_formatted is not None + elif cmd == 8 and i == 0: + arg_formatted = f'{arg_value}' + assert arg_formatted is not None + elif cmd == 17 and i == 0: + arg_formatted = week_event_reg[arg_value] + assert arg_formatted is not None + elif cmd == 20 and i == 0: + if arg_value & 0x8000: # Value is negative take twos compliment + arg_formatted = f'{arg_value - 0x10000}' + else: + arg_formatted = f'{arg_value}' + assert arg_formatted is not None + elif cmd == 27 and i == 0: + arg_formatted = getFlagMacro(arg_value) + assert arg_formatted is not None + elif cmd == 28 and i == 0: + arg_formatted = getFlagMacro(arg_value) + assert arg_formatted is not None + elif cmd == 29 and i == 0: + arg_formatted = getFlagMacro(arg_value) + assert arg_formatted is not None + elif cmd == 30 and i == 0: + arg_formatted = item_action_names[arg_value] + assert arg_formatted is not None + elif cmd == 32 and i == 0: + arg_formatted = mask_names[arg_value] + assert arg_formatted is not None + elif cmd == 34 and (i == 0 or i == 1): + arg_formatted = f'{arg_value}' + assert arg_formatted is not None + elif cmd == 37 and i == 0: + arg_formatted = item_names[arg_value] + assert arg_formatted is not None + elif cmd == 39 and i == 0: + arg_formatted = f'{arg_value}' + assert arg_formatted is not None + elif cmd == 42 and i == 0: + arg_formatted = item_names[arg_value] + assert arg_formatted is not None + elif cmd == 45 and i == 0: + arg_formatted = notebook_event[arg_value] + assert arg_formatted is not None + else: + if arg_type == "h": + arg_formatted = f"{arg_value:#x}" + elif arg_type == "H": + arg_formatted = f"0x{arg_value:04X}" + elif arg_type == "B": + arg_formatted = f"0x{arg_value:02X}" + + if i in cmd_info[cmd][4]: # skip argument indices + # add skip args to branch targets, and change the output to absolute differences rather than relative offsets + arg_value += cmd_len + + is_branch = True + branch_pos = offset + cmd_len + branch_target = offset + arg_value + + branch_targets.append(branch_target) + + if arg_value == cmd_len: + arg_formatted == "0" + else: + arg_formatted = f"0x{branch_target:04X} - 0x{branch_pos:04X}" + args_formatted.append(arg_formatted) + # else: + # print(1, f"0x{cmd:02X}") + + args = ", ".join(args_formatted) if len(args_formatted) != 0 else "" + + line = f" /* 0x{offset:04X} 0x{cmd_len:02X} */ {cmd_name}({args}),{f' // {cmd_info[cmd][2]}' if cmd_info[cmd][2] != '' else ''}\n" + out += line + + if cmd == 0x10 or is_branch and branch_target < branch_pos: # maybe + out += "\n" + + offset += cmd_len + + if is_branch and branch_target < branch_pos: + # branch backwards, terminate if nothing branches past here + # TODO if the branch is conditional we should not be terminating here + if not any([branch >= offset for branch in branch_targets]): + break + + length -= offset + + if length > 0: + if length < 4 and all([b == 0 for b in read_bytes(data_file, script_start + offset, length)]): + # padding + pass + else: + # some data left over, try and disassemble it + out += " // Unreachable\n" + out += disassemble_msg_script(data_file, script_start, offset, length) + + return out + +def main(): + parser = argparse.ArgumentParser(description="Disassembles MM behavior scripts") + parser.add_argument('address', help="VRAM or ROM address to disassemble at", type=lambda s : int(s.replace("D_", "0x"), 16)) + parser.add_argument('length', help="Number of bytes to disassemble, by default it will disassemble all reachable commands", nargs='?', default=-1, type=int) + parser.add_argument('--name', help="Array name", default="sMsgScript", type=str) + args = parser.parse_args() + + file_result = resolve_symbol(args.address) + + if file_result[0] is None: + print("Invalid address") + return + + print(hex(file_result[1]), "in", file_result[0].split(os.sep)[-1]) + + print(f"MsgScript {args.name}[] = {{") + print(disassemble_msg_script(file_result[0], file_result[1], 0, args.length).rstrip()) + print("};") + +if __name__ == "__main__": + main() diff --git a/tools/overlayhelpers/scheduledis.py b/tools/overlayhelpers/scheduledis.py index c80448b0cd..30a15c2e86 100755 --- a/tools/overlayhelpers/scheduledis.py +++ b/tools/overlayhelpers/scheduledis.py @@ -7,8 +7,8 @@ import argparse, os, struct, math from actor_symbols import resolve_symbol cmd_info = [ - ('SCHEDULE_CMD_CHECK_FLAG_S', 0x04, '>Hb', (1, )), - ('SCHEDULE_CMD_CHECK_FLAG_L', 0x05, '>Hh', (1, )), + ('SCHEDULE_CMD_CHECK_WEEK_EVENT_REG_S', 0x04, '>Hb', (1, )), + ('SCHEDULE_CMD_CHECK_WEEK_EVENT_REG_L', 0x05, '>Hh', (1, )), ('SCHEDULE_CMD_CHECK_TIME_RANGE_S', 0x06, '>BBBBb', (4, )), ('SCHEDULE_CMD_CHECK_TIME_RANGE_L', 0x07, '>BBBBh', (4, )), ('SCHEDULE_CMD_RET_VAL_L', 0x03, '>H', ( )), diff --git a/tools/sizes/code_functions.csv b/tools/sizes/code_functions.csv index 8b21b5f147..c6cd916cd1 100644 --- a/tools/sizes/code_functions.csv +++ b/tools/sizes/code_functions.csv @@ -1523,58 +1523,58 @@ asm/non_matchings/code/z_map_exp/Map_Destroy.s,Map_Destroy,0x8010A410,0x8 asm/non_matchings/code/z_map_exp/Map_Init.s,Map_Init,0x8010A430,0x47 asm/non_matchings/code/z_map_exp/Minimap_Draw.s,Minimap_Draw,0x8010A54C,0xD asm/non_matchings/code/z_map_exp/Map_Update.s,Map_Update,0x8010A580,0x78 -asm/non_matchings/code/z_msgevent/func_8010A760.s,func_8010A760,0x8010A760,0x1B -asm/non_matchings/code/z_msgevent/func_8010A7CC.s,func_8010A7CC,0x8010A7CC,0x12 -asm/non_matchings/code/z_msgevent/func_8010A814.s,func_8010A814,0x8010A814,0x12 -asm/non_matchings/code/z_msgevent/func_8010A85C.s,func_8010A85C,0x8010A85C,0x12 -asm/non_matchings/code/z_msgevent/func_8010A8A4.s,func_8010A8A4,0x8010A8A4,0x12 -asm/non_matchings/code/z_msgevent/func_8010A8EC.s,func_8010A8EC,0x8010A8EC,0x29 -asm/non_matchings/code/z_msgevent/func_8010A990.s,func_8010A990,0x8010A990,0x31 -asm/non_matchings/code/z_msgevent/func_8010AA54.s,func_8010AA54,0x8010AA54,0x37 -asm/non_matchings/code/z_msgevent/func_8010AB30.s,func_8010AB30,0x8010AB30,0x19 -asm/non_matchings/code/z_msgevent/func_8010AB94.s,func_8010AB94,0x8010AB94,0x1B -asm/non_matchings/code/z_msgevent/func_8010AC00.s,func_8010AC00,0x8010AC00,0x49 -asm/non_matchings/code/z_msgevent/func_8010AD24.s,func_8010AD24,0x8010AD24,0x2C -asm/non_matchings/code/z_msgevent/func_8010ADD4.s,func_8010ADD4,0x8010ADD4,0x1D -asm/non_matchings/code/z_msgevent/func_8010AE48.s,func_8010AE48,0x8010AE48,0x21 -asm/non_matchings/code/z_msgevent/func_8010AECC.s,func_8010AECC,0x8010AECC,0x15 -asm/non_matchings/code/z_msgevent/func_8010AF20.s,func_8010AF20,0x8010AF20,0x13 -asm/non_matchings/code/z_msgevent/func_8010AF6C.s,func_8010AF6C,0x8010AF6C,0xA -asm/non_matchings/code/z_msgevent/func_8010AF94.s,func_8010AF94,0x8010AF94,0x13 -asm/non_matchings/code/z_msgevent/func_8010AFE0.s,func_8010AFE0,0x8010AFE0,0xC -asm/non_matchings/code/z_msgevent/func_8010B010.s,func_8010B010,0x8010B010,0x17 -asm/non_matchings/code/z_msgevent/func_8010B06C.s,func_8010B06C,0x8010B06C,0x12 -asm/non_matchings/code/z_msgevent/func_8010B0B4.s,func_8010B0B4,0x8010B0B4,0xA -asm/non_matchings/code/z_msgevent/func_8010B0DC.s,func_8010B0DC,0x8010B0DC,0xB -asm/non_matchings/code/z_msgevent/func_8010B108.s,func_8010B108,0x8010B108,0xE -asm/non_matchings/code/z_msgevent/func_8010B140.s,func_8010B140,0x8010B140,0x10 -asm/non_matchings/code/z_msgevent/func_8010B180.s,func_8010B180,0x8010B180,0xF -asm/non_matchings/code/z_msgevent/func_8010B1BC.s,func_8010B1BC,0x8010B1BC,0x1C -asm/non_matchings/code/z_msgevent/func_8010B22C.s,func_8010B22C,0x8010B22C,0x16 -asm/non_matchings/code/z_msgevent/func_8010B284.s,func_8010B284,0x8010B284,0xF -asm/non_matchings/code/z_msgevent/func_8010B2C0.s,func_8010B2C0,0x8010B2C0,0x10 -asm/non_matchings/code/z_msgevent/func_8010B300.s,func_8010B300,0x8010B300,0x4D -asm/non_matchings/code/z_msgevent/func_8010B434.s,func_8010B434,0x8010B434,0x1C -asm/non_matchings/code/z_msgevent/func_8010B4A4.s,func_8010B4A4,0x8010B4A4,0x1F -asm/non_matchings/code/z_msgevent/func_8010B520.s,func_8010B520,0x8010B520,0x51 -asm/non_matchings/code/z_msgevent/func_8010B664.s,func_8010B664,0x8010B664,0x51 -asm/non_matchings/code/z_msgevent/func_8010B7A8.s,func_8010B7A8,0x8010B7A8,0x20 -asm/non_matchings/code/z_msgevent/func_8010B828.s,func_8010B828,0x8010B828,0x14 -asm/non_matchings/code/z_msgevent/func_8010B878.s,func_8010B878,0x8010B878,0x1B -asm/non_matchings/code/z_msgevent/func_8010B8E4.s,func_8010B8E4,0x8010B8E4,0x8A -asm/non_matchings/code/z_msgevent/func_8010BB0C.s,func_8010BB0C,0x8010BB0C,0x18 -asm/non_matchings/code/z_msgevent/func_8010BB6C.s,func_8010BB6C,0x8010BB6C,0x18 -asm/non_matchings/code/z_msgevent/func_8010BBCC.s,func_8010BBCC,0x8010BBCC,0x17 -asm/non_matchings/code/z_msgevent/func_8010BC28.s,func_8010BC28,0x8010BC28,0x15 -asm/non_matchings/code/z_msgevent/func_8010BC7C.s,func_8010BC7C,0x8010BC7C,0x33 -asm/non_matchings/code/z_msgevent/func_8010BD48.s,func_8010BD48,0x8010BD48,0x12 -asm/non_matchings/code/z_msgevent/func_8010BD90.s,func_8010BD90,0x8010BD90,0x13 -asm/non_matchings/code/z_msgevent/func_8010BDDC.s,func_8010BDDC,0x8010BDDC,0x27 -asm/non_matchings/code/z_msgevent/func_8010BE78.s,func_8010BE78,0x8010BE78,0x11 -asm/non_matchings/code/z_msgevent/func_8010BEBC.s,func_8010BEBC,0x8010BEBC,0xD -asm/non_matchings/code/z_msgevent/func_8010BEF0.s,func_8010BEF0,0x8010BEF0,0xD -asm/non_matchings/code/z_msgevent/func_8010BF24.s,func_8010BF24,0x8010BF24,0xD -asm/non_matchings/code/z_msgevent/func_8010BF58.s,func_8010BF58,0x8010BF58,0x5A +asm/non_matchings/code/z_msgevent/MsgEvent_CheckWeekEventReg.s,MsgEvent_CheckWeekEventReg,0x8010A760,0x1B +asm/non_matchings/code/z_msgevent/MsgEvent_CheckGoron.s,MsgEvent_CheckGoron,0x8010A7CC,0x12 +asm/non_matchings/code/z_msgevent/MsgEvent_CheckZora.s,MsgEvent_CheckZora,0x8010A814,0x12 +asm/non_matchings/code/z_msgevent/MsgEvent_CheckDeku.s,MsgEvent_CheckDeku,0x8010A85C,0x12 +asm/non_matchings/code/z_msgevent/MsgEvent_CheckHuman.s,MsgEvent_CheckHuman,0x8010A8A4,0x12 +asm/non_matchings/code/z_msgevent/MsgEvent_CheckTextChoice.s,MsgEvent_CheckTextChoice,0x8010A8EC,0x29 +asm/non_matchings/code/z_msgevent/MsgEvent_OfferItem.s,MsgEvent_OfferItem,0x8010A990,0x31 +asm/non_matchings/code/z_msgevent/MsgEvent_Autotalk.s,MsgEvent_Autotalk,0x8010AA54,0x37 +asm/non_matchings/code/z_msgevent/MsgEvent_CheckRupees.s,MsgEvent_CheckRupees,0x8010AB30,0x19 +asm/non_matchings/code/z_msgevent/MsgEvent_CheckCallback.s,MsgEvent_CheckCallback,0x8010AB94,0x1B +asm/non_matchings/code/z_msgevent/MsgEvent_CheckDay.s,MsgEvent_CheckDay,0x8010AC00,0x49 +asm/non_matchings/code/z_msgevent/MsgEvent_AwaitTextJump.s,MsgEvent_AwaitTextJump,0x8010AD24,0x2C +asm/non_matchings/code/z_msgevent/MsgEvent_AwaitText.s,MsgEvent_AwaitText,0x8010ADD4,0x1D +asm/non_matchings/code/z_msgevent/MsgEvent_AwaitTextEnd.s,MsgEvent_AwaitTextEnd,0x8010AE48,0x21 +asm/non_matchings/code/z_msgevent/MsgEvent_BeginText.s,MsgEvent_BeginText,0x8010AECC,0x15 +asm/non_matchings/code/z_msgevent/MsgEvent_ContinueText.s,MsgEvent_ContinueText,0x8010AF20,0x13 +asm/non_matchings/code/z_msgevent/MsgEvent_Done.s,MsgEvent_Done,0x8010AF6C,0xA +asm/non_matchings/code/z_msgevent/MsgEvent_SetWeekEventReg.s,MsgEvent_SetWeekEventReg,0x8010AF94,0x13 +asm/non_matchings/code/z_msgevent/MsgEvent_CloseText.s,MsgEvent_CloseText,0x8010AFE0,0xC +asm/non_matchings/code/z_msgevent/MsgEvent_SetCollectible.s,MsgEvent_SetCollectible,0x8010B010,0x17 +asm/non_matchings/code/z_msgevent/MsgEvent_ChangeRupees.s,MsgEvent_ChangeRupees,0x8010B06C,0x12 +asm/non_matchings/code/z_msgevent/MsgEvent_Pause.s,MsgEvent_Pause,0x8010B0B4,0xA +asm/non_matchings/code/z_msgevent/MsgEvent_UnsetAutotalk.s,MsgEvent_UnsetAutotalk,0x8010B0DC,0xB +asm/non_matchings/code/z_msgevent/MsgEvent_FocusToChild.s,MsgEvent_FocusToChild,0x8010B108,0xE +asm/non_matchings/code/z_msgevent/MsgEvent_FocusToSelf.s,MsgEvent_FocusToSelf,0x8010B140,0x10 +asm/non_matchings/code/z_msgevent/MsgEvent_Jump.s,MsgEvent_Jump,0x8010B180,0xF +asm/non_matchings/code/z_msgevent/MsgEvent_CheckQuestItem.s,MsgEvent_CheckQuestItem,0x8010B1BC,0x1C +asm/non_matchings/code/z_msgevent/MsgEvent_CheckEventInf.s,MsgEvent_CheckEventInf,0x8010B22C,0x16 +asm/non_matchings/code/z_msgevent/MsgEvent_SetEventInf.s,MsgEvent_SetEventInf,0x8010B284,0xF +asm/non_matchings/code/z_msgevent/MsgEvent_UnsetEventInf.s,MsgEvent_UnsetEventInf,0x8010B2C0,0x10 +asm/non_matchings/code/z_msgevent/MsgEvent_CheckItemAction.s,MsgEvent_CheckItemAction,0x8010B300,0x4D +asm/non_matchings/code/z_msgevent/MsgEvent_CheckHasSong.s,MsgEvent_CheckHasSong,0x8010B434,0x1C +asm/non_matchings/code/z_msgevent/MsgEvent_CheckWornMask.s,MsgEvent_CheckWornMask,0x8010B4A4,0x1F +asm/non_matchings/code/z_msgevent/MsgEvent_CheckAfterTime.s,MsgEvent_CheckAfterTime,0x8010B520,0x51 +asm/non_matchings/code/z_msgevent/MsgEvent_CheckBeforeTime.s,MsgEvent_CheckBeforeTime,0x8010B664,0x51 +asm/non_matchings/code/z_msgevent/MsgEvent_CheckSwitchFlag.s,MsgEvent_CheckSwitchFlag,0x8010B7A8,0x20 +asm/non_matchings/code/z_msgevent/MsgEvent_SetSwitchFlag.s,MsgEvent_SetSwitchFlag,0x8010B828,0x14 +asm/non_matchings/code/z_msgevent/MsgEvent_CheckItem.s,MsgEvent_CheckItem,0x8010B878,0x1B +asm/non_matchings/code/z_msgevent/MsgEvent_CheckBetweenTime.s,MsgEvent_CheckBetweenTime,0x8010B8E4,0x8A +asm/non_matchings/code/z_msgevent/MsgEvent_CheckOnDay.s,MsgEvent_CheckOnDay,0x8010BB0C,0x18 +asm/non_matchings/code/z_msgevent/MsgEvent_CheckCallbackContinue.s,MsgEvent_CheckCallbackContinue,0x8010BB6C,0x18 +asm/non_matchings/code/z_msgevent/MsgEvent_CheckHasPowderKeg.s,MsgEvent_CheckHasPowderKeg,0x8010BBCC,0x17 +asm/non_matchings/code/z_msgevent/MsgEvent_DeleteItem.s,MsgEvent_DeleteItem,0x8010BC28,0x15 +asm/non_matchings/code/z_msgevent/MsgEvent_CheckCallbackMulti.s,MsgEvent_CheckCallbackMulti,0x8010BC7C,0x33 +asm/non_matchings/code/z_msgevent/MsgEvent_PlayerTalk.s,MsgEvent_PlayerTalk,0x8010BD48,0x12 +asm/non_matchings/code/z_msgevent/MsgEvent_NotebookEvent.s,MsgEvent_NotebookEvent,0x8010BD90,0x13 +asm/non_matchings/code/z_msgevent/MsgEvent_AwaitTextDone.s,MsgEvent_AwaitTextDone,0x8010BDDC,0x27 +asm/non_matchings/code/z_msgevent/MsgEvent_Jump3.s,MsgEvent_Jump3,0x8010BE78,0x11 +asm/non_matchings/code/z_msgevent/MsgEvent_PlayDecide.s,MsgEvent_PlayDecide,0x8010BEBC,0xD +asm/non_matchings/code/z_msgevent/MsgEvent_PlayCancel.s,MsgEvent_PlayCancel,0x8010BEF0,0xD +asm/non_matchings/code/z_msgevent/MsgEvent_PlayError.s,MsgEvent_PlayError,0x8010BF24,0xD +asm/non_matchings/code/z_msgevent/MsgEvent_RunScript.s,MsgEvent_RunScript,0x8010BF58,0x5A asm/non_matchings/code/z_nmi_buff/Nmi_Init.s,Nmi_Init,0x8010C0C0,0x29 asm/non_matchings/code/z_nmi_buff/Nmi_SetPrenmiStart.s,Nmi_SetPrenmiStart,0x8010C164,0xE asm/non_matchings/code/z_nmi_buff/Nmi_GetPrenmiHasStarted.s,Nmi_GetPrenmiHasStarted,0x8010C19C,0x5 diff --git a/tools/weekeventregconvert.py b/tools/weekeventregconvert.py index 6a7d3b4d6a..e975f48120 100755 --- a/tools/weekeventregconvert.py +++ b/tools/weekeventregconvert.py @@ -140,7 +140,7 @@ weekEventReg = { (16 << 8) | 0x20: "WEEKEVENTREG_16_20", (16 << 8) | 0x40: "WEEKEVENTREG_16_40", (16 << 8) | 0x80: "WEEKEVENTREG_16_80", - (17 << 8) | 0x01: "WEEKEVENTREG_TALKED_EMPTY_BOAT_CRUISE", + (17 << 8) | 0x01: "WEEKEVENTREG_TALKED_KOUME_KIOSK_EMPTY", (17 << 8) | 0x02: "WEEKEVENTREG_17_02", (17 << 8) | 0x04: "WEEKEVENTREG_17_04", (17 << 8) | 0x08: "WEEKEVENTREG_17_08",