From 707c9df576847660fd884b762db9c223e4337941 Mon Sep 17 00:00:00 2001 From: MarioFan64 Date: Tue, 2 Sep 2025 18:27:45 -0500 Subject: [PATCH 1/2] link st_config and st_final --- config/RSBE01_02/config.yml | 4 +- config/RSBE01_02/rels/st_config/splits.txt | 11 ++ config/RSBE01_02/rels/st_config/symbols.txt | 128 ++++++++++---------- config/RSBE01_02/rels/st_final/splits.txt | 12 ++ config/RSBE01_02/rels/st_final/symbols.txt | 126 +++++++++---------- configure.py | 10 +- include/st_config/gr_config.h | 11 ++ include/st_config/st_config.h | 43 +++++++ include/st_final/gr_final.h | 33 +++++ include/st_final/st_final.h | 47 +++++++ src/mo_stage/st_config/gr_config.cpp | 26 ++++ src/mo_stage/st_config/st_config.cpp | 56 +++++++++ src/mo_stage/st_final/gr_final.cpp | 72 +++++++++++ src/mo_stage/st_final/st_final.cpp | 85 +++++++++++++ 14 files changed, 533 insertions(+), 131 deletions(-) create mode 100644 include/st_config/gr_config.h create mode 100644 include/st_config/st_config.h create mode 100644 include/st_final/gr_final.h create mode 100644 include/st_final/st_final.h create mode 100644 src/mo_stage/st_config/gr_config.cpp create mode 100644 src/mo_stage/st_config/st_config.cpp create mode 100644 src/mo_stage/st_final/gr_final.cpp create mode 100644 src/mo_stage/st_final/st_final.cpp diff --git a/config/RSBE01_02/config.yml b/config/RSBE01_02/config.yml index 05d7f5e..8fb1530 100644 --- a/config/RSBE01_02/config.yml +++ b/config/RSBE01_02/config.yml @@ -231,12 +231,12 @@ modules: hash: 06c4022b10b50735dfd29f768f19b9a8d122c85e splits: config/RSBE01_02/rels/st_config/splits.txt symbols: config/RSBE01_02/rels/st_config/symbols.txt - force_active: [HomeBtnIcon] + force_active: [create__8stConfigFv, HomeBtnIcon] - object: files/module/st_final.rel hash: 06ddc8f1c6e28cec63304ab53c4da979a1f362cc splits: config/RSBE01_02/rels/st_final/splits.txt symbols: config/RSBE01_02/rels/st_final/symbols.txt - force_active: [HomeBtnIcon] + force_active: [create__7stFinalFv, HomeBtnIcon] - object: files/module/st_dolpic.rel hash: b1ac03ca812bf92ae4ff1cefdbce698ffd7e6bce splits: config/RSBE01_02/rels/st_dolpic/splits.txt diff --git a/config/RSBE01_02/rels/st_config/splits.txt b/config/RSBE01_02/rels/st_config/splits.txt index f50d131..5d61a44 100644 --- a/config/RSBE01_02/rels/st_config/splits.txt +++ b/config/RSBE01_02/rels/st_config/splits.txt @@ -11,6 +11,17 @@ global_destructor_chain.c: .dtors start:0x00000000 end:0x00000008 .bss start:0x00000000 end:0x00000004 +mo_stage/st_config/st_config.cpp: + .text start:0x00000070 end:0x000004E4 + .ctors start:0x00000000 end:0x00000004 + .rodata start:0x00000000 end:0x00000008 + .data start:0x00000000 end:0x00000368 + .bss start:0x00000008 end:0x00000018 + +mo_stage/st_config/gr_config.cpp: + .text start:0x000004E4 end:0x0000069C + .data start:0x00000368 end:0x000005E0 + mo_stage/mo_stage.cpp: .text start:0x0000069C end:0x00000738 .data start:0x000005E0 end:0x000005ED diff --git a/config/RSBE01_02/rels/st_config/symbols.txt b/config/RSBE01_02/rels/st_config/symbols.txt index 868fce5..5988b89 100644 --- a/config/RSBE01_02/rels/st_config/symbols.txt +++ b/config/RSBE01_02/rels/st_config/symbols.txt @@ -1,61 +1,61 @@ __register_global_object = .text:0x00000000; // type:function size:0x1C scope:global __destroy_global_chain = .text:0x0000001C; // type:function size:0x54 scope:global -fn_44_70 = .text:0x00000070; // type:function size:0x5C -fn_44_CC = .text:0x000000CC; // type:function size:0x6C -fn_44_138 = .text:0x00000138; // type:function size:0x8 -fn_44_140 = .text:0x00000140; // type:function size:0x158 -fn_44_298 = .text:0x00000298; // type:function size:0x4 -fn_44_29C = .text:0x0000029C; // type:function size:0x8 -fn_44_2A4 = .text:0x000002A4; // type:function size:0x8 -fn_44_2AC = .text:0x000002AC; // type:function size:0x8 -fn_44_2B4 = .text:0x000002B4; // type:function size:0x8 -fn_44_2BC = .text:0x000002BC; // type:function size:0x8 -fn_44_2C4 = .text:0x000002C4; // type:function size:0x4 -fn_44_2C8 = .text:0x000002C8; // type:function size:0x8 -fn_44_2D0 = .text:0x000002D0; // type:function size:0x8 -fn_44_2D8 = .text:0x000002D8; // type:function size:0x8 -fn_44_2E0 = .text:0x000002E0; // type:function size:0xC -fn_44_2EC = .text:0x000002EC; // type:function size:0xC -fn_44_2F8 = .text:0x000002F8; // type:function size:0x10 -fn_44_308 = .text:0x00000308; // type:function size:0x14 -fn_44_31C = .text:0x0000031C; // type:function size:0x8 -fn_44_324 = .text:0x00000324; // type:function size:0x8 -fn_44_32C = .text:0x0000032C; // type:function size:0x8 -fn_44_334 = .text:0x00000334; // type:function size:0x8 -fn_44_33C = .text:0x0000033C; // type:function size:0x8 -fn_44_344 = .text:0x00000344; // type:function size:0x4 -fn_44_348 = .text:0x00000348; // type:function size:0x1C -fn_44_364 = .text:0x00000364; // type:function size:0x8 -fn_44_36C = .text:0x0000036C; // type:function size:0x8 -fn_44_374 = .text:0x00000374; // type:function size:0x8 -fn_44_37C = .text:0x0000037C; // type:function size:0x8 -fn_44_384 = .text:0x00000384; // type:function size:0xC -fn_44_390 = .text:0x00000390; // type:function size:0x4 -fn_44_394 = .text:0x00000394; // type:function size:0x8 -fn_44_39C = .text:0x0000039C; // type:function size:0x8 -fn_44_3A4 = .text:0x000003A4; // type:function size:0x8 -fn_44_3AC = .text:0x000003AC; // type:function size:0x64 -fn_44_410 = .text:0x00000410; // type:function size:0x74 -fn_44_484 = .text:0x00000484; // type:function size:0x5C -fn_44_4E0 = .text:0x000004E0; // type:function size:0x4 -fn_44_4E4 = .text:0x000004E4; // type:function size:0xC4 -fn_44_5A8 = .text:0x000005A8; // type:function size:0x8 -fn_44_5B0 = .text:0x000005B0; // type:function size:0x58 -fn_44_608 = .text:0x00000608; // type:function size:0x8 -fn_44_610 = .text:0x00000610; // type:function size:0x8 -fn_44_618 = .text:0x00000618; // type:function size:0x4 -fn_44_61C = .text:0x0000061C; // type:function size:0x4 -fn_44_620 = .text:0x00000620; // type:function size:0x10 -fn_44_630 = .text:0x00000630; // type:function size:0x10 -fn_44_640 = .text:0x00000640; // type:function size:0xC -fn_44_64C = .text:0x0000064C; // type:function size:0x8 -fn_44_654 = .text:0x00000654; // type:function size:0x4 -fn_44_658 = .text:0x00000658; // type:function size:0x8 -fn_44_660 = .text:0x00000660; // type:function size:0x8 -fn_44_668 = .text:0x00000668; // type:function size:0x1C -fn_44_684 = .text:0x00000684; // type:function size:0x8 -fn_44_68C = .text:0x0000068C; // type:function size:0x8 -fn_44_694 = .text:0x00000694; // type:function size:0x8 +create__8stConfigFv = .text:0x00000070; // type:function size:0x5C +__dt__8stConfigFv = .text:0x000000CC; // type:function size:0x6C +loading__8stConfigFv = .text:0x00000138; // type:function size:0x8 +createObj__8stConfigFv = .text:0x00000140; // type:function size:0x158 +startFighterEvent__5StageFv = .text:0x00000298; // type:function size:0x4 +initializeFighterAttackRatio__5StageFv = .text:0x0000029C; // type:function size:0x8 +helperStarWarp__5StageFv = .text:0x000002A4; // type:function size:0x8 +isSimpleBossBattleMode__5StageFv = .text:0x000002AC; // type:function size:0x8 +isBossBattleMode__5StageFv = .text:0x000002B4; // type:function size:0x8 +isCameraLocked__5StageFv = .text:0x000002BC; // type:function size:0x8 +notifyTimmingGameStart__5StageFv = .text:0x000002C4; // type:function size:0x4 +getFrameRuleTime__5StageFv = .text:0x000002C8; // type:function size:0x8 +setFrameRuleTime__5StageFf = .text:0x000002D0; // type:function size:0x8 +isNextStepBgmEqualNowStepBgmFromFlag__5StageFv = .text:0x000002D8; // type:function size:0x8 +getBgmPlayOffsetFrame__5StageFv = .text:0x000002E0; // type:function size:0xC +getBgmVolume__5StageFv = .text:0x000002EC; // type:function size:0xC +setBgmChange__5StageFfbUl = .text:0x000002F8; // type:function size:0x10 +getBgmChangeID__5StageFPUlPf = .text:0x00000308; // type:function size:0x14 +isBgmChange__5StageFv = .text:0x0000031C; // type:function size:0x8 +getBgmOptionID__5StageFv = .text:0x00000324; // type:function size:0x8 +getNowStepBgmID__5StageFv = .text:0x0000032C; // type:function size:0x8 +getBgmID__5StageFv = .text:0x00000334; // type:function size:0x8 +getBgmID__5StageCFv = .text:0x0000033C; // type:function size:0x8 +appearanceFighterLocal__5StageFv = .text:0x00000344; // type:function size:0x4 +getScrollDir__5StageFP5Vec3f = .text:0x00000348; // type:function size:0x1C +getDefaultLightSetIndex__5StageFv = .text:0x00000364; // type:function size:0x8 +getAIRange__5StageFv = .text:0x0000036C; // type:function size:0x8 +isAdventureStage__5StageFv = .text:0x00000374; // type:function size:0x8 +getPokeTrainerDrawLayer__5StageFv = .text:0x0000037C; // type:function size:0x8 +getPokeTrainerPositionZ__5StageFv = .text:0x00000384; // type:function size:0xC +getPokeTrainerPointData__5StageFPii = .text:0x00000390; // type:function size:0x4 +getPokeTrainerPointNum__5StageFv = .text:0x00000394; // type:function size:0x8 +getWind2ndOnlyData__7stMeleeFv = .text:0x0000039C; // type:function size:0x8 +isReStartSamePoint__8stConfigFv = .text:0x000003A4; // type:function size:0x8 +__sinit_\st_config_cpp = .text:0x000003AC; // type:function size:0x64 +__dt__29stClassInfoImpl<38,8stConfig>Fv = .text:0x00000410; // type:function size:0x74 +create__29stClassInfoImpl<38,8stConfig>Fv = .text:0x00000484; // type:function size:0x5C +preload__29stClassInfoImpl<38,8stConfig>Fv = .text:0x000004E0; // type:function size:0x4 +create__8grConfigFiPCcPCc = .text:0x000004E4; // type:function size:0xC4 +setMdlIndex__6GroundFi = .text:0x000005A8; // type:function size:0x8 +__dt__8grConfigFv = .text:0x000005B0; // type:function size:0x58 +adventureEventGetItem__6GroundFiP13stTriggerData = .text:0x00000608; // type:function size:0x8 +getInitializeInfo__6GroundFi = .text:0x00000610; // type:function size:0x8 +setInitializeInfo__6GroundFi = .text:0x00000618; // type:function size:0x4 +setInitializeFlag__6GroundFv = .text:0x0000061C; // type:function size:0x4 +disableCalcCollision__6GroundFv = .text:0x00000620; // type:function size:0x10 +enableCalcCollision__6GroundFv = .text:0x00000630; // type:function size:0x10 +isEnableCalcCollision__6GroundFv = .text:0x00000640; // type:function size:0xC +getMdlIndex__6GroundFv = .text:0x0000064C; // type:function size:0x8 +initStageData__6GroundFv = .text:0x00000654; // type:function size:0x4 +getStageData__6GroundFv = .text:0x00000658; // type:function size:0x8 +setStageData__6GroundFPv = .text:0x00000660; // type:function size:0x8 +getModelCount__6GroundFv = .text:0x00000668; // type:function size:0x1C +getTransparencyFlag__9grGimmickFv = .text:0x00000684; // type:function size:0x8 +getGimmickData__9grGimmickFv = .text:0x0000068C; // type:function size:0x8 +setGimmickData__9grGimmickFPv = .text:0x00000694; // type:function size:0x8 _prolog = .text:0x0000069C; // type:function size:0x48 scope:global _epilog = .text:0x000006E4; // type:function size:0x48 scope:global _unresolved = .text:0x0000072C; // type:function size:0xC scope:global @@ -65,13 +65,13 @@ __destroy_global_chain_reference = .dtors:0x00000000; // type:object size:0x4 sc __destroy_global_chain_reference = .dtors:0x00000004; // type:object size:0x4 scope:global lbl_44_rodata_0 = .rodata:0x00000000; // type:object size:0x4 data:float lbl_44_rodata_4 = .rodata:0x00000004; // type:object size:0x4 align:4 data:float -lbl_44_data_0 = .data:0x00000000; // type:object size:0xC -lbl_44_data_C = .data:0x0000000C; // type:object size:0x4 -lbl_44_data_10 = .data:0x00000010; // type:object size:0x10 -lbl_44_data_20 = .data:0x00000020; // type:object size:0x21C -lbl_44_data_23C = .data:0x0000023C; // type:object size:0xC -lbl_44_data_248 = .data:0x00000248; // type:object size:0x28 -lbl_44_data_270 = .data:0x00000270; // type:object size:0x8 +lbl_44_data_0 = .data:0x00000000; // type:object size:0x9 data:string +lbl_44_data_C = .data:0x0000000C; // type:object size:0x1 +lbl_44_data_10 = .data:0x00000010; // type:object size:0xF data:string +__vt__8stConfig = .data:0x00000020; // type:object size:0x21C +lbl_44_data_23C = .data:0x0000023C; // type:object size:0x9 data:string +lbl_44_data_248 = .data:0x00000248; // type:object size:0x24 +__RTTI__8stConfig = .data:0x00000270; // type:object size:0x8 lbl_44_data_278 = .data:0x00000278; // type:object size:0x8 data:string lbl_44_data_280 = .data:0x00000280; // type:object size:0x20 lbl_44_data_2A0 = .data:0x000002A0; // type:object size:0x8 @@ -82,7 +82,7 @@ lbl_44_data_2D8 = .data:0x000002D8; // type:object size:0x8 lbl_44_data_2E0 = .data:0x000002E0; // type:object size:0x10 lbl_44_data_2F0 = .data:0x000002F0; // type:object size:0x8 lbl_44_data_2F8 = .data:0x000002F8; // type:object size:0x8 -lbl_44_data_300 = .data:0x00000300; // type:object size:0x8 +__RTTI__6gfTask = .data:0x00000300; // type:object size:0x8 lbl_44_data_308 = .data:0x00000308; // type:object size:0x14 lbl_44_data_31C = .data:0x0000031C; // type:object size:0x20 lbl_44_data_33C = .data:0x0000033C; // type:object size:0xC diff --git a/config/RSBE01_02/rels/st_final/splits.txt b/config/RSBE01_02/rels/st_final/splits.txt index b5d26a9..05a73ab 100644 --- a/config/RSBE01_02/rels/st_final/splits.txt +++ b/config/RSBE01_02/rels/st_final/splits.txt @@ -11,6 +11,18 @@ global_destructor_chain.c: .dtors start:0x00000000 end:0x00000008 .bss start:0x00000000 end:0x00000004 +mo_stage/st_final/st_final.cpp: + .text start:0x00000070 end:0x00000604 + .ctors start:0x00000000 end:0x00000004 + .rodata start:0x00000000 end:0x00000008 + .data start:0x00000000 end:0x00000380 + .bss start:0x00000008 end:0x00000018 + +mo_stage/st_final/gr_final.cpp: + .text start:0x00000604 end:0x000009E4 + .rodata start:0x00000008 end:0x00000014 + .data start:0x00000380 end:0x00000610 + mo_stage/mo_stage.cpp: .text start:0x000009E4 end:0x00000A80 .data start:0x00000610 end:0x0000061D diff --git a/config/RSBE01_02/rels/st_final/symbols.txt b/config/RSBE01_02/rels/st_final/symbols.txt index 5d9ae77..a729a37 100644 --- a/config/RSBE01_02/rels/st_final/symbols.txt +++ b/config/RSBE01_02/rels/st_final/symbols.txt @@ -1,67 +1,67 @@ __register_global_object = .text:0x00000000; // type:function size:0x1C scope:global __destroy_global_chain = .text:0x0000001C; // type:function size:0x54 scope:global -fn_45_70 = .text:0x00000070; // type:function size:0x5C -fn_45_CC = .text:0x000000CC; // type:function size:0x6C -fn_45_138 = .text:0x00000138; // type:function size:0x8 -fn_45_140 = .text:0x00000140; // type:function size:0x250 -fn_45_390 = .text:0x00000390; // type:function size:0x8 -fn_45_398 = .text:0x00000398; // type:function size:0x8 -fn_45_3A0 = .text:0x000003A0; // type:function size:0x4 -fn_45_3A4 = .text:0x000003A4; // type:function size:0x4 -fn_45_3A8 = .text:0x000003A8; // type:function size:0x8 -fn_45_3B0 = .text:0x000003B0; // type:function size:0x8 -fn_45_3B8 = .text:0x000003B8; // type:function size:0x8 -fn_45_3C0 = .text:0x000003C0; // type:function size:0x8 -fn_45_3C8 = .text:0x000003C8; // type:function size:0x8 -fn_45_3D0 = .text:0x000003D0; // type:function size:0x4 -fn_45_3D4 = .text:0x000003D4; // type:function size:0x8 -fn_45_3DC = .text:0x000003DC; // type:function size:0x8 -fn_45_3E4 = .text:0x000003E4; // type:function size:0x8 -fn_45_3EC = .text:0x000003EC; // type:function size:0xC -fn_45_3F8 = .text:0x000003F8; // type:function size:0xC -fn_45_404 = .text:0x00000404; // type:function size:0x10 -fn_45_414 = .text:0x00000414; // type:function size:0x14 -fn_45_428 = .text:0x00000428; // type:function size:0x8 -fn_45_430 = .text:0x00000430; // type:function size:0x8 -fn_45_438 = .text:0x00000438; // type:function size:0x8 -fn_45_440 = .text:0x00000440; // type:function size:0x8 -fn_45_448 = .text:0x00000448; // type:function size:0x8 -fn_45_450 = .text:0x00000450; // type:function size:0x4 -fn_45_454 = .text:0x00000454; // type:function size:0x1C -fn_45_470 = .text:0x00000470; // type:function size:0x8 -fn_45_478 = .text:0x00000478; // type:function size:0x8 -fn_45_480 = .text:0x00000480; // type:function size:0x8 -fn_45_488 = .text:0x00000488; // type:function size:0x8 -fn_45_490 = .text:0x00000490; // type:function size:0xC -fn_45_49C = .text:0x0000049C; // type:function size:0x4 -fn_45_4A0 = .text:0x000004A0; // type:function size:0x8 -fn_45_4A8 = .text:0x000004A8; // type:function size:0x8 -fn_45_4B0 = .text:0x000004B0; // type:function size:0x8 -fn_45_4B8 = .text:0x000004B8; // type:function size:0x8 -fn_45_4C0 = .text:0x000004C0; // type:function size:0xC -fn_45_4CC = .text:0x000004CC; // type:function size:0x64 -fn_45_530 = .text:0x00000530; // type:function size:0x74 -fn_45_5A4 = .text:0x000005A4; // type:function size:0x5C -fn_45_600 = .text:0x00000600; // type:function size:0x4 -fn_45_604 = .text:0x00000604; // type:function size:0xE0 -fn_45_6E4 = .text:0x000006E4; // type:function size:0x8 -fn_45_6EC = .text:0x000006EC; // type:function size:0x58 -fn_45_744 = .text:0x00000744; // type:function size:0x10 -fn_45_754 = .text:0x00000754; // type:function size:0x204 -fn_45_958 = .text:0x00000958; // type:function size:0x8 -fn_45_960 = .text:0x00000960; // type:function size:0x8 -fn_45_968 = .text:0x00000968; // type:function size:0x4 -fn_45_96C = .text:0x0000096C; // type:function size:0x4 -fn_45_970 = .text:0x00000970; // type:function size:0x10 -fn_45_980 = .text:0x00000980; // type:function size:0x10 -fn_45_990 = .text:0x00000990; // type:function size:0xC -fn_45_99C = .text:0x0000099C; // type:function size:0x8 -fn_45_9A4 = .text:0x000009A4; // type:function size:0x4 -fn_45_9A8 = .text:0x000009A8; // type:function size:0x8 -fn_45_9B0 = .text:0x000009B0; // type:function size:0x1C -fn_45_9CC = .text:0x000009CC; // type:function size:0x8 -fn_45_9D4 = .text:0x000009D4; // type:function size:0x8 -fn_45_9DC = .text:0x000009DC; // type:function size:0x8 +create__7stFinalFv = .text:0x00000070; // type:function size:0x5C +__dt__7stFinalFv = .text:0x000000CC; // type:function size:0x6C +loading__7stFinalFv = .text:0x00000138; // type:function size:0x8 +createObj__7stFinalFv = .text:0x00000140; // type:function size:0x250 +setStageData__6GroundFPv = .text:0x00000390; // type:function size:0x8 +setType__7grFinalFi = .text:0x00000398; // type:function size:0x8 +update__7stFinalFf = .text:0x000003A0; // type:function size:0x4 +startFighterEvent__5StageFv = .text:0x000003A4; // type:function size:0x4 +initializeFighterAttackRatio__5StageFv = .text:0x000003A8; // type:function size:0x8 +helperStarWarp__5StageFv = .text:0x000003B0; // type:function size:0x8 +isSimpleBossBattleMode__5StageFv = .text:0x000003B8; // type:function size:0x8 +isBossBattleMode__5StageFv = .text:0x000003C0; // type:function size:0x8 +isCameraLocked__5StageFv = .text:0x000003C8; // type:function size:0x8 +notifyTimmingGameStart__5StageFv = .text:0x000003D0; // type:function size:0x4 +getFrameRuleTime__5StageFv = .text:0x000003D4; // type:function size:0x8 +setFrameRuleTime__5StageFf = .text:0x000003DC; // type:function size:0x8 +isNextStepBgmEqualNowStepBgmFromFlag__5StageFv = .text:0x000003E4; // type:function size:0x8 +getBgmPlayOffsetFrame__5StageFv = .text:0x000003EC; // type:function size:0xC +getBgmVolume__5StageFv = .text:0x000003F8; // type:function size:0xC +setBgmChange__5StageFfbUl = .text:0x00000404; // type:function size:0x10 +getBgmChangeID__5StageFPUlPf = .text:0x00000414; // type:function size:0x14 +isBgmChange__5StageFv = .text:0x00000428; // type:function size:0x8 +getBgmOptionID__5StageFv = .text:0x00000430; // type:function size:0x8 +getNowStepBgmID__5StageFv = .text:0x00000438; // type:function size:0x8 +getBgmID__5StageFv = .text:0x00000440; // type:function size:0x8 +getBgmID__5StageCFv = .text:0x00000448; // type:function size:0x8 +appearanceFighterLocal__5StageFv = .text:0x00000450; // type:function size:0x4 +getScrollDir__5StageFP5Vec3f = .text:0x00000454; // type:function size:0x1C +getDefaultLightSetIndex__5StageFv = .text:0x00000470; // type:function size:0x8 +getAIRange__5StageFv = .text:0x00000478; // type:function size:0x8 +isAdventureStage__5StageFv = .text:0x00000480; // type:function size:0x8 +getPokeTrainerDrawLayer__5StageFv = .text:0x00000488; // type:function size:0x8 +getPokeTrainerPositionZ__5StageFv = .text:0x00000490; // type:function size:0xC +getPokeTrainerPointData__5StageFPii = .text:0x0000049C; // type:function size:0x4 +getPokeTrainerPointNum__5StageFv = .text:0x000004A0; // type:function size:0x8 +isReStartSamePoint__7stMeleeFv = .text:0x000004A8; // type:function size:0x8 +getWind2ndOnlyData__7stMeleeFv = .text:0x000004B0; // type:function size:0x8 +isBamperVector__7stFinalFv = .text:0x000004B8; // type:function size:0x8 +getFinalTechniqColor__7stFinalFv = .text:0x000004C0; // type:function size:0xC +__sinit_\st_final_cpp = .text:0x000004CC; // type:function size:0x64 +__dt__27stClassInfoImpl<2,7stFinal>Fv = .text:0x00000530; // type:function size:0x74 +create__27stClassInfoImpl<2,7stFinal>Fv = .text:0x000005A4; // type:function size:0x5C +preload__27stClassInfoImpl<2,7stFinal>Fv = .text:0x00000600; // type:function size:0x4 +create__7grFinalFiPCcPCc = .text:0x00000604; // type:function size:0xE0 +setMdlIndex__6GroundFi = .text:0x000006E4; // type:function size:0x8 +__dt__7grFinalFv = .text:0x000006EC; // type:function size:0x58 +update__7grFinalFf = .text:0x00000744; // type:function size:0x10 +updateEff__7grFinalFv = .text:0x00000754; // type:function size:0x204 +adventureEventGetItem__6GroundFiP13stTriggerData = .text:0x00000958; // type:function size:0x8 +getInitializeInfo__6GroundFi = .text:0x00000960; // type:function size:0x8 +setInitializeInfo__6GroundFi = .text:0x00000968; // type:function size:0x4 +setInitializeFlag__6GroundFv = .text:0x0000096C; // type:function size:0x4 +disableCalcCollision__6GroundFv = .text:0x00000970; // type:function size:0x10 +enableCalcCollision__6GroundFv = .text:0x00000980; // type:function size:0x10 +isEnableCalcCollision__6GroundFv = .text:0x00000990; // type:function size:0xC +getMdlIndex__6GroundFv = .text:0x0000099C; // type:function size:0x8 +initStageData__6GroundFv = .text:0x000009A4; // type:function size:0x4 +getStageData__6GroundFv = .text:0x000009A8; // type:function size:0x8 +getModelCount__6GroundFv = .text:0x000009B0; // type:function size:0x1C +getTransparencyFlag__9grGimmickFv = .text:0x000009CC; // type:function size:0x8 +getGimmickData__9grGimmickFv = .text:0x000009D4; // type:function size:0x8 +setGimmickData__9grGimmickFPv = .text:0x000009DC; // type:function size:0x8 _prolog = .text:0x000009E4; // type:function size:0x48 scope:global _epilog = .text:0x00000A2C; // type:function size:0x48 scope:global _unresolved = .text:0x00000A74; // type:function size:0xC scope:global @@ -87,7 +87,7 @@ lbl_45_data_2F0 = .data:0x000002F0; // type:object size:0x8 lbl_45_data_2F8 = .data:0x000002F8; // type:object size:0x10 lbl_45_data_308 = .data:0x00000308; // type:object size:0x8 lbl_45_data_310 = .data:0x00000310; // type:object size:0x8 -lbl_45_data_318 = .data:0x00000318; // type:object size:0x8 +__RTTI__6gfTask = .data:0x00000318; // type:object size:0x8 lbl_45_data_320 = .data:0x00000320; // type:object size:0x14 lbl_45_data_334 = .data:0x00000334; // type:object size:0x1C data:string lbl_45_data_350 = .data:0x00000350; // type:object size:0x10 diff --git a/configure.py b/configure.py index 6bf149d..6bc49fa 100755 --- a/configure.py +++ b/configure.py @@ -993,7 +993,10 @@ def MatchingFor(*versions): "mw_version": config.linker_version, "cflags": cflags_rel, "host": False, - "objects": [], + "objects": [ + Object(Matching, "mo_stage/st_config/st_config.cpp"), + Object(Matching, "mo_stage/st_config/gr_config.cpp"), + ], }, { "lib": "st_crayon", @@ -1127,7 +1130,10 @@ def MatchingFor(*versions): "mw_version": config.linker_version, "cflags": cflags_rel, "host": False, - "objects": [], + "objects": [ + Object(Matching, "mo_stage/st_final/st_final.cpp"), + Object(Matching, "mo_stage/st_final/gr_final.cpp"), + ], }, { "lib": "st_fzero", diff --git a/include/st_config/gr_config.h b/include/st_config/gr_config.h new file mode 100644 index 0000000..dffb0d4 --- /dev/null +++ b/include/st_config/gr_config.h @@ -0,0 +1,11 @@ +#pragma once + +#include +#include + +class grConfig : public grYakumono { + public: + grConfig(const char* taskName); + static grConfig* create(int mdlIndex, const char *tgtNodeName, const char *taskName); + virtual ~grConfig(); +}; \ No newline at end of file diff --git a/include/st_config/st_config.h b/include/st_config/st_config.h new file mode 100644 index 0000000..073dd2b --- /dev/null +++ b/include/st_config/st_config.h @@ -0,0 +1,43 @@ +#pragma once + +#include +#include +#include +#include +#include +#include + +template +class stClassInfoImpl : public stClassInfo { +public: + stClassInfoImpl() : stClassInfo() { + setClassInfo(Stages::Config, this); + }; + + virtual ~stClassInfoImpl() { + setClassInfo(Stages::Config, 0); + } + + virtual T* create() { + return T::create(); + } + + virtual void preload() { } +}; + +class stConfig : public stMelee { +// void* m_shrineStageData; + // TODO: float array? + + public: + stConfig(); + virtual ~stConfig(); + virtual void createObj(); + virtual bool loading(); +// virtual void update(float deltaFrame); +// virtual void initStageData(); + virtual bool isReStartSamePoint() { return false; } + static stConfig* create(); + static stClassInfoImpl bss_loc_14; +}; +//static_assert(sizeof(stCrayon) == 0x200, "Class is wrong size!"); diff --git a/include/st_final/gr_final.h b/include/st_final/gr_final.h new file mode 100644 index 0000000..86f239a --- /dev/null +++ b/include/st_final/gr_final.h @@ -0,0 +1,33 @@ +#pragma once + +#include + +const float EFF_SOMETHING = 0.0f; +const float EFF_FRAME_MAX1 = 2540.0f; +const float EFF_FRAME_MAX2 = 6100.0f; +class grFinal : public grYakumono { +protected: + char unk1; + float unk_float; + u8 type; + u8 step; + u16 padding; + +public: + grFinal(const char* taskName) : grYakumono(taskName) + { + unk1 = 0; + unk_float = EFF_SOMETHING; + type = 0; + step = 0; + setupMelee(); + }; + virtual void update(float deltaFrame); + virtual ~grFinal(); + + virtual void updateEff(); + virtual void setType(int type); + + static grFinal* create(int mdlIndex, const char* tgtNodeName, const char* taskName); + +}; diff --git a/include/st_final/st_final.h b/include/st_final/st_final.h new file mode 100644 index 0000000..7870bad --- /dev/null +++ b/include/st_final/st_final.h @@ -0,0 +1,47 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include + +template +class stClassInfoImpl : public stClassInfo { +public: + stClassInfoImpl() : stClassInfo() { + setClassInfo(Stages::Final, this); + }; + + virtual ~stClassInfoImpl() { + setClassInfo(Stages::Final, 0); + } + + virtual T* create() { + return T::create(); + } + + virtual void preload() { } +}; + +class stFinal : public stMelee { +// void* m_shrineStageData; + // TODO: float array? + + public: + stFinal(); + virtual ~stFinal(); + virtual void createObj(); + virtual bool loading(); + virtual void update(float deltaFrame); +// virtual void update(float deltaFrame); +// virtual void initStageData(); +// virtual bool isReStartSamePoint() { return false; } + virtual GXColor getFinalTechniqColor() { return nw4r::ut::Color(0x14000496); } + virtual bool isBamperVector() { return true; } +// virtual void notifyEventInfoGo(); + static stFinal* create(); + static stClassInfoImpl bss_loc_14; +}; \ No newline at end of file diff --git a/src/mo_stage/st_config/gr_config.cpp b/src/mo_stage/st_config/gr_config.cpp new file mode 100644 index 0000000..d2dd007 --- /dev/null +++ b/src/mo_stage/st_config/gr_config.cpp @@ -0,0 +1,26 @@ + +#include +#include +#include + +inline grConfig::grConfig(const char* taskName): grYakumono(taskName) { + setupMelee(); +} + + +grConfig* grConfig::create(int mdlIndex, const char *tgtNodeName, const char *taskName) {//: grPictchat(taskname) { + grConfig *bg = new (Heaps::StageInstance) grConfig(taskName); + if (bg != 0) { + + //bg->setupMelee(); + bg->setMdlIndex(mdlIndex); + //bg->m_heapType = Heaps::StageInstance; + //bg->makeCalcuCallback(1, Heaps::StageInstance); + //bg->setCalcuCallbackRoot(7); + bg->setTgtNode(tgtNodeName); + } + return bg; +} + + +grConfig::~grConfig() { } \ No newline at end of file diff --git a/src/mo_stage/st_config/st_config.cpp b/src/mo_stage/st_config/st_config.cpp new file mode 100644 index 0000000..9722139 --- /dev/null +++ b/src/mo_stage/st_config/st_config.cpp @@ -0,0 +1,56 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +stClassInfoImpl stConfig::bss_loc_14; + +stConfig::stConfig() : stMelee("stConfig", Stages::Config) { +// initStageData(); +} + +stConfig* stConfig::create() { + return new (Heaps::StageInstance) stConfig; +} + +stConfig::~stConfig() { + releaseArchive(); +} + +bool stConfig::loading() { + return true; +} + +void stConfig::createObj() { + testStageParamInit(m_fileData, 10); + testStageDataInit(m_fileData, 20,1); + grConfig *ground = grConfig::create(1,"", "grConfigMainBg"); + if (ground) { + addGround(ground); + ground->startup(this->m_fileData,0,0); + createCollision(m_fileData, 2, 0); + initCameraParam(); + nw4r::g3d::ResFile posData(m_fileData->getData(Data_Type_Model, 0x64, 0xFFFE)); + if (posData.ptr()) { + nw4r::g3d::ResFile copyPosData = posData; + createStagePositions(©PosData); + } else { + createStagePositions(); + } + createWind2ndOnly(); + loadStageAttrParam(m_fileData, 0x1E); + registScnAnim(static_cast(m_fileData->getData(Data_Type_Scene, 0, 0xFFFE)), 0); + } +} + diff --git a/src/mo_stage/st_final/gr_final.cpp b/src/mo_stage/st_final/gr_final.cpp new file mode 100644 index 0000000..b1401f0 --- /dev/null +++ b/src/mo_stage/st_final/gr_final.cpp @@ -0,0 +1,72 @@ +#include +#include +#include + +grFinal* grFinal::create(int mdlIndex, const char* tgtNodeName, const char* taskName) +{ + grFinal* ground = new (Heaps::StageInstance) grFinal(taskName); + if (ground) { +// ground->setupMelee(); + ground->setMdlIndex(mdlIndex); + ground->setTgtNode(tgtNodeName); + } + + return ground; +} + +grFinal::~grFinal() { + +} + +void grFinal::update(float deltaFrame) +{ + this->updateEff(); +} + +void grFinal::updateEff() +{ + if (this->type == 0) + { + switch (this->step) + { + case 0: + g_ecMgr->setDrawPrio(1); + g_ecMgr->setEffect(ef_ptc_stg_final_zenpan); + g_ecMgr->setDrawPrio(0xffffffff); + unk_float = EFF_SOMETHING; + step++; + break; + case 1: + if (!(this->getMotionFrame(0) < 2540.0f)) + { + g_ecMgr->setDrawPrio(1); + u32 unk = g_ecMgr->setEffect(ef_ptc_stg_final_star); + g_ecMgr->setDrawPrio(0xffffffff); + g_ecMgr->setParent(unk, this->m_sceneModels[0], "spaceB", 0); // sceneModel is actually supposed to be a wrapper of some kind + step++; + } + break; + case 2: + if (!(this->getMotionFrame(0) < 6100.0f)) +// if (this->getMotionFrame(0) > 6100.0f) + { + g_ecMgr->setDrawPrio(1); + u32 unk = g_ecMgr->setEffect(ef_ptc_stg_final_kirakira); + g_ecMgr->setDrawPrio(0xffffffff); + g_ecMgr->setParent(unk, this->m_sceneModels[0], "spaceF", 0); // sceneModel is actually supposed to be a wrapper of some kind + step++; + } + break; + case 3: + if (this->getMotionFrame(0) < this->unk_float) + { + step = 0; + } + else + { + this->unk_float = this->getMotionFrame(0); + } + break; + } + } +} \ No newline at end of file diff --git a/src/mo_stage/st_final/st_final.cpp b/src/mo_stage/st_final/st_final.cpp new file mode 100644 index 0000000..c72eb3d --- /dev/null +++ b/src/mo_stage/st_final/st_final.cpp @@ -0,0 +1,85 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +stClassInfoImpl stFinal::bss_loc_14; + +stFinal::stFinal() : stMelee("stFinal", Stages::Final) { + +} + +stFinal* stFinal::create() { + return new (Heaps::StageInstance) stFinal; +} + +stFinal::~stFinal() { + releaseArchive(); +} + +bool stFinal::loading() { + return true; +} + +void stFinal::createObj() +{ + testStageParamInit(m_fileData, 0xA); + testStageDataInit(m_fileData, 0x14, 1); + grFinal* ground = grFinal::create(1, "", "grFinalMainBg"); + if (ground != NULL) + { + addGround(ground); + ground->startup(m_fileData, 0, 0); + ground->setStageData(m_stageData); + ground->setType(0); + ground->setDontMoveGround(); + } + ground = grFinal::create(2, "", "grFinalStage"); + if (ground != NULL) + { + addGround(ground); + ground->startup(m_fileData, 0, 0); + ground->setStageData(m_stageData); + ground->setType(1); + ground->setDontMoveGround(); + } + createCollision(m_fileData, 2, NULL); + initCameraParam(); + nw4r::g3d::ResFile posData(m_fileData->getData(Data_Type_Model, 0x64, 0xfffe)); + if (posData.ptr()) + { + nw4r::g3d::ResFile copyPosData = posData; + createStagePositions(©PosData); + } + else + { + // if no stgPos model in pac, use defaults + createStagePositions(); + } + createWind2ndOnly(); + loadStageAttrParam(m_fileData, 0x1E); + nw4r::g3d::ResFileData* scnData = static_cast(m_fileData->getData(Data_Type_Scene, 0, 0xfffe)); + registScnAnim(scnData, 0); + initPosPokeTrainer(1, 0); + createObjPokeTrainer(m_fileData, 0x65, "PokeTrainer00", this->m_pokeTrainerPos, 0x0); +} + +void grFinal::setType(int type) +{ + this->type = type; +} + +void stFinal::update(float deltaFrame) { + +} From 23503d3ef0dd29808d7573542402be850d3c8dc8 Mon Sep 17 00:00:00 2001 From: MarioFan64 Date: Mon, 13 Oct 2025 17:39:13 -0500 Subject: [PATCH 2/2] Nearly Match most of grVillageAshiba --- config/RSBE01_02/rels/st_village/splits.txt | 10 + config/RSBE01_02/rels/st_village/symbols.txt | 53 ++-- configure.py | 5 +- include/st_village/gr_village.h | 25 ++ include/st_village/gr_village_ashiba.h | 20 ++ src/mo_stage/st_village/gr_village.cpp | 65 +++++ src/mo_stage/st_village/gr_village_ashiba.cpp | 237 ++++++++++++++++++ 7 files changed, 387 insertions(+), 28 deletions(-) create mode 100644 include/st_village/gr_village.h create mode 100644 include/st_village/gr_village_ashiba.h create mode 100644 src/mo_stage/st_village/gr_village.cpp create mode 100644 src/mo_stage/st_village/gr_village_ashiba.cpp diff --git a/config/RSBE01_02/rels/st_village/splits.txt b/config/RSBE01_02/rels/st_village/splits.txt index 085ab50..698af8e 100644 --- a/config/RSBE01_02/rels/st_village/splits.txt +++ b/config/RSBE01_02/rels/st_village/splits.txt @@ -11,6 +11,16 @@ global_destructor_chain.c: .dtors start:0x00000000 end:0x00000008 .bss start:0x00000000 end:0x00000004 +mo_stage/st_village/gr_village.cpp: + .text start:0x00001F98 end:0x000022DC + .rodata start:0x00000028 end:0x00000030 + .data start:0x00000A68 end:0x00000CF0 + +mo_stage/st_village/gr_village_ashiba.cpp: + .text start:0x00002568 end:0x00002B80 + .rodata start:0x00000030 end:0x00000048 + .data start:0x00001068 end:0x00001298 + mo_stage/mo_stage.cpp: .text start:0x0000DA54 end:0x0000DAF0 .data start:0x00004500 end:0x0000450D diff --git a/config/RSBE01_02/rels/st_village/symbols.txt b/config/RSBE01_02/rels/st_village/symbols.txt index b99396d..6ff4b29 100644 --- a/config/RSBE01_02/rels/st_village/symbols.txt +++ b/config/RSBE01_02/rels/st_village/symbols.txt @@ -6,7 +6,7 @@ fn_70_184 = .text:0x00000184; // type:function size:0xCC fn_70_250 = .text:0x00000250; // type:function size:0x8 fn_70_258 = .text:0x00000258; // type:function size:0x370 fn_70_5C8 = .text:0x000005C8; // type:function size:0x1C4 -fn_70_78C = .text:0x0000078C; // type:function size:0x8 +setStageData__6GroundFPv = .text:0x0000078C; // type:function size:0x8 fn_70_794 = .text:0x00000794; // type:function size:0x8 fn_70_79C = .text:0x0000079C; // type:function size:0x8 fn_70_7A4 = .text:0x000007A4; // type:function size:0x8 @@ -71,35 +71,34 @@ fn_70_1E88 = .text:0x00001E88; // type:function size:0x64 fn_70_1EEC = .text:0x00001EEC; // type:function size:0x74 fn_70_1F60 = .text:0x00001F60; // type:function size:0x34 fn_70_1F94 = .text:0x00001F94; // type:function size:0x4 -fn_70_1F98 = .text:0x00001F98; // type:function size:0xE8 -fn_70_2080 = .text:0x00002080; // type:function size:0x8 -fn_70_2088 = .text:0x00002088; // type:function size:0x74 -fn_70_20FC = .text:0x000020FC; // type:function size:0x58 -fn_70_2154 = .text:0x00002154; // type:function size:0x5C -fn_70_21B0 = .text:0x000021B0; // type:function size:0x54 -fn_70_2204 = .text:0x00002204; // type:function size:0x4 -fn_70_2208 = .text:0x00002208; // type:function size:0x48 -fn_70_2250 = .text:0x00002250; // type:function size:0x8 -fn_70_2258 = .text:0x00002258; // type:function size:0x8 -fn_70_2260 = .text:0x00002260; // type:function size:0x4 -fn_70_2264 = .text:0x00002264; // type:function size:0x4 -fn_70_2268 = .text:0x00002268; // type:function size:0x10 -fn_70_2278 = .text:0x00002278; // type:function size:0x10 -fn_70_2288 = .text:0x00002288; // type:function size:0xC -fn_70_2294 = .text:0x00002294; // type:function size:0x8 -fn_70_229C = .text:0x0000229C; // type:function size:0x4 -fn_70_22A0 = .text:0x000022A0; // type:function size:0x8 -fn_70_22A8 = .text:0x000022A8; // type:function size:0x1C -fn_70_22C4 = .text:0x000022C4; // type:function size:0x8 -fn_70_22CC = .text:0x000022CC; // type:function size:0x8 -fn_70_22D4 = .text:0x000022D4; // type:function size:0x8 +create__9grVillageFiPCcPCc = .text:0x00001F98; // type:function size:0xE8 +setMdlIndex__6GroundFi = .text:0x00002080; // type:function size:0x8 +__ct__9grVillageFPCc = .text:0x00002088; // type:function size:0x74 +__dt__9grVillageFv = .text:0x000020FC; // type:function size:0x58 +update__9grVillageFf = .text:0x00002154; // type:function size:0x5C +updateVisible__9grVillageFf = .text:0x000021B0; // type:function size:0x58 +isSceneBit__9grVillageFv = .text:0x00002208; // type:function size:0x48 +adventureEventGetItem__6GroundFiP13stTriggerData = .text:0x00002250; // type:function size:0x8 +getInitializeInfo__6GroundFi = .text:0x00002258; // type:function size:0x8 +setInitializeInfo__6GroundFi = .text:0x00002260; // type:function size:0x4 +setInitializeFlag__6GroundFv = .text:0x00002264; // type:function size:0x4 +disableCalcCollision__6GroundFv = .text:0x00002268; // type:function size:0x10 +enableCalcCollision__6GroundFv = .text:0x00002278; // type:function size:0x10 +isEnableCalcCollision__6GroundFv = .text:0x00002288; // type:function size:0xC +getMdlIndex__6GroundFv = .text:0x00002294; // type:function size:0x8 +initStageData__6GroundFv = .text:0x0000229C; // type:function size:0x4 +getStageData__6GroundFv = .text:0x000022A0; // type:function size:0x8 +getModelCount__6GroundFv = .text:0x000022A8; // type:function size:0x1C +getTransparencyFlag__9grGimmickFv = .text:0x000022C4; // type:function size:0x8 +getGimmickData__9grGimmickFv = .text:0x000022CC; // type:function size:0x8 +setGimmickData__9grGimmickFPv = .text:0x000022D4; // type:function size:0x8 fn_70_22DC = .text:0x000022DC; // type:function size:0xB0 fn_70_238C = .text:0x0000238C; // type:function size:0x58 fn_70_23E4 = .text:0x000023E4; // type:function size:0x184 -fn_70_2568 = .text:0x00002568; // type:function size:0xC4 -fn_70_262C = .text:0x0000262C; // type:function size:0x58 -fn_70_2684 = .text:0x00002684; // type:function size:0xB4 -fn_70_2738 = .text:0x00002738; // type:function size:0x448 +create__15grVillageAshibaFiPCcPCc = .text:0x00002568; // type:function size:0xC4 +__dt__15grVillageAshibaFv = .text:0x0000262C; // type:function size:0x58 +update__15grVillageAshibaFf = .text:0x00002684; // type:function size:0xB4 +setMotion__15grVillageAshibaFUcbUlPf = .text:0x00002738; // type:function size:0x448 fn_70_2B80 = .text:0x00002B80; // type:function size:0xA8 fn_70_2C28 = .text:0x00002C28; // type:function size:0x13C fn_70_2D64 = .text:0x00002D64; // type:function size:0x130 diff --git a/configure.py b/configure.py index 6bc49fa..97703e9 100755 --- a/configure.py +++ b/configure.py @@ -1333,7 +1333,10 @@ def MatchingFor(*versions): "mw_version": config.linker_version, "cflags": cflags_rel, "host": False, - "objects": [], + "objects": [ + Object(NonMatching, "mo_stage/st_village/gr_village.cpp"), + Object(NonMatching, "mo_stage/st_village/gr_village_ashiba.cpp"), + ], }, ] diff --git a/include/st_village/gr_village.h b/include/st_village/gr_village.h new file mode 100644 index 0000000..f367edb --- /dev/null +++ b/include/st_village/gr_village.h @@ -0,0 +1,25 @@ +#pragma once + +#include +#include + +class grVillage : public grYakumono { + protected: + u8 m_state; + float m_stateTimer; + u8* m_sceneWork; + unsigned char m_sceneBit; + char* m_stateWork; + int* m_guestPositionsWork; + public: + grVillage(const char* taskName); + static grVillage* create(int mdlIndex, const char *tgtNodeName, const char *taskName); + virtual void update(float deltaFrame); + virtual void updateVisible(float deltaFrame); + virtual void setSceneWork(char* sceneWork); + virtual void setSceneBit(char sceneBit); + virtual void setStateWork(char* stateWork); + virtual void setPosGuestWork(int* guestPositions); + virtual bool isSceneBit(); + virtual ~grVillage(); +}; \ No newline at end of file diff --git a/include/st_village/gr_village_ashiba.h b/include/st_village/gr_village_ashiba.h new file mode 100644 index 0000000..e152868 --- /dev/null +++ b/include/st_village/gr_village_ashiba.h @@ -0,0 +1,20 @@ +#pragma once + +#include +#include +#include + +class grVillageAshiba : public grVillage { + protected: + u8 curAnimId; // 0x168 + char _0x169; // 0x169 + char _0x16A; // 0x16A + char _0x16b; // 0x16B + float _0x16C; // 0x16C + public: + grVillageAshiba(const char* taskName); + static grVillageAshiba* create(int mdlIndex, const char *tgtNodeName, const char *taskName); + virtual ~grVillageAshiba(); + virtual void update(float deltaFrame); + virtual void setMotion(u8 animId, bool shouldLoop, u32 unk3, float* unkFloat); +}; \ No newline at end of file diff --git a/src/mo_stage/st_village/gr_village.cpp b/src/mo_stage/st_village/gr_village.cpp new file mode 100644 index 0000000..1e60bf5 --- /dev/null +++ b/src/mo_stage/st_village/gr_village.cpp @@ -0,0 +1,65 @@ + +#include +#include +#include + + +grVillage* grVillage::create(int mdlIndex, const char *tgtNodeName, const char *taskName) { + grVillage *bg = new (Heaps::StageInstance) grVillage(taskName); + if (bg != 0) { + + //bg->setupMelee(); + bg->setMdlIndex(mdlIndex); + //bg->m_heapType = Heaps::StageInstance; + //bg->makeCalcuCallback(1, Heaps::StageInstance); + //bg->setCalcuCallbackRoot(7); + bg->setTgtNode(tgtNodeName); + } + return bg; +} + +grVillage::grVillage(const char* taskName): grYakumono(taskName) { + m_state = 0; + m_stateTimer = 0; + m_sceneWork = NULL; + m_sceneBit = 0; + m_stateWork = NULL; + m_guestPositionsWork = NULL; + setupMelee(); +} + +grVillage::~grVillage() { } + +void grVillage::update(float deltaFrame) { + grGimmick::update(deltaFrame); + if (m_isUpdate) { + updateVisible(deltaFrame); + } + +} + +void grVillage::updateVisible(float deltaFrame) { + //grGimmick::update(deltaFrame); + if (m_sceneWork == NULL) { + return; + } + if (m_sceneBit == NULL) { + return; + } + if (m_sceneBit & (1 << *m_sceneWork)) { + setVisibility(true); + } else { + setVisibility(false); + } +} + +bool grVillage::isSceneBit() { + //grGimmick::update(deltaFrame); + if (m_sceneWork == NULL) { + return false; + } + if (m_sceneBit == NULL) { + return true; + } + return (m_sceneBit & (1 << *m_sceneWork)); +} \ No newline at end of file diff --git a/src/mo_stage/st_village/gr_village_ashiba.cpp b/src/mo_stage/st_village/gr_village_ashiba.cpp new file mode 100644 index 0000000..3970756 --- /dev/null +++ b/src/mo_stage/st_village/gr_village_ashiba.cpp @@ -0,0 +1,237 @@ + +#include +#include +#include +#include +#include +//#include +//#include + +inline grVillageAshiba::grVillageAshiba(const char* taskName): grVillage(taskName) { + //setupMelee(); + curAnimId = 1; // 0x168 + _0x16C = 0.0; +} + + +grVillageAshiba* grVillageAshiba::create(int mdlIndex, const char *tgtNodeName, const char *taskName) {//: grPictchat(taskname) { + grVillageAshiba *bg = new (Heaps::StageInstance) grVillageAshiba(taskName); + if (bg != 0) { + + //bg->setupMelee(); + bg->setMdlIndex(mdlIndex); + //bg->m_heapType = Heaps::StageInstance; + //bg->makeCalcuCallback(1, Heaps::StageInstance); + //bg->setCalcuCallbackRoot(7); + bg->setTgtNode(tgtNodeName); + } + return bg; +} + + +grVillageAshiba::~grVillageAshiba() { } + +void grVillageAshiba::update(float deltaFrame) { + grVillage::update(deltaFrame); + if (m_isUpdate) { + switch(m_state) { + case 0: + setMotion(0, true, 0, NULL); + switch(*m_stateWork) { + case 2: + setMotionFrame(300, 0); + break; + } + m_state = 4; + break; + case 4: + break; + } + } +} + +/*inline void setVisibilityAnim(nw4r::g3d::ResMdl model, gfModelAnimation* modelAnim) { + if (animId < modelAnim->m_resFile.GetResAnmVisNumEntries()) + int instanceSize; + nw4r::g3d::ResAnmVis anim = modelAnim->m_resFile.GetResAnmVis(animId); + + MEMAllocator* allocator = gfHeapManager::getMEMAllocator(Heaps::StageInstance); + if (anim.IsValid()) + { + nw4r::g3d::AnmObjVisRes* anmObj = nw4r::g3d::AnmObjVisRes::Construct(allocator, &instanceSize, anim, model); + if (anmObj != NULL) + { + anmObj->Bind(model); + + if (modelAnim->m_anmObjVisRes != NULL) + { + modelAnim->m_anmObjVisRes->Destroy(); + } + + modelAnim->m_anmObjVisRes = anmObj; + } + } + } +}*/ +//setVisibilityAnim(model,modelAnim); +void grVillageAshiba::setMotion(u8 animId, bool shouldLoop, u32 unk3, float* frameCount) +{ + if (this->curAnimId == animId and unk3 == 0) + return; + + // get sceneMdl and model animations + nw4r::g3d::ScnMdl* sceneMdl = *this->m_sceneModels; + + if (sceneMdl == NULL) + return; + + gfModelAnimation* modelAnim = *this->m_modelAnims; + if (modelAnim == NULL) + return; + + // get scene model data + nw4r::g3d::ResMdl model = sceneMdl->m_resMdl; + + if (!model.IsValid()) + return; + + modelAnim->unbindNodeAnim(sceneMdl); + modelAnim->unbindVisibleAnim(sceneMdl); + modelAnim->unbindTexAnim(sceneMdl); + modelAnim->unbindTexSrtAnim(sceneMdl); + modelAnim->unbindMatColAnim(sceneMdl); + this->curAnimId = animId; + + if (animId >= 1) + return; +// MEMAllocator* allocator; + bool result = (modelAnim->m_resFile.GetResAnmVisNumEntries() > animId); + if ((result) and (animId < modelAnim->m_resFile.GetResAnmVisNumEntries())) + { + int instanceSize; + nw4r::g3d::ResAnmVis anim = modelAnim->m_resFile.GetResAnmVis(animId); + + MEMAllocator* allocator = gfHeapManager::getMEMAllocator(Heaps::StageInstance); + if (anim.IsValid()) + { + nw4r::g3d::AnmObjVisRes* anmObj = nw4r::g3d::AnmObjVisRes::Construct(allocator, &instanceSize, anim, model); + if (anmObj != NULL) + { + anmObj->Bind(model); + + if (modelAnim->m_anmObjVisRes != NULL) + { + modelAnim->m_anmObjVisRes->Destroy(); + } + + modelAnim->m_anmObjVisRes = anmObj; + } + } + } + + result = (modelAnim->m_resFile.GetResAnmChrNumEntries() > animId); + if ((result) and (animId < modelAnim->m_resFile.GetResAnmChrNumEntries())) + { + int instanceSize; + nw4r::g3d::ResAnmChr anim = modelAnim->m_resFile.GetResAnmChr(animId); + + MEMAllocator* allocator = gfHeapManager::getMEMAllocator(Heaps::StageInstance); + if (anim.IsValid()) + { + nw4r::g3d::AnmObjChrRes* anmObj = nw4r::g3d::AnmObjChrRes::Construct(allocator, &instanceSize, anim, model, false); + if (anmObj != NULL) + { + anmObj->Bind(model); + + if (modelAnim->m_anmObjChrRes != NULL) + { + modelAnim->m_anmObjChrRes->Destroy(); + } + + modelAnim->m_anmObjChrRes = anmObj; + } + } + } + + result = (modelAnim->m_resFile.GetResAnmTexPatNumEntries() > animId); + if ((result) and (animId < modelAnim->m_resFile.GetResAnmTexPatNumEntries())) + { + int instanceSize; + nw4r::g3d::ResAnmTexPat anim = modelAnim->m_resFile.GetResAnmTexPat(animId); + + if (anim.IsValid()) + { + MEMAllocator* allocator = gfHeapManager::getMEMAllocator(Heaps::StageInstance); + nw4r::g3d::AnmObjTexPatRes* anmObj = nw4r::g3d::AnmObjTexPatRes::Construct(allocator, &instanceSize, anim, model, false); + if (anmObj != NULL) + { + anmObj->Bind(model); + + if (modelAnim->m_anmObjTexPatRes != NULL) + { + modelAnim->m_anmObjTexPatRes->Destroy(); + } + + modelAnim->m_anmObjTexPatRes = anmObj; + } + } + } + + result = (modelAnim->m_resFile.GetResAnmTexSrtNumEntries() > animId); + if ((result) and (animId < modelAnim->m_resFile.GetResAnmTexSrtNumEntries())) + { + int instanceSize; + nw4r::g3d::ResAnmTexSrt anim = modelAnim->m_resFile.GetResAnmTexSrt(animId); + + if (anim.IsValid()) + { + MEMAllocator* allocator = gfHeapManager::getMEMAllocator(Heaps::StageInstance); + nw4r::g3d::AnmObjTexSrtRes* anmObj = nw4r::g3d::AnmObjTexSrtRes::Construct(allocator, &instanceSize, anim, model, false); + if (anmObj != NULL) + { + anmObj->Bind(model); + + if (modelAnim->m_anmObjTexSrtRes != NULL) + { + modelAnim->m_anmObjTexSrtRes->Destroy(); + } + + modelAnim->m_anmObjTexSrtRes = anmObj; + } + } + } + + result = (modelAnim->m_resFile.GetResAnmClrNumEntries() > animId); + if ((result) and (animId < modelAnim->m_resFile.GetResAnmClrNumEntries())) + { + int instanceSize; + nw4r::g3d::ResAnmClr anim = modelAnim->m_resFile.GetResAnmClr(animId); + + if (anim.IsValid()) + { + MEMAllocator* allocator = gfHeapManager::getMEMAllocator(Heaps::StageInstance); + nw4r::g3d::AnmObjMatClrRes* anmObj = nw4r::g3d::AnmObjMatClrRes::Construct(allocator, &instanceSize, anim, model, false); + if (anmObj != NULL) + { + anmObj->Bind(model); + + if (modelAnim->m_anmObjMatClrRes != NULL) + { + modelAnim->m_anmObjMatClrRes->Destroy(); + } + + modelAnim->m_anmObjMatClrRes = anmObj; + } + } + } + + gfModelAnimation::bind(sceneMdl, modelAnim); + modelAnim->setFrame(0.0); + modelAnim->setUpdateRate(1.0); + modelAnim->setLoop(shouldLoop); + + if (frameCount != NULL) + { + *frameCount = modelAnim->getFrameCount(); + } +} \ No newline at end of file