summaryrefslogtreecommitdiff
path: root/src/d/event/d_event_data.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/d/event/d_event_data.cpp')
-rw-r--r--src/d/event/d_event_data.cpp694
1 files changed, 508 insertions, 186 deletions
diff --git a/src/d/event/d_event_data.cpp b/src/d/event/d_event_data.cpp
index 9f3c49323c..b28ca2bd6b 100644
--- a/src/d/event/d_event_data.cpp
+++ b/src/d/event/d_event_data.cpp
@@ -5,22 +5,16 @@
#include "d/event/d_event_data.h"
#include "d/com/d_com_inf_game.h"
+#include "d/d_demo.h"
+#include "d/d_gameover.h"
#include "dol2asm.h"
#include "dolphin/types.h"
+#include "f_op/f_op_msg_mng.h"
//
// Types:
//
-struct dDemo_c {
- /* 80039B6C */ void start(u8 const*, cXyz*, f32);
- /* 80039CF8 */ void end();
-
- static u8 m_control[4];
- static u8 m_frameNoMsg[4];
- static u8 m_mode[4];
-};
-
struct dCamera_c {
/* 80181170 */ void StartBlure(int, fopAc_ac_c*, f32, f32);
};
@@ -136,92 +130,109 @@ extern "C" u8 m_mode__7dDemo_c[4];
extern "C" f32 mWipeRate__12dDlst_list_c;
extern "C" u8 mAudioMgrPtr__10Z2AudioMgr[4 + 4 /* padding */];
+inline dEvent_manager_c& dComIfGp_getEventManager() {
+ return g_dComIfG_gameInfo.play.getEvtManager();
+}
+
//
// Declarations:
//
+inline BOOL dComIfGs_isEventBit(u16 id) {
+ return g_dComIfG_gameInfo.info.getEvent().isEventBit(id);
+}
+
+struct TelopDataStruct {
+ s32 mName;
+ u16 mTelopNo;
+ u16 _6;
+ u16 _8;
+ // padding
+};
+
/* ############################################################################################## */
/* 803A7FB0-803A8238 0050D0 0288+00 2/2 0/0 0/0 .data TelopData */
-SECTION_DATA static u8 TelopData[648] = {
- 0x44, 0x30, 0x35, 0x00, 0x04, 0x4D, 0x10, 0x69, 0x00, 0x03, 0x00, 0x00, 0x44, 0x30, 0x35, 0x41,
- 0x04, 0x4D, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x44, 0x30, 0x35, 0x42, 0x04, 0x4D, 0xFF, 0xFF,
- 0x00, 0x00, 0x00, 0x00, 0x44, 0x30, 0x34, 0x00, 0x04, 0x4E, 0xFF, 0xFF, 0x00, 0x01, 0x00, 0x00,
- 0x44, 0x30, 0x34, 0x41, 0x04, 0x4E, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x44, 0x30, 0x34, 0x42,
- 0x04, 0x4E, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x44, 0x30, 0x31, 0x00, 0x04, 0x4F, 0x12, 0x78,
- 0x00, 0x03, 0x00, 0x00, 0x44, 0x30, 0x31, 0x41, 0x04, 0x4F, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
- 0x44, 0x30, 0x31, 0x42, 0x04, 0x4F, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x44, 0x31, 0x30, 0x00,
- 0x04, 0x50, 0x13, 0x2C, 0x00, 0x03, 0x00, 0x00, 0x44, 0x31, 0x30, 0x41, 0x04, 0x50, 0xFF, 0xFF,
- 0x00, 0x00, 0x00, 0x00, 0x44, 0x31, 0x30, 0x42, 0x04, 0x50, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
- 0x44, 0x31, 0x31, 0x00, 0x04, 0x51, 0x14, 0x78, 0x00, 0x03, 0x00, 0x00, 0x44, 0x31, 0x31, 0x41,
- 0x04, 0x51, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x44, 0x31, 0x31, 0x42, 0x04, 0x51, 0xFF, 0xFF,
- 0x00, 0x00, 0x00, 0x00, 0x44, 0x30, 0x36, 0x00, 0x04, 0x52, 0x15, 0x59, 0x00, 0x03, 0x00, 0x00,
- 0x44, 0x30, 0x36, 0x41, 0x04, 0x52, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x44, 0x30, 0x36, 0x42,
- 0x04, 0x52, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x44, 0x30, 0x37, 0x00, 0x04, 0x53, 0x16, 0x39,
- 0x00, 0x03, 0x00, 0x00, 0x44, 0x30, 0x37, 0x41, 0x04, 0x53, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
- 0x44, 0x30, 0x37, 0x42, 0x04, 0x53, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x44, 0x30, 0x38, 0x00,
- 0x04, 0x54, 0xFF, 0xFF, 0x00, 0x01, 0x00, 0x00, 0x44, 0x30, 0x38, 0x41, 0x04, 0x54, 0xFF, 0xFF,
- 0x00, 0x00, 0x00, 0x00, 0x44, 0x30, 0x38, 0x42, 0x04, 0x54, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
- 0x44, 0x30, 0x38, 0x43, 0x04, 0x54, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x44, 0x30, 0x38, 0x44,
- 0x04, 0x54, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x44, 0x30, 0x39, 0x00, 0x04, 0x55, 0xFF, 0xFF,
- 0x00, 0x01, 0x00, 0x00, 0x44, 0x30, 0x39, 0x41, 0x04, 0x55, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
- 0x44, 0x30, 0x39, 0x42, 0x04, 0x55, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x44, 0x30, 0x39, 0x43,
- 0x04, 0x55, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x46, 0x30, 0x30, 0x00, 0x04, 0x56, 0xFF, 0xFF,
- 0x00, 0x01, 0x00, 0x00, 0x46, 0x31, 0x30, 0x33, 0x04, 0x57, 0x00, 0x0A, 0x00, 0x03, 0x00, 0x00,
- 0x52, 0x30, 0x31, 0x00, 0x04, 0x57, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x46, 0x31, 0x30, 0x39,
- 0x04, 0x58, 0xFF, 0xFF, 0x00, 0x01, 0x00, 0x00, 0x52, 0x31, 0x30, 0x39, 0x04, 0x58, 0xFF, 0xFF,
- 0x00, 0x00, 0x00, 0x00, 0x52, 0x32, 0x30, 0x39, 0x04, 0x58, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
- 0x46, 0x31, 0x31, 0x32, 0x04, 0x59, 0x04, 0x09, 0x00, 0x03, 0x00, 0x00, 0x46, 0x31, 0x31, 0x33,
- 0x04, 0x5A, 0x04, 0x00, 0x00, 0x03, 0x00, 0x00, 0x46, 0x31, 0x30, 0x38, 0x04, 0x5B, 0xFF, 0xFF,
- 0x00, 0x01, 0x00, 0x00, 0x52, 0x31, 0x30, 0x38, 0x04, 0x5B, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
- 0x46, 0x31, 0x31, 0x35, 0x04, 0x5C, 0x04, 0x1E, 0x00, 0x03, 0x00, 0x00, 0x46, 0x31, 0x31, 0x31,
- 0x04, 0x5E, 0xFF, 0xFF, 0x00, 0x01, 0x00, 0x00, 0x46, 0x31, 0x32, 0x34, 0x04, 0x5F, 0xFF, 0xFF,
- 0x00, 0x01, 0x00, 0x00, 0x46, 0x31, 0x31, 0x34, 0x04, 0x60, 0x08, 0x00, 0x00, 0x03, 0x00, 0x00,
- 0x46, 0x31, 0x32, 0x35, 0x04, 0x61, 0x0A, 0x0C, 0x00, 0x03, 0x00, 0x00, 0x46, 0x31, 0x32, 0x31,
- 0x04, 0x62, 0x06, 0x2D, 0x00, 0x03, 0x00, 0x00, 0x46, 0x31, 0x32, 0x32, 0x04, 0x62, 0x06, 0x2D,
- 0x00, 0x03, 0x00, 0x00, 0x46, 0x31, 0x32, 0x33, 0x04, 0x62, 0x06, 0x2D, 0x00, 0x03, 0x00, 0x00,
- 0x46, 0x31, 0x31, 0x37, 0x04, 0x63, 0xFF, 0xFF, 0x00, 0x01, 0x00, 0x00, 0x46, 0x31, 0x32, 0x38,
- 0x04, 0x6E, 0x03, 0x2E, 0x00, 0x03, 0x00, 0x00, 0x52, 0x31, 0x32, 0x38, 0x04, 0x6E, 0xFF, 0xFF,
- 0x00, 0x00, 0x00, 0x00, 0x46, 0x31, 0x32, 0x37, 0x04, 0x74, 0xFF, 0xFF, 0x00, 0x01, 0x00, 0x00,
- 0x52, 0x31, 0x32, 0x37, 0x04, 0x74, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x46, 0x31, 0x32, 0x36,
- 0x04, 0x75, 0xFF, 0xFF, 0x00, 0x01, 0x00, 0x00,
-};
+static TelopDataStruct TelopData[] = {
+ {'D05\0', 1101, 4201, 3}, {'D05A', 1101, -1, 0}, {'D05B', 1101, -1, 0},
+ {'D04\0', 1102, -1, 1}, {'D04A', 1102, -1, 0}, {'D04B', 1102, -1, 0},
+ {'D01\0', 1103, 4728, 3}, {'D01A', 1103, -1, 0}, {'D01B', 1103, -1, 0},
+ {'D10\0', 1104, 4908, 3}, {'D10A', 1104, -1, 0}, {'D10B', 1104, -1, 0},
+ {'D11\0', 1105, 5240, 3}, {'D11A', 1105, -1, 0}, {'D11B', 1105, -1, 0},
+ {'D06\0', 1106, 5465, 3}, {'D06A', 1106, -1, 0}, {'D06B', 1106, -1, 0},
+ {'D07\0', 1107, 5689, 3}, {'D07A', 1107, -1, 0}, {'D07B', 1107, -1, 0},
+ {'D08\0', 1108, -1, 1}, {'D08A', 1108, -1, 0}, {'D08B', 1108, -1, 0},
+ {'D08C', 1108, -1, 0}, {'D08D', 1108, -1, 0}, {'D09\0', 1109, -1, 1},
+ {'D09A', 1109, -1, 0}, {'D09B', 1109, -1, 0}, {'D09C', 1109, -1, 0},
+ {'F00\0', 1110, -1, 1}, {'F103', 1111, 10, 3}, {'R01\0', 1111, -1, 0},
+ {'F109', 1112, -1, 1}, {'R109', 1112, -1, 0}, {'R209', 1112, -1, 0},
+ {'F112', 1113, 1033, 3}, {'F113', 1114, 1024, 3}, {'F108', 1115, -1, 1},
+ {'R108', 1115, -1, 0}, {'F115', 1116, 1054, 3}, {'F111', 1118, -1, 1},
+ {'F124', 1119, -1, 1}, {'F114', 1120, 2048, 3}, {'F125', 1121, 2572, 3},
+ {'F121', 1122, 1581, 3}, {'F122', 1122, 1581, 3}, {'F123', 1122, 1581, 3},
+ {'F117', 1123, -1, 1}, {'F128', 1134, 814, 3}, {'R128', 1134, -1, 0},
+ {'F127', 1140, -1, 1}, {'R127', 1140, -1, 0}, {'F126', 1141, -1, 1}};
/* 80450640-80450648 0000C0 0004+04 2/2 0/0 0/0 .sdata numTelopData */
-SECTION_SDATA static u32 numTelopData[1 + 1 /* padding */] = {
- 0x00000036,
- /* padding */
- 0x00000000,
-};
+static s32 numTelopData = ARRAY_SIZE(TelopData);
/* 8004372C-800437C4 03E06C 0098+00 2/2 0/0 0/0 .text getTelopNo__FPCc */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-static asm void getTelopNo(char const* param_0) {
- nofralloc
-#include "asm/d/event/d_event_data/getTelopNo__FPCc.s"
+static u16 getTelopNo(char const* pName) {
+ s32 val =
+ ((pName[3] == 'B' ? 'd' : pName[0]) << 0x18 | pName[4] << 0x10 | pName[5] << 8 | pName[6]);
+ for (s32 i = 0; i < numTelopData; i++) {
+ if (val == TelopData[i].mName) {
+ return TelopData[i].mTelopNo;
+ }
+ }
+ return 0xFFFF;
}
-#pragma pop
/* 800437C4-800437F0 03E104 002C+00 1/1 0/0 0/0 .text getTelopNo__Fv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-static asm void getTelopNo() {
- nofralloc
-#include "asm/d/event/d_event_data/getTelopNo__Fv.s"
+static u16 getTelopNo() {
+ return getTelopNo(dComIfGp_getStartStageName());
}
-#pragma pop
/* 800437F0-80043A14 03E130 0224+00 1/1 0/0 0/0 .text getStartTelopNo__Fv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-static asm void getStartTelopNo() {
- nofralloc
-#include "asm/d/event/d_event_data/getStartTelopNo__Fv.s"
+static u16 getStartTelopNo() {
+ const char* startStageName = dComIfGp_getStartStageName();
+ const char* lastPlayStateName = dComIfGp_getLastPlayStageName();
+ if (strcmp(startStageName, lastPlayStateName) == 0) {
+ return 0xFFFF;
+ }
+ TelopDataStruct* telopData = NULL;
+ s32 val = ((startStageName[3] == 'B' ? 'd' : startStageName[0]) << 0x18 |
+ startStageName[4] << 0x10 | startStageName[5] << 8 | startStageName[6]);
+ for (s32 i = 0; i < numTelopData; i++) {
+ if (val == TelopData[i].mName) {
+ telopData = &TelopData[i];
+ break;
+ }
+ }
+ if (telopData == NULL || telopData->_8 == 0) {
+ return 0xFFFF;
+ } else if (telopData->_8 == 2 && telopData->_6 != 0xFFFF &&
+ !dComIfGs_isEventBit(telopData->_6)) {
+ return 0xFFFF;
+ } else if (telopData->_8 == 3 && telopData->_6 != 0xFFFF &&
+ !dComIfGs_isStageSwitch(telopData->_6 >> 8, telopData->_6 & 0xFF)) {
+ return 0xFFFF;
+ } else {
+ TelopDataStruct* lastTelopData = NULL;
+ val = ((lastPlayStateName[3] == 'B' ? 'd' : lastPlayStateName[0]) << 0x18 |
+ lastPlayStateName[4] << 0x10 | lastPlayStateName[5] << 8 | lastPlayStateName[6]);
+ for (s32 i = 0; i < numTelopData; i++) {
+ if (val == TelopData[i].mName) {
+ lastTelopData = &TelopData[i];
+ break;
+ }
+ }
+ if (lastTelopData != NULL && telopData->mTelopNo == lastTelopData->mTelopNo) {
+ return 0xFFFF;
+ } else {
+ return telopData->mTelopNo;
+ }
+ }
}
-#pragma pop
/* ############################################################################################## */
/* 80379DD0-80379DD0 006430 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
@@ -255,6 +266,7 @@ SECTION_SDATA2 static f64 lit_4267 = 4503601774854144.0 /* cast s32 to float */;
/* 80043A14-80043D60 03E354 034C+00 1/1 0/0 0/0 .text dEvDt_Next_Stage__Fii */
// bunch of issues with sclsInfo section. regalloc for the rest
+// TODO: try struct on stack
#ifdef NONMATCHING
static int dEvDt_Next_Stage(int index, int wipe_type) {
char* stage;
@@ -281,18 +293,19 @@ static int dEvDt_Next_Stage(int index, int wipe_type) {
}
if (info != NULL && id >= 0 && id < info->numEntries) {
- stage = info->mEntries[id].mStage;
- point = info->mEntries[id].mStart;
- roomNo = info->mEntries[id].mRoom;
- layer = dStage_sclsInfo_getSceneLayer(&info->mEntries[id]);
- wipe = dStage_sclsInfo_getWipe(&info->mEntries[id]);
- wipe_time = dStage_sclsInfo_getWipeTime(&info->mEntries[id]);
+ stage_scls_info_class* stgInfo = &info->mEntries[id];
+ stage = stgInfo->mStage;
+ point = stgInfo->mStart;
+ roomNo = stgInfo->mRoom;
+ layer = dStage_sclsInfo_getSceneLayer(stgInfo);
+ wipe = dStage_sclsInfo_getWipe(stgInfo);
+ wipe_time = dStage_sclsInfo_getWipeTime(stgInfo);
if (wipe == 15) {
wipe = 0;
}
- s8 timeH = dStage_sclsInfo_getTimeH(&info->mEntries[id]);
+ int timeH = dStage_sclsInfo_getTimeH(stgInfo);
if (timeH >= 0 && timeH <= 23) {
setHour = true;
hour = timeH;
@@ -367,31 +380,38 @@ static asm int dEvDt_Next_Stage(int param_0, int param_1) {
#endif
/* 80043D60-80043DC8 03E6A0 0068+00 3/3 0/0 0/0 .text flagCheck__11dEvDtFlag_cFi */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dEvDtFlag_c::flagCheck(int param_0) {
- nofralloc
-#include "asm/d/event/d_event_data/flagCheck__11dEvDtFlag_cFi.s"
+BOOL dEvDtFlag_c::flagCheck(int param_0) {
+ if (flagMaxCheck(param_0)) {
+ return FALSE;
+ } else {
+ if (mFlags[(u32)param_0 / 0x20] & (1 << (param_0 & 0x1F))) {
+ return TRUE;
+ } else {
+ return FALSE;
+ }
+ }
}
-#pragma pop
/* 80043DC8-80043E30 03E708 0068+00 2/2 1/1 0/0 .text flagSet__11dEvDtFlag_cFi */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dEvDtFlag_c::flagSet(int param_0) {
- nofralloc
-#include "asm/d/event/d_event_data/flagSet__11dEvDtFlag_cFi.s"
+BOOL dEvDtFlag_c::flagSet(int param_0) {
+ if (flagMaxCheck(param_0)) {
+ return FALSE;
+ } else {
+ mFlags[(u32)param_0 / 0x20] |= (1 << (param_0 & 0x1F));
+ return TRUE;
+ }
}
-#pragma pop
-bool dEvDtFlag_c::flagMaxCheck(int flag_id) {
+BOOL dEvDtFlag_c::flagMaxCheck(int flag_id) {
if (flag_id == -1) {
- return true;
+ return TRUE;
}
- return FlagMax <= flag_id;
+ if (FlagMax <= flag_id) {
+ return TRUE;
+ } else {
+ return FALSE;
+ }
}
void dEvDtFlag_c::init() {
@@ -401,35 +421,38 @@ void dEvDtFlag_c::init() {
}
/* 80043E78-80043EFC 03E7B8 0084+00 0/0 1/1 0/0 .text finishCheck__12dEvDtEvent_cFv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm int dEvDtEvent_c::finishCheck() {
- nofralloc
-#include "asm/d/event/d_event_data/finishCheck__12dEvDtEvent_cFv.s"
+int dEvDtEvent_c::finishCheck() {
+ for (int i = 0; i < 3; i++) {
+ int tmp = field_0x88[i];
+ if (tmp == -1) {
+ return 1;
+ }
+ if (!dComIfGp_getEventManager().flagCheck(tmp)) {
+ return 0;
+ }
+ }
+ return 1;
}
-#pragma pop
/* 80043EFC-80043F70 03E83C 0074+00 0/0 1/1 0/0 .text forceFinish__12dEvDtEvent_cFv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dEvDtEvent_c::forceFinish() {
- nofralloc
-#include "asm/d/event/d_event_data/forceFinish__12dEvDtEvent_cFv.s"
+int dEvDtEvent_c::forceFinish() {
+ for (int i = 0; i < 3; i++) {
+ int tmp = field_0x88[i];
+ if (tmp == -1) {
+ return 1;
+ }
+ dComIfGp_getEventManager().setFlag(tmp);
+ }
+ return 1;
}
-#pragma pop
/* 80043F70-80043FD8 03E8B0 0068+00 0/0 1/1 0/0 .text
* specialStaffProc__12dEvDtEvent_cFP12dEvDtStaff_c */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dEvDtEvent_c::specialStaffProc(dEvDtStaff_c* param_0) {
- nofralloc
-#include "asm/d/event/d_event_data/specialStaffProc__12dEvDtEvent_cFP12dEvDtStaff_c.s"
+void dEvDtEvent_c::specialStaffProc(dEvDtStaff_c* param_0) {
+ for (int i = 0; i < mNStaff; i++) {
+ param_0[mStaff[i]].specialProc();
+ }
}
-#pragma pop
/* ############################################################################################## */
/* 80379DD0-80379DD0 006430 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
@@ -439,57 +462,56 @@ SECTION_DEAD static char const* const stringBase_80379E0D = "Timer";
#pragma pop
/* 80043FD8-8004403C 03E918 0064+00 4/4 0/0 0/0 .text specialProc_WaitStart__12dEvDtStaff_cFi */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dEvDtStaff_c::specialProc_WaitStart(int param_0) {
- nofralloc
-#include "asm/d/event/d_event_data/specialProc_WaitStart__12dEvDtStaff_cFi.s"
+void dEvDtStaff_c::specialProc_WaitStart(int param_0) {
+ int* timer = dComIfGp_evmng_getMyIntegerP(param_0, "Timer");
+ if (timer == NULL) {
+ field_0x36 = 0;
+ } else {
+ field_0x36 = *timer;
+ }
}
-#pragma pop
/* 8004403C-80044080 03E97C 0044+00 4/4 0/0 0/0 .text specialProc_WaitProc__12dEvDtStaff_cFi */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dEvDtStaff_c::specialProc_WaitProc(int param_0) {
- nofralloc
-#include "asm/d/event/d_event_data/specialProc_WaitProc__12dEvDtStaff_cFi.s"
+void dEvDtStaff_c::specialProc_WaitProc(int param_0) {
+ if (field_0x36 > 0) {
+ field_0x36--;
+ } else {
+ dComIfGp_evmng_cutEnd(param_0);
+ }
}
-#pragma pop
-
-/* ############################################################################################## */
-/* 803A8238-803A8270 -00001 0034+04 1/1 0/0 0/0 .data @4398 */
-SECTION_DATA static void* lit_4398[13 + 1 /* padding */] = {
- (void*)(((char*)specialProc__12dEvDtStaff_cFv) + 0xA0),
- (void*)(((char*)specialProc__12dEvDtStaff_cFv) + 0x50),
- (void*)(((char*)specialProc__12dEvDtStaff_cFv) + 0xA0),
- (void*)(((char*)specialProc__12dEvDtStaff_cFv) + 0x68),
- (void*)(((char*)specialProc__12dEvDtStaff_cFv) + 0x48),
- (void*)(((char*)specialProc__12dEvDtStaff_cFv) + 0xA0),
- (void*)(((char*)specialProc__12dEvDtStaff_cFv) + 0x40),
- (void*)(((char*)specialProc__12dEvDtStaff_cFv) + 0x94),
- (void*)(((char*)specialProc__12dEvDtStaff_cFv) + 0x8C),
- (void*)(((char*)specialProc__12dEvDtStaff_cFv) + 0x9C),
- (void*)(((char*)specialProc__12dEvDtStaff_cFv) + 0xA0),
- (void*)(((char*)specialProc__12dEvDtStaff_cFv) + 0x38),
- (void*)(((char*)specialProc__12dEvDtStaff_cFv) + 0x70),
- /* padding */
- NULL,
-};
/* 80044080-80044134 03E9C0 00B4+00 2/1 0/0 0/0 .text specialProc__12dEvDtStaff_cFv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dEvDtStaff_c::specialProc() {
- nofralloc
-#include "asm/d/event/d_event_data/specialProc__12dEvDtStaff_cFv.s"
-}
-#pragma pop
-
-inline dEvent_manager_c& dComIfGp_getEventManager() {
- return g_dComIfG_gameInfo.play.getEvtManager();
+void dEvDtStaff_c::specialProc() {
+ switch (mType) {
+ case 0xB:
+ specialProcPackage();
+ break;
+ case 6:
+ specialProcDirector();
+ break;
+ case 4:
+ specialProcTimekeeper();
+ break;
+ case 1:
+ dComIfGp_evmng_cutEnd(mIndex);
+ break;
+ case 3:
+ specialProcEffect();
+ break;
+ case 0xC:
+ specialProcCreate();
+ dComIfGp_evmng_cutEnd(mIndex);
+ break;
+ case 8:
+ specialProcSound();
+ break;
+ case 7:
+ specialProcMessage();
+ break;
+ case 9:
+ specialProcLight();
+ break;
+ }
}
/* 80044134-80044170 03EA74 003C+00 0/0 1/1 0/0 .text init__12dEvDtStaff_cFv */
@@ -531,6 +553,46 @@ SECTION_SDATA2 static f64 lit_4461 = 24.0;
/* 80044190-80044324 03EAD0 0194+00 1/1 0/0 0/0 .text specialProcLight__12dEvDtStaff_cFv
*/
+#ifdef NM
+// matches besides floats
+void dEvDtStaff_c::specialProcLight() {
+ int staffId = i_dComIfGp_evmng_getMyStaffId("LIGHT", NULL, 0);
+ if (staffId != -1) {
+ char* nowCutNameP = dComIfGp_getEventManager().getMyNowCutName(staffId);
+ if (dComIfGp_evmng_getIsAddvance(staffId)) {
+ int nowCutName = *(int*)nowCutNameP;
+ f32* hourP;
+ switch (nowCutName) {
+ case 'CHAN':
+ hourP = dComIfGp_evmng_getMyFloatP(staffId, "Hour");
+ if (hourP != NULL) {
+ dKy_instant_timechg(*hourP * 15.0f);
+ }
+ int* weatherP = dComIfGp_evmng_getMyIntegerP(staffId, "Weather");
+ if (weatherP != NULL) {
+ switch (*weatherP) {
+ case 0:
+ dKy_instant_rainchg();
+ }
+ }
+ break;
+ case 'ADD_':
+ hourP = dComIfGp_evmng_getMyFloatP(staffId, "Hour");
+ if (hourP != NULL) {
+ f32 hours = dComIfGs_getTime() * (1.0f / 15.0f);
+ hours += *hourP;
+ while (hours >= 24.0) {
+ hours -= 24.0;
+ }
+ dKy_instant_timechg(hours * 15.0f);
+ }
+ break;
+ }
+ }
+ dComIfGp_evmng_cutEnd(staffId);
+ }
+}
+#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
@@ -539,27 +601,183 @@ asm void dEvDtStaff_c::specialProcLight() {
#include "asm/d/event/d_event_data/specialProcLight__12dEvDtStaff_cFv.s"
}
#pragma pop
-
-/* ############################################################################################## */
-/* 80379DD0-80379DD0 006430 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
-#pragma push
-#pragma force_active on
-SECTION_DEAD static char const* const stringBase_80379E21 = "MESSAGE";
-SECTION_DEAD static char const* const stringBase_80379E29 = "msgNo";
-SECTION_DEAD static char const* const stringBase_80379E2F = "No";
-SECTION_DEAD static char const* const stringBase_80379E32 = "Type";
-SECTION_DEAD static char const* const stringBase_80379E37 = "ForStart";
-#pragma pop
+#endif
/* 80044324-80044A58 03EC64 0734+00 1/1 0/0 0/0 .text specialProcMessage__12dEvDtStaff_cFv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dEvDtStaff_c::specialProcMessage() {
- nofralloc
-#include "asm/d/event/d_event_data/specialProcMessage__12dEvDtStaff_cFv.s"
+void dEvDtStaff_c::specialProcMessage() {
+ StaffWork* work = &mWork;
+ int staffId = i_dComIfGp_evmng_getMyStaffId("MESSAGE", NULL, 0);
+ if (staffId == -1) {
+ return;
+ }
+ char* nowCutName = dComIfGp_getEventManager().getMyNowCutName(staffId);
+ if (dComIfGp_evmng_getIsAddvance(staffId)) {
+ switch (*(int*)nowCutName) {
+ case 'WAIT':
+ specialProc_WaitStart(staffId);
+ break;
+ case 'CREA':
+ case 'SHOW':
+ work->_0 = UINT32_MAX;
+ work->mLMsg = NULL;
+ work->mMsgSubstanceNum = dComIfGp_evmng_getMySubstanceNum(staffId, "msgNo");
+ work->mMsgSubstanceP = dComIfGp_evmng_getMyIntegerP(staffId, "msgNo");
+ if (work->mMsgSubstanceNum < 1) {
+ work->mMsgSubstanceNum = dComIfGp_evmng_getMySubstanceNum(staffId, "No");
+ work->mMsgSubstanceP = dComIfGp_evmng_getMyIntegerP(staffId, "No");
+ }
+ work->mMsgNo = *work->mMsgSubstanceP;
+ field_0x42 = 0;
+ break;
+ case 'END\0':
+ case 'FINI':
+ work->mLMsg->field_0xf8 = 0x10;
+ break;
+ case 'CONT':
+ work->mLMsg->field_0xf8 = 0xF;
+ int* ptr = dComIfGp_evmng_getMyIntegerP(staffId, "msgNo");
+ if (ptr == NULL) {
+ ptr = dComIfGp_evmng_getMyIntegerP(staffId, "No");
+ }
+ work->mMsgNo = *ptr;
+ fopMsgM_messageSet(work->mMsgNo, 1000);
+ break;
+ case 'SAVE':
+ work->mMsgNo = 1;
+ int* typeP = dComIfGp_evmng_getMyIntegerP(staffId, "Type");
+ if (typeP != NULL && *typeP == 1) {
+ work->mMsgNo = 2;
+ }
+ work->_0 = d_GameOver_Create(work->mMsgNo);
+ break;
+ case 'TELO':
+ int* forStartP = dComIfGp_evmng_getMyIntegerP(staffId, "ForStart");
+ if (forStartP != NULL && *forStartP != 0) {
+ work->mMsgNo = getStartTelopNo();
+ } else {
+ char* stageP = dComIfGp_evmng_getMyStringP(staffId, "Stage");
+ int* noP = dComIfGp_evmng_getMyIntegerP(staffId, "No");
+ if (noP != NULL) {
+ work->mMsgNo = *noP;
+ } else if (stageP != NULL) {
+ work->mMsgNo = getTelopNo(stageP);
+ } else {
+ work->mMsgNo = getTelopNo();
+ }
+ }
+ field_0x42 = 0;
+ if (work->mMsgNo != 0xFFFF) {
+ work->_0 = fopMsgM_messageSetDemo(work->mMsgNo);
+ }
+ }
+ }
+ switch (*(int*)nowCutName) {
+ case 'WAIT':
+ specialProc_WaitProc(staffId);
+ break;
+ case 'CREA':
+ switch (field_0x42) {
+ case 0:
+ work->_0 = fopMsgM_messageSet(work->mMsgNo, 1000);
+ if (work->_0 != UINT32_MAX) {
+ field_0x42++;
+ }
+ break;
+ case 1:
+ work->mLMsg = fopMsgM_SearchByID(work->_0);
+ if (work->mLMsg != NULL) {
+ field_0x42++;
+ }
+ break;
+ case 2:
+ dComIfGp_evmng_cutEnd(staffId);
+ break;
+ }
+ break;
+ case 'PUSH':
+ if (work->mLMsg->field_0xf8 == 0xE) {
+ dComIfGp_evmng_cutEnd(staffId);
+ }
+ break;
+ case 'TELO':
+ dComIfGp_evmng_cutEnd(staffId);
+ break;
+ case 'SHOW':
+ switch (field_0x42) {
+ case 0:
+ work->_0 = fopMsgM_messageSet(work->mMsgNo, 1000);
+ if (work->_0 != UINT32_MAX) {
+ field_0x42 = 1;
+ } else {
+ break;
+ }
+ case 1:
+ work->mLMsg = fopMsgM_SearchByID(work->_0);
+ if (work->mLMsg == NULL) {
+ break;
+ }
+ switch (work->mLMsg->field_0xf8) {
+ case 0xE:
+ work->mLMsg->field_0xf8 = 0x10;
+ break;
+ case 0x11:
+ break;
+ case 0x12:
+ work->mLMsg->field_0xf8 = 0x13;
+ work->_0 = UINT32_MAX;
+ work->mLMsg = NULL;
+ work->mMsgSubstanceNum--;
+ if (work->mMsgSubstanceNum != 0) {
+ field_0x42 = 0;
+ work->mMsgSubstanceP++;
+ work->mMsgNo = *work->mMsgSubstanceP;
+ } else {
+ dComIfGp_evmng_cutEnd(staffId);
+ field_0x42 = 99;
+ }
+ break;
+ default:
+ break;
+ }
+ break;
+ default:
+ dComIfGp_evmng_cutEnd(staffId);
+ break;
+ }
+ break;
+ case 'DELE':
+ case 'FINI':
+ if (work->mLMsg == NULL) {
+ dComIfGp_evmng_cutEnd(staffId);
+ } else if (work->mLMsg->field_0xf8 == 0x12) {
+ work->mLMsg->field_0xf8 = 0x13;
+ work->_0 = UINT32_MAX;
+ work->mLMsg = NULL;
+ dComIfGp_evmng_cutEnd(staffId);
+ }
+ break;
+ case 'CONT':
+ dComIfGp_evmng_cutEnd(staffId);
+ break;
+ case 'END\0':
+ switch (work->mLMsg->field_0xf8) {
+ case 0x11:
+ case 0x12:
+ dComIfGp_evmng_cutEnd(staffId);
+ break;
+ }
+ break;
+ case 'SAVE':
+ if (d_GameOver_CheckDelete(work->_0) && dComIfGp_getGameoverStatus() == 1) {
+ dComIfGp_evmng_cutEnd(staffId);
+ d_GameOver_Delete(work->_0);
+ }
+ break;
+ default:
+ dComIfGp_evmng_cutEnd(staffId);
+ break;
+ }
}
-#pragma pop
/* ############################################################################################## */
/* 80379DD0-80379DD0 006430 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
@@ -576,6 +794,54 @@ SECTION_SDATA2 static f32 lit_4669 = -1.0f;
/* 80044A58-80044CB8 03F398 0260+00 1/1 0/0 0/0 .text specialProcSound__12dEvDtStaff_cFv
*/
+#ifdef NONMATCHING
+// matches besides floats
+void dEvDtStaff_c::specialProcSound() {
+ int staffId = i_dComIfGp_evmng_getMyStaffId("SOUND", NULL, 0);
+ if (staffId == -1) {
+ return;
+ }
+ char* nowCutName = dComIfGp_getEventManager().getMyNowCutName(staffId);
+ if (dComIfGp_evmng_getIsAddvance(staffId)) {
+ switch (*(int*)nowCutName) {
+ case 'WAIT':
+ specialProc_WaitStart(staffId);
+ break;
+ case 'STRM':
+ mDoAud_bgmStreamPlay();
+ break;
+ case 'NOMS':
+ specialProc_WaitStart(staffId);
+ break;
+ case 'RIDD':
+ int* typeP = dComIfGp_evmng_getMyIntegerP(staffId, "Type");
+ if (typeP != NULL && *typeP == 1) {
+ mDoAud_seStart(0xC, NULL, 0, 0);
+ } else {
+ mDoAud_seStart(0xD, NULL, 0, 0);
+ }
+ break;
+ case 'BGMS':
+ int* timerP = dComIfGp_evmng_getMyIntegerP(staffId, "Timer");
+ if (timerP != NULL) {
+ mDoAud_bgmStop(*timerP);
+ }
+ }
+ }
+ switch (*(int*)nowCutName) {
+ case 'WAIT':
+ specialProc_WaitProc(staffId);
+ break;
+ case 'NOMS':
+ if (mSoundWait <= dDemo_c::getFrameNoMsg()) {
+ dComIfGp_evmng_cutEnd(staffId);
+ }
+ break;
+ default:
+ dComIfGp_evmng_cutEnd(staffId);
+ }
+}
+#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
@@ -584,6 +850,7 @@ asm void dEvDtStaff_c::specialProcSound() {
#include "asm/d/event/d_event_data/specialProcSound__12dEvDtStaff_cFv.s"
}
#pragma pop
+#endif
/* ############################################################################################## */
/* 80379DD0-80379DD0 006430 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
@@ -599,6 +866,60 @@ SECTION_DEAD static char const* const stringBase_80379E65 = "SCALE";
/* 80044CB8-80044EE4 03F5F8 022C+00 1/1 0/0 0/0 .text specialProcCreate__12dEvDtStaff_cFv
*/
+#ifdef NONMATCHING
+void dEvDtStaff_c::specialProcCreate() {
+ // regalloc
+ char* name;
+ u32 arg;
+ cXyz pos;
+ csXyz angle;
+ cXyz scale;
+ char* nowCutName;
+ dStage_objectNameInf* objNameInf;
+ int staffId;
+ staffId = i_dComIfGp_evmng_getMyStaffId("CREATER", NULL, 0);
+ if (staffId == -1) {
+ return;
+ }
+ nowCutName = dComIfGp_getEventManager().getMyNowCutName(staffId);
+ if (dComIfGp_evmng_getIsAddvance(staffId)) {
+ switch (*(int*)nowCutName) {
+ case 'WAIT':
+ break;
+ case 'CREA':
+ name = dComIfGp_evmng_getMyStringP(staffId, "MAKECAST");
+ objNameInf = dStage_searchName(name);
+ int* argP = dComIfGp_evmng_getMyIntegerP(staffId, "ARG");
+ if (argP == NULL) {
+ arg = UINT32_MAX;
+ } else {
+ arg = *argP;
+ }
+ cXyz* posP = dComIfGp_evmng_getMyXyzP(staffId, "POS");
+ if (posP == NULL) {
+ pos = ((fopAc_ac_c*)dComIfGp_getPlayer(0))->getPosition();
+ } else {
+ pos = *posP;
+ }
+ int* angleP = dComIfGp_evmng_getMyIntegerP(staffId, "ANGLE");
+ if (angleP == NULL) {
+ angle.setall(0);
+ } else {
+ angle.set(angleP[0], angleP[1], angleP[2]);
+ }
+ cXyz* scaleP = dComIfGp_evmng_getMyXyzP(staffId, "SCALE");
+ if (scaleP == NULL) {
+ scale.setAll(1.0f);
+ } else {
+ scale = *scaleP;
+ }
+ fopAcM_create(objNameInf->mProcName, arg, &pos, dComIfGp_roomControl_getStayNo(),
+ &angle, &scale, objNameInf->mSubtype);
+ break;
+ }
+ }
+}
+#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
@@ -607,6 +928,7 @@ asm void dEvDtStaff_c::specialProcCreate() {
#include "asm/d/event/d_event_data/specialProcCreate__12dEvDtStaff_cFv.s"
}
#pragma pop
+#endif
/* ############################################################################################## */
/* 80379DD0-80379DD0 006430 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */