diff options
| author | Pheenoh <pheenoh@gmail.com> | 2021-02-03 15:12:27 -0500 |
|---|---|---|
| committer | Pheenoh <pheenoh@gmail.com> | 2021-02-03 15:12:27 -0500 |
| commit | 9cb88fdb31ed711d2fc9dfd641a01833f1d3b3c9 (patch) | |
| tree | fd9ff0f0f3939fa2d5ea0cca94516edc1f81851a /src | |
| parent | 8091fa95c5adae85d83566cee5b04e0258b0a1c6 (diff) | |
main attempt
Diffstat (limited to 'src')
| -rw-r--r-- | src/d/d_com/d_com_inf_game.cpp | 3 | ||||
| -rw-r--r-- | src/m_Do/m_Do_machine_exception.cpp | 4 | ||||
| -rw-r--r-- | src/m_Do/m_Do_main.cpp | 62 |
3 files changed, 64 insertions, 5 deletions
diff --git a/src/d/d_com/d_com_inf_game.cpp b/src/d/d_com/d_com_inf_game.cpp index aef47499e3..4126f8d584 100644 --- a/src/d/d_com/d_com_inf_game.cpp +++ b/src/d/d_com/d_com_inf_game.cpp @@ -281,6 +281,7 @@ void setBottleNum__24dSv_player_item_record_cFUcUc(u8, u8); void setCollect__20dSv_player_collect_cFiUc(int, u8); void setWarpItemData__14dComIfG_play_cFPCc4cXyzsScUcUc(void); void* memset(void* dest, int ch, u32 count); +void ct__13dComIfG_inf_cFv(void); } // memset first arg is wrong @@ -474,7 +475,7 @@ u32 dComIfG_play_c::getTimerPtr(void) { // ct__13dComIfG_inf_cFv // dComIfG_inf_c::ct(void) -asm void dComIfG_inf_c_NS_ct(void) { +asm void dComIfG_inf_c::ct(void) { nofralloc #include "d/d_com/d_com_inf_game/asm/func_8002CBE4.s" } diff --git a/src/m_Do/m_Do_machine_exception.cpp b/src/m_Do/m_Do_machine_exception.cpp index 31e76fe7c0..e6fe4a1a10 100644 --- a/src/m_Do/m_Do_machine_exception.cpp +++ b/src/m_Do/m_Do_machine_exception.cpp @@ -29,8 +29,8 @@ void print_f(void); // additional symbols needed for m_Do_machine_exception.cpp // autogenerated by split.py v0.4 at 2021-01-31 21:28:06.026523 extern u8 lbl_80374460; -extern u8 lbl_80450B08; -extern u8 lbl_80450B0C; +extern u32 lbl_80450B08; +extern u32 lbl_80450B0C; extern u8 lbl_80450B10; extern u8 lbl_80450B14; extern u8 lbl_80450C28; diff --git a/src/m_Do/m_Do_main.cpp b/src/m_Do/m_Do_main.cpp index 757c2e9fb9..4a825acfcf 100644 --- a/src/m_Do/m_Do_main.cpp +++ b/src/m_Do/m_Do_main.cpp @@ -17,6 +17,7 @@ extern u8 lbl_80451A08; extern u8 lbl_80451A0C; extern u8 lbl_80451A10; extern u8 lbl_80451A18; +extern u8 lbl_803D0000; // extern char lbl_803739A0[0x310]; extern char lbl_803739A0; @@ -54,6 +55,8 @@ void mDoMemCd_Ctrl_c_NS_update(void); void memcpy(void*, const void*, int); void read__8mDoCPd_cFv(void); void version_check__Fv(void); +void main01__Fv(void); +void ct__13dComIfG_inf_cFv(void); } void version_check(void) { @@ -223,7 +226,7 @@ const char* lbl_80373C9F = "Command"; const char* lbl_80373CA7 = "ƒRƒ}ƒ“ƒh"; void debug(void) { - if (lbl_80450580[0]) { + if (lbl_80450580) { if (lbl_80450B1A[0]) { CheckHeap(2); } @@ -351,7 +354,62 @@ asm void main01(void) { #endif #ifdef NONMATCHING -void main(void) {} +void main(void) { + s32 current_thread_priority; + u32 test; + u32 resetCode; + + OSThread* current_thread = OSGetCurrentThread(); + test = lbl_803D3420[0]; + OSTime current_time = OSGetTime(); + lbl_80450B0C = (current_time >> 0x20); + lbl_80450B08 = test; + + OSReportInit__Fv(); + version_check__Fv(); + m_Do_Reset_NS_mDoRst_NS_mResetData = (ResetData *)OSAllocFromArenaLo(0x18,4); + if (!m_Do_Reset_NS_mDoRst_NS_mResetData) { + do { + + } while (true); + } + + resetCode = OSGetResetCode(); + if (!resetCode) { + m_Do_Reset_NS_mDoRst_NS_mResetData->field_0x0 = 0; + m_Do_Reset_NS_mDoRst_NS_mResetData->field_0x4 = 0; + m_Do_Reset_NS_mDoRst_NS_mResetData->field_0x4 = 0; + m_Do_Reset_NS_mDoRst_NS_mResetData->field_0x8 = 0; + m_Do_Reset_NS_mDoRst_NS_mResetData->pad_index = -1; + m_Do_Reset_NS_mDoRst_NS_mResetData->field_0x12 = 0; + m_Do_Reset_NS_mDoRst_NS_mResetData->field_0x13 = 0; + m_Do_Reset_NS_mDoRst_NS_mResetData->field_0x14 = 0; + m_Do_Reset_NS_mDoRst_NS_mResetData->field_0x15 = 0; + m_Do_Reset_NS_mDoRst_NS_mResetData->field_0x10 = 0; + m_Do_Reset_NS_mDoRst_NS_mResetData->field_0x11 = 0; + } + + g_dComIfG_gameInfo.ct(); + + if (lbl_80450580 < 0) { + DVDDiskID* disk_id = DVDGetCurrentDiskID(); + if (disk_id->game_version > 0x90) { + lbl_80450580 = 0; + } else { + if (disk_id->game_version > 0x80) { + resetCode = OSGetConsoleType(); + lbl_80450580 = (resetCode >> 0x1C) & 1; + } + lbl_80450580 = 1; + } + } + + current_thread_priority = OSGetThreadPriority(current_thread); + OSCreateThread(&lbl_803DB420,main01__Fv, 0, &lbl_803DB420, 0x8000, current_thread_priority, 0); + OSResumeThread(&lbl_803DB420); + OSSetThreadPriority(current_thread, 0x1F); + OSSuspendThread(current_thread); +} #else asm void main(void) { nofralloc |
