diff --git a/config/SOUE01/rels/d_t_barrelNP/symbols.txt b/config/SOUE01/rels/d_t_barrelNP/symbols.txt index 3d27630f..74c10465 100644 --- a/config/SOUE01/rels/d_t_barrelNP/symbols.txt +++ b/config/SOUE01/rels/d_t_barrelNP/symbols.txt @@ -9,8 +9,8 @@ __dt__24sFState_c<11dTgBarrel_c>Fv = .text:0x00000250; // type:function size:0x5 __dt__27sFStateFct_c<11dTgBarrel_c>Fv = .text:0x000002B0; // type:function size:0x6C __dt__80sStateMgr_c<11dTgBarrel_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x00000320; // type:function size:0xA0 __dt__50sFStateMgr_c<11dTgBarrel_c,20sStateMethodUsr_FI_c>Fv = .text:0x000003C0; // type:function size:0xA4 -__ct__24dAcRef_c<12dAcOBarrel_c>Fv = .text:0x00000470; // type:function size:0x14 -__dt__24dAcRef_c<12dAcOBarrel_c>Fv = .text:0x00000490; // type:function size:0x58 +__ct__24dAcRef_c<12dAcObjBase_c>Fv = .text:0x00000470; // type:function size:0x14 +__dt__24dAcRef_c<12dAcObjBase_c>Fv = .text:0x00000490; // type:function size:0x58 __ct__26dAcRef_c<14dTgBarrelPos_c>Fv = .text:0x000004F0; // type:function size:0x14 __dt__26dAcRef_c<14dTgBarrelPos_c>Fv = .text:0x00000510; // type:function size:0x58 actorCreate__11dTgBarrel_cFv = .text:0x00000570; // type:function size:0xC0 diff --git a/config/SOUE01/rels/d_t_sporeNP/symbols.txt b/config/SOUE01/rels/d_t_sporeNP/symbols.txt index e4af62d0..f4c61da5 100644 --- a/config/SOUE01/rels/d_t_sporeNP/symbols.txt +++ b/config/SOUE01/rels/d_t_sporeNP/symbols.txt @@ -3,29 +3,29 @@ _epilog = .text:0x00000030; // type:function size:0x2C scope:global _unresolved = .text:0x00000060; // type:function size:0x4 scope:global __register_global_object = .text:0x00000070; // type:function size:0x1C scope:global __destroy_global_chain = .text:0x00000090; // type:function size:0x54 scope:global -fn_454_F0 = .text:0x000000F0; // type:function size:0x40 +__dt__7mVec3_cFv = .text:0x000000F0; // type:function size:0x40 dSporeTag_c_classInit__Fv = .text:0x00000130; // type:function size:0x110 -__dt__11dSporeTag_cFv = .text:0x00000240; // type:function size:0x58 +__dt__5dTg_cFv = .text:0x00000240; // type:function size:0x58 __dt__24sFState_c<11dSporeTag_c>Fv = .text:0x000002A0; // type:function size:0x58 __dt__27sFStateFct_c<11dSporeTag_c>Fv = .text:0x00000300; // type:function size:0x6C __dt__80sStateMgr_c<11dSporeTag_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x00000370; // type:function size:0xA0 __dt__50sFStateMgr_c<11dSporeTag_c,20sStateMethodUsr_FI_c>Fv = .text:0x00000410; // type:function size:0xA4 -fn_454_4C0 = .text:0x000004C0; // type:function size:0x4 -fn_454_4D0 = .text:0x000004D0; // type:function size:0x74 -SporeTag__initModels = .text:0x00000550; // type:function size:0x6C -SporeTag__init = .text:0x000005C0; // type:function size:0x94 +__ct__7mVec3_cFv = .text:0x000004C0; // type:function size:0x4 +__dt__12dSporeProc_cFv = .text:0x000004D0; // type:function size:0x74 +createHeap__11dSporeTag_cFv = .text:0x00000550; // type:function size:0x6C +create__11dSporeTag_cFv = .text:0x000005C0; // type:function size:0x94 changeState__80sStateMgr_c<11dSporeTag_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>FRC12sStateIDIf_c = .text:0x00000660; // type:function size:0x10 -fn_454_670 = .text:0x00000670; // type:function size:0x8 -fn_454_680 = .text:0x00000680; // type:function size:0x30 +doDelete__11dSporeTag_cFv = .text:0x00000670; // type:function size:0x8 +actorExecuteInEvent__11dSporeTag_cFv = .text:0x00000680; // type:function size:0x30 executeState__80sStateMgr_c<11dSporeTag_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x000006B0; // type:function size:0x10 -SporeTag__update = .text:0x000006C0; // type:function size:0x30 -fn_454_6F0 = .text:0x000006F0; // type:function size:0x34 -fn_454_730 = .text:0x00000730; // type:function size:0x954 -fn_454_1090 = .text:0x00001090; // type:function size:0x318 +actorExecute__11dSporeTag_cFv = .text:0x000006C0; // type:function size:0x30 +draw__11dSporeTag_cFv = .text:0x000006F0; // type:function size:0x34 +execute__12dSporeProc_cFv = .text:0x00000730; // type:function size:0x954 +drawXlu__12dSporeProc_cFv = .text:0x00001090; // type:function size:0x318 initializeState_Wait__11dSporeTag_cFv = .text:0x000013B0; // type:function size:0x4 executeState_Wait__11dSporeTag_cFv = .text:0x000013C0; // type:function size:0x8 finalizeState_Wait__11dSporeTag_cFv = .text:0x000013D0; // type:function size:0x4 -fn_454_13E0 = .text:0x000013E0; // type:function size:0xF4 +__dt__11dSporeTag_cFv = .text:0x000013E0; // type:function size:0xF4 getStateID__80sStateMgr_c<11dSporeTag_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x000014E0; // type:function size:0x10 build__27sFStateFct_c<11dSporeTag_c>FRC12sStateIDIf_c = .text:0x000014F0; // type:function size:0x60 dispose__27sFStateFct_c<11dSporeTag_c>FRP10sStateIf_c = .text:0x00001550; // type:function size:0xC @@ -47,18 +47,18 @@ isSameName__26sFStateID_c<11dSporeTag_c>CFPCc = .text:0x00001820; // type:functi _ctors = .ctors:0x00000000; // type:label scope:global _dtors = .dtors:0x00000000; // type:label scope:global __destroy_global_chain_reference = .dtors:0x00000000; // type:object size:0x4 scope:global -lbl_454_rodata_0 = .rodata:0x00000000; // type:object size:0xD0 data:float +lbl_454_rodata_0 = .rodata:0x00000000; // type:object size:0xD0 scope:local data:float g_profile_SPORE_TAG = .data:0x00000000; // type:object size:0x10 data:4byte -lbl_454_data_10 = .data:0x00000010; // type:object size:0x7 data:string -lbl_454_data_18 = .data:0x00000018; // type:object size:0x13 data:string -lbl_454_data_2C = .data:0x0000002C; // type:object size:0x19 data:string -SporeTag__vtable = .data:0x00000048; // type:object size:0x78 -lbl_454_data_C0 = .data:0x000000C0; // type:object size:0x30 -lbl_454_data_F0 = .data:0x000000F0; // type:object size:0x30 -lbl_454_data_120 = .data:0x00000120; // type:object size:0x18 -lbl_454_data_138 = .data:0x00000138; // type:object size:0x18 -lbl_454_data_150 = .data:0x00000150; // type:object size:0xE0 -lbl_454_data_230 = .data:0x00000230; // type:object size:0x34 +lbl_454_data_10 = .data:0x00000010; // type:object size:0x7 scope:local data:string +lbl_454_data_18 = .data:0x00000018; // type:object size:0x13 scope:local data:string +lbl_454_data_2C = .data:0x0000002C; // type:object size:0x19 scope:local data:string +__vt__11dSporeTag_c = .data:0x00000048; // type:object size:0x78 +lbl_454_data_C0 = .data:0x000000C0; // type:object size:0x30 scope:local +lbl_454_data_F0 = .data:0x000000F0; // type:object size:0x30 scope:local +lbl_454_data_120 = .data:0x00000120; // type:object size:0x18 scope:local +lbl_454_data_138 = .data:0x00000138; // type:object size:0x18 scope:local +lbl_454_data_150 = .data:0x00000150; // type:object size:0xE0 scope:local +lbl_454_data_230 = .data:0x00000230; // type:object size:0x34 scope:local __global_destructor_chain = .bss:0x00000000; // type:object size:0x4 scope:global -lbl_454_bss_8 = .bss:0x00000008; // type:object size:0x10 -SporeTag__StateID_Wait = .bss:0x00000018; // type:object size:0x30 data:4byte +lbl_454_bss_8 = .bss:0x00000008; // type:object size:0x10 scope:local +StateID_Wait__11dSporeTag_c = .bss:0x00000018; // type:object size:0x30 data:4byte diff --git a/config/SOUE01/rels/d_t_streamNP/symbols.txt b/config/SOUE01/rels/d_t_streamNP/symbols.txt index 70b4b2ce..b3ee77e2 100644 --- a/config/SOUE01/rels/d_t_streamNP/symbols.txt +++ b/config/SOUE01/rels/d_t_streamNP/symbols.txt @@ -2,14 +2,14 @@ _prolog = .text:0x00000000; // type:function size:0x2C scope:global _epilog = .text:0x00000030; // type:function size:0x2C scope:global _unresolved = .text:0x00000060; // type:function size:0x4 scope:global dTgStream_c_classInit__Fv = .text:0x00000070; // type:function size:0x5C -TgStream__addToStreamList = .text:0x000000D0; // type:function size:0x64 -TgStream__init = .text:0x00000140; // type:function size:0xE0 -fn_203_220 = .text:0x00000220; // type:function size:0x54 -fn_203_280 = .text:0x00000280; // type:function size:0x8 +addToList__11dTgStream_cFR9fLiMgBa_c = .text:0x000000D0; // type:function size:0x64 +create__11dTgStream_cFv = .text:0x00000140; // type:function size:0xE0 +doDelete__11dTgStream_cFv = .text:0x00000220; // type:function size:0x54 +actorExecute__11dTgStream_cFv = .text:0x00000280; // type:function size:0x8 __dt__11dTgStream_cFv = .text:0x00000290; // type:function size:0x5C _ctors = .ctors:0x00000000; // type:label scope:global _dtors = .dtors:0x00000000; // type:label scope:global -lbl_203_rodata_0 = .rodata:0x00000000; // type:object size:0x4 data:float +lbl_203_rodata_0 = .rodata:0x00000000; // type:object size:0x4 scope:local data:float g_profile_TAG_STREAM = .data:0x00000000; // type:object size:0x10 -lbl_203_data_10 = .data:0x00000010; // type:object size:0x4 data:4byte -TgStream__vtable = .data:0x00000014; // type:object size:0x74 +lbl_203_data_10 = .data:0x00000010; // type:object size:0x4 scope:local data:4byte +__vt__11dTgStream_c = .data:0x00000014; // type:object size:0x74 diff --git a/config/SOUE01/rels/d_t_sword_battle_gameNP/symbols.txt b/config/SOUE01/rels/d_t_sword_battle_gameNP/symbols.txt index 2e9ad528..bad9ea15 100644 --- a/config/SOUE01/rels/d_t_sword_battle_gameNP/symbols.txt +++ b/config/SOUE01/rels/d_t_sword_battle_gameNP/symbols.txt @@ -3,57 +3,57 @@ _epilog = .text:0x00000030; // type:function size:0x2C scope:global _unresolved = .text:0x00000060; // type:function size:0x4 scope:global __register_global_object = .text:0x00000070; // type:function size:0x1C scope:global __destroy_global_chain = .text:0x00000090; // type:function size:0x54 scope:global -fn_72_F0 = .text:0x000000F0; // type:function size:0xC -fn_72_100 = .text:0x00000100; // type:function size:0xC +baseID_Wait<10sStateID_c>__Fv_RC12sStateIDIf_c = .text:0x000000F0; // type:function size:0xC +baseID_Manage<10sStateID_c>__Fv_RC12sStateIDIf_c = .text:0x00000100; // type:function size:0xC dTgSwordBattleGame_c_classInit__Fv = .text:0x00000110; // type:function size:0xC4 -__dt__20dTgSwordBattleGame_cFv = .text:0x000001E0; // type:function size:0x58 +__dt__5dTg_cFv = .text:0x000001E0; // type:function size:0x58 __dt__33sFState_c<20dTgSwordBattleGame_c>Fv = .text:0x00000240; // type:function size:0x58 __dt__36sFStateFct_c<20dTgSwordBattleGame_c>Fv = .text:0x000002A0; // type:function size:0x6C __dt__89sStateMgr_c<20dTgSwordBattleGame_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x00000310; // type:function size:0xA0 __dt__59sFStateMgr_c<20dTgSwordBattleGame_c,20sStateMethodUsr_FI_c>Fv = .text:0x000003B0; // type:function size:0xA4 -TgSwordBattleGame__init = .text:0x00000460; // type:function size:0x70 -TgSwordBattleGame__isInBossRush = .text:0x000004D0; // type:function size:0x8 +create__20dTgSwordBattleGame_cFv = .text:0x00000460; // type:function size:0x70 +checkInBossRush__15MinigameManagerFv = .text:0x000004D0; // type:function size:0x8 changeState__89sStateMgr_c<20dTgSwordBattleGame_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>FRC12sStateIDIf_c = .text:0x000004E0; // type:function size:0x10 -fn_72_4F0 = .text:0x000004F0; // type:function size:0x44 -TgSwordBattleGame__update = .text:0x00000540; // type:function size:0x184 +doDelete__20dTgSwordBattleGame_cFv = .text:0x000004F0; // type:function size:0x44 +actorExecute__20dTgSwordBattleGame_cFv = .text:0x00000540; // type:function size:0x184 executeState__89sStateMgr_c<20dTgSwordBattleGame_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x000006D0; // type:function size:0x10 -fn_72_6E0 = .text:0x000006E0; // type:function size:0x280 -fn_72_960 = .text:0x00000960; // type:function size:0x8 -fn_72_970 = .text:0x00000970; // type:function size:0x4 -fn_72_980 = .text:0x00000980; // type:function size:0x70 -fn_72_9F0 = .text:0x000009F0; // type:function size:0x4 -fn_72_A00 = .text:0x00000A00; // type:function size:0x4 -fn_72_A10 = .text:0x00000A10; // type:function size:0x114 -fn_72_B30 = .text:0x00000B30; // type:function size:0x4 -fn_72_B40 = .text:0x00000B40; // type:function size:0x88 -fn_72_BD0 = .text:0x00000BD0; // type:function size:0x138 -TgSwordBattleGame__getTime = .text:0x00000D10; // type:function size:0x38 -TgSwordBattleGame__checkInBossRushStoryflag = .text:0x00000D50; // type:function size:0x48 -fn_72_DA0 = .text:0x00000DA0; // type:function size:0x1C -fn_72_DC0 = .text:0x00000DC0; // type:function size:0xD4 -fn_72_EA0 = .text:0x00000EA0; // type:function size:0x74 -fn_72_F20 = .text:0x00000F20; // type:function size:0x1C -TgSwordBattleGame__setInBossRush = .text:0x00000F40; // type:function size:0x1C -fn_72_F60 = .text:0x00000F60; // type:function size:0x114 -fn_72_1080 = .text:0x00001080; // type:function size:0xEC -fn_72_1170 = .text:0x00001170; // type:function size:0xB4 -fn_72_1230 = .text:0x00001230; // type:function size:0xB4 -fn_72_12F0 = .text:0x000012F0; // type:function size:0xB4 -fn_72_13B0 = .text:0x000013B0; // type:function size:0xB4 -fn_72_1470 = .text:0x00001470; // type:function size:0xB4 -fn_72_1530 = .text:0x00001530; // type:function size:0xB4 -fn_72_15F0 = .text:0x000015F0; // type:function size:0xB4 -fn_72_16B0 = .text:0x000016B0; // type:function size:0xB4 -fn_72_1770 = .text:0x00001770; // type:function size:0xB4 -fn_72_1830 = .text:0x00001830; // type:function size:0xB4 -fn_72_18F0 = .text:0x000018F0; // type:function size:0xB4 -fn_72_19B0 = .text:0x000019B0; // type:function size:0xB4 -fn_72_1A70 = .text:0x00001A70; // type:function size:0x3C -fn_72_1AB0 = .text:0x00001AB0; // type:function size:0x3C -TgSwordBattleGame__setCurrentBossNumber = .text:0x00001AF0; // type:function size:0x20 -fn_72_1B10 = .text:0x00001B10; // type:function size:0x1C -fn_72_1B30 = .text:0x00001B30; // type:function size:0x8 -fn_72_1B40 = .text:0x00001B40; // type:function size:0xE0 +actorExecuteInEvent__20dTgSwordBattleGame_cFv = .text:0x000006E0; // type:function size:0x280 +draw__20dTgSwordBattleGame_cFv = .text:0x00000960; // type:function size:0x8 +initializeState_Wait__20dTgSwordBattleGame_cFv = .text:0x00000970; // type:function size:0x4 +executeState_Wait__20dTgSwordBattleGame_cFv = .text:0x00000980; // type:function size:0x70 +finalizeState_Wait__20dTgSwordBattleGame_cFv = .text:0x000009F0; // type:function size:0x4 +initializeState_Manage__20dTgSwordBattleGame_cFv = .text:0x00000A00; // type:function size:0x4 +executeState_Manage__20dTgSwordBattleGame_cFv = .text:0x00000A10; // type:function size:0x114 +finalizeState_Manage__20dTgSwordBattleGame_cFv = .text:0x00000B30; // type:function size:0x4 +init__20dTgSwordBattleGame_cFv = .text:0x00000B40; // type:function size:0x88 +checkInEvent__20dTgSwordBattleGame_cFPCc = .text:0x00000BD0; // type:function size:0x138 +getCurrentTime__20dTgSwordBattleGame_cCFv = .text:0x00000D10; // type:function size:0x38 +checkInBossRushFlag__20dTgSwordBattleGame_cFv = .text:0x00000D50; // type:function size:0x48 +unsetInBossRushFlag__20dTgSwordBattleGame_cFv = .text:0x00000DA0; // type:function size:0x1C +unsetEarlyFightFlags__20dTgSwordBattleGame_cCFv = .text:0x00000DC0; // type:function size:0xD4 +unsetImprisonedFightFlags__20dTgSwordBattleGame_cCFv = .text:0x00000EA0; // type:function size:0x74 +unsetDemiseFightFlag__20dTgSwordBattleGame_cCFv = .text:0x00000F20; // type:function size:0x1C +setInBossRushFlag__20dTgSwordBattleGame_cFv = .text:0x00000F40; // type:function size:0x1C +saveCurrentTime__20dTgSwordBattleGame_cCFl = .text:0x00000F60; // type:function size:0x114 +getBossHighscore__20dTgSwordBattleGame_cCFv = .text:0x00001080; // type:function size:0xEC +getGhirahim1Highscore__20dTgSwordBattleGame_cCFv = .text:0x00001170; // type:function size:0xB4 +getScalderaHighscore__20dTgSwordBattleGame_cCFv = .text:0x00001230; // type:function size:0xB4 +getMolderachHighscore__20dTgSwordBattleGame_cCFv = .text:0x000012F0; // type:function size:0xB4 +getKoloktosHighscore__20dTgSwordBattleGame_cCFv = .text:0x000013B0; // type:function size:0xB4 +getTentalusHighscore__20dTgSwordBattleGame_cCFv = .text:0x00001470; // type:function size:0xB4 +getGhirahim2Highscore__20dTgSwordBattleGame_cCFv = .text:0x00001530; // type:function size:0xB4 +getImprisoned1Highscore__20dTgSwordBattleGame_cCFv = .text:0x000015F0; // type:function size:0xB4 +getImprisoned2Highscore__20dTgSwordBattleGame_cCFv = .text:0x000016B0; // type:function size:0xB4 +getImprisoned3Highscore__20dTgSwordBattleGame_cCFv = .text:0x00001770; // type:function size:0xB4 +getHordeHighscore__20dTgSwordBattleGame_cCFv = .text:0x00001830; // type:function size:0xB4 +getGhirahim3Highscore__20dTgSwordBattleGame_cCFv = .text:0x000018F0; // type:function size:0xB4 +getDemiseHighscore__20dTgSwordBattleGame_cCFv = .text:0x000019B0; // type:function size:0xB4 +getBossIdx__20dTgSwordBattleGame_cCFv = .text:0x00001A70; // type:function size:0x3C +getCurrentBossNumber__20dTgSwordBattleGame_cCFv = .text:0x00001AB0; // type:function size:0x3C +setCurrentBossNumber__20dTgSwordBattleGame_cFl = .text:0x00001AF0; // type:function size:0x20 +notifyBossDeath__20dTgSwordBattleGame_cFb = .text:0x00001B10; // type:function size:0x1C +checkFightStarted__20dTgSwordBattleGame_cCFv = .text:0x00001B30; // type:function size:0x8 +__dt__20dTgSwordBattleGame_cFv = .text:0x00001B40; // type:function size:0xE0 getStateID__89sStateMgr_c<20dTgSwordBattleGame_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x00001C20; // type:function size:0x10 build__36sFStateFct_c<20dTgSwordBattleGame_c>FRC12sStateIDIf_c = .text:0x00001C30; // type:function size:0x60 dispose__36sFStateFct_c<20dTgSwordBattleGame_c>FRP10sStateIf_c = .text:0x00001C90; // type:function size:0xC @@ -71,39 +71,40 @@ executeState__35sFStateID_c<20dTgSwordBattleGame_c>CFR20dTgSwordBattleGame_c = . initializeState__35sFStateID_c<20dTgSwordBattleGame_c>CFR20dTgSwordBattleGame_c = .text:0x00001DC0; // type:function size:0x30 __sinit_\d_t_sword_battle_game_cpp = .text:0x00001DF0; // type:function size:0x1E0 scope:local __dt__35sFStateID_c<20dTgSwordBattleGame_c>Fv = .text:0x00001FD0; // type:function size:0x58 -fn_72_2030 = .text:0x00002030; // type:function size:0x5C -fn_72_2090 = .text:0x00002090; // type:function size:0xDC -fn_72_2170 = .text:0x00002170; // type:function size:0xE0 +__dt__42sFStateVirtualID_c<20dTgSwordBattleGame_c>Fv = .text:0x00002030; // type:function size:0x5C +number__42sFStateVirtualID_c<20dTgSwordBattleGame_c>CFv = .text:0x00002090; // type:function size:0xDC +superID__42sFStateVirtualID_c<20dTgSwordBattleGame_c>CFv = .text:0x00002170; // type:function size:0xE0 isSameName__35sFStateID_c<20dTgSwordBattleGame_c>CFPCc = .text:0x00002250; // type:function size:0x88 _ctors = .ctors:0x00000000; // type:label scope:global _dtors = .dtors:0x00000000; // type:label scope:global __destroy_global_chain_reference = .dtors:0x00000000; // type:object size:0x4 scope:global -lbl_72_section4_0 = .data:0x00000000; // type:object size:0x18 data:4byte -lbl_72_section4_18 = .data:0x00000018; // type:object size:0x13 data:string -lbl_72_section4_2C = .data:0x0000002C; // type:object size:0x14 data:string -lbl_72_section4_40 = .data:0x00000040; // type:object size:0xC data:4byte -lbl_72_section4_4C = .data:0x0000004C; // type:object size:0x12 data:string -lbl_72_section4_60 = .data:0x00000060; // type:object size:0x7 data:string -lbl_72_section4_68 = .data:0x00000068; // type:object size:0xB data:string -lbl_72_section4_78 = .data:0x00000078; // type:object size:0x8 data:string -lbl_72_section4_80 = .data:0x00000080; // type:object size:0xA data:string -lbl_72_section4_8C = .data:0x0000008C; // type:object size:0xB data:string -lbl_72_section4_98 = .data:0x00000098; // type:object size:0xB data:string -lbl_72_section4_A8 = .data:0x000000A8; // type:object size:0x8 data:string -lbl_72_section4_B0 = .data:0x000000B0; // type:object size:0x20 data:4byte +lbl_72_section4_0 = .data:0x00000000; // type:object size:0x18 scope:local data:4byte +lbl_72_section4_18 = .data:0x00000018; // type:object size:0x13 scope:local data:string +lbl_72_section4_2C = .data:0x0000002C; // type:object size:0x14 scope:local data:string +lbl_72_section4_40 = .data:0x00000040; // type:object size:0xC scope:local data:4byte +lbl_72_section4_4C = .data:0x0000004C; // type:object size:0x12 scope:local data:string +lbl_72_section4_60 = .data:0x00000060; // type:object size:0x7 scope:local data:string +lbl_72_section4_68 = .data:0x00000068; // type:object size:0xB scope:local data:string +lbl_72_section4_78 = .data:0x00000078; // type:object size:0x8 scope:local data:string +lbl_72_section4_80 = .data:0x00000080; // type:object size:0xA scope:local data:string +lbl_72_section4_8C = .data:0x0000008C; // type:object size:0xB scope:local data:string +lbl_72_section4_98 = .data:0x00000098; // type:object size:0xB scope:local data:string +lbl_72_section4_A8 = .data:0x000000A8; // type:object size:0x8 scope:local data:string +lbl_72_section4_B0 = .data:0x000000B0; // type:object size:0x20 scope:local data:4byte g_profile_TAG_SWORD_BATTLE_GAME = .data:0x000000D0; // type:object size:0x10 -lbl_72_section4_E0 = .data:0x000000E0; // type:object size:0x4 data:4byte -lbl_72_section4_E4 = .data:0x000000E4; // type:object size:0x4 data:4byte +lbl_72_section4_E0 = .data:0x000000E0; // type:object size:0x4 scope:local data:4byte +lbl_72_section4_E4 = .data:0x000000E4; // type:object size:0x4 scope:local data:4byte jumptable_72_section4_E8 = .data:0x000000E8; // type:object size:0x30 scope:local -lbl_72_section4_118 = .data:0x00000118; // type:object size:0x90 -lbl_72_section4_1A8 = .data:0x000001A8; // type:object size:0x30 -lbl_72_section4_1D8 = .data:0x000001D8; // type:object size:0x30 -lbl_72_section4_208 = .data:0x00000208; // type:object size:0x18 -lbl_72_section4_220 = .data:0x00000220; // type:object size:0x120 -lbl_72_section4_340 = .data:0x00000340; // type:object size:0x68 +lbl_72_section4_118 = .data:0x00000118; // type:object size:0x90 scope:local +lbl_72_section4_1A8 = .data:0x000001A8; // type:object size:0x30 scope:local +lbl_72_section4_1D8 = .data:0x000001D8; // type:object size:0x30 scope:local +lbl_72_section4_208 = .data:0x00000208; // type:object size:0x18 scope:local +lbl_72_section4_220 = .data:0x00000220; // type:object size:0x120 scope:local +lbl_72_section4_340 = .data:0x00000340; // type:object size:0x68 scope:local __global_destructor_chain = .bss:0x00000000; // type:object size:0x4 scope:global -lbl_72_bss_8 = .bss:0x00000008; // type:object size:0xC data:4byte -TgSwordBattleGame__STATE_WAIT = .bss:0x00000014; // type:object size:0x40 data:4byte -TgSwordBattleGame__STATE_MANAGE = .bss:0x00000054; // type:object size:0x34 data:4byte -lbl_72_bss_88 = .bss:0x00000088; // type:object size:0x4 data:4byte -lbl_72_bss_8C = .bss:0x0000008C; // type:object size:0x1 data:byte +lbl_72_bss_8 = .bss:0x00000008; // type:object size:0xC scope:local data:4byte +StateID_Wait__20dTgSwordBattleGame_c = .bss:0x00000014; // type:object size:0x34 data:4byte +lbl_72_bss_48 = .bss:0x00000048; // type:object size:0xC scope:local data:4byte +StateID_Manage__20dTgSwordBattleGame_c = .bss:0x00000054; // type:object size:0x34 data:4byte +lbl_72_bss_88 = .bss:0x00000088; // type:object size:0x4 scope:local data:4byte +lbl_72_bss_8C = .bss:0x0000008C; // type:object size:0x1 scope:local data:byte diff --git a/config/SOUE01/rels/d_t_tumble_weedNP/symbols.txt b/config/SOUE01/rels/d_t_tumble_weedNP/symbols.txt index 383f069b..5dbe3d62 100644 --- a/config/SOUE01/rels/d_t_tumble_weedNP/symbols.txt +++ b/config/SOUE01/rels/d_t_tumble_weedNP/symbols.txt @@ -28,7 +28,7 @@ finalizeState_Wind__15dTgTumbleWeed_cFv = .text:0x000007B0; // type:function siz shouldSpawnTumbleweed__15dTgTumbleWeed_cFv = .text:0x000007C0; // type:function size:0x98 shouldDoWind__15dTgTumbleWeed_cFv = .text:0x00000860; // type:function size:0x54 doSpawnTumbleweed__15dTgTumbleWeed_cFv = .text:0x000008C0; // type:function size:0x288 -getWind__15dTgTumbleWeed_cFP7mVec3_c = .text:0x00000B50; // type:function size:0x114 +getWind__15dTgTumbleWeed_cFR7mVec3_c = .text:0x00000B50; // type:function size:0x114 __dt__15dTgTumbleWeed_cFv = .text:0x00000C70; // type:function size:0xD8 getStateID__84sStateMgr_c<15dTgTumbleWeed_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x00000D50; // type:function size:0x10 build__31sFStateFct_c<15dTgTumbleWeed_c>FRC12sStateIDIf_c = .text:0x00000D60; // type:function size:0x60 @@ -45,25 +45,27 @@ getOldStateID__84sStateMgr_c<15dTgTumbleWeed_c,20sStateMethodUsr_FI_c,12sFStateF finalizeState__30sFStateID_c<15dTgTumbleWeed_c>CFR15dTgTumbleWeed_c = .text:0x00000E90; // type:function size:0x30 executeState__30sFStateID_c<15dTgTumbleWeed_c>CFR15dTgTumbleWeed_c = .text:0x00000EC0; // type:function size:0x30 initializeState__30sFStateID_c<15dTgTumbleWeed_c>CFR15dTgTumbleWeed_c = .text:0x00000EF0; // type:function size:0x30 -__sinit_\d_t_tumble_weed_cpp = .text:0x00000F20; // type:function size:0x27C +__sinit_\d_t_tumble_weed_cpp = .text:0x00000F20; // type:function size:0x27C scope:local __dt__30sFStateID_c<15dTgTumbleWeed_c>Fv = .text:0x000011A0; // type:function size:0x58 isSameName__30sFStateID_c<15dTgTumbleWeed_c>CFPCc = .text:0x00001200; // type:function size:0x88 _ctors = .ctors:0x00000000; // type:label scope:global _dtors = .dtors:0x00000000; // type:label scope:global __destroy_global_chain_reference = .dtors:0x00000000; // type:object size:0x4 scope:global -lbl_476_rodata_0 = .rodata:0x00000000; // type:object size:0x1C data:float -lbl_476_rodata_1C = .rodata:0x0000001C; // type:object size:0x4 align:4 data:float -lbl_476_rodata_20 = .rodata:0x00000020; // type:object size:0x44 align:4 data:float +lbl_476_rodata_0 = .rodata:0x00000000; // type:object size:0x1C scope:local data:float +lbl_476_rodata_1C = .rodata:0x0000001C; // type:object size:0x4 scope:local align:4 data:float +lbl_476_rodata_20 = .rodata:0x00000020; // type:object size:0x44 scope:local align:4 data:float g_profile_TUMBLE_WEED_TAG = .data:0x00000000; // type:object size:0x10 data:4byte __vt__15dTgTumbleWeed_c = .data:0x00000010; // type:object size:0x74 __vt__54sFStateMgr_c<15dTgTumbleWeed_c,20sStateMethodUsr_FI_c> = .data:0x00000088; // type:object size:0x30 __vt__84sStateMgr_c<15dTgTumbleWeed_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c> = .data:0x000000B8; // type:object size:0x30 __vt__31sFStateFct_c<15dTgTumbleWeed_c> = .data:0x000000E8; // type:object size:0x14 __vt__28sFState_c<15dTgTumbleWeed_c> = .data:0x00000100; // type:object size:0x18 -lbl_476_data_118 = .data:0x00000118; // type:object size:0x148 +lbl_476_data_118 = .data:0x00000118; // type:object size:0x148 scope:local __vt__30sFStateID_c<15dTgTumbleWeed_c> = .data:0x00000260; // type:object size:0x34 __global_destructor_chain = .bss:0x00000000; // type:object size:0x4 scope:global -lbl_476_bss_8 = .bss:0x00000008; // type:object size:0x10 data:4byte +lbl_476_bss_8 = .bss:0x00000008; // type:object size:0xC scope:local data:4byte StateID_AreaOut__15dTgTumbleWeed_c = .bss:0x00000018; // type:object size:0x30 data:4byte -TgTumbleWeed__StateID_AreaIn = .bss:0x00000058; // type:object size:0x30 data:4byte -TgTumbleWeed__StateID_Wind = .bss:0x00000098; // type:object size:0x30 data:4byte +lbl_476_bss_48 = .bss:0x00000048; // type:object size:0xC scope:local data:4byte +StateID_AreaIn__15dTgTumbleWeed_c = .bss:0x00000058; // type:object size:0x30 data:4byte +lbl_476_bss_88 = .bss:0x00000088; // type:object size:0xC scope:local data:4byte +StateID_Wind__15dTgTumbleWeed_c = .bss:0x00000098; // type:object size:0x30 data:4byte diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 08b6c3c4..c0285720 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -3635,7 +3635,7 @@ execute__15MinigameManagerFv = .text:0x800A5240; // type:function size:0x30 isInAnyMinigame__15MinigameManagerFv = .text:0x800A5270; // type:function size:0x2C isInMinigameState__15MinigameManagerFQ215MinigameManager8Minigame = .text:0x800A52A0; // type:function size:0x28 setNextStoredSpecialMinigameState = .text:0x800A52D0; // type:function size:0x54 -endSpecialMinigameState = .text:0x800A5330; // type:function size:0x50 +endMinigame__15MinigameManagerFQ215MinigameManager8Minigame = .text:0x800A5330; // type:function size:0x50 fn_800A5380 = .text:0x800A5380; // type:function size:0x3C fn_800A53C0 = .text:0x800A53C0; // type:function size:0x3C fn_800A5400 = .text:0x800A5400; // type:function size:0x88 @@ -4405,9 +4405,9 @@ fn_800C7760 = .text:0x800C7760; // type:function size:0x38 model_getNodeWorldOrLocalMatrix = .text:0x800C77A0; // type:function size:0x24 fn_800C77D0 = .text:0x800C77D0; // type:function size:0x54 fn_800C7830 = .text:0x800C7830; // type:function size:0x44 -Timekeeper__ctor = .text:0x800C7880; // type:function size:0x28 -Timekeeper__dtorMaybe = .text:0x800C78B0; // type:function size:0x40 -fn_800C78F0 = .text:0x800C78F0; // type:function size:0x34 +__ct__10TimekeeperFv = .text:0x800C7880; // type:function size:0x28 +__dt__10TimekeeperFv = .text:0x800C78B0; // type:function size:0x40 +initUpCounter__10TimekeeperFv = .text:0x800C78F0; // type:function size:0x34 setTime = .text:0x800C7930; // type:function size:0x6C getTime__10TimekeeperCFv = .text:0x800C79A0; // type:function size:0x50 Timekeeper__setIsCountingUp = .text:0x800C79F0; // type:function size:0x8 @@ -10720,7 +10720,7 @@ fn_8019E120 = .text:0x8019E120; // type:function size:0xC4 fn_8019E1F0 = .text:0x8019E1F0; // type:function size:0x10 fn_8019E200 = .text:0x8019E200; // type:function size:0x18C fn_8019E390 = .text:0x8019E390; // type:function size:0xC -getCameraYRot = .text:0x8019E3A0; // type:function size:0x8 +getYRot__9dCamera_cCFv = .text:0x8019E3A0; // type:function size:0x8 fn_8019E3B0__9dCamera_cCFv = .text:0x8019E3B0; // type:function size:0xC fn_8019E3C0 = .text:0x8019E3C0; // type:function size:0x44 fn_8019E410__9dCamera_cFv = .text:0x8019E410; // type:function size:0x1C @@ -15441,19 +15441,19 @@ scoreRelatedExecute__14dLytMiniGame_cFv = .text:0x80295740; // type:function siz 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 +fn_80295940__14dLytMiniGame_cFv = .text:0x80295940; // type:function size:0x38 +fn_80295980__14dLytMiniGame_cFv = .text:0x80295980; // type:function size:0x98 fn_80295A20 = .text:0x80295A20; // type:function size:0x90 -fn_80295AB0 = .text:0x80295AB0; // type:function size:0x20 -fn_80295AD0 = .text:0x80295AD0; // type:function size:0x20 +fn_80295AB0__14dLytMiniGame_cFv = .text:0x80295AB0; // type:function size:0x20 +fn_80295AD0__14dLytMiniGame_cFv = .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 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 +setHighscore__14dLytMiniGame_cFl = .text:0x80295C70; // type:function size:0x38 +fn_80295CB0__14dLytMiniGame_cFb = .text:0x80295CB0; // type:function size:0x38 fn_80295CF0 = .text:0x80295CF0; // type:function size:0x8 fn_80295D00 = .text:0x80295D00; // type:function size:0xC fn_80295D10 = .text:0x80295D10; // type:function size:0xC @@ -42241,8 +42241,8 @@ sInstance__11dTitleMgr_c = .sbss:0x805756B4; // type:object size:0x4 data:4byte TITLE_SCREEN_CHANGE = .sbss:0x805756B8; // type:object size:0x4 data:4byte sInstance__10dTgSiren_c = .sbss:0x805756BC; // type:object size:0x4 data:4byte WEATHER_TAG = .sbss:0x805756C0; // type:object size:0x8 data:4byte -StreamTList = .sbss:0x805756C8; // type:object size:0x8 data:4byte -SandStreamTList = .sbss:0x805756D0; // type:object size:0x8 data:4byte +sStreamList__11dTgStream_c = .sbss:0x805756C8; // type:object size:0x8 data:4byte +sSandStreamList__11dTgStream_c = .sbss:0x805756D0; // type:object size:0x8 data:4byte lbl_805756D8 = .sbss:0x805756D8; // type:object size:0x8 data:4byte IMPRISONED_PTR = .sbss:0x805756E0; // type:object size:0x4 data:4byte TADTONE_GAME = .sbss:0x805756E4; // type:object size:0x4 data:4byte diff --git a/configure.py b/configure.py index 08b43a53..0833cb75 100644 --- a/configure.py +++ b/configure.py @@ -2877,7 +2877,7 @@ config.libs = [ Rel(Matching, "d_t_action", "REL/d/t/d_t_action.cpp"), Rel(NonMatching, "d_t_at0", "REL/d/t/d_t_at0.cpp"), Rel(NonMatching, "d_t_auto_message", "REL/d/t/d_t_auto_message.cpp"), - Rel(NonMatching, "d_t_barrel", "REL/d/t/d_t_barrel.cpp"), + Rel(Matching, "d_t_barrel", "REL/d/t/d_t_barrel.cpp"), Rel(Matching, "d_t_barrel_pos", "REL/d/t/d_t_barrel_pos.cpp"), Rel(NonMatching, "d_t_bb_quake", "REL/d/t/d_t_bb_quake.cpp"), Rel(NonMatching, "d_t_bcal_tag", "REL/d/t/d_t_bcal_tag.cpp"), @@ -2957,8 +2957,8 @@ config.libs = [ Rel(NonMatching, "d_t_sparks2", "REL/d/t/d_t_sparks2.cpp"), Rel(NonMatching, "d_t_sparks", "REL/d/t/d_t_sparks.cpp"), Rel(NonMatching, "d_t_spore", "REL/d/t/d_t_spore.cpp"), - Rel(NonMatching, "d_t_stream", "REL/d/t/d_t_stream.cpp"), - Rel(NonMatching, "d_t_sword_battle_game", "REL/d/t/d_t_sword_battle_game.cpp"), + Rel(Matching, "d_t_stream", "REL/d/t/d_t_stream.cpp"), + Rel(Matching, "d_t_sword_battle_game", "REL/d/t/d_t_sword_battle_game.cpp"), Rel(Matching, "d_t_sw_area", "REL/d/t/d_t_sw_area.cpp"), Rel(Matching, "d_t_tackle", "REL/d/t/d_t_tackle.cpp"), Rel(Matching, "d_t_telop", "REL/d/t/d_t_telop.cpp"), @@ -2966,7 +2966,7 @@ config.libs = [ Rel(Matching, "d_t_time_area_check", "REL/d/t/d_t_time_area_check.cpp"), Rel(Matching, "d_t_time_door_beam", "REL/d/t/d_t_time_door_beam.cpp"), Rel(Matching, "d_t_touch", "REL/d/t/d_t_touch.cpp"), - Rel(NonMatching, "d_t_tumble_weed", "REL/d/t/d_t_tumble_weed.cpp"), + Rel(Matching, "d_t_tumble_weed", "REL/d/t/d_t_tumble_weed.cpp"), ] diff --git a/include/d/a/d_a_base.h b/include/d/a/d_a_base.h index 45b2336f..c24f8ed7 100644 --- a/include/d/a/d_a_base.h +++ b/include/d/a/d_a_base.h @@ -52,6 +52,14 @@ public: BOOL isLinked() const { return get() != nullptr; } + + dAcRef_c *getPrev() const { + return static_cast *>(cListNd_c::getPrev()); + } + + dAcRef_c *getNext() const { + return static_cast *>(cListNd_c::getNext()); + } }; // Ghidra: ActorBase diff --git a/include/d/a/obj/d_a_obj_base.h b/include/d/a/obj/d_a_obj_base.h index 039def40..1faa9589 100644 --- a/include/d/a/obj/d_a_obj_base.h +++ b/include/d/a/obj/d_a_obj_base.h @@ -264,4 +264,6 @@ public: /* 0x14 */ u8 _14[0x2C - 0x14]; }; +typedef dAcRef_c dAcObjRef_c; + #endif diff --git a/include/d/a/obj/d_a_obj_spore.h b/include/d/a/obj/d_a_obj_spore.h new file mode 100644 index 00000000..1f787c6e --- /dev/null +++ b/include/d/a/obj/d_a_obj_spore.h @@ -0,0 +1,13 @@ +#ifndef D_A_O_SPORE_H +#define D_A_O_SPORE_H + +#include "d/a/obj/d_a_obj_base.h" +class dAcOSpore_c : public dAcObjBase_c { +public: + dAcOSpore_c() {} + virtual ~dAcOSpore_c() {} + +private: +}; + +#endif diff --git a/include/d/a/obj/d_a_obj_tumble_weed.h b/include/d/a/obj/d_a_obj_tumble_weed.h index e87012ad..a449b1c5 100644 --- a/include/d/a/obj/d_a_obj_tumble_weed.h +++ b/include/d/a/obj/d_a_obj_tumble_weed.h @@ -59,6 +59,8 @@ public: STATE_FUNC_DECLARE(dAcOTumbleWeed_c, Wait); STATE_FUNC_DECLARE(dAcOTumbleWeed_c, Slope); + STATE_MGR_DEFINE_UTIL_EXECUTESTATE(dTgTumbleWeed_c); + private: /* 0x330 */ nw4r::g3d::ResFile mResFile; /* 0x334 */ m3d::smdl_c mMdl; diff --git a/include/d/d_camera.h b/include/d/d_camera.h index ef2cf73d..8f4560a0 100644 --- a/include/d/d_camera.h +++ b/include/d/d_camera.h @@ -3,6 +3,7 @@ #include "common.h" #include "d/d_base.h" +#include "m/m_angle.h" #include "m/m_vec.h" extern "C" bool fn_80081FE0(void *, const char *); @@ -28,6 +29,10 @@ public: const mVec3_c &getField_0x78() const { return field_0x78; } + f32 getField_0x2A8() const { + return field_0x2A8; + } + mAng getYRot() const; bool doFn_800918E0(s32 a1, s16 a2) { return fn_800918E0(field_0xDA0, a1, a2); @@ -64,7 +69,9 @@ private: /* 0x068 */ u8 _0x068[0x6C - 0x068]; /* 0x06C */ mVec3_c mPositionMaybe; /* 0x078 */ mVec3_c field_0x78; - /* 0x084 */ u8 _0x084[0xD98 - 0x084]; + /* 0x084 */ u8 _0x084[0x2A8 - 0x084]; + /* 0x2A8 */ f32 field_0x2A8; + /* 0x2AC */ u8 _0x2AC[0xD98 - 0x2AC]; /* 0xD98 */ void *field_0xD98; /* 0xD9C */ u8 _0xD9C[0xDA0 - 0xD9C]; /* 0xDA0 */ void *field_0xDA0; diff --git a/include/d/d_sc_game.h b/include/d/d_sc_game.h index af9973dd..d1a905b7 100644 --- a/include/d/d_sc_game.h +++ b/include/d/d_sc_game.h @@ -203,7 +203,7 @@ public: sReloaderType = type; } - static dCamera_c *getCamera(s32 idx); + static dCamera_c *getCamera(s32 idx = 0); static void setCamera(s32 idx, dCamera_c *); bool isFaderSettled() const { diff --git a/include/d/flag/storyflag_map.h b/include/d/flag/storyflag_map.h index 64ca1504..86271424 100644 --- a/include/d/flag/storyflag_map.h +++ b/include/d/flag/storyflag_map.h @@ -2688,32 +2688,32 @@ enum StoryFlags_e { /** [(not implemented yet -- 6D05)] * Story Flag #533 (0x0215) - JP from 805ACE33 0x01 to 805ACE33 0x20 / US from 805A9BB3 0x01 to 805A9BB3 0x20 */ - STORYFLAG_533, + STORYFLAG_BOSSRUSH_CURRENT_MIN, /** [(not implemented yet -- 7205)] * Story Flag #534 (0x0216) - JP from 805ACE3D 0x01 to 805ACE3D 0x20 / US from 805A9BBD 0x01 to 805A9BBD 0x20 */ - STORYFLAG_534, + STORYFLAG_BOSSRUSH_CURRENT_SEC, /** [(not implemented yet -- 7266)] * Story Flag #535 (0x0217) - JP from 805ACE3D 0x40 to 805ACE3C 0x10 / US from 805A9BBD 0x40 to 805A9BBC 0x10 */ - STORYFLAG_535, + STORYFLAG_BOSSRUSH_CURRENT_MS, /** [(not implemented yet -- 6D65)] * Story Flag #536 (0x0218) - JP from 805ACE33 0x40 to 805ACE32 0x08 / US from 805A9BB3 0x40 to 805A9BB2 0x08 */ - STORYFLAG_536, + STORYFLAG_GHIRAHIM1_TIME_MIN, /** [(not implemented yet -- 7145)] * Story Flag #537 (0x0219) - JP from 805ACE3B 0x10 to 805ACE3A 0x02 / US from 805A9BBB 0x10 to 805A9BBA 0x02 */ - STORYFLAG_537, + STORYFLAG_GHIRAHIM1_TIME_SEC, /** [(not implemented yet -- 7006)] * Story Flag #538 (0x021A) - JP from 805ACE39 0x01 to 805ACE39 0x40 / US from 805A9BB9 0x01 to 805A9BB9 0x40 */ - STORYFLAG_538, + STORYFLAG_GHIRAHIM1_TIME_MS, /** [(not implemented yet -- 71A5)] * Story Flag #539 (0x021B) - JP from 805ACE3A 0x04 to 805ACE3A 0x80 / US from 805A9BBA 0x04 to 805A9BBA 0x80 @@ -2883,7 +2883,7 @@ enum StoryFlags_e { /** [In Boss Rush mode (can be unset)] * Story Flag #572 (0x023C) - JP 805ACD98 0x08 / US 805A9B18 0x08 */ - STORYFLAG_572, + STORYFLAG_BOSSRUSH_ACTIVE, /** [In redoing slient realm mode?] * Story Flag #573 (0x023D) - JP 805ACD98 0x10 / US 805A9B18 0x10 @@ -2988,167 +2988,167 @@ enum StoryFlags_e { /** [(not implemented yet -- 6875)] * Story Flag #593 (0x0251) - JP from 805ACE29 0x80 to 805ACE28 0x10 / US from 805A9BA9 0x80 to 805A9BA8 0x10 */ - STORYFLAG_593, + STORYFLAG_SCALDERA_TIME_MIN, /** [(not implemented yet -- 6705)] * Story Flag #594 (0x0252) - JP from 805ACE27 0x01 to 805ACE27 0x20 / US from 805A9BA7 0x01 to 805A9BA7 0x20 */ - STORYFLAG_594, + STORYFLAG_SCALDERA_TIME_SEC, /** [(not implemented yet -- 6766)] * Story Flag #595 (0x0253) - JP from 805ACE27 0x40 to 805ACE26 0x10 / US from 805A9BA7 0x40 to 805A9BA6 0x10 */ - STORYFLAG_595, + STORYFLAG_SCALDERA_TIME_MS, /** [(not implemented yet -- 6605)] * Story Flag #596 (0x0254) - JP from 805ACE25 0x01 to 805ACE25 0x20 / US from 805A9BA5 0x01 to 805A9BA5 0x20 */ - STORYFLAG_596, + STORYFLAG_MOLDERACH_TIME_MIN, /** [(not implemented yet -- 6665)] * Story Flag #597 (0x0255) - JP from 805ACE25 0x40 to 805ACE24 0x08 / US from 805A9BA5 0x40 to 805A9BA4 0x08 */ - STORYFLAG_597, + STORYFLAG_MOLDERACH_TIME_SEC, /** [(not implemented yet -- 6506)] * Story Flag #598 (0x0256) - JP from 805ACE23 0x01 to 805ACE23 0x40 / US from 805A9BA3 0x01 to 805A9BA3 0x40 */ - STORYFLAG_598, + STORYFLAG_MOLDERACH_TIME_MS, /** [(not implemented yet -- 6575)] * Story Flag #599 (0x0257) - JP from 805ACE23 0x80 to 805ACE22 0x10 / US from 805A9BA3 0x80 to 805A9BA2 0x10 */ - STORYFLAG_599, + STORYFLAG_IMP1_TIME_MIN, /** [(not implemented yet -- 6405)] * Story Flag #600 (0x0258) - JP from 805ACE21 0x01 to 805ACE21 0x20 / US from 805A9BA1 0x01 to 805A9BA1 0x20 */ - STORYFLAG_600, + STORYFLAG_IMP1_TIME_SEC, /** [(not implemented yet -- 6466)] * Story Flag #601 (0x0259) - JP from 805ACE21 0x40 to 805ACE20 0x10 / US from 805A9BA1 0x40 to 805A9BA0 0x10 */ - STORYFLAG_601, + STORYFLAG_IMP1_TIME_MS, /** [(not implemented yet -- 6305)] * Story Flag #602 (0x025A) - JP from 805ACE1F 0x01 to 805ACE1F 0x20 / US from 805A9B9F 0x01 to 805A9B9F 0x20 */ - STORYFLAG_602, + STORYFLAG_KOLOKTOS_TIME_MIN, /** [(not implemented yet -- 6365)] * Story Flag #603 (0x025B) - JP from 805ACE1F 0x40 to 805ACE1E 0x08 / US from 805A9B9F 0x40 to 805A9B9E 0x08 */ - STORYFLAG_603, + STORYFLAG_KOLOKTOS_TIME_SEC, /** [(not implemented yet -- 6206)] * Story Flag #604 (0x025C) - JP from 805ACE1D 0x01 to 805ACE1D 0x40 / US from 805A9B9D 0x01 to 805A9B9D 0x40 */ - STORYFLAG_604, + STORYFLAG_KOLOKTOS_TIME_MS, /** [(not implemented yet -- 6275)] * Story Flag #605 (0x025D) - JP from 805ACE1D 0x80 to 805ACE1C 0x10 / US from 805A9B9D 0x80 to 805A9B9C 0x10 */ - STORYFLAG_605, + STORYFLAG_TENTALUS_TIME_MIN, /** [(not implemented yet -- 6105)] * Story Flag #606 (0x025E) - JP from 805ACE1B 0x01 to 805ACE1B 0x20 / US from 805A9B9B 0x01 to 805A9B9B 0x20 */ - STORYFLAG_606, + STORYFLAG_TENTALUS_TIME_SEC, /** [(not implemented yet -- 6166)] * Story Flag #607 (0x025F) - JP from 805ACE1B 0x40 to 805ACE1A 0x10 / US from 805A9B9B 0x40 to 805A9B9A 0x10 */ - STORYFLAG_607, + STORYFLAG_TENTALUS_TIME_MS, /** [(not implemented yet -- 6005)] * Story Flag #608 (0x0260) - JP from 805ACE19 0x01 to 805ACE19 0x20 / US from 805A9B99 0x01 to 805A9B99 0x20 */ - STORYFLAG_608, + STORYFLAG_GHIRAHIM2_TIME_MIN, /** [(not implemented yet -- 6065)] * Story Flag #609 (0x0261) - JP from 805ACE19 0x40 to 805ACE18 0x08 / US from 805A9B99 0x40 to 805A9B98 0x08 */ - STORYFLAG_609, + STORYFLAG_GHIRAHIM2_TIME_SEC, /** [(not implemented yet -- 5F06)] * Story Flag #610 (0x0262) - JP from 805ACE17 0x01 to 805ACE17 0x40 / US from 805A9B97 0x01 to 805A9B97 0x40 */ - STORYFLAG_610, + STORYFLAG_GHIRAHIM2_TIME_MS, /** [(not implemented yet -- 5F75)] * Story Flag #611 (0x0263) - JP from 805ACE17 0x80 to 805ACE16 0x10 / US from 805A9B97 0x80 to 805A9B96 0x10 */ - STORYFLAG_611, + STORYFLAG_IMP2_TIME_MIN, /** [(not implemented yet -- 5E05)] * Story Flag #612 (0x0264) - JP from 805ACE15 0x01 to 805ACE15 0x20 / US from 805A9B95 0x01 to 805A9B95 0x20 */ - STORYFLAG_612, + STORYFLAG_IMP2_TIME_SEC, /** [(not implemented yet -- 5E66)] * Story Flag #613 (0x0265) - JP from 805ACE15 0x40 to 805ACE14 0x10 / US from 805A9B95 0x40 to 805A9B94 0x10 */ - STORYFLAG_613, + STORYFLAG_IMP2_TIME_MS, /** [(not implemented yet -- 5D05)] * Story Flag #614 (0x0266) - JP from 805ACE13 0x01 to 805ACE13 0x20 / US from 805A9B93 0x01 to 805A9B93 0x20 */ - STORYFLAG_614, + STORYFLAG_IMP3_TIME_MIN, /** [(not implemented yet -- 5D65)] * Story Flag #615 (0x0267) - JP from 805ACE13 0x40 to 805ACE12 0x08 / US from 805A9B93 0x40 to 805A9B92 0x08 */ - STORYFLAG_615, + STORYFLAG_IMP3_TIME_SEC, /** [(not implemented yet -- 5C06)] * Story Flag #616 (0x0268) - JP from 805ACE11 0x01 to 805ACE11 0x40 / US from 805A9B91 0x01 to 805A9B91 0x40 */ - STORYFLAG_616, + STORYFLAG_IMP3_TIME_MS, /** [(not implemented yet -- 5C75)] * Story Flag #617 (0x0269) - JP from 805ACE11 0x80 to 805ACE10 0x10 / US from 805A9B91 0x80 to 805A9B90 0x10 */ - STORYFLAG_617, + STORYFLAG_HORDE_TIME_MIN, /** [(not implemented yet -- 5B05)] * Story Flag #618 (0x026A) - JP from 805ACE0F 0x01 to 805ACE0F 0x20 / US from 805A9B8F 0x01 to 805A9B8F 0x20 */ - STORYFLAG_618, + STORYFLAG_HORDE_TIME_SEC, /** [(not implemented yet -- 5B66)] * Story Flag #619 (0x026B) - JP from 805ACE0F 0x40 to 805ACE0E 0x10 / US from 805A9B8F 0x40 to 805A9B8E 0x10 */ - STORYFLAG_619, + STORYFLAG_HORDE_TIME_MS, /** [(not implemented yet -- 5A05)] * Story Flag #620 (0x026C) - JP from 805ACE0D 0x01 to 805ACE0D 0x20 / US from 805A9B8D 0x01 to 805A9B8D 0x20 */ - STORYFLAG_620, + STORYFLAG_GHIRAHIM3_TIME_MIN, /** [(not implemented yet -- 5A65)] * Story Flag #621 (0x026D) - JP from 805ACE0D 0x40 to 805ACE0C 0x08 / US from 805A9B8D 0x40 to 805A9B8C 0x08 */ - STORYFLAG_621, + STORYFLAG_GHIRAHIM3_TIME_SEC, /** [(not implemented yet -- 5906)] * Story Flag #622 (0x026E) - JP from 805ACE0B 0x01 to 805ACE0B 0x40 / US from 805A9B8B 0x01 to 805A9B8B 0x40 */ - STORYFLAG_622, + STORYFLAG_GHIRAHIM3_TIME_MS, /** [(not implemented yet -- 5975)] * Story Flag #623 (0x026F) - JP from 805ACE0B 0x80 to 805ACE0A 0x10 / US from 805A9B8B 0x80 to 805A9B8A 0x10 */ - STORYFLAG_623, + STORYFLAG_DEMISE_TIME_MIN, /** [(not implemented yet -- 5805)] * Story Flag #624 (0x0270) - JP from 805ACE09 0x01 to 805ACE09 0x20 / US from 805A9B89 0x01 to 805A9B89 0x20 */ - STORYFLAG_624, + STORYFLAG_DEMISE_TIME_SEC, /** [(not implemented yet -- 5866)] * Story Flag #625 (0x0271) - JP from 805ACE09 0x40 to 805ACE08 0x10 / US from 805A9B89 0x40 to 805A9B88 0x10 */ - STORYFLAG_625, + STORYFLAG_DEMISE_TIME_MS, /** [(not implemented yet -- 550D)] * Story Flag #626 (0x0272) - JP from 805ACE03 0x01 to 805ACE02 0x20 / US from 805A9B83 0x01 to 805A9B82 0x20 @@ -3538,17 +3538,17 @@ enum StoryFlags_e { /** [Sets when you refight imp 1 (Sealed Grounds layer 2)] * Story Flag #703 (0x02BF) - JP 805ACDA2 0x08 / US 805A9B22 0x08 */ - STORYFLAG_703, + STORYFLAG_IMPRISONED1_BOSSRUSH, /** [Sets when you refight imp 2 (Sealed Grounds layer 3)] * Story Flag #704 (0x02C0) - JP 805ACDA2 0x10 / US 805A9B22 0x10 */ - STORYFLAG_704, + STORYFLAG_IMPRISONED2_BOSSRUSH, /** [Sets when you refight imp3 (Sealed Grounds layer 4)] * Story Flag #705 (0x02C1) - JP 805ACDA2 0x20 / US 805A9B22 0x20 */ - STORYFLAG_705, + STORYFLAG_IMPRISONED3_BOSSRUSH, /** [Minecart Escort done (Lanayru Gorge layer 2)] * Story Flag #706 (0x02C2) - JP 805ACDA2 0x40 / US 805A9B22 0x40 @@ -3653,7 +3653,7 @@ enum StoryFlags_e { /** [[Gets Set in a refight](Hylia's Realm layer 4)] * Story Flag #726 (0x02D6) - JP 805ACDA4 0x40 / US 805A9B24 0x40 */ - STORYFLAG_726, + STORYFLAG_DEMISE_BOSSRUSH, /** [Talking to Fi after filling Wallet] * Story Flag #727 (0x02D7) - JP 805ACDA4 0x80 / US 805A9B24 0x80 diff --git a/include/d/lyt/d_lyt_mini_game.h b/include/d/lyt/d_lyt_mini_game.h index a8065496..bfb19692 100644 --- a/include/d/lyt/d_lyt_mini_game.h +++ b/include/d/lyt/d_lyt_mini_game.h @@ -9,6 +9,20 @@ public: return sInstance; } + /** Updates some window */ + void fn_80295940(); + /** ??? */ + void fn_80295980(); + /** Checks to see if in BAMBOO_CUTTING .. BOSS_RUSH and returns some boolean (start?) */ + bool fn_80295AB0(); + /** Checks to see if in BAMBOO_CUTTING .. BOSS_RUSH and returns some boolean (end?) */ + bool fn_80295AD0(); + + void setHighscore(s32 time); + + /** GUESS: sets the start for the high score? */ + void fn_80295CB0(bool); + void timeRelatedExecute(); void scoreRelatedExecute(); @@ -18,7 +32,15 @@ public: void timeRelated(); void scoreRelated(); + /** GUESS: Assumption based on function caller */ + void setComplete() { + field_0x3866 = true; + } + private: + u8 _0x0000[0x3866 - 0x0000]; + bool field_0x3866; + static dLytMiniGame_c *sInstance; }; diff --git a/include/d/t/d_t_barrel.h b/include/d/t/d_t_barrel.h index 3266d6d1..19fb57e8 100644 --- a/include/d/t/d_t_barrel.h +++ b/include/d/t/d_t_barrel.h @@ -3,6 +3,7 @@ #include "common.h" #include "d/a/d_a_base.h" +#include "d/a/obj/d_a_obj_base.h" #include "d/t/d_tg.h" #include "m/m_vec.h" #include "s/s_State.hpp" @@ -29,9 +30,9 @@ public: private: /* 0x0FC */ STATE_MGR_DECLARE(dTgBarrel_c); - /* 0x138 */ dAcRef_c mStageRef; + /* 0x138 */ dAcObjRef_c mStageRef; /* 0x144 */ dAcRef_c mTgBarrelPosArr[10]; - /* 0x1BC */ dAcRef_c mBarrelArr[10]; + /* 0x1BC */ dAcObjRef_c mBarrelArr[10]; /* 0x234 */ mVec3_c mSpawnPosition; /* 0x240 */ u8 mStopFlag; ///< Stop Sceneflag - Note there is no checking done to see if valid /* 0x241 */ u8 mSpawnInterval; ///< Barrel Spawn Interval in Seconds diff --git a/include/d/t/d_t_spore.h b/include/d/t/d_t_spore.h index 492aa9f0..e24375e3 100644 --- a/include/d/t/d_t_spore.h +++ b/include/d/t/d_t_spore.h @@ -1,19 +1,62 @@ #ifndef D_T_SPORE_H #define D_T_SPORE_H -#include "d/a/d_a_base.h" +#include "d/t/d_tg.h" +#include "egg/egg_types.h" +#include "m/m3d/m_proc.h" +#include "m/m_angle.h" +#include "m/m_vec.h" #include "s/s_State.hpp" -#include "s/s_StateMgr.hpp" -class dSporeTag_c : public dAcBase_c { +class dSporeProc_c : public m3d::proc_c { +public: + dSporeProc_c() : mpTexture(nullptr), field_0x39EC(false), field_0x39ED(false), field_0x39EE(0), field_0x39F0(0) {} + ~dSporeProc_c() {}; + + virtual void drawXlu() override; + + void execute(); + +private: + /* 0x0018 */ mVec3_c mSporesPos[400]; + /* 0x12D8 */ f32 field_0x12D8[400]; + /* 0x1918 */ f32 field_0x1918[400]; + /* 0x1F58 */ f32 field_0x1F58[400]; + /* 0x2598 */ f32 field_0x2598[400]; + /* 0x2BD8 */ f32 field_0x2BD8[400]; + /* 0x3218 */ mAng field_0x3218[400]; + /* 0x3538 */ mAng field_0x3538[400]; + /* 0x3858 */ s8 field_0x3858[400]; + /* 0x39E8 */ EGG::ResTIMG *mpTexture; + /* 0x39EC */ bool field_0x39EC; + /* 0x39ED */ u8 field_0x39ED; + /* 0x39EE */ s16 field_0x39EE; + /* 0x39F0 */ u8 field_0x39F0; + /* 0x39F1 */ u8 _0x39F1[0x3A02 - 0x39F1]; + /* 0x3A02 */ s16 field_0x3A02; + /* 0x3A04 */ s16 field_0x3A04; + /* 0x3A06 */ s16 field_0x3A06; + + friend class dSporeTag_c; +}; + +class dSporeTag_c : public dTg_c { public: dSporeTag_c() : mStateMgr(*this, sStateID::null) {} virtual ~dSporeTag_c() {} + virtual int create() override; + virtual int doDelete() override; + virtual int draw() override; + virtual bool createHeap() override; + virtual int actorExecute() override; + virtual int actorExecuteInEvent() override; + STATE_FUNC_DECLARE(dSporeTag_c, Wait); private: - /* 0x??? */ STATE_MGR_DECLARE(dSporeTag_c); + /* 0x0FC */ STATE_MGR_DECLARE(dSporeTag_c); + /* 0x138 */ dSporeProc_c mProc; }; #endif diff --git a/include/d/t/d_t_stream.h b/include/d/t/d_t_stream.h index 76d077e6..ef32391f 100644 --- a/include/d/t/d_t_stream.h +++ b/include/d/t/d_t_stream.h @@ -1,14 +1,36 @@ #ifndef D_T_STREAM_H #define D_T_STREAM_H -#include "d/a/d_a_base.h" +#include "d/t/d_tg.h" +#include "f/f_list_mg.h" +#include "f/f_list_nd.h" +#include "m/m_mtx.h" -class dTgStream_c : public dAcBase_c { +class dTgStream_c : public dTg_c { public: - dTgStream_c() {} + dTgStream_c() : mStreamNode(this) {} virtual ~dTgStream_c() {} + virtual int create() override; + virtual int doDelete() override; + virtual int actorExecute() override; + + // The following lists are defined in the dol + static fLiMgBa_c sStreamList; + static fLiMgBa_c sSandStreamList; + + void addToList(fLiMgBa_c &list); + private: + /* 0x0FC */ u8 mSceneflag; ///< Sceneflag to indicate when to flow + /* 0x0FD */ u8 mAreaIdx; + /* 0x0FE */ u8 mSpeed; + /* 0x0FF */ u8 mOrder; + /* 0x100 */ u8 mIsSand; + /* 0x101 */ u8 field_0x101; + /* 0x104 */ mMtx_c mArea; + + /* 0x134 */ fLiNdBa_c mStreamNode; }; #endif diff --git a/include/d/t/d_t_sword_battle_game.h b/include/d/t/d_t_sword_battle_game.h index cfe7ff90..d5503033 100644 --- a/include/d/t/d_t_sword_battle_game.h +++ b/include/d/t/d_t_sword_battle_game.h @@ -1,17 +1,87 @@ #ifndef D_T_SWORD_BATTLE_GAME_H #define D_T_SWORD_BATTLE_GAME_H -#include "d/a/d_a_base.h" +#include "d/t/d_tg.h" #include "s/s_State.hpp" -#include "s/s_StateMgr.hpp" +#include "toBeSorted/actor_event.h" +#include "toBeSorted/timekeeper.h" -class dTgSwordBattleGame_c : public dAcBase_c { +class dTgSwordBattleGame_c : public dTg_c { public: - dTgSwordBattleGame_c() : mStateMgr(*this, sStateID::null) {} + dTgSwordBattleGame_c() : mStateMgr(*this, sStateID::null), mEventRelated(*this, 0) {} virtual ~dTgSwordBattleGame_c() {} + virtual int create() override; + virtual int doDelete() override; + virtual int draw() override; + virtual int actorExecute() override; + virtual int actorExecuteInEvent() override; + + /* vt 0x74-0x80*/ STATE_VIRTUAL_FUNC_DECLARE(dTgSwordBattleGame_c, Wait); + /* vt 0x80-0x88*/ STATE_VIRTUAL_FUNC_DECLARE(dTgSwordBattleGame_c, Manage); + void init(); + + bool checkInEvent(const char *eventName); + + bool checkInBossRushFlag(); + void unsetInBossRushFlag(); + void setInBossRushFlag(); + + void unsetEarlyFightFlags() const; + void unsetImprisonedFightFlags() const; + void unsetDemiseFightFlag() const; + + s32 getCurrentTime() const; + void saveCurrentTime(s32 time) const; + + s32 getBossIdx() const; + s32 getBossHighscore() const; + + /** Index 0 */ + s32 getGhirahim1Highscore() const; + /** Index 1 */ + s32 getScalderaHighscore() const; + /** Index 2 */ + s32 getMolderachHighscore() const; + /** Index 3 */ + s32 getImprisoned1Highscore() const; + /** Index 4 */ + s32 getKoloktosHighscore() const; + /** Index 5 */ + s32 getTentalusHighscore() const; + /** Index 6 */ + s32 getGhirahim2Highscore() const; + /** Index 7 */ + s32 getImprisoned2Highscore() const; + /** Index 8 */ + s32 getImprisoned3Highscore() const; + /** Index 9 */ + s32 getHordeHighscore() const; + /** Index 10 */ + s32 getGhirahim3Highscore() const; + /** Index 11 */ + s32 getDemiseHighscore() const; + + s32 getCurrentBossNumber() const; + void setCurrentBossNumber(s32 num); + + void notifyBossDeath(bool ghirahim_related = false); + bool checkFightStarted() const; + private: - /* 0x??? */ STATE_MGR_DECLARE(dTgSwordBattleGame_c); + /* 0x0FC */ STATE_MGR_DECLARE(dTgSwordBattleGame_c); + /* 0x138 */ ActorEventRelated mEventRelated; + /* 0x188 */ Timekeeper mTimer; + /* 0x1A8 */ bool field_0x1A8; + /* 0x1A9 */ bool field_0x1A9; + /* 0x1AA */ bool field_0x1AA; + /* 0x1AB */ bool field_0x1AB; ///< set if current boss is complete + /* 0x1AC */ bool field_0x1AC; + /* 0x1AD */ u8 field_0x1AD; + /* 0x1AE */ u8 field_0x1AE; + /* 0x1B0 */ u32 mBossNumber; + + // Note: Gets padded to 0x1B8 due to Timekeepers 8-byte alignment }; #endif diff --git a/include/d/t/d_t_tumble_weed.h b/include/d/t/d_t_tumble_weed.h index 9dc5f39e..a1918cfa 100644 --- a/include/d/t/d_t_tumble_weed.h +++ b/include/d/t/d_t_tumble_weed.h @@ -1,13 +1,13 @@ #ifndef D_T_TUMBLE_WEED_H #define D_T_TUMBLE_WEED_H -#include "d/a/obj/d_a_obj_tumble_weed.h" #include "d/t/d_tg.h" #include "s/s_State.hpp" +class dAcOTumbleWeed_c; class dTgTumbleWeed_c : public dTg_c { public: - dTgTumbleWeed_c() : mStateMgr(*this, sStateID::null), childTumbleweed(nullptr) {} + dTgTumbleWeed_c() : mStateMgr(*this, sStateID::null) {} virtual ~dTgTumbleWeed_c() {} virtual int create() override; virtual int actorExecute() override; @@ -18,18 +18,21 @@ public: STATE_FUNC_DECLARE(dTgTumbleWeed_c, AreaIn); STATE_FUNC_DECLARE(dTgTumbleWeed_c, Wind); + STATE_MGR_DEFINE_UTIL_EXECUTESTATE(dTgTumbleWeed_c); + private: bool shouldSpawnTumbleweed(); bool shouldDoWind(); void doSpawnTumbleweed(); - void getWind(mVec3_c *); + void getWind(mVec3_c &); - STATE_MGR_DECLARE(dTgTumbleWeed_c); - u16 tumbleweedTimer; - u16 padding; - u16 windTimer; - dAcRef_c childTumbleweed; - u16 someField; + /* 0x0FC */ STATE_MGR_DECLARE(dTgTumbleWeed_c); + + /* 0x138 */ u16 mSpawnTimer; + /* 0x13A */ u16 field_0x13A; + /* 0x13C */ u16 mWindTimer; + /* 0x140 */ dAcRef_c mSpawnedTumbleWeed; + /* 0x14C */ u16 field_0x14C; }; #endif diff --git a/include/d/t/d_tg.h b/include/d/t/d_tg.h index 4aa87822..a0cdf29d 100644 --- a/include/d/t/d_tg.h +++ b/include/d/t/d_tg.h @@ -8,4 +8,6 @@ public: virtual ~dTg_c() {} }; +typedef dAcRef_c dTgRef_c; + #endif diff --git a/include/s/s_State.hpp b/include/s/s_State.hpp index d461f630..807a1bd9 100644 --- a/include/s/s_State.hpp +++ b/include/s/s_State.hpp @@ -38,6 +38,10 @@ void changeState(const sStateIDIf_c &value) { \ mStateMgr.changeState(value); \ } +#define STATE_MGR_DEFINE_UTIL_EXECUTESTATE(class_name) \ + void executeState() { \ + mStateMgr.executeState(); \ + } #define STATE_MGR_DEFINE_UTIL_ISSTATE(class_name) \ bool isState(const sFStateID_c &value) const { \ diff --git a/include/toBeSorted/minigame_mgr.h b/include/toBeSorted/minigame_mgr.h index f473974b..10bb4be3 100644 --- a/include/toBeSorted/minigame_mgr.h +++ b/include/toBeSorted/minigame_mgr.h @@ -19,12 +19,22 @@ public: HARP_PLAYING, }; static bool isInMinigameState(Minigame game); + static bool isInAnyMinigame(); + static bool endMinigame(Minigame game); + static void create(); static void destroy(); static void execute(); + static MinigameManager *GetInstance() { + return sInstance; + } + static bool checkInBossRush() { + return isInMinigameState(BOSS_RUSH); + } + private: MinigameManager() {} virtual ~MinigameManager() {} diff --git a/include/toBeSorted/timekeeper.h b/include/toBeSorted/timekeeper.h index 1bf6d842..d297bb76 100644 --- a/include/toBeSorted/timekeeper.h +++ b/include/toBeSorted/timekeeper.h @@ -3,9 +3,26 @@ #include "common.h" +#define TIME_CONVERT(min, sec, msec) ((min * 60 * 1000) + (sec * 1000) + (msec * 10)) + class Timekeeper { public: + Timekeeper(); + virtual ~Timekeeper(); + + virtual s32 vt_0x0C(); ///< Init + virtual s32 vt_0x10(); ///< Delete + virtual s32 vt_0x14(); + virtual s32 doCount(); + virtual s32 vt_0x1C(); + s32 getTime() const; + void initUpCounter(); + + /* 0x08 */ s64 mTime; + /* 0x10 */ u32 mCountingUp; + /* 0x14 */ u32 mCountingDown; + /* 0x1C */ bool field_0x1C; }; #endif diff --git a/src/REL/d/t/d_t_barrel.cpp b/src/REL/d/t/d_t_barrel.cpp index d6d81a89..f1c64bf4 100644 --- a/src/REL/d/t/d_t_barrel.cpp +++ b/src/REL/d/t/d_t_barrel.cpp @@ -84,7 +84,7 @@ void dTgBarrel_c::executeState_Wait() { mStateMgr.changeState(StateID_Stop); return; } - dAcOstageSink_c *pStage = mStageRef.get(); + dAcObjBase_c *pStage = mStageRef.get(); mVec3_c pos = pStage->mPosition; mAng3_c rot = pStage->mRotation; diff --git a/src/REL/d/t/d_t_spore.cpp b/src/REL/d/t/d_t_spore.cpp index 24a4dff2..aa7937eb 100644 --- a/src/REL/d/t/d_t_spore.cpp +++ b/src/REL/d/t/d_t_spore.cpp @@ -1,9 +1,269 @@ #include "d/t/d_t_spore.h" +#include "c/c_math.h" +#include "common.h" +#include "d/a/d_a_player.h" +#include "d/a/obj/d_a_obj_base.h" +#include "d/d_camera.h" +#include "d/d_light_env.h" +#include "d/d_sc_game.h" +#include "d/t/d_t_siren.h" +#include "egg/egg_types.h" +#include "egg/gfx/eggDrawGX.h" +#include "f/f_base.h" +#include "m/m_angle.h" +#include "m/m_color.h" +#include "m/m_mtx.h" +#include "m/m_vec.h" +#include "nw4r/g3d/g3d_scnobj.h" +#include "rvl/GX/GXGeometry.h" +#include "rvl/GX/GXTev.h" +#include "rvl/GX/GXTransform.h" +#include "rvl/GX/GXTypes.h" +#include "rvl/MTX/mtxvec.h" +#include "s/s_Math.h" + SPECIAL_ACTOR_PROFILE(SPORE_TAG, dSporeTag_c, fProfile::SPORE_TAG, 0xD, 0, 388); STATE_DEFINE(dSporeTag_c, Wait); +bool dSporeTag_c::createHeap() { + u32 size = 0; + if (!mProc.create(&mAllocator, &size)) { + return true; + } + mProc.mpTexture = static_cast(dAcObjBase_c::getOarcFile("Common", "tex/WK2_Houshi.bti")); + return true; +} + +int dSporeTag_c::create() { + CREATE_ALLOCATOR(dSporeTag_c); + + mProc.setPriorityDraw(0, 142); + mProc.setOption(nw4r::g3d::ScnObj::OPTION_DISABLE_DRAW_OPA, true); + mStateMgr.changeState(StateID_Wait); + mProc.field_0x39ED = true; + + return SUCCEEDED; +} + +int dSporeTag_c::doDelete() { + return SUCCEEDED; +} + +int dSporeTag_c::actorExecuteInEvent() { + mStateMgr.executeState(); + return SUCCEEDED; +} + +int dSporeTag_c::actorExecute() { + mStateMgr.executeState(); + return SUCCEEDED; +} + +int dSporeTag_c::draw() { + mProc.entry(); + return SUCCEEDED; +} + +void dSporeProc_c::execute() { + // NONMATCHING + // I dont feel like it + mVec3_c _playerPos = dAcPy_c::GetLink()->mPosition; + dLightEnv_c &env = dLightEnv_c::GetInstance(); + dCamera_c *pCam = dScGame_c::getCamera(); + + mVec3_c camPos; + mVec3_c camTowards; + + camPos = pCam->getPositionMaybe(); + camTowards = pCam->getField_0x78() - camPos; + + if (pCam != nullptr && camTowards.normalizeRS()) { + mVec3_c v; + mVec3_c pos = camPos + camTowards * 1000.f; + if (!field_0x39EC) { + for (s32 i = 0; i < 400; ++i) { + mSporesPos[i].x = pos.x + cM::rndFX(1100.f); + mSporesPos[i].y = pos.y + cM::rndFX(1100.f); + mSporesPos[i].z = pos.z + cM::rndFX(1100.f); + + field_0x1F58[i] = 0.f; + field_0x1918[i] = 1.f; + + field_0x3218[i] = cM::rnd() * 65535.f; + field_0x3538[i] = cM::rnd() * 65535.f; + + field_0x3858[i] = 0; + + field_0x2598[i] = cM::rndF(45.f) + 90.f; + field_0x2BD8[i] = cM::rndF(360.f); + + field_0x12D8[i] = cM::rndF(0.9f) + 0.1f; + + field_0x3A02 += 200; + field_0x3A04 += 50; + field_0x3A06 += 400; + } + field_0x3A02 = 0; + field_0x3A04 = 0; + field_0x3A06 = 0; + field_0x39EC = true; + } + + f32 f0 = 1050.f; + f32 f1 = 13.f; + f32 end = -1e9f; + f32 f3 = 900.f; + f32 f4 = 100.f; + f32 f5 = 3.f; + + for (s32 i = 0; i < 400; ++i) { + mVec3_c playerPos = dAcPy_c::GetLink()->mPosition; + mVec3_c point; + env.sphere_to_cartesian(field_0x2598[i], field_0x2BD8[i], &point); + + switch (field_0x3858[i]) { + case 0: { + field_0x3858[i] = 2; + } break; + case 1: { + if (playerPos.distance(mSporesPos[i]) < 150.f || dTgSiren_c::isOutOfTime()) { + field_0x3858[i]++; + } else { + mSporesPos[i].y += cM::rndF(30.f); + } + } break; + case 2: { + sLib::addCalc(&field_0x1918[i], 1.f, 0.5f, 0.1f, 0.001f); + f32 sin = field_0x3218[i].sin(); + field_0x3218[i] += sin * 90.f + 10.f; + + if (dScGame_c::currentSpawnInfo.getTrial() == SpawnInfo::TRIAL) { + if (dTgSiren_c::isOutOfTime()) { + mSporesPos[i].y += field_0x12D8[i] * 16.f; + field_0x2598[i] += sin * (field_0x12D8[i] - 0.5f) * 48.f; + field_0x2BD8[i] += sin * (field_0x12D8[i] - 0.5f) * 48.f; + mSporesPos[i] += point * ((field_0x12D8[i] * 0.5f) * 32.f + 0.5f); + } else { + mSporesPos[i].y += field_0x12D8[i] * 1.5f; + field_0x2598[i] += sin * (field_0x12D8[i] - 0.5f) * 12.f; + field_0x2BD8[i] += sin * (field_0x12D8[i] - 0.5f) * 12.f; + mSporesPos[i] += point * (field_0x12D8[i] * 4.f); + } + } else { + mSporesPos[i].y += field_0x12D8[i] * -0.5f; + field_0x2598[i] += sin * (field_0x12D8[i] - 0.5f) * 14.f; + field_0x2BD8[i] += sin * (field_0x12D8[i] - 0.5f) * f1; + mSporesPos[i] += point * (field_0x12D8[i] * 5.f); + } + + f32 camY = pCam->getField_0x2A8(); + if (end != camY && mSporesPos[i].y < camY) { + mSporesPos[i].y = camY; + } + } break; + } + + v = mSporesPos[i]; + if (v.distance(pos) > 1050.f) { + mSporesPos[i].x = pos.x + cM::rndFX(1100.f); + mSporesPos[i].y = pos.y + cM::rndFX(1100.f); + mSporesPos[i].z = pos.z + cM::rndFX(1100.f); + } else if (v.distance(pos) > 1000.f) { + mVec3_c out; + env.get_vectle_calc(&v, &pos, &out); + mSporesPos[i].x = pos.x + out.x * 1000.f; + mSporesPos[i].y = pos.y + out.y * 1000.f; + mSporesPos[i].z = pos.z + out.z * 1000.f; + + if (!dTgSiren_c::isOutOfTime()) { + field_0x3858[i] = 0; + } + } + + v = mSporesPos[i]; + f32 minDist = nw4r::ut::Min(v.distance(pos) / 1000.f, 1.f); + + f32 sin = (1.f - minDist) * field_0x3538[i].sin(); + field_0x3538[i] += f4 + f3 * field_0x12D8[i]; + field_0x1F58[i] = sin; + if (sin < 0.f) { + field_0x1F58[i] = 0.f; + } + + field_0x1918[i] = f5 * v.distance(camPos) / 1000.f + 1.f; + } + } +} + +void dSporeProc_c::drawXlu() { + using namespace EGG; + + DrawGX::LoadTexture(mpTexture, GX_TEXMAP0); + mColor color0(0x78, 0xB4, 0xFF, 1); // #78B4FF + mColor color1(0x2D, 0x50, 0x41, 0xFF); // #2D5041FF + + Matrix34f matrix( + EGG::DrawGX::s_cameraMtx._00, EGG::DrawGX::s_cameraMtx._01, EGG::DrawGX::s_cameraMtx._02, + EGG::DrawGX::s_cameraMtx._03, EGG::DrawGX::s_cameraMtx._10, EGG::DrawGX::s_cameraMtx._11, + EGG::DrawGX::s_cameraMtx._12, EGG::DrawGX::s_cameraMtx._13, EGG::DrawGX::s_cameraMtx._20, + EGG::DrawGX::s_cameraMtx._21, EGG::DrawGX::s_cameraMtx._22, EGG::DrawGX::s_cameraMtx._23 + ); + + dCamera_c *pCam = dScGame_c::getCamera(); + mVec3_c pos = pCam->getPositionMaybe(); + + if (dTgSiren_c::isOutOfTime()) { + color0.r = 0xFF; + color0.g = 0xDB; + color0.b = 0xA5; + } + + GXSetCullMode(GX_CULL_NONE); + GXSetClipMode(GX_CLIP_DISABLE); + + f32 scaleMult = 12.f; + + DrawGX::BeginDrawQuad(DrawGX::COLORCHAN_1, DrawGX::ZMODE_2, DrawGX::BLEND_3, true, false); + GXSetTevColor(GX_TEVREG1, color1); + GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR_NULL); + GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_C1, GX_CC_C0, GX_CC_TEXC, GX_CC_ZERO); + GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, 1, GX_TEVPREV); + GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, GX_CA_A0, GX_CA_TEXA, GX_CA_ZERO); + GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, true, GX_TEVPREV); + + GXColor c = EGG::DrawGX::WHITE; + s16 zRot; + s32 i; + mVec3_c *sporePos = mSporesPos; + for (i = 0, zRot = 0; i < 400; i++, zRot += 10) { + mVec3_c b; + mVec3_c a = mSporesPos[i]; + MTXMultVec(*matrix, a, b); + + mMtx_c m; + m.transS(b); + + color0.a = field_0x1F58[i] * 255.f; + if (color0.a != 0) { + m.ZrotM(field_0x3A02 + zRot); + + mMtx_c scale; + f32 scaleX = field_0x1918[i] * scaleMult * field_0x1F58[i]; + scale.scaleS(scaleX, scaleX, 1.f); + + m += scale; + GXSetTevColor(GX_TEVREG0, color0); + DrawGX::DrawDL(EGG::DrawGX::DL_13, m, c); + } + } + + GXSetClipMode(GX_CLIP_ENABLE); +} + void dSporeTag_c::initializeState_Wait() {} -void dSporeTag_c::executeState_Wait() {} +void dSporeTag_c::executeState_Wait() { + mProc.execute(); +} void dSporeTag_c::finalizeState_Wait() {} diff --git a/src/REL/d/t/d_t_stream.cpp b/src/REL/d/t/d_t_stream.cpp index f267bd24..80990f61 100644 --- a/src/REL/d/t/d_t_stream.cpp +++ b/src/REL/d/t/d_t_stream.cpp @@ -1,3 +1,66 @@ #include "d/t/d_t_stream.h" +#include "d/a/d_a_base.h" +#include "f/f_base.h" +#include "f/f_list_mg.h" +#include "toBeSorted/area_math.h" + SPECIAL_ACTOR_PROFILE(TAG_STREAM, dTgStream_c, fProfile::TAG_STREAM, 0x29D, 0, 0); + +void dTgStream_c::addToList(fLiMgBa_c &list) { + // Upcasting for simplicity of the mOrder check. + dAcRef_c *pIt = static_cast *>(list.getFirst()); + if (pIt != nullptr) { + while (pIt != nullptr) { + if (pIt->get()->mOrder <= mOrder) { + pIt = pIt->getNext(); + continue; + } + + list.insertAfter(&mStreamNode, pIt->getPrev()); + return; + } + list.append(&mStreamNode); + } + + else { + list.append(&mStreamNode); + } +} + +int dTgStream_c::create() { + mSceneflag = getFromParams(0, 0xFF); + mAreaIdx = getFromParams(8, 0xFF); + mSpeed = getFromParams(16, 0xFF); + if (mSpeed == 0xFF) { + mSpeed = 0; + } + + mOrder = getFromParams(28, 0xFF); + mIsSand = getFromParams(24, 0xF); + field_0x101 = (mRotation.z & 0x3) == 1; + mRotation.z = 0; + + if (mIsSand == 1) { + addToList(sSandStreamList); + } else { + addToList(sStreamList); + } + + matrixCreateFromPosRotYScale(mArea, mPosition, mRotation.y, mScale, nullptr, 0.f); + + return SUCCEEDED; +} + +int dTgStream_c::doDelete() { + if (mIsSand == 1) { + sSandStreamList.remove(&mStreamNode); + } else { + sStreamList.remove(&mStreamNode); + } + return SUCCEEDED; +} + +int dTgStream_c::actorExecute() { + return SUCCEEDED; +} diff --git a/src/REL/d/t/d_t_sword_battle_game.cpp b/src/REL/d/t/d_t_sword_battle_game.cpp index 07148175..5cb2f84a 100644 --- a/src/REL/d/t/d_t_sword_battle_game.cpp +++ b/src/REL/d/t/d_t_sword_battle_game.cpp @@ -1,3 +1,391 @@ #include "d/t/d_t_sword_battle_game.h" +#include "common.h" +#include "d/a/d_a_player.h" +#include "d/d_sc_game.h" +#include "d/flag/storyflag_manager.h" +#include "d/lyt/d_lyt_mini_game.h" +#include "f/f_base.h" +#include "f/f_profile_name.h" +#include "sized_string.h" +#include "toBeSorted/event.h" +#include "toBeSorted/event_manager.h" +#include "toBeSorted/minigame_mgr.h" + +const char *sGameEvents[] = {"StartSwordBattleGame", "EndSwordBattleGame", "EndSwordBattleGame2"}; +const char *sEndEventNames[] = { + "dAcBvd_c_DeadDEMO", "MG_end", "AsuraDeadB", "BKR_end", "BBossEvac", "BBoss2Evac", "BBoss3Evac", "BLS_end", +}; + +STATE_VIRTUAL_DEFINE(dTgSwordBattleGame_c, Wait); +STATE_VIRTUAL_DEFINE(dTgSwordBattleGame_c, Manage); + SPECIAL_ACTOR_PROFILE(TAG_SWORD_BATTLE_GAME, dTgSwordBattleGame_c, fProfile::TAG_SWORD_BATTLE_GAME, 0x6F, 0, 4); + +int dTgSwordBattleGame_c::create() { + if (!checkInBossRushFlag() && !MinigameManager::GetInstance()->checkInBossRush()) { + return FAILED; + } + + init(); + mStateMgr.changeState(StateID_Wait); + return SUCCEEDED; +} + +int dTgSwordBattleGame_c::doDelete() { + fBase_c::doDelete(); + mTimer.vt_0x10(); + return SUCCEEDED; +} + +int dTgSwordBattleGame_c::actorExecute() { + if (EventManager::isInEvent()) { + static const char *l_currentEvent = EventManager::getCurrentEventName(); + + if (strequals(l_currentEvent, sEndEventNames[0]) || strequals(l_currentEvent, sEndEventNames[1]) || + strequals(l_currentEvent, sEndEventNames[2]) || strequals(l_currentEvent, sEndEventNames[3]) || + strequals(l_currentEvent, sEndEventNames[4]) || strequals(l_currentEvent, sEndEventNames[5]) || + strequals(l_currentEvent, sEndEventNames[6]) || strequals(l_currentEvent, sEndEventNames[7])) { + field_0x1AB = true; + } + } + mStateMgr.executeState(); + return SUCCEEDED; +} + +int dTgSwordBattleGame_c::actorExecuteInEvent() { + bool advance = mEventRelated.isAdvance(); + + int ret = NOT_READY; + switch (mEventRelated.getCurrentEventCommand()) { + case 'none': { + mEventRelated.advanceNext(); + ret = SUCCEEDED; + } break; + case 'gini': { + mEventRelated.advanceNext(); + ret = SUCCEEDED; + } break; + case 'cndn': { + if (advance) { + dLytMiniGame_c::GetInstance()->fn_80295940(); + + } else if (dLytMiniGame_c::GetInstance()->fn_80295AB0()) { + dLytMiniGame_c::GetInstance()->timeRelatedExecute(); + dLytMiniGame_c::GetInstance()->setHighscore(getBossHighscore()); + dLytMiniGame_c::GetInstance()->fn_80295CB0(true); + mTimer.initUpCounter(); + field_0x1A8 = true; + field_0x1AC = true; + mEventRelated.advanceNext(); + } + ret = SUCCEEDED; + } break; + case 'fnsh': { + if (advance) { + dLytMiniGame_c::GetInstance()->fn_80295980(); + } else if (dLytMiniGame_c::GetInstance()->fn_80295AD0()) { + mEventRelated.advanceNext(); + } + ret = SUCCEEDED; + } break; + case 'gend': { + if (advance) { + dScGame_c::GetInstance()->triggerExit(mRoomID, getFromParams(0, 0xFF)); + } + ret = SUCCEEDED; + } break; + default: { + if (dAcPy_c::GetLink()->checkFlags0x340(0x200) && !field_0x1AD && + MinigameManager::endMinigame(MinigameManager::BOSS_RUSH)) { + field_0x1AD = true; + unsetInBossRushFlag(); + unsetEarlyFightFlags(); + unsetImprisonedFightFlags(); + unsetDemiseFightFlag(); + setCurrentBossNumber(0); + } + + if (!field_0x1AE && field_0x1A9 && !field_0x1AA) { + field_0x1AE = true; + saveCurrentTime(getCurrentTime()); + setInBossRushFlag(); + setCurrentBossNumber(mBossNumber + 1); + if (MinigameManager::endMinigame(MinigameManager::BOSS_RUSH)) { + dLytMiniGame_c::GetInstance()->fn_80295980(); + dLytMiniGame_c::GetInstance()->timeRelated(); + } + } + } break; + } + return ret; +} + +int dTgSwordBattleGame_c::draw() { + return SUCCEEDED; +} + +void dTgSwordBattleGame_c::initializeState_Wait() {} +void dTgSwordBattleGame_c::executeState_Wait() { + if (MinigameManager::GetInstance()->checkInBossRush()) { + if (field_0x1A8) { + mStateMgr.changeState(StateID_Manage); + } else { + checkInEvent(sGameEvents[0]); + } + } +} +void dTgSwordBattleGame_c::finalizeState_Wait() {} + +void dTgSwordBattleGame_c::initializeState_Manage() {} +void dTgSwordBattleGame_c::executeState_Manage() { + if (!field_0x1A9) { + mTimer.vt_0x14(); + } + + s32 time = getCurrentTime(); + dLytMiniGame_c::GetInstance()->setDisplayedTime(time); + + if (!field_0x1AE && field_0x1A9 && field_0x1AA) { + saveCurrentTime(time); + setInBossRushFlag(); + setCurrentBossNumber(mBossNumber + 1); + if (MinigameManager::endMinigame(MinigameManager::BOSS_RUSH) && checkInEvent(sGameEvents[1])) { + field_0x1AE = true; + } + } + + if (field_0x1AB && checkInEvent(sGameEvents[2])) { + field_0x1AB = false; + } +} +void dTgSwordBattleGame_c::finalizeState_Manage() {} + +void dTgSwordBattleGame_c::init() { + if (MinigameManager::GetInstance()->checkInBossRush()) { + createBase(fProfile::LYT_MINI_GAME, this, 8, OTHER); + } + mTimer.vt_0x0C(); + + field_0x1A8 = false; + field_0x1A9 = false; + field_0x1AA = false; + field_0x1AB = false; + field_0x1AC = false; + field_0x1AD = false; + field_0x1AE = false; + + mBossNumber = getCurrentBossNumber(); +} + +bool dTgSwordBattleGame_c::checkInEvent(const char *eventName) { + if (EventManager::isInEvent() && strequals(EventManager::getCurrentEventName(), eventName)) { + return true; + } + + if (EventManager::isInEvent0Or7()) { + static volatile u32 FLAGS_1 = 0x00000001; + static u32 FLAGS_2 = 0x00100001; + u32 f1 = FLAGS_1; + u32 f2 = FLAGS_2; + u32 eventFlag = f2 & ~f1; + Event event = Event(eventName, 100, eventFlag, nullptr, nullptr); + EventManager::alsoSetAsCurrentEvent(this, &event, nullptr); + } + return false; +} + +s32 dTgSwordBattleGame_c::getCurrentTime() const { + s32 time = mTimer.getTime(); + if (time > TIME_CONVERT(59, 59, 99)) { + time = TIME_CONVERT(59, 59, 99); + } + return time; +} + +bool dTgSwordBattleGame_c::checkInBossRushFlag() { + return StoryflagManager::sInstance->getCounterOrFlag(STORYFLAG_BOSS_RUSH_ACTIVE); +} + +void dTgSwordBattleGame_c::unsetInBossRushFlag() { + StoryflagManager::sInstance->unsetFlag(STORYFLAG_BOSS_RUSH_ACTIVE); +} + +void dTgSwordBattleGame_c::unsetEarlyFightFlags() const { + StoryflagManager *pMgr = StoryflagManager::sInstance; + + // Not naming these flags due to the weirdness... + pMgr->unsetFlag(STORYFLAG_351); + pMgr->unsetFlag(STORYFLAG_352); + pMgr->unsetFlag(STORYFLAG_353); + pMgr->unsetFlag(STORYFLAG_354); + pMgr->unsetFlag(STORYFLAG_355); + pMgr->unsetFlag(STORYFLAG_356); + pMgr->unsetFlag(STORYFLAG_357); +} + +void dTgSwordBattleGame_c::unsetImprisonedFightFlags() const { + StoryflagManager *pMgr = StoryflagManager::sInstance; + + pMgr->unsetFlag(STORYFLAG_IMPRISONED1_BOSSRUSH); + pMgr->unsetFlag(STORYFLAG_IMPRISONED2_BOSSRUSH); + pMgr->unsetFlag(STORYFLAG_IMPRISONED3_BOSSRUSH); +} + +void dTgSwordBattleGame_c::unsetDemiseFightFlag() const { + StoryflagManager *pMgr = StoryflagManager::sInstance; + + pMgr->unsetFlag(STORYFLAG_DEMISE_BOSSRUSH); +} + +void dTgSwordBattleGame_c::setInBossRushFlag() { + StoryflagManager::sInstance->setFlag(STORYFLAG_BOSSRUSH_ACTIVE); +} + +void dTgSwordBattleGame_c::saveCurrentTime(s32 time) const { + StoryflagManager *pMgr = StoryflagManager::sInstance; + pMgr->setFlagOrCounterToValue(STORYFLAG_BOSSRUSH_CURRENT_MIN, (time / 1000) / 60); + pMgr->setFlagOrCounterToValue(STORYFLAG_BOSSRUSH_CURRENT_SEC, (time / 1000) % 60); + pMgr->setFlagOrCounterToValue(STORYFLAG_BOSSRUSH_CURRENT_MS, (time % 1000) / 10); +} + +s32 dTgSwordBattleGame_c::getBossHighscore() const { + s32 time; + switch (getBossIdx()) { + case 0: time = getGhirahim1Highscore(); break; + case 1: time = getScalderaHighscore(); break; + case 2: time = getMolderachHighscore(); break; + case 4: time = getKoloktosHighscore(); break; + case 5: time = getTentalusHighscore(); break; + case 6: time = getGhirahim2Highscore(); break; + case 3: time = getImprisoned1Highscore(); break; + case 7: time = getImprisoned2Highscore(); break; + case 8: time = getImprisoned3Highscore(); break; + case 9: time = getHordeHighscore(); break; + case 10: time = getGhirahim3Highscore(); break; + case 11: time = getDemiseHighscore(); break; + } + + if (time > TIME_CONVERT(59, 59, 99)) { + time = TIME_CONVERT(59, 59, 99); + } + return time; +} + +s32 dTgSwordBattleGame_c::getGhirahim1Highscore() const { + StoryflagManager *pMgr = StoryflagManager::sInstance; + u16 min = pMgr->getCounterOrFlag(STORYFLAG_GHIRAHIM1_TIME_MIN); + u16 sec = pMgr->getCounterOrFlag(STORYFLAG_GHIRAHIM1_TIME_SEC); + u16 msec = pMgr->getCounterOrFlag(STORYFLAG_GHIRAHIM1_TIME_MS); + return TIME_CONVERT(min, sec, msec); +} + +s32 dTgSwordBattleGame_c::getScalderaHighscore() const { + StoryflagManager *pMgr = StoryflagManager::sInstance; + u16 min = pMgr->getCounterOrFlag(STORYFLAG_SCALDERA_TIME_MIN); + u16 sec = pMgr->getCounterOrFlag(STORYFLAG_SCALDERA_TIME_SEC); + u16 msec = pMgr->getCounterOrFlag(STORYFLAG_SCALDERA_TIME_MS); + return TIME_CONVERT(min, sec, msec); +} + +s32 dTgSwordBattleGame_c::getMolderachHighscore() const { + StoryflagManager *pMgr = StoryflagManager::sInstance; + u16 min = pMgr->getCounterOrFlag(STORYFLAG_MOLDERACH_TIME_MIN); + u16 sec = pMgr->getCounterOrFlag(STORYFLAG_MOLDERACH_TIME_SEC); + u16 msec = pMgr->getCounterOrFlag(STORYFLAG_MOLDERACH_TIME_MS); + return TIME_CONVERT(min, sec, msec); +} + +s32 dTgSwordBattleGame_c::getKoloktosHighscore() const { + StoryflagManager *pMgr = StoryflagManager::sInstance; + u16 min = pMgr->getCounterOrFlag(STORYFLAG_KOLOKTOS_TIME_MIN); + u16 sec = pMgr->getCounterOrFlag(STORYFLAG_KOLOKTOS_TIME_SEC); + u16 msec = pMgr->getCounterOrFlag(STORYFLAG_KOLOKTOS_TIME_MS); + return TIME_CONVERT(min, sec, msec); +} + +s32 dTgSwordBattleGame_c::getTentalusHighscore() const { + StoryflagManager *pMgr = StoryflagManager::sInstance; + u16 min = pMgr->getCounterOrFlag(STORYFLAG_TENTALUS_TIME_MIN); + u16 sec = pMgr->getCounterOrFlag(STORYFLAG_TENTALUS_TIME_SEC); + u16 msec = pMgr->getCounterOrFlag(STORYFLAG_TENTALUS_TIME_MS); + return TIME_CONVERT(min, sec, msec); +} + +s32 dTgSwordBattleGame_c::getGhirahim2Highscore() const { + StoryflagManager *pMgr = StoryflagManager::sInstance; + u16 min = pMgr->getCounterOrFlag(STORYFLAG_GHIRAHIM2_TIME_MIN); + u16 sec = pMgr->getCounterOrFlag(STORYFLAG_GHIRAHIM2_TIME_SEC); + u16 msec = pMgr->getCounterOrFlag(STORYFLAG_GHIRAHIM2_TIME_MS); + return TIME_CONVERT(min, sec, msec); +} + +s32 dTgSwordBattleGame_c::getImprisoned1Highscore() const { + StoryflagManager *pMgr = StoryflagManager::sInstance; + u16 min = pMgr->getCounterOrFlag(STORYFLAG_IMP1_TIME_MIN); + u16 sec = pMgr->getCounterOrFlag(STORYFLAG_IMP1_TIME_SEC); + u16 msec = pMgr->getCounterOrFlag(STORYFLAG_IMP1_TIME_MS); + return TIME_CONVERT(min, sec, msec); +} + +s32 dTgSwordBattleGame_c::getImprisoned2Highscore() const { + StoryflagManager *pMgr = StoryflagManager::sInstance; + u16 min = pMgr->getCounterOrFlag(STORYFLAG_IMP2_TIME_MIN); + u16 sec = pMgr->getCounterOrFlag(STORYFLAG_IMP2_TIME_SEC); + u16 msec = pMgr->getCounterOrFlag(STORYFLAG_IMP2_TIME_MS); + return TIME_CONVERT(min, sec, msec); +} + +s32 dTgSwordBattleGame_c::getImprisoned3Highscore() const { + StoryflagManager *pMgr = StoryflagManager::sInstance; + u16 min = pMgr->getCounterOrFlag(STORYFLAG_IMP3_TIME_MIN); + u16 sec = pMgr->getCounterOrFlag(STORYFLAG_IMP3_TIME_SEC); + u16 msec = pMgr->getCounterOrFlag(STORYFLAG_IMP3_TIME_MS); + return TIME_CONVERT(min, sec, msec); +} + +s32 dTgSwordBattleGame_c::getHordeHighscore() const { + StoryflagManager *pMgr = StoryflagManager::sInstance; + u16 min = pMgr->getCounterOrFlag(STORYFLAG_HORDE_TIME_MIN); + u16 sec = pMgr->getCounterOrFlag(STORYFLAG_HORDE_TIME_SEC); + u16 msec = pMgr->getCounterOrFlag(STORYFLAG_HORDE_TIME_MS); + return TIME_CONVERT(min, sec, msec); +} + +s32 dTgSwordBattleGame_c::getGhirahim3Highscore() const { + StoryflagManager *pMgr = StoryflagManager::sInstance; + u16 min = pMgr->getCounterOrFlag(STORYFLAG_GHIRAHIM3_TIME_MIN); + u16 sec = pMgr->getCounterOrFlag(STORYFLAG_GHIRAHIM3_TIME_SEC); + u16 msec = pMgr->getCounterOrFlag(STORYFLAG_GHIRAHIM3_TIME_MS); + return TIME_CONVERT(min, sec, msec); +} + +s32 dTgSwordBattleGame_c::getDemiseHighscore() const { + StoryflagManager *pMgr = StoryflagManager::sInstance; + u16 min = pMgr->getCounterOrFlag(STORYFLAG_DEMISE_TIME_MIN); + u16 sec = pMgr->getCounterOrFlag(STORYFLAG_DEMISE_TIME_SEC); + u16 msec = pMgr->getCounterOrFlag(STORYFLAG_DEMISE_TIME_MS); + return TIME_CONVERT(min, sec, msec); +} + +s32 dTgSwordBattleGame_c::getBossIdx() const { + return StoryflagManager::sInstance->getCounterOrFlag(STORYFLAG_563); +} + +s32 dTgSwordBattleGame_c::getCurrentBossNumber() const { + return StoryflagManager::sInstance->getCounterOrFlag(STORYFLAG_654); +} + +void dTgSwordBattleGame_c::setCurrentBossNumber(s32 num) { + StoryflagManager::sInstance->setFlagOrCounterToValue(STORYFLAG_654, num); +} + +void dTgSwordBattleGame_c::notifyBossDeath(bool ghirahim_related) { + field_0x1A9 = true; + field_0x1AA = ghirahim_related; + dLytMiniGame_c::GetInstance()->setComplete(); +} + +bool dTgSwordBattleGame_c::checkFightStarted() const { + return field_0x1AC; +} diff --git a/src/REL/d/t/d_t_tumble_weed.cpp b/src/REL/d/t/d_t_tumble_weed.cpp index f11c2e1c..48525354 100644 --- a/src/REL/d/t/d_t_tumble_weed.cpp +++ b/src/REL/d/t/d_t_tumble_weed.cpp @@ -1,7 +1,14 @@ #include "d/t/d_t_tumble_weed.h" +#include "c/c_math.h" +#include "common.h" +#include "d/a/obj/d_a_obj_tumble_weed.h" +#include "d/col/bg/d_bg_s_gnd_chk.h" +#include "d/d_sc_game.h" +#include "f/f_profile_name.h" #include "m/m_vec.h" #include "s/s_Math.h" +#include "toBeSorted/event_manager.h" SPECIAL_ACTOR_PROFILE(TUMBLE_WEED_TAG, dTgTumbleWeed_c, fProfile::TUMBLE_WEED_TAG, 0x0244, 0, 0); @@ -9,9 +16,13 @@ STATE_DEFINE(dTgTumbleWeed_c, AreaOut); STATE_DEFINE(dTgTumbleWeed_c, AreaIn); STATE_DEFINE(dTgTumbleWeed_c, Wind); +void rodata_floats() { + const f32 arr[] = {0.f, 0.8f, 20.f, 20.f, 5.f, 0.5f, 7.f}; +} + int dTgTumbleWeed_c::create() { - tumbleweedTimer = 0; - windTimer = 0x96; + mSpawnTimer = 0; + mWindTimer = 150; mStateMgr.changeState(StateID_AreaOut); return SUCCEEDED; } @@ -22,7 +33,7 @@ int dTgTumbleWeed_c::doDelete() { int dTgTumbleWeed_c::actorExecute() { mStateMgr.executeState(); - sLib::calcTimer(&tumbleweedTimer); + sLib::calcTimer(&mSpawnTimer); return SUCCEEDED; } @@ -32,8 +43,8 @@ int dTgTumbleWeed_c::draw() { void dTgTumbleWeed_c::initializeState_AreaOut() {} void dTgTumbleWeed_c::executeState_AreaOut() { - if (sLib::calcTimer(&windTimer) == 0) { - windTimer = 0x96; + if (sLib::calcTimer(&mWindTimer) == 0) { + mWindTimer = 150; if (shouldDoWind()) { mStateMgr.changeState(StateID_Wind); return; @@ -47,14 +58,14 @@ void dTgTumbleWeed_c::finalizeState_AreaOut() {} void dTgTumbleWeed_c::initializeState_AreaIn() {} void dTgTumbleWeed_c::executeState_AreaIn() { - if (tumbleweedTimer == 0) { + if (mSpawnTimer == 0) { if (shouldSpawnTumbleweed()) { doSpawnTumbleweed(); } - tumbleweedTimer = 600; + mSpawnTimer = 600; } - if (sLib::calcTimer(&windTimer) == 0) { - windTimer = 0x96; + if (sLib::calcTimer(&mWindTimer) == 0) { + mWindTimer = 150; if (shouldDoWind()) { mStateMgr.changeState(StateID_Wind); return; @@ -68,9 +79,9 @@ void dTgTumbleWeed_c::finalizeState_AreaIn() {} void dTgTumbleWeed_c::initializeState_Wind() { mVec3_c vec; - getWind(&vec); - if (childTumbleweed.get() != nullptr) { - childTumbleweed.get()->setWind(vec); + getWind(vec); + if (mSpawnedTumbleWeed.isLinked()) { + mSpawnedTumbleWeed.get()->setWind(vec); } } @@ -84,20 +95,82 @@ void dTgTumbleWeed_c::executeState_Wind() { void dTgTumbleWeed_c::finalizeState_Wind() {} bool dTgTumbleWeed_c::shouldSpawnTumbleweed() { - bool spawnAllowed = false; - if (childTumbleweed.get() == nullptr && cM::rnd() <= 0.8f) { - spawnAllowed = true; - } - - if (spawnAllowed) { - return true; - } - - return false; + return !mSpawnedTumbleWeed.isLinked() && cM::rnd() <= 0.8f && !EventManager::isInEvent(); } bool dTgTumbleWeed_c::shouldDoWind() { - return childTumbleweed.get() != nullptr && cM::rnd() <= 0.5f; + return mSpawnedTumbleWeed.isLinked() && cM::rnd() <= 0.5f; +} + +void dTgTumbleWeed_c::doSpawnTumbleweed() { + mVec3_c pos = mVec3_c::Ez; + + dCamera_c *pCam = dScGame_c::getCamera(0); + if (pCam != nullptr) { + mAng angle = pCam->getYRot(); + + f32 change; + if (cM::rnd() < 0.5f) { + change = cM::rndFX(5.f) * 182.f + 10923.f; + } else { + change = cM::rndFX(5.f) * 182.f + -10923.f; + } + angle += change; + pos.rotY(angle); + + pos *= 600.f; + pos += pCam->getPositionMaybe(); + + if (dBgS_ObjGndChk::CheckPos(pos + mVec3_c::Ey * 100.f)) { + pos.y = dBgS_ObjGndChk::GetGroundHeight() + 10.f; + } + } + + dAcOTumbleWeed_c *pTumble = static_cast( + dAcObjBase_c::create(fProfile::OBJ_TUMBLE_WEED, mRoomID, 0, &pos, nullptr, nullptr, 0xFFFFFFFF) + ); + if (pTumble == nullptr) { + return; + } + + mSpawnedTumbleWeed.link(pTumble); + if (pCam != nullptr) { + mAng rot = mAng::fromVec(mPosition - pos); + + f32 change; + if (cM::rnd() < 0.5f) { + change = cM::rndFX(5.f) * 182.f; + } else { + change = cM::rndFX(5.f) * -182.f; + } + rot += change; + + pTumble->mAngle.y = rot; + pTumble->mSpeed = cM::rndFX(1.f) + 20.f; + pTumble->mVelocity.y = 0.f; + } +} + +void dTgTumbleWeed_c::getWind(mVec3_c &pWind) { + mVec3_c wind = mVec3_c::Ez; + + // @bug dir may not be initialized + mAng dir; + + if (mSpawnedTumbleWeed.isLinked()) { + dir = mSpawnedTumbleWeed.get()->getAngle().y; + } + + f32 change; + if (cM::rnd() < 0.5f) { + change = cM::rndFX(15.f) * 182.f + 8192.f; + } else { + change = cM::rndFX(15.f) * 182.f + -8192.f; + } + + dir += change; + wind.rotY(dir); + wind *= cM::rndFX(3.f) + 7.f; + + pWind = wind; } -void dTgTumbleWeed_c::doSpawnTumbleweed() {} -void dTgTumbleWeed_c::getWind(mVec3_c *) {}