From a6d931239d91a01b2fcbd8371fd5f6b8a2e8b150 Mon Sep 17 00:00:00 2001 From: 2gifts Date: Mon, 28 Sep 2026 12:18:02 -0400 Subject: [PATCH] Match st_mansion ground objects --- config/RSBE01_02/rels/st_mansion/splits.txt | 20 ++ config/RSBE01_02/rels/st_mansion/symbols.txt | 180 +++++++++--------- config/RSBE01_02/symbols.txt | 2 +- configure.py | 7 +- include/st_mansion/gr_mansion.h | 15 ++ include/st_mansion/gr_mansion_area.h | 40 ++++ include/st_mansion/gr_mansion_area_break.h | 33 ++++ include/st_mansion/gr_mansion_area_down.h | 31 +++ include/st_mansion/gr_mansion_area_up.h | 31 +++ include/st_mansion/gr_mansion_ground.h | 17 ++ src/mo_stage/st_mansion/gr_mansion.cpp | 38 ++++ .../st_mansion/gr_mansion_area_break.cpp | 70 +++++++ .../st_mansion/gr_mansion_area_down.cpp | 105 ++++++++++ .../st_mansion/gr_mansion_area_up.cpp | 96 ++++++++++ 14 files changed, 597 insertions(+), 88 deletions(-) create mode 100644 include/st_mansion/gr_mansion.h create mode 100644 include/st_mansion/gr_mansion_area.h create mode 100644 include/st_mansion/gr_mansion_area_break.h create mode 100644 include/st_mansion/gr_mansion_area_down.h create mode 100644 include/st_mansion/gr_mansion_area_up.h create mode 100644 include/st_mansion/gr_mansion_ground.h create mode 100644 src/mo_stage/st_mansion/gr_mansion.cpp create mode 100644 src/mo_stage/st_mansion/gr_mansion_area_break.cpp create mode 100644 src/mo_stage/st_mansion/gr_mansion_area_down.cpp create mode 100644 src/mo_stage/st_mansion/gr_mansion_area_up.cpp diff --git a/config/RSBE01_02/rels/st_mansion/splits.txt b/config/RSBE01_02/rels/st_mansion/splits.txt index 93164084d..df293ec16 100644 --- a/config/RSBE01_02/rels/st_mansion/splits.txt +++ b/config/RSBE01_02/rels/st_mansion/splits.txt @@ -11,6 +11,26 @@ global_destructor_chain.c: .dtors start:0x00000000 end:0x00000008 .bss start:0x00000000 end:0x00000004 +mo_stage/st_mansion/gr_mansion.cpp: + .text start:0x00001670 end:0x00001A5C + .data start:0x00000630 end:0x00000AE0 + .rodata start:0x00000040 end:0x00000044 + +mo_stage/st_mansion/gr_mansion_area_up.cpp: + .text start:0x0000A104 end:0x0000A590 + .data start:0x000024D8 end:0x00002738 + .rodata start:0x000000B8 end:0x000000CC + +mo_stage/st_mansion/gr_mansion_area_down.cpp: + .text start:0x0000A590 end:0x0000AA78 + .data start:0x00002738 end:0x00002998 + .rodata start:0x000000D0 end:0x000000E4 + +mo_stage/st_mansion/gr_mansion_area_break.cpp: + .text start:0x0000AA78 end:0x0000AD50 + .data start:0x00002998 end:0x00002BE0 + .rodata start:0x000000E8 end:0x000000EC + mo_stage/mo_stage.cpp: .text start:0x0000CC28 end:0x0000CCC4 .data start:0x00003060 end:0x0000306D diff --git a/config/RSBE01_02/rels/st_mansion/symbols.txt b/config/RSBE01_02/rels/st_mansion/symbols.txt index aa0a1d763..f0d507baa 100644 --- a/config/RSBE01_02/rels/st_mansion/symbols.txt +++ b/config/RSBE01_02/rels/st_mansion/symbols.txt @@ -6,23 +6,23 @@ fn_47_184 = .text:0x00000184; // type:function size:0x6C fn_47_1F0 = .text:0x000001F0; // type:function size:0x8 fn_47_1F8 = .text:0x000001F8; // type:function size:0x2F4 fn_47_4EC = .text:0x000004EC; // type:function size:0xB4 -fn_47_5A0 = .text:0x000005A0; // type:function size:0x8 +setStageData__6GroundFPv = .text:0x000005A0; // type:function size:0x8 scope:weak fn_47_5A8 = .text:0x000005A8; // type:function size:0xCC -fn_47_674 = .text:0x00000674; // type:function size:0x8 +setPosGimmickWork__15grMansionGroundFP5Vec3f = .text:0x00000674; // type:function size:0x8 scope:weak fn_47_67C = .text:0x0000067C; // type:function size:0x148 fn_47_7C4 = .text:0x000007C4; // type:function size:0x8 fn_47_7CC = .text:0x000007CC; // type:function size:0x8 fn_47_7D4 = .text:0x000007D4; // type:function size:0x8 fn_47_7DC = .text:0x000007DC; // type:function size:0x8 fn_47_7E4 = .text:0x000007E4; // type:function size:0x390 -fn_47_B74 = .text:0x00000B74; // type:function size:0x8 -fn_47_B7C = .text:0x00000B7C; // type:function size:0x8 -fn_47_B84 = .text:0x00000B84; // type:function size:0x8 -fn_47_B8C = .text:0x00000B8C; // type:function size:0x8 -fn_47_B94 = .text:0x00000B94; // type:function size:0x8 -fn_47_B9C = .text:0x00000B9C; // type:function size:0x8 -fn_47_BA4 = .text:0x00000BA4; // type:function size:0x8 -fn_47_BAC = .text:0x00000BAC; // type:function size:0x8 +setPosWork__13grMansionAreaFP5Vec3f = .text:0x00000B74; // type:function size:0x8 scope:weak +setStateWork__13grMansionAreaFPUc = .text:0x00000B7C; // type:function size:0x8 scope:weak +setStateSubWork__13grMansionAreaFPUc = .text:0x00000B84; // type:function size:0x8 scope:weak +setScaleRateWork__13grMansionAreaFPf = .text:0x00000B8C; // type:function size:0x8 scope:weak +setType__13grMansionAreaFUc = .text:0x00000B94; // type:function size:0x8 scope:weak +setTypeLR__13grMansionAreaFUc = .text:0x00000B9C; // type:function size:0x8 scope:weak +setScaleRateFlg__13grMansionAreaFUc = .text:0x00000BA4; // type:function size:0x8 scope:weak +setPillarNode__13grMansionAreaFUl = .text:0x00000BAC; // type:function size:0x8 scope:weak fn_47_BB4 = .text:0x00000BB4; // type:function size:0x1BC fn_47_D70 = .text:0x00000D70; // type:function size:0x8 fn_47_D78 = .text:0x00000D78; // type:function size:0x8 @@ -76,27 +76,27 @@ fn_47_1560 = .text:0x00001560; // type:function size:0x64 fn_47_15C4 = .text:0x000015C4; // type:function size:0x74 fn_47_1638 = .text:0x00001638; // type:function size:0x34 fn_47_166C = .text:0x0000166C; // type:function size:0x4 -fn_47_1670 = .text:0x00001670; // type:function size:0xD8 -fn_47_1748 = .text:0x00001748; // type:function size:0x8 -fn_47_1750 = .text:0x00001750; // type:function size:0x64 -fn_47_17B4 = .text:0x000017B4; // type:function size:0x58 -fn_47_180C = .text:0x0000180C; // type:function size:0xE8 -fn_47_18F4 = .text:0x000018F4; // type:function size:0x5C -fn_47_1950 = .text:0x00001950; // type:function size:0x80 -fn_47_19D0 = .text:0x000019D0; // type:function size:0x8 -fn_47_19D8 = .text:0x000019D8; // type:function size:0x8 -fn_47_19E0 = .text:0x000019E0; // type:function size:0x4 -fn_47_19E4 = .text:0x000019E4; // type:function size:0x4 -fn_47_19E8 = .text:0x000019E8; // type:function size:0x10 -fn_47_19F8 = .text:0x000019F8; // type:function size:0x10 -fn_47_1A08 = .text:0x00001A08; // type:function size:0xC -fn_47_1A14 = .text:0x00001A14; // type:function size:0x8 -fn_47_1A1C = .text:0x00001A1C; // type:function size:0x4 -fn_47_1A20 = .text:0x00001A20; // type:function size:0x8 -fn_47_1A28 = .text:0x00001A28; // type:function size:0x1C -fn_47_1A44 = .text:0x00001A44; // type:function size:0x8 -fn_47_1A4C = .text:0x00001A4C; // type:function size:0x8 -fn_47_1A54 = .text:0x00001A54; // type:function size:0x8 +create__9grMansionFiPCcPCc = .text:0x00001670; // type:function size:0xD8 scope:global +setMdlIndex__6GroundFi = .text:0x00001748; // type:function size:0x8 scope:weak +__ct__9grMansionFPCc = .text:0x00001750; // type:function size:0x64 +__dt__9grMansionFv = .text:0x000017B4; // type:function size:0x58 +create__15grMansionGroundFiPCcPCc = .text:0x0000180C; // type:function size:0xE8 scope:global +__dt__15grMansionGroundFv = .text:0x000018F4; // type:function size:0x5C scope:global +processAnim__15grMansionGroundFv = .text:0x00001950; // type:function size:0x80 scope:global +adventureEventGetItem__6GroundFiP13stTriggerData = .text:0x000019D0; // type:function size:0x8 scope:weak +getInitializeInfo__6GroundFi = .text:0x000019D8; // type:function size:0x8 scope:weak +setInitializeInfo__6GroundFi = .text:0x000019E0; // type:function size:0x4 scope:weak +setInitializeFlag__6GroundFv = .text:0x000019E4; // type:function size:0x4 scope:weak +disableCalcCollision__6GroundFv = .text:0x000019E8; // type:function size:0x10 scope:weak +enableCalcCollision__6GroundFv = .text:0x000019F8; // type:function size:0x10 scope:weak +isEnableCalcCollision__6GroundFv = .text:0x00001A08; // type:function size:0xC scope:weak +getMdlIndex__6GroundFv = .text:0x00001A14; // type:function size:0x8 scope:weak +initStageData__6GroundFv = .text:0x00001A1C; // type:function size:0x4 scope:weak +getStageData__6GroundFv = .text:0x00001A20; // type:function size:0x8 scope:weak +getModelCount__6GroundFv = .text:0x00001A28; // type:function size:0x1C scope:weak +getTransparencyFlag__9grGimmickFv = .text:0x00001A44; // type:function size:0x8 scope:weak +getGimmickData__9grGimmickFv = .text:0x00001A4C; // type:function size:0x8 scope:weak +setGimmickData__9grGimmickFPv = .text:0x00001A54; // type:function size:0x8 scope:weak fn_47_1A5C = .text:0x00001A5C; // type:function size:0xA8 fn_47_1B04 = .text:0x00001B04; // type:function size:0x118 fn_47_1C1C = .text:0x00001C1C; // type:function size:0xF0 @@ -410,22 +410,22 @@ fn_47_9980 = .text:0x00009980; // type:function size:0x8 fn_47_9988 = .text:0x00009988; // type:function size:0x8 fn_47_9990 = .text:0x00009990; // type:function size:0x8 fn_47_9998 = .text:0x00009998; // type:function size:0x8 -fn_47_99A0 = .text:0x000099A0; // type:function size:0xD4 -fn_47_9A74 = .text:0x00009A74; // type:function size:0x68 -fn_47_9ADC = .text:0x00009ADC; // type:function size:0x54 -fn_47_9B30 = .text:0x00009B30; // type:function size:0x88 -fn_47_9BB8 = .text:0x00009BB8; // type:function size:0x4 -fn_47_9BBC = .text:0x00009BBC; // type:function size:0x100 -fn_47_9CBC = .text:0x00009CBC; // type:function size:0x448 -fn_47_A104 = .text:0x0000A104; // type:function size:0xB0 -fn_47_A1B4 = .text:0x0000A1B4; // type:function size:0x58 -fn_47_A20C = .text:0x0000A20C; // type:function size:0x384 -fn_47_A590 = .text:0x0000A590; // type:function size:0xB0 -fn_47_A640 = .text:0x0000A640; // type:function size:0x58 -fn_47_A698 = .text:0x0000A698; // type:function size:0x3E0 -fn_47_AA78 = .text:0x0000AA78; // type:function size:0xB0 -fn_47_AB28 = .text:0x0000AB28; // type:function size:0x58 -fn_47_AB80 = .text:0x0000AB80; // type:function size:0x1D0 +__ct__13grMansionAreaFPCc = .text:0x000099A0; // type:function size:0xD4 +__dt__13grMansionAreaFv = .text:0x00009A74; // type:function size:0x68 +processAnim__13grMansionAreaFv = .text:0x00009ADC; // type:function size:0x54 +update__13grMansionAreaFf = .text:0x00009B30; // type:function size:0x88 +updateDestroy__13grMansionAreaFf = .text:0x00009BB8; // type:function size:0x4 +updateCallBack__13grMansionAreaFf = .text:0x00009BBC; // type:function size:0x100 +setMotion__13grMansionAreaFUlbbPf = .text:0x00009CBC; // type:function size:0x448 +create__15grMansionAreaUpFiPCcPCc = .text:0x0000A104; // type:function size:0xB0 scope:global +__dt__15grMansionAreaUpFv = .text:0x0000A1B4; // type:function size:0x58 scope:global +updateDestroy__15grMansionAreaUpFf = .text:0x0000A20C; // type:function size:0x384 scope:global +create__17grMansionAreaDownFiPCcPCc = .text:0x0000A590; // type:function size:0xB0 scope:global +__dt__17grMansionAreaDownFv = .text:0x0000A640; // type:function size:0x58 scope:global +updateDestroy__17grMansionAreaDownFf = .text:0x0000A698; // type:function size:0x3E0 scope:global +create__18grMansionAreaBreakFiPCcPCc = .text:0x0000AA78; // type:function size:0xB0 scope:global +__dt__18grMansionAreaBreakFv = .text:0x0000AB28; // type:function size:0x58 scope:global +updateDestroy__18grMansionAreaBreakFf = .text:0x0000AB80; // type:function size:0x1D0 scope:global fn_47_AD50 = .text:0x0000AD50; // type:function size:0xF8 fn_47_AE48 = .text:0x0000AE48; // type:function size:0x68 fn_47_AEB0 = .text:0x0000AEB0; // type:function size:0x74 @@ -452,7 +452,7 @@ __destroy_global_chain_reference = .dtors:0x00000000; // type:object size:0x4 sc __destroy_global_chain_reference = .dtors:0x00000004; // type:object size:0x4 scope:global lbl_47_rodata_0 = .rodata:0x00000000; // type:object size:0x4 data:float lbl_47_rodata_4 = .rodata:0x00000004; // type:object size:0x3C align:4 data:float -lbl_47_rodata_40 = .rodata:0x00000040; // type:object size:0x8 align:4 data:float +@10477 = .rodata:0x00000040; // type:object size:0x4 align:4 data:float scope:local lbl_47_rodata_48 = .rodata:0x00000048; // type:object size:0x4 align:4 data:float lbl_47_rodata_4C = .rodata:0x0000004C; // type:object size:0x14 align:4 data:float lbl_47_rodata_60 = .rodata:0x00000060; // type:object size:0x10 align:8 data:double @@ -463,9 +463,9 @@ lbl_47_rodata_A4 = .rodata:0x000000A4; // type:object size:0x4 align:4 data:floa lbl_47_rodata_A8 = .rodata:0x000000A8; // type:object size:0x4 align:4 data:float lbl_47_rodata_AC = .rodata:0x000000AC; // type:object size:0x4 lbl_47_rodata_B0 = .rodata:0x000000B0; // type:object size:0x8 align:8 data:double -lbl_47_rodata_B8 = .rodata:0x000000B8; // type:object size:0x18 align:4 data:float -lbl_47_rodata_D0 = .rodata:0x000000D0; // type:object size:0x18 align:4 data:float -lbl_47_rodata_E8 = .rodata:0x000000E8; // type:object size:0x8 align:4 data:float +@14482 = .rodata:0x000000B8; // type:object size:0x4 align:4 data:float scope:local +@14500 = .rodata:0x000000D0; // type:object size:0x4 align:4 data:float scope:local +@10543 = .rodata:0x000000E8; // type:object size:0x4 align:4 data:float scope:local lbl_47_rodata_F0 = .rodata:0x000000F0; // type:object size:0x4 align:4 data:float lbl_47_rodata_F4 = .rodata:0x000000F4; // type:object size:0xC align:4 data:float lbl_47_rodata_100 = .rodata:0x00000100; // type:object size:0x4 align:4 data:float @@ -498,32 +498,32 @@ lbl_47_data_5A0 = .data:0x000005A0; // type:object size:0x6 data:string lbl_47_data_5A8 = .data:0x000005A8; // type:object size:0x10 lbl_47_data_5B8 = .data:0x000005B8; // type:object size:0x8 lbl_47_data_5C0 = .data:0x000005C0; // type:object size:0x7 data:string -lbl_47_data_5C8 = .data:0x000005C8; // type:object size:0x8 +__RTTI__6gfTask = .data:0x000005C8; // type:object size:0x8 scope:weak lbl_47_data_5D0 = .data:0x000005D0; // type:object size:0x14 lbl_47_data_5E4 = .data:0x000005E4; // type:object size:0x1E data:string lbl_47_data_604 = .data:0x00000604; // type:object size:0xC lbl_47_data_610 = .data:0x00000610; // type:object size:0x8 lbl_47_data_618 = .data:0x00000618; // type:object size:0xC data:string lbl_47_data_628 = .data:0x00000628; // type:object size:0x8 -lbl_47_data_630 = .data:0x00000630; // type:object size:0xF data:string -lbl_47_data_640 = .data:0x00000640; // type:object size:0xF data:string -lbl_47_data_650 = .data:0x00000650; // type:object size:0x1D0 -lbl_47_data_820 = .data:0x00000820; // type:object size:0x10 data:string -lbl_47_data_830 = .data:0x00000830; // type:object size:0x30 -lbl_47_data_860 = .data:0x00000860; // type:object size:0x8 -lbl_47_data_868 = .data:0x00000868; // type:object size:0x1C8 -lbl_47_data_A30 = .data:0x00000A30; // type:object size:0xA data:string -lbl_47_data_A3C = .data:0x00000A3C; // type:object size:0x24 -lbl_47_data_A60 = .data:0x00000A60; // type:object size:0x8 -lbl_47_data_A68 = .data:0x00000A68; // type:object size:0xB data:string -lbl_47_data_A74 = .data:0x00000A74; // type:object size:0x1C -lbl_47_data_A90 = .data:0x00000A90; // type:object size:0x8 -lbl_47_data_A98 = .data:0x00000A98; // type:object size:0xA data:string -lbl_47_data_AA4 = .data:0x00000AA4; // type:object size:0x14 -lbl_47_data_AB8 = .data:0x00000AB8; // type:object size:0x8 -lbl_47_data_AC0 = .data:0x00000AC0; // type:object size:0x7 data:string -lbl_47_data_AC8 = .data:0x00000AC8; // type:object size:0x10 -lbl_47_data_AD8 = .data:0x00000AD8; // type:object size:0x8 +@10501 = .data:0x00000630; // type:object size:0xF data:string scope:local +@10502 = .data:0x00000640; // type:object size:0xF data:string scope:local +__vt__15grMansionGround = .data:0x00000650; // type:object size:0x1CC scope:global +@10195 = .data:0x00000820; // type:object size:0x10 data:string scope:local +@10196 = .data:0x00000830; // type:object size:0x2C scope:local +__RTTI__15grMansionGround = .data:0x00000860; // type:object size:0x8 scope:weak +__vt__9grMansion = .data:0x00000868; // type:object size:0x1C8 scope:global +@10197 = .data:0x00000A30; // type:object size:0xA data:string scope:local +@10198 = .data:0x00000A3C; // type:object size:0x24 scope:local +__RTTI__9grMansion = .data:0x00000A60; // type:object size:0x8 scope:weak +@10199 = .data:0x00000A68; // type:object size:0xB data:string scope:local +@10200 = .data:0x00000A74; // type:object size:0x1C scope:local +__RTTI__10grYakumono = .data:0x00000A90; // type:object size:0x8 scope:weak +@10201 = .data:0x00000A98; // type:object size:0xA data:string scope:local +@10202 = .data:0x00000AA4; // type:object size:0x14 scope:local +__RTTI__9grGimmick = .data:0x00000AB8; // type:object size:0x8 scope:weak +@10203 = .data:0x00000AC0; // type:object size:0x7 data:string scope:local +@10204 = .data:0x00000AC8; // type:object size:0xC scope:local +__RTTI__6Ground = .data:0x00000AD8; // type:object size:0x8 scope:weak lbl_47_data_AE0 = .data:0x00000AE0; // type:object size:0x15 data:string jumptable_47_data_AF8 = .data:0x00000AF8; // type:object size:0x1C scope:local lbl_47_data_B14 = .data:0x00000B14; // type:object size:0x10C @@ -701,21 +701,21 @@ lbl_47_data_2290 = .data:0x00002290; // type:object size:0x9 data:string lbl_47_data_22A0 = .data:0x000022A0; // type:object size:0x1F4 lbl_47_data_2494 = .data:0x00002494; // type:object size:0xE data:string lbl_47_data_24A4 = .data:0x000024A4; // type:object size:0x2C -lbl_47_data_24D0 = .data:0x000024D0; // type:object size:0x8 -jumptable_47_data_24D8 = .data:0x000024D8; // type:object size:0x1C scope:local -lbl_47_data_24F4 = .data:0x000024F4; // type:object size:0x1F4 -lbl_47_data_26E8 = .data:0x000026E8; // type:object size:0x10 data:string -lbl_47_data_26F8 = .data:0x000026F8; // type:object size:0x38 -lbl_47_data_2730 = .data:0x00002730; // type:object size:0x8 -jumptable_47_data_2738 = .data:0x00002738; // type:object size:0x1C scope:local -lbl_47_data_2754 = .data:0x00002754; // type:object size:0x1F4 -lbl_47_data_2948 = .data:0x00002948; // type:object size:0x12 data:string -lbl_47_data_295C = .data:0x0000295C; // type:object size:0x34 -lbl_47_data_2990 = .data:0x00002990; // type:object size:0x8 -lbl_47_data_2998 = .data:0x00002998; // type:object size:0x1F4 -lbl_47_data_2B8C = .data:0x00002B8C; // type:object size:0x13 data:string -lbl_47_data_2BA0 = .data:0x00002BA0; // type:object size:0x38 -lbl_47_data_2BD8 = .data:0x00002BD8; // type:object size:0x8 +__RTTI__13grMansionArea = .data:0x000024D0; // type:object size:0x8 scope:weak +@14488 = .data:0x000024D8; // type:object size:0x1C scope:local +__vt__15grMansionAreaUp = .data:0x000024F4; // type:object size:0x1F4 scope:global +@14163 = .data:0x000026E8; // type:object size:0x10 data:string scope:local +@14164 = .data:0x000026F8; // type:object size:0x34 scope:local +__RTTI__15grMansionAreaUp = .data:0x00002730; // type:object size:0x8 scope:weak +@14506 = .data:0x00002738; // type:object size:0x1C scope:local +__vt__17grMansionAreaDown = .data:0x00002754; // type:object size:0x1F4 scope:global +@14169 = .data:0x00002948; // type:object size:0x12 data:string scope:local +@14170 = .data:0x0000295C; // type:object size:0x34 scope:local +__RTTI__17grMansionAreaDown = .data:0x00002990; // type:object size:0x8 scope:weak +__vt__18grMansionAreaBreak = .data:0x00002998; // type:object size:0x1F4 scope:global +@10240 = .data:0x00002B8C; // type:object size:0x13 data:string scope:local +@10241 = .data:0x00002BA0; // type:object size:0x34 scope:local +__RTTI__18grMansionAreaBreak = .data:0x00002BD8; // type:object size:0x8 scope:weak lbl_47_data_2BE0 = .data:0x00002BE0; // type:object size:0x12 data:string lbl_47_data_2BF8 = .data:0x00002BF8; // type:object size:0x1E0 lbl_47_data_2DD8 = .data:0x00002DD8; // type:object size:0xF data:string @@ -743,3 +743,11 @@ lbl_47_bss_60 = .bss:0x00000060; // type:object size:0x8 data:byte lbl_47_bss_68 = .bss:0x00000068; // type:object size:0x68 data:4byte lbl_47_bss_D0 = .bss:0x000000D0; // type:object size:0x8 data:byte lbl_47_bss_D8 = .bss:0x000000D8; // type:object size:0x68 data:4byte +@14483 = .rodata:0x000000BC; // type:object size:0x4 scope:local +@14484 = .rodata:0x000000C0; // type:object size:0x4 scope:local +@14485 = .rodata:0x000000C4; // type:object size:0x4 scope:local +@14486 = .rodata:0x000000C8; // type:object size:0x4 scope:local +@14501 = .rodata:0x000000D4; // type:object size:0x4 scope:local +@14502 = .rodata:0x000000D8; // type:object size:0x4 scope:local +@14503 = .rodata:0x000000DC; // type:object size:0x4 scope:local +@14504 = .rodata:0x000000E0; // type:object size:0x4 scope:local diff --git a/config/RSBE01_02/symbols.txt b/config/RSBE01_02/symbols.txt index fedea1b01..f9ee6a891 100644 --- a/config/RSBE01_02/symbols.txt +++ b/config/RSBE01_02/symbols.txt @@ -4189,7 +4189,7 @@ fn_8009D468 = .text:0x8009D468; // type:function size:0xFC fn_8009D564 = .text:0x8009D564; // type:function size:0x1E0 fn_8009D744 = .text:0x8009D744; // type:function size:0x2D4 fn_8009DA18 = .text:0x8009DA18; // type:function size:0x178 -cmReqQuake__FiP5Vec3f = .text:0x8009DB90; // type:function size:0x1B0 +cmReqQuake__FQ27cmQuake9AmplitudeP5Vec3f = .text:0x8009DB90; // type:function size:0x1B0 cmRemoveQuake__Fi = .text:0x8009DD40; // type:function size:0x1A8 fn_8009DEE8 = .text:0x8009DEE8; // type:function size:0x1A8 fn_8009E090 = .text:0x8009E090; // type:function size:0x1AC diff --git a/configure.py b/configure.py index d44984a5b..a6e12ee89 100755 --- a/configure.py +++ b/configure.py @@ -1266,7 +1266,12 @@ def MatchingFor(*versions): "mw_version": config.linker_version, "cflags": cflags_rel, "host": False, - "objects": [], + "objects": [ + Object(Matching, "mo_stage/st_mansion/gr_mansion.cpp"), + Object(Matching, "mo_stage/st_mansion/gr_mansion_area_up.cpp"), + Object(Matching, "mo_stage/st_mansion/gr_mansion_area_down.cpp"), + Object(Matching, "mo_stage/st_mansion/gr_mansion_area_break.cpp"), + ], }, { "lib": "st_mariopast", diff --git a/include/st_mansion/gr_mansion.h b/include/st_mansion/gr_mansion.h new file mode 100644 index 000000000..3e5fdd4c2 --- /dev/null +++ b/include/st_mansion/gr_mansion.h @@ -0,0 +1,15 @@ +#pragma once + +#include + +class grMansion : public grYakumono { +protected: + u8 unk150; + float unk154; + +public: + static grMansion* create(int modelIndex, const char* nodeName, const char* taskName); + grMansion(const char* taskName); + virtual ~grMansion(); +}; +static_assert(sizeof(grMansion) == 0x158, "Class is wrong size!"); diff --git a/include/st_mansion/gr_mansion_area.h b/include/st_mansion/gr_mansion_area.h new file mode 100644 index 000000000..d032ff538 --- /dev/null +++ b/include/st_mansion/gr_mansion_area.h @@ -0,0 +1,40 @@ +#pragma once + +#include +#include + +#include + +class grMansionArea : public grMansion { +protected: + Vec3f* unk158; + u8* unk15C; + u8* unk160; + float* unk164; + float unk168; + u8 unk16C; + u8 unk16D; + u8 unk16E; + u32 unk170; + u8 unk174; + float unk178; + snd3DGenerator unk17C; + +public: + grMansionArea(const char* taskName); + virtual ~grMansionArea(); + virtual void processAnim(); + virtual void update(float deltaFrame); + virtual void updateDestroy(float deltaFrame); + virtual void updateCallBack(float deltaFrame); + virtual void setMotion(u32 index, bool loop, bool force, float* frameCount); + virtual void setPillarNode(u32 nodeIndex) { unk170 = nodeIndex; } + virtual void setPosWork(Vec3f* position) { unk158 = position; } + virtual void setStateWork(u8* state) { unk15C = state; } + virtual void setStateSubWork(u8* state) { unk160 = state; } + virtual void setScaleRateWork(float* rate) { unk164 = rate; } + virtual void setType(u8 type) { unk16D = type; } + virtual void setTypeLR(u8 type) { unk16E = type; } + virtual void setScaleRateFlg(u8 flag) { unk16C = flag; } +}; +static_assert(sizeof(grMansionArea) == 0x184, "Class is wrong size!"); diff --git a/include/st_mansion/gr_mansion_area_break.h b/include/st_mansion/gr_mansion_area_break.h new file mode 100644 index 000000000..b4fef9ffb --- /dev/null +++ b/include/st_mansion/gr_mansion_area_break.h @@ -0,0 +1,33 @@ +#pragma once + +#include + +class grMansionAreaBreak : public grMansionArea { +private: + enum State { // Name unknown + State_0 = 0, + State_2 = 2, + State_4 = 4 + }; + enum WorkState { // Name unknown + WorkState_0 = 0, + WorkState_2 = 2, + WorkState_3 = 3, + WorkState_4 = 4 + }; + enum Type { // Name unknown + Type_2 = 2, + Type_3 = 3 + }; + enum SubState { // Name unknown + SubState_1 = 1, + SubState_2 = 2, + SubState_3 = 3 + }; + +public: + static grMansionAreaBreak* create(int modelIndex, const char* nodeName, const char* taskName); + grMansionAreaBreak(const char* taskName) : grMansionArea(taskName) { } + virtual ~grMansionAreaBreak(); + virtual void updateDestroy(float deltaFrame); +}; diff --git a/include/st_mansion/gr_mansion_area_down.h b/include/st_mansion/gr_mansion_area_down.h new file mode 100644 index 000000000..863a89c2d --- /dev/null +++ b/include/st_mansion/gr_mansion_area_down.h @@ -0,0 +1,31 @@ +#pragma once + +#include + +class grMansionAreaDown : public grMansionArea { +private: + enum State { // Name unknown + State_0 = 0, + State_2 = 2, + State_3 = 3, + State_4 = 4, + State_5 = 5, + State_6 = 6 + }; + enum WorkState { // Name unknown + WorkState_0 = 0, + WorkState_1 = 1, + WorkState_2 = 2, + WorkState_4 = 4 + }; + enum TypeLR { // Name unknown + TypeLR_0 = 0, + TypeLR_1 = 1 + }; + +public: + static grMansionAreaDown* create(int modelIndex, const char* nodeName, const char* taskName); + grMansionAreaDown(const char* taskName) : grMansionArea(taskName) { } + virtual ~grMansionAreaDown(); + virtual void updateDestroy(float deltaFrame); +}; diff --git a/include/st_mansion/gr_mansion_area_up.h b/include/st_mansion/gr_mansion_area_up.h new file mode 100644 index 000000000..682d06335 --- /dev/null +++ b/include/st_mansion/gr_mansion_area_up.h @@ -0,0 +1,31 @@ +#pragma once + +#include + +class grMansionAreaUp : public grMansionArea { +private: + enum State { // Name unknown + State_0 = 0, + State_2 = 2, + State_3 = 3, + State_4 = 4, + State_5 = 5, + State_6 = 6 + }; + enum WorkState { // Name unknown + WorkState_0 = 0, + WorkState_1 = 1, + WorkState_2 = 2, + WorkState_4 = 4 + }; + enum TypeLR { // Name unknown + TypeLR_0 = 0, + TypeLR_1 = 1 + }; + +public: + static grMansionAreaUp* create(int modelIndex, const char* nodeName, const char* taskName); + grMansionAreaUp(const char* taskName) : grMansionArea(taskName) { } + virtual ~grMansionAreaUp(); + virtual void updateDestroy(float deltaFrame); +}; diff --git a/include/st_mansion/gr_mansion_ground.h b/include/st_mansion/gr_mansion_ground.h new file mode 100644 index 000000000..fa9d261d6 --- /dev/null +++ b/include/st_mansion/gr_mansion_ground.h @@ -0,0 +1,17 @@ +#pragma once + +#include +#include + +class grMansionGround : public grMansion { +private: + Vec3f* unk158; + +public: + static grMansionGround* create(int modelIndex, const char* nodeName, const char* taskName); + grMansionGround(const char* taskName) : grMansion(taskName), unk158(nullptr) { } + virtual ~grMansionGround(); + virtual void processAnim(); + virtual void setPosGimmickWork(Vec3f* positions) { unk158 = positions; } +}; +static_assert(sizeof(grMansionGround) == 0x15C, "Class is wrong size!"); diff --git a/src/mo_stage/st_mansion/gr_mansion.cpp b/src/mo_stage/st_mansion/gr_mansion.cpp new file mode 100644 index 000000000..12cd4cbcc --- /dev/null +++ b/src/mo_stage/st_mansion/gr_mansion.cpp @@ -0,0 +1,38 @@ +#include +#include + +#include + +grMansion* grMansion::create(int modelIndex, const char* nodeName, const char* taskName) { + grMansion* ground = new (Heaps::StageInstance) grMansion(taskName); + if (ground != nullptr) { + ground->setMdlIndex(modelIndex); + ground->setTgtNode(nodeName); + } + return ground; +} + +grMansion::grMansion(const char* taskName) : grYakumono(taskName), unk150(0), unk154(0.0f) { + setupMelee(); +} + +grMansion::~grMansion() { } + +grMansionGround* grMansionGround::create(int modelIndex, const char* nodeName, const char* taskName) { + grMansionGround* ground = new (Heaps::StageInstance) grMansionGround(taskName); + if (ground != nullptr) { + ground->setMdlIndex(modelIndex); + ground->setTgtNode(nodeName); + } + return ground; +} + +grMansionGround::~grMansionGround() { } + +void grMansionGround::processAnim() { + Ground::processAnim(); + if (unk158 != nullptr) { + getNodePosition(&unk158[0], 0, "FrontLocator_L"); + getNodePosition(&unk158[1], 0, "FrontLocator_R"); + } +} diff --git a/src/mo_stage/st_mansion/gr_mansion_area_break.cpp b/src/mo_stage/st_mansion/gr_mansion_area_break.cpp new file mode 100644 index 000000000..e43ab6271 --- /dev/null +++ b/src/mo_stage/st_mansion/gr_mansion_area_break.cpp @@ -0,0 +1,70 @@ +#include + +#include + +grMansionAreaBreak* grMansionAreaBreak::create(int modelIndex, const char* nodeName, const char* taskName) { + grMansionAreaBreak* ground = new (Heaps::StageInstance) grMansionAreaBreak(taskName); + if (ground != nullptr) { + ground->setMdlIndex(modelIndex); + ground->setTgtNode(nodeName); + } + return ground; +} + +grMansionAreaBreak::~grMansionAreaBreak() { } + +void grMansionAreaBreak::updateDestroy(float deltaFrame) { + unk154 -= deltaFrame; + if (unk154 < 0.0f) { + unk154 = 0.0f; + } + switch (unk150) { + case State_0: + setVisibility(false); + unk150 = State_2; + break; + case State_2: + if (*unk15C == WorkState_2) { + switch (unk16D) { + case Type_3: + setVisibility(false); + break; + case Type_2: + setVisibility(true); + break; + } + unk150 = State_4; + } + break; + case State_4: + if (*unk15C == WorkState_3) { + switch (unk16D) { + case Type_3: + setVisibility(true); + break; + case Type_2: + setVisibility(false); + break; + } + } else if (*unk15C == WorkState_2) { + switch (unk16D) { + case Type_2: + switch (*unk160) { + case SubState_1: + case SubState_2: + case SubState_3: + break; + default: + setMotionFrame(0.0f, 0); + break; + } + break; + } + } else if (*unk15C == WorkState_4) { + // The original explicitly leaves this state unchanged. + } else if (*unk15C == WorkState_0) { + unk150 = State_0; + } + break; + } +} diff --git a/src/mo_stage/st_mansion/gr_mansion_area_down.cpp b/src/mo_stage/st_mansion/gr_mansion_area_down.cpp new file mode 100644 index 000000000..869cfca5f --- /dev/null +++ b/src/mo_stage/st_mansion/gr_mansion_area_down.cpp @@ -0,0 +1,105 @@ +#include +#include +#include +#include +#include + +#include + +grMansionAreaDown* grMansionAreaDown::create(int modelIndex, const char* nodeName, const char* taskName) { + grMansionAreaDown* ground = new (Heaps::StageInstance) grMansionAreaDown(taskName); + if (ground != nullptr) { + ground->setMdlIndex(modelIndex); + ground->setTgtNode(nodeName); + } + return ground; +} + +grMansionAreaDown::~grMansionAreaDown() { } + +void grMansionAreaDown::updateDestroy(float deltaFrame) { + unk154 -= deltaFrame; + if (unk154 < 0.0f) { + unk154 = 0.0f; + } + switch (unk150) { + case State_0: + setMotion(0, false, true, &unk178); + setVisibility(true); + setEnableCollisionStatus(true); + unk150 = State_2; + break; + case State_2: + // The stage passes element 1 or 3 of its four-byte state buffer. + if (unk15C[-1] == WorkState_2) { + setMotionFrame(1.0f, 0); + } else { + setMotionFrame(0.0f, 0); + } + if (*unk15C == WorkState_1) { + setEnableCollisionStatus(false); + unk150 = State_3; + unk154 = 10.0f; + } + break; + case State_3: + if (unk15C[-1] == WorkState_2) { + setMotionFrame(1.0f, 0); + } else { + setMotionFrame(0.0f, 0); + } + if (unk154 == 0.0f) { + // Stage setup sets TypeLR to 0 or 1 before updates begin. + u32 effect; + switch (unk16E) { + case TypeLR_0: + effect = g_ecMgr->setEffect(ef_ptc_stg_mansion_ldcrash); + break; + case TypeLR_1: + effect = g_ecMgr->setEffect(ef_ptc_stg_mansion_rdcrash); + break; + } + g_ecMgr->setParent(effect, m_sceneModels[0], static_cast(unk170), true); + float random = randf(); + if (random < 1.0f / 3.0f) { + unk17C.playSE(snd_se_stage_Mansion_01, 0, 0, -1); + } else if (random < 2.0f / 3.0f) { + unk17C.playSE(snd_se_stage_Mansion_02, 0, 0, -1); + } else { + unk17C.playSE(snd_se_stage_Mansion_03, 0, 0, -1); + } + Vec3f offset(0.0f, 0.0f, 0.0f); + cmReqQuake(cmQuake::Amplitude_L, &offset); + unk150 = State_4; + } + break; + case State_4: + unk178 -= deltaFrame; + if (unk178 < 0.0f) { + unk178 = 0.0f; + } + if (unk178 == 0.0f) { + Vec3f offset(0.0f, 0.0f, 0.0f); + cmReqQuake(cmQuake::Amplitude_XL, &offset); + setVisibility(false); + *unk15C = WorkState_2; + g_sndSystem->playSE(snd_se_stage_Mansion_break_finish, 0, 0, 0, -1); + unk150 = State_5; + } + break; + case State_5: + if (*unk15C == WorkState_4) { + setMotion(0, false, true, &unk178); + setVisibility(true); + setEnableCollisionStatus(true); + unk150 = State_6; + } + break; + case State_6: + setMotionFrame(0.0f, 0); + if (*unk15C == WorkState_0) { + unk150 = State_0; + } + break; + } +} diff --git a/src/mo_stage/st_mansion/gr_mansion_area_up.cpp b/src/mo_stage/st_mansion/gr_mansion_area_up.cpp new file mode 100644 index 000000000..6d49f2c8e --- /dev/null +++ b/src/mo_stage/st_mansion/gr_mansion_area_up.cpp @@ -0,0 +1,96 @@ +#include +#include +#include +#include +#include + +#include + +grMansionAreaUp* grMansionAreaUp::create(int modelIndex, const char* nodeName, const char* taskName) { + grMansionAreaUp* ground = new (Heaps::StageInstance) grMansionAreaUp(taskName); + if (ground != nullptr) { + ground->setMdlIndex(modelIndex); + ground->setTgtNode(nodeName); + } + return ground; +} + +grMansionAreaUp::~grMansionAreaUp() { } + +void grMansionAreaUp::updateDestroy(float deltaFrame) { + unk154 -= deltaFrame; + if (unk154 < 0.0f) { + unk154 = 0.0f; + } + switch (unk150) { + case State_0: + setMotion(0, false, true, &unk178); + setVisibility(true); + setEnableCollisionStatus(true); + unk150 = State_2; + break; + case State_2: + setMotionFrame(0.0f, 0); + if (*unk15C == WorkState_1) { + setEnableCollisionStatus(false); + unk150 = State_3; + unk154 = 10.0f; + } + break; + case State_3: + setMotionFrame(0.0f, 0); + if (unk154 == 0.0f) { + // Stage setup sets TypeLR to 0 or 1 before updates begin. + u32 effect; + switch (unk16E) { + case TypeLR_0: + effect = g_ecMgr->setEffect(ef_ptc_stg_mansion_lucrash); + break; + case TypeLR_1: + effect = g_ecMgr->setEffect(ef_ptc_stg_mansion_rucrash); + break; + } + g_ecMgr->setParent(effect, m_sceneModels[0], static_cast(unk170), true); + float random = randf(); + if (random < 1.0f / 3.0f) { + unk17C.playSE(snd_se_stage_Mansion_04, 0, 0, -1); + } else if (random < 2.0f / 3.0f) { + unk17C.playSE(snd_se_stage_Mansion_05, 0, 0, -1); + } else { + unk17C.playSE(snd_se_stage_Mansion_06, 0, 0, -1); + } + Vec3f offset(0.0f, 0.0f, 0.0f); + cmReqQuake(cmQuake::Amplitude_L, &offset); + unk150 = State_4; + } + break; + case State_4: + unk178 -= deltaFrame; + if (unk178 < 0.0f) { + unk178 = 0.0f; + } + if (unk178 == 0.0f) { + Vec3f offset(0.0f, 1.0f, 0.0f); + cmReqQuake(cmQuake::Amplitude_L, &offset); + setVisibility(false); + *unk15C = WorkState_2; + g_sndSystem->playSE(snd_se_stage_Mansion_break_finish, 0, 0, 0, -1); + unk150 = State_5; + } + break; + case State_5: + if (*unk15C == WorkState_4) { + setMotion(0, false, true, &unk178); + setVisibility(true); + setEnableCollisionStatus(true); + unk150 = State_6; + } + break; + case State_6: + setMotionFrame(0.0f, 0); + if (*unk15C == WorkState_0) { + unk150 = State_0; + } + break; + } +}