From 86fddd48d54f5b8fb126cf71f130a4733c8f0ded Mon Sep 17 00:00:00 2001 From: Jcw87 Date: Thu, 22 Jan 2026 21:11:28 -0800 Subject: [PATCH] d_stage debug (#3063) --- config/RZDE01_00/splits.txt | 6 +- config/RZDE01_00/symbols.txt | 12 +- config/RZDE01_02/splits.txt | 6 +- config/RZDE01_02/symbols.txt | 6 +- config/RZDJ01/splits.txt | 6 +- config/RZDJ01/symbols.txt | 6 +- config/RZDP01/splits.txt | 6 +- config/RZDP01/symbols.txt | 14 +- config/Shield/symbols.txt | 10 +- config/ShieldD/splits.txt | 6 +- config/ShieldD/symbols.txt | 6 +- include/d/d_bg_parts.h | 2 + include/d/d_com_inf_game.h | 8 +- include/d/d_save.h | 6 +- include/d/d_stage.h | 413 ++++++++-------- include/f_ap/f_ap_game.h | 4 + include/f_op/f_op_actor_mng.h | 4 - src/d/d_stage.cpp | 879 ++++++++++++++++++++++------------ 18 files changed, 840 insertions(+), 560 deletions(-) diff --git a/config/RZDE01_00/splits.txt b/config/RZDE01_00/splits.txt index ab505d33f2..f5b4ace0fc 100644 --- a/config/RZDE01_00/splits.txt +++ b/config/RZDE01_00/splits.txt @@ -341,7 +341,7 @@ f_pc/f_pc_node_req.cpp: f_pc/f_pc_priority.cpp: .text start:0x80027DFC end:0x80028140 .bss start:0x804813F0 end:0x80481400 - .sdata start:0x805378D0 end:0x80537908 + .sdata start:0x805378D0 end:0x805378D8 f_pc/f_pc_profile.cpp: .text start:0x80028140 end:0x80028150 @@ -381,7 +381,7 @@ d/d_stage.cpp: .ctors start:0x803CE268 end:0x803CE26C .data start:0x803FA5A8 end:0x803FDE58 .bss start:0x80481400 end:0x804928C8 - .sdata start:0x80537908 end:0x8053793C + .sdata start:0x805378D8 end:0x80537920 .sbss start:0x8053A988 end:0x8053A9B0 .sdata2 start:0x8053BD28 end:0x8053BD38 @@ -389,7 +389,7 @@ d/d_map.cpp: .text start:0x8002CC88 end:0x8002F3F4 .rodata start:0x803CFC30 end:0x803CFD10 .data start:0x803FDE58 end:0x803FE258 - .sdata start:0x8053793C end:0x80537ACC + .sdata start:0x80537920 end:0x80537ACC .sbss start:0x8053A9B0 end:0x8053A9B8 .sdata2 start:0x8053BD38 end:0x8053BD98 diff --git a/config/RZDE01_00/symbols.txt b/config/RZDE01_00/symbols.txt index 8ef25f657a..3622853600 100644 --- a/config/RZDE01_00/symbols.txt +++ b/config/RZDE01_00/symbols.txt @@ -25247,7 +25247,7 @@ l_RoomKeepDoorInfo = .bss:0x80481D1C; // type:object size:0x904 scope:global ali mStatus__20dStage_roomControl_c = .bss:0x8048262C; // type:object size:0x10100 scope:global align:4 data:4byte mMemoryBlock__20dStage_roomControl_c = .bss:0x8049272C; // type:object size:0x4C scope:global align:4 mDemoArcName__20dStage_roomControl_c = .bss:0x80492778; // type:object size:0xA data:byte -lbl_80492782 = .bss:0x80492782; // type:object size:0x146 +mArcBank__20dStage_roomControl_c = .bss:0x80492782; // type:object size:0x146 ...bss.0 = .bss:0x804928C8; // type:label scope:local align:4 dComIfG_mTimerInfo = .bss:0x804928C8; // type:object size:0x14 scope:global align:4 @109519 = .bss:0x804928DC; // type:object size:0xC scope:local align:4 @@ -26155,7 +26155,7 @@ lbl_805378E8 = .sdata:0x805378E8; // type:object size:0x8 data:string lbl_805378F0 = .sdata:0x805378F0; // type:object size:0x7 data:string lbl_805378F7 = .sdata:0x805378F7; // type:object size:0x7 data:string lbl_805378FE = .sdata:0x805378FE; // type:object size:0x6 data:string -lbl_80537904 = .sdata:0x80537904; // type:object size:0x1 data:byte +mRoomReadId__20dStage_roomControl_c = .sdata:0x80537904; // type:object size:0x1 data:byte __RTTI__16dStage_stageDt_c = .sdata:0x80537908; // type:object size:0x8 scope:global align:4 __RTTI__15dStage_roomDt_c = .sdata:0x80537910; // type:object size:0x8 scope:global align:4 __RTTI__11dStage_dt_c = .sdata:0x80537918; // type:object size:0x8 scope:global align:4 @@ -28187,10 +28187,10 @@ g_fpcPf_ProfileList_p = .sbss:0x8053A980; // type:object size:0x4 scope:global a tmp_name$50691 = .sbss:0x8053A988; // type:object size:0x8 scope:local align:1 data:byte mProcID__20dStage_roomControl_c = .sbss:0x8053A990; // type:object size:0x4 scope:global align:4 data:4byte mStayNo__20dStage_roomControl_c = .sbss:0x8053A994; // type:object size:0x1 data:byte -lbl_8053A995 = .sbss:0x8053A995; // type:object size:0x1 data:byte -lbl_8053A996 = .sbss:0x8053A996; // type:object size:0x1 data:byte -lbl_8053A997 = .sbss:0x8053A997; // type:object size:0x1 data:byte -lbl_8053A998 = .sbss:0x8053A998; // type:object size:0x1 data:byte +mOldStayNo__20dStage_roomControl_c = .sbss:0x8053A995; // type:object size:0x1 data:byte +mNextStayNo__20dStage_roomControl_c = .sbss:0x8053A996; // type:object size:0x1 data:byte +m_time_pass__20dStage_roomControl_c = .sbss:0x8053A997; // type:object size:0x1 data:byte +mNoChangeRoom__20dStage_roomControl_c = .sbss:0x8053A998; // type:object size:0x1 data:byte mArcBankName__20dStage_roomControl_c = .sbss:0x8053A99C; // type:object size:0x4 scope:global align:4 data:4byte mArcBankData__20dStage_roomControl_c = .sbss:0x8053A9A0; // type:object size:0x4 scope:global align:4 data:4byte m_roomDzs__20dStage_roomControl_c = .sbss:0x8053A9A4; // type:object size:0x8 scope:global align:4 diff --git a/config/RZDE01_02/splits.txt b/config/RZDE01_02/splits.txt index 540f739d7c..87abd0a5b2 100644 --- a/config/RZDE01_02/splits.txt +++ b/config/RZDE01_02/splits.txt @@ -341,7 +341,7 @@ f_pc/f_pc_node_req.cpp: f_pc/f_pc_priority.cpp: .text start:0x80027F0C end:0x80028250 .bss start:0x804689F8 end:0x80468A08 - .sdata start:0x8051D970 end:0x8051D9A8 + .sdata start:0x8051D970 end:0x8051D978 f_pc/f_pc_profile.cpp: .text start:0x80028250 end:0x80028260 @@ -381,7 +381,7 @@ d/d_stage.cpp: .ctors start:0x803B8CAC end:0x803B8CB0 .data start:0x803E5848 end:0x803E90F8 .bss start:0x80468A08 end:0x80479ED0 - .sdata start:0x8051D9A8 end:0x8051D9DC + .sdata start:0x8051D978 end:0x8051D9C0 .sbss start:0x80520990 end:0x805209B8 .sdata2 start:0x80521D28 end:0x80521D38 @@ -389,7 +389,7 @@ d/d_map.cpp: .text start:0x8002CD10 end:0x8002F47C .rodata start:0x803BA670 end:0x803BA750 .data start:0x803E90F8 end:0x803E94F8 - .sdata start:0x8051D9DC end:0x8051DB6C + .sdata start:0x8051D9C0 end:0x8051DB6C .sbss start:0x805209B8 end:0x805209C0 .sdata2 start:0x80521D38 end:0x80521D98 diff --git a/config/RZDE01_02/symbols.txt b/config/RZDE01_02/symbols.txt index b321ecb8b5..92a073689e 100644 --- a/config/RZDE01_02/symbols.txt +++ b/config/RZDE01_02/symbols.txt @@ -24800,8 +24800,8 @@ l_RoomKeepDoorInfo = .bss:0x80469324; // type:object size:0x904 scope:global ali @97897 = .bss:0x80469C28; // type:object size:0xC scope:local align:4 mStatus__20dStage_roomControl_c = .bss:0x80469C34; // type:object size:0x10100 scope:global align:4 data:4byte mMemoryBlock__20dStage_roomControl_c = .bss:0x80479D34; // type:object size:0x4C scope:global align:4 -lbl_80479D80 = .bss:0x80479D80; // type:object size:0xA data:byte -lbl_80479D8A = .bss:0x80479D8A; // type:object size:0x146 +mDemoArcName__20dStage_roomControl_c = .bss:0x80479D80; // type:object size:0xA data:byte +mArcBank__20dStage_roomControl_c = .bss:0x80479D8A; // type:object size:0x146 ...bss.0 = .bss:0x80479ED0; // type:label scope:local align:4 dComIfG_mTimerInfo = .bss:0x80479ED0; // type:object size:0x14 scope:global align:4 @109549 = .bss:0x80479EE4; // type:object size:0xC scope:local align:4 @@ -25706,7 +25706,7 @@ lbl_8051D988 = .sdata:0x8051D988; // type:object size:0x8 data:string lbl_8051D990 = .sdata:0x8051D990; // type:object size:0x7 data:string lbl_8051D997 = .sdata:0x8051D997; // type:object size:0x7 data:string lbl_8051D99E = .sdata:0x8051D99E; // type:object size:0x6 data:string -lbl_8051D9A4 = .sdata:0x8051D9A4; // type:object size:0x1 data:byte +mRoomReadId__20dStage_roomControl_c = .sdata:0x8051D9A4; // type:object size:0x1 data:byte __RTTI__16dStage_stageDt_c = .sdata:0x8051D9A8; // type:object size:0x8 scope:global align:4 __RTTI__15dStage_roomDt_c = .sdata:0x8051D9B0; // type:object size:0x8 scope:global align:4 __RTTI__11dStage_dt_c = .sdata:0x8051D9B8; // type:object size:0x8 scope:global align:4 diff --git a/config/RZDJ01/splits.txt b/config/RZDJ01/splits.txt index a68d330186..7c478a5d25 100644 --- a/config/RZDJ01/splits.txt +++ b/config/RZDJ01/splits.txt @@ -341,7 +341,7 @@ f_pc/f_pc_node_req.cpp: f_pc/f_pc_priority.cpp: .text start:0x80027F1C end:0x80028260 .bss start:0x80466878 end:0x80466888 - .sdata start:0x8051B7E8 end:0x8051B820 + .sdata start:0x8051B7E8 end:0x8051B7F0 f_pc/f_pc_profile.cpp: .text start:0x80028260 end:0x80028270 @@ -381,7 +381,7 @@ d/d_stage.cpp: .ctors start:0x803BA76C end:0x803BA770 .data start:0x803E37D0 end:0x803E7080 .bss start:0x80466888 end:0x80477D50 - .sdata start:0x8051B820 end:0x8051B854 + .sdata start:0x8051B7F0 end:0x8051B838 .sbss start:0x8051E810 end:0x8051E838 .sdata2 start:0x8051FBA8 end:0x8051FBB8 @@ -389,7 +389,7 @@ d/d_map.cpp: .text start:0x8002CD20 end:0x8002F48C .rodata start:0x803BC130 end:0x803BC210 .data start:0x803E7080 end:0x803E7480 - .sdata start:0x8051B854 end:0x8051B9E4 + .sdata start:0x8051B838 end:0x8051B9E4 .sbss start:0x8051E838 end:0x8051E840 .sdata2 start:0x8051FBB8 end:0x8051FC18 diff --git a/config/RZDJ01/symbols.txt b/config/RZDJ01/symbols.txt index 2fcb92996f..00357054ee 100644 --- a/config/RZDJ01/symbols.txt +++ b/config/RZDJ01/symbols.txt @@ -24802,8 +24802,8 @@ l_RoomKeepDoorInfo = .bss:0x804671A4; // type:object size:0x904 scope:global ali @97897 = .bss:0x80467AA8; // type:object size:0xC scope:local align:4 mStatus__20dStage_roomControl_c = .bss:0x80467AB4; // type:object size:0x10100 scope:global align:4 data:4byte mMemoryBlock__20dStage_roomControl_c = .bss:0x80477BB4; // type:object size:0x4C scope:global align:4 -lbl_80477C00 = .bss:0x80477C00; // type:object size:0xA data:byte -lbl_80477C0A = .bss:0x80477C0A; // type:object size:0x146 +mDemoArcName__20dStage_roomControl_c = .bss:0x80477C00; // type:object size:0xA data:byte +mArcBank__20dStage_roomControl_c = .bss:0x80477C0A; // type:object size:0x146 ...bss.0 = .bss:0x80477D50; // type:label scope:local align:4 dComIfG_mTimerInfo = .bss:0x80477D50; // type:object size:0x14 scope:global align:4 @109549 = .bss:0x80477D64; // type:object size:0xC scope:local align:4 @@ -25707,7 +25707,7 @@ lbl_8051B800 = .sdata:0x8051B800; // type:object size:0x8 data:string lbl_8051B808 = .sdata:0x8051B808; // type:object size:0x7 data:string lbl_8051B80F = .sdata:0x8051B80F; // type:object size:0x7 data:string lbl_8051B816 = .sdata:0x8051B816; // type:object size:0x6 data:string -lbl_8051B81C = .sdata:0x8051B81C; // type:object size:0x1 data:byte +mRoomReadId__20dStage_roomControl_c = .sdata:0x8051B81C; // type:object size:0x1 data:byte __RTTI__16dStage_stageDt_c = .sdata:0x8051B820; // type:object size:0x8 scope:global align:4 __RTTI__15dStage_roomDt_c = .sdata:0x8051B828; // type:object size:0x8 scope:global align:4 __RTTI__11dStage_dt_c = .sdata:0x8051B830; // type:object size:0x8 scope:global align:4 diff --git a/config/RZDP01/splits.txt b/config/RZDP01/splits.txt index 708ed06b9e..6a3fdf9517 100644 --- a/config/RZDP01/splits.txt +++ b/config/RZDP01/splits.txt @@ -341,7 +341,7 @@ f_pc/f_pc_node_req.cpp: f_pc/f_pc_priority.cpp: .text start:0x80027FC0 end:0x80028304 .bss start:0x804692F0 end:0x80469300 - .sdata start:0x8051E270 end:0x8051E2A8 + .sdata start:0x8051E270 end:0x8051E278 f_pc/f_pc_profile.cpp: .text start:0x80028304 end:0x80028314 @@ -381,7 +381,7 @@ d/d_stage.cpp: .ctors start:0x803B912C end:0x803B9130 .data start:0x803E65F8 end:0x803E9EA8 .bss start:0x80469300 end:0x8047A7C8 - .sdata start:0x8051E2A8 end:0x8051E2DC + .sdata start:0x8051E278 end:0x8051E2C0 .sbss start:0x80521150 end:0x80521178 .sdata2 start:0x805224E8 end:0x805224F8 @@ -389,7 +389,7 @@ d/d_map.cpp: .text start:0x8002CDC4 end:0x8002F530 .rodata start:0x803BAAF0 end:0x803BABD0 .data start:0x803E9EA8 end:0x803EA2A8 - .sdata start:0x8051E2DC end:0x8051E46C + .sdata start:0x8051E2C0 end:0x8051E46C .sbss start:0x80521178 end:0x80521180 .sdata2 start:0x805224F8 end:0x80522558 diff --git a/config/RZDP01/symbols.txt b/config/RZDP01/symbols.txt index 979c07a945..f0e971c366 100644 --- a/config/RZDP01/symbols.txt +++ b/config/RZDP01/symbols.txt @@ -24796,8 +24796,8 @@ l_RoomKeepDoorInfo = .bss:0x80469C1C; // type:object size:0x904 scope:global ali @97897 = .bss:0x8046A520; // type:object size:0xC scope:local align:4 mStatus__20dStage_roomControl_c = .bss:0x8046A52C; // type:object size:0x10100 scope:global align:4 data:4byte mMemoryBlock__20dStage_roomControl_c = .bss:0x8047A62C; // type:object size:0x4C scope:global align:4 -lbl_8047A678 = .bss:0x8047A678; // type:object size:0xA data:byte -lbl_8047A682 = .bss:0x8047A682; // type:object size:0x146 +mDemoArcName__20dStage_roomControl_c = .bss:0x8047A678; // type:object size:0xA data:byte +mArcBank__20dStage_roomControl_c = .bss:0x8047A682; // type:object size:0x146 ...bss.0 = .bss:0x8047A7C8; // type:label scope:local align:4 dComIfG_mTimerInfo = .bss:0x8047A7C8; // type:object size:0x14 scope:global align:4 @109549 = .bss:0x8047A7DC; // type:object size:0xC scope:local align:4 @@ -25702,7 +25702,7 @@ lbl_8051E288 = .sdata:0x8051E288; // type:object size:0x8 data:string lbl_8051E290 = .sdata:0x8051E290; // type:object size:0x7 data:string lbl_8051E297 = .sdata:0x8051E297; // type:object size:0x7 data:string lbl_8051E29E = .sdata:0x8051E29E; // type:object size:0x6 data:string -lbl_8051E2A4 = .sdata:0x8051E2A4; // type:object size:0x1 data:byte +mRoomReadId__20dStage_roomControl_c = .sdata:0x8051E2A4; // type:object size:0x1 data:byte __RTTI__16dStage_stageDt_c = .sdata:0x8051E2A8; // type:object size:0x8 scope:global align:4 __RTTI__15dStage_roomDt_c = .sdata:0x8051E2B0; // type:object size:0x8 scope:global align:4 __RTTI__11dStage_dt_c = .sdata:0x8051E2B8; // type:object size:0x8 scope:global align:4 @@ -27603,10 +27603,10 @@ g_fpcPf_ProfileList_p = .sbss:0x80521148; // type:object size:0x4 scope:global a tmp_name$50691 = .sbss:0x80521150; // type:object size:0x8 scope:local align:1 data:byte mProcID__20dStage_roomControl_c = .sbss:0x80521158; // type:object size:0x4 scope:global align:4 data:4byte mStayNo__20dStage_roomControl_c = .sbss:0x8052115C; // type:object size:0x1 data:byte -lbl_8052115D = .sbss:0x8052115D; // type:object size:0x1 data:byte -lbl_8052115E = .sbss:0x8052115E; // type:object size:0x1 data:byte -lbl_8052115F = .sbss:0x8052115F; // type:object size:0x1 data:byte -lbl_80521160 = .sbss:0x80521160; // type:object size:0x1 data:byte +mOldStayNo__20dStage_roomControl_c = .sbss:0x8052115D; // type:object size:0x1 data:byte +mNextStayNo__20dStage_roomControl_c = .sbss:0x8052115E; // type:object size:0x1 data:byte +m_time_pass__20dStage_roomControl_c = .sbss:0x8052115F; // type:object size:0x1 data:byte +mNoChangeRoom__20dStage_roomControl_c = .sbss:0x80521160; // type:object size:0x1 data:byte mArcBankName__20dStage_roomControl_c = .sbss:0x80521164; // type:object size:0x4 scope:global align:4 data:4byte mArcBankData__20dStage_roomControl_c = .sbss:0x80521168; // type:object size:0x4 scope:global align:4 data:4byte m_roomDzs__20dStage_roomControl_c = .sbss:0x8052116C; // type:object size:0x8 scope:global align:4 diff --git a/config/Shield/symbols.txt b/config/Shield/symbols.txt index d90f87197a..f79dab20f7 100644 --- a/config/Shield/symbols.txt +++ b/config/Shield/symbols.txt @@ -23030,7 +23030,7 @@ g_fpcNd_IsCheckOfDeleteTiming = .sdata:0x80504EF0; // type:object size:0x4 scope @116401 = .sdata:0x80504F20; // type:object size:0x7 scope:local data:string hash:0xAC942746 @117095 = .sdata:0x80504F28; // type:object size:0x7 scope:local data:string hash:0xAC949B4E @117096 = .sdata:0x80504F30; // type:object size:0x6 scope:local data:string hash:0xAC949B4D -lbl_80504F36 = .sdata:0x80504F36; // type:object size:0x1 data:byte hash:0x1A63BEEE dhash:0x24126ACC +mRoomReadId__20dStage_roomControl_c = .sdata:0x80504F36; // type:object size:0x1 data:byte hash:0x1A63BEEE dhash:0x24126ACC __RTTI__16dStage_stageDt_c = .sdata:0x80504F38; // type:object size:0x8 scope:global hash:0x17B0566E dhash:0xF078A7E9 __RTTI__15dStage_roomDt_c = .sdata:0x80504F40; // type:object size:0x8 scope:global hash:0x0033F5F6 dhash:0xF77E0AD2 __RTTI__11dStage_dt_c = .sdata:0x80504F48; // type:object size:0x8 scope:global hash:0x5F98966D dhash:0x6874274D @@ -25275,10 +25275,10 @@ g_fpcPf_ProfileList_p = .sbss:0x80508B58; // type:object size:0x4 scope:global d @LOCAL@dStage_getName__FsSc@tmp_name = .sbss:0x80508B60; // type:object size:0x8 scope:local hash:0xDC907C52 dhash:0x0B811DD9 mProcID__20dStage_roomControl_c = .sbss:0x80508B68; // type:object size:0x4 scope:global data:4byte hash:0x24C2F7B2 dhash:0xBF1DEEF0 mStayNo__20dStage_roomControl_c = .sbss:0x80508B6C; // type:object size:0x1 data:byte hash:0x87058A4F dhash:0xB3B700CD -lbl_80508B6D = .sbss:0x80508B6D; // type:object size:0x1 data:byte hash:0x5AF37248 dhash:0x1A945A6A -lbl_80508B6E = .sbss:0x80508B6E; // type:object size:0x1 data:byte hash:0xE957ED68 dhash:0x66C51F6A -lbl_80508B6F = .sbss:0x80508B6F; // type:object size:0x1 data:byte hash:0x88D929D5 dhash:0xB0689D17 -lbl_80508B70 = .sbss:0x80508B70; // type:object size:0x1 data:byte hash:0x3F91BE16 dhash:0xDD72DA34 +mOldStayNo__20dStage_roomControl_c = .sbss:0x80508B6D; // type:object size:0x1 data:byte hash:0x5AF37248 dhash:0x1A945A6A +mNextStayNo__20dStage_roomControl_c = .sbss:0x80508B6E; // type:object size:0x1 data:byte hash:0xE957ED68 dhash:0x66C51F6A +m_time_pass__20dStage_roomControl_c = .sbss:0x80508B6F; // type:object size:0x1 data:byte hash:0x88D929D5 dhash:0xB0689D17 +mNoChangeRoom__20dStage_roomControl_c = .sbss:0x80508B70; // type:object size:0x1 data:byte hash:0x3F91BE16 dhash:0xDD72DA34 mArcBankName__20dStage_roomControl_c = .sbss:0x80508B74; // type:object size:0x4 scope:global data:4byte hash:0x885DF1A0 dhash:0xD2AA5D02 mArcBankData__20dStage_roomControl_c = .sbss:0x80508B78; // type:object size:0x4 scope:global data:4byte hash:0xF1AABD97 dhash:0xD2A70575 m_roomDzs__20dStage_roomControl_c = .sbss:0x80508B80; // type:object size:0x8 scope:global data:byte hash:0x67101B7C dhash:0x0B10A8BE diff --git a/config/ShieldD/splits.txt b/config/ShieldD/splits.txt index fc2f52bd7d..4916e4f9c7 100644 --- a/config/ShieldD/splits.txt +++ b/config/ShieldD/splits.txt @@ -156,7 +156,7 @@ f_ap/f_ap_game.cpp: .ctors start:0x8062F7E8 end:0x8062F7EC .data start:0x80667F90 end:0x80669130 .sdata start:0x8073F6E8 end:0x8073F850 - .sbss start:0x8074C47C end:0x8074C4A0 + .sbss start:0x8074C47C end:0x8074C498 .sdata2 start:0x8074D920 end:0x8074D950 .bss start:0x80776F20 end:0x8077EF68 @@ -165,7 +165,7 @@ f_op/f_op_actor.cpp: .ctors start:0x8062F7EC end:0x8062F7F0 .data start:0x80669130 end:0x80669848 .sdata start:0x8073F850 end:0x8073F8B8 - .sbss start:0x8074C4A0 end:0x8074C4E0 + .sbss start:0x8074C498 end:0x8074C4D8 .sdata2 start:0x8074D950 end:0x8074D998 .bss start:0x8077EF68 end:0x8077EF78 @@ -185,7 +185,7 @@ f_op/f_op_actor_mng.cpp: .rodata start:0x806311D0 end:0x80631200 .data start:0x80669848 end:0x8066AA10 .sdata start:0x8073F8B8 end:0x8073F970 - .sbss start:0x8074C4E0 end:0x8074C4F8 + .sbss start:0x8074C4D8 end:0x8074C4F8 .sdata2 start:0x8074D998 end:0x8074D9F0 .bss start:0x8077EF88 end:0x8077F148 diff --git a/config/ShieldD/symbols.txt b/config/ShieldD/symbols.txt index 25bbe3bb43..13235f88d5 100644 --- a/config/ShieldD/symbols.txt +++ b/config/ShieldD/symbols.txt @@ -64314,10 +64314,10 @@ lbl_8074C56C = .sbss:0x8074C56C; // type:object size:0x1 data:byte hash:0x5A01C5 @LOCAL@dStage_getName__FsSc@tmp_name = .sbss:0x8074C570; // type:object size:0x8 scope:local hash:0xDC907C52 dhash:0x0B811DD9 mProcID__20dStage_roomControl_c = .sbss:0x8074C578; // type:object size:0x4 scope:global data:4byte hash:0x24C2F7B2 dhash:0xBF1DEEF0 mStayNo__20dStage_roomControl_c = .sbss:0x8074C57C; // type:object size:0x1 data:byte hash:0x87058A4F dhash:0xB3B700CD -lbl_8074C57D = .sbss:0x8074C57D; // type:object size:0x1 data:byte hash:0x5AF37248 dhash:0x1A945A6A -dStage_roomControl_c::mNextStayNo = .sbss:0x8074C57E; // type:object size:0x1 data:byte hash:0xE957ED68 dhash:0x66C51F6A +mOldStayNo__20dStage_roomControl_c = .sbss:0x8074C57D; // type:object size:0x1 data:byte hash:0x5AF37248 dhash:0x1A945A6A +mNextStayNo__20dStage_roomControl_c = .sbss:0x8074C57E; // type:object size:0x1 data:byte hash:0xE957ED68 dhash:0x66C51F6A m_time_pass__20dStage_roomControl_c = .sbss:0x8074C57F; // type:object size:0x1 data:byte hash:0x88D929D5 dhash:0xB0689D17 -lbl_8074C580 = .sbss:0x8074C580; // type:object size:0x1 data:byte hash:0x3F91BE16 dhash:0xDD72DA34 +mNoChangeRoom__20dStage_roomControl_c = .sbss:0x8074C580; // type:object size:0x1 data:byte hash:0x3F91BE16 dhash:0xDD72DA34 mArcBankName__20dStage_roomControl_c = .sbss:0x8074C584; // type:object size:0x4 scope:global data:4byte hash:0x885DF1A0 dhash:0xD2AA5D02 mArcBankData__20dStage_roomControl_c = .sbss:0x8074C588; // type:object size:0x4 scope:global data:4byte hash:0xF1AABD97 dhash:0xD2A70575 m_roomDzs__20dStage_roomControl_c = .sbss:0x8074C590; // type:object size:0x8 scope:global hash:0x67101B7C dhash:0x0B10A8BE diff --git a/include/d/d_bg_parts.h b/include/d/d_bg_parts.h index e1dee27800..e36b6cba33 100644 --- a/include/d/d_bg_parts.h +++ b/include/d/d_bg_parts.h @@ -9,6 +9,8 @@ public: void draw(fopAc_ac_c*); int execute(bool); void releaseBg(); + + static void setPointer(void*); }; #endif /* D_D_BG_PARTS */ diff --git a/include/d/d_com_inf_game.h b/include/d/d_com_inf_game.h index dff02bc7ea..ff79f9dd4f 100644 --- a/include/d/d_com_inf_game.h +++ b/include/d/d_com_inf_game.h @@ -447,7 +447,7 @@ public: dMsgObject_c* getMsgObjectClass() { return mItemInfo.mMsgObjectClass; } dStage_roomControl_c* getRoomControl() { return &mRoomControl; } - dStage_dt_c& getStage() { return mStageData; } + dStage_stageDt_c& getStage() { return mStageData; } dEvt_control_c* getEvent() { return &mEvent; } daHorse_c* getHorseActor() { return (daHorse_c*)mPlayerPtr[1]; } J2DGrafContext* getCurrentGrafPort() { return (J2DGrafContext*)mCurrentGrafPort; } @@ -2108,7 +2108,7 @@ inline u32 dComIfGs_getTurnRestartParam() { return g_dComIfG_gameInfo.info.getTurnRestart().getParam(); } -inline cXyz& dComIfGs_getTurnRestartPos() { +inline const cXyz& dComIfGs_getTurnRestartPos() { return g_dComIfG_gameInfo.info.getTurnRestart().getPos(); } @@ -2124,7 +2124,7 @@ inline u32 dComIfGs_getRestartRoomParam() { return g_dComIfG_gameInfo.info.getRestart().getRoomParam(); } -inline cXyz& dComIfGs_getRestartRoomPos() { +inline const cXyz& dComIfGs_getRestartRoomPos() { return g_dComIfG_gameInfo.info.getRestart().getRoomPos(); } @@ -3029,7 +3029,7 @@ inline void dComIfGp_setItem(u8 slot, u8 i_no) { g_dComIfG_gameInfo.play.setItem(slot, i_no); } -inline dStage_dt_c* dComIfGp_getStage() { +inline dStage_stageDt_c* dComIfGp_getStage() { return &g_dComIfG_gameInfo.play.getStage(); } diff --git a/include/d/d_save.h b/include/d/d_save.h index 8c7f2b7e2f..47a3f88118 100644 --- a/include/d/d_save.h +++ b/include/d/d_save.h @@ -819,7 +819,7 @@ public: u32 getLastMode() const { return mLastMode; } s8 getRoomNo() const { return mRoomNo; } u32 getRoomParam() const { return mRoomParam; } - cXyz& getRoomPos() { return mRoomPos; } + const cXyz& getRoomPos() const { return mRoomPos; } s16 getRoomAngleY() const { return mRoomAngleY; } s16 getLastAngleY() const { return mLastAngleY; } f32 getLastSpeedF() const { return mLastSpeedF; } @@ -848,7 +848,7 @@ public: void set(const cXyz& i_position, s16 i_angleY, s8, u32 i_param); u32 getParam() const { return mParam; } - cXyz& getPos() { return mPosition; } + const cXyz& getPos() const { return mPosition; } s16 getAngleY() const { return mAngleY; } s8 getRoomNo() const { return unk18; } @@ -996,7 +996,7 @@ public: #if DEBUG /* 0x000 */ u8 unk_0x0; - /* 0x001 */ u8 unk_0x1; + /* 0x001 */ char unk_0x1; /* 0x000 */ u8 unk_0x2[0x48 - 0x2]; #endif /* 0x000 */ dSv_save_c mSavedata; diff --git a/include/d/d_stage.h b/include/d/d_stage.h index 00e46bb3ad..98e0cf5e07 100644 --- a/include/d/d_stage.h +++ b/include/d/d_stage.h @@ -535,6 +535,10 @@ public: /* vt[86] */ virtual stage_tgsc_class* getDrTg(void) const = 0; /* vt[87] */ virtual void setDoor(stage_tgsc_class*) = 0; /* vt[88] */ virtual stage_tgsc_class* getDoor(void) const = 0; +#if DEBUG + virtual void setUnit(void*) = 0; + virtual void* getUnit() = 0; +#endif /* vt[89] */ virtual void setMapPath(void*) = 0; /* vt[90] */ virtual void* getMapPath(void) = 0; /* vt[91] */ virtual void setElst(dStage_Elst_c*) = 0; @@ -547,194 +551,6 @@ private: void dStage_SetErrorStage(); void dStage_SetErrorRoom(); -class dStage_stageDt_c : public dStage_dt_c { -public: - dStage_stageDt_c() {} - - /* vt[ 2] */ virtual void init(void); - /* vt[ 3] */ virtual void setCamera(stage_camera_class* i_Camera) { mCamera = i_Camera; } - /* vt[ 4] */ virtual stage_camera_class* getCamera(void) const { return mCamera; } - /* vt[ 5] */ virtual void setArrow(stage_arrow_class* i_Arrow) { mArrow = i_Arrow; } - /* vt[ 6] */ virtual stage_arrow_class* getArrow(void) const { return mArrow; } - /* vt[ 7] */ virtual void setPlayer(stage_actor_class* i_Player) { mPlayer = i_Player; } - /* vt[ 8] */ virtual stage_actor_class* getPlayer(void) const { return mPlayer; } - /* vt[ 9] */ virtual void setPlayerNum(u16 i_PlayerNum) { mPlayerNum = i_PlayerNum; } - /* vt[10] */ virtual u16 getPlayerNum(void) const { return mPlayerNum; } - /* vt[11] */ virtual void setRoom(roomRead_class* i_Room) { mRoom = i_Room; } - /* vt[12] */ virtual roomRead_class* getRoom(void) const { return mRoom; } - /* vt[13] */ virtual void setMapInfo(stage_map_info_class* i_MapInfo) { mMapInfo = i_MapInfo; } - /* vt[14] */ virtual stage_map_info_class* getMapInfo(void) const { return mMapInfo; } - /* vt[15] */ virtual stage_map_info_class* getMapInfo2(int) const; - /* vt[16] */ virtual void setMapInfoBase(stage_map_info_dummy_class* i_MapInfoBase) { mMapInfoBase = i_MapInfoBase; } - /* vt[17] */ virtual stage_map_info_dummy_class* getMapInfoBase(void) const { return mMapInfoBase; } - /* vt[18] */ virtual void setPaletteInfo(stage_palette_info_class* i_PaletteInfo) { mPaletteInfo = i_PaletteInfo; } - /* vt[19] */ virtual stage_palette_info_class* getPaletteInfo(void) const { return mPaletteInfo; } - /* vt[20] */ virtual void setPselectInfo(stage_pselect_info_class* i_PselectInfo) { mPselectInfo = i_PselectInfo; } - /* vt[21] */ virtual stage_pselect_info_class* getPselectInfo(void) const { return mPselectInfo; } - /* vt[22] */ virtual void setEnvrInfo(stage_envr_info_class* i_EnvrInfo) { mEnvrInfo = i_EnvrInfo; } - /* vt[23] */ virtual stage_envr_info_class* getEnvrInfo(void) const { return mEnvrInfo; } - /* vt[24] */ virtual void setVrboxInfo(stage_vrbox_info_class* i_VrboxInfo) { mVrboxInfo = i_VrboxInfo; } - /* vt[25] */ virtual stage_vrbox_info_class* getVrboxInfo(void) const { return mVrboxInfo; } - /* vt[26] */ virtual void setVrboxcolInfo(stage_vrboxcol_info_class* i_VrboxcolInfo) { mVrboxcolInfo = i_VrboxcolInfo; } - /* vt[27] */ virtual stage_vrboxcol_info_class* getVrboxcolInfo(void) const { return mVrboxcolInfo; } - /* vt[28] */ virtual void setPlightInfo(stage_plight_info_class* i_PlightInfo) { mPlightInfo = i_PlightInfo; } - /* vt[29] */ virtual stage_plight_info_class* getPlightInfo(void) const { return mPlightInfo; } - /* vt[30] */ virtual void setPaletteNumInfo(int i_PaletteNumInfo) { mPaletteNumInfo = i_PaletteNumInfo; } - /* vt[31] */ virtual int getPaletteNumInfo(void) const { return mPaletteNumInfo; } - /* vt[32] */ virtual void setPselectNumInfo(int i_PselectNumInfo) { mPselectNumInfo = i_PselectNumInfo; } - /* vt[33] */ virtual int getPselectNumInfo(void) const { return mPselectNumInfo; } - /* vt[34] */ virtual void setEnvrNumInfo(int i_EnvrNumInfo) { mEnvrNumInfo = i_EnvrNumInfo; } - /* vt[35] */ virtual int getEnvrNumInfo(void) const { return mEnvrNumInfo; } - /* vt[36] */ virtual void setVrboxNumInfo(int i_VrboxNumInfo) { mVrboxNumInfo = i_VrboxNumInfo; } - /* vt[37] */ virtual int getVrboxNumInfo(void) const { return mVrboxNumInfo; } - /* vt[38] */ virtual void setVrboxcolNumInfo(int i_VrboxcolNumInfo) { mVrboxcolNumInfo = i_VrboxcolNumInfo; } - /* vt[39] */ virtual int getVrboxcolNumInfo(void) const { return mVrboxcolNumInfo; } - /* vt[42] */ virtual void setLightVecInfo(stage_pure_lightvec_info_class* i_LightVecInfo) { - UNUSED(i_LightVecInfo); - dStage_SetErrorStage(); - OSReport("stage non LightVec data !!\n"); - JUT_ASSERT(3003, FALSE); - } - /* vt[43] */ virtual stage_pure_lightvec_info_class* getLightVecInfo(void) const { - OSReport("stage non LightVec data !!\n"); - JUT_ASSERT(3007, FALSE); - return NULL; - } - /* vt[44] */ virtual void setLightVecInfoNum(int i_LightVecInfoNum) { - UNUSED(i_LightVecInfoNum); - dStage_SetErrorStage(); - OSReport("stage non LightVecNum data !!\n"); - JUT_ASSERT(3014, FALSE); - } - /* vt[45] */ virtual int getLightVecInfoNum(void) const { - OSReport("stage non LightVecNum data !!\n"); - JUT_ASSERT(3018, FALSE); - return NULL; - } - /* vt[40] */ virtual void setPlightNumInfo(int i_PlightNumInfo) { mPlightNumInfo = i_PlightNumInfo; } - /* vt[41] */ virtual int getPlightNumInfo(void) const { return mPlightNumInfo; } - /* vt[46] */ virtual void setStagInfo(stage_stag_info_class* i_StagInfo) { mStagInfo = i_StagInfo; } - /* vt[47] */ virtual stage_stag_info_class* getStagInfo(void) const { return mStagInfo; } - /* vt[48] */ virtual void setSclsInfo(stage_scls_info_dummy_class* i_SclsInfo) { mSclsInfo = i_SclsInfo; } - /* vt[49] */ virtual stage_scls_info_dummy_class* getSclsInfo(void) const { return mSclsInfo; } - /* vt[50] */ virtual void setPntInfo(dStage_dPnt_c* i_PntInfo) { mPntInfo = i_PntInfo; } - /* vt[51] */ virtual dStage_dPnt_c* getPntInf(void) const { return mPntInfo; } - /* vt[52] */ virtual void setPathInfo(dStage_dPath_c* i_PathInfo) { mPathInfo = i_PathInfo; } - /* vt[53] */ virtual dStage_dPath_c* getPathInf(void) const { return mPathInfo; } - /* vt[54] */ virtual void setPnt2Info(dStage_dPnt_c* i_Pnt2Info) { mPnt2Info = i_Pnt2Info; } - /* vt[55] */ virtual dStage_dPnt_c* getPnt2Inf(void) const { return mPnt2Info; } - /* vt[56] */ virtual void setPath2Info(dStage_dPath_c* i_Path2Info) { mPath2Info = i_Path2Info; } - /* vt[57] */ virtual dStage_dPath_c* getPath2Inf(void) const { return mPath2Info; } - /* vt[58] */ virtual void setSoundInf(dStage_SoundInfo_c* i_SoundInf) { mSoundInf = i_SoundInf; } - /* vt[59] */ virtual dStage_SoundInfo_c* getSoundInf(void) const { return mSoundInf; } - /* vt[60] */ virtual void setSoundInfCL(dStage_SoundInfo_c* i_SoundInfCL) { mSoundInfCL = i_SoundInfCL; } - /* vt[61] */ virtual dStage_SoundInfo_c* getSoundInfCL(void) const { return mSoundInfCL; } - /* vt[62] */ virtual void setMapEventInfo(dStage_MapEventInfo_c* i_MapEventInfo) { mMapEventInfo = i_MapEventInfo; } - /* vt[63] */ virtual dStage_MapEventInfo_c* getMapEventInfo(void) const { return mMapEventInfo; } - /* vt[64] */ virtual void setFileList2Info(dStage_FileList2_dt_c* list) { - UNUSED(list); - dStage_SetErrorStage(); - OSReport("stage non filelist2 data!\n"); - JUT_ASSERT(3123, FALSE); - } - /* vt[65] */ virtual dStage_FileList2_dt_c* getFileList2Info(void) const { - OSReport("stage non filelist2 data!\n"); - JUT_ASSERT(3127, FALSE); - return NULL; - } - /* vt[66] */ virtual void setFileListInfo(dStage_FileList_dt_c* list) { - UNUSED(list); - dStage_SetErrorStage(); - OSReport("stage non filelist data!\n"); - JUT_ASSERT(3138, FALSE); - } - /* vt[67] */ virtual dStage_FileList_dt_c* getFileListInfo(void) const { - OSReport("stage non filelist data!\n"); - JUT_ASSERT(3142, FALSE); - return NULL; - } - /* vt[68] */ virtual void setFloorInfo(dStage_FloorInfo_c* i_FloorInfo) { mFloorInfo = i_FloorInfo; } - /* vt[69] */ virtual dStage_FloorInfo_c* getFloorInfo(void) const { return mFloorInfo; } - /* vt[70] */ virtual void setMemoryConfig(dStage_MemoryConfig_c* i_MemoryConfig) { mMemoryConfig = i_MemoryConfig; } - /* vt[71] */ virtual dStage_MemoryConfig_c* getMemoryConfig(void) const { return mMemoryConfig; } - /* vt[72] */ virtual void setMemoryMap(dStage_MemoryMap_c* i_MemoryMap) { mMemoryMap = i_MemoryMap; } - /* vt[73] */ virtual dStage_MemoryMap_c* getMemoryMap(void) const { return mMemoryMap; } - /* vt[74] */ virtual void setMulti(dStage_Multi_c* i_Multi) { mMulti = i_Multi; } - /* vt[75] */ virtual dStage_Multi_c* getMulti(void) const { return mMulti; } - /* vt[76] */ virtual void setOldMulti(void); - /* vt[77] */ virtual void resetOldMulti(void); - /* vt[78] */ virtual dStage_Multi_c* getOldMulti(void) const { return mOldMulti; } - /* vt[79] */ virtual void setLbnk(dStage_Lbnk_c* lbnk) { - UNUSED(lbnk); - dStage_SetErrorStage(); - OSReport("stage non Lbnk data!\n"); - JUT_ASSERT(3231, FALSE); - } - /* vt[80] */ virtual dStage_Lbnk_c* getLbnk(void) const { - OSReport("stage non Lbnk data!\n"); - JUT_ASSERT(3238, FALSE); - return NULL; - } - /* vt[81] */ virtual void setTresure(stage_tresure_class* i_Tresure) { mTresure = i_Tresure; } - /* vt[82] */ virtual stage_tresure_class* getTresure(void) const { return mTresure; } - /* vt[83] */ virtual void setDMap(dStage_DMap_c* i_DMap) { mDMap = i_DMap; } - /* vt[84] */ virtual dStage_DMap_c* getDMap(void) const { return mDMap; } - /* vt[85] */ virtual void setDrTg(stage_tgsc_class* i_DrTg) { mDrTg = i_DrTg; } - /* vt[86] */ virtual stage_tgsc_class* getDrTg(void) const { return mDrTg; } - /* vt[87] */ virtual void setDoor(stage_tgsc_class* i_Door) { mDoor = i_Door; } - /* vt[88] */ virtual stage_tgsc_class* getDoor(void) const { return mDoor; } - /* vt[89] */ virtual void setMapPath(void* i_MapPath) { return; } - /* vt[90] */ virtual void* getMapPath(void) { return NULL; } - /* vt[91] */ virtual void setElst(dStage_Elst_c* i_Elst) { mElst = i_Elst; } - /* vt[92] */ virtual dStage_Elst_c* getElst(void); - - s16 getWorldRollAngleX() const { return (s16)mWorldRollAngleX; } - s16 getWorldRollDirAngleY() const { return mWorldRollDirAngleY; } - -public: - /* 0x08 */ stage_camera_class* mCamera; - /* 0x0C */ stage_arrow_class* mArrow; - /* 0x10 */ stage_actor_class* mPlayer; - /* 0x14 */ roomRead_class* mRoom; - /* 0x18 */ stage_map_info_class* mMapInfo; - /* 0x1C */ stage_map_info_dummy_class* mMapInfoBase; - /* 0x20 */ stage_palette_info_class* mPaletteInfo; - /* 0x24 */ stage_pselect_info_class* mPselectInfo; - /* 0x28 */ stage_envr_info_class* mEnvrInfo; - /* 0x2C */ stage_vrbox_info_class* mVrboxInfo; - /* 0x30 */ stage_vrboxcol_info_class* mVrboxcolInfo; - /* 0x34 */ stage_plight_info_class* mPlightInfo; - /* 0x38 */ dStage_MapEventInfo_c* mMapEventInfo; - /* 0x3C */ u32 mPaletteNumInfo; - /* 0x40 */ u32 mPselectNumInfo; - /* 0x44 */ u32 mEnvrNumInfo; - /* 0x48 */ u32 mVrboxNumInfo; - /* 0x4C */ int mVrboxcolNumInfo; - /* 0x50 */ u32 mPlightNumInfo; - /* 0x54 */ u16 mPlayerNum; - /* 0x56 */ s16 mWorldRollAngleX; - /* 0x58 */ s16 mWorldRollDirAngleY; - /* 0x5A */ u16 field_0x5a; - /* 0x5C */ stage_stag_info_class* mStagInfo; - /* 0x60 */ stage_scls_info_dummy_class* mSclsInfo; - /* 0x64 */ dStage_dPnt_c* mPntInfo; - /* 0x68 */ dStage_dPath_c* mPathInfo; - /* 0x6C */ dStage_dPnt_c* mPnt2Info; - /* 0x70 */ dStage_dPath_c* mPath2Info; - /* 0x74 */ dStage_SoundInfo_c* mSoundInf; - /* 0x78 */ dStage_SoundInfo_c* mSoundInfCL; - /* 0x7C */ dStage_FloorInfo_c* mFloorInfo; - /* 0x80 */ dStage_MemoryConfig_c* mMemoryConfig; - /* 0x84 */ dStage_MemoryMap_c* mMemoryMap; - /* 0x88 */ dStage_Multi_c* mMulti; - /* 0x8C */ dStage_Multi_c* mOldMulti; - /* 0x90 */ stage_tresure_class* mTresure; - /* 0x94 */ dStage_DMap_c* mDMap; - /* 0x98 */ stage_tgsc_class* mDrTg; - /* 0x9C */ stage_tgsc_class* mDoor; - /* 0xA0 */ dStage_Elst_c* mElst; -}; - class dStage_roomDt_c : public dStage_dt_c { public: dStage_roomDt_c() {} @@ -977,6 +793,10 @@ public: virtual stage_tgsc_class* getDrTg(void) const { return mDrTg; } virtual void setDoor(stage_tgsc_class* i_Door) { mDoor = i_Door; } virtual stage_tgsc_class* getDoor(void) const { return mDoor; } +#if DEBUG + virtual void setUnit(void* i_Unit) { mUnit = i_Unit; } + virtual void* getUnit() { return mUnit; } +#endif virtual void setMapPath(void* i_MapPath) { UNUSED(i_MapPath); OSReport("stage non 2d map path data !!\n"); @@ -1023,7 +843,7 @@ public: /* 0x58 */ stage_tgsc_class* mDoor; /* 0x5C */ dStage_FloorInfo_c* mFloorInfo; #if DEBUG - /* 0x60 */ int field_0x60; + /* 0x60 */ void* mUnit; #endif /* 0x60 */ u16 mPlayerNum; /* 0x62 */ u16 field_0x62; @@ -1031,6 +851,206 @@ public: /* 0x68 */ int mVrboxcolNumInfo; }; // Size: 0x6C +class dStage_stageDt_c : public dStage_dt_c { +public: + dStage_stageDt_c() {} + + /* vt[ 2] */ virtual void init(void); + /* vt[ 3] */ virtual void setCamera(stage_camera_class* i_Camera) { mCamera = i_Camera; } + /* vt[ 4] */ virtual stage_camera_class* getCamera(void) const { return mCamera; } + /* vt[ 5] */ virtual void setArrow(stage_arrow_class* i_Arrow) { mArrow = i_Arrow; } + /* vt[ 6] */ virtual stage_arrow_class* getArrow(void) const { return mArrow; } + /* vt[ 7] */ virtual void setPlayer(stage_actor_class* i_Player) { mPlayer = i_Player; } + /* vt[ 8] */ virtual stage_actor_class* getPlayer(void) const { return mPlayer; } + /* vt[ 9] */ virtual void setPlayerNum(u16 i_PlayerNum) { mPlayerNum = i_PlayerNum; } + /* vt[10] */ virtual u16 getPlayerNum(void) const { return mPlayerNum; } + /* vt[11] */ virtual void setRoom(roomRead_class* i_Room) { mRoom = i_Room; } + /* vt[12] */ virtual roomRead_class* getRoom(void) const { return mRoom; } + /* vt[13] */ virtual void setMapInfo(stage_map_info_class* i_MapInfo) { mMapInfo = i_MapInfo; } + /* vt[14] */ virtual stage_map_info_class* getMapInfo(void) const { return mMapInfo; } + /* vt[15] */ virtual stage_map_info_class* getMapInfo2(int) const; + /* vt[16] */ virtual void setMapInfoBase(stage_map_info_dummy_class* i_MapInfoBase) { mMapInfoBase = i_MapInfoBase; } + /* vt[17] */ virtual stage_map_info_dummy_class* getMapInfoBase(void) const { return mMapInfoBase; } + /* vt[18] */ virtual void setPaletteInfo(stage_palette_info_class* i_PaletteInfo) { mPaletteInfo = i_PaletteInfo; } + /* vt[19] */ virtual stage_palette_info_class* getPaletteInfo(void) const { return mPaletteInfo; } + /* vt[20] */ virtual void setPselectInfo(stage_pselect_info_class* i_PselectInfo) { mPselectInfo = i_PselectInfo; } + /* vt[21] */ virtual stage_pselect_info_class* getPselectInfo(void) const { return mPselectInfo; } + /* vt[22] */ virtual void setEnvrInfo(stage_envr_info_class* i_EnvrInfo) { mEnvrInfo = i_EnvrInfo; } + /* vt[23] */ virtual stage_envr_info_class* getEnvrInfo(void) const { return mEnvrInfo; } + /* vt[24] */ virtual void setVrboxInfo(stage_vrbox_info_class* i_VrboxInfo) { mVrboxInfo = i_VrboxInfo; } + /* vt[25] */ virtual stage_vrbox_info_class* getVrboxInfo(void) const { return mVrboxInfo; } + /* vt[26] */ virtual void setVrboxcolInfo(stage_vrboxcol_info_class* i_VrboxcolInfo) { mVrboxcolInfo = i_VrboxcolInfo; } + /* vt[27] */ virtual stage_vrboxcol_info_class* getVrboxcolInfo(void) const { return mVrboxcolInfo; } + /* vt[28] */ virtual void setPlightInfo(stage_plight_info_class* i_PlightInfo) { mPlightInfo = i_PlightInfo; } + /* vt[29] */ virtual stage_plight_info_class* getPlightInfo(void) const { return mPlightInfo; } + /* vt[30] */ virtual void setPaletteNumInfo(int i_PaletteNumInfo) { mPaletteNumInfo = i_PaletteNumInfo; } + /* vt[31] */ virtual int getPaletteNumInfo(void) const { return mPaletteNumInfo; } + /* vt[32] */ virtual void setPselectNumInfo(int i_PselectNumInfo) { mPselectNumInfo = i_PselectNumInfo; } + /* vt[33] */ virtual int getPselectNumInfo(void) const { return mPselectNumInfo; } + /* vt[34] */ virtual void setEnvrNumInfo(int i_EnvrNumInfo) { mEnvrNumInfo = i_EnvrNumInfo; } + /* vt[35] */ virtual int getEnvrNumInfo(void) const { return mEnvrNumInfo; } + /* vt[36] */ virtual void setVrboxNumInfo(int i_VrboxNumInfo) { mVrboxNumInfo = i_VrboxNumInfo; } + /* vt[37] */ virtual int getVrboxNumInfo(void) const { return mVrboxNumInfo; } + /* vt[38] */ virtual void setVrboxcolNumInfo(int i_VrboxcolNumInfo) { mVrboxcolNumInfo = i_VrboxcolNumInfo; } + /* vt[39] */ virtual int getVrboxcolNumInfo(void) const { return mVrboxcolNumInfo; } + /* vt[42] */ virtual void setLightVecInfo(stage_pure_lightvec_info_class* i_LightVecInfo) { + UNUSED(i_LightVecInfo); + dStage_SetErrorStage(); + OSReport("stage non LightVec data !!\n"); + JUT_ASSERT(3003, FALSE); + } + /* vt[43] */ virtual stage_pure_lightvec_info_class* getLightVecInfo(void) const { + OSReport("stage non LightVec data !!\n"); + JUT_ASSERT(3007, FALSE); + return NULL; + } + /* vt[44] */ virtual void setLightVecInfoNum(int i_LightVecInfoNum) { + UNUSED(i_LightVecInfoNum); + dStage_SetErrorStage(); + OSReport("stage non LightVecNum data !!\n"); + JUT_ASSERT(3014, FALSE); + } + /* vt[45] */ virtual int getLightVecInfoNum(void) const { + OSReport("stage non LightVecNum data !!\n"); + JUT_ASSERT(3018, FALSE); + return NULL; + } + /* vt[40] */ virtual void setPlightNumInfo(int i_PlightNumInfo) { mPlightNumInfo = i_PlightNumInfo; } + /* vt[41] */ virtual int getPlightNumInfo(void) const { return mPlightNumInfo; } + /* vt[46] */ virtual void setStagInfo(stage_stag_info_class* i_StagInfo) { mStagInfo = i_StagInfo; } + /* vt[47] */ virtual stage_stag_info_class* getStagInfo(void) const { return mStagInfo; } + /* vt[48] */ virtual void setSclsInfo(stage_scls_info_dummy_class* i_SclsInfo) { mSclsInfo = i_SclsInfo; } + /* vt[49] */ virtual stage_scls_info_dummy_class* getSclsInfo(void) const { return mSclsInfo; } + /* vt[50] */ virtual void setPntInfo(dStage_dPnt_c* i_PntInfo) { mPntInfo = i_PntInfo; } + /* vt[51] */ virtual dStage_dPnt_c* getPntInf(void) const { return mPntInfo; } + /* vt[52] */ virtual void setPathInfo(dStage_dPath_c* i_PathInfo) { mPathInfo = i_PathInfo; } + /* vt[53] */ virtual dStage_dPath_c* getPathInf(void) const { return mPathInfo; } + /* vt[54] */ virtual void setPnt2Info(dStage_dPnt_c* i_Pnt2Info) { mPnt2Info = i_Pnt2Info; } + /* vt[55] */ virtual dStage_dPnt_c* getPnt2Inf(void) const { return mPnt2Info; } + /* vt[56] */ virtual void setPath2Info(dStage_dPath_c* i_Path2Info) { mPath2Info = i_Path2Info; } + /* vt[57] */ virtual dStage_dPath_c* getPath2Inf(void) const { return mPath2Info; } + /* vt[58] */ virtual void setSoundInf(dStage_SoundInfo_c* i_SoundInf) { mSoundInf = i_SoundInf; } + /* vt[59] */ virtual dStage_SoundInfo_c* getSoundInf(void) const { return mSoundInf; } + /* vt[60] */ virtual void setSoundInfCL(dStage_SoundInfo_c* i_SoundInfCL) { mSoundInfCL = i_SoundInfCL; } + /* vt[61] */ virtual dStage_SoundInfo_c* getSoundInfCL(void) const { return mSoundInfCL; } + /* vt[62] */ virtual void setMapEventInfo(dStage_MapEventInfo_c* i_MapEventInfo) { mMapEventInfo = i_MapEventInfo; } + /* vt[63] */ virtual dStage_MapEventInfo_c* getMapEventInfo(void) const { return mMapEventInfo; } + /* vt[64] */ virtual void setFileList2Info(dStage_FileList2_dt_c* list) { + UNUSED(list); + dStage_SetErrorStage(); + OSReport("stage non filelist2 data!\n"); + JUT_ASSERT(3123, FALSE); + } + /* vt[65] */ virtual dStage_FileList2_dt_c* getFileList2Info(void) const { + OSReport("stage non filelist2 data!\n"); + JUT_ASSERT(3127, FALSE); + return NULL; + } + /* vt[66] */ virtual void setFileListInfo(dStage_FileList_dt_c* list) { + UNUSED(list); + dStage_SetErrorStage(); + OSReport("stage non filelist data!\n"); + JUT_ASSERT(3138, FALSE); + } + /* vt[67] */ virtual dStage_FileList_dt_c* getFileListInfo(void) const { + OSReport("stage non filelist data!\n"); + JUT_ASSERT(3142, FALSE); + return NULL; + } + /* vt[68] */ virtual void setFloorInfo(dStage_FloorInfo_c* i_FloorInfo) { mFloorInfo = i_FloorInfo; } + /* vt[69] */ virtual dStage_FloorInfo_c* getFloorInfo(void) const { return mFloorInfo; } + /* vt[70] */ virtual void setMemoryConfig(dStage_MemoryConfig_c* i_MemoryConfig) { mMemoryConfig = i_MemoryConfig; } + /* vt[71] */ virtual dStage_MemoryConfig_c* getMemoryConfig(void) const { return mMemoryConfig; } + /* vt[72] */ virtual void setMemoryMap(dStage_MemoryMap_c* i_MemoryMap) { mMemoryMap = i_MemoryMap; } + /* vt[73] */ virtual dStage_MemoryMap_c* getMemoryMap(void) const { return mMemoryMap; } + /* vt[74] */ virtual void setMulti(dStage_Multi_c* i_Multi) { mMulti = i_Multi; } + /* vt[75] */ virtual dStage_Multi_c* getMulti(void) const { return mMulti; } + /* vt[76] */ virtual void setOldMulti(void) { mOldMulti = mMulti; } + /* vt[77] */ virtual void resetOldMulti(void) { mOldMulti = NULL; } + /* vt[78] */ virtual dStage_Multi_c* getOldMulti(void) const { return mOldMulti; } + /* vt[79] */ virtual void setLbnk(dStage_Lbnk_c* lbnk) { + UNUSED(lbnk); + dStage_SetErrorStage(); + OSReport("stage non Lbnk data!\n"); + JUT_ASSERT(3231, FALSE); + } + /* vt[80] */ virtual dStage_Lbnk_c* getLbnk(void) const { + OSReport("stage non Lbnk data!\n"); + JUT_ASSERT(3238, FALSE); + return NULL; + } + /* vt[81] */ virtual void setTresure(stage_tresure_class* i_Tresure) { mTresure = i_Tresure; } + /* vt[82] */ virtual stage_tresure_class* getTresure(void) const { return mTresure; } + /* vt[83] */ virtual void setDMap(dStage_DMap_c* i_DMap) { mDMap = i_DMap; } + /* vt[84] */ virtual dStage_DMap_c* getDMap(void) const { return mDMap; } + /* vt[85] */ virtual void setDrTg(stage_tgsc_class* i_DrTg) { mDrTg = i_DrTg; } + /* vt[86] */ virtual stage_tgsc_class* getDrTg(void) const { return mDrTg; } + /* vt[87] */ virtual void setDoor(stage_tgsc_class* i_Door) { mDoor = i_Door; } + /* vt[88] */ virtual stage_tgsc_class* getDoor(void) const { return mDoor; } +#if DEBUG + virtual void setUnit(void* i_Unit) { + UNUSED(i_Unit); + OSReport("stage non unit list data !!\n"); + JUT_ASSERT(3321, 0); + } + virtual void* getUnit() { + OSReport("stage non unit list data !!\n"); + JUT_ASSERT(3325, 0); + return NULL; + } +#endif + /* vt[89] */ virtual void setMapPath(void* i_MapPath) { return; } + /* vt[90] */ virtual void* getMapPath(void) { return NULL; } + /* vt[91] */ virtual void setElst(dStage_Elst_c* i_Elst) { mElst = i_Elst; } + /* vt[92] */ virtual dStage_Elst_c* getElst(void); + + s16 getWorldRollAngleX() const { return (s16)mWorldRollAngleX; } + s16 getWorldRollDirAngleY() const { return mWorldRollDirAngleY; } + +public: + /* 0x08 */ stage_camera_class* mCamera; + /* 0x0C */ stage_arrow_class* mArrow; + /* 0x10 */ stage_actor_class* mPlayer; + /* 0x14 */ roomRead_class* mRoom; + /* 0x18 */ stage_map_info_class* mMapInfo; + /* 0x1C */ stage_map_info_dummy_class* mMapInfoBase; + /* 0x20 */ stage_palette_info_class* mPaletteInfo; + /* 0x24 */ stage_pselect_info_class* mPselectInfo; + /* 0x28 */ stage_envr_info_class* mEnvrInfo; + /* 0x2C */ stage_vrbox_info_class* mVrboxInfo; + /* 0x30 */ stage_vrboxcol_info_class* mVrboxcolInfo; + /* 0x34 */ stage_plight_info_class* mPlightInfo; + /* 0x38 */ dStage_MapEventInfo_c* mMapEventInfo; + /* 0x3C */ u32 mPaletteNumInfo; + /* 0x40 */ u32 mPselectNumInfo; + /* 0x44 */ u32 mEnvrNumInfo; + /* 0x48 */ u32 mVrboxNumInfo; + /* 0x4C */ int mVrboxcolNumInfo; + /* 0x50 */ u32 mPlightNumInfo; + /* 0x54 */ u16 mPlayerNum; + /* 0x56 */ s16 mWorldRollAngleX; + /* 0x58 */ s16 mWorldRollDirAngleY; + /* 0x5A */ u16 field_0x5a; + /* 0x5C */ stage_stag_info_class* mStagInfo; + /* 0x60 */ stage_scls_info_dummy_class* mSclsInfo; + /* 0x64 */ dStage_dPnt_c* mPntInfo; + /* 0x68 */ dStage_dPath_c* mPathInfo; + /* 0x6C */ dStage_dPnt_c* mPnt2Info; + /* 0x70 */ dStage_dPath_c* mPath2Info; + /* 0x74 */ dStage_SoundInfo_c* mSoundInf; + /* 0x78 */ dStage_SoundInfo_c* mSoundInfCL; + /* 0x7C */ dStage_FloorInfo_c* mFloorInfo; + /* 0x80 */ dStage_MemoryConfig_c* mMemoryConfig; + /* 0x84 */ dStage_MemoryMap_c* mMemoryMap; + /* 0x88 */ dStage_Multi_c* mMulti; + /* 0x8C */ dStage_Multi_c* mOldMulti; + /* 0x90 */ stage_tresure_class* mTresure; + /* 0x94 */ dStage_DMap_c* mDMap; + /* 0x98 */ stage_tgsc_class* mDrTg; + /* 0x9C */ stage_tgsc_class* mDoor; + /* 0xA0 */ dStage_Elst_c* mElst; +}; + class dBgW_Base; class dStage_roomStatus_c { @@ -1113,7 +1133,10 @@ public: static int getStayNo() { return mStayNo; } static u8 getRegionNo(int i_roomNo) { return mStatus[i_roomNo].mRegionNo; } - static s8 getMemoryBlockID(int i_roomNo) { return mStatus[i_roomNo].mMemBlockID; } + static int getMemoryBlockID(int i_roomNo) { + JUT_ASSERT(2757, 0 <= i_roomNo && i_roomNo < 64); + return mStatus[i_roomNo].mMemBlockID; + } dKy_tevstr_c* getTevStr(int i_roomNo) { JUT_ASSERT(2675, 0 <= i_roomNo && i_roomNo < 64); return &mStatus[i_roomNo].mKyTevStr; @@ -1122,9 +1145,13 @@ public: JUT_ASSERT(2679, 0 <= i_roomNo && i_roomNo < 64); mStatus[i_roomNo].mFlag = flag; } - static void onStatusDraw(int i_roomNo) { mStatus[i_roomNo].mDraw = true; } + static void onStatusDraw(int i_roomNo) { + JUT_ASSERT(2725, 0 <= i_roomNo && i_roomNo < 64); + mStatus[i_roomNo].mDraw = true; + } static dStage_FileList2_dt_c* getFileList2(int i_roomNo) { - return mStatus[i_roomNo].mRoomDt.mFileList2Info; + JUT_ASSERT(2715, 0 <= i_roomNo && i_roomNo < 64); + return mStatus[i_roomNo].mRoomDt.getFileList2Info(); } static char* getDemoArcName() { return mDemoArcName; } static nameData* getArcBankName() { return mArcBankName; } @@ -1379,7 +1406,7 @@ inline s32 dStage_roomRead_dt_c_GetTimePass(roomRead_data_class& data) { return data.field_0x2 & 3; } -inline u8 dStage_roomRead_dt_c_GetLoadRoomIndex(u8 param_0) { +inline int dStage_roomRead_dt_c_GetLoadRoomIndex(u8 param_0) { return param_0 & 0x3f; } diff --git a/include/f_ap/f_ap_game.h b/include/f_ap/f_ap_game.h index e0162fcf38..79bbb1b24f 100644 --- a/include/f_ap/f_ap_game.h +++ b/include/f_ap/f_ap_game.h @@ -185,6 +185,10 @@ inline u8 fapGmHIO_getGamma() { } #endif +inline u8 fapGmHIO_getMemoryBlockOff() { + return g_HIO.mMemBlockOff; +} + struct fapGm_dataMem { enum HeapType_e { HeapType_Error_e, diff --git a/include/f_op/f_op_actor_mng.h b/include/f_op/f_op_actor_mng.h index 5e67374270..868671d2d8 100644 --- a/include/f_op/f_op_actor_mng.h +++ b/include/f_op/f_op_actor_mng.h @@ -545,10 +545,6 @@ fpc_ProcID fopAcM_create(s16 i_procName, u16 i_setId, u32 i_parameters, const cX fpc_ProcID fopAcM_create(s16 i_procName, u32 i_parameters, const cXyz* i_pos, int i_roomNo, const csXyz* i_angle, const cXyz* i_scale, s8 i_argument); -inline fpc_ProcID fopAcM_create(s16 i_procName, createFunc i_createFunc, void* params) { - return fpcM_Create(i_procName, i_createFunc, params); -} - inline fpc_ProcID fopAcM_Create(s16 i_procName, createFunc i_createFunc, void* params) { return fpcM_Create(i_procName, i_createFunc,params); } diff --git a/src/d/d_stage.cpp b/src/d/d_stage.cpp index 809afb65fc..b00b4ec845 100644 --- a/src/d/d_stage.cpp +++ b/src/d/d_stage.cpp @@ -12,6 +12,7 @@ #include "d/d_path.h" #include "d/d_save_HIO.h" #include "d/d_stage.h" +#include "f_ap/f_ap_game.h" #include "f_op/f_op_kankyo_mng.h" #include "f_op/f_op_msg_mng.h" #include "f_op/f_op_scene_mng.h" @@ -25,6 +26,11 @@ void dStage_nextStage_c::set(const char* i_stage, s8 i_roomId, s16 i_point, s8 i enabled = true; wipe = i_wipe; wipe_speed = i_speed; +#if DEBUG + if (g_kankyoHIO.navy.fade_test_speed) { + wipe_speed = g_kankyoHIO.navy.fade_test_speed; + } +#endif dStage_startStage_c::set(i_stage, i_roomId, i_point, i_layer); if (!strcmp(i_stage, "OPENING")) { mDoRst::onReset(); @@ -35,11 +41,13 @@ void dStage_nextStage_c::set(const char* i_stage, s8 i_roomId, s16 i_point, s8 i void dStage_SetErrorRoom() { // "Room information might be corrupted. \nPlease try to re-convert. \n" OSReport_Error("部屋情報が、多分ですが壊れています。\n変換し直してみてください。\n"); + OS_REPORT("または、ステージの情報が部屋にあります。↓を参考に。\n"); } void dStage_SetErrorStage() { // "Stage information might be corrupted. \nPlease try to re-convert. " OSReport_Error("ステージ情報が、多分ですが壊れています。\n変換し直してみてください。"); + OS_REPORT("または、部屋の情報がステージにあります。↓を参考に。\n"); } static dStage_KeepDoorInfo DoorInfo; @@ -48,14 +56,20 @@ dStage_KeepDoorInfo* dStage_GetKeepDoorInfo() { return &DoorInfo; } -static u8 dStage_isBossStage(dStage_dt_c* i_stage) { +static bool dStage_isBossStage(dStage_dt_c* i_stage) { stage_stag_info_class* pstag = i_stage->getStagInfo(); + JUT_ASSERT(127, pstag != 0); if (pstag == NULL) { return false; } - return dStage_stagInfo_GetSTType(pstag) == ST_BOSS_ROOM; + u32 stType = dStage_stagInfo_GetSTType(pstag); + if (stType == ST_BOSS_ROOM) { + return true; + } else { + return false; + } } static void dStage_KeepDoorInfoInit(dStage_dt_c* i_stage) { @@ -65,6 +79,7 @@ static void dStage_KeepDoorInfoInit(dStage_dt_c* i_stage) { } static void dStage_KeepDoorInfoProc(dStage_dt_c* i_stage, stage_tgsc_class* i_drtg) { + UNUSED(i_stage); if (i_drtg == NULL) { DoorInfo.mNum = 0; return; @@ -79,8 +94,10 @@ static void dStage_KeepDoorInfoProc(dStage_dt_c* i_stage, stage_tgsc_class* i_dr } stage_tgsc_data_class* pSrcEntry = i_drtg->m_entries; stage_tgsc_data_class* pDstEntry = DoorInfo.mDrTgData; - for (int i = 0; i < DoorInfo.mNum; pDstEntry++, pSrcEntry++, i++) { + for (int i = 0; i < DoorInfo.mNum; i++) { *pDstEntry = *pSrcEntry; + pDstEntry++; + pSrcEntry++; } } @@ -95,7 +112,10 @@ static void dStage_initRoomKeepDoorInfo() { } static void dStage_RoomKeepDoorInfoProc(dStage_dt_c* i_stage, stage_tgsc_class* param_2) { - if (param_2 == NULL || param_2->num + l_RoomKeepDoorInfo.mNum >= 0x40 || param_2->num < 0) { + if (param_2 == NULL) { + return; + } + if (param_2->num + l_RoomKeepDoorInfo.mNum >= 0x40 || param_2->num < 0) { return; } if (param_2->num == 0) { @@ -117,7 +137,10 @@ static void dStage_RoomKeepDoorInfoProc(dStage_dt_c* i_stage, stage_tgsc_class* static int dStage_RoomKeepDoorInit(dStage_dt_c* i_stage, void* i_data, int entryNum, void* param_3) { - dStage_RoomKeepDoorInfoProc(i_stage, (stage_tgsc_class*)((char*)i_data + 4)); + UNUSED(entryNum); + UNUSED(param_3); + stage_tgsc_class* tgsc = (stage_tgsc_class*)((char*)i_data + 4); + dStage_RoomKeepDoorInfoProc(i_stage, tgsc); return 1; } @@ -137,9 +160,15 @@ void dStage_roomControl_c::init() { mNoChangeRoom = 0; mRoomReadId = -1; +#if PLATFORM_GCN if (dComIfGp_getStartStagePoint() >= 0 || dComIfGp_getStartStagePoint() == -4) { initZone(); } +#else + if (dComIfGp_getStartStagePoint() >= 0) { + dComIfGs_initZone(); + } +#endif dStage_roomStatus_c* status = mStatus; for (int i = 0; i < 0x40; i++) { @@ -148,7 +177,9 @@ void dStage_roomControl_c::init() { setStatusFlag(i, 0); status->mDraw = false; - if (status->mZoneNo >= 0) { + if (!PLATFORM_GCN && dComIfGp_getStartStagePoint() >= 0) { + status->mZoneNo = -1; + } else if (status->mZoneNo >= 0) { dComIfGs_clearRoomSwitch(status->mZoneNo); dComIfGs_clearRoomItem(status->mZoneNo); } @@ -162,8 +193,17 @@ void dStage_roomControl_c::init() { mArcBankData = (dStage_roomControl_c::bankData*)dComIfG_getStageRes("bank.bin"); if (mArcBankName == NULL) { + JUT_ASSERT(449, mArcBankData == NULL); + mArcBankData = NULL; + } else { + JUT_ASSERT(452, mArcBankData != NULL); + } +#if DEBUG + if (mNoArcBank) { + mArcBankName = NULL; mArcBankData = NULL; } +#endif } void dStage_roomControl_c::initZone() { @@ -178,11 +218,268 @@ void dStage_roomControl_c::initZone() { dStage_roomDt_c* dStage_roomControl_c::getStatusRoomDt(int i_statusIdx) { if (i_statusIdx < 0 || i_statusIdx >= 0x40) { + OS_REPORT_ERROR("getStatusRoomDt():部屋番号範囲外:%d(0~%d)\n", i_statusIdx, 0x40); return NULL; } return &mStatus[i_statusIdx].mRoomDt; } +JKRExpHeap* dStage_roomControl_c::getMemoryBlock(int i_roomNo) { + int blockId = getMemoryBlockID(i_roomNo); + + if (blockId < 0) { + return NULL; + } + return mMemoryBlock[blockId]; +} + +void dStage_roomControl_c::setStayNo(int i_roomNo) { + mOldStayNo = mStayNo; + mStayNo = i_roomNo; + mNextStayNo = mStayNo; + + if (mStayNo < 0) { + return; + } + + onStatusDraw(mStayNo); +} + +void dStage_roomControl_c::setNextStayNo(int nextStayNo) { + mNextStayNo = nextStayNo; +} + +static int stayRoomCheck(int param_0, u8* param_1, int param_2) { + for (int i = 0; i < param_0; i++) { + if (param_2 == dStage_roomRead_dt_c_GetLoadRoomIndex(param_1[i])) { + return 1; + } + } + return 0; +} + +static int createRoomScene(int param_0) { + int* ptr = (int*)JKRAlloc(4, -4); + + if (ptr == NULL) { + return 0; + } + *ptr = param_0; + + if (!fopScnM_CreateReq(PROC_ROOM_SCENE, 0x7FFF, 0, (uintptr_t)ptr)) { + JKRFree(ptr); + return 0; + } + + return 1; +} + +BOOL dStage_roomControl_c::checkRoomDisp(int i_roomNo) const { + if (checkStatusFlag(i_roomNo, 8)) { + return 0; + } + + if (checkStatusFlag(i_roomNo, 16)) { + return true; + } else { + return false; + } +} + +int dStage_roomControl_c::loadRoom(int roomCount, u8* rooms, bool param_2) { + if (mRoomReadId < 0 && mNoChangeRoom != 0) { + return 0; + } + + for (int roomNo = 0; roomNo < ARRAY_SIZE(mStatus); roomNo++) { + if (checkStatusFlag(roomNo, 0x02 | 0x04)) { + return 0; + } + } + + BOOL r26 = TRUE; + for (int roomNo = 0; roomNo < ARRAY_SIZE(mStatus); roomNo++) { + if (dStage_roomControl_c::checkStatusFlag(roomNo, 0x01)) { + if (!stayRoomCheck(roomCount, rooms, roomNo)) { + onStatusFlag(roomNo, 0xc); + OS_REPORT("kill !!<%d>\n", roomNo); + r26 = FALSE; + } + } + } + if (!r26) { + return FALSE; + } + + for (int i = 0; i < roomCount; i++) { + int roomNo = dStage_roomRead_dt_c_GetLoadRoomIndex(rooms[i]); + dStage_roomControl_c::setZoneCount(roomNo, 2); + if (!checkStatusFlag(roomNo, 0x01)) { + if (param_2) { + if (dStage_roomRead_dt_c_ChkBg(rooms[i]) && createRoomScene(roomNo)) { + onStatusFlag(roomNo, 2); + } + } else { + if (createRoomScene(roomNo)) { + int flag; + if (dStage_roomRead_dt_c_ChkBg(rooms[i])) { + flag = 0x02; + } else { + flag = 0x4A; + } + onStatusFlag(roomNo, flag); + } + return TRUE; + } + } else { + if (dStage_roomRead_dt_c_ChkBg(rooms[i])) { + if (checkStatusFlag(roomNo, 0x40)) { + offStatusFlag(roomNo, 0x48); + } + } else { + if (!checkStatusFlag(roomNo, 0x60)) { + onStatusFlag(roomNo, 0x48); + } else { + onStatusFlag(roomNo, 0x40); + } + } + } + } + + return TRUE; +} + +void dStage_roomControl_c::zoneCountCheck(int i_roomNo) const { + dStage_roomStatus_c* status = mStatus; + for (int i = 0; i < 0x40; i++) { + if (status->mZoneNo >= 0 && status->mZoneCount > 0) { + dComIfGs_clearRoomSwitch(status->mZoneNo); + dComIfGs_clearRoomItem(status->mZoneNo); + + if (dStage_stagInfo_GetSTType(dComIfGp_getStage()->getStagInfo()) != ST_FIELD && + i_roomNo != mOldStayNo) + { + if (--status->mZoneCount == 0) { + dComIfGs_removeZone(status->mZoneNo); + status->mZoneNo = -1; + } + } + } + status++; + } + + setStayNo(i_roomNo); +} + +static void dummy1(dStage_roomControl_c* roomControl) { + roomControl->getFileList2(0); +} + +JKRExpHeap* dStage_roomControl_c::createMemoryBlock(int i_blockIdx, u32 i_heapSize) { + if (mMemoryBlock[i_blockIdx] == NULL) { + mMemoryBlock[i_blockIdx] = JKRCreateExpHeap(i_heapSize, mDoExt_getArchiveHeap(), false); + } + + return mMemoryBlock[i_blockIdx]; +} + +void dStage_roomControl_c::destroyMemoryBlock() { + for (int i = 0; i < MEMORY_BLOCK_MAX; i++) { + if (mMemoryBlock[i] != NULL) { + mDoExt_destroyExpHeap(mMemoryBlock[i]); + mMemoryBlock[i] = NULL; + } + } +} + +void dStage_roomControl_c::setArcBank(int i_bank, char const* bankName) { + JUT_ASSERT(1053, 0 <= i_bank && i_bank < 32); + strncpy(&mArcBank[i_bank][0], bankName, 9); +} + +char* dStage_roomControl_c::getArcBank(int i_bank) { + JUT_ASSERT(1067, 0 <= i_bank && i_bank < 32); + return mArcBank[i_bank]; +} + +bool dStage_roomControl_c::resetArchiveBank(int i_bank) { + for (int i = i_bank; i < 32; i++) { + char* bank = getArcBank(i); + + if (strcmp(bank, "")) { + s32 syncStatus = dComIfG_syncObjectRes(bank); + if (syncStatus < 0) { + OSReport_Error("Bank[%d] : %s.arc Sync Read Error !!\n", i, bank); + } else { + if (syncStatus > 0) { + return 0; + } + OS_REPORT(">>>>>>>>>>> delete Bank[%d] : %s\n", i, bank); + dComIfG_deleteObjectResMain(bank); + setArcBank(i, ""); + } + } + } + return 1; +} + +void dStage_roomControl_c::roomDzs_c::create(u8 i_num) { + JUT_ASSERT(1112, !m_num && 0 < i_num && i_num < 64); + m_dzs = new (mDoExt_getArchiveHeap(), -4) void*[i_num]; + JUT_ASSERT(1114, m_dzs != NULL); + + if (m_dzs != NULL) { + u32** dzs = (u32**)m_dzs; + for (u8 i = 0; i < i_num; i++) { + *dzs = NULL; + dzs++; + } + m_num = i_num; + } +} + +void dStage_roomControl_c::roomDzs_c::remove() { + if (m_num != 0) { + u32** dzs = (u32**)m_dzs; + for (u8 i = 0; i < m_num; i++) { + if (*dzs != NULL) { + mDoExt_getArchiveHeap()->free(*dzs); + } + dzs++; + } + delete[] m_dzs; + m_num = 0; + } +} + +void* dStage_roomControl_c::roomDzs_c::add(u8 i_no, u8 roomNo) { + if (m_num == 0) { + return NULL; + } + + JUT_ASSERT(1160, i_no < m_num); + void** dzs = m_dzs + i_no; + if (*dzs == NULL) { + char dzsName[20]; + sprintf(dzsName, "%s/room%d.dzs", dComIfGp_getStartStageName(), roomNo); + JUT_ASSERT(1167, strlen(dzsName) <= sizeof(dzsName)); + + u32 expandSize = + dLib_getExpandSizeFromAramArchive(dComIfGp_getFieldMapArchive2(), (const char*)dzsName); + JUT_ASSERT(1172, expandSize); + OS_REPORT("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ <%s> <%d>\n", dzsName, expandSize); + *dzs = mDoExt_getArchiveHeap()->alloc(expandSize, -0x20); + JUT_ASSERT(1179, *dzs != NULL); + + if (*dzs != NULL) { + u32 readSize = dComIfGp_getFieldMapArchive2()->readResource(*dzs, expandSize, dzsName); + JUT_ASSERT(1186, readSize <= expandSize); + } + } + + return *dzs; +} + // clang-format off #define OBJNAME(name, proc, sub) \ { name, proc, sub } @@ -1093,7 +1390,7 @@ static dStage_objectNameInf l_objectName[] = { OBJNAME("mvbg_a", PROC_BG_OBJ, -1), OBJNAME("burnBox", PROC_Obj_BurnBox, -1), OBJNAME("stnMark", PROC_Obj_StoneMark, -1), -#if !DEBUG +#if PLATFORM_GCN OBJNAME("Passer", PROC_NPC_PASSER, -1), #endif OBJNAME("Passer2", PROC_NPC_PASSER2, -1), @@ -1112,258 +1409,6 @@ static dStage_objectNameInf l_objectName[] = { }; // clang-format on -JKRExpHeap* dStage_roomControl_c::getMemoryBlock(int i_roomNo) { - int blockId = getMemoryBlockID(i_roomNo); - - if (blockId < 0) { - return NULL; - } - return mMemoryBlock[blockId]; -} - -void dStage_roomControl_c::setStayNo(int i_roomNo) { - mOldStayNo = mStayNo; - mStayNo = i_roomNo; - mNextStayNo = mStayNo; - - if (mStayNo < 0) { - return; - } - - onStatusDraw(mStayNo); -} - -void dStage_roomControl_c::setNextStayNo(int nextStayNo) { - mNextStayNo = nextStayNo; -} - -static int stayRoomCheck(int param_0, u8* param_1, int param_2) { - for (; param_0 > 0; param_0--) { - if (param_2 == dStage_roomRead_dt_c_GetLoadRoomIndex(*param_1)) { - return 1; - } - param_1++; - } - return 0; -} - -static int createRoomScene(int param_0) { - int* ptr = (int*)JKRHeap::alloc(4, -4, NULL); - - if (ptr == NULL) { - return 0; - } - *ptr = param_0; - - if (!fopScnM_CreateReq(PROC_ROOM_SCENE, 0x7FFF, 0, (uintptr_t)ptr)) { - JKRHeap::free(ptr, NULL); - return 0; - } - - return 1; -} - -BOOL dStage_roomControl_c::checkRoomDisp(int i_roomNo) const { - if (checkStatusFlag(i_roomNo, 8)) { - return 0; - } - - return checkStatusFlag(i_roomNo, 16) ? 1 : 0; -} - -int dStage_roomControl_c::loadRoom(int roomCount, u8* rooms, bool param_2) { - if (mRoomReadId < 0 && mNoChangeRoom != 0) { - return 0; - } - - for (int roomNo = 0; roomNo < ARRAY_SIZEU(mStatus); roomNo++) { - if (checkStatusFlag(roomNo, 0x02 | 0x04)) { - return 0; - } - } - - BOOL r26 = TRUE; - for (int roomNo = 0; roomNo < ARRAY_SIZE(mStatus); roomNo++) { - if (dStage_roomControl_c::checkStatusFlag(roomNo, 0x01)) { - if (!stayRoomCheck(roomCount, rooms, roomNo)) { - onStatusFlag(roomNo, 0xc); - r26 = FALSE; - } - } - } - if (!r26) { - return FALSE; - } - - for (int i = 0; i < roomCount; i++) { - u8 roomNo = dStage_roomRead_dt_c_GetLoadRoomIndex(rooms[i]); - dStage_roomControl_c::setZoneCount(roomNo, 2); - if (!checkStatusFlag(roomNo, 0x01)) { - if (param_2) { - if (dStage_roomRead_dt_c_ChkBg(rooms[i]) && createRoomScene(roomNo)) { - onStatusFlag(roomNo, 2); - } - } else { - if (createRoomScene(roomNo)) { - int flag; - if (dStage_roomRead_dt_c_ChkBg(rooms[i])) { - flag = 0x02; - } else { - flag = 0x4A; - } - onStatusFlag(roomNo, flag); - } - return TRUE; - } - } else { - if (dStage_roomRead_dt_c_ChkBg(rooms[i])) { - if (checkStatusFlag(roomNo, 0x40)) { - offStatusFlag(roomNo, 0x48); - } - } else { - if (!checkStatusFlag(roomNo, 0x60)) { - onStatusFlag(roomNo, 0x48); - } else { - onStatusFlag(roomNo, 0x40); - } - } - } - } - - return TRUE; -} - -void dStage_roomControl_c::zoneCountCheck(int i_roomNo) const { - dStage_roomStatus_c* status = mStatus; - for (int i = 0; i < 0x40; i++) { - if (status->mZoneNo >= 0 && status->mZoneCount > 0) { - dComIfGs_clearRoomSwitch(status->mZoneNo); - dComIfGs_clearRoomItem(status->mZoneNo); - - if (dStage_stagInfo_GetSTType(dComIfGp_getStage()->getStagInfo()) != ST_FIELD && - i_roomNo != mOldStayNo) - { - if (--status->mZoneCount == 0) { - dComIfGs_removeZone(status->mZoneNo); - status->mZoneNo = -1; - } - } - } - status++; - } - - setStayNo(i_roomNo); -} - -static void dummy1() { - ((dStage_stageDt_c*)dComIfGp_getStage())->getStagInfo(); -} - -JKRExpHeap* dStage_roomControl_c::createMemoryBlock(int i_blockIdx, u32 i_heapSize) { - if (mMemoryBlock[i_blockIdx] == NULL) { - mMemoryBlock[i_blockIdx] = JKRCreateExpHeap(i_heapSize, mDoExt_getArchiveHeap(), false); - } - - return mMemoryBlock[i_blockIdx]; -} - -void dStage_roomControl_c::destroyMemoryBlock() { - for (int i = 0; i < MEMORY_BLOCK_MAX; i++) { - if (mMemoryBlock[i] != NULL) { - mDoExt_destroyExpHeap(mMemoryBlock[i]); - mMemoryBlock[i] = NULL; - } - } -} - -void dStage_roomControl_c::setArcBank(int i_bank, char const* bankName) { - JUT_ASSERT(1053, 0 <= i_bank && i_bank < 32); - strncpy(&mArcBank[i_bank][0], bankName, 9); -} - -char* dStage_roomControl_c::getArcBank(int i_bank) { - JUT_ASSERT(1067, 0 <= i_bank && i_bank < 32); - return mArcBank[i_bank]; -} - -bool dStage_roomControl_c::resetArchiveBank(int i_bank) { - for (int i = i_bank; i < 32; i++) { - char* bank = getArcBank(i); - - if (strcmp(bank, "")) { - s32 syncStatus = dComIfG_syncObjectRes(bank); - if (syncStatus < 0) { - OSReport_Error("Bank[%d] : %s.arc Sync Read Error !!\n", i, bank); - } else { - if (syncStatus > 0) { - return 0; - } - OS_REPORT(">>>>>>>>>>> delete Bank[%d] : %s\n", i, bank); - dComIfG_deleteObjectResMain(bank); - setArcBank(i, ""); - } - } - } - return 1; -} - -void dStage_roomControl_c::roomDzs_c::create(u8 i_num) { - JUT_ASSERT(1112, !m_num && 0 < i_num && i_num < 64); - m_dzs = new (mDoExt_getArchiveHeap(), -4) void*[i_num]; - JUT_ASSERT(1114, m_dzs != NULL); - - if (m_dzs != NULL) { - u32** dzs = (u32**)m_dzs; - for (u8 i = 0; i < i_num; i++) { - *dzs = NULL; - dzs++; - } - m_num = i_num; - } -} - -void dStage_roomControl_c::roomDzs_c::remove() { - if (m_num != 0) { - u32** dzs = (u32**)m_dzs; - for (u8 i = 0; i < m_num; i++) { - if (*dzs != NULL) { - mDoExt_getArchiveHeap()->free(*dzs); - } - dzs++; - } - delete[] m_dzs; - m_num = 0; - } -} - -void* dStage_roomControl_c::roomDzs_c::add(u8 i_no, u8 roomNo) { - if (m_num == 0) { - return NULL; - } - - JUT_ASSERT(1160, i_no < m_num); - void** dzs = m_dzs + i_no; - if (*dzs == NULL) { - char dzsName[20]; - sprintf(dzsName, "%s/room%d.dzs", dComIfGp_getStartStageName(), roomNo); - JUT_ASSERT(1167, strlen(dzsName) <= sizeof(dzsName)); - - u32 expandSize = - dLib_getExpandSizeFromAramArchive(dComIfGp_getFieldMapArchive2(), (const char*)dzsName); - JUT_ASSERT(1172, expandSize); - OS_REPORT("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ <%s> <%d>\n", dzsName, expandSize); - *dzs = mDoExt_getArchiveHeap()->alloc(expandSize, -0x20); - JUT_ASSERT(1179, *dzs != NULL); - - if (*dzs != NULL) { - u32 readSize = dComIfGp_getFieldMapArchive2()->readResource(*dzs, expandSize, dzsName); - JUT_ASSERT(1186, readSize <= expandSize); - } - } - - return *dzs; -} - void dStage_stageDt_c::init() { mCamera = NULL; mArrow = NULL; @@ -1433,7 +1478,7 @@ void dStage_roomDt_c::init() { mDoor = NULL; mFloorInfo = NULL; #if DEBUG - field_0x60 = 0; + mUnit = NULL; #endif } @@ -1499,6 +1544,12 @@ const char* dStage_getName2(s16 procName, s8 argument) { return dStage_getName(procName, argument); } +u8 data_8074C568_debug; +u8 data_8074C569_debug; +u8 data_8074C56A_debug; +u8 data_8074C56B_debug; +u8 data_8074C56C_debug; + u32 dStage_roomControl_c::mProcID; s8 dStage_roomControl_c::mStayNo; @@ -1515,7 +1566,10 @@ dStage_roomControl_c::nameData* dStage_roomControl_c::mArcBankName; dStage_roomControl_c::bankData* dStage_roomControl_c::mArcBankData; -s8 dStage_roomControl_c::mRoomReadId = -1; +dStage_roomControl_c::roomDzs_c dStage_roomControl_c::m_roomDzs; +#if DEBUG +u8 dStage_roomControl_c::mNoArcBank; +#endif static void dStage_actorCreate(stage_actor_data_class* i_actorData, fopAcM_prm_class* i_actorPrm) { dStage_objectNameInf* actorInf = dStage_searchName(i_actorData->name); @@ -1534,7 +1588,7 @@ static void dStage_actorCreate(stage_actor_data_class* i_actorData, fopAcM_prm_c return; } - fopAcM_create(actorInf->procname, NULL, i_actorPrm); + fopAcM_Create(actorInf->procname, NULL, i_actorPrm); } } @@ -1566,6 +1620,7 @@ static void dummy2() { } static int dStage_playerInit(dStage_dt_c* i_stage, void* i_data, int num, void* param_3) { + UNUSED(param_3); stage_actor_class* player = (stage_actor_class*)((int*)i_data + 1); stage_actor_data_class* player_data = player->m_entries; i_stage->setPlayer(player); @@ -1641,24 +1696,35 @@ static int dStage_playerInit(dStage_dt_c* i_stage, void* i_data, int num, void* } static int dStage_cameraInit(dStage_dt_c* i_stage, void* i_data, int param_2, void* param_3) { + UNUSED(param_2); + UNUSED(param_3); stage_camera_class* camera = (stage_camera_class*)((char*)i_data + 4); + int r30 = 0; i_stage->setCamera(camera); - dStage_cameraCreate(camera->m_entries, 0, 0); + stage_camera2_data_class* camera2 = &camera->m_entries[r30]; + dStage_cameraCreate(camera2, 0, 0); return 1; } static int dStage_RoomCameraInit(dStage_dt_c* i_stage, void* i_data, int param_2, void* param_3) { - i_stage->setCamera((stage_camera_class*)((char*)i_data + 4)); + UNUSED(param_2); + UNUSED(param_3); + stage_camera_class* camera = (stage_camera_class*)((char*)i_data + 4); + i_stage->setCamera(camera); return 1; } static int dStage_arrowInit(dStage_dt_c* i_stage, void* i_data, int param_2, void* param_3) { - i_stage->setArrow((stage_arrow_class*)((char*)i_data + 4)); + UNUSED(param_2); + UNUSED(param_3); + stage_arrow_class* arrow = (stage_arrow_class*)((char*)i_data + 4); + i_stage->setArrow(arrow); return 1; } stage_map_info_class* dStage_roomDt_c::getMapInfo2(int param_0) const { - stage_map_info_dummy_class* map_info_p = getMapInfoBase(); + stage_map_info_dummy_class* map_info_p = NULL; + map_info_p = getMapInfoBase(); if (map_info_p == NULL || map_info_p->num == 0 || map_info_p->m_entries == NULL) { return NULL; @@ -1682,7 +1748,8 @@ static void dummy3() { } stage_map_info_class* dStage_stageDt_c::getMapInfo2(int param_0) const { - stage_map_info_dummy_class* map_info_p = getMapInfoBase(); + stage_map_info_dummy_class* map_info_p = NULL; + map_info_p = getMapInfoBase(); if (map_info_p == NULL || map_info_p->num == 0 || map_info_p->m_entries == NULL) { return NULL; @@ -1706,20 +1773,32 @@ static void dummy4() { } static int dStage_paletteInfoInit(dStage_dt_c* i_stage, void* i_data, int param_2, void* param_3) { + UNUSED(param_3); dStage_nodeHeader* pal_info = (dStage_nodeHeader*)(i_data); i_stage->setPaletteInfo((stage_palette_info_class*)pal_info->m_offset); +#if DEBUG + i_stage->setPaletteNumInfo(param_2); +#endif return 1; } static int dStage_pselectInfoInit(dStage_dt_c* i_stage, void* i_data, int param_2, void* param_3) { + UNUSED(param_3); dStage_nodeHeader* psel_info = (dStage_nodeHeader*)(i_data); i_stage->setPselectInfo((stage_pselect_info_class*)psel_info->m_offset); +#if DEBUG + i_stage->setPselectNumInfo(param_2); +#endif return 1; } static int dStage_envrInfoInit(dStage_dt_c* i_stage, void* i_data, int param_2, void* param_3) { + UNUSED(param_3); dStage_nodeHeader* envr_info = (dStage_nodeHeader*)(i_data); i_stage->setEnvrInfo((stage_envr_info_class*)envr_info->m_offset); +#if DEBUG + i_stage->setEnvrNumInfo(param_2); +#endif return 1; } @@ -1746,10 +1825,10 @@ static int dStage_fieldMapFiliInfo2Init(dStage_dt_c* i_stage, void* i_data, int } static int dStage_filiInfoInit(dStage_dt_c* i_stage, void* i_data, int entryNum, void* param_3) { + dStage_nodeHeader* fili_info = (dStage_nodeHeader*)(i_data); if (entryNum == 0) { i_stage->setFileListInfo(NULL); } else { - dStage_nodeHeader* fili_info = (dStage_nodeHeader*)(i_data); i_stage->setFileListInfo((dStage_FileList_dt_c*)fili_info->m_offset); } @@ -1757,15 +1836,23 @@ static int dStage_filiInfoInit(dStage_dt_c* i_stage, void* i_data, int entryNum, } static int dStage_vrboxInfoInit(dStage_dt_c* i_stage, void* i_data, int entryNum, void* param_3) { + UNUSED(param_3); dStage_nodeHeader* vrbox_info = (dStage_nodeHeader*)(i_data); i_stage->setVrboxInfo((stage_vrbox_info_class*)vrbox_info->m_offset); +#if DEBUG + i_stage->setVrboxNumInfo(entryNum); +#endif return 1; } static int dStage_vrboxcolInfoInit(dStage_dt_c* i_stage, void* i_data, int entryNum, void* param_3) { + UNUSED(param_3); dStage_nodeHeader* vrcol_info = (dStage_nodeHeader*)(i_data); i_stage->setVrboxcolInfo((stage_vrboxcol_info_class*)vrcol_info->m_offset); +#if DEBUG + i_stage->setVrboxcolNumInfo(entryNum); +#endif return 1; } @@ -1795,6 +1882,8 @@ u32 dStage_stagInfo_GetParticleNo(stage_stag_info_class* p_info, int layer) { } static int dStage_stagInfoInit(dStage_dt_c* i_stage, void* i_data, int entryNum, void* param_3) { + UNUSED(entryNum); + UNUSED(param_3); dStage_nodeHeader* stag_info = (dStage_nodeHeader*)(i_data); i_stage->setStagInfo((stage_stag_info_class*)stag_info->m_offset); @@ -1806,15 +1895,23 @@ static int dStage_stagInfoInit(dStage_dt_c* i_stage, void* i_data, int entryNum, int stageNo = dStage_stagInfo_GetSaveTbl(i_stage->getStagInfo()); dComIfGs_getSave(stageNo); g_save_bit_HIO.init(); +#if DEBUG + OS_REPORT("Save StageNo=%d sizeof(dSv_save_c)=%d\n", stageNo, sizeof(dSv_save_c)); + char* r30 = &dComIfGs_getSaveInfo()->unk_0x1; + if (dComIfGs_getSaveInfo()->unk_0x0 && *r30 && !strcmp(r30, dComIfGp_getStartStageName())) { + OS_REPORT("stage: keep dungeon save data\n"); + } else { + OS_REPORT("stage: clear dungeon save data\n"); + } +#endif dComIfGs_initDan(stageNo); +#if DEBUG + dComIfGs_getSaveInfo()->unk_0x0 = 0; +#endif dStage_KeepDoorInfoInit(i_stage); return 1; } -void dStage_stageDt_c::resetOldMulti() { - mOldMulti = NULL; -} - static int dStage_sclsInfoInit(dStage_dt_c* i_stage, void* i_data, int entryNum, void* param_3) { i_stage->setSclsInfo((stage_scls_info_dummy_class*)((char*)i_data + 4)); return 1; @@ -1822,6 +1919,8 @@ static int dStage_sclsInfoInit(dStage_dt_c* i_stage, void* i_data, int entryNum, static int dStage_actorCommonLayerInit(dStage_dt_c* i_stage, void* i_data, int entryNum, void* param_3) { + UNUSED(entryNum); + UNUSED(param_3); stage_actor_class* actor = (stage_actor_class*)((int*)i_data + 1); stage_actor_data_class* actor_data = actor->m_entries; @@ -1845,6 +1944,8 @@ static int dStage_actorCommonLayerInit(dStage_dt_c* i_stage, void* i_data, int e static int dStage_tgscCommonLayerInit(dStage_dt_c* i_stage, void* i_data, int entryNum, void* param_3) { + UNUSED(entryNum); + UNUSED(param_3); stage_tgsc_class* actor = (stage_tgsc_class*)((int*)i_data + 1); stage_tgsc_data_class* tgsc_data = actor->m_entries; @@ -1867,6 +1968,8 @@ static int dStage_tgscCommonLayerInit(dStage_dt_c* i_stage, void* i_data, int en } static int dStage_actorInit(dStage_dt_c* i_stage, void* i_data, int entryNum, void* param_3) { + UNUSED(entryNum); + UNUSED(param_3); stage_actor_class* actor = (stage_actor_class*)((int*)i_data + 1); stage_actor_data_class* actor_data = actor->m_entries; @@ -1890,6 +1993,8 @@ static int dStage_actorInit(dStage_dt_c* i_stage, void* i_data, int entryNum, vo static int dStage_actorInit_always(dStage_dt_c* i_stage, void* i_data, int entryNum, void* param_3) { + UNUSED(entryNum); + UNUSED(param_3); stage_actor_class* actor = (stage_actor_class*)((int*)i_data + 1); stage_actor_data_class* actor_data = actor->m_entries; @@ -1910,6 +2015,8 @@ static int dStage_actorInit_always(dStage_dt_c* i_stage, void* i_data, int entry } static int dStage_tgscInfoInit(dStage_dt_c* i_stage, void* i_data, int entryNum, void* param_3) { + UNUSED(entryNum); + UNUSED(param_3); stage_tgsc_class* actor = (stage_tgsc_class*)((int*)i_data + 1); stage_tgsc_data_class* tgsc_data = actor->m_entries; @@ -1932,6 +2039,8 @@ static int dStage_tgscInfoInit(dStage_dt_c* i_stage, void* i_data, int entryNum, } static int dStage_doorInfoInit(dStage_dt_c* i_stage, void* i_data, int entryNum, void* param_3) { + UNUSED(entryNum); + UNUSED(param_3); stage_tgsc_class* actor = (stage_tgsc_class*)((int*)i_data + 1); stage_tgsc_data_class* tgsc_data = actor->m_entries; @@ -1952,6 +2061,7 @@ static int dStage_doorInfoInit(dStage_dt_c* i_stage, void* i_data, int entryNum, } static int dStage_roomReadInit(dStage_dt_c* i_stage, void* i_data, int param_2, void* param_3) { + UNUSED(param_2); roomRead_class* p_node = (roomRead_class*)((int*)i_data + 1); roomRead_data_class** rtbl = p_node->m_entries; @@ -1972,15 +2082,21 @@ s8 dStage_roomRead_dt_c_GetReverbStage(roomRead_class& room, int index) { index = 0; } - return dStage_roomRead_dt_c_GetReverb(*room.m_entries[index]); + roomRead_data_class* data = room.m_entries[index]; + return dStage_roomRead_dt_c_GetReverb(*data); } static int dStage_ppntInfoInit(dStage_dt_c* i_stage, void* i_data, int entryNum, void* param_3) { - i_stage->setPntInfo((dStage_dPnt_c*)((char*)i_data + 4)); + UNUSED(entryNum); + UNUSED(param_3); + dStage_dPnt_c* pnt = (dStage_dPnt_c*)((char*)i_data + 4); + i_stage->setPntInfo(pnt); return 1; } static int dStage_pathInfoInit(dStage_dt_c* i_stage, void* i_data, int entryNum, void* param_3) { + UNUSED(entryNum); + UNUSED(param_3); dStage_dPath_c* path_c = (dStage_dPath_c*)((char*)i_data + 4); dPath* path = path_c->m_path; @@ -1997,7 +2113,10 @@ static int dStage_pathInfoInit(dStage_dt_c* i_stage, void* i_data, int entryNum, } static int dStage_rppnInfoInit(dStage_dt_c* i_stage, void* i_data, int entryNum, void* param_3) { - i_stage->setPnt2Info((dStage_dPnt_c*)((char*)i_data + 4)); + UNUSED(entryNum); + UNUSED(param_3); + dStage_dPnt_c* pnt = (dStage_dPnt_c*)((char*)i_data + 4); + i_stage->setPnt2Info(pnt); return 1; } @@ -2018,23 +2137,24 @@ static int dStage_rpatInfoInit(dStage_dt_c* i_stage, void* i_data, int i_num, vo } static int dStage_soundInfoInit(dStage_dt_c* i_stage, void* i_data, int entryNum, void* param_3) { - i_stage->setSoundInf((dStage_SoundInfo_c*)((char*)i_data + 4)); + UNUSED(entryNum); + UNUSED(param_3); + dStage_SoundInfo_c* soundInfo = (dStage_SoundInfo_c*)((char*)i_data + 4); + i_stage->setSoundInf(soundInfo); return 1; } static int dStage_soundInfoInitCL(dStage_dt_c* i_stage, void* i_data, int entryNum, void* param_3) { - i_stage->setSoundInfCL((dStage_SoundInfo_c*)((char*)i_data + 4)); + UNUSED(entryNum); + UNUSED(param_3); + dStage_SoundInfo_c* soundInfo = (dStage_SoundInfo_c*)((char*)i_data + 4); + i_stage->setSoundInfCL(soundInfo); return 1; } static void dStage_setLayerTagName(FuncTable* funcTbl, int tblSize, int i_layerNo) { - char layerTag; - if (i_layerNo < 10) { - layerTag = '0'; - } else { - layerTag = 'W'; - } - layerTag = i_layerNo + layerTag; + JUT_ASSERT(3007, 0 <= i_layerNo && i_layerNo < 15); + char layerTag = i_layerNo + (i_layerNo < 10 ? '0' : 'W'); for (int i = 0; i < tblSize; i++) { funcTbl->identifier[3] = layerTag; @@ -2045,20 +2165,22 @@ static void dStage_setLayerTagName(FuncTable* funcTbl, int tblSize, int i_layerN static void dStage_dt_c_decode(void* i_data, dStage_dt_c* i_stage, FuncTable* funcTbl, int tblSize) { if (i_data != NULL) { + dStage_fileHeader* file = (dStage_fileHeader*)i_data; + dStage_nodeHeader* node1 = file->m_nodes; for (int i = 0; i < tblSize; i++) { - dStage_fileHeader* file = (dStage_fileHeader*)i_data; - dStage_nodeHeader* p_tno = file->m_nodes; + node1 = file->m_nodes; FuncTable* nodeFunc = funcTbl + i; for (int j = 0; j < file->m_chunkCount; j++) { - if ((int)p_tno->m_tag == *(int*)nodeFunc->identifier) { - if (nodeFunc->function != NULL) { - nodeFunc->function(i_stage, p_tno, p_tno->m_entryNum, i_data); + dStage_nodeHeader* node2 = node1; + if ((int)node2->m_tag == *(int*)nodeFunc->identifier) { + if (funcTbl[i].function != NULL) { + funcTbl[i].function(i_stage, node1, node1->m_entryNum, i_data); } break; } - p_tno++; + node1++; } } } else { @@ -2067,18 +2189,26 @@ static void dStage_dt_c_decode(void* i_data, dStage_dt_c* i_stage, FuncTable* fu } static int dStage_stEventInfoInit(dStage_dt_c* i_stage, void* i_data, int entryNum, void* param_3) { - i_stage->setMapEventInfo((dStage_MapEventInfo_c*)((char*)i_data + 4)); + UNUSED(entryNum); + UNUSED(param_3); + dStage_MapEventInfo_c* mapEvent = (dStage_MapEventInfo_c*)((char*)i_data + 4); + i_stage->setMapEventInfo(mapEvent); + OS_REPORT("\nステージイベントデータ初期化!! %d %x\n\n", mapEvent->num, mapEvent->m_entries); return 1; } static int dStage_mapEventInfoInit(dStage_dt_c* i_stage, void* i_data, int entryNum, void* param_3) { - i_stage->setMapEventInfo((dStage_MapEventInfo_c*)((char*)i_data + 4)); + dStage_MapEventInfo_c* mapEvent = (dStage_MapEventInfo_c*)((char*)i_data + 4); + i_stage->setMapEventInfo(mapEvent); return 1; } static int dStage_floorInfoInit(dStage_dt_c* i_stage, void* i_data, int entryNum, void* param_3) { - i_stage->setFloorInfo((dStage_FloorInfo_c*)((char*)i_data + 4)); + UNUSED(entryNum); + UNUSED(param_3); + dStage_FloorInfo_c* floorInfo = (dStage_FloorInfo_c*)((char*)i_data + 4); + i_stage->setFloorInfo(floorInfo); return 1; } @@ -2086,6 +2216,11 @@ static int dStage_memaInfoInit(dStage_dt_c* i_stage, void* i_data, int param_2, UNUSED(param_2); UNUSED(param_3); dStage_MemoryMap_c* pd = (dStage_MemoryMap_c*)((char*)i_data + 4); +#if DEBUG + if (fapGmHIO_getMemoryBlockOff()) { + pd = NULL; + } +#endif i_stage->setMemoryMap(pd); if (pd != NULL) { @@ -2108,6 +2243,11 @@ static int dStage_mecoInfoInit(dStage_dt_c* i_stage, void* i_data, int param_2, UNUSED(param_2); UNUSED(param_3); dStage_MemoryConfig_c* pd = (dStage_MemoryConfig_c*)((char*)i_data + 4); +#if DEBUG + if (fapGmHIO_getMemoryBlockOff()) { + pd = NULL; + } +#endif i_stage->setMemoryConfig(pd); if (pd != NULL) { @@ -2177,8 +2317,6 @@ static int dStage_fieldMapMapPathInit(dStage_dt_c* i_stage, void* i_data, int pa return 1; } -dStage_roomControl_c::roomDzs_c dStage_roomControl_c::m_roomDzs; - static void readMult(dStage_dt_c* i_stage, dStage_Multi_c* multi, bool useOldRes) { static FuncTable l_roomFuncTable[] = { {"TRES", dStage_stageKeepTresureInit}, @@ -2199,7 +2337,7 @@ static void readMult(dStage_dt_c* i_stage, dStage_Multi_c* multi, bool useOldRes if (dStage_stagInfo_GetUpButton(dComIfGp_getStage()->getStagInfo()) == 0 || dStage_stagInfo_GetUpButton(dComIfGp_getStage()->getStagInfo()) == 6) { - dStage_roomControl_c::m_roomDzs.create(multi->num); + dStage_roomControl_c::createRoomDzs(multi->num); } for (s8 i = 0; i < multi->num; i++) { @@ -2208,12 +2346,15 @@ static void readMult(dStage_dt_c* i_stage, dStage_Multi_c* multi, bool useOldRes if (dzs == NULL) { char dzsName[11]; sprintf(dzsName, "room%d.dzs", info->mRoomNo); + JUT_ASSERT(3548, strlen(dzsName) <= sizeof(dzsName)); if (useOldRes) { dzs = dComIfG_getOldStageRes(dzsName); } else { dzs = dComIfG_getStageRes(dzsName); } + } else { + OS_REPORT("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Field Map Dzs Find !!\n"); } if (dzs != NULL) { @@ -2231,7 +2372,10 @@ static void readMult(dStage_dt_c* i_stage, dStage_Multi_c* multi, bool useOldRes } static int dStage_multInfoInit(dStage_dt_c* i_stage, void* i_data, int entryNum, void* param_3) { - i_stage->setMulti((dStage_Multi_c*)((char*)i_data + 4)); + UNUSED(entryNum); + UNUSED(param_3); + dStage_Multi_c* multi = (dStage_Multi_c*)((char*)i_data + 4); + i_stage->setMulti(multi); dStage_initRoomKeepDoorInfo(); readMult(i_stage, i_stage->getMulti(), false); @@ -2242,7 +2386,10 @@ static int dStage_multInfoInit(dStage_dt_c* i_stage, void* i_data, int entryNum, } static int dStage_lbnkInfoInit(dStage_dt_c* i_stage, void* i_data, int entryNum, void* param_3) { - i_stage->setLbnk((dStage_Lbnk_c*)((char*)i_data + 4)); + UNUSED(entryNum); + UNUSED(param_3); + dStage_Lbnk_c* lbnk = (dStage_Lbnk_c*)((char*)i_data + 4); + i_stage->setLbnk(lbnk); return 1; } @@ -2269,20 +2416,32 @@ static int dStage_dmapInfoInit(dStage_dt_c* i_stage, void* i_data, int entryNum, static int dStage_stageDrtgInfoInit(dStage_dt_c* i_stage, void* i_data, int entryNum, void* param_3) { - i_stage->setDrTg((stage_tgsc_class*)((char*)i_data + 4)); + stage_tgsc_class* tgsc = (stage_tgsc_class*)((char*)i_data + 4); + i_stage->setDrTg(tgsc); dStage_tgscInfoInit(i_stage, i_data, entryNum, param_3); - dStage_KeepDoorInfoProc(i_stage, (stage_tgsc_class*)((char*)i_data + 4)); + dStage_KeepDoorInfoProc(i_stage, tgsc); return 1; } static int dStage_roomDrtgInfoInit(dStage_dt_c* i_stage, void* i_data, int entryNum, void* param_3) { - i_stage->setDrTg((stage_tgsc_class*)((char*)i_data + 4)); + stage_tgsc_class* tgsc = (stage_tgsc_class*)((char*)i_data + 4); + i_stage->setDrTg(tgsc); dStage_doorInfoInit(i_stage, i_data, entryNum, param_3); return 1; } +#if DEBUG +static int dStage_unitInit(dStage_dt_c* i_stage, void* i_data, int, void*) { + void* unit = (void*)((char*)i_data + 4); + dBgp_c::setPointer(unit); + i_stage->setUnit(unit); + return 1; +} +#endif + static int dStage_elstInfoInit(dStage_dt_c* i_stage, void* i_data, int param_2, void* param_3) { + UNUSED(param_3); dStage_Elst_c* elst = (dStage_Elst_c*)((char*)i_data + 4); if (param_2 == 0) { @@ -2302,6 +2461,7 @@ static void dKankyo_create() { } static void layerMemoryInfoLoader(void* i_data, dStage_dt_c* i_stage, int param_2) { + UNUSED(param_2); static FuncTable l_layerFuncTable[] = { {"MEM0", dStage_memaInfoInit}, {"MEC0", dStage_mecoInfoInit}, @@ -2313,15 +2473,58 @@ static void layerMemoryInfoLoader(void* i_data, dStage_dt_c* i_stage, int param_ static void dStage_dt_c_stageInitLoader(void* i_data, dStage_dt_c* i_stage) { static FuncTable l_funcTable[] = {"STAG", dStage_stagInfoInit}; + JUT_ASSERT(3959, i_data != NULL); + JUT_ASSERT(3960, i_stage != NULL); + dStage_dt_c_offsetToPtr(i_data); i_stage->init(); dStage_dt_c_decode(i_data, i_stage, l_funcTable, ARRAY_SIZEU(l_funcTable)); layerMemoryInfoLoader(i_data, i_stage, -1); } -static void layerTableLoader(void* i_data, dStage_dt_c* i_stage, int roomNo) { - static FuncTable l_layerFuncTableA[] = {"SON0", dStage_soundInfoInit}; +#if DEBUG +static void dStage_DebugDisp() { + if (data_8074C569_debug) { + JUTReport(30, 270, "envLayerSet: EnvRoom None"); + } + if (data_8074C56A_debug) { + JUTReport(30, 300, "envLayerSet: Color None"); + } + if (data_8074C56B_debug) { + JUTReport(30, 330, "envLayerSet: Palette None"); + } + if (data_8074C56C_debug) { + JUTReport(30, 360, "envLayerSet: Vrbox None"); + } +} +#endif +static void layerTableLoader(void* i_data, dStage_dt_c* i_stage, int roomNo) { +#if DEBUG + static FuncTable l_layer0FuncTableA[] = {{"SON0", dStage_soundInfoInit}, {"UNI0", dStage_unitInit}, {"UNI1", dStage_unitInit}}; + static FuncTable l_layer1FuncTableA[] = {{"SON1", dStage_soundInfoInit}, {"UNI0", dStage_unitInit}, {"UNI1", dStage_unitInit}}; + static FuncTable l_layer2FuncTableA[] = {{"SON2", dStage_soundInfoInit}, {"UNI2", dStage_unitInit}, {"UNI3", dStage_unitInit}}; + static FuncTable l_layer3FuncTableA[] = {{"SON3", dStage_soundInfoInit}, {"UNI2", dStage_unitInit}, {"UNI3", dStage_unitInit}}; + static FuncTable l_layer4FuncTableA[] = {{"SON4", dStage_soundInfoInit}, {"UNI0", dStage_unitInit}, {"UNI1", dStage_unitInit}}; + static FuncTable l_layer5FuncTableA[] = {{"SON5", dStage_soundInfoInit}, {"UNI0", dStage_unitInit}, {"UNI1", dStage_unitInit}}; + static FuncTable l_layer6FuncTableA[] = {{"SON6", dStage_soundInfoInit}, {"UNI2", dStage_unitInit}, {"UNI3", dStage_unitInit}}; + static FuncTable l_layer7FuncTableA[] = {{"SON7", dStage_soundInfoInit}, {"UNI2", dStage_unitInit}, {"UNI3", dStage_unitInit}}; + static FuncTable l_layer8FuncTableA[] = {{"SON8", dStage_soundInfoInit}, {"UNI0", dStage_unitInit}, {"UNI1", dStage_unitInit}}; + static FuncTable l_layer9FuncTableA[] = {{"SON9", dStage_soundInfoInit}, {"UNI0", dStage_unitInit}, {"UNI1", dStage_unitInit}}; + static FuncTable l_layerAFuncTableA[] = {{"SONa", dStage_soundInfoInit}, {"UNI2", dStage_unitInit}, {"UNI3", dStage_unitInit}}; + static FuncTable l_layerBFuncTableA[] = {{"SONb", dStage_soundInfoInit}, {"UNI2", dStage_unitInit}, {"UNI3", dStage_unitInit}}; + static FuncTable l_layerCFuncTableA[] = {{"SONc", dStage_soundInfoInit}, {"UNI0", dStage_unitInit}, {"UNI1", dStage_unitInit}}; + static FuncTable l_layerDFuncTableA[] = {{"SONd", dStage_soundInfoInit}, {"UNI0", dStage_unitInit}, {"UNI1", dStage_unitInit}}; + static FuncTable l_layerEFuncTableA[] = {{"SONe", dStage_soundInfoInit}, {"UNI2", dStage_unitInit}, {"UNI3", dStage_unitInit}}; + static FuncTable* l_layerFuncTableA_p[] = { + l_layer0FuncTableA, l_layer1FuncTableA, l_layer2FuncTableA, l_layer3FuncTableA, + l_layer4FuncTableA, l_layer5FuncTableA, l_layer6FuncTableA, l_layer7FuncTableA, + l_layer8FuncTableA, l_layer9FuncTableA, l_layerAFuncTableA, l_layerBFuncTableA, + l_layerCFuncTableA, l_layerDFuncTableA, l_layerEFuncTableA, + }; +#else + static FuncTable l_layerFuncTableA[] = {"SON0", dStage_soundInfoInit}; +#endif static FuncTable l_envLayerFuncTable[] = { {"LGT0", dStage_lgtvInfoInit}, {"Env0", dStage_envrInfoInit}, {"Col0", dStage_pselectInfoInit}, {"PAL0", dStage_paletteInfoInit}, @@ -2335,17 +2538,41 @@ static void layerTableLoader(void* i_data, dStage_dt_c* i_stage, int roomNo) { newRoomNo = dComIfGp_getStartStageRoomNo(); } +#if DEBUG + dStage_dt_c_decode(i_data, i_stage, l_layerFuncTableA_p[dComIfG_play_c::getLayerNo(0)], ARRAY_SIZE(l_layer0FuncTableA)); +#else dStage_setLayerTagName(l_layerFuncTableA, ARRAY_SIZEU(l_layerFuncTableA), dComIfG_play_c::getLayerNo(0)); dStage_dt_c_decode(i_data, i_stage, l_layerFuncTableA, ARRAY_SIZEU(l_layerFuncTableA)); +#endif + dStage_Elst_c* elst = dComIfGp_getStage()->getElst(); if (elst != NULL && newRoomNo >= 0 && elst->m_entryNum > newRoomNo) { dStage_Elst_dt_c* d = elst->m_entries; - int layer = dComIfG_play_c::getLayerNo(0); - dStage_setLayerTagName(l_envLayerFuncTable, ARRAY_SIZEU(l_envLayerFuncTable), - d[newRoomNo].m_layerTable[layer]); + int l = dComIfG_play_c::getLayerNo(0); + JUT_ASSERT(4174, 0 <= l && l < 15); + int env_layer = d[newRoomNo].m_layerTable[l]; + JUT_ASSERT(4182, 0 <= env_layer && env_layer < 15); + dStage_setLayerTagName(l_envLayerFuncTable, ARRAY_SIZEU(l_envLayerFuncTable), env_layer); dStage_dt_c_decode(i_data, i_stage, l_envLayerFuncTable, ARRAY_SIZEU(l_envLayerFuncTable)); +#if DEBUG + if (roomNo != -1 && !i_stage->getLightVecInfo()) { + data_8074C568_debug = true; + } + if (roomNo == -1 && !i_stage->getEnvrInfo()) { + data_8074C569_debug = true; + } + if (roomNo == -1 && !i_stage->getPselectInfo()) { + data_8074C56A_debug = true; + } + if (roomNo == -1 && !i_stage->getPaletteInfo()) { + data_8074C56B_debug = true; + } + if (roomNo == -1 && !i_stage->getVrboxcolInfo()) { + data_8074C56C_debug = true; + } +#endif } else { dStage_setLayerTagName(l_envLayerFuncTable, ARRAY_SIZEU(l_envLayerFuncTable), 0); dStage_dt_c_decode(i_data, i_stage, l_envLayerFuncTable, ARRAY_SIZEU(l_envLayerFuncTable)); @@ -2355,18 +2582,24 @@ static void layerTableLoader(void* i_data, dStage_dt_c* i_stage, int roomNo) { dStage_Elst_c* dStage_stageDt_c::getElst(void) { return mElst; } static void layerActorLoader(void* i_data, dStage_dt_c* i_stage, int param_2) { + UNUSED(param_2); static FuncTable l_layerFuncTable[] = { +#if PLATFORM_GCN {"Doo0", dStage_roomDrtgInfoInit}, +#endif {"SCO0", dStage_tgscInfoInit}, {"ACT0", dStage_actorInit}, {"TRE0", dStage_layerTresureInit}, +#if !PLATFORM_GCN + {"Doo0", dStage_roomDrtgInfoInit}, +#endif }; dStage_setLayerTagName(l_layerFuncTable, 4, dComIfG_play_c::getLayerNo(0)); dStage_dt_c_decode(i_data, i_stage, l_layerFuncTable, ARRAY_SIZEU(l_layerFuncTable)); } -static void dStage_dt_c_stageLoader(void* i_data, dStage_dt_c* i_stage) { +void dStage_dt_c_stageLoader(void* i_data, dStage_dt_c* i_stage) { static FuncTable l_funcTable[] = { {"EVLY", dStage_elstInfoInit}, {"RPPN", dStage_rppnInfoInit}, {"RPAT", dStage_rpatInfoInit}, {"MULT", dStage_multInfoInit}, @@ -2407,10 +2640,19 @@ void dStage_dt_c_roomLoader(void* i_data, dStage_dt_c* i_stage, int param_2) { void dStage_dt_c_roomReLoader(void* i_data, dStage_dt_c* i_stage, int param_2) { static FuncTable l_funcTable[] = { - {"Door", dStage_roomDrtgInfoInit}, {"ACTR", dStage_actorCommonLayerInit}, - {"TGOB", dStage_actorCommonLayerInit}, {"TRES", dStage_roomTresureInit}, - {"TGSC", dStage_tgscCommonLayerInit}, {"SCOB", dStage_tgscCommonLayerInit}, - {"TGDR", dStage_tgscInfoInit}, {"REVT", dStage_mapEventInfoInit}, +#if PLATFORM_GCN + {"Door", dStage_roomDrtgInfoInit}, +#endif + {"ACTR", dStage_actorCommonLayerInit}, + {"TGOB", dStage_actorCommonLayerInit}, + {"TRES", dStage_roomTresureInit}, + {"TGSC", dStage_tgscCommonLayerInit}, + {"SCOB", dStage_tgscCommonLayerInit}, +#if !PLATFORM_GCN + {"Door", dStage_roomDrtgInfoInit}, +#endif + {"TGDR", dStage_tgscInfoInit}, + {"REVT", dStage_mapEventInfoInit}, }; dStage_dt_c_decode(i_data, i_stage, l_funcTable, ARRAY_SIZEU(l_funcTable)); @@ -2451,6 +2693,13 @@ char dStage_roomControl_c::mDemoArcName[10]; void dStage_Create() { void* stageRsrc = dComIfG_getStageRes("stage.dzs"); JUT_ASSERT(4451, stageRsrc != NULL); +#if DEBUG + data_8074C568_debug = false; + data_8074C569_debug = false; + data_8074C56A_debug = false; + data_8074C56B_debug = false; + data_8074C56C_debug = false; +#endif dStage_dt_c_stageLoader(stageRsrc, dComIfGp_getStage()); daSus_c::execute(); @@ -2507,9 +2756,7 @@ void dStage_Delete() { dComIfGp_getStage()->init(); } -void dStage_stageDt_c::setOldMulti() { - mOldMulti = mMulti; -} +s8 dStage_roomControl_c::mRoomReadId = -1; int dStage_RoomCheck(cBgS_GndChk* gndChk) { int roomReadId = dStage_roomControl_c::getRoomReadId(); @@ -2640,6 +2887,10 @@ int dStage_changeScene4Event(int i_exitId, s8 room_no, int i_wipe, bool param_3, return 1; } +static void dummy6() { + dComIfGs_getStartPoint(); +} + void dStage_restartRoom(u32 roomParam, u32 mode, int param_2) { dComIfGp_setNextStage(dComIfGp_getStartStageName(), -1, dComIfGs_getRestartRoomNo(), -1, 0.0f, mode, 0, 0, 0, param_2, 0);