From 4c5dede891ea0934d77bfcee8f50f9702c949031 Mon Sep 17 00:00:00 2001 From: robojumper Date: Fri, 9 May 2025 18:28:45 +0200 Subject: [PATCH] d_message OK (via dFlow_c) --- config/SOUE01/splits.txt | 3 + config/SOUE01/symbols.txt | 286 ++-- configure.py | 2 +- include/d/a/d_a_item.h | 7 + include/d/a/d_a_player.h | 3 +- include/d/a/obj/d_a_obj_toD3_stone_figure.h | 2 +- include/d/d_camera.h | 7 + include/d/d_message.h | 249 +++- include/d/d_player.h | 3 + include/d/d_pouch.h | 11 + include/d/d_sc_game.h | 2 +- include/d/d_stage.h | 4 +- include/d/d_stage_mgr.h | 1 + include/d/d_tag_processor.h | 13 + include/d/lyt/d_lyt_control_game.h | 3 + include/d/lyt/d_lyt_demo_dowsing.h | 39 + include/d/lyt/d_lyt_map.h | 5 + include/d/lyt/d_lyt_mini_game.h | 25 + include/d/lyt/meter/d_lyt_meter.h | 22 + include/d/lyt/meter/d_lyt_meter_rupy.h | 4 + include/d/lyt/msg_window/d_lyt_msg_window.h | 21 +- include/libms/flowfile.h | 6 +- include/rvl/OS.h | 3 +- include/sized_string.h | 7 + include/toBeSorted/blur_and_palette_manager.h | 2 + include/toBeSorted/fi_context.h | 141 ++ include/toBeSorted/global_fi_context.h | 17 - include/toBeSorted/music_mgrs.h | 5 + include/toBeSorted/unk_save_time.h | 27 + src/REL/d/t/d_t_reaction.cpp | 2 +- src/d/a/obj/d_a_obj_tbox.cpp | 6 +- src/d/d_message.cpp | 1263 ++++++++++++++++- src/d/d_sc_game.cpp | 11 +- src/d/d_sc_title.cpp | 7 +- src/d/lyt/d_lyt_demo_dowsing.cpp | 9 + src/d/lyt/meter/d_lyt_meter.cpp | 4 +- src/d/lyt/meter/d_lyt_meter_rupy.cpp | 18 +- src/d/lyt/msg_window/d_lyt_msg_window.cpp | 14 +- src/toBeSorted/special_item_drop_mgr.cpp | 3 +- 39 files changed, 2038 insertions(+), 219 deletions(-) create mode 100644 include/d/lyt/d_lyt_demo_dowsing.h create mode 100644 include/d/lyt/d_lyt_mini_game.h create mode 100644 include/toBeSorted/fi_context.h delete mode 100644 include/toBeSorted/global_fi_context.h create mode 100644 include/toBeSorted/unk_save_time.h create mode 100644 src/d/lyt/d_lyt_demo_dowsing.cpp diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index bc6975be..347de295 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -1086,9 +1086,11 @@ d/tg/d_t_weather.cpp: d/d_message.cpp: .text start:0x801AF7E0 end:0x801B329C align:16 .ctors start:0x804DB808 end:0x804DB80C + .rodata start:0x804EA950 end:0x804EAB60 .data start:0x8052C858 end:0x8052DF40 .sdata start:0x80573248 end:0x80573290 .sbss start:0x80575740 end:0x80575760 + .sdata2 start:0x8057B4D8 end:0x8057B4E8 .bss start:0x805B29E0 end:0x805B36E0 d/d_stage.cpp: @@ -1288,6 +1290,7 @@ d/lyt/d_lyt_boss_caption.cpp: d/lyt/d_lyt_demo_dowsing.cpp: .text start:0x802A0B10 end:0x802A17C8 align:16 .ctors start:0x804DB880 end:0x804DB884 + .data start:0x8053BD00 end:0x8053BF50 d/lyt/d_lyt_shop.cpp: .text start:0x802A17D0 end:0x802A7FD8 align:16 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index c723d6c4..1a8cc182 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -840,7 +840,7 @@ __ct__3SpfFv = .text:0x80024010; // type:function size:0x114 __ct__6SffSubFv = .text:0x80024130; // type:function size:0xC __dt__6SffSubFv = .text:0x80024140; // type:function size:0x40 __dt__3SpfFv = .text:0x80024180; // type:function size:0xBC -fn_80024240 = .text:0x80024240; // type:function size:0xF8 +fn_80024240__21BlurAndPaletteManagerFsss = .text:0x80024240; // type:function size:0xF8 fn_80024340 = .text:0x80024340; // type:function size:0x10 BlurAndPaletteMgr__setMist = .text:0x80024350; // type:function size:0x18 fn_80024370 = .text:0x80024370; // type:function size:0x58 @@ -1430,7 +1430,7 @@ fn_80038540 = .text:0x80038540; // type:function size:0x108 fn_80038650 = .text:0x80038650; // type:function size:0x144 fn_800387A0 = .text:0x800387A0; // type:function size:0x50 getCurrentActorEventFlowManager = .text:0x800387F0; // type:function size:0x50 -fn_80038840 = .text:0x80038840; // type:function size:0x8 +vt_0x38__7dFlow_cCFv = .text:0x80038840; // type:function size:0x8 fn_80038850 = .text:0x80038850; // type:function size:0x94 fn_800388F0 = .text:0x800388F0; // type:function size:0xD4 fn_800389D0 = .text:0x800389D0; // type:function size:0x90 @@ -2489,7 +2489,7 @@ getCurrentSwordType = .text:0x8005C060; // type:function size:0xAC updateCurrentSword = .text:0x8005C110; // type:function size:0x24 doesPlayerHaveSword = .text:0x8005C140; // type:function size:0x1C getSwordName = .text:0x8005C160; // type:function size:0x14 -getCurrentlyEquippedShieldType = .text:0x8005C180; // type:function size:0x44 +getCurrentlyEquippedShieldType__7dAcPy_cFv = .text:0x8005C180; // type:function size:0x44 getCurrentSlingshotType__7dAcPy_cFv = .text:0x8005C1D0; // type:function size:0x48 getCurrentBugNetType__7dAcPy_cFv = .text:0x8005C220; // type:function size:0x48 getCurrentBeetleType__7dAcPy_cFv = .text:0x8005C270; // type:function size:0x78 @@ -2500,7 +2500,7 @@ isInBossRushMinigameState = .text:0x8005C420; // type:function size:0x8 isItemRestrictedByBokoBase__7dAcPy_cF7ITEM_ID = .text:0x8005C430; // type:function size:0xB8 isItemRestricted = .text:0x8005C4F0; // type:function size:0xE0 fn_8005C5D0 = .text:0x8005C5D0; // type:function size:0x34 -getLinkPtr2 = .text:0x8005C610; // type:function size:0x8 +getLinkPtr__Fv = .text:0x8005C610; // type:function size:0x8 fn_8005C620 = .text:0x8005C620; // type:function size:0x8 fn_8005C630 = .text:0x8005C630; // type:function size:0x8 fn_8005C640 = .text:0x8005C640; // type:function size:0x8 @@ -4279,7 +4279,7 @@ fn_800C3DA0 = .text:0x800C3DA0; // type:function size:0xB4 fn_800C3E60 = .text:0x800C3E60; // type:function size:0x2C fn_800C3E90 = .text:0x800C3E90; // type:function size:0x24 ActorEventFlowManagerRelated__checkEventFinished = .text:0x800C3EC0; // type:function size:0x20C -fn_800C40D0 = .text:0x800C40D0; // type:function size:0x4 +vt_0x34__11dFlowBase_cFv = .text:0x800C40D0; // type:function size:0x4 fn_800C40E0 = .text:0x800C40E0; // type:function size:0xC fn_800C40F0 = .text:0x800C40F0; // type:function size:0xB4 fn_800C41B0 = .text:0x800C41B0; // type:function size:0xBC @@ -6831,8 +6831,8 @@ fn_80117380 = .text:0x80117380; // type:function size:0xC fn_80117390__15dLytMsgWindow_cCFb = .text:0x80117390; // type:function size:0x54 setCurrentEntrypointName__15dLytMsgWindow_cFPCc = .text:0x801173F0; // type:function size:0xB4 setCurrentFlowFilename__15dLytMsgWindow_cFPCc = .text:0x801174B0; // type:function size:0xB4 -LytMsgWindow__setNumericArg0 = .text:0x80117570; // type:function size:0x8 -LytMsgWindow__setNumericArgs = .text:0x80117580; // type:function size:0x8 +setNumericArg0__15dLytMsgWindow_cFl = .text:0x80117570; // type:function size:0x8 +setNumericArgs__15dLytMsgWindow_cFPll = .text:0x80117580; // type:function size:0x8 createSubMsgManager__15dLytMsgWindow_cFUc = .text:0x80117590; // type:function size:0x260 __ct__19dLytMsgWindowWood_cFv = .text:0x801177F0; // type:function size:0x184 __dt__32sFState_c<19dLytMsgWindowWood_c>Fv = .text:0x80117980; // type:function size:0x58 @@ -7835,7 +7835,7 @@ isOpenMaybe__13dLytMapMain_cCFv = .text:0x80139090; // type:function size:0x478 fn_80139510 = .text:0x80139510; // type:function size:0xA8 fn_801395C0 = .text:0x801395C0; // type:function size:0x64 fn_80139630 = .text:0x80139630; // type:function size:0x4C -fn_80139680 = .text:0x80139680; // type:function size:0x14 +lightPillarRelated__13dLytMapMain_cFlll = .text:0x80139680; // type:function size:0x14 fn_801396A0 = .text:0x801396A0; // type:function size:0xA4 fn_80139750 = .text:0x80139750; // type:function size:0x5E8 fn_80139D40 = .text:0x80139D40; // type:function size:0x15C @@ -9327,31 +9327,31 @@ fn_8016BA00 = .text:0x8016BA00; // type:function size:0x30 LytCursorStick__initStates = .text:0x8016BA30; // type:function size:0x1C0 LytCursorStick__dtor = .text:0x8016BBF0; // type:function size:0x58 fn_8016BC50 = .text:0x8016BC50; // type:function size:0x88 -fn_8016BCE0 = .text:0x8016BCE0; // type:function size:0x14 -FiHelpEntry__getAreaIndexForFiAreaName = .text:0x8016BD00; // type:function size:0x44 +isValid__16FiAnalysisHandleCFv = .text:0x8016BCE0; // type:function size:0x14 +getAreaIndexForFiAreaName__16FiAnalysisHandleCFv = .text:0x8016BD00; // type:function size:0x44 fn_8016BD50 = .text:0x8016BD50; // type:function size:0x68 -fn_8016BDC0 = .text:0x8016BDC0; // type:function size:0x68 -fn_8016BE30 = .text:0x8016BE30; // type:function size:0x4C -fn_8016BE80 = .text:0x8016BE80; // type:function size:0x50 -fn_8016BED0 = .text:0x8016BED0; // type:function size:0x44 -fn_8016BF20 = .text:0x8016BF20; // type:function size:0x44 +getEquipmentFocus__16FiAnalysisHandleCFv = .text:0x8016BDC0; // type:function size:0x68 +getSuitabilityArg__16FiAnalysisHandleCFv = .text:0x8016BE30; // type:function size:0x4C +getSuitabilityLabel__16FiAnalysisHandleCFv = .text:0x8016BE80; // type:function size:0x50 +shieldRelated__16FiAnalysisHandleFv = .text:0x8016BED0; // type:function size:0x44 +getShieldMessage__16FiAnalysisHandleFv = .text:0x8016BF20; // type:function size:0x44 initializeNaviTable = .text:0x8016BF70; // type:function size:0x88 -getNaviTableProgressSummary = .text:0x8016C000; // type:function size:0xB8 -getFiAdviceHintEntry = .text:0x8016C0C0; // type:function size:0xC4 -fn_8016C190 = .text:0x8016C190; // type:function size:0x1CC -getNaviTableEquipmentCheckEntry = .text:0x8016C360; // type:function size:0x9C +getNaviTableProgressSummary__9FiContextFv = .text:0x8016C000; // type:function size:0xB8 +getFiAdviceHintEntry__9FiContextFv = .text:0x8016C0C0; // type:function size:0xC4 +getUnkObjectiveValue__9FiContextFv = .text:0x8016C190; // type:function size:0x1CC +getNaviTableEquipmentCheckEntry__9FiContextFv = .text:0x8016C360; // type:function size:0x9C FiContext__setTargetedActorTextId = .text:0x8016C400; // type:function size:0x9C -rateBattlePerformance = .text:0x8016C4A0; // type:function size:0x148 +rateBattlePerformance__9FiContextFUc = .text:0x8016C4A0; // type:function size:0x148 prepareFiHelpIndex = .text:0x8016C5F0; // type:function size:0x288 getGlobalFiInfo0__9FiContextFl = .text:0x8016C880; // type:function size:0x20 -fn_8016C8A0 = .text:0x8016C8A0; // type:function size:0x54 -createGlobalFiContext = .text:0x8016C900; // type:function size:0x2C +getTextMessage__9FiContextFl = .text:0x8016C8A0; // type:function size:0x54 +create__9FiContextFv = .text:0x8016C900; // type:function size:0x2C FiContext__init = .text:0x8016C930; // type:function size:0xB4 fn_8016C9F0 = .text:0x8016C9F0; // type:function size:0xC -fn_8016CA00 = .text:0x8016CA00; // type:function size:0xFC -fn_8016CB00 = .text:0x8016CB00; // type:function size:0x1C -fn_8016CB20 = .text:0x8016CB20; // type:function size:0x1C -fn_8016CB40 = .text:0x8016CB40; // type:function size:0x1C +fn_8016CA00__9FiContextFv = .text:0x8016CA00; // type:function size:0xFC +fn_8016CB00__9FiContextFl = .text:0x8016CB00; // type:function size:0x1C +fn_8016CB20__9FiContextFv = .text:0x8016CB20; // type:function size:0x1C +fn_8016CB40__9FiContextFv = .text:0x8016CB40; // type:function size:0x1C fn_8016CB60 = .text:0x8016CB60; // type:function size:0x78 AcItem__isItemThatHasStruct = .text:0x8016CBE0; // type:function size:0x3C AcItem__getIndex = .text:0x8016CC20; // type:function size:0x14 @@ -10087,12 +10087,12 @@ getAdditionalInfoForPouchItem2 = .text:0x8018A330; // type:function size:0xC0 setPouchSlotToValueWithExtraInfo = .text:0x8018A3F0; // type:function size:0x130 tryCollectPouchItemInPouch = .text:0x8018A520; // type:function size:0x60 collectPouchItem = .text:0x8018A580; // type:function size:0xD0 -adventurePouchFindItemSlot = .text:0x8018A650; // type:function size:0x84 -adventurePouchCountItem = .text:0x8018A6E0; // type:function size:0x74 +adventurePouchFindItemSlot__F7ITEM_ID = .text:0x8018A650; // type:function size:0x84 +adventurePouchCountItem__F7ITEM_ID = .text:0x8018A6E0; // type:function size:0x74 convertLytPouchSlot__Fl = .text:0x8018A760; // type:function size:0x1C convertFilePouchSlot__Fl = .text:0x8018A780; // type:function size:0xAC fn_8018A830 = .text:0x8018A830; // type:function size:0x16C -fn_8018A9A0 = .text:0x8018A9A0; // type:function size:0x7C +hasAnyShields__Fv = .text:0x8018A9A0; // type:function size:0x7C changeItemPouchExtensionCounter = .text:0x8018AA20; // type:function size:0x10C getExtraAmmoInPouchByType = .text:0x8018AB30; // type:function size:0x98 getExtraAmmoCapacityByType = .text:0x8018ABD0; // type:function size:0x98 @@ -10101,7 +10101,7 @@ fn_8018ACD0 = .text:0x8018ACD0; // type:function size:0xC4 fn_8018ADA0 = .text:0x8018ADA0; // type:function size:0xA0 trySwapAdventurePouchItems = .text:0x8018AE40; // type:function size:0x120 fn_8018AF60 = .text:0x8018AF60; // type:function size:0x204 -findItemInItemCheck = .text:0x8018B170; // type:function size:0x60 +itemCheckFindItemSlot__F7ITEM_ID = .text:0x8018B170; // type:function size:0x60 fn_8018B1D0 = .text:0x8018B1D0; // type:function size:0x60 fn_8018B230 = .text:0x8018B230; // type:function size:0x74 ActorLink__handleHotPumpkinSoup = .text:0x8018B2B0; // type:function size:0xE4 @@ -10258,12 +10258,12 @@ fn_80190710 = .text:0x80190710; // type:function size:0x14 fn_80190730 = .text:0x80190730; // type:function size:0x48 fn_80190780 = .text:0x80190780; // type:function size:0x40 fn_801907C0 = .text:0x801907C0; // type:function size:0x4 -fn_801907D0 = .text:0x801907D0; // type:function size:0x1C -fn_801907F0 = .text:0x801907F0; // type:function size:0x38 +fn_801907D0__15SaveTimeRelatedFv = .text:0x801907D0; // type:function size:0x1C +fn_801907F0__15SaveTimeRelatedFv = .text:0x801907F0; // type:function size:0x38 fn_80190830 = .text:0x80190830; // type:function size:0x50 fn_80190880 = .text:0x80190880; // type:function size:0x64 fn_801908F0 = .text:0x801908F0; // type:function size:0xAC -fn_801909A0 = .text:0x801909A0; // type:function size:0x40 +fn_801909A0__15SaveTimeRelatedFv = .text:0x801909A0; // type:function size:0x40 fn_801909E0 = .text:0x801909E0; // type:function size:0x2C fn_80190A10 = .text:0x80190A10; // type:function size:0x94 fn_80190AB0 = .text:0x80190AB0; // type:function size:0xC @@ -10569,7 +10569,7 @@ overrideLayer0WithLyse__11dStageMgr_cFv = .text:0x80199580; // type:function siz setStif__11dStageMgr_cFPC4STIF = .text:0x80199680; // type:function size:0x1AC getFlagIndex__11dStageMgr_cCFv = .text:0x80199830; // type:function size:0x2C getAreaType__11dStageMgr_cCFv = .text:0x80199860; // type:function size:0x1C -StageManager__isAreaTypeNormal = .text:0x80199880; // type:function size:0x28 +isAreaTypeNormal__11dStageMgr_cCFv = .text:0x80199880; // type:function size:0x28 isAreaTypeDungeon__11dStageMgr_cCFv = .text:0x801998B0; // type:function size:0x2C StageManager__isAreaTypeBoss = .text:0x801998E0; // type:function size:0x2C StageManager__isAreaTypeSkyloft = .text:0x80199910; // type:function size:0x2C @@ -10854,59 +10854,59 @@ fn_801AF5B0 = .text:0x801AF5B0; // type:function size:0x30 WeatherTag__initStates = .text:0x801AF5E0; // type:function size:0x10C WeatherTag__dtor2 = .text:0x801AF6F0; // type:function size:0x58 fn_801AF750 = .text:0x801AF750; // type:function size:0x88 -ActorEventFlowManager__ctor = .text:0x801AF7E0; // type:function size:0x58 -fn_801AF840 = .text:0x801AF840; // type:function size:0x40 -ActorEventFlowManager__dtor = .text:0x801AF880; // type:function size:0x40 -findEventEntryPoint = .text:0x801AF8C0; // type:function size:0x138 -fn_801AFA00 = .text:0x801AFA00; // type:function size:0xDC -ActorEventFlowManager__setNext = .text:0x801AFAE0; // type:function size:0x28 -ActorEventFlowManager__handleNextEvent = .text:0x801AFB10; // type:function size:0x234 -fn_801AFD50 = .text:0x801AFD50; // type:function size:0x38 -fn_801AFD90 = .text:0x801AFD90; // type:function size:0x28 -fn_801AFDC0 = .text:0x801AFDC0; // type:function size:0x13C -ActorEventFlowManager__actuallyHandleType3 = .text:0x801AFF00; // type:function size:0x888 -firstHandleType3EventFlow = .text:0x801B0790; // type:function size:0xC8 -ActorEventFlowManager__processTextCommand = .text:0x801B0860; // type:function size:0x7CC -ActorEventFlowManager__getSwitchChoice = .text:0x801B1030; // type:function size:0x54 -fn_801B1090 = .text:0x801B1090; // type:function size:0x10 -fn_801B10A0 = .text:0x801B10A0; // type:function size:0x10 -fn_801B10B0 = .text:0x801B10B0; // type:function size:0x104 -ActorEventFlowManager__checkStoryflag = .text:0x801B11C0; // type:function size:0x44 -fn_801B1210 = .text:0x801B1210; // type:function size:0x8 -ActorEventFlowManager__checkZoneflag = .text:0x801B1220; // type:function size:0x50 -ActorEventFlowManager__checkSceneflag = .text:0x801B1270; // type:function size:0x3C -fn_801B12B0 = .text:0x801B12B0; // type:function size:0x14 -fn_801B12D0 = .text:0x801B12D0; // type:function size:0x14 -ActorEventFlowManager__checkTempflag = .text:0x801B12F0; // type:function size:0x44 -ActorEventFlowManager__checkRupees = .text:0x801B1340; // type:function size:0x44 -ActorEventFlowManager__getRand0To2 = .text:0x801B1390; // type:function size:0x38 -ActorEventFlowManager__getRand0To3 = .text:0x801B13D0; // type:function size:0x38 -ActorEventFlowManager__getRand0To4 = .text:0x801B1410; // type:function size:0x38 -fn_801B1450 = .text:0x801B1450; // type:function size:0x8 -fn_801B1460 = .text:0x801B1460; // type:function size:0x8 -fn_801B1470 = .text:0x801B1470; // type:function size:0x8 -ActorEventFlowManager__checkFreePouchSlot = .text:0x801B1480; // type:function size:0x44 -fn_801B14D0 = .text:0x801B14D0; // type:function size:0x4C -fn_801B1520 = .text:0x801B1520; // type:function size:0x1AC -fn_801B16D0 = .text:0x801B16D0; // type:function size:0x44 -fn_801B1720 = .text:0x801B1720; // type:function size:0x54 -fn_801B1780 = .text:0x801B1780; // type:function size:0x44 -ActorEventFlowManager__handleSwitch = .text:0x801B17D0; // type:function size:0xA4 -fn_801B1880 = .text:0x801B1880; // type:function size:0x48 -fn_801B18D0 = .text:0x801B18D0; // type:function size:0x8 -ActorEventFlowManager__triggerEntryPoint = .text:0x801B18E0; // type:function size:0x298 -fn_801B1B80 = .text:0x801B1B80; // type:function size:0x3C -fn_801B1BC0 = .text:0x801B1BC0; // type:function size:0x8 -fn_801B1BD0 = .text:0x801B1BD0; // type:function size:0x8 -fn_801B1BE0 = .text:0x801B1BE0; // type:function size:0x80 -fn_801B1C60 = .text:0x801B1C60; // type:function size:0xC -fn_801B1C70 = .text:0x801B1C70; // type:function size:0x14 -fn_801B1C90 = .text:0x801B1C90; // type:function size:0xA4 -fn_801B1D40 = .text:0x801B1D40; // type:function size:0x1C8 -fn_801B1F10 = .text:0x801B1F10; // type:function size:0x38 -ActorEventFlowManager__clear = .text:0x801B1F50; // type:function size:0x2C -fn_801B1F80 = .text:0x801B1F80; // type:function size:0xD8 -fn_801B2060 = .text:0x801B2060; // type:function size:0x98 +__ct__7dFlow_cFv = .text:0x801AF7E0; // type:function size:0x58 +__dt__11dFlowBase_cFv = .text:0x801AF840; // type:function size:0x40 +__dt__7dFlow_cFv = .text:0x801AF880; // type:function size:0x40 +findEntryPoint__7dFlow_cFUsUs = .text:0x801AF8C0; // type:function size:0x138 +findEntryPoint__7dFlow_cFPCc = .text:0x801AFA00; // type:function size:0xDC +setNext__7dFlow_cFUs = .text:0x801AFAE0; // type:function size:0x28 +advanceFlow__7dFlow_cFv = .text:0x801AFB10; // type:function size:0x234 +advanceUntilEvent__7dFlow_cFlPl = .text:0x801AFD50; // type:function size:0x38 +vt_0x18__7dFlow_cCFv = .text:0x801AFD90; // type:function size:0x28 +playSound__7dFlow_cFUl = .text:0x801AFDC0; // type:function size:0x13C +handleEventInternal__7dFlow_cFPC11MsbFlowInfo = .text:0x801AFF00; // type:function size:0x888 +handleEvent__7dFlow_cFv = .text:0x801B0790; // type:function size:0xC8 +handleMessage__7dFlow_cFv = .text:0x801B0860; // type:function size:0x7CC +getSwitchChoice__7dFlow_cCFPC11MsbFlowInfoUs = .text:0x801B1030; // type:function size:0x54 +branchHandler00__7dFlow_cCFPC11MsbFlowInfo = .text:0x801B1090; // type:function size:0x10 +branchHandler01__7dFlow_cCFPC11MsbFlowInfo = .text:0x801B10A0; // type:function size:0x10 +branchHandler02__7dFlow_cCFPC11MsbFlowInfo = .text:0x801B10B0; // type:function size:0x104 +branchHandler03__7dFlow_cCFPC11MsbFlowInfo = .text:0x801B11C0; // type:function size:0x44 +branchHandler04__7dFlow_cCFPC11MsbFlowInfo = .text:0x801B1210; // type:function size:0x8 +branchHandler05__7dFlow_cCFPC11MsbFlowInfo = .text:0x801B1220; // type:function size:0x50 +branchHandler06__7dFlow_cCFPC11MsbFlowInfo = .text:0x801B1270; // type:function size:0x3C +branchHandler07__7dFlow_cCFPC11MsbFlowInfo = .text:0x801B12B0; // type:function size:0x14 +branchHandler08__7dFlow_cCFPC11MsbFlowInfo = .text:0x801B12D0; // type:function size:0x14 +branchHandler09__7dFlow_cCFPC11MsbFlowInfo = .text:0x801B12F0; // type:function size:0x44 +branchHandler10__7dFlow_cCFPC11MsbFlowInfo = .text:0x801B1340; // type:function size:0x44 +branchHandler11__7dFlow_cCFPC11MsbFlowInfo = .text:0x801B1390; // type:function size:0x38 +branchHandler12__7dFlow_cCFPC11MsbFlowInfo = .text:0x801B13D0; // type:function size:0x38 +branchHandler13__7dFlow_cCFPC11MsbFlowInfo = .text:0x801B1410; // type:function size:0x38 +branchHandler14__7dFlow_cCFPC11MsbFlowInfo = .text:0x801B1450; // type:function size:0x8 +branchHandler15__7dFlow_cCFPC11MsbFlowInfo = .text:0x801B1460; // type:function size:0x8 +branchHandler16__7dFlow_cCFPC11MsbFlowInfo = .text:0x801B1470; // type:function size:0x8 +branchHandler17__7dFlow_cCFPC11MsbFlowInfo = .text:0x801B1480; // type:function size:0x44 +branchHandler18__7dFlow_cCFPC11MsbFlowInfo = .text:0x801B14D0; // type:function size:0x4C +branchHandler19__7dFlow_cCFPC11MsbFlowInfo = .text:0x801B1520; // type:function size:0x1AC +branchHandler20__7dFlow_cCFPC11MsbFlowInfo = .text:0x801B16D0; // type:function size:0x44 +branchHandler21__7dFlow_cCFPC11MsbFlowInfo = .text:0x801B1720; // type:function size:0x54 +branchHandler22__7dFlow_cCFPC11MsbFlowInfo = .text:0x801B1780; // type:function size:0x44 +handleBranch__7dFlow_cFv = .text:0x801B17D0; // type:function size:0xA4 +handleEntry__7dFlow_cFv = .text:0x801B1880; // type:function size:0x48 +handleJump__7dFlow_cFv = .text:0x801B18D0; // type:function size:0x8 +triggerEntryPoint__7dFlow_cFll = .text:0x801B18E0; // type:function size:0x298 +triggerEntryPoint__7dFlow_cFPCc = .text:0x801B1B80; // type:function size:0x3C +getField_0x44__7dFlow_cCFv = .text:0x801B1BC0; // type:function size:0x8 +getField_0x46__7dFlow_cCFv = .text:0x801B1BD0; // type:function size:0x8 +triggerEntryPointChecked__7dFlow_cFll = .text:0x801B1BE0; // type:function size:0x80 +setField0x3C__7dFlow_cFv = .text:0x801B1C60; // type:function size:0xC +checkField0x3C__7dFlow_cCFv = .text:0x801B1C70; // type:function size:0x14 +start__7dFlow_cFUs = .text:0x801B1C90; // type:function size:0xA4 +advanceUntil__7dFlow_cFllPl = .text:0x801B1D40; // type:function size:0x1C8 +matchesUnknownActorCategory__7dFlow_cCFl = .text:0x801B1F10; // type:function size:0x38 +clear__7dFlow_cFv = .text:0x801B1F50; // type:function size:0x2C +createLytMiniGame__7dFlow_cFv = .text:0x801B1F80; // type:function size:0xD8 +clearMinigame__7dFlow_cFv = .text:0x801B2060; // type:function size:0x98 dMessage_c_classInit__Fv = .text:0x801B2100; // type:function size:0x30 msbAlloc__FUl = .text:0x801B2130; // type:function size:0x2C msbFree__FPv = .text:0x801B2160; // type:function size:0x24 @@ -10926,7 +10926,7 @@ getMsbtFileName__10dMessage_cFl = .text:0x801B2880; // type:function size:0x88 getMsbfFileName__10dMessage_cFl = .text:0x801B2910; // type:function size:0x88 getMsbtNumberByIndex__10dMessage_cFl = .text:0x801B29A0; // type:function size:0x24 getMsbfNumberByIndex__10dMessage_cFl = .text:0x801B29D0; // type:function size:0x24 -fn_801B2A00 = .text:0x801B2A00; // type:function size:0x14 +getMsbtIndexForMsbfIndex__10dMessage_cFl = .text:0x801B2A00; // type:function size:0x14 getTextIndexForLabel__10dMessage_cFPCc = .text:0x801B2A20; // type:function size:0x4C getMsbtIndexForLabel__10dMessage_cFPCc = .text:0x801B2A70; // type:function size:0xC getMsbtIndexForLabelInternal__10dMessage_cFPCc = .text:0x801B2A80; // type:function size:0xA4 @@ -10934,9 +10934,9 @@ getMsbtInfoForIndex__10dMessage_cFl = .text:0x801B2B30; // type:function size:0x getMsbtInfoForIndexInternal__10dMessage_cFl = .text:0x801B2B40; // type:function size:0x38 getMsbfInfoForIndex__10dMessage_cFl = .text:0x801B2B80; // type:function size:0xC getMsbfInfoForIndexInternal__10dMessage_cFl = .text:0x801B2B90; // type:function size:0x38 -fn_801B2BD0 = .text:0x801B2BD0; // type:function size:0x10 -fn_801B2BE0 = .text:0x801B2BE0; // type:function size:0x40 -fn_801B2C20 = .text:0x801B2C20; // type:function size:0x30 +getLightPillarRelatedArg__10dMessage_cFl = .text:0x801B2BD0; // type:function size:0x10 +storeLightPillarRelatedArg__10dMessage_cFUl = .text:0x801B2BE0; // type:function size:0x40 +clearLightPillarRelatedArgs__10dMessage_cFv = .text:0x801B2C20; // type:function size:0x30 executeMinigame__10dMessage_cFv = .text:0x801B2C50; // type:function size:0xC0 init__10dMessage_cFv = .text:0x801B2D10; // type:function size:0x4C reset__10dMessage_cFv = .text:0x801B2D60; // type:function size:0x44 @@ -11180,7 +11180,7 @@ fn_801BAE60 = .text:0x801BAE60; // type:function size:0x90 fn_801BAEF0 = .text:0x801BAEF0; // type:function size:0x50 fn_801BAF40 = .text:0x801BAF40; // type:function size:0x54 Reloader__triggerEntrance = .text:0x801BAFA0; // type:function size:0xDC -triggerExit__9dScGame_cFlUcll = .text:0x801BB080; // type:function size:0xC0 +triggerExit__9dScGame_cFlUsll = .text:0x801BB080; // type:function size:0xC0 Reloader__triggerExitInner = .text:0x801BB140; // type:function size:0x154 fn_801BB2A0 = .text:0x801BB2A0; // type:function size:0x28 fn_801BB2D0 = .text:0x801BB2D0; // type:function size:0x8 @@ -13547,17 +13547,17 @@ AcItem__getCurrentOffset = .text:0x802519F0; // type:function size:0xA0 AcItem__getPositionOffset = .text:0x80251A90; // type:function size:0x5C fn_80251AF0 = .text:0x80251AF0; // type:function size:0x78 checkFlag__9dAcItem_cFUl = .text:0x80251B70; // type:function size:0x128 -AcItem__setFlag = .text:0x80251CA0; // type:function size:0xC0 +setFlag__9dAcItem_cFl = .text:0x80251CA0; // type:function size:0xC0 AcItem__checkFlagForItem = .text:0x80251D60; // type:function size:0x34 AcItem__checkItemFlag = .text:0x80251DA0; // type:function size:0x48 isItemAnyFairy = .text:0x80251DF0; // type:function size:0x50 setItemflag = .text:0x80251E40; // type:function size:0x1C getRupeeCounter = .text:0x80251E60; // type:function size:0x8 -getRupeeCounter2 = .text:0x80251E70; // type:function size:0x4 +getRupeeCounter__9dAcItem_cFv = .text:0x80251E70; // type:function size:0x4 fn_80251E80 = .text:0x80251E80; // type:function size:0xC -addRupees = .text:0x80251E90; // type:function size:0x18 +addRupees__9dAcItem_cFl = .text:0x80251E90; // type:function size:0x18 getCurrentWalletCapacity = .text:0x80251EB0; // type:function size:0x8 -getCurrentWalletCapacity2 = .text:0x80251EC0; // type:function size:0x4 +getCurrentWalletCapacity__9dAcItem_cFv = .text:0x80251EC0; // type:function size:0x4 AcItem__getCurrentArrowCount = .text:0x80251ED0; // type:function size:0x8 getTotalArrowCount__9dAcItem_cFv = .text:0x80251EE0; // type:function size:0x38 changeArrowCounter = .text:0x80251F20; // type:function size:0xC @@ -15443,9 +15443,9 @@ LytMiniGame__init = .text:0x80294830; // type:function size:0xA94 LytMiniGame__destructRes = .text:0x802952D0; // type:function size:0x31C fn_802955F0 = .text:0x802955F0; // type:function size:0xD4 fn_802956D0 = .text:0x802956D0; // type:function size:0x6C -fn_80295740 = .text:0x80295740; // type:function size:0x8C -fn_802957D0 = .text:0x802957D0; // type:function size:0x78 -LytMiniGame__updateDisplayedCounter = .text:0x80295850; // type:function size:0xA8 +scoreRelatedExecute__14dLytMiniGame_cFv = .text:0x80295740; // type:function size:0x8C +scoreRelated__14dLytMiniGame_cFv = .text:0x802957D0; // type:function size:0x78 +setDisplayedPoints__14dLytMiniGame_cFl = .text:0x80295850; // type:function size:0xA8 fn_80295900 = .text:0x80295900; // type:function size:0x38 fn_80295940 = .text:0x80295940; // type:function size:0x38 fn_80295980 = .text:0x80295980; // type:function size:0x98 @@ -15455,9 +15455,9 @@ fn_80295AD0 = .text:0x80295AD0; // type:function size:0x20 fn_80295AF0 = .text:0x80295AF0; // type:function size:0x2C fn_80295B20 = .text:0x80295B20; // type:function size:0x8 fn_80295B30 = .text:0x80295B30; // type:function size:0x8 -fn_80295B40 = .text:0x80295B40; // type:function size:0xA8 -fn_80295BF0 = .text:0x80295BF0; // type:function size:0x24 -fn_80295C20 = .text:0x80295C20; // type:function size:0x4C +timeRelatedExecute__14dLytMiniGame_cFv = .text:0x80295B40; // type:function size:0xA8 +timeRelated__14dLytMiniGame_cFv = .text:0x80295BF0; // type:function size:0x24 +setDisplayedTime__14dLytMiniGame_cFl = .text:0x80295C20; // type:function size:0x4C fn_80295C70 = .text:0x80295C70; // type:function size:0x38 fn_80295CB0 = .text:0x80295CB0; // type:function size:0x38 fn_80295CF0 = .text:0x80295CF0; // type:function size:0x8 @@ -15796,14 +15796,14 @@ fn_802A06B0 = .text:0x802A06B0; // type:function size:0x30 LytBossCaption__initStates = .text:0x802A06E0; // type:function size:0x338 LytBossCaption__dtor = .text:0x802A0A20; // type:function size:0x58 fn_802A0A80 = .text:0x802A0A80; // type:function size:0x88 -fn_802A0B10 = .text:0x802A0B10; // type:function size:0x118 -fn_802A0C30 = .text:0x802A0C30; // type:function size:0x58 -fn_802A0C90 = .text:0x802A0C90; // type:function size:0x6C -fn_802A0D00 = .text:0x802A0D00; // type:function size:0xA0 -fn_802A0DA0 = .text:0x802A0DA0; // type:function size:0xA4 +dLytDemoDowsing_c_classInit__Fv = .text:0x802A0B10; // type:function size:0x118 +__dt__30sFState_c<17dLytDemoDowsing_c>Fv = .text:0x802A0C30; // type:function size:0x58 +__dt__33sFStateFct_c<17dLytDemoDowsing_c>Fv = .text:0x802A0C90; // type:function size:0x6C +__dt__86sStateMgr_c<17dLytDemoDowsing_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802A0D00; // type:function size:0xA0 +__dt__56sFStateMgr_c<17dLytDemoDowsing_c,20sStateMethodUsr_FI_c>Fv = .text:0x802A0DA0; // type:function size:0xA4 fn_802A0E50 = .text:0x802A0E50; // type:function size:0x4 fn_802A0E60 = .text:0x802A0E60; // type:function size:0x28 -fn_802A0E90 = .text:0x802A0E90; // type:function size:0x10 +changeState__86sStateMgr_c<17dLytDemoDowsing_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>FRC12sStateIDIf_c = .text:0x802A0E90; // type:function size:0x10 fn_802A0EA0 = .text:0x802A0EA0; // type:function size:0x4 fn_802A0EB0 = .text:0x802A0EB0; // type:function size:0x48 fn_802A0F00 = .text:0x802A0F00; // type:function size:0x9C @@ -15811,27 +15811,27 @@ fn_802A0FA0 = .text:0x802A0FA0; // type:function size:0x4 fn_802A0FB0 = .text:0x802A0FB0; // type:function size:0x15C fn_802A1110 = .text:0x802A1110; // type:function size:0x6C fn_802A1180 = .text:0x802A1180; // type:function size:0x70 -fn_802A11F0 = .text:0x802A11F0; // type:function size:0x10 +executeState__86sStateMgr_c<17dLytDemoDowsing_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802A11F0; // type:function size:0x10 fn_802A1200 = .text:0x802A1200; // type:function size:0x28 -fn_802A1230 = .text:0x802A1230; // type:function size:0x120 -fn_802A1350 = .text:0x802A1350; // type:function size:0x60 -fn_802A13B0 = .text:0x802A13B0; // type:function size:0xC -fn_802A13C0 = .text:0x802A13C0; // type:function size:0x1C -fn_802A13E0 = .text:0x802A13E0; // type:function size:0x1C -fn_802A1400 = .text:0x802A1400; // type:function size:0x1C -fn_802A1420 = .text:0x802A1420; // type:function size:0x10 -fn_802A1430 = .text:0x802A1430; // type:function size:0x10 -fn_802A1440 = .text:0x802A1440; // type:function size:0x10 -fn_802A1450 = .text:0x802A1450; // type:function size:0x10 -fn_802A1460 = .text:0x802A1460; // type:function size:0x10 -fn_802A1470 = .text:0x802A1470; // type:function size:0x10 -fn_802A1480 = .text:0x802A1480; // type:function size:0x10 -fn_802A1490 = .text:0x802A1490; // type:function size:0x30 -fn_802A14C0 = .text:0x802A14C0; // type:function size:0x30 -fn_802A14F0 = .text:0x802A14F0; // type:function size:0x30 -LytDemoDowsing__initStates = .text:0x802A1520; // type:function size:0x1C0 -LytDemoDowsing__dtor = .text:0x802A16E0; // type:function size:0x58 -fn_802A1740 = .text:0x802A1740; // type:function size:0x88 +__dt__17dLytDemoDowsing_cFv = .text:0x802A1230; // type:function size:0x120 +build__33sFStateFct_c<17dLytDemoDowsing_c>FRC12sStateIDIf_c = .text:0x802A1350; // type:function size:0x60 +dispose__33sFStateFct_c<17dLytDemoDowsing_c>FRP10sStateIf_c = .text:0x802A13B0; // type:function size:0xC +initialize__30sFState_c<17dLytDemoDowsing_c>Fv = .text:0x802A13C0; // type:function size:0x1C +execute__30sFState_c<17dLytDemoDowsing_c>Fv = .text:0x802A13E0; // type:function size:0x1C +finalize__30sFState_c<17dLytDemoDowsing_c>Fv = .text:0x802A1400; // type:function size:0x1C +initializeState__86sStateMgr_c<17dLytDemoDowsing_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802A1420; // type:function size:0x10 +finalizeState__86sStateMgr_c<17dLytDemoDowsing_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802A1430; // type:function size:0x10 +refreshState__86sStateMgr_c<17dLytDemoDowsing_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802A1440; // type:function size:0x10 +getState__86sStateMgr_c<17dLytDemoDowsing_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802A1450; // type:function size:0x10 +getNewStateID__86sStateMgr_c<17dLytDemoDowsing_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802A1460; // type:function size:0x10 +getStateID__86sStateMgr_c<17dLytDemoDowsing_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802A1470; // type:function size:0x10 +getOldStateID__86sStateMgr_c<17dLytDemoDowsing_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802A1480; // type:function size:0x10 +finalizeState__32sFStateID_c<17dLytDemoDowsing_c>CFR17dLytDemoDowsing_c = .text:0x802A1490; // type:function size:0x30 +executeState__32sFStateID_c<17dLytDemoDowsing_c>CFR17dLytDemoDowsing_c = .text:0x802A14C0; // type:function size:0x30 +initializeState__32sFStateID_c<17dLytDemoDowsing_c>CFR17dLytDemoDowsing_c = .text:0x802A14F0; // type:function size:0x30 +__sinit_\d_lyt_demo_dowsing_cpp = .text:0x802A1520; // type:function size:0x1C0 +__dt__32sFStateID_c<17dLytDemoDowsing_c>Fv = .text:0x802A16E0; // type:function size:0x58 +isSameName__32sFStateID_c<17dLytDemoDowsing_c>CFPCc = .text:0x802A1740; // type:function size:0x88 fn_802A17D0 = .text:0x802A17D0; // type:function size:0x4 dLytShopMain__stateModeNoneUpdate = .text:0x802A17E0; // type:function size:0x10 fn_802A17F0 = .text:0x802A17F0; // type:function size:0x4 @@ -16833,14 +16833,14 @@ checkStoryflag2 = .text:0x802CFA40; // type:function size:0x44 fn_802CFA90 = .text:0x802CFA90; // type:function size:0x2E0 fn_802CFD70 = .text:0x802CFD70; // type:function size:0x20 updateHelpText = .text:0x802CFD90; // type:function size:0x1C -fn_802CFDB0 = .text:0x802CFDB0; // type:function size:0x74 +isStateNormalOrNotInEvent__17dLytControlGame_cCFv = .text:0x802CFDB0; // type:function size:0x74 isInSomeMapState__17dLytControlGame_cCFv = .text:0x802CFE30; // type:function size:0xD8 isNotInStateMap__17dLytControlGame_cCFv = .text:0x802CFF10; // type:function size:0x4C fn_802CFF60 = .text:0x802CFF60; // type:function size:0x90 fn_802CFFF0 = .text:0x802CFFF0; // type:function size:0x1C -somehowRelatedToEnteringLightPillars = .text:0x802D0010; // type:function size:0x254 +somehowRelatedToEnteringLightPillars__17dLytControlGame_cFlll = .text:0x802D0010; // type:function size:0x254 fn_802D0270 = .text:0x802D0270; // type:function size:0x4C -LytControlGame__openCollectionScreenDemo = .text:0x802D02C0; // type:function size:0xA0 +openCollectionScreenDemo__17dLytControlGame_cFv = .text:0x802D02C0; // type:function size:0xA0 fn_802D0360 = .text:0x802D0360; // type:function size:0xA0 fn_802D0400 = .text:0x802D0400; // type:function size:0xC fn_802D0410 = .text:0x802D0410; // type:function size:0xD4 @@ -34179,7 +34179,7 @@ lbl_8052DE40 = .data:0x8052DE40; // type:object size:0x10 EVENT_FLOW_FILENAMES = .data:0x8052DE50; // type:object size:0x18 lbl_8052DE68 = .data:0x8052DE68; // type:object size:0x10 __vt__10dMessage_c = .data:0x8052DE78; // type:object size:0x4C -ActorEventFlowManager__vtable = .data:0x8052DEC4; // type:object size:0x78 +__vt__7dFlow_c = .data:0x8052DEC4; // type:object size:0x78 g_profile_STAGE = .data:0x8052DF40; // type:object size:0xC sCallbacks__8dStage_c = .data:0x8052DF4C; // type:object size:0x24 lbl_8052DF70 = .data:0x8052DF70; // type:object size:0x10 @@ -35361,12 +35361,12 @@ lbl_8053BD34 = .data:0x8053BD34; // type:object size:0x1C lbl_8053BD50 = .data:0x8053BD50; // type:object size:0x10 data:string lbl_8053BD60 = .data:0x8053BD60; // type:object size:0xC data:string lbl_8053BD6C = .data:0x8053BD6C; // type:object size:0x18 -lbl_8053BD84 = .data:0x8053BD84; // type:object size:0x4C -lbl_8053BDD0 = .data:0x8053BDD0; // type:object size:0x30 -lbl_8053BE00 = .data:0x8053BE00; // type:object size:0x30 -lbl_8053BE30 = .data:0x8053BE30; // type:object size:0x18 -lbl_8053BE48 = .data:0x8053BE48; // type:object size:0xD4 -lbl_8053BF1C = .data:0x8053BF1C; // type:object size:0x34 +__vt__17dLytDemoDowsing_c = .data:0x8053BD84; // type:object size:0x4C +__vt__56sFStateMgr_c<17dLytDemoDowsing_c,20sStateMethodUsr_FI_c> = .data:0x8053BDD0; // type:object size:0x30 +__vt__86sStateMgr_c<17dLytDemoDowsing_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c> = .data:0x8053BE00; // type:object size:0x30 +__vt__33sFStateFct_c<17dLytDemoDowsing_c> = .data:0x8053BE30; // type:object size:0x18 +__vt__30sFState_c<17dLytDemoDowsing_c> = .data:0x8053BE48; // type:object size:0xD4 +__vt__32sFStateID_c<17dLytDemoDowsing_c> = .data:0x8053BF1C; // type:object size:0x34 lbl_8053BF50 = .data:0x8053BF50; // type:object size:0x14 data:string lbl_8053BF64 = .data:0x8053BF64; // type:object size:0x18 lbl_8053BF7C = .data:0x8053BF7C; // type:object size:0x14 @@ -38638,7 +38638,7 @@ lbl_80573228 = .sdata:0x80573228; // type:object size:0x8 lbl_80573230 = .sdata:0x80573230; // type:object size:0x8 lbl_80573238 = .sdata:0x80573238; // type:object size:0x8 lbl_80573240 = .sdata:0x80573240; // type:object size:0x8 -lbl_80573248 = .sdata:0x80573248; // type:object size:0x4 data:4byte +sExitId__7dFlow_c = .sdata:0x80573248; // type:object size:0x4 data:4byte lbl_8057324C = .sdata:0x8057324C; // type:object size:0x4 lbl_80573250 = .sdata:0x80573250; // type:object size:0x8 data:string lbl_80573258 = .sdata:0x80573258; // type:object size:0x8 @@ -40121,7 +40121,7 @@ sInstance__15dLytBirdGauge_c = .sbss:0x805754E0; // type:object size:0x4 data:4b sInstance__14dLytSkyGauge_c = .sbss:0x805754E8; // type:object size:0x4 data:4byte lbl_805754F0 = .sbss:0x805754F0; // type:object size:0x8 data:4byte sInstance__17dLytCursorStick_c = .sbss:0x805754F8; // type:object size:0x8 data:4byte -GLOBAL_FI_CONTEXT = .sbss:0x80575500; // type:object size:0x4 data:4byte +sInstance__9FiContext = .sbss:0x80575500; // type:object size:0x4 data:4byte NAVI_TABLE = .sbss:0x80575504; // type:object size:0x4 data:4byte sSmallKeyCounter = .sbss:0x80575508; // type:object size:0x8 data:4byte sPouchExpansionCounter = .sbss:0x80575510; // type:object size:0x8 data:4byte @@ -40172,7 +40172,7 @@ DOOR_ACTOR_LIST = .sbss:0x80575668; // type:object size:0x8 data:4byte lbl_80575670 = .sbss:0x80575670; // type:object size:0x8 data:byte lbl_80575678 = .sbss:0x80575678; // type:object size:0x8 data:4byte lbl_80575680 = .sbss:0x80575680; // type:object size:0x8 data:4byte -lbl_80575688 = .sbss:0x80575688; // type:object size:0x8 data:4byte +sInstance__15SaveTimeRelated = .sbss:0x80575688; // type:object size:0x8 data:4byte lbl_80575690 = .sbss:0x80575690; // type:object size:0x1 data:byte lbl_80575691 = .sbss:0x80575691; // type:object size:0x1 data:byte lbl_80575692 = .sbss:0x80575692; // type:object size:0x1 data:byte @@ -40400,11 +40400,11 @@ lbl_80575978 = .sbss:0x80575978; // type:object size:0x4 data:4byte lbl_8057597C = .sbss:0x8057597C; // type:object size:0x4 data:4byte lbl_80575980 = .sbss:0x80575980; // type:object size:0x4 data:4byte lbl_80575984 = .sbss:0x80575984; // type:object size:0x4 data:4byte -LYT_MINI_GAME = .sbss:0x80575988; // type:object size:0x8 data:4byte +sInstance__14dLytMiniGame_c = .sbss:0x80575988; // type:object size:0x8 data:4byte lbl_80575990 = .sbss:0x80575990; // type:object size:0x8 data:4byte lbl_80575998 = .sbss:0x80575998; // type:object size:0x8 data:4byte BOSS_CAPTION_PTR = .sbss:0x805759A0; // type:object size:0x8 data:4byte -lbl_805759A8 = .sbss:0x805759A8; // type:object size:0x8 data:4byte +sInstance__17dLytDemoDowsing_c = .sbss:0x805759A8; // type:object size:0x8 data:4byte lbl_805759B0 = .sbss:0x805759B0; // type:object size:0x2 data:2byte LYT_SHOP = .sbss:0x805759B4; // type:object size:0x4 data:4byte lbl_805759B8 = .sbss:0x805759B8; // type:object size:0x8 diff --git a/configure.py b/configure.py index cb561e0d..061881a6 100644 --- a/configure.py +++ b/configure.py @@ -570,7 +570,7 @@ config.libs = [ Object(NonMatching, "d/d_camera.cpp"), Object(NonMatching, "d/d_light_obj.cpp"), Object(NonMatching, "d/tg/d_t_weather.cpp"), - Object(NonMatching, "d/d_message.cpp"), + Object(Matching, "d/d_message.cpp"), Object(NonMatching, "d/d_stage.cpp"), Object(NonMatching, "d/d_stage_select.cpp"), Object(Matching, "d/d_room.cpp"), diff --git a/include/d/a/d_a_item.h b/include/d/a/d_a_item.h index bb3181bc..983b701f 100644 --- a/include/d/a/d_a_item.h +++ b/include/d/a/d_a_item.h @@ -47,6 +47,8 @@ public: static void spawnItem(u16 item, u32 room, const mVec3_c &pos, const mAng3_c &rot, u32 params, u32 arg); static void spawnDrop(u16 item, u32 room, const mVec3_c &pos, const mAng3_c &rot); static u32 checkFlag(u32 flag); + static void setFlag(s32 id); + void setItemPosition(const mVec3_c &); void getItemFromBWheelItem(); bool isStateWait(); @@ -59,6 +61,9 @@ public: static s32 getTotalSeedCapacity(); static s32 getTotalArrowCapacity(); + static s32 getRupeeCounter(); + static u32 getCurrentWalletCapacity(); + static u32 getKeyPieceCount(); static u32 getSmallKeyCount(); @@ -70,6 +75,8 @@ public: static void itemGetEventStart(dAcBase_c *); static void itemGetEventEnd(dAcBase_c *); + static void addRupees(s32 amount); + enum Trial_e { TRIAL_SKYLOFT, TRIAL_FARON, diff --git a/include/d/a/d_a_player.h b/include/d/a/d_a_player.h index 32297c77..e56ec7f5 100644 --- a/include/d/a/d_a_player.h +++ b/include/d/a/d_a_player.h @@ -149,7 +149,7 @@ public: /* vt 0x1A4 */ virtual void vt_0x1A4(); /* vt 0x1A8 */ virtual void vt_0x1A8(); /* vt 0x1AC */ virtual void vt_0x1AC(); - /* vt 0x1B0 */ virtual void isItemFairyFromBugnet(); + /* vt 0x1B0 */ virtual bool isItemFairyFromBugnet(); /* vt 0x1B4 */ virtual void isByte0x434eEqual7(); /* vt 0x1B8 */ virtual void canHandleGameOver(); /* vt 0x1BC */ virtual void vt_0x1BC(); @@ -338,6 +338,7 @@ public: static s32 getCurrentSlingshotType(); static s32 getCurrentBeetleType(); static s32 getCurrentBugNetType(); + static s32 getCurrentlyEquippedShieldType(); static bool isItemRestrictedByBokoBase(ITEM_ID item); diff --git a/include/d/a/obj/d_a_obj_toD3_stone_figure.h b/include/d/a/obj/d_a_obj_toD3_stone_figure.h index 9c7e1819..fd9e4f00 100644 --- a/include/d/a/obj/d_a_obj_toD3_stone_figure.h +++ b/include/d/a/obj/d_a_obj_toD3_stone_figure.h @@ -39,7 +39,7 @@ private: m3d::smdl_c mMdl; STATE_MGR_DECLARE(dAcOtoD3StoneFigure_c); dCcD_Cyl mCollision; - s8 mExitId; + u8 mExitId; bool mIsSkyKeepAlreadyOpen; }; diff --git a/include/d/d_camera.h b/include/d/d_camera.h index baf6246c..c0973223 100644 --- a/include/d/d_camera.h +++ b/include/d/d_camera.h @@ -5,6 +5,7 @@ #include "m/m_vec.h" extern "C" bool fn_80081FE0(void *, const char *); +extern "C" bool fn_800918E0(void *, s32, s16); class dCamera_c : public dBase_c { public: @@ -20,11 +21,17 @@ public: return mPositionMaybe; } + bool doFn_800918E0(s32 a1, s16 a2) { + return fn_800918E0(field_0xDA0, a1, a2); + } + private: /* 0x068 */ u8 _0x068[0x6C - 0x068]; /* 0x06C */ mVec3_c mPositionMaybe; /* 0x078 */ u8 _0x078[0xD98 - 0x078]; /* 0xD98 */ void *field_0xD98; + /* 0xD9C */ u8 _0xD9C[0xDA0 - 0xD9C]; + /* 0xDA0 */ void *field_0xDA0; }; #endif diff --git a/include/d/d_message.h b/include/d/d_message.h index 3c232312..684dd067 100644 --- a/include/d/d_message.h +++ b/include/d/d_message.h @@ -8,6 +8,193 @@ #include "libms/msgfile.h" #include "sized_string.h" +class dFlowBase_c { +protected: + enum Type_e { + FLOW_NONE, + FLOW_MESSAGE, + FLOW_BRANCH, + FLOW_EVENT, + FLOW_ENTRY, + FLOW_JUMP, + }; + +public: + virtual ~dFlowBase_c() {} + + /* vt 0x0C */ virtual void triggerEntryPoint(s32, s32) = 0; + /* vt 0x10 */ virtual void triggerEntryPoint(const char *) = 0; + /* vt 0x14 */ virtual void advanceFlow() = 0; + /* vt 0x18 */ virtual bool vt_0x18() const = 0; + /* vt 0x1C */ virtual bool handleEventInternal(const MsbFlowInfo *element) = 0; + /* vt 0x20 */ virtual bool handleEvent() = 0; + /* vt 0x24 */ virtual bool handleMessage() = 0; + /* vt 0x28 */ virtual bool handleBranch() = 0; + /* vt 0x2C */ virtual bool handleEntry() = 0; + /* vt 0x30 */ virtual bool handleJump() = 0; + /* vt 0x34 */ virtual void vt_0x34() {} +}; + +// Ghidra: ActorEventFlowManager +class dFlow_c : dFlowBase_c { + enum BranchValue_e { + BRANCH_00, + BRANCH_01, + BRANCH_02, + BRANCH_STORYFLAG, + BRANCH_04, + BRANCH_ZONEFLAG, + BRANCH_SCENEFLAG, + BRANCH_EVENT_COUNTER_THRESHOLD_1, + BRANCH_EVENT_COUNTER_THRESHOLD_2, + BRANCH_TEMPFLAG, + BRANCH_CURRENT_RUPEES, + BRANCH_RAND_2, + BRANCH_RAND_3, + BRANCH_RAND_4, + BRANCH_14, + BRANCH_15, + BRANCH_16, + BRANCH_FREE_SPACE_IN_POUCH, + BRANCH_18, + BRANCH_19, + BRANCH_FREE_SPACE_IN_ITEM_CHECK, + BRANCH_21, + BRANCH_22, + }; + + enum Event_e { + EVENT_SET_STORYFLAG = 0, + EVENT_UNSET_STORYFLAG = 1, + EVENT_SET_SCENEFLAG = 2, + EVENT_UNSET_SCENEFLAG = 3, + EVENT_SET_ZONEFLAG = 4, + EVENT_UNSET_ZONEFLAG = 5, + EVENT_DELAY = 6, + EVENT_07 = 7, + EVENT_RUPEES = 8, + EVENT_SET_ITEM = 9, + EVENT_EXIT = 10, + + EVENT_12 = 12, + + EVENT_COUNTER_THRESHOLD = 23, + EVENT_PLAY_SOUND = 24, + EVENT_ADD_ITEM = 25, + + EVENT_SET_TEMPFLAG = 28, + EVENT_UNSET_TEMPFLAG = 29, + + EVENT_LIGHT_PILLAR_30 = 30, + + EVENT_LIGHT_PILLAR_34 = 34, + + EVENT_SET_STORYFLAG_217 = 37, + EVENT_DEMO_METER_ITEM_SELECT = 38, + EVENT_CAMERA_42 = 42, + EVENT_LYT_MINI_GAME = 44, + EVENT_LYT_MINI_GAME_END = 45, + EVENT_46 = 46, + + EVENT_RESET_STORYFLAG = 52, + EVENT_SET_ITEMFLAG = 53, + EVENT_PALETTE = 54, + EVENT_DEMO_DOWSING = 55, + EVENT_DEMO_METER_DOWSING = 56, + EVENT_DEMO_METER_MINUS_BTN = 57, + EVENT_SELECT_STORY_DOWSING = 58, + EVENT_DEMO_COLLECTION_SCREEN = 59, + }; + +public: + dFlow_c(); + + virtual ~dFlow_c(); + + typedef u16 (dFlow_c::*BranchHandler)(const MsbFlowInfo *element) const; + + /* vt 0x0C */ virtual void triggerEntryPoint(s32 labelPart1, s32 labelPart2) override; + /* vt 0x10 */ virtual void triggerEntryPoint(const char *) override; + /* vt 0x14 */ virtual void advanceFlow() override; + /* vt 0x18 */ virtual bool vt_0x18() const override; + /* vt 0x1C */ virtual bool handleEventInternal(const MsbFlowInfo *element) override; + /* vt 0x20 */ virtual bool handleEvent() override; + /* vt 0x24 */ virtual bool handleMessage() override; + /* vt 0x28 */ virtual bool handleBranch() override; + /* vt 0x2C */ virtual bool handleEntry() override; + /* vt 0x30 */ virtual bool handleJump() override; + /* vt 0x38 */ virtual bool vt_0x38() const { + return 0; + } + /* vt 0x3C */ virtual u16 getSwitchChoice(const MsbFlowInfo *element, u16 param) const; + /* vt 0x40 */ virtual bool triggerEntryPointChecked(s32 labelPart1, s32 labelPart2); + + bool advanceUntilEvent(s32 searchParam3, s32 *pOutParams1n2); + bool advanceUntil(s32 searchType, s32 searchParam3, s32 *pOutParams1n2); + + u16 getField_0x44() const; + u16 getField_0x46() const; + +protected: + static s32 sExitId; + + static BranchHandler sBranchHandlers[]; + u16 branchHandler00(const MsbFlowInfo *element) const; + u16 branchHandler01(const MsbFlowInfo *element) const; + u16 branchHandler02(const MsbFlowInfo *element) const; + u16 branchHandler03(const MsbFlowInfo *element) const; + u16 branchHandler04(const MsbFlowInfo *element) const; + u16 branchHandler05(const MsbFlowInfo *element) const; + u16 branchHandler06(const MsbFlowInfo *element) const; + u16 branchHandler07(const MsbFlowInfo *element) const; + u16 branchHandler08(const MsbFlowInfo *element) const; + u16 branchHandler09(const MsbFlowInfo *element) const; + u16 branchHandler10(const MsbFlowInfo *element) const; + u16 branchHandler11(const MsbFlowInfo *element) const; + u16 branchHandler12(const MsbFlowInfo *element) const; + u16 branchHandler13(const MsbFlowInfo *element) const; + u16 branchHandler14(const MsbFlowInfo *element) const; + u16 branchHandler15(const MsbFlowInfo *element) const; + u16 branchHandler16(const MsbFlowInfo *element) const; + u16 branchHandler17(const MsbFlowInfo *element) const; + u16 branchHandler18(const MsbFlowInfo *element) const; + u16 branchHandler19(const MsbFlowInfo *element) const; + u16 branchHandler20(const MsbFlowInfo *element) const; + u16 branchHandler21(const MsbFlowInfo *element) const; + u16 branchHandler22(const MsbFlowInfo *element) const; + + u16 findEntryPoint(u16 labelPart1, u16 labelPart2); + u16 findEntryPoint(const char *label); + + void start(u16 entry); + void clear(); + void setNext(u16 next); + void setField0x3C(); + bool checkField0x3C() const; + bool matchesUnknownActorCategory(s32 id) const; + static void playSound(u32); + void createLytMiniGame(); + void clearMinigame(); + + /* 0x04 */ MsbfInfo *mpMsbf; + /* 0x08 */ s32 mCurrentFlowIndex; + /* 0x0C */ u16 field_0x0C; + /* 0x0E */ u8 field_0x0E; + /* 0x0F */ u8 field_0x0F; + /* 0x10 */ u8 field_0x10; + /* 0x14 */ s32 field_0x14; + /* 0x18 */ s32 mResultFromCounterCheck; + /* 0x1C */ SizedString<32> mCurrentTextLabelName; + /* 0x3C */ u8 field_0x3C; + /* 0x40 */ s32 field_0x40; + /* 0x44 */ u16 field_0x44; + /* 0x46 */ u16 field_0x46; + /* 0x48 */ s32 mDelayTimer; + /* 0x4C */ MsbFlowInfo mFlowInfo; + /* 0x5C */ s32 field_0x5C; + /* 0x60 */ s32 mFiInfo0; +}; + class dMessage_c : public dBase_c { public: dMessage_c(); @@ -30,6 +217,7 @@ public: return sTagProcessor; } + void clearLightPillarRelatedArgs(); void init(); void reset(); @@ -49,23 +237,63 @@ public: field_0x2FC = val; } + void setField_0x328(u8 val) { + field_0x328 = val; + } + s32 getField_0x32C() const { return field_0x32C; } + void setField_0x32C(s32 val) { + field_0x32C = val; + } + void setField_0x329(bool v) { field_0x329 = v; } + void setField_0x32A(bool v) { + field_0x32A = v; + } + bool getField_0x32A() const { return field_0x32A; } + void setField_0x330(bool v) { + field_0x330 = v; + } + + void setMiniGameVariant(s32 v) { + mMiniGameVariant = v; + } + + s32 getMiniGameVariant() const { + return mMiniGameVariant; + } + + void setField_0x344(s32 v) { + field_0x344 = v; + } + + u8 getField_0x340() const { + return field_0x340; + } + + void setField_0x340(u8 v) { + field_0x340 = v; + } + static bool isValidTextLabel(const char *name); static void loadTextByLabel(const char *label, dTagProcessor_c *tagProcessor, bool, u32, u32); static s32 getMsbtIndexForLabel(const char *name); static const char *getMsbtFileName(s32 index); + static MsbfInfo *getMsbfInfoForIndex(s32 index); + static s32 getMsbtIndexForMsbfIndex(s32); + static const char *getArcNameByIndex(s32 idx, bool); + static MsbtInfo *getMsbtInfoForIndex(s32 index); static const wchar_t *getTextMessageByLabel(const char *label, bool global, wchar_t *dstBuf, u32 maxLen); static const wchar_t * @@ -73,9 +301,16 @@ public: static const wchar_t *formatText(const wchar_t *text); - static MsbtInfo *getMsbtInfoForIndex(s32 index); - static MsbfInfo *getMsbfInfoForIndex(s32 index); - static const char *getArcNameByIndex(s32 idx, bool); + void storeLightPillarRelatedArg(u32); + u32 getLightPillarRelatedArg(s32); + + s32 getCurrentTextFileNumber() const { + return mCurrentTextFileNumber; + } + + void setCurrentTextFileNumber(s32 num) { + mCurrentTextFileNumber = num; + } private: static void *sZev0; @@ -105,7 +340,6 @@ private: s32 getTextIndexForLabel(const char *label); s32 getMsbtIndexForLabelInternal(const char *label); MsbtInfo *getMsbtInfoForIndexInternal(s32 index); - MsbfInfo *getMsbfInfoForIndexInternal(s32 index); static const char *getArcNameByIndexInternal(s32 idx, bool global); @@ -120,7 +354,7 @@ private: /* 0x2FC */ s32 field_0x2FC; - /* 0x300 */ u8 _0x300[0x328 - 0x300]; + /* 0x300 */ u32 field_0x300[10]; /* 0x328 */ bool field_0x328; /* 0x329 */ bool field_0x329; @@ -128,11 +362,12 @@ private: /* 0x32B */ u8 field_0x32B; /* 0x32C */ s32 field_0x32C; - /* 0x330 */ u8 _0x330[0x334 - 0x330]; + /* 0x330 */ u8 field_0x330; /* 0x334 */ u32 mMinigameResultPoints; /* 0x338 */ u32 mMinigameTime; - /* 0x33C */ u8 _0x33C[0x344 - 0x33C]; + /* 0x33C */ s32 mMiniGameVariant; + /* 0x340 */ u8 field_0x340; /* 0x344 */ s32 field_0x344; }; diff --git a/include/d/d_player.h b/include/d/d_player.h index bd6118d5..09c355b6 100644 --- a/include/d/d_player.h +++ b/include/d/d_player.h @@ -2,5 +2,8 @@ #define D_PLAYER_H #include "common.h" +#include "d/a/d_a_player.h" + +dAcPy_c *getLinkPtr(); #endif diff --git a/include/d/d_pouch.h b/include/d/d_pouch.h index a65d0097..80d671d1 100644 --- a/include/d/d_pouch.h +++ b/include/d/d_pouch.h @@ -2,11 +2,22 @@ #define D_POUCH_H #include "common.h" +#include "d/a/d_a_itembase.h" u32 convertFilePouchSlot(s32 fileSlot); s32 convertLytPouchSlot(s32 fileSlot); s32 getPouchSlotCount(bool unk); bool isItemExtraAmmo(s32 item); bool isItemMedal(s32 item); +bool hasAnyShields(); + +#define POUCH_SLOT_NONE 8 + +u8 adventurePouchFindItemSlot(ITEM_ID item); +u32 adventurePouchCountItem(ITEM_ID itemId); + +#define ITEM_CHECK_SLOT_NONE 60 + +u16 itemCheckFindItemSlot(ITEM_ID item); #endif diff --git a/include/d/d_sc_game.h b/include/d/d_sc_game.h index 33bd09d6..25c42b57 100644 --- a/include/d/d_sc_game.h +++ b/include/d/d_sc_game.h @@ -127,7 +127,7 @@ public: virtual int draw() override; virtual void deleteReady() override; - void triggerExit(s32 room, u8 exitIndex, s32 forcedNight = 2, s32 forcedTrial = 2); + void triggerExit(s32 room, u16 exitIndex, s32 forcedNight = 2, s32 forcedTrial = 2); // void triggerEntrance(const char *stageName, u8 room, ); const LinkReloadInfo &getLinkReloadInfo() const; diff --git a/include/d/d_stage.h b/include/d/d_stage.h index b7901d05..7e4dea81 100644 --- a/include/d/d_stage.h +++ b/include/d/d_stage.h @@ -137,7 +137,7 @@ public: return mFader.isStatus(mFaderBase_c::FADED_IN); } - u8 getCurrRoomId() const { + s8 getCurrRoomId() const { return curr_room_id; } @@ -158,7 +158,7 @@ private: /* 0x01A0 */ MapRelated mapRelated; /* 0x0394 */ u8 _0x394[0x39C - 0x394]; /* 0x039C */ u32 loaded_entities[2047]; - /* 0x2398 */ u8 curr_room_id; + /* 0x2398 */ s8 curr_room_id; /* 80575760 */ static dStage_c *sInstance; }; diff --git a/include/d/d_stage_mgr.h b/include/d/d_stage_mgr.h index c239a98d..05377c6f 100644 --- a/include/d/d_stage_mgr.h +++ b/include/d/d_stage_mgr.h @@ -48,6 +48,7 @@ public: STATE_FUNC_DECLARE(dStageMgr_c, RestartScene); public: + bool isAreaTypeNormal() const; bool isAreaTypeDungeon() const; bool isAreaTypeSky() const; bool isAreaTypeHouse() const; diff --git a/include/d/d_tag_processor.h b/include/d/d_tag_processor.h index d1b6fa0e..449c1388 100644 --- a/include/d/d_tag_processor.h +++ b/include/d/d_tag_processor.h @@ -132,6 +132,19 @@ public: field_0x82C = val; } + void setFields_0x8FC_0x900(s32 v1, s32 v2) { + field_0x8FC = v1; + field_0x900 = v2; + } + + s32 getField_0x8FC() const { + return field_0x8FC; + } + + s32 getField_0x900() const { + return field_0x900; + } + void setField_0x90D(u8 val) { field_0x90D = val; } diff --git a/include/d/lyt/d_lyt_control_game.h b/include/d/lyt/d_lyt_control_game.h index f8af08fc..d6908d2a 100644 --- a/include/d/lyt/d_lyt_control_game.h +++ b/include/d/lyt/d_lyt_control_game.h @@ -11,6 +11,9 @@ public: bool isInSomeMapState() const; bool isNotInStateMap() const; + void openCollectionScreenDemo(); + bool isStateNormalOrNotInEvent() const; + void somehowRelatedToEnteringLightPillars(s32, s32, s32); void fn_802CCD40(bool); diff --git a/include/d/lyt/d_lyt_demo_dowsing.h b/include/d/lyt/d_lyt_demo_dowsing.h new file mode 100644 index 00000000..e361b60f --- /dev/null +++ b/include/d/lyt/d_lyt_demo_dowsing.h @@ -0,0 +1,39 @@ +#ifndef D_LYT_DEMO_DOWSING_H +#define D_LYT_DEMO_DOWSING_H + +#include "common.h" +#include "d/d_base.h" +#include "d/lyt/d2d.h" +#include "s/s_State.hpp" + +class dLytDemoDowsing_c : public dBase_c { +public: + dLytDemoDowsing_c() : mStateMgr(*this, sStateID::null) { + sInstance = this; + } + virtual ~dLytDemoDowsing_c() { + sInstance = nullptr; + } + + static dLytDemoDowsing_c *GetInstance() { + return sInstance; + } + + void start() { + mShouldStart = true; + } + +private: + STATE_FUNC_DECLARE(dLytDemoDowsing_c, Wait); + STATE_FUNC_DECLARE(dLytDemoDowsing_c, Start); + + static dLytDemoDowsing_c *sInstance; + + /* 0x068 */ UI_STATE_MGR_DECLARE(dLytDemoDowsing_c); + /* 0x0A4 */ d2d::ResAccIf_c mResAcc; + /* 0x414 */ d2d::LytBase_c mLyt; + /* 0x4A4 */ d2d::AnmGroup_c mAnm[2]; + /* 0x524 */ bool mShouldStart; +}; + +#endif diff --git a/include/d/lyt/d_lyt_map.h b/include/d/lyt/d_lyt_map.h index 02f01563..652fcf4f 100644 --- a/include/d/lyt/d_lyt_map.h +++ b/include/d/lyt/d_lyt_map.h @@ -278,6 +278,7 @@ public: bool isOpenMaybe() const; bool fn_80139EA0() const; + void lightPillarRelated(s32, s32, s32); STATE_FUNC_DECLARE(dLytMapMain_c, Invisible); STATE_FUNC_DECLARE(dLytMapMain_c, RenderingWait); @@ -417,6 +418,10 @@ public: return isValid(val) && ((1 << (val - 2)) & 0x1D); } + void lightPillarRelated(s32 p1, s32 p2, s32 p3) { + mMapMain.lightPillarRelated(p1, p2, p3); + } + private: /* 0x0004 */ d2d::ResAccIf_c mResAcc; /* 0x0374 */ dLytMapMain_c mMapMain; diff --git a/include/d/lyt/d_lyt_mini_game.h b/include/d/lyt/d_lyt_mini_game.h new file mode 100644 index 00000000..a8065496 --- /dev/null +++ b/include/d/lyt/d_lyt_mini_game.h @@ -0,0 +1,25 @@ +#ifndef D_LYT_MINI_GAME_H +#define D_LYT_MINI_GAME_H + +#include "common.h" + +class dLytMiniGame_c { +public: + static dLytMiniGame_c *GetInstance() { + return sInstance; + } + + void timeRelatedExecute(); + void scoreRelatedExecute(); + + void setDisplayedTime(s32 time); + void setDisplayedPoints(s32 time); + + void timeRelated(); + void scoreRelated(); + +private: + static dLytMiniGame_c *sInstance; +}; + +#endif diff --git a/include/d/lyt/meter/d_lyt_meter.h b/include/d/lyt/meter/d_lyt_meter.h index de76952a..0e3c1068 100644 --- a/include/d/lyt/meter/d_lyt_meter.h +++ b/include/d/lyt/meter/d_lyt_meter.h @@ -239,6 +239,18 @@ public: return &sInstance->mMain; } + bool itemSelectDemoRelated(s32 arg) { + return mMain.mItemSelect.fn_800F0220(arg); + } + + bool dowsingDemoRelated(s32 arg) { + return mMain.mDowsing.fn_800FE3C0(arg); + } + + bool minusBtnDemoRelated(s32 arg) { + return mMain.mMinusBtn.demoRelated(arg); + } + // Not all of these inlines exist on dLytMeterMain_c // because accessing via GetMeter->get... causes // different instructions sometimes @@ -255,6 +267,10 @@ public: return mMain.field_0x13774; } + void setMeterField_0x13775(bool val) { + mMain.field_0x13775 = val; + } + bool getMeterField_0x1377F() const { return mMain.field_0x1377F; } @@ -309,6 +325,12 @@ public: } } + static void setRupyField_0x8AD(u8 val) { + if (sInstance != nullptr) { + sInstance->mMain.mRupy.setField_0x8AD(val); + } + } + static u8 getRupyField_0x8AC() { if (sInstance != nullptr) { return sInstance->mMain.mRupy.getField_0x8AC(); diff --git a/include/d/lyt/meter/d_lyt_meter_rupy.h b/include/d/lyt/meter/d_lyt_meter_rupy.h index cacdbc88..65b04517 100644 --- a/include/d/lyt/meter/d_lyt_meter_rupy.h +++ b/include/d/lyt/meter/d_lyt_meter_rupy.h @@ -109,6 +109,10 @@ public: field_0x8AC = val; } + void setField_0x8AD(u8 val) { + field_0x8AD = val; + } + void setSize(u8 size) { mSize = size; } diff --git a/include/d/lyt/msg_window/d_lyt_msg_window.h b/include/d/lyt/msg_window/d_lyt_msg_window.h index 7c8ad633..c454767b 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window.h @@ -36,10 +36,13 @@ public: bool isVisible() const; bool isOutputtingText() const; - void setCurrentLabelName(const char *name, bool storeFile); + bool setCurrentLabelName(const char *name, bool storeFile); void setCurrentEntrypointName(const char *name); void setCurrentFlowFilename(const char *name); + void setNumericArg0(s32 arg); + void setNumericArgs(s32 *arg, s32 argCount); + static dLytMsgWindow_c *getInstance() { return sInstance; } @@ -58,6 +61,22 @@ public: return sInstance->mEntryPointToTrigger; } + dTagProcessor_c *getTagProcessor() const { + return mpTagProcessor; + } + + u8 getField_0x80D() const { + return field_0x80D; + } + + u8 getField_0x815() const { + return field_0x815; + } + + s32 getTextOptionSelection() const { + return mTextOptionSelection; + } + private: bool setTextToDisplay(const wchar_t *text); void createSubMsgManager(u8 type); diff --git a/include/libms/flowfile.h b/include/libms/flowfile.h index dbd5be3d..0fe9b525 100644 --- a/include/libms/flowfile.h +++ b/include/libms/flowfile.h @@ -12,10 +12,10 @@ struct MsbfInfo; struct MsbFlowInfo { /* 0x00 */ unsigned char type; /* 0x01 */ char subType; - /* 0x04 */ int params1n2; + /* 0x04 */ unsigned int params1n2; /* 0x08 */ short next; - /* 0x0A */ short param3; - /* 0x0C */ short param4; + /* 0x0A */ unsigned short param3; + /* 0x0C */ unsigned short param4; /* 0x0E */ unsigned short param5; }; diff --git a/include/rvl/OS.h b/include/rvl/OS.h index e298765c..8fd3e5b4 100644 --- a/include/rvl/OS.h +++ b/include/rvl/OS.h @@ -6,7 +6,7 @@ #ifdef __cplusplus extern "C" { #endif - +// IWYU pragma: begin_exports #include "rvl/OS/OS.h" #include "rvl/OS/OSAddress.h" #include "rvl/OS/OSAlarm.h" @@ -39,6 +39,7 @@ extern "C" { #include "rvl/OS/OSTime.h" #include "rvl/OS/OSUtf.h" #include "rvl/OS/__ppc_eabi_init.h" +// IWYU pragma: end_exports #ifdef __cplusplus } diff --git a/include/sized_string.h b/include/sized_string.h index 391eefdc..dc711238 100644 --- a/include/sized_string.h +++ b/include/sized_string.h @@ -43,6 +43,13 @@ struct SizedString { } } + void set(const char *src) { + if (src != mChars) { + mChars[0] = '\0'; + append(src); + } + } + void operator+=(const char *src) { if (src != nullptr) { append(src); diff --git a/include/toBeSorted/blur_and_palette_manager.h b/include/toBeSorted/blur_and_palette_manager.h index b7af8384..b86394dd 100644 --- a/include/toBeSorted/blur_and_palette_manager.h +++ b/include/toBeSorted/blur_and_palette_manager.h @@ -231,6 +231,8 @@ public: } void fn_800223A0(void *); void fn_80022440(void *); + // light pillar related + void fn_80024240(s16, s16, s16); u8 get0x2DE8() const { return field_0x2DE0[8]; diff --git a/include/toBeSorted/fi_context.h b/include/toBeSorted/fi_context.h new file mode 100644 index 00000000..6f3f8cd7 --- /dev/null +++ b/include/toBeSorted/fi_context.h @@ -0,0 +1,141 @@ +#ifndef FI_CONTEXT_H +#define FI_CONTEXT_H + +#include "common.h" + +struct FiAnalysisEntry { + /* 0x00 */ const char *mStageName; + /* 0x04 */ u16 mStoryFlag; + /* 0x06 */ s16 mKen3MonsterPresenceEntry; + /* 0x08 */ u8 mSuitabilityPercent[4]; + /* 0x0C */ u16 mKen3SuitabilityAnalysis[4]; + /* 0x14 */ s16 mShieldType; + /* 0x16 */ s16 mShieldMessage; +}; + +class FiAnalysisHandle { +public: + s16 getEquipmentFocus() const; + s16 getAreaIndexForFiAreaName() const; + s32 getSuitabilityArg() const; + s16 getSuitabilityLabel() const; + s16 getShieldMessage(); + s16 shieldRelated(); + + bool isValid() const; + +private: + FiAnalysisEntry *mpEntry; +}; + +class FiContext { +public: + static void create(); + static s32 getGlobalFiInfo0(s32); + static FiAnalysisHandle getNaviTableEquipmentCheckEntry(); + static u8 rateBattlePerformance(u8 enemyActorId); + static s16 getNaviTableProgressSummary(); + static s16 getFiAdviceHintEntry(); + static s16 getUnkObjectiveValue(); + + bool getDoSpecialFiMenuHandling() const { + return mDoSpecialFiMenuHandling; + } + + static bool getDoSpecialFiMenuHandlingChecked() { + if (sInstance != nullptr) { + return sInstance->getDoSpecialFiMenuHandling(); + } else { + return false; + } + } + + static void setDoSpecialFiMenuHandling(bool val) { + if (sInstance != nullptr) { + sInstance->mDoSpecialFiMenuHandling = val; + } + } + + static const wchar_t *getMessageForFiInfo(s32 arg) { + return getTextMessage(getGlobalFiInfo0(arg)); + } + + static FiContext *GetInstance() { + return sInstance; + } + + static void setField_0x48(bool val) { + if (sInstance != nullptr) { + sInstance->field_0x48 = val; + } + } + + static void setField_0x4A(bool val) { + if (sInstance != nullptr) { + sInstance->field_0x4A = val; + } + } + + static s32 getHelpIndex() { + if (sInstance != nullptr) { + return sInstance->mFiHelpIndex; + } else { + return -1; + } + } + + static s32 getTargetActorId() { + if (sInstance != nullptr) { + return sInstance->mTargetActorId; + } else { + return -1; + } + } + + static void do_fn_8016CB00(s32 arg) { + if (sInstance != nullptr) { + sInstance->fn_8016CB00(arg); + } + } + + static void do_fn_8016CB40() { + if (sInstance != nullptr) { + sInstance->fn_8016CB40(); + } + } + + static void do_fn_8016CA00() { + if (sInstance != nullptr) { + sInstance->fn_8016CA00(); + } + } + + static void do_fn_8016CB20() { + if (sInstance != nullptr) { + sInstance->fn_8016CB20(); + } + } + + void resetField_0x3C(); + + static const wchar_t *getTextMessage(s32 idx); + +private: + static FiContext *sInstance; + + void fn_8016CB00(s32); + void fn_8016CB40(); + void fn_8016CA00(); + void fn_8016CB20(); + + /* 0x00 */ u8 _0x00[0x34 - 0x00]; + /* 0x34 */ s32 mTargetActorId; + /* 0x38 */ s32 mFiHelpIndex; + /* 0x3C */ u8 _0x3C[0x48 - 0x3C]; + /* 0x48 */ bool field_0x48; + /* 0x49 */ bool field_0x49; + /* 0x4A */ bool field_0x4A; + /* 0x4B */ bool mDoSpecialFiMenuHandling; +}; + +#endif diff --git a/include/toBeSorted/global_fi_context.h b/include/toBeSorted/global_fi_context.h deleted file mode 100644 index 585f416d..00000000 --- a/include/toBeSorted/global_fi_context.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef GLOBAL_FI_CONTEXT_H -#define GLOBAL_FI_CONTEXT_H - -#include "common.h" - -struct FiContext { - /* 0x00 */ u8 _0x00[0x4B - 0x00]; - /* 0x4B */ bool mDoSpecialFiMenuHandling; - - static s32 getGlobalFiInfo0(s32); -}; - -extern "C" FiContext *GLOBAL_FI_CONTEXT; -extern "C" void fn_8016C9F0(FiContext *); -extern "C" void createGlobalFiContext(); - -#endif diff --git a/include/toBeSorted/music_mgrs.h b/include/toBeSorted/music_mgrs.h index 7beeb58e..cbd56564 100644 --- a/include/toBeSorted/music_mgrs.h +++ b/include/toBeSorted/music_mgrs.h @@ -17,8 +17,13 @@ extern "C" void fn_803618F0(void *); extern "C" void fn_80362730(void *); extern "C" void fn_80365D20(void *); extern "C" void fn_803624F0(void *); +extern "C" void fn_80364FD0(void *, s32); extern "C" void *ENEMY_BGM_RELATED_MGR; extern "C" void fn_80384570(void *, bool); +extern "C" void fn_803858D0(void *); + +extern "C" void *FANFARE_SOUND_MGR; +extern "C" void AnotherSoundMgr__playSound(void *, s32); #endif diff --git a/include/toBeSorted/unk_save_time.h b/include/toBeSorted/unk_save_time.h new file mode 100644 index 00000000..ef947c35 --- /dev/null +++ b/include/toBeSorted/unk_save_time.h @@ -0,0 +1,27 @@ +#ifndef UNK_SAVE_TIME_H +#define UNK_SAVE_TIME_H + +#include "common.h" + +class SaveTimeRelated { +public: + static SaveTimeRelated *GetInstance() { + return sInstance; + } + + s64 getField_0x08() const { + return field_0x08; + } + + s64 fn_801907D0(); + void fn_801907F0(); + void fn_801909A0(); + +private: + static SaveTimeRelated *sInstance; + + /* 0x00 */ u8 _0x00[0x08 - 0x00]; + /* 0x08 */ u64 field_0x08; +}; + +#endif diff --git a/src/REL/d/t/d_t_reaction.cpp b/src/REL/d/t/d_t_reaction.cpp index f165f90c..7c7849d4 100644 --- a/src/REL/d/t/d_t_reaction.cpp +++ b/src/REL/d/t/d_t_reaction.cpp @@ -6,6 +6,7 @@ #include "d/a/d_a_player.h" #include "d/col/c/c_cc_d.h" #include "d/col/cc/d_cc_s.h" +#include "d/d_pouch.h" #include "d/flag/sceneflag_manager.h" #include "m/m_angle.h" #include "toBeSorted/small_sound_mgr.h" @@ -37,7 +38,6 @@ bool dTgReaction_c::createHeap() { } extern "C" bool isHeroMode(); -extern "C" u32 adventurePouchCountItem(u32 itemId); int dTgReaction_c::create() { // Note the double _c here diff --git a/src/d/a/obj/d_a_obj_tbox.cpp b/src/d/a/obj/d_a_obj_tbox.cpp index 81d3923e..38fe0513 100644 --- a/src/d/a/obj/d_a_obj_tbox.cpp +++ b/src/d/a/obj/d_a_obj_tbox.cpp @@ -11,6 +11,7 @@ #include "d/col/c/c_bg_s_poly_info.h" #include "d/col/cc/d_cc_d.h" #include "d/col/cc/d_cc_s.h" +#include "d/d_pouch.h" #include "d/d_room.h" #include "d/d_stage.h" #include "d/flag/sceneflag_manager.h" @@ -1935,8 +1936,6 @@ void dAcTbox_c::finalizeState_LoadArchive() {} extern "C" void fn_800298B0(u16 effectIndex, mVec3_c *, mAng3_c *, mVec3_c *, void *, void *, void *, void *); extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_209_; extern "C" const bool isPouchItem(u16); -extern "C" u8 adventurePouchFindItemSlot(ITEM_ID item); -extern "C" u16 findItemInItemCheck(ITEM_ID item); extern "C" dAcItem_c *giveItem3(u16 item, s32); void dAcTbox_c::initializeState_Open() { @@ -1962,7 +1961,8 @@ void dAcTbox_c::initializeState_Open() { } fn_8026D140(); ITEM_ID itemId = mItemId != 0 ? (ITEM_ID)mItemId : ITEM_GODDESS_HARP; - if (isPouchItem(itemId) && adventurePouchFindItemSlot(ITEM_NONE) == 8 && findItemInItemCheck(ITEM_NONE) == 0x3C) { + if (isPouchItem(itemId) && adventurePouchFindItemSlot(ITEM_NONE) == POUCH_SLOT_NONE && + itemCheckFindItemSlot(ITEM_NONE) == ITEM_CHECK_SLOT_NONE) { setShouldCloseFlag(); } dAcItem_c *item = giveItem3(itemId, -1); diff --git a/src/d/d_message.cpp b/src/d/d_message.cpp index 8b6d7669..655e68bd 100644 --- a/src/d/d_message.cpp +++ b/src/d/d_message.cpp @@ -1,20 +1,1166 @@ #include "d/d_message.h" +#include "c/c_math.h" #include "common.h" +#include "d/a/d_a_item.h" +#include "d/a/d_a_itembase.h" +#include "d/a/d_a_player.h" +#include "d/d_base.h" +#include "d/d_player.h" +#include "d/d_pouch.h" #include "d/d_sc_game.h" +#include "d/d_stage.h" +#include "d/d_stage_mgr.h" #include "d/d_tag_processor.h" #include "d/d_textunk.h" +#include "d/flag/itemflag_manager.h" +#include "d/flag/sceneflag_manager.h" +#include "d/flag/storyflag_manager.h" +#include "d/lyt/d_lyt_control_game.h" +#include "d/lyt/d_lyt_demo_dowsing.h" +#include "d/lyt/d_lyt_map.h" +#include "d/lyt/d_lyt_mini_game.h" +#include "d/lyt/meter/d_lyt_meter.h" +#include "d/lyt/msg_window/d_lyt_msg_window.h" #include "egg/core/eggHeap.h" #include "f/f_base.h" #include "f/f_profile.h" #include "f/f_profile_name.h" +#include "libms/flowfile.h" #include "libms/libms.h" #include "libms/msgfile.h" #include "sized_string.h" #include "toBeSorted/arc_managers/oarc_manager.h" +#include "toBeSorted/blur_and_palette_manager.h" +#include "toBeSorted/dowsing_target.h" #include "toBeSorted/event_manager.h" -#include "toBeSorted/global_fi_context.h" +#include "toBeSorted/fi_context.h" +#include "toBeSorted/file_manager.h" +#include "toBeSorted/minigame_mgr.h" +#include "toBeSorted/music_mgrs.h" +#include "toBeSorted/small_sound_mgr.h" +#include "toBeSorted/unk_save_time.h" +#include "rvl/OS.h" + +#include +#include + +s32 dFlow_c::sExitId = -1; + +dFlow_c::dFlow_c() { + field_0x14 = 0; + mpMsbf = nullptr; + mCurrentFlowIndex = -1; + field_0x0E = 0; + field_0x0F = 0; + field_0x10 = 1; + field_0x3C = 0; + field_0x40 = -1; + field_0x44 = -1; + field_0x46 = -1; + mDelayTimer = 0; + field_0x5C = -1; +} + +dFlow_c::~dFlow_c() {} + +u16 dFlow_c::findEntryPoint(u16 labelPart1, u16 labelPart2) { + char buf[8]; + for (int i = 0; i < 8; i++) { + buf[i] = '\0'; + } + u16 ret = 0xFFFF; + if (labelPart1 < 100) { + sprintf(buf, "%03d_%03d", labelPart1, labelPart2); + } else { + sprintf(buf, "%03d_%02d", labelPart1, labelPart2); + } + for (int i = 0; i < 80; i++) { + if (dMessage_c::getMsbfInfoForIndex(i) != nullptr) { + int entry = LMS_GetEntrypoint(dMessage_c::getMsbfInfoForIndex(i), buf); + if (entry >= 0) { + mpMsbf = dMessage_c::getMsbfInfoForIndex(i); + s32 fileNumber = dMessage_c::getMsbtIndexForMsbfIndex(i); + ret = entry; + dMessage_c::getInstance()->setCurrentTextFileNumber(fileNumber); + } + } + } + + const char *arcName = dMessage_c::getArcNameByIndex(labelPart1 / 100, true); + dLytMsgWindow_c::getInstance()->setCurrentFlowFilename(arcName); + dLytMsgWindow_c::getInstance()->setCurrentEntrypointName(buf); + return ret; +} + +u16 dFlow_c::findEntryPoint(const char *label) { + u16 ret = 0xFFFF; + for (int i = 0; i < 80; i++) { + if (dMessage_c::getMsbfInfoForIndex(i) != nullptr) { + int entry = LMS_GetEntrypoint(dMessage_c::getMsbfInfoForIndex(i), label); + if (entry >= 0) { + mpMsbf = dMessage_c::getMsbfInfoForIndex(i); + s32 fileNumber = dMessage_c::getMsbtIndexForMsbfIndex(i); + ret = entry; + dMessage_c::getInstance()->setCurrentTextFileNumber(fileNumber); + } + } + } + + const char *arcName = dMessage_c::getArcNameByIndex(dLytMsgWindow_c::fn_800D7B40() / 10000, true); + dLytMsgWindow_c::getInstance()->setCurrentFlowFilename(arcName); + dLytMsgWindow_c::getInstance()->setCurrentEntrypointName(label); + return ret; +} + +void dFlow_c::setNext(u16 next) { + if (next != 0xFFFF) { + if (mCurrentFlowIndex != next) { + mCurrentFlowIndex = next; + } else { + clear(); + } + } else { + clear(); + } +} + +void dFlow_c::advanceFlow() { + bool keepGoing = true; + + if (dLytMsgWindow_c::getInstance()->getTagProcessor()->getField_0x8FC() >= 0 && + dLytMsgWindow_c::getInstance()->getTagProcessor()->getField_0x900() >= 0) { + triggerEntryPoint( + dLytMsgWindow_c::getInstance()->getTagProcessor()->getField_0x8FC(), + dLytMsgWindow_c::getInstance()->getTagProcessor()->getField_0x900() + ); + field_0x0F = 1; + dLytMsgWindow_c::getInstance()->getTagProcessor()->setFields_0x8FC_0x900(-1, -1); + } else { + while (keepGoing && !vt_0x18() && !dLytMsgWindow_c::getInstance()->getField_0x815() && !checkField0x3C()) { + MsbFlowInfo *element = LMS_GetFlowElement(mpMsbf, mCurrentFlowIndex); + s32 prevIdx = mCurrentFlowIndex; + s32 type = element->type; + mCurrentTextLabelName = ""; + switch (type) { + case FLOW_MESSAGE: keepGoing = handleMessage(); break; + case FLOW_BRANCH: keepGoing = handleBranch(); break; + case FLOW_EVENT: + handleEvent(); + keepGoing = false; + break; + case FLOW_ENTRY: keepGoing = handleEntry(); break; + case FLOW_JUMP: keepGoing = handleJump(); break; + } + field_0x10 = prevIdx != mCurrentFlowIndex; + if (field_0x10) { + memcpy(&mFlowInfo, element, sizeof(MsbFlowInfo)); + } + } + } +} + +bool dFlow_c::advanceUntilEvent(s32 searchParam3, s32 *pOutParams1n2) { + return advanceUntil(FLOW_EVENT, searchParam3, pOutParams1n2) == true; +} + +bool dFlow_c::vt_0x18() const { + bool ret = false; + if (field_0x0E && dLytMsgWindow_c::getInstance()->getField_0x815() == false) { + ret = true; + } + return ret; +} + +struct FlowSoundDef { + /* 0x00 */ u32 mParams; + /* 0x04 */ u32 mSoundMgr; + /* 0x08 */ WZSound mSoundId; +}; + +static const FlowSoundDef sSoundDefs[] = { + { 1, 0, FAN_ITEM_GET_MINI}, + { 2, 0, FAN_ITEM_GET}, + { 3, 0, FAN_HEART_GET}, + { 4, 1, SE_S_MSG_IMPORTANT}, + { 5, 1, SE_S_REACTION}, + { 6, 1, SE_S_MSG_GOOD}, + { 7, 1, SE_S_MSG_PRESAGE}, + { 8, 0, FAN_TRANSITION_IMPACT_01}, + { 9, 1, SE_S_READ_RIDDLE_A}, + {10, 1, SE_S_READ_RIDDLE_B}, +}; + +void dFlow_c::playSound(u32 params) { + if (params >= 1000) { + fn_80364FD0(ENEMY_SOUND_MGR, params); + return; + } + if (params >= 100) { + fn_803858D0(ENEMY_BGM_RELATED_MGR); + return; + } + + s32 idx = -1; + for (int i = 0; i < 10; i++) { + if (sSoundDefs[i].mParams == params) { + idx = i; + break; + } + } + + if (idx < 0) { + return; + } + + switch (sSoundDefs[idx].mSoundMgr) { + case 0: AnotherSoundMgr__playSound(FANFARE_SOUND_MGR, sSoundDefs[idx].mSoundId); break; + case 1: SmallSoundManager::GetInstance()->playSound(sSoundDefs[idx].mSoundId); break; + } +} + +bool dFlow_c::handleEventInternal(const MsbFlowInfo *element) { + u32 params1n2 = element->params1n2; + switch (element->param3) { + case EVENT_SET_STORYFLAG: + StoryflagManager::sInstance->setFlag(params1n2); + if (params1n2 == 0x52) { + dLytMeter_c::GetInstance()->setMeterField_0x13775(true); + } + if (dLytMsgWindow_c::fn_800D7B40() != 50013 && dLytMsgWindow_c::fn_800D7B40() != 20061) { + if (params1n2 == 100 || params1n2 == 64 || params1n2 == 271 || params1n2 == 81 || params1n2 == 668 || + params1n2 == 669) { + FileManager::GetInstance()->setDowsingSlotIdx(DowsingTarget::SLOT_STORY_EVENT); + } else if (params1n2 == 106 || params1n2 == 107) { + FileManager::GetInstance()->setDowsingSlotIdx(DowsingTarget::SLOT_QUEST); + } + } + break; + case EVENT_UNSET_STORYFLAG: StoryflagManager::sInstance->unsetFlag(params1n2); break; + case EVENT_SET_SCENEFLAG: + dStageMgr_c::GetInstance()->getFlagIndex(); + SceneflagManager::sInstance->setFlag(0x3F, (params1n2 >> 16) & 0xFFFF); + break; + case EVENT_UNSET_SCENEFLAG: + dStageMgr_c::GetInstance()->getFlagIndex(); + SceneflagManager::sInstance->unsetFlag(0x3F, (params1n2 >> 16) & 0xFFFF); + break; + case EVENT_SET_ZONEFLAG: + dStageMgr_c::GetInstance()->getFlagIndex(); + SceneflagManager::sInstance->setFlag( + dStage_c::GetInstance()->getCurrRoomId(), ((params1n2 >> 16) & 0xFFFF) + 0xC0 + ); + break; + case EVENT_UNSET_ZONEFLAG: + dStageMgr_c::GetInstance()->getFlagIndex(); + SceneflagManager::sInstance->unsetFlag( + dStage_c::GetInstance()->getCurrRoomId(), ((params1n2 >> 16) & 0xFFFF) + 0xC0 + ); + break; + case EVENT_DELAY: + mDelayTimer++; + if (mDelayTimer < params1n2) { + return false; + } + mDelayTimer = 0; + break; + case EVENT_07: + if (params1n2 == -1) { + s32 hi, lo; + s32 selectedOption = dLytMsgWindow_c::getInstance()->getTextOptionSelection(); + mFiInfo0 = FiContext::getGlobalFiInfo0(selectedOption); + switch (mFiInfo0) { + case 0: { + hi = 6; + lo = 1; + field_0x5C = FiContext::getNaviTableProgressSummary(); + break; + } + case 11: + hi = 6; + lo = 100; + field_0x5C = FiContext::getFiAdviceHintEntry(); + break; + case 2: { + hi = 6; + lo = 200; + field_0x5C = FiContext::getUnkObjectiveValue(); + break; + } + case 3: { + FiAnalysisHandle handle = FiContext::getNaviTableEquipmentCheckEntry(); + if (handle.isValid()) { + hi = 6; + lo = 300; + } else { + hi = 6; + lo = 301; + } + field_0x5C = 5; + break; + } + case 4: + hi = 6; + lo = 800; + break; + case 9: + hi = 6; + lo = 802; + break; + case 1: { + hi = 6; + lo = 100; + field_0x5C = FiContext::getFiAdviceHintEntry(); + break; + } + case 5: + hi = 6; + lo = 900; + break; + } + FiContext::do_fn_8016CB00(FiContext::getGlobalFiInfo0(selectedOption)); + field_0x46 = lo + hi * 1000; + } else { + triggerEntryPoint((params1n2 >> 16) & 0xFFFF, params1n2 & 0xFFFF); + field_0x0F = 1; + } + break; + case EVENT_RUPEES: + if (dMessage_c::getInstance()->getField_0x2FC() != -1) { + dMessage_c::getInstance()->setField_0x2FC(0x3C); + } + dAcItem_c::addRupees(params1n2); + if ((s32)params1n2 > 0) { + dLytMeter_c::setRupyField_0x8AD(1); + } + break; + case EVENT_SET_ITEM: { + u16 flag = params1n2 & 0xFFFF; + ItemflagManager::sInstance->setFlag(flag | 0x4000); + switch (params1n2) { + case ITEM_FARORES_COURAGE: + case ITEM_NAYRUS_WISDOM: + case ITEM_DINS_POWER: + case ITEM_SOTH: FileManager::GetInstance()->setDowsingSlotIdx(DowsingTarget::SLOT_STORY_EVENT); break; + } + break; + } + case EVENT_EXIT: { + u16 id = (params1n2 >> 16) & 0xFFFF; + sExitId = id; + if ((params1n2 & 0xFFFF) == 1) { + dScGame_c::GetInstance()->triggerExit( + dStage_c::GetInstance()->getCurrRoomId(), id, SpawnInfo::RETAIN_TOD, SpawnInfo::NO_TRIAL + ); + } else { + dScGame_c::GetInstance()->triggerExit( + dStage_c::GetInstance()->getCurrRoomId(), id, SpawnInfo::RETAIN_TOD, SpawnInfo::RETAIN_TRIAL + ); + } + return 0; + } + case EVENT_12: + if (params1n2 == 1) { + dMessage_c::getInstance()->setField_0x2FC(-1); + } else { + dLytMeter_c::setRupyField_0x8AC(1); + dMessage_c::getInstance()->setField_0x2FC(0); + } + break; + case EVENT_COUNTER_THRESHOLD: { + u16 counter = (params1n2 >> 16) & 0xFFFF; + u16 threshold = (params1n2 & 0xFFFF); + if (counter == 0x1F5) { + counter = dAcItem_c::getRupeeCounter(); + } else if (counter == 0x1ED) { + counter = dAcItem_c::getTotalSeedCount(); + } else if (counter == 0x1F2) { + counter = dAcItem_c::getTotalArrowCount(); + } else if (counter == 0x1F3) { + counter = dAcItem_c::getTotalBombCount(); + } else { + counter = ItemflagManager::sInstance->getCounterOrFlag(counter | 0x4000); + } + + if (counter >= threshold) { + mResultFromCounterCheck = 0; + } else { + mResultFromCounterCheck = 1; + } + break; + } + case EVENT_PLAY_SOUND: playSound(params1n2); break; + case EVENT_ADD_ITEM: { + u16 flag = (params1n2 >> 16) & 0xFFFF; + s16 change = (s16)(params1n2 & 0xFFFF); + s32 value = ItemflagManager::sInstance->getCounterOrFlag(flag | 0x4000); + value += change; + if (value < 0) { + value = 0; + } else if (value > 0x8000) { + value = 0x7FFF; + } + ItemflagManager::sInstance->setFlagOrCounterToValue(flag | 0x4000, value); + break; + } + case EVENT_SET_TEMPFLAG: + dStageMgr_c::GetInstance()->getFlagIndex(); + SceneflagManager::sInstance->setFlag(0x3F, ((params1n2 >> 16) & 0xFFFF) + 0x80); + break; + case EVENT_UNSET_TEMPFLAG: + dStageMgr_c::GetInstance()->getFlagIndex(); + SceneflagManager::sInstance->unsetFlag(0x3F, ((params1n2 >> 16) & 0xFFFF) + 0x80); + break; + case EVENT_LIGHT_PILLAR_30: { + s8 p4 = (params1n2 >> 24) & 0xFF; + s8 p1 = params1n2 & 0xFF; + s8 p3 = (params1n2 >> 16) & 0xFF; + s8 p2 = (params1n2 >> 8) & 0xFF; + s32 val = 1; + switch (p1) { + case 1: val = 4; break; + case 2: val = 3; break; + case 3: val = 5; break; + case 5: val = 7; break; + case 6: val = 8; break; + case 7: val = 9; break; + } + dMessage_c::getInstance()->setField_0x32C(val); + dMessage_c::getInstance()->setField_0x329(true); + if (dMessage_c::getInstance()->getField_0x328() == 0) { + dMessage_c::getInstance()->setField_0x328(1); + dMessage_c::getInstance()->clearLightPillarRelatedArgs(); + if (dLytControlGame_c::getInstance()->isStateNormalOrNotInEvent()) { + dLytControlGame_c::getInstance()->somehowRelatedToEnteringLightPillars(val, p3, p2); + } + } else { + dLytMap_c::getInstance()->lightPillarRelated(val, p3, p2); + } + dMessage_c::getInstance()->storeLightPillarRelatedArg(p4); + break; + } + case EVENT_LIGHT_PILLAR_34: { + if (params1n2 == 1) { + if (!dLytControlGame_c::getInstance()->isNotInStateMap()) { + dLytControlGame_c::getInstance()->fn_802CCD40(true); + } + } else if (params1n2 == 2) { + dMessage_c::getInstance()->setField_0x330(1); + if (dMessage_c::getInstance()->getField_0x32C() != 4 && + dMessage_c::getInstance()->getField_0x32C() != 12) { + dMessage_c::getInstance()->setField_0x32A(1); + } + } else { + if (dMessage_c::getInstance()->getField_0x32C() != 4 && + dMessage_c::getInstance()->getField_0x32C() != 12) { + dMessage_c::getInstance()->setField_0x32A(1); + } + } + dMessage_c::getInstance()->setField_0x328(0); + break; + } + case EVENT_SET_STORYFLAG_217: + StoryflagManager::sInstance->setFlagOrCounterToValue( + 217, dLytMsgWindow_c::getInstance()->getTextOptionSelection() + ); + break; + case EVENT_DEMO_METER_ITEM_SELECT: return dLytMeter_c::GetInstance()->itemSelectDemoRelated(params1n2); + case EVENT_CAMERA_42: { + s32 p1 = (params1n2 >> 16) & 0xFFFF; + s32 p2 = params1n2 & 0xFFFF; + dScGame_c::getCamera(0)->doFn_800918E0(p1, p2); + break; + } + case EVENT_LYT_MINI_GAME: { + if (dMessage_c::getInstance()->getField_0x340() != 0) { + // cancel something minigame related if running + clearMinigame(); + } + // start something minigame related + dMessage_c::getInstance()->setMiniGameVariant(params1n2); + createLytMiniGame(); + break; + } + case EVENT_LYT_MINI_GAME_END: + // cancel something minigame related + clearMinigame(); + break; + case EVENT_46: dMessage_c::getInstance()->setField_0x344(params1n2); break; + case EVENT_RESET_STORYFLAG: StoryflagManager::sInstance->setFlagOrCounterToValue(params1n2 & 0xFFFF, 0); break; + case EVENT_SET_ITEMFLAG: dAcItem_c::setFlag(params1n2 & 0xFFFF); break; + case EVENT_PALETTE: { + s16 p1 = (params1n2 >> 16) & 0xFFFF; + s16 p2 = params1n2 & 0xFFFF; + if (&BlurAndPaletteManager::GetInstance() != nullptr) { + BlurAndPaletteManager::GetInstance().fn_80024240(-1, p1, p2); + } + break; + } + case EVENT_DEMO_DOWSING: + if (dLytDemoDowsing_c::GetInstance() != nullptr) { + dLytDemoDowsing_c::GetInstance()->start(); + } + break; + case EVENT_DEMO_METER_DOWSING: return dLytMeter_c::GetInstance()->dowsingDemoRelated(params1n2); break; + case EVENT_DEMO_METER_MINUS_BTN: return dLytMeter_c::GetInstance()->minusBtnDemoRelated(params1n2); break; + case EVENT_SELECT_STORY_DOWSING: + FileManager::GetInstance()->setDowsingSlotIdx(DowsingTarget::SLOT_STORY_EVENT); + break; + case EVENT_DEMO_COLLECTION_SCREEN: + if (!MinigameManager::isInMinigameState(MinigameManager::INSECT_CAPTURE)) { + dLytControlGame_c::getInstance()->openCollectionScreenDemo(); + } + break; + } + + return true; +} + +bool dFlow_c::handleEvent() { + MsbFlowInfo *element = LMS_GetFlowElement(mpMsbf, mCurrentFlowIndex); + u16 next = element->next; + if (handleEventInternal(element)) { + if (next != 0xFFFF) { + setNext(next); + if (checkField0x3C()) { + field_0x40 = mCurrentFlowIndex; + field_0x44 = dLytMsgWindow_c::fn_800D7B40(); + } + } else if (field_0x0F != 0) { + field_0x0F = 0; + } else { + clear(); + } + return true; + } else { + return false; + } +} + +bool dFlow_c::handleMessage() { + char label[40]; + MsbFlowInfo *flow = LMS_GetFlowElement(mpMsbf, mCurrentFlowIndex); + int hasLabel = LMS_GetLabelByTextIndex( + dMessage_c::getMsbtInfoForIndex(dMessage_c::getInstance()->getCurrentTextFileNumber()), flow->param4, label + ); + mCurrentTextLabelName.set(label); + u16 next = flow->next; + // Does this make sense? Result is unused... + LMS_GetAttribute(dMessage_c::getMsbtInfoForIndex(dMessage_c::getInstance()->getCurrentTextFileNumber()), hasLabel); + if (mCurrentTextLabelName == "KEN0_08") { + if (field_0x5C < 0) { + field_0x5C = 8; + } + mCurrentTextLabelName.sprintf("KEN0_%02d", field_0x5C); + } else if (mCurrentTextLabelName == "KEN1_000") { + if (field_0x5C < 0) { + field_0x5C = 0; + } + mCurrentTextLabelName.sprintf("KEN1_%03d", field_0x5C); + } else if (mCurrentTextLabelName == "KEN2_000") { + if (field_0x5C < 0) { + field_0x5C = 2; + } + mCurrentTextLabelName.sprintf("KEN2_%03d", field_0x5C); + } else if (mCurrentTextLabelName == "KEN3_500") { + FiAnalysisHandle analysis = FiContext::getNaviTableEquipmentCheckEntry(); + SizedString<16> label; + label.sprintf("KEN3_%03d", analysis.getEquipmentFocus()); + dLytMsgWindow_c::getInstance()->getTagProcessor()->setStringArg( + dMessage_c::getTextMessageByLabel(label, true, nullptr, nullptr), 0 + ); + } else if (mCurrentTextLabelName == "KEN3_000") { + FiAnalysisHandle analysis = FiContext::getNaviTableEquipmentCheckEntry(); + s16 value = analysis.getAreaIndexForFiAreaName(); + if (value < 0) { + value = 0; + } + mCurrentTextLabelName.sprintf("KEN3_%03d", value); + } else if (mCurrentTextLabelName == "KEN3_501") { + FiAnalysisHandle analysis = FiContext::getNaviTableEquipmentCheckEntry(); + s32 arg = analysis.getSuitabilityArg(); + dLytMsgWindow_c::getInstance()->setNumericArg0(arg); + } else if (mCurrentTextLabelName == "KEN3_100") { + FiAnalysisHandle analysis = FiContext::getNaviTableEquipmentCheckEntry(); + s16 value = analysis.getSuitabilityLabel(); + if (value < 0) { + value = 0; + } + mCurrentTextLabelName.sprintf("KEN3_%03d", value); + } else if (mCurrentTextLabelName == "KEN3_200") { + FiAnalysisHandle analysis = FiContext::getNaviTableEquipmentCheckEntry(); + s16 value = analysis.getShieldMessage(); + if (value < 0) { + value = 0; + } + mCurrentTextLabelName.sprintf("KEN3_%03d", value); + } else if (mCurrentTextLabelName == "KEN4_000") { + s32 fiHelpIndex = FiContext::getHelpIndex(); + if (fiHelpIndex < 0) { + fiHelpIndex = 0; + } + if (fiHelpIndex == 5) { + StoryflagManager::sInstance->setFlag(727); + } + mCurrentTextLabelName.sprintf("KEN4_%03d", fiHelpIndex); + } else if (mCurrentTextLabelName == "KEN5_000") { + s32 targetActorId = FiContext::getTargetActorId(); + if (targetActorId < 0) { + targetActorId = 0; + } + if (targetActorId <= 480) { + mCurrentTextLabelName.sprintf("KEN5_%03d", targetActorId); + } else { + mCurrentTextLabelName.sprintf("KEN7_000"); + } + } else if (mCurrentTextLabelName == "KEN6_000") { + s32 targetActorId = FiContext::getTargetActorId(); + if (targetActorId < 0) { + targetActorId = 0; + } + if (targetActorId <= 91) { + mCurrentTextLabelName.sprintf("KEN6_%03d", targetActorId); + } else { + mCurrentTextLabelName.sprintf("KEN7_000"); + } + } else if (mCurrentTextLabelName == "KEN6_107") { + s32 targetActorId = FiContext::getTargetActorId(); + if (targetActorId < 0) { + targetActorId = 0; + } + u16 killCount = FileManager::GetInstance()->getEnemyKillCount(targetActorId); + u8 performance = FiContext::rateBattlePerformance(targetActorId); + if (performance == 0xFF) { + dLytMsgWindow_c::getInstance()->setNumericArg0(killCount); + mCurrentTextLabelName.sprintf("KEN6_108"); + } else { + dLytMsgWindow_c::getInstance()->setNumericArg0(killCount); + SizedString<16> tmpLabel; + tmpLabel.sprintf("KEN6_1%02d", performance); + dLytMsgWindow_c::getInstance()->getTagProcessor()->setStringArg( + dMessage_c::getTextMessageByLabel(tmpLabel, true, nullptr, nullptr), 0 + ); + } + } else if (mCurrentTextLabelName == "KEN7_000") { + s32 targetActorId = FiContext::getTargetActorId(); + if (targetActorId < 0) { + targetActorId = 0; + } + if (targetActorId <= 561) { + mCurrentTextLabelName.sprintf("KEN7_%03d", targetActorId); + } else { + mCurrentTextLabelName.sprintf("KEN7_000"); + } + } else if (mCurrentTextLabelName == "KEN8_000" || mCurrentTextLabelName == "KEN2_096") { + s32 seconds = OS_TICKS_TO_SEC(SaveTimeRelated::GetInstance()->getField_0x08()); + s32 minutes_ = seconds / 60; + s32 minutes = minutes_ % 60; + s32 hours = seconds / 3600; + if (hours > 99) { + hours = 99; + minutes = 59; + } + s32 seconds1 = OS_TICKS_TO_SEC(SaveTimeRelated::GetInstance()->fn_801907D0()); + s32 minutes1_ = seconds1 / 60; + s32 minutes1 = minutes1_ % 60; + s32 hours1 = seconds1 / 3600; + if (hours1 > 999) { + hours1 = 999; + minutes1 = 59; + } + s32 time[4] = {hours, minutes, hours1, minutes1}; + dLytMsgWindow_c::getInstance()->setNumericArgs(time, 4); + } else if (mCurrentTextLabelName == "KEN9_000") { + s32 v; + if (StoryflagManager::sInstance->getCounterOrFlag(530)) { + v = 200; + } else if (dStageMgr_c::GetInstance()->getSTIFbyte4() == 0) { + v = cM::rndInt(30); + } else { + v = cM::rndInt(30) + 30; + } + mCurrentTextLabelName.sprintf("KEN9_%03d", v); + } + + if (dLytMsgWindow_c::getInstance()->setCurrentLabelName(mCurrentTextLabelName, false) == true) { + if (!dLytMsgWindow_c::getInstance()->getField_0x80D()) { + field_0x14 = 1; + } + if (next != 0xFFFF) { + setNext(next); + } else { + clear(); + } + } + + return false; +} + +u16 dFlow_c::getSwitchChoice(const MsbFlowInfo *element, u16 param) const { + u16 result = 0; + if (param < 14 || param > 16) { + result = (this->*(sBranchHandlers[param]))(element); + } + return result; +} + +inline void setTagProcessorFiArgument(s32 a1, s32 a2) { + dTagProcessor_c *p = dLytMsgWindow_c::getInstance()->getTagProcessor(); + p->setStringArg(FiContext::getMessageForFiInfo(a1), a2); +} + +inline void setTagProcessorArgument(s32 a1, s32 a2) { + dTagProcessor_c *p = dLytMsgWindow_c::getInstance()->getTagProcessor(); + p->setStringArg(FiContext::getTextMessage(a1), a2); +} + +u16 dFlow_c::branchHandler00(const MsbFlowInfo *element) const { + return dLytMsgWindow_c::getInstance()->getTextOptionSelection(); +} + +u16 dFlow_c::branchHandler01(const MsbFlowInfo *element) const { + return dLytMsgWindow_c::getInstance()->getTextOptionSelection(); +} + +u16 dFlow_c::branchHandler02(const MsbFlowInfo *element) const { + if (FiContext::getDoSpecialFiMenuHandlingChecked()) { + if (dLytMsgWindow_c::getInstance()->getTextOptionSelection() == 0 && FiContext::getGlobalFiInfo0(0) == 9) { + FiContext::do_fn_8016CB20(); + setTagProcessorFiArgument(0, 0); + setTagProcessorFiArgument(1, 1); + setTagProcessorFiArgument(2, 2); + } else { + FiContext::setDoSpecialFiMenuHandling(false); + } + } + return dLytMsgWindow_c::getInstance()->getTextOptionSelection(); +} + +u16 dFlow_c::branchHandler03(const MsbFlowInfo *element) const { + return !StoryflagManager::sInstance->getCounterOrFlag(element->params1n2); +} + +u16 dFlow_c::branchHandler04(const MsbFlowInfo *element) const { + return 0; +} + +u16 dFlow_c::branchHandler05(const MsbFlowInfo *element) const { + return !SceneflagManager::sInstance->checkFlag( + dStage_c::GetInstance()->getCurrRoomId(), (element->params1n2 & 0xFFFF) + 0xC0 + ); +} + +u16 dFlow_c::branchHandler06(const MsbFlowInfo *element) const { + return !SceneflagManager::sInstance->checkFlag(0x3F, (element->params1n2 & 0xFFFF)); +} + +u16 dFlow_c::branchHandler07(const MsbFlowInfo *element) const { + return mResultFromCounterCheck != 0; +} + +u16 dFlow_c::branchHandler08(const MsbFlowInfo *element) const { + return mResultFromCounterCheck != 0; +} + +u16 dFlow_c::branchHandler09(const MsbFlowInfo *element) const { + return !SceneflagManager::sInstance->checkFlag(0x3F, (element->params1n2 & 0xFFFF) + 0x80); +} + +u16 dFlow_c::branchHandler10(const MsbFlowInfo *element) const { + u16 threshold = element->params1n2 & 0xFFFF; + return threshold > dAcItem_c::getRupeeCounter(); +} + +u16 dFlow_c::branchHandler11(const MsbFlowInfo *element) const { + return (s32)(cM::rnd() * 2.0f); +} + +u16 dFlow_c::branchHandler12(const MsbFlowInfo *element) const { + return (s32)(cM::rnd() * 3.0f); +} + +u16 dFlow_c::branchHandler13(const MsbFlowInfo *element) const { + return (s32)(cM::rnd() * 4.0f); +} + +u16 dFlow_c::branchHandler14(const MsbFlowInfo *element) const { + return 0; +} + +u16 dFlow_c::branchHandler15(const MsbFlowInfo *element) const { + return 0; +} + +u16 dFlow_c::branchHandler16(const MsbFlowInfo *element) const { + return 0; +} + +u16 dFlow_c::branchHandler17(const MsbFlowInfo *element) const { + bool ret = false; + if (adventurePouchFindItemSlot(ITEM_NONE) != POUCH_SLOT_NONE) { + ret = true; + } + return ret; +} + +u16 dFlow_c::branchHandler18(const MsbFlowInfo *element) const { + bool ret = false; + if (!getLinkPtr()->isItemFairyFromBugnet()) { + ret = true; + } + return ret; +} + +u16 dFlow_c::branchHandler19(const MsbFlowInfo *element) const { + u16 ret = 1; + switch (element->params1n2 & 0xFFFF) { + case 0: + if (dAcPy_c::getCurrentlyEquippedShieldType() != 4) { + ret = 0; + } + break; + case 1: + if (adventurePouchFindItemSlot(ITEM_BOTTLE) != POUCH_SLOT_NONE) { + ret = 0; + } + break; + case 2: + if (adventurePouchFindItemSlot(ITEM_HOT_SOUP) != POUCH_SLOT_NONE) { + ret = 0; + } + break; + case 3: + if (adventurePouchFindItemSlot(ITEM_COLD_SOUP) != POUCH_SLOT_NONE) { + ret = 0; + } + break; + case 4: + if (adventurePouchFindItemSlot(ITEM_STAMINA_POTION) != POUCH_SLOT_NONE || + adventurePouchFindItemSlot(ITEM_STAMINA_POTION_PLUS) != POUCH_SLOT_NONE) { + ret = 0; + } + break; + case 5: + if (adventurePouchFindItemSlot(ITEM_MUSHROOM_SPORES) != POUCH_SLOT_NONE || + adventurePouchFindItemSlot(ITEM_GLITTERING_SPORES) != POUCH_SLOT_NONE) { + ret = 0; + } + break; + case 6: { + FiAnalysisHandle handle = FiContext::getNaviTableEquipmentCheckEntry(); + switch (handle.shieldRelated()) { + case 0: + if (dAcPy_c::getCurrentlyEquippedShieldType() == 0) { + ret = 0; + } + break; + case 1: + if (dAcPy_c::getCurrentlyEquippedShieldType() == 1) { + ret = 0; + } + break; + } + break; + } + case 7: + if (adventurePouchFindItemSlot(ITEM_SACRED_WATER) != POUCH_SLOT_NONE) { + ret = 0; + } + break; + case 8: + if (adventurePouchCountItem(ITEM_HEART_MEDAL) != 0) { + ret = 0; + } + break; + case 9: + if (hasAnyShields()) { + ret = 0; + } + break; + } + return ret; +} + +u16 dFlow_c::branchHandler20(const MsbFlowInfo *element) const { + u16 ret = 0; + if (itemCheckFindItemSlot(ITEM_NONE) != ITEM_CHECK_SLOT_NONE) { + ret = 1; + } + return ret; +} + +u16 dFlow_c::branchHandler21(const MsbFlowInfo *element) const { + u16 ret = 0; + if (matchesUnknownActorCategory(FiContext::getTargetActorId())) { + ret = 1; + } + return ret; +} + +u16 dFlow_c::branchHandler22(const MsbFlowInfo *element) const { + u16 ret = StoryflagManager::sInstance->getCounterOrFlag(692); + if (ret > 3) { + ret = 3; + } + return ret; +} + +dFlow_c::BranchHandler dFlow_c::sBranchHandlers[] = { + &dFlow_c::branchHandler00, &dFlow_c::branchHandler01, &dFlow_c::branchHandler02, &dFlow_c::branchHandler03, + &dFlow_c::branchHandler04, &dFlow_c::branchHandler05, &dFlow_c::branchHandler06, &dFlow_c::branchHandler07, + &dFlow_c::branchHandler08, &dFlow_c::branchHandler09, &dFlow_c::branchHandler10, &dFlow_c::branchHandler11, + &dFlow_c::branchHandler12, &dFlow_c::branchHandler13, &dFlow_c::branchHandler14, &dFlow_c::branchHandler15, + &dFlow_c::branchHandler16, &dFlow_c::branchHandler17, &dFlow_c::branchHandler18, &dFlow_c::branchHandler19, + &dFlow_c::branchHandler20, &dFlow_c::branchHandler21, &dFlow_c::branchHandler22, +}; + +bool dFlow_c::handleBranch() { + MsbFlowInfo *info = LMS_GetFlowElement(mpMsbf, mCurrentFlowIndex); + u16 next = getSwitchChoice(info, info->param3); + u16 *branchPoints = LMS_GetBranchPoints(mpMsbf, mCurrentFlowIndex); + if (info->param5 != 0xFFFF) { + setNext(branchPoints[next]); + } else { + clear(); + } + return true; +} + +bool dFlow_c::handleEntry() { + MsbFlowInfo *element = LMS_GetFlowElement(mpMsbf, mCurrentFlowIndex); + setNext(element->next); + return true; +} + +bool dFlow_c::handleJump() { + // unimplemented + return true; +} + +void dFlow_c::triggerEntryPoint(s32 labelPart1, s32 labelPart2) { + if (labelPart1 == 6) { + // "Your hearts have decreased quite dramatically..." + // 400 -> may introduce heart dowsing + // 401 -> no heart dowsing introduction + if (labelPart2 == 400) { + FiContext::setField_0x48(true); + labelPart2 = 401; + } else if (labelPart2 == 401) { + StoryflagManager::sInstance->setFlag(808); + // Don't introduce heart dowsing in areas where you might + // not be able to dowse + if (dStageMgr_c::GetInstance()->isAreaTypeNormal()) { + labelPart2 = 400; + } else { + labelPart2 = 401; + } + } else if (labelPart2 == 402 && (dLytMsgWindow_c::getInstance()->getTagProcessor()->getField_0x8FC() < 0 || + dLytMsgWindow_c::getInstance()->getTagProcessor()->getField_0x900() < 0)) { + // "You have elected to engage Hero Mode..." + FiContext::setField_0x4A(true); + labelPart2 = 401; + } + } + + if (labelPart1 == 6 && labelPart2 == 801) { + // "You called for me, Master?" + FiContext::do_fn_8016CA00(); + FiContext::setDoSpecialFiMenuHandling(true); + FiContext::do_fn_8016CB40(); + setTagProcessorFiArgument(0, 0); + setTagProcessorFiArgument(1, 1); + setTagProcessorFiArgument(2, 2); + setTagProcessorArgument(7, 3); + } else if (labelPart1 == 6 && labelPart2 == 802) { + // Doesn't seem to exist in the files + FiContext::setDoSpecialFiMenuHandling(true); + setTagProcessorFiArgument(0, 0); + setTagProcessorFiArgument(1, 1); + setTagProcessorFiArgument(2, 2); + setTagProcessorArgument(7, 3); + } + u16 entry = findEntryPoint(labelPart1, labelPart2); + start(entry); +} + +void dFlow_c::triggerEntryPoint(const char *label) { + u16 entry = findEntryPoint(label); + start(entry); +} + +u16 dFlow_c::getField_0x44() const { + return field_0x44; +} + +u16 dFlow_c::getField_0x46() const { + return field_0x46; +} + +bool dFlow_c::triggerEntryPointChecked(s32 labelPart1, s32 labelPart2) { + if (checkField0x3C()) { + s32 old = field_0x40; + dFlow_c::triggerEntryPoint(labelPart1, labelPart2); + setNext(old); + return true; + } + return false; +} + +void dFlow_c::setField0x3C() { + field_0x3C = 1; +} + +bool dFlow_c::checkField0x3C() const { + return field_0x3C == 1; +} + +extern "C" dFlow_c *CURRENT_ACTOR_EVENT_FLOW_MANAGER; +void dFlow_c::start(u16 entry) { + field_0x0E = 0; + field_0x0F = 0; + field_0x3C = 0; + field_0x40 = -1; + field_0x44 = -1; + field_0x46 = -1; + mDelayTimer = 0; + std::memset(&mFlowInfo, 0, sizeof(MsbFlowInfo)); + CURRENT_ACTOR_EVENT_FLOW_MANAGER = this; + field_0x0C = 0xFFFF; + mCurrentFlowIndex = -1; + field_0x10 = 1; + setNext(entry); +} + +bool dFlow_c::advanceUntil(s32 searchType, s32 searchParam3, s32 *pOutParams1n2) { + bool keepGoing = true; + while (keepGoing && !vt_0x18()) { + MsbFlowInfo *element = LMS_GetFlowElement(mpMsbf, mCurrentFlowIndex); + s32 type = element->type; + if (searchType == type) { + if (element->type == FLOW_EVENT) { + if (element->param3 == searchParam3) { + if (pOutParams1n2 != nullptr) { + *pOutParams1n2 = element->params1n2; + } + return true; + } + } else { + return true; + } + } + switch (type) { + case FLOW_MESSAGE: + // Skip text processing, simply advance + setNext(element->next); + keepGoing = true; + break; + case FLOW_BRANCH: + if (element->param3 <= 2) { + keepGoing = false; + } else { + keepGoing = handleBranch(); + } + break; + case FLOW_EVENT: + switch (element->param3) { + case 7: + case 23: + case 27: keepGoing = handleEvent(); continue; + case 34: + if (element->params1n2 == 2) { + keepGoing = false; + continue; + } + // fall-through + default: + setNext(element->next); + keepGoing = true; + break; + } + break; + case FLOW_ENTRY: keepGoing = handleEntry(); break; + case FLOW_JUMP: keepGoing = handleJump(); break; + } + } + return 0; +} + +static const s32 sTargetActorIds[] = {0, 1, 10, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 65, 67, 77, 81, 87, 88, 89, 90, -1}; + +bool dFlow_c::matchesUnknownActorCategory(s32 id) const { + for (s32 i = 0; sTargetActorIds[i] >= 0; i++) { + if (sTargetActorIds[i] == id) { + return true; + } + } + return false; +} + +void dFlow_c::clear() { + mCurrentFlowIndex = -1; + field_0x0E = 1; + field_0x3C = 0; + field_0x40 = -1; + field_0x44 = -1; +} + +void dFlow_c::createLytMiniGame() { + if (dLytMiniGame_c::GetInstance() == nullptr) { + switch (dMessage_c::getInstance()->getMiniGameVariant()) { + case 0: + dBase_c::createBase(fProfile::LYT_MINI_GAME, dLytControlGame_c::getInstance(), 11, fBase_c::OTHER); + break; + case 1: + dBase_c::createBase(fProfile::LYT_MINI_GAME, dLytControlGame_c::getInstance(), 10, fBase_c::OTHER); + break; + case 2: + dBase_c::createBase(fProfile::LYT_MINI_GAME, dLytControlGame_c::getInstance(), 12, fBase_c::OTHER); + break; + case 3: + dBase_c::createBase(fProfile::LYT_MINI_GAME, dLytControlGame_c::getInstance(), 14, fBase_c::OTHER); + break; + case 4: + dBase_c::createBase(fProfile::LYT_MINI_GAME, dLytControlGame_c::getInstance(), 13, fBase_c::OTHER); + break; + case 5: + dBase_c::createBase(fProfile::LYT_MINI_GAME, dLytControlGame_c::getInstance(), 2, fBase_c::OTHER); + break; + case 6: + dBase_c::createBase(fProfile::LYT_MINI_GAME, dLytControlGame_c::getInstance(), 16, fBase_c::OTHER); + break; + case 7: + dBase_c::createBase(fProfile::LYT_MINI_GAME, dLytControlGame_c::getInstance(), 15, fBase_c::OTHER); + break; + } + } +} + +void dFlow_c::clearMinigame() { + if (dMessage_c::getInstance()->getField_0x340()) { + switch (dMessage_c::getInstance()->getMiniGameVariant()) { + case 0: + case 1: + case 4: + case 5: + if (dLytMiniGame_c::GetInstance() != nullptr) { + dLytMiniGame_c::GetInstance()->scoreRelated(); + } + break; + case 2: + case 3: + case 6: + case 7: + if (dLytMiniGame_c::GetInstance() != nullptr) { + dLytMiniGame_c::GetInstance()->timeRelated(); + } + break; + } + } + dMessage_c::getInstance()->setField_0x340(0); + dMessage_c::getInstance()->setMiniGameVariant(8); +} SPECIAL_BASE_PROFILE(MESSAGE, dMessage_c, fProfile::MESSAGE, 0x2A8, 0); @@ -186,10 +1332,6 @@ static char *sMsbfFileNames[80] = { "599-Demo.msbf", }; -static char *sArcNames[] = { - "0-Common", "1-Town", "2-Forest", "3-Mountain", "4-Desert", "5-CenterField", -}; - dMessage_c *dMessage_c::sInstance; dTagProcessor_c *dMessage_c::sTagProcessor; @@ -245,7 +1387,7 @@ int dMessage_c::create() { } sTagProcessor = new dTagProcessor_c(); - createGlobalFiContext(); + FiContext::create(); reset(); return SUCCEEDED; } @@ -416,6 +1558,17 @@ s32 dMessage_c::getMsbfNumberByIndex(s32 index) { return atoi(getMsbfFileName(index)); } +// Skipping 007-MapText.msbt and word.msbt +static const s32 sMsbfToMsbt[] = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, +}; + +s32 dMessage_c::getMsbtIndexForMsbfIndex(s32 index) { + return sMsbfToMsbt[index]; +} + s32 dMessage_c::getTextIndexForLabel(const char *label) { s32 idx = getMsbtIndexForLabelInternal(label); MsbtInfo *info = nullptr; @@ -474,8 +1627,74 @@ MsbfInfo *dMessage_c::getMsbfInfoForIndexInternal(s32 index) { return mpFlows[index]; } -extern "C" u8 fn_80054F30(); +u32 dMessage_c::getLightPillarRelatedArg(s32 arg) { + return field_0x300[arg]; +} +void dMessage_c::storeLightPillarRelatedArg(u32 arg) { + for (s32 i = 0; i < ARRAY_LENGTH(field_0x300); i++) { + if (field_0x300[i] == 0xFFFFFFFF) { + field_0x300[i] = arg; + return; + } + } +} + +void dMessage_c::clearLightPillarRelatedArgs() { + for (s32 i = 0; i < ARRAY_LENGTH(field_0x300); i++) { + field_0x300[i] = 0xFFFFFFFF; + } +} + +void dMessage_c::executeMinigame() { + if (mMiniGameVariant == 8) { + return; + } + if (!dMessage_c::getInstance()->getField_0x340()) { + switch (mMiniGameVariant) { + case 0: + case 1: + case 4: + case 5: + if (dLytMiniGame_c::GetInstance() != nullptr) { + dLytMiniGame_c::GetInstance()->scoreRelatedExecute(); + dLytMiniGame_c::GetInstance()->setDisplayedPoints(mMinigameResultPoints); + sInstance->field_0x340 = 1; + } + break; + case 2: + case 3: + case 6: + case 7: + if (dLytMiniGame_c::GetInstance() != nullptr) { + dLytMiniGame_c::GetInstance()->timeRelatedExecute(); + dLytMiniGame_c::GetInstance()->setDisplayedTime(mMinigameTime); + sInstance->field_0x340 = 1; + } + break; + } + } +} + +void dMessage_c::init() { + clearLightPillarRelatedArgs(); + // Probably inlines + field_0x328 = 0; + field_0x329 = 0; + field_0x32A = 0; + sInstance->setField_0x32C(12); + field_0x330 = 0; +} + +void dMessage_c::reset() { + init(); + mMiniGameVariant = 8; + field_0x340 = 0; + mMinigameResultPoints = 0; + mMinigameTime = 0; +} + +extern "C" u8 fn_80054F30(); static SizedString<8> sCurrentLanguage; const char *dMessage_c::getLanguageIdentifier() { u8 lang = fn_80054F30(); @@ -489,10 +1708,40 @@ const char *dMessage_c::getLanguageIdentifier() { return sCurrentLanguage; } +const char *sLytMsbts_Unused[] = { + "basic/remoConBtn_00.msbt", + "basic/remoConBtn_01.msbt", + "basic/remoConBtn_03.msbt", + "basic/remoConBtn_04.msbt", + "basic/remoConBtn_05.msbt", + "basic/nunBtn_03.msbt", + "common/commonTitle_00.msbt", + "endroll/endScroll_00.msbt", + "fileSelect/fileSelect_00.msbt", + "information/skip_00.msbt", + "map/map_00.msbt", + "messageWindow/messageBtn_00.msbt", + "miniGame/start_00.msbt", + "miniGameScore/miniGameScore_00.msbt", + "miniGameTime/miniGameTime_00.msbt", + "pause/pauseInfo_00.msbt", + "pause/pause_00.msbt", + "shop/depositBox_00.msbt", + "shop/itemSelect_00.msbt", + "shop/materialCheck_00.msbt", + "softwareKeyboard/toolbarBtn_00.msbt", + "systemWindow/systemWindow_00.msbt", + "title/titleBG_00.msbt", +}; + const char *dMessage_c::getArcNameByIndex(s32 idx, bool global) { return getArcNameByIndexInternal(idx, global); } +static char *sArcNames[] = { + "0-Common", "1-Town", "2-Forest", "3-Mountain", "4-Desert", "5-CenterField", +}; + const char *dMessage_c::getArcNameByIndexInternal(s32 idx, bool global) { return sArcNames[idx]; } diff --git a/src/d/d_sc_game.cpp b/src/d/d_sc_game.cpp index a6b056a5..0399b3de 100644 --- a/src/d/d_sc_game.cpp +++ b/src/d/d_sc_game.cpp @@ -16,6 +16,7 @@ #include "toBeSorted/file_manager.h" #include "toBeSorted/minigame_mgr.h" #include "toBeSorted/music_mgrs.h" +#include "toBeSorted/unk_save_time.h" #include @@ -232,7 +233,7 @@ void dScGame_c::clearSpawnInfo() { } extern "C" void processEventFlags(); -void dScGame_c::triggerExit(s32 room, u8 exitIndex, s32 forcedNight, s32 forcedTrial) { +void dScGame_c::triggerExit(s32 room, u16 exitIndex, s32 forcedNight, s32 forcedTrial) { processEventFlags(); // TODO } @@ -261,8 +262,6 @@ bool dScGame_c::isCurrentStage(const char *stage) { } extern "C" void fn_801BB9C0(); -extern "C" void *lbl_80575688; -extern "C" void fn_801909A0(void *); extern "C" void maybeResetSkykeepPuzzle(bool); void dScGame_c::copySpawnNextToCurrent() { @@ -271,7 +270,7 @@ void dScGame_c::copySpawnNextToCurrent() { sDoSomethingWithFileAOnTransition = false; } if (std::strncmp(currentSpawnInfo.stageName, nextSpawnInfo.stageName, 2)) { - fn_801909A0(lbl_80575688); + SaveTimeRelated::GetInstance()->fn_801909A0(); } currentSpawnInfo = nextSpawnInfo; sCurrentLayer = currentSpawnInfo.layer; @@ -283,13 +282,13 @@ void dScGame_c::actuallyTriggerEntrance( u16 transitionFadeFrames, s8 field0x28 ) { s32 trial, night; - if (forcedTrial == 2) { + if (forcedTrial == SpawnInfo::RETAIN_TRIAL) { trial = currentSpawnInfo.trial; } else { trial = forcedTrial; } - if (forcedNight == 2) { + if (forcedNight == SpawnInfo::RETAIN_TOD) { night = currentSpawnInfo.night; } else { night = forcedNight; diff --git a/src/d/d_sc_title.cpp b/src/d/d_sc_title.cpp index f148b159..3f46894d 100644 --- a/src/d/d_sc_title.cpp +++ b/src/d/d_sc_title.cpp @@ -16,6 +16,7 @@ #include "toBeSorted/file_manager.h" #include "toBeSorted/music_mgrs.h" #include "toBeSorted/reload_color_fader.h" +#include "toBeSorted/unk_save_time.h" SPECIAL_BASE_PROFILE(TITLE, dScTitle_c, fProfile::TITLE, 0, 0); @@ -39,14 +40,14 @@ static const char *sLayoutArcsToLoad[] = { STATE_VIRTUAL_DEFINE(dScTitle_c, Stanby); STATE_VIRTUAL_DEFINE(dScTitle_c, Action); -extern "C" void *lbl_80575688; -extern "C" void fn_801907F0(void *); +extern "C" void *lbl_805750D8; +extern "C" void fn_80052D50(void *); dScTitle_c::dScTitle_c() { sInstance = this; mRelCtrl.set(sModulesToLoad, ARRAY_LENGTH(sModulesToLoad)); mLayoutCtrl.set(sLayoutArcsToLoad, ARRAY_LENGTH(sLayoutArcsToLoad)); - fn_801907F0(lbl_80575688); + SaveTimeRelated::GetInstance()->fn_801907F0(); if (checkAllSaveFilesEmpty() == true) { actuallyTriggerEntrance("F000", 0, 26, 55, 0, 0, 0, 15, -1); } else { diff --git a/src/d/lyt/d_lyt_demo_dowsing.cpp b/src/d/lyt/d_lyt_demo_dowsing.cpp new file mode 100644 index 00000000..cc70a09c --- /dev/null +++ b/src/d/lyt/d_lyt_demo_dowsing.cpp @@ -0,0 +1,9 @@ +#include "d/lyt/d_lyt_demo_dowsing.h" + +#include "f/f_profile.h" +#include "s/s_State.hpp" + +SPECIAL_BASE_PROFILE(LYT_DEMO_DOWSING, dLytDemoDowsing_c, fProfile::LYT_DEMO_DOWSING, 0x2AA, 0x6F9); + +STATE_DEFINE(dLytDemoDowsing_c, Wait); +STATE_DEFINE(dLytDemoDowsing_c, Start); diff --git a/src/d/lyt/meter/d_lyt_meter.cpp b/src/d/lyt/meter/d_lyt_meter.cpp index 39c92069..676251e4 100644 --- a/src/d/lyt/meter/d_lyt_meter.cpp +++ b/src/d/lyt/meter/d_lyt_meter.cpp @@ -1564,8 +1564,8 @@ bool dLytMeterMain_c::execute() { if (dMessage_c::getInstance()->getField_0x2FC() != 0) { rupeePos = 3; - if (dLytMsgWindow_c::getInstance() != nullptr && (dLytMsgWindow_c::getInstance()->fn_800D7B40() == 0x9E02 || - dLytMsgWindow_c::getInstance()->fn_800D7B40() == 0x768C)) { + if (dLytMsgWindow_c::getInstance() != nullptr && (dLytMsgWindow_c::getInstance()->fn_800D7B40() == 40450 || + dLytMsgWindow_c::getInstance()->fn_800D7B40() == 30348)) { s32 off = -(mHeart.getCurrentHealthCapacity() / 4 <= 10); rupeePos = 6 + off; } diff --git a/src/d/lyt/meter/d_lyt_meter_rupy.cpp b/src/d/lyt/meter/d_lyt_meter_rupy.cpp index 976ba037..889efecb 100644 --- a/src/d/lyt/meter/d_lyt_meter_rupy.cpp +++ b/src/d/lyt/meter/d_lyt_meter_rupy.cpp @@ -1,14 +1,12 @@ #include "d/lyt/meter/d_lyt_meter_rupy.h" #include "c/c_math.h" +#include "d/a/d_a_item.h" #include "d/lyt/d2d.h" #include "d/lyt/d_lyt_meter_configuration.h" #include "nw4r/math/math_types.h" #include "toBeSorted/small_sound_mgr.h" -extern "C" s32 getRupeeCounter2(); -extern "C" u32 getCurrentWalletCapacity2(); - STATE_DEFINE(dLytMeterRupyStart_c, Wait); STATE_DEFINE(dLytMeterRupyStart_c, Start); @@ -239,7 +237,7 @@ void dLytMeterRupy_c::executeState_Out() { field_0x8AB = 0; if (field_0x8AE == 0 && hasChangeInRupees()) { - mDisplayedRupeeCount = getRupeeCounter2(); + mDisplayedRupeeCount = dAcItem_c::getRupeeCounter(); updateDisplayedAmount(true); } @@ -290,7 +288,7 @@ bool dLytMeterRupy_c::build(d2d::ResAccIf_c *resAcc) { mAnm[RUPY_ANIM_IN].setAnimEnable(false); field_0x8AB = 0; - mDisplayedRupeeCount = getRupeeCounter2(); + mDisplayedRupeeCount = dAcItem_c::getRupeeCounter(); field_0x890 = -1; mBlinkDelay = cM::rndF(10.0f); for (int i = 0; i < RUPY_NUM_DIGITS; i++) { @@ -362,7 +360,7 @@ bool dLytMeterRupy_c::execute() { bool isMax = false; u32 current = mDisplayedRupeeCount; - u32 capacity = getCurrentWalletCapacity2(); + u32 capacity = dAcItem_c::getCurrentWalletCapacity(); if (current != 0 && capacity == current) { isMax = true; }; @@ -375,7 +373,7 @@ bool dLytMeterRupy_c::execute() { } bool dLytMeterRupy_c::hasChangeInRupees() const { - s32 amount = getRupeeCounter2(); + s32 amount = dAcItem_c::getRupeeCounter(); if (amount > 9999) { amount = 9999; } else if (amount < 0) { @@ -385,7 +383,7 @@ bool dLytMeterRupy_c::hasChangeInRupees() const { } s32 dLytMeterRupy_c::getRupeeDifference() const { - return getRupeeCounter2() - mDisplayedRupeeCount; + return dAcItem_c::getRupeeCounter() - mDisplayedRupeeCount; } mVec3_c dLytMeterRupy_c::getLastVisibleDigitPosition() { @@ -407,7 +405,7 @@ void dLytMeterRupy_c::setDigit(s32 index, s32 digit) { } bool dLytMeterRupy_c::updateDisplayedAmount(bool suppressSound) { - s32 amount = getRupeeCounter2(); + s32 amount = dAcItem_c::getRupeeCounter(); if (amount > 9999) { amount = 9999; } else if (amount < 0) { @@ -512,7 +510,7 @@ bool dLytMeterRupy_c::updateDisplayedAmount(bool suppressSound) { mPrevDigits[1] = mDisplayedDigits[1]; mPrevDigits[2] = mDisplayedDigits[2]; mPrevDigits[3] = mDisplayedDigits[3]; - } else if (field_0x8AD && amount == getCurrentWalletCapacity2()) { + } else if (field_0x8AD && amount == dAcItem_c::getCurrentWalletCapacity()) { SmallSoundManager::GetInstance()->playSound(SE_S_RUPEE_MAX); field_0x890 = 0; field_0x8AD = 0; diff --git a/src/d/lyt/msg_window/d_lyt_msg_window.cpp b/src/d/lyt/msg_window/d_lyt_msg_window.cpp index 9dafff64..af85c022 100644 --- a/src/d/lyt/msg_window/d_lyt_msg_window.cpp +++ b/src/d/lyt/msg_window/d_lyt_msg_window.cpp @@ -33,7 +33,7 @@ #include "toBeSorted/arc_managers/layout_arc_manager.h" #include "toBeSorted/d_d3d.h" #include "toBeSorted/event_manager.h" -#include "toBeSorted/global_fi_context.h" +#include "toBeSorted/fi_context.h" #include "toBeSorted/lyt_related_floats.h" #include "toBeSorted/music_mgrs.h" #include "toBeSorted/other_sound_stuff.h" @@ -89,8 +89,8 @@ bool dLytMsgWindow_c::build() { mpTagProcessor = new dTagProcessor_c(); mpMsgWindowUnk = new TextWindowUnk(mpTagProcessor); - if (GLOBAL_FI_CONTEXT != nullptr) { - fn_8016C9F0(GLOBAL_FI_CONTEXT); + if (FiContext::GetInstance() != nullptr) { + FiContext::GetInstance()->resetField_0x3C(); } mpWindowTalk = nullptr; @@ -514,8 +514,8 @@ void dLytMsgWindow_c::executeState_WaitKeySelectQuestion() { field_0x824 = 0; mTextOptionSelection = selection; field_0x1220 = 0; - if (GLOBAL_FI_CONTEXT != nullptr) { - doFiThing = GLOBAL_FI_CONTEXT->mDoSpecialFiMenuHandling; + if (FiContext::GetInstance() != nullptr) { + doFiThing = FiContext::GetInstance()->getDoSpecialFiMenuHandling(); } if (doFiThing) { @@ -714,10 +714,10 @@ bool dLytMsgWindow_c::draw() { return true; } -void dLytMsgWindow_c::setCurrentLabelName(const char *name, bool storeFile) { +bool dLytMsgWindow_c::setCurrentLabelName(const char *name, bool storeFile) { // TODO mName = name; - !std::strcmp(name, "FR_SIREN_04"); + return !std::strcmp(name, "FR_SIREN_04"); } bool dLytMsgWindow_c::isVisible() const { diff --git a/src/toBeSorted/special_item_drop_mgr.cpp b/src/toBeSorted/special_item_drop_mgr.cpp index 86906f3e..c3ecf8d5 100644 --- a/src/toBeSorted/special_item_drop_mgr.cpp +++ b/src/toBeSorted/special_item_drop_mgr.cpp @@ -6,6 +6,7 @@ #include "d/a/d_a_item.h" #include "d/a/d_a_itembase.h" #include "d/a/d_a_player.h" +#include "d/d_pouch.h" #include "m/m_angle.h" #include "m/m_vec.h" @@ -444,8 +445,6 @@ bool SpecialItemDropMgr::shouldTryExtraRupees(int specialItemId) { return sDropTable.mList[specialItemId].mFlags & FLAG_EXTRA_RUPEES; } -extern "C" bool adventurePouchCountItem(u32 itemId); - // 800c7d40 int SpecialItemDropMgr::giveSpecialDropItem( int specialItemId, int roomid, mVec3_c *pos, int subtype, mAng rot, s32 unused