From 03c08002ee6a6a2a134d5ec3a0e2ec1eb414a3d7 Mon Sep 17 00:00:00 2001 From: 2gifts Date: Mon, 28 Sep 2026 12:18:01 -0400 Subject: [PATCH] Match st_gw scene ground objects and grGWFireEtc --- config/RSBE01_02/rels/st_gw/splits.txt | 22 ++ config/RSBE01_02/rels/st_gw/symbols.txt | 279 +++++++++------ config/RSBE01_02/symbols.txt | 4 +- configure.py | 8 +- include/st_gw/gr_gw.h | 26 ++ include/st_gw/gr_gw_fire_etc.h | 70 ++++ include/st_gw/gr_gw_scene.h | 36 ++ include/st_gw/gr_gw_scene_chef.h | 12 + include/st_gw/gr_gw_scene_lion.h | 20 ++ include/st_gw/gr_gw_scene_oil.h | 27 ++ src/mo_stage/st_gw/gr_gw_fire_etc.cpp | 454 ++++++++++++++++++++++++ src/mo_stage/st_gw/gr_gw_scene.cpp | 136 +++++++ src/mo_stage/st_gw/gr_gw_scene_chef.cpp | 18 + src/mo_stage/st_gw/gr_gw_scene_lion.cpp | 32 ++ src/mo_stage/st_gw/gr_gw_scene_oil.cpp | 43 +++ 15 files changed, 1070 insertions(+), 117 deletions(-) create mode 100644 include/st_gw/gr_gw.h create mode 100644 include/st_gw/gr_gw_fire_etc.h create mode 100644 include/st_gw/gr_gw_scene.h create mode 100644 include/st_gw/gr_gw_scene_chef.h create mode 100644 include/st_gw/gr_gw_scene_lion.h create mode 100644 include/st_gw/gr_gw_scene_oil.h create mode 100644 src/mo_stage/st_gw/gr_gw_fire_etc.cpp create mode 100644 src/mo_stage/st_gw/gr_gw_scene.cpp create mode 100644 src/mo_stage/st_gw/gr_gw_scene_chef.cpp create mode 100644 src/mo_stage/st_gw/gr_gw_scene_lion.cpp create mode 100644 src/mo_stage/st_gw/gr_gw_scene_oil.cpp diff --git a/config/RSBE01_02/rels/st_gw/splits.txt b/config/RSBE01_02/rels/st_gw/splits.txt index dd488bfdb..937a120dd 100644 --- a/config/RSBE01_02/rels/st_gw/splits.txt +++ b/config/RSBE01_02/rels/st_gw/splits.txt @@ -11,6 +11,28 @@ global_destructor_chain.c: .dtors start:0x00000000 end:0x00000008 .bss start:0x00000000 end:0x00000004 +mo_stage/st_gw/gr_gw_scene.cpp: + .text start:0x000033A4 end:0x0000398C + .data start:0x00000BA8 end:0x00000DF0 + .rodata start:0x00000048 end:0x00000050 + +mo_stage/st_gw/gr_gw_scene_chef.cpp: + .text start:0x0000398C end:0x00003A98 + .data start:0x00000DF0 end:0x00001048 + +mo_stage/st_gw/gr_gw_scene_lion.cpp: + .text start:0x00004F5C end:0x00005190 + .data start:0x00001418 end:0x00001808 + +mo_stage/st_gw/gr_gw_scene_oil.cpp: + .text start:0x00005190 end:0x0000552C + .data start:0x00001808 end:0x00001C78 + +mo_stage/st_gw/gr_gw_fire_etc.cpp: + .text start:0x00014728 end:0x00015C80 + .data start:0x00005970 end:0x00006048 + .rodata start:0x000001E0 end:0x00000208 + mo_stage/mo_stage.cpp: .text start:0x000172EC end:0x00017388 .data start:0x00006878 end:0x00006885 diff --git a/config/RSBE01_02/rels/st_gw/symbols.txt b/config/RSBE01_02/rels/st_gw/symbols.txt index aecabea1d..912990eca 100644 --- a/config/RSBE01_02/rels/st_gw/symbols.txt +++ b/config/RSBE01_02/rels/st_gw/symbols.txt @@ -6,24 +6,24 @@ fn_63_244 = .text:0x00000244; // type:function size:0xD8 fn_63_31C = .text:0x0000031C; // type:function size:0x8 fn_63_324 = .text:0x00000324; // type:function size:0x1CC fn_63_4F0 = .text:0x000004F0; // type:function size:0xAC -fn_63_59C = .text:0x0000059C; // type:function size:0x8 +setStageData__6GroundFPv = .text:0x0000059C; // type:function size:0x8 scope:weak fn_63_5A4 = .text:0x000005A4; // type:function size:0x358 -fn_63_8FC = .text:0x000008FC; // type:function size:0x8 -fn_63_904 = .text:0x00000904; // type:function size:0x8 -fn_63_90C = .text:0x0000090C; // type:function size:0x8 -fn_63_914 = .text:0x00000914; // type:function size:0x8 -fn_63_91C = .text:0x0000091C; // type:function size:0x8 -fn_63_924 = .text:0x00000924; // type:function size:0x8 -fn_63_92C = .text:0x0000092C; // type:function size:0x8 +setSceneIDWork__4grGWFPUc = .text:0x000008FC; // type:function size:0x8 +setSceneID__4grGWFUc = .text:0x00000904; // type:function size:0x8 +setFrameWork__9grGWSceneFPf = .text:0x0000090C; // type:function size:0x8 +setEventWork__9grGWSceneFPUc = .text:0x00000914; // type:function size:0x8 +setPosGimmickWork__9grGWSceneFP5Vec3f = .text:0x0000091C; // type:function size:0x8 +setCtrlStepWork__9grGWSceneFPUc = .text:0x00000924; // type:function size:0x8 +setTblStepAcc__9grGWSceneFP20stDataMultiContainer = .text:0x0000092C; // type:function size:0x8 fn_63_934 = .text:0x00000934; // type:function size:0x8 fn_63_93C = .text:0x0000093C; // type:function size:0x8 fn_63_944 = .text:0x00000944; // type:function size:0x8 fn_63_94C = .text:0x0000094C; // type:function size:0x8 fn_63_954 = .text:0x00000954; // type:function size:0x8 -fn_63_95C = .text:0x0000095C; // type:function size:0x8 -fn_63_964 = .text:0x00000964; // type:function size:0x8 -fn_63_96C = .text:0x0000096C; // type:function size:0x8 -fn_63_974 = .text:0x00000974; // type:function size:0x8 +setPosKeeperLWork__13grGWSceneLionFP5Vec3f = .text:0x0000095C; // type:function size:0x8 scope:weak +setPosKeeperRWork__13grGWSceneLionFP5Vec3f = .text:0x00000964; // type:function size:0x8 scope:weak +setDataGuestManWork__12grGWSceneOilFP13grGWGuestData = .text:0x0000096C; // type:function size:0x8 scope:weak +setDataGuestWomanWork__12grGWSceneOilFP13grGWGuestData = .text:0x00000974; // type:function size:0x8 scope:weak fn_63_97C = .text:0x0000097C; // type:function size:0x16C fn_63_AE8 = .text:0x00000AE8; // type:function size:0x8 fn_63_AF0 = .text:0x00000AF0; // type:function size:0x6C @@ -48,20 +48,20 @@ fn_63_11E8 = .text:0x000011E8; // type:function size:0x8 fn_63_11F0 = .text:0x000011F0; // type:function size:0x8 fn_63_11F8 = .text:0x000011F8; // type:function size:0xDC fn_63_12D4 = .text:0x000012D4; // type:function size:0x13C -fn_63_1410 = .text:0x00001410; // type:function size:0x8 -fn_63_1418 = .text:0x00001418; // type:function size:0x8 -fn_63_1420 = .text:0x00001420; // type:function size:0x8 -fn_63_1428 = .text:0x00001428; // type:function size:0x8 +setStateMistakeWork__11grGWFireEtcFPUc = .text:0x00001410; // type:function size:0x8 scope:weak +setEventWork__11grGWFireEtcFPUc = .text:0x00001418; // type:function size:0x8 scope:weak +setIndexWork__11grGWFireEtcFPUc = .text:0x00001420; // type:function size:0x8 scope:weak +setIndexFighterWork__11grGWFireEtcFPUc = .text:0x00001428; // type:function size:0x8 scope:weak fn_63_1430 = .text:0x00001430; // type:function size:0x13C -fn_63_156C = .text:0x0000156C; // type:function size:0x8 -fn_63_1574 = .text:0x00001574; // type:function size:0x8 -fn_63_157C = .text:0x0000157C; // type:function size:0x8 -fn_63_1584 = .text:0x00001584; // type:function size:0x8 +setEventWork__15grGWFireFighterFPUc = .text:0x0000156C; // type:function size:0x8 scope:weak +setPosWork__15grGWFireFighterFP5Vec3f = .text:0x00001574; // type:function size:0x8 scope:weak +setIndexWork__15grGWFireFighterFPUc = .text:0x0000157C; // type:function size:0x8 scope:weak +setIndexVictimWork__15grGWFireFighterFPUc = .text:0x00001584; // type:function size:0x8 scope:weak fn_63_158C = .text:0x0000158C; // type:function size:0x168 fn_63_16F4 = .text:0x000016F4; // type:function size:0x8 fn_63_16FC = .text:0x000016FC; // type:function size:0x8 fn_63_1704 = .text:0x00001704; // type:function size:0x180 -fn_63_1884 = .text:0x00001884; // type:function size:0x8 +setGimmickData__9grGimmickFPv = .text:0x00001884; // type:function size:0x8 scope:weak fn_63_188C = .text:0x0000188C; // type:function size:0x8 fn_63_1894 = .text:0x00001894; // type:function size:0x8 fn_63_189C = .text:0x0000189C; // type:function size:0x8 @@ -126,39 +126,39 @@ fn_63_2A10 = .text:0x00002A10; // type:function size:0x74 fn_63_2A84 = .text:0x00002A84; // type:function size:0x34 fn_63_2AB8 = .text:0x00002AB8; // type:function size:0x4 fn_63_2ABC = .text:0x00002ABC; // type:function size:0xA8 -fn_63_2B64 = .text:0x00002B64; // type:function size:0x8 -fn_63_2B6C = .text:0x00002B6C; // type:function size:0xD4 -fn_63_2C40 = .text:0x00002C40; // type:function size:0x58 -fn_63_2C98 = .text:0x00002C98; // type:function size:0x68 -fn_63_2D00 = .text:0x00002D00; // type:function size:0x110 -fn_63_2E10 = .text:0x00002E10; // type:function size:0xC8 -fn_63_2ED8 = .text:0x00002ED8; // type:function size:0x448 -fn_63_3320 = .text:0x00003320; // type:function size:0x8 -fn_63_3328 = .text:0x00003328; // type:function size:0x8 -fn_63_3330 = .text:0x00003330; // type:function size:0x4 -fn_63_3334 = .text:0x00003334; // type:function size:0x4 -fn_63_3338 = .text:0x00003338; // type:function size:0x10 -fn_63_3348 = .text:0x00003348; // type:function size:0x10 -fn_63_3358 = .text:0x00003358; // type:function size:0xC -fn_63_3364 = .text:0x00003364; // type:function size:0x8 -fn_63_336C = .text:0x0000336C; // type:function size:0x4 -fn_63_3370 = .text:0x00003370; // type:function size:0x8 -fn_63_3378 = .text:0x00003378; // type:function size:0x1C -fn_63_3394 = .text:0x00003394; // type:function size:0x8 -fn_63_339C = .text:0x0000339C; // type:function size:0x8 -fn_63_33A4 = .text:0x000033A4; // type:function size:0xE4 -fn_63_3488 = .text:0x00003488; // type:function size:0x70 -fn_63_34F8 = .text:0x000034F8; // type:function size:0x58 -fn_63_3550 = .text:0x00003550; // type:function size:0x3CC -fn_63_391C = .text:0x0000391C; // type:function size:0x4 -fn_63_3920 = .text:0x00003920; // type:function size:0x4 -fn_63_3924 = .text:0x00003924; // type:function size:0x5C -fn_63_3980 = .text:0x00003980; // type:function size:0x4 -fn_63_3984 = .text:0x00003984; // type:function size:0x4 -fn_63_3988 = .text:0x00003988; // type:function size:0x4 -fn_63_398C = .text:0x0000398C; // type:function size:0xB0 -fn_63_3A3C = .text:0x00003A3C; // type:function size:0x58 -fn_63_3A94 = .text:0x00003A94; // type:function size:0x4 +setMdlIndex__6GroundFi = .text:0x00002B64; // type:function size:0x8 scope:weak +__ct__4grGWFPCc = .text:0x00002B6C; // type:function size:0xD4 +__dt__4grGWFv = .text:0x00002C40; // type:function size:0x58 +update__4grGWFf = .text:0x00002C98; // type:function size:0x68 +updateScaleBase__4grGWFf = .text:0x00002D00; // type:function size:0x110 +updateCallBack__4grGWFf = .text:0x00002E10; // type:function size:0xC8 +setMotion__4grGWFUlbbPf = .text:0x00002ED8; // type:function size:0x448 +adventureEventGetItem__6GroundFiP13stTriggerData = .text:0x00003320; // type:function size:0x8 scope:weak +getInitializeInfo__6GroundFi = .text:0x00003328; // type:function size:0x8 scope:weak +setInitializeInfo__6GroundFi = .text:0x00003330; // type:function size:0x4 scope:weak +setInitializeFlag__6GroundFv = .text:0x00003334; // type:function size:0x4 scope:weak +disableCalcCollision__6GroundFv = .text:0x00003338; // type:function size:0x10 scope:weak +enableCalcCollision__6GroundFv = .text:0x00003348; // type:function size:0x10 scope:weak +isEnableCalcCollision__6GroundFv = .text:0x00003358; // type:function size:0xC scope:weak +getMdlIndex__6GroundFv = .text:0x00003364; // type:function size:0x8 scope:weak +initStageData__6GroundFv = .text:0x0000336C; // type:function size:0x4 scope:weak +getStageData__6GroundFv = .text:0x00003370; // type:function size:0x8 scope:weak +getModelCount__6GroundFv = .text:0x00003378; // type:function size:0x1C scope:weak +getTransparencyFlag__9grGimmickFv = .text:0x00003394; // type:function size:0x8 scope:weak +getGimmickData__9grGimmickFv = .text:0x0000339C; // type:function size:0x8 scope:weak +create__9grGWSceneFiPCcPCc = .text:0x000033A4; // type:function size:0xE4 scope:global +__ct__9grGWSceneFPCc = .text:0x00003488; // type:function size:0x70 +__dt__9grGWSceneFv = .text:0x000034F8; // type:function size:0x58 +update__9grGWSceneFf = .text:0x00003550; // type:function size:0x3CC +clearStep__9grGWSceneFv = .text:0x0000391C; // type:function size:0x4 +selectStep__9grGWSceneFv = .text:0x00003920; // type:function size:0x4 +updateSub__9grGWSceneFf = .text:0x00003924; // type:function size:0x5C +updateSubEnd__9grGWSceneFf = .text:0x00003980; // type:function size:0x4 +updateStep__9grGWSceneFf = .text:0x00003984; // type:function size:0x4 +updateEvent__9grGWSceneFf = .text:0x00003988; // type:function size:0x4 +create__13grGWSceneChefFiPCcPCc = .text:0x0000398C; // type:function size:0xB0 scope:global +__dt__13grGWSceneChefFv = .text:0x00003A3C; // type:function size:0x58 scope:global +update__13grGWSceneChefFf = .text:0x00003A94; // type:function size:0x4 scope:global fn_63_3A98 = .text:0x00003A98; // type:function size:0xA8 fn_63_3B40 = .text:0x00003B40; // type:function size:0xA4 fn_63_3BE4 = .text:0x00003BE4; // type:function size:0xA0 @@ -177,14 +177,14 @@ fn_63_4D18 = .text:0x00004D18; // type:function size:0xC0 fn_63_4DD8 = .text:0x00004DD8; // type:function size:0x4C fn_63_4E24 = .text:0x00004E24; // type:function size:0x108 fn_63_4F2C = .text:0x00004F2C; // type:function size:0x30 -fn_63_4F5C = .text:0x00004F5C; // type:function size:0xBC -fn_63_5018 = .text:0x00005018; // type:function size:0x58 -fn_63_5070 = .text:0x00005070; // type:function size:0x11C -fn_63_518C = .text:0x0000518C; // type:function size:0x4 -fn_63_5190 = .text:0x00005190; // type:function size:0xBC -fn_63_524C = .text:0x0000524C; // type:function size:0x58 -fn_63_52A4 = .text:0x000052A4; // type:function size:0x284 -fn_63_5528 = .text:0x00005528; // type:function size:0x4 +create__13grGWSceneLionFiPCcPCc = .text:0x00004F5C; // type:function size:0xBC scope:global +__dt__13grGWSceneLionFv = .text:0x00005018; // type:function size:0x58 scope:global +processAnim__13grGWSceneLionFv = .text:0x00005070; // type:function size:0x11C scope:global +update__13grGWSceneLionFf = .text:0x0000518C; // type:function size:0x4 scope:global +create__12grGWSceneOilFiPCcPCc = .text:0x00005190; // type:function size:0xBC scope:global +__dt__12grGWSceneOilFv = .text:0x0000524C; // type:function size:0x58 scope:global +processAnim__12grGWSceneOilFv = .text:0x000052A4; // type:function size:0x284 scope:global +update__12grGWSceneOilFf = .text:0x00005528; // type:function size:0x4 scope:global fn_63_552C = .text:0x0000552C; // type:function size:0x128 fn_63_5654 = .text:0x00005654; // type:function size:0x58 fn_63_56AC = .text:0x000056AC; // type:function size:0x6C @@ -636,20 +636,20 @@ fn_63_140A4 = .text:0x000140A4; // type:function size:0xB0 fn_63_14154 = .text:0x00014154; // type:function size:0x58 fn_63_141AC = .text:0x000141AC; // type:function size:0x300 fn_63_144AC = .text:0x000144AC; // type:function size:0x27C -fn_63_14728 = .text:0x00014728; // type:function size:0x110 -fn_63_14838 = .text:0x00014838; // type:function size:0x84 -fn_63_148BC = .text:0x000148BC; // type:function size:0x2E8 -fn_63_14BA4 = .text:0x00014BA4; // type:function size:0x39C -fn_63_14F40 = .text:0x00014F40; // type:function size:0x34C -fn_63_1528C = .text:0x0001528C; // type:function size:0x9C -fn_63_15328 = .text:0x00015328; // type:function size:0x6C -fn_63_15394 = .text:0x00015394; // type:function size:0x7C -fn_63_15410 = .text:0x00015410; // type:function size:0x38 -fn_63_15448 = .text:0x00015448; // type:function size:0xEC -fn_63_15534 = .text:0x00015534; // type:function size:0x58 -fn_63_1558C = .text:0x0001558C; // type:function size:0x2BC -fn_63_15848 = .text:0x00015848; // type:function size:0x36C -fn_63_15BB4 = .text:0x00015BB4; // type:function size:0xCC +create__11grGWFireEtcFiPCcPCc = .text:0x00014728; // type:function size:0x110 scope:global +__dt__11grGWFireEtcFv = .text:0x00014838; // type:function size:0x84 scope:global +update__11grGWFireEtcFf = .text:0x000148BC; // type:function size:0x2E8 scope:global +updateVictim__11grGWFireEtcFf = .text:0x00014BA4; // type:function size:0x39C scope:global +setNode__11grGWFireEtcFv = .text:0x00014F40; // type:function size:0x34C scope:global +addVictim__11grGWFireEtcFv = .text:0x0001528C; // type:function size:0x9C scope:global +clearVictim__11grGWFireEtcFv = .text:0x00015328; // type:function size:0x6C scope:global +clearVictimAll__11grGWFireEtcFv = .text:0x00015394; // type:function size:0x7C scope:global +getVictim__11grGWFireEtcFUl = .text:0x00015410; // type:function size:0x38 scope:global +create__15grGWFireFighterFiPCcPCc = .text:0x00015448; // type:function size:0xEC scope:global +__dt__15grGWFireFighterFv = .text:0x00015534; // type:function size:0x58 scope:global +update__15grGWFireFighterFf = .text:0x0001558C; // type:function size:0x2BC scope:global +updateFighter__15grGWFireFighterFf = .text:0x00015848; // type:function size:0x36C scope:global +setNode__15grGWFireFighterFv = .text:0x00015BB4; // type:function size:0xCC scope:global fn_63_15C80 = .text:0x00015C80; // type:function size:0xCC fn_63_15D4C = .text:0x00015D4C; // type:function size:0x58 fn_63_15DA4 = .text:0x00015DA4; // type:function size:0x2A0 @@ -686,8 +686,8 @@ lbl_63_rodata_34 = .rodata:0x00000034; // type:object size:0x4 align:4 data:floa lbl_63_rodata_38 = .rodata:0x00000038; // type:object size:0x4 align:4 data:float lbl_63_rodata_3C = .rodata:0x0000003C; // type:object size:0x4 align:4 data:float lbl_63_rodata_40 = .rodata:0x00000040; // type:object size:0x8 align:8 data:double -lbl_63_rodata_48 = .rodata:0x00000048; // type:object size:0x4 align:4 data:float -lbl_63_rodata_4C = .rodata:0x0000004C; // type:object size:0x4 align:4 data:float +@10573 = .rodata:0x00000048; // type:object size:0x4 align:4 data:float scope:local +@10603 = .rodata:0x0000004C; // type:object size:0x4 align:4 data:float scope:local lbl_63_rodata_50 = .rodata:0x00000050; // type:object size:0x4 align:4 data:float lbl_63_rodata_54 = .rodata:0x00000054; // type:object size:0x24 align:4 data:float lbl_63_rodata_78 = .rodata:0x00000078; // type:object size:0x8 align:4 data:float @@ -719,9 +719,9 @@ lbl_63_rodata_1C8 = .rodata:0x000001C8; // type:object size:0x4 align:4 data:flo lbl_63_rodata_1CC = .rodata:0x000001CC; // type:object size:0x4 align:4 data:float lbl_63_rodata_1D0 = .rodata:0x000001D0; // type:object size:0x4 align:4 data:float lbl_63_rodata_1D8 = .rodata:0x000001D8; // type:object size:0x8 align:8 data:double -lbl_63_rodata_1E0 = .rodata:0x000001E0; // type:object size:0x4 align:4 data:float -lbl_63_rodata_1E4 = .rodata:0x000001E4; // type:object size:0x4 align:4 data:float -lbl_63_rodata_1E8 = .rodata:0x000001E8; // type:object size:0x20 align:8 data:double +@11384 = .rodata:0x000001E0; // type:object size:0x4 align:4 data:float scope:local +@11420 = .rodata:0x000001E4; // type:object size:0x4 align:4 data:float scope:local +@11575 = .rodata:0x000001E8; // type:object size:0x8 align:8 data:double scope:local lbl_63_rodata_208 = .rodata:0x00000208; // type:object size:0x4 align:4 data:float lbl_63_rodata_20C = .rodata:0x0000020C; // type:object size:0x4 align:4 data:float lbl_63_rodata_210 = .rodata:0x00000210; // type:object size:0x4 align:4 data:float @@ -765,7 +765,7 @@ lbl_63_data_890 = .data:0x00000890; // type:object size:0x6 data:string lbl_63_data_898 = .data:0x00000898; // type:object size:0x10 lbl_63_data_8A8 = .data:0x000008A8; // type:object size:0x8 lbl_63_data_8B0 = .data:0x000008B0; // type:object size:0x7 data:string -lbl_63_data_8B8 = .data:0x000008B8; // type:object size:0x8 +__RTTI__6gfTask = .data:0x000008B8; // type:object size:0x8 scope:weak lbl_63_data_8C0 = .data:0x000008C0; // type:object size:0x14 lbl_63_data_8D4 = .data:0x000008D4; // type:object size:0x1A data:string lbl_63_data_8F0 = .data:0x000008F0; // type:object size:0x10 @@ -775,39 +775,39 @@ lbl_63_data_918 = .data:0x00000918; // type:object size:0x8 lbl_63_data_920 = .data:0x00000920; // type:object size:0x1DC lbl_63_data_AFC = .data:0x00000AFC; // type:object size:0x5 data:string lbl_63_data_B04 = .data:0x00000B04; // type:object size:0x24 -lbl_63_data_B28 = .data:0x00000B28; // type:object size:0x8 +__RTTI__4grGW = .data:0x00000B28; // type:object size:0x8 scope:weak lbl_63_data_B30 = .data:0x00000B30; // type:object size:0xB data:string lbl_63_data_B3C = .data:0x00000B3C; // type:object size:0x1C -lbl_63_data_B58 = .data:0x00000B58; // type:object size:0x8 +__RTTI__10grYakumono = .data:0x00000B58; // type:object size:0x8 scope:weak lbl_63_data_B60 = .data:0x00000B60; // type:object size:0xA data:string lbl_63_data_B6C = .data:0x00000B6C; // type:object size:0x14 -lbl_63_data_B80 = .data:0x00000B80; // type:object size:0x8 +__RTTI__9grGimmick = .data:0x00000B80; // type:object size:0x8 scope:weak lbl_63_data_B88 = .data:0x00000B88; // type:object size:0x7 data:string lbl_63_data_B90 = .data:0x00000B90; // type:object size:0x10 -lbl_63_data_BA0 = .data:0x00000BA0; // type:object size:0x8 -lbl_63_data_BA8 = .data:0x00000BA8; // type:object size:0x208 -lbl_63_data_DB0 = .data:0x00000DB0; // type:object size:0xA data:string -lbl_63_data_DBC = .data:0x00000DBC; // type:object size:0x2C -lbl_63_data_DE8 = .data:0x00000DE8; // type:object size:0x8 -lbl_63_data_DF0 = .data:0x00000DF0; // type:object size:0x208 -lbl_63_data_FF8 = .data:0x00000FF8; // type:object size:0xE data:string -lbl_63_data_1008 = .data:0x00001008; // type:object size:0x38 -lbl_63_data_1040 = .data:0x00001040; // type:object size:0x8 +__RTTI__6Ground = .data:0x00000BA0; // type:object size:0x8 scope:weak +__vt__9grGWScene = .data:0x00000BA8; // type:object size:0x208 scope:global +@10284 = .data:0x00000DB0; // type:object size:0xA data:string scope:local +@10285 = .data:0x00000DBC; // type:object size:0x2C scope:local +__RTTI__9grGWScene = .data:0x00000DE8; // type:object size:0x8 scope:weak +__vt__13grGWSceneChef = .data:0x00000DF0; // type:object size:0x208 scope:global +@10172 = .data:0x00000FF8; // type:object size:0xE data:string scope:local +@10173 = .data:0x00001008; // type:object size:0x34 scope:local +__RTTI__13grGWSceneChef = .data:0x00001040; // type:object size:0x8 scope:weak lbl_63_data_1048 = .data:0x00001048; // type:object size:0x50 lbl_63_data_1098 = .data:0x00001098; // type:object size:0x234 lbl_63_data_12CC = .data:0x000012CC; // type:object size:0xE data:string lbl_63_data_12DC = .data:0x000012DC; // type:object size:0x34 lbl_63_data_1310 = .data:0x00001310; // type:object size:0x108 -lbl_63_data_1418 = .data:0x00001418; // type:object size:0x90 -lbl_63_data_14A8 = .data:0x000014A8; // type:object size:0x210 -lbl_63_data_16B8 = .data:0x000016B8; // type:object size:0xE data:string -lbl_63_data_16C8 = .data:0x000016C8; // type:object size:0x38 -lbl_63_data_1700 = .data:0x00001700; // type:object size:0x108 -lbl_63_data_1808 = .data:0x00001808; // type:object size:0x110 -lbl_63_data_1918 = .data:0x00001918; // type:object size:0x210 -lbl_63_data_1B28 = .data:0x00001B28; // type:object size:0xD data:string -lbl_63_data_1B38 = .data:0x00001B38; // type:object size:0x38 -lbl_63_data_1B70 = .data:0x00001B70; // type:object size:0x108 +@10477 = .data:0x00001418; // type:object size:0x16 scope:local +__vt__13grGWSceneLion = .data:0x000014A8; // type:object size:0x210 scope:global +@10200 = .data:0x000016B8; // type:object size:0xE data:string scope:local +@10201 = .data:0x000016C8; // type:object size:0x34 scope:local +__RTTI__13grGWSceneLion = .data:0x00001700; // type:object size:0x8 scope:weak +@10477 = .data:0x00001808; // type:object size:0x11 scope:local +__vt__12grGWSceneOil = .data:0x00001918; // type:object size:0x210 scope:global +@10200 = .data:0x00001B28; // type:object size:0xD data:string scope:local +@10201 = .data:0x00001B38; // type:object size:0x34 scope:local +__RTTI__12grGWSceneOil = .data:0x00001B70; // type:object size:0x8 scope:weak lbl_63_data_1C78 = .data:0x00001C78; // type:object size:0x1E4 lbl_63_data_1E5C = .data:0x00001E5C; // type:object size:0xA data:string lbl_63_data_1E68 = .data:0x00001E68; // type:object size:0x30 @@ -1043,16 +1043,16 @@ lbl_63_data_5750 = .data:0x00005750; // type:object size:0x1DC lbl_63_data_592C = .data:0x0000592C; // type:object size:0xE data:string lbl_63_data_593C = .data:0x0000593C; // type:object size:0x2C lbl_63_data_5968 = .data:0x00005968; // type:object size:0x8 -jumptable_63_data_5970 = .data:0x00005970; // type:object size:0x40 scope:local -lbl_63_data_59B0 = .data:0x000059B0; // type:object size:0x160 -lbl_63_data_5B10 = .data:0x00005B10; // type:object size:0x1F0 -lbl_63_data_5D00 = .data:0x00005D00; // type:object size:0x10 data:string -lbl_63_data_5D10 = .data:0x00005D10; // type:object size:0x30 -lbl_63_data_5D40 = .data:0x00005D40; // type:object size:0x8 -lbl_63_data_5D48 = .data:0x00005D48; // type:object size:0x200 data:4byte -lbl_63_data_5F48 = .data:0x00005F48; // type:object size:0xC data:string -lbl_63_data_5F54 = .data:0x00005F54; // type:object size:0x2C -lbl_63_data_5F80 = .data:0x00005F80; // type:object size:0xC8 +@11577 = .data:0x00005970; // type:object size:0x40 scope:local +@11579 = .data:0x000059B0; // type:object size:0x8 scope:local +__vt__15grGWFireFighter = .data:0x00005B10; // type:object size:0x1F0 scope:global +@10681 = .data:0x00005D00; // type:object size:0x10 data:string scope:local +@10682 = .data:0x00005D10; // type:object size:0x2C scope:local +__RTTI__15grGWFireFighter = .data:0x00005D40; // type:object size:0x8 scope:weak +__vt__11grGWFireEtc = .data:0x00005D48; // type:object size:0x200 data:4byte scope:global +@10683 = .data:0x00005F48; // type:object size:0xC data:string scope:local +@10684 = .data:0x00005F54; // type:object size:0x2C scope:local +__RTTI__11grGWFireEtc = .data:0x00005F80; // type:object size:0x8 scope:weak jumptable_63_data_6048 = .data:0x00006048; // type:object size:0x1C scope:local lbl_63_data_6064 = .data:0x00006064; // type:object size:0x1E4 lbl_63_data_6248 = .data:0x00006248; // type:object size:0x10 data:string @@ -1090,3 +1090,54 @@ lbl_63_bss_78 = .bss:0x00000078; // type:object size:0x68 data:4byte lbl_63_bss_E0 = .bss:0x000000E0; // type:object size:0x8 data:byte lbl_63_bss_E8 = .bss:0x000000E8; // type:object size:0x68 data:4byte lbl_63_bss_150 = .bss:0x00000150; // type:object size:0xC +@10478 = .data:0x00001430; // type:object size:0x16 scope:local +@10479 = .data:0x00001448; // type:object size:0x16 scope:local +@10480 = .data:0x00001460; // type:object size:0x16 scope:local +@10481 = .data:0x00001478; // type:object size:0x16 scope:local +@10482 = .data:0x00001490; // type:object size:0x16 scope:local +lbl_63_data_1708 = .data:0x00001708; // type:object size:0x100 +@10478 = .data:0x0000181C; // type:object size:0x11 scope:local +@10479 = .data:0x00001830; // type:object size:0x11 scope:local +@10480 = .data:0x00001844; // type:object size:0x11 scope:local +@10481 = .data:0x00001858; // type:object size:0x13 scope:local +@10482 = .data:0x0000186C; // type:object size:0x14 scope:local +@10483 = .data:0x00001880; // type:object size:0x13 scope:local +@10484 = .data:0x00001894; // type:object size:0x13 scope:local +@10485 = .data:0x000018A8; // type:object size:0x19 scope:local +@10486 = .data:0x000018C4; // type:object size:0x19 scope:local +@10487 = .data:0x000018E0; // type:object size:0x19 scope:local +@10488 = .data:0x000018FC; // type:object size:0x19 scope:local +lbl_63_data_1B78 = .data:0x00001B78; // type:object size:0x100 +@11580 = .data:0x000059B8; // type:object size:0xA scope:local +@11581 = .data:0x000059C4; // type:object size:0xA scope:local +@11582 = .data:0x000059D0; // type:object size:0xA scope:local +@11583 = .data:0x000059DC; // type:object size:0xA scope:local +@11584 = .data:0x000059E8; // type:object size:0xA scope:local +@11585 = .data:0x000059F4; // type:object size:0xA scope:local +@11586 = .data:0x00005A00; // type:object size:0xA scope:local +@11587 = .data:0x00005A0C; // type:object size:0xA scope:local +@11588 = .data:0x00005A18; // type:object size:0xA scope:local +@11589 = .data:0x00005A24; // type:object size:0xA scope:local +@11590 = .data:0x00005A30; // type:object size:0xA scope:local +@11591 = .data:0x00005A3C; // type:object size:0xA scope:local +@11592 = .data:0x00005A48; // type:object size:0xA scope:local +@11593 = .data:0x00005A54; // type:object size:0xA scope:local +@11594 = .data:0x00005A60; // type:object size:0xA scope:local +@11595 = .data:0x00005A6C; // type:object size:0xA scope:local +@11596 = .data:0x00005A78; // type:object size:0xA scope:local +@11597 = .data:0x00005A84; // type:object size:0xA scope:local +@11598 = .data:0x00005A90; // type:object size:0xA scope:local +@11599 = .data:0x00005A9C; // type:object size:0xA scope:local +@11600 = .data:0x00005AA8; // type:object size:0xA scope:local +@11601 = .data:0x00005AB4; // type:object size:0xA scope:local +@11602 = .data:0x00005AC0; // type:object size:0xA scope:local +@11808 = .data:0x00005ACC; // type:object size:0xD scope:local +@11809 = .data:0x00005ADC; // type:object size:0xF scope:local +@11810 = .data:0x00005AEC; // type:object size:0xF scope:local +@11811 = .data:0x00005AFC; // type:object size:0xF scope:local +lbl_63_data_5F88 = .data:0x00005F88; // type:object size:0xC0 +@11801 = .rodata:0x000001F0; // type:object size:0x4 scope:local +@11802 = .rodata:0x000001F4; // type:object size:0x4 scope:local +@11803 = .rodata:0x000001F8; // type:object size:0x4 scope:local +@11804 = .rodata:0x000001FC; // type:object size:0x4 scope:local +@11805 = .rodata:0x00000200; // type:object size:0x4 scope:local diff --git a/config/RSBE01_02/symbols.txt b/config/RSBE01_02/symbols.txt index fedea1b01..a50dfbd83 100644 --- a/config/RSBE01_02/symbols.txt +++ b/config/RSBE01_02/symbols.txt @@ -6528,8 +6528,8 @@ fn_8015C144 = .text:0x8015C144; // type:function size:0x6C fn_8015C1B0 = .text:0x8015C1B0; // type:function size:0x20 fn_8015C1D0 = .text:0x8015C1D0; // type:function size:0x1C fn_8015C1EC = .text:0x8015C1EC; // type:function size:0x4C -fn_8015C238 = .text:0x8015C238; // type:function size:0x84 -fn_8015C2BC = .text:0x8015C2BC; // type:function size:0x48 +__dt__Q44nw4r2ut6detail12LinkListImplFv = .text:0x8015C238; // type:function size:0x84 +Erase__Q44nw4r2ut6detail12LinkListImplFQ54nw4r2ut6detail12LinkListImpl8Iterator = .text:0x8015C2BC; // type:function size:0x48 fn_8015C304 = .text:0x8015C304; // type:function size:0x44 Insert__Q44nw4r2ut6detail12LinkListImplFQ54nw4r2ut6detail12LinkListImpl8IteratorPQ34nw4r2ut12LinkListNode = .text:0x8015C348; // type:function size:0x2C Erase__Q44nw4r2ut6detail12LinkListImplFPQ34nw4r2ut12LinkListNode = .text:0x8015C374; // type:function size:0x30 diff --git a/configure.py b/configure.py index d44984a5b..61b366019 100755 --- a/configure.py +++ b/configure.py @@ -1210,7 +1210,13 @@ def MatchingFor(*versions): "mw_version": config.linker_version, "cflags": cflags_rel, "host": False, - "objects": [], + "objects": [ + Object(Matching, "mo_stage/st_gw/gr_gw_scene.cpp"), + Object(Matching, "mo_stage/st_gw/gr_gw_scene_chef.cpp"), + Object(Matching, "mo_stage/st_gw/gr_gw_scene_lion.cpp"), + Object(Matching, "mo_stage/st_gw/gr_gw_scene_oil.cpp"), + Object(Matching, "mo_stage/st_gw/gr_gw_fire_etc.cpp"), + ], }, { "lib": "st_halberd", diff --git a/include/st_gw/gr_gw.h b/include/st_gw/gr_gw.h new file mode 100644 index 000000000..ecbaf3db9 --- /dev/null +++ b/include/st_gw/gr_gw.h @@ -0,0 +1,26 @@ +#pragma once + +#include + +class grGW : public grYakumono { +protected: + u8 unk150; + float unk154; + u8* unk158; + u8 unk15C; + u8 unk15D; + float unk160; + float unk164; + Vec3f unk168; + +public: + grGW(const char* taskName); + virtual ~grGW(); + virtual void update(float deltaFrame); + virtual void updateScaleBase(float deltaFrame); + virtual void updateCallBack(float deltaFrame); + virtual void setMotion(u32 index, bool loop, bool force, float* frameCount); + virtual void setSceneIDWork(u8* scene); + virtual void setSceneID(u8 scene); +}; +static_assert(sizeof(grGW) == 0x174, "Class is wrong size!"); diff --git a/include/st_gw/gr_gw_fire_etc.h b/include/st_gw/gr_gw_fire_etc.h new file mode 100644 index 000000000..43839fdd3 --- /dev/null +++ b/include/st_gw/gr_gw_fire_etc.h @@ -0,0 +1,70 @@ +#pragma once + +#include +#include + +class grGWFireEtc : public grGW { + struct Victim { // Name unknown + nw4r::ut::LinkListNode unk0; + u8 unk8; + float unkC; + }; + struct NodeState { // Name unknown + u32 unk0[22]; + float unk58; + }; + enum State { STATE_0, STATE_1, STATE_2, STATE_3, STATE_4 }; // Name unknown + enum VictimStep { // Name unknown + STEP_3 = 3, STEP_4 = 4, STEP_11 = 11, STEP_12 = 12, + STEP_17 = 17, STEP_18 = 18, STEP_END = 21, STEP_REMOVED = 255 + }; + enum MistakeState { MISTAKE_11 = 11, MISTAKE_12 = 12 }; // Name unknown + u8* unk174; + u8* unk178; + u8* unk17C; + u32 unk180; + u32 unk184; + NodeState unk188; + u8* unk1E4; + u8 unk1E8; + nw4r::ut::LinkList unk1EC; +public: + inline grGWFireEtc(const char* taskName); + virtual ~grGWFireEtc(); + virtual void update(float deltaFrame); + virtual bool setNode(); + virtual void updateVictim(float deltaFrame); + virtual void setIndexWork(u8* value) { unk178 = value; } + virtual void setIndexFighterWork(u8* value) { unk17C = value; } + virtual void setStateMistakeWork(u8* value) { unk174 = value; } + virtual void setEventWork(u8* value) { unk1E4 = value; } + virtual void addVictim(); + virtual void clearVictim(); + virtual void clearVictimAll(); + virtual Victim* getVictim(u32 index); + static grGWFireEtc* create(int modelIndex, const char* nodeName, const char* taskName); +}; +static_assert(sizeof(grGWFireEtc) == 0x1F8, "Class is wrong size!"); + +class grGWFireFighter : public grGW { + enum State { STATE_0, STATE_1, STATE_2, STATE_3, STATE_4 }; // Name unknown + u32 unk174; + u32 unk178[3]; + Vec3f* unk184; + u8* unk188; + u8* unk18C; + u8* unk190; + u8 unk194; +public: + inline grGWFireFighter(const char* taskName); + virtual ~grGWFireFighter(); + virtual void update(float deltaFrame); + virtual bool setNode(); + virtual void updateFighter(float deltaFrame); + virtual void setEventWork(u8* value) { unk190 = value; } + virtual void setPosWork(Vec3f* value) { unk184 = value; } + virtual void setIndexWork(u8* value) { unk188 = value; } + virtual void setIndexVictimWork(u8* value) { unk18C = value; } + static grGWFireFighter* create(int modelIndex, const char* nodeName, const char* taskName); +}; +static_assert(sizeof(grGWFireFighter) == 0x198, "Class is wrong size!"); diff --git a/include/st_gw/gr_gw_scene.h b/include/st_gw/gr_gw_scene.h new file mode 100644 index 000000000..828d8a036 --- /dev/null +++ b/include/st_gw/gr_gw_scene.h @@ -0,0 +1,36 @@ +#pragma once + +#include + +class stDataMultiContainer; + +class grGWScene : public grGW { +private: + u8 unk174; + float unk178; + float* unk17C; + Vec3f* unk180; + u8* unk184; + u8* unk188; + u8 unk18C; + u8 unk18D; + stDataMultiContainer* unk190; + +public: + static grGWScene* create(int modelIndex, const char* nodeName, const char* taskName); + grGWScene(const char* taskName); + virtual ~grGWScene(); + virtual void update(float deltaFrame); + virtual void updateSub(float deltaFrame); + virtual void updateSubEnd(float deltaFrame); + virtual void updateStep(float deltaFrame); + virtual void updateEvent(float deltaFrame); + virtual void selectStep(); + virtual void clearStep(); + virtual void setFrameWork(float* frame); + virtual void setEventWork(u8* event); + virtual void setPosGimmickWork(Vec3f* positions); + virtual void setCtrlStepWork(u8* control); + virtual void setTblStepAcc(stDataMultiContainer* table); +}; +static_assert(sizeof(grGWScene) == 0x194, "Class is wrong size!"); diff --git a/include/st_gw/gr_gw_scene_chef.h b/include/st_gw/gr_gw_scene_chef.h new file mode 100644 index 000000000..bbf9e2c42 --- /dev/null +++ b/include/st_gw/gr_gw_scene_chef.h @@ -0,0 +1,12 @@ +#pragma once + +#include + +class grGWSceneChef : public grGWScene { +public: + static grGWSceneChef* create(int modelIndex, const char* nodeName, const char* taskName); + grGWSceneChef(const char* taskName) : grGWScene(taskName) { } + virtual ~grGWSceneChef(); + virtual void update(float deltaFrame); +}; +static_assert(sizeof(grGWSceneChef) == 0x194, "Class is wrong size!"); diff --git a/include/st_gw/gr_gw_scene_lion.h b/include/st_gw/gr_gw_scene_lion.h new file mode 100644 index 000000000..d93066f78 --- /dev/null +++ b/include/st_gw/gr_gw_scene_lion.h @@ -0,0 +1,20 @@ +#pragma once + +#include + +class grGWSceneLion : public grGWScene { +private: + Vec3f* unk194; + Vec3f* unk198; + +public: + static grGWSceneLion* create(int modelIndex, const char* nodeName, const char* taskName); + grGWSceneLion(const char* taskName) + : grGWScene(taskName), unk194(nullptr), unk198(nullptr) { } + virtual ~grGWSceneLion(); + virtual void processAnim(); + virtual void update(float deltaFrame); + virtual void setPosKeeperLWork(Vec3f* positions) { unk194 = positions; } + virtual void setPosKeeperRWork(Vec3f* positions) { unk198 = positions; } +}; +static_assert(sizeof(grGWSceneLion) == 0x19C, "Class is wrong size!"); diff --git a/include/st_gw/gr_gw_scene_oil.h b/include/st_gw/gr_gw_scene_oil.h new file mode 100644 index 000000000..7931f124d --- /dev/null +++ b/include/st_gw/gr_gw_scene_oil.h @@ -0,0 +1,27 @@ +#pragma once + +#include + +struct grGWGuestData { // Name unknown + Vec3f unk0[8]; + u8 unk60; + u8 unk61; +}; +static_assert(sizeof(grGWGuestData) == 0x64, "Class is wrong size!"); + +class grGWSceneOil : public grGWScene { +private: + grGWGuestData* unk194; + grGWGuestData* unk198; + +public: + static grGWSceneOil* create(int modelIndex, const char* nodeName, const char* taskName); + grGWSceneOil(const char* taskName) + : grGWScene(taskName), unk194(nullptr), unk198(nullptr) { } + virtual ~grGWSceneOil(); + virtual void processAnim(); + virtual void update(float deltaFrame); + virtual void setDataGuestManWork(grGWGuestData* data) { unk194 = data; } + virtual void setDataGuestWomanWork(grGWGuestData* data) { unk198 = data; } +}; +static_assert(sizeof(grGWSceneOil) == 0x19C, "Class is wrong size!"); diff --git a/src/mo_stage/st_gw/gr_gw_fire_etc.cpp b/src/mo_stage/st_gw/gr_gw_fire_etc.cpp new file mode 100644 index 000000000..c76e86b0d --- /dev/null +++ b/src/mo_stage/st_gw/gr_gw_fire_etc.cpp @@ -0,0 +1,454 @@ +#include +#include + +#include + +namespace { +struct StageData { // Name unknown + u8 unk0[0x3C]; + float unk3C; + u8 unk40[4]; + float unk44; + float unk48; + float unk4C; + float unk50; +}; +} + +grGWFireEtc::grGWFireEtc(const char* taskName) : grGW(taskName) { + unk174 = nullptr; + unk1E4 = nullptr; + unk1E8 = 1; + memset(&unk180, 0, sizeof(unk180)); + memset(&unk188, 0, sizeof(unk188)); + unk178 = nullptr; + unk17C = nullptr; + unk188.unk58 = 0.0f; +} + +grGWFireEtc* grGWFireEtc::create(int modelIndex, const char* nodeName, const char* taskName) { + grGWFireEtc* ground = new (Heaps::StageInstance) grGWFireEtc(taskName); + if (ground != nullptr) { + ground->setMdlIndex(modelIndex); + ground->setTgtNode(nodeName); + } + return ground; +} + +grGWFireEtc::~grGWFireEtc() { + clearVictimAll(); +} + +void grGWFireEtc::update(float deltaFrame) { + grGW::update(deltaFrame); + StageData* data = static_cast(getStageData()); + if (data == nullptr) { + return; + } + unk154 -= deltaFrame; + if (unk154 < 0.0f) { + unk154 = 0.0f; + } + switch (unk150) { + case STATE_0: + setMotion(1, false, true, nullptr); + setVisibility(false); + setNodeVisibility(false, 0, unk180, true, true); + clearVictimAll(); + unk174[0] = MISTAKE_11; + unk174[1] = MISTAKE_11; + unk174[2] = MISTAKE_11; + unk1E8 = 1; + unk150 = STATE_1; + break; + case STATE_1: + if (*unk158 == unk15C) { + setVisibility(true); + unk188.unk58 = data->unk44 + (data->unk48 - data->unk44) * randf(); + unk150 = STATE_3; + } + break; + case STATE_2: + break; + case STATE_3: + if (*unk158 != unk15C) { + setMotion(0, false, true, &unk164); + if (m_motionRatio < 0.0f) { + m_motionRatio *= -1.0f; + } + unk150 = STATE_4; + } else { + if (*unk1E4 == 0) { + updateVictim(deltaFrame); + } else if (*unk1E4 != unk1E8) { + setNodeVisibility(false, 0, unk180, true, true); + clearVictimAll(); + unk174[0] = MISTAKE_11; + unk174[1] = MISTAKE_11; + unk174[2] = MISTAKE_11; + } + unk1E8 = *unk1E4; + } + break; + case STATE_4: + if (getMotionFrame(0) >= unk164) { + unk150 = STATE_0; + } + break; + } +} + +void grGWFireEtc::updateVictim(float deltaFrame) { + StageData* data = static_cast(getStageData()); + if (data == nullptr) { + return; + } + unk188.unk58 -= deltaFrame; + if (unk188.unk58 < 0.0) { + unk188.unk58 = 0.0f; + } + setNodeVisibility(true, 0, unk184, true, false); + if (unk188.unk58 == 0.0f) { + if (randf() < data->unk4C) { + addVictim(); + setNodeVisibility(true, 0, unk188.unk0[0], true, false); + } + unk188.unk58 = data->unk44 + (data->unk48 - data->unk44) * randf(); + } + if (unk178 != nullptr) { + unk178[0] = 0; + unk178[1] = 0; + unk178[2] = 0; + } + u32 removed; + u32 i; + u32 count; + nw4r::ut::LinkList::Iterator victim; + victim = unk1EC.GetBeginIter(); + count = unk1EC.GetSize(); + removed = 0; + for (i = 0; i != count; ++i, ++victim) { + victim->unkC -= deltaFrame; + if (victim->unkC < 0.0f) { + victim->unkC = 0.0f; + } + if (victim->unkC == 0.0f) { + setNodeVisibility(false, 0, unk188.unk0[victim->unk8], true, false); + if (victim->unk8 == STEP_END) { + victim->unk8 = STEP_REMOVED; + ++removed; + } else { + u32 previous = removed; + switch (victim->unk8) { + case STEP_4: + if (*unk17C == 2) { + unk154 = data->unk3C; + } else { + unk174[2] = MISTAKE_12; + victim->unk8 = STEP_REMOVED; + ++removed; + } + break; + case STEP_12: + if (*unk17C == 1) { + unk154 = data->unk3C; + } else { + unk174[1] = MISTAKE_12; + victim->unk8 = STEP_REMOVED; + ++removed; + } + break; + case STEP_18: + if (*unk17C == 0) { + unk154 = data->unk3C; + } else { + unk174[0] = MISTAKE_12; + victim->unk8 = STEP_REMOVED; + ++removed; + } + break; + } + if (removed == previous) { + ++victim->unk8; + victim->unkC = data->unk50; + setNodeVisibility(true, 0, unk188.unk0[victim->unk8], true, false); + } + } + switch (victim->unk8) { + case STEP_3: + unk178[2] = 1; + break; + case STEP_4: + unk178[2] = 1; + break; + case STEP_11: + unk178[1] = 1; + break; + case STEP_12: + unk178[1] = 1; + break; + case STEP_17: + unk178[0] = 1; + break; + case STEP_18: + unk178[0] = 1; + break; + } + } + } + for (u32 i = 0; i != removed; ++i) { + clearVictim(); + } +} + +bool grGWFireEtc::setNode() { + bool result = grGimmick::setNode(); + unk180 = getNodeIndex(0, "_VICTIM"); + unk184 = getNodeIndex(0, "Victim_02"); + unk188.unk0[0] = getNodeIndex(0, "Victim_01"); + unk188.unk0[1] = getNodeIndex(0, "Victim_03"); + unk188.unk0[2] = getNodeIndex(0, "Victim_04"); + unk188.unk0[3] = getNodeIndex(0, "Victim_05"); + unk188.unk0[4] = getNodeIndex(0, "Victim_06"); + unk188.unk0[5] = getNodeIndex(0, "Victim_07"); + unk188.unk0[6] = getNodeIndex(0, "Victim_08"); + unk188.unk0[7] = getNodeIndex(0, "Victim_09"); + unk188.unk0[8] = getNodeIndex(0, "Victim_10"); + unk188.unk0[9] = getNodeIndex(0, "Victim_11"); + unk188.unk0[10] = getNodeIndex(0, "Victim_12"); + unk188.unk0[11] = getNodeIndex(0, "Victim_13"); + unk188.unk0[12] = getNodeIndex(0, "Victim_14"); + unk188.unk0[13] = getNodeIndex(0, "Victim_15"); + unk188.unk0[14] = getNodeIndex(0, "Victim_16"); + unk188.unk0[15] = getNodeIndex(0, "Victim_17"); + unk188.unk0[16] = getNodeIndex(0, "Victim_18"); + unk188.unk0[17] = getNodeIndex(0, "Victim_19"); + unk188.unk0[18] = getNodeIndex(0, "Victim_20"); + unk188.unk0[19] = getNodeIndex(0, "Victim_21"); + unk188.unk0[20] = getNodeIndex(0, "Victim_22"); + unk188.unk0[21] = getNodeIndex(0, "Victim_23"); + return result; +} + +void grGWFireEtc::addVictim() { + StageData* data = static_cast(getStageData()); + if (data == nullptr) { + return; + } + Victim* victim = new (Heaps::StageInstance) Victim; + if (victim != nullptr) { + victim->unk8 = 0; + victim->unkC = data->unk50; + unk1EC.PushBack(victim); + } +} + +void grGWFireEtc::clearVictim() { + Victim* victim = getVictim(STEP_REMOVED); + if (victim != nullptr) { + unk1EC.Erase(victim); + delete victim; + } +} + +void grGWFireEtc::clearVictimAll() { + u32 i = 0; + u32 count = unk1EC.GetSize(); + for (; i != count; ++i) { + Victim* victim = &unk1EC.GetFront(); + unk1EC.Erase(unk1EC.GetBeginIter()); + delete victim; + } +} + +grGWFireEtc::Victim* grGWFireEtc::getVictim(u32 index) { + u32 count = unk1EC.GetSize(); + nw4r::ut::LinkList::Iterator victim = unk1EC.GetBeginIter(); + for (u32 i = 0; i != count; ++i, ++victim) { + if (index == victim->unk8) { + return &*victim; + } + } + return nullptr; +} + +grGWFireFighter::grGWFireFighter(const char* taskName) : grGW(taskName) { + unk190 = nullptr; + unk194 = 1; + memset(&unk174, 0, sizeof(unk174)); + memset(unk178, 0, sizeof(unk178)); + unk184 = nullptr; + unk188 = nullptr; + unk18C = nullptr; +} + +grGWFireFighter* grGWFireFighter::create(int modelIndex, const char* nodeName, const char* taskName) { + grGWFireFighter* ground = new (Heaps::StageInstance) grGWFireFighter(taskName); + if (ground != nullptr) { + ground->setMdlIndex(modelIndex); + ground->setTgtNode(nodeName); + } + return ground; +} + +grGWFireFighter::~grGWFireFighter() { } + +void grGWFireFighter::update(float deltaFrame) { + grGW::update(deltaFrame); + StageData* data = static_cast(getStageData()); + if (data == nullptr) { + return; + } + unk154 -= deltaFrame; + if (unk154 < 0.0f) { + unk154 = 0.0f; + } + switch (unk150) { + case STATE_0: + setMotion(1, false, true, nullptr); + setVisibility(false); + setNodeVisibility(false, 0, unk174, true, true); + unk194 = 1; + unk150 = STATE_1; + break; + case STATE_1: + if (*unk158 == unk15C) { + setVisibility(true); + if (*unk188 == 255) { + *unk188 = 0; + } + unk154 = data->unk3C; + unk150 = STATE_3; + } + break; + case STATE_2: + break; + case STATE_3: + if (*unk158 != unk15C) { + setMotion(0, false, true, &unk164); + if (m_motionRatio < 0.0f) { + m_motionRatio *= -1.0f; + } + unk150 = STATE_4; + } else { + if (*unk190 == 0) { + updateFighter(deltaFrame); + } else if (*unk190 != unk194) { + setNodeVisibility(false, 0, unk174, true, true); + } + getNodePosition(unk184, 0, unk178[*unk188]); + unk194 = *unk190; + } + break; + case STATE_4: + if (getMotionFrame(0) >= unk164) { + unk150 = STATE_0; + } + break; + } +} + +void grGWFireFighter::updateFighter(float deltaFrame) { + StageData* data = static_cast(getStageData()); + if (data == nullptr) { + return; + } + unk154 -= deltaFrame; + if (unk154 < 0.0f) { + unk154 = 0.0f; + } + if (unk154 == 0.0f) { + float random = randf(); + setNodeVisibility(false, 0, unk178[*unk188], true, false); + switch (*unk188) { + case 0: + if (unk18C[0] == 1) { + if (random < 0.8f) { + *unk188 = 0; + } else { + *unk188 = 1; + } + } else if (unk18C[1] == 1) { + if (random < 0.8f) { + *unk188 = 1; + } else { + *unk188 = 0; + } + } else { + if (random < 0.5f) { + *unk188 = 1; + } else { + *unk188 = 0; + } + } + break; + case 1: + if (unk18C[1] == 1) { + if (random < 0.8f) { + *unk188 = 1; + } else if (random < 0.9f) { + *unk188 = 0; + } else { + *unk188 = 2; + } + } else if (unk18C[0] == 1) { + if (random < 0.8f) { + *unk188 = 0; + } else if (random < 0.9f) { + *unk188 = 1; + } else { + *unk188 = 2; + } + } else if (unk18C[2] == 1) { + if (random < 0.8f) { + *unk188 = 0; + } else if (random < 0.9f) { + *unk188 = 1; + } else { + *unk188 = 2; + } + } else { + if (random < 1.0f / 3.0f) { + *unk188 = 0; + } else if (random < 2.0f / 3.0f) { + *unk188 = 2; + } else { + *unk188 = 1; + } + } + break; + case 2: + if (unk18C[2] == 1) { + if (random < 0.8f) { + *unk188 = 2; + } else { + *unk188 = 1; + } + } else if (unk18C[1] == 1) { + if (random < 0.8f) { + *unk188 = 1; + } else { + *unk188 = 2; + } + } else { + if (random < 0.5f) { + *unk188 = 1; + } else { + *unk188 = 2; + } + } + break; + } + unk154 = data->unk3C; + } + setNodeVisibility(true, 0, unk178[*unk188], true, false); +} + +bool grGWFireFighter::setNode() { + bool result = grGimmick::setNode(); + unk174 = getNodeIndex(0, "_FIREFIGHTER"); + unk178[0] = getNodeIndex(0, "Firefighter_01"); + unk178[1] = getNodeIndex(0, "Firefighter_02"); + unk178[2] = getNodeIndex(0, "Firefighter_03"); + return result; +} diff --git a/src/mo_stage/st_gw/gr_gw_scene.cpp b/src/mo_stage/st_gw/gr_gw_scene.cpp new file mode 100644 index 000000000..9a6300247 --- /dev/null +++ b/src/mo_stage/st_gw/gr_gw_scene.cpp @@ -0,0 +1,136 @@ +#include +#include + +#include + +namespace { + +enum State { // Name unknown + State_0 = 0, + State_1 = 1, + State_2 = 2, + State_3 = 3, + State_4 = 4, +}; + +// Only the stage-data prefix read by this unit is described. +struct StageData { // Name unknown + u8 unk00[0x2C]; + float unk2C; +}; + +} + +grGWScene* grGWScene::create(int modelIndex, const char* nodeName, const char* taskName) { + grGWScene* ground = new (Heaps::StageInstance) grGWScene(taskName); + if (ground != nullptr) { + ground->setMdlIndex(modelIndex); + ground->setTgtNode(nodeName); + } + return ground; +} + +grGWScene::grGWScene(const char* taskName) : grGW(taskName) { + unk174 = 0; + unk178 = 0.0f; + unk17C = nullptr; + unk180 = nullptr; + unk184 = nullptr; + unk188 = nullptr; + unk18C = 1; + unk18D = 0; + unk190 = nullptr; +} + +grGWScene::~grGWScene() { } + +void grGWScene::update(float deltaFrame) { + grGW::update(deltaFrame); + StageData* data = static_cast(getStageData()); + if (data == nullptr) { + return; + } + unk154 -= deltaFrame; + if (unk154 < 0.0f) { + unk154 = 0.0f; + } + switch (unk150) { + case State_0: + setMotion(0, false, true, &unk164); + setMotionFrame(unk164, 0); + setVisibility(false); + setEnableCollisionStatus(false); + clearStep(); + if (unk15C != 0) { + unk18C = 0; + } + unk174 = 0; + unk178 = 0.0f; + unk150 = State_1; + break; + case State_1: + if (*unk158 == unk15C) { + if (unk18C == 1) { + setMotion(1, false, true, nullptr); + unk18C = 0; + unk160 = 0.0f; + } else { + setMotion(0, true, true, &unk164); + setMotionFrame(unk164, 0); + unk160 = unk164; + m_motionRatio *= -1.0f; + } + selectStep(); + if (randf() < data->unk2C) { + unk18D = 1; + } + unk150 = State_3; + } + break; + case State_2: + break; + case State_3: + if (*unk158 != unk15C) { + if (unk184 != nullptr) { + ++*unk184; + } + setMotion(0, false, true, &unk164); + if (m_motionRatio < 0.0f) { + m_motionRatio *= -1.0f; + } + updateSubEnd(deltaFrame); + unk18D = 0; + unk150 = State_4; + } else { + if (getMotionFrame(0) > unk160) { + setMotion(1, false, false, nullptr); + } else { + unk160 = getMotionFrame(0); + } + setVisibility(true); + setEnableCollisionStatus(true); + updateSub(deltaFrame); + } + break; + case State_4: + if (getMotionFrame(0) >= unk164) { + unk150 = State_0; + } + break; + } +} + +void grGWScene::clearStep() { } + +void grGWScene::selectStep() { } + +void grGWScene::updateSub(float deltaFrame) { + updateStep(deltaFrame); + updateEvent(deltaFrame); +} + +void grGWScene::updateSubEnd(float deltaFrame) { } + +void grGWScene::updateStep(float deltaFrame) { } + +void grGWScene::updateEvent(float deltaFrame) { } diff --git a/src/mo_stage/st_gw/gr_gw_scene_chef.cpp b/src/mo_stage/st_gw/gr_gw_scene_chef.cpp new file mode 100644 index 000000000..1ca9575ee --- /dev/null +++ b/src/mo_stage/st_gw/gr_gw_scene_chef.cpp @@ -0,0 +1,18 @@ +#include + +#include + +grGWSceneChef* grGWSceneChef::create(int modelIndex, const char* nodeName, const char* taskName) { + grGWSceneChef* ground = new (Heaps::StageInstance) grGWSceneChef(taskName); + if (ground != nullptr) { + ground->setMdlIndex(modelIndex); + ground->setTgtNode(nodeName); + } + return ground; +} + +grGWSceneChef::~grGWSceneChef() { } + +void grGWSceneChef::update(float deltaFrame) { + grGWScene::update(deltaFrame); +} diff --git a/src/mo_stage/st_gw/gr_gw_scene_lion.cpp b/src/mo_stage/st_gw/gr_gw_scene_lion.cpp new file mode 100644 index 000000000..8d1429d15 --- /dev/null +++ b/src/mo_stage/st_gw/gr_gw_scene_lion.cpp @@ -0,0 +1,32 @@ +#include + +#include + +grGWSceneLion* grGWSceneLion::create(int modelIndex, const char* nodeName, const char* taskName) { + grGWSceneLion* ground = new (Heaps::StageInstance) grGWSceneLion(taskName); + if (ground != nullptr) { + ground->setMdlIndex(modelIndex); + ground->setTgtNode(nodeName); + } + return ground; +} + +grGWSceneLion::~grGWSceneLion() { } + +void grGWSceneLion::processAnim() { + Ground::processAnim(); + if (unk194 != nullptr) { + getNodePosition(&unk194[0], 0, "_KEEPER_L_POSITION_01"); + getNodePosition(&unk194[1], 0, "_KEEPER_L_POSITION_02"); + getNodePosition(&unk194[2], 0, "_KEEPER_L_POSITION_03"); + } + if (unk198 != nullptr) { + getNodePosition(&unk198[0], 0, "_KEEPER_R_POSITION_01"); + getNodePosition(&unk198[1], 0, "_KEEPER_R_POSITION_02"); + getNodePosition(&unk198[2], 0, "_KEEPER_R_POSITION_03"); + } +} + +void grGWSceneLion::update(float deltaFrame) { + grGWScene::update(deltaFrame); +} diff --git a/src/mo_stage/st_gw/gr_gw_scene_oil.cpp b/src/mo_stage/st_gw/gr_gw_scene_oil.cpp new file mode 100644 index 000000000..8c274a6ca --- /dev/null +++ b/src/mo_stage/st_gw/gr_gw_scene_oil.cpp @@ -0,0 +1,43 @@ +#include + +#include + +grGWSceneOil* grGWSceneOil::create(int modelIndex, const char* nodeName, const char* taskName) { + grGWSceneOil* ground = new (Heaps::StageInstance) grGWSceneOil(taskName); + if (ground != nullptr) { + ground->setMdlIndex(modelIndex); + ground->setTgtNode(nodeName); + } + return ground; +} + +grGWSceneOil::~grGWSceneOil() { } + +void grGWSceneOil::processAnim() { + Ground::processAnim(); + if (unk194 != nullptr) { + // Both man pose sets use the same four nodes. + getNodePosition(&unk194->unk0[0], 0, "_MAN_01_POSITION"); + getNodePosition(&unk194->unk0[1], 0, "_MAN_02_POSITION"); + getNodePosition(&unk194->unk0[2], 0, "_MAN_03_POSITION"); + getNodePosition(&unk194->unk0[3], 0, "_MAN_04_POSITION"); + getNodePosition(&unk194->unk0[4], 0, "_MAN_01_POSITION"); + getNodePosition(&unk194->unk0[5], 0, "_MAN_02_POSITION"); + getNodePosition(&unk194->unk0[6], 0, "_MAN_03_POSITION"); + getNodePosition(&unk194->unk0[7], 0, "_MAN_04_POSITION"); + } + if (unk198 != nullptr) { + getNodePosition(&unk198->unk0[0], 0, "_WOMAN_01_POSITION"); + getNodePosition(&unk198->unk0[1], 0, "_WOMAN_02_POSITION1"); + getNodePosition(&unk198->unk0[2], 0, "_WOMAN_03_POSITION"); + getNodePosition(&unk198->unk0[3], 0, "_WOMAN_04_POSITION"); + getNodePosition(&unk198->unk0[4], 0, "_WOMAN_ANGER_01_POSITION"); + getNodePosition(&unk198->unk0[5], 0, "_WOMAN_ANGER_02_POSITION"); + getNodePosition(&unk198->unk0[6], 0, "_WOMAN_ANGER_03_POSITION"); + getNodePosition(&unk198->unk0[7], 0, "_WOMAN_ANGER_04_POSITION"); + } +} + +void grGWSceneOil::update(float deltaFrame) { + grGWScene::update(deltaFrame); +}