d_menu_save / pane_class / rename some data (#205)

* work on fop actor / actor mng, daalink, d_a_obj_item

* d_a_title mostly decompiled

* daalink / d_event / JMessage / dmsg_out_font work

* msg_scrn_base / msg_scrn_boss

* some work on mDo machine, d_menu_save, d_tresure, and various

* remove asm

* progress

* finish d_menu_save / d_pane_class_alpha / d_pane_class / rename some data

* rename more data

* remove asm / progress

* match all of d_pane_class

* fixes / some dKankyo doc
This commit is contained in:
TakaRikka
2022-07-04 12:21:57 -07:00
committed by GitHub
parent b68cfbc0e6
commit 929c5cfa5a
572 changed files with 4756 additions and 8007 deletions
+4 -4
View File
@@ -29,7 +29,7 @@ static OSAlarm Alarm;
/* 8001659C-8001665C 010EDC 00C0+00 0/0 1/1 0/0 .text mDoDvdErr_ThdInit__Fv */
void mDoDvdErr_ThdInit() {
if (!data_80450C88) {
if (!mDoDvdErr_initialized) {
OSTime time = OSGetTime();
OSThread* curThread = OSGetCurrentThread();
s32 priority = OSGetThreadPriority(curThread);
@@ -40,16 +40,16 @@ void mDoDvdErr_ThdInit() {
OSCreateAlarm(&Alarm);
OSSetPeriodicAlarm(&Alarm, time, OS_BUS_CLOCK / 4, AlarmHandler);
data_80450C88 = 1;
mDoDvdErr_initialized = true;
}
}
/* 8001665C-800166A4 010F9C 0048+00 0/0 1/1 0/0 .text mDoDvdErr_ThdCleanup__Fv */
void mDoDvdErr_ThdCleanup() {
if (data_80450C88) {
if (mDoDvdErr_initialized) {
OSCancelThread(&DvdErr_thread);
OSCancelAlarm(&Alarm);
data_80450C88 = 0;
mDoDvdErr_initialized = false;
}
}
+6 -5
View File
@@ -27,7 +27,6 @@ extern "C" void mDoRst_resetCallBack__FiPv();
extern "C" u32 getResetData__6mDoRstFv();
extern "C" extern char const* const m_Do_m_Do_Reset__stringBase0;
extern "C" u8 mResetData__6mDoRst[4 + 4 /* padding */];
extern "C" extern u8 struct_80450C80;
//
// External References:
@@ -138,7 +137,7 @@ void mDoRst_resetCallBack(int port, void*) {
cAPICPad_recalibrate();
} else {
if (mDoRst::is3ButtonReset()) {
struct_80451501 = false;
JUTGamePad::C3ButtonReset::sResetOccurred = false;
JUTGamePad::C3ButtonReset::sCallback = mDoRst_resetCallBack;
JUTGamePad::C3ButtonReset::sCallbackArg = NULL;
return;
@@ -171,8 +170,10 @@ u8 struct_80450C7C;
u8 struct_80450C7D;
u8 struct_80450C7E;
u8 struct_80450C7F;
u8 struct_80450C80;
u8 struct_80450C81;
bool SyncWidthSound;
u8 sDefaultDirection;
u8 struct_80450C82;
u8 struct_80450C83;
u8 struct_80450C84;
@@ -182,6 +183,6 @@ u8 struct_80450C87;
#pragma pop
/* 80450C88-80450C90 000188 0008+00 0/0 2/2 0/0 .sbss None */
u8 data_80450C88;
bool mDoDvdErr_initialized;
/* 80374198-80374198 0007F8 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
+6 -8
View File
@@ -101,7 +101,6 @@ extern "C" extern u8 data_80450B80[4];
extern "C" extern u8 data_80450B84[4];
extern "C" extern u8 data_80450B88[4];
extern "C" u8 mResetData__6mDoRst[4 + 4 /* padding */];
extern "C" extern bool struct_80450C80;
extern "C" u8 mAudioMgrPtr__10Z2AudioMgr[4 + 4 /* padding */];
extern "C" u8 sCurrentHeap__7JKRHeap[4];
@@ -114,19 +113,18 @@ extern "C" u8 sCurrentHeap__7JKRHeap[4];
/* 80450BB8 0001+00 data_80450BB8 None */
/* 80450BB9 0001+00 data_80450BB9 None */
/* 80450BBA 0002+00 data_80450BBA None */
bool struct_80450BB8;
#pragma push
#pragma force_active on
bool sResetFlag;
bool mDoAud_zelAudio_c::mInitFlag;
extern bool data_80450bba;
bool data_80450bba;
bool mDoAud_zelAudio_c::mResetFlag;
bool mDoAud_zelAudio_c::mBgmSet;
#pragma pop
/* 80006FB4-80006FC0 0018F4 000C+00 1/1 0/0 0/0 .text reset__17mDoAud_zelAudio_cFv */
void mDoAud_zelAudio_c::reset() {
data_80450bba = false;
mBgmSet = false;
}
/* 803DBF40-803DBF4C 008C60 000C+00 1/1 0/1 0/0 .bss @3620 */
@@ -187,7 +185,7 @@ static void mDoAud_Create() {
l_arcCommand->destroy();
mDoAud_zelAudio_c::onInitFlag();
struct_80450C80 = true;
SyncWidthSound = true;
}
}
+2 -7
View File
@@ -4,17 +4,12 @@
//
#include "m_Do/m_Do_controller_pad.h"
#include "m_Do/m_Do_main.h"
#include "SSystem/SComponent/c_lib.h"
#include "dol2asm.h"
#include "dolphin/types.h"
#include "f_ap/f_ap_game.h"
//
// External References:
//
extern "C" extern s8 data_80450580;
//
// Declarations:
//
@@ -31,7 +26,7 @@ void mDoCPd_c::create() {
JUTGamePad* pad = new JUTGamePad(JUTGamePad::Port_1);
m_gamePad[0] = pad;
if (data_80450580 != 0) {
if (mDoMain::developmentMode != 0) {
m_gamePad[1] = new JUTGamePad(JUTGamePad::Port_2);
m_gamePad[2] = new JUTGamePad(JUTGamePad::Port_3);
m_gamePad[3] = new JUTGamePad(JUTGamePad::Port_4);
+5 -7
View File
@@ -13,6 +13,7 @@
#include "dolphin/os/OSThread.h"
#include "dolphin/types.h"
#include "m_Do/m_Do_ext.h"
#include "m_Do/m_Do_reset.h"
//
// Types:
@@ -26,9 +27,6 @@ struct JASDvd {
static JASTaskThread* getThreadPointer();
};
extern "C" extern u8 struct_80450C80;
extern "C" extern u8 struct_80450C81;
//
// Declarations:
//
@@ -132,7 +130,7 @@ void mDoDvdThd_param_c::mainLoop() {
while (this->waitForKick() != 0) {
while (mDoDvdThd_command_c* command = this->getFirstCommand()) {
this->cut(command);
if (struct_80450C80 != 0) {
if (SyncWidthSound) {
JASDvd::getThreadPointer()->sendCmdMsg(cb, &command, 4);
} else {
cb(&command);
@@ -187,7 +185,7 @@ mDoDvdThd_mountArchive_c::mDoDvdThd_mountArchive_c(u8 param_0) {
mArchive = NULL;
mHeap = NULL;
if (param_0 == 0) {
mMountDirection = struct_80450C81;
mMountDirection = sDefaultDirection;
}
}
@@ -278,7 +276,7 @@ mDoDvdThd_mountXArchive_c::mDoDvdThd_mountXArchive_c(u8 param_0, JKRArchive::EMo
mMountMode = param_1;
mHeap = NULL;
if (param_0 == 0) {
mMountDirection = struct_80450C81;
mMountDirection = sDefaultDirection;
}
}
@@ -319,7 +317,7 @@ s32 mDoDvdThd_mountXArchive_c::execute() {
mDoDvdThd_toMainRam_c::mDoDvdThd_toMainRam_c(u8 param_0) {
mMountDirection = param_0;
if (param_0 == 0) {
mMountDirection = struct_80450C81;
mMountDirection = sDefaultDirection;
}
}
+1 -1
View File
@@ -3131,7 +3131,7 @@ static asm void mDoExt_initFont2() {
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void mDoExt_getSubFont() {
asm JUTFont* mDoExt_getSubFont() {
nofralloc
#include "asm/m_Do/m_Do_ext/mDoExt_getSubFont__Fv.s"
}
+10 -10
View File
@@ -144,6 +144,7 @@ extern "C" f32 Zero__4cXyz[3];
extern "C" u8 mPadStatus__10JUTGamePad[48];
extern "C" u8 sincosTable___5JMath[65536];
extern "C" extern s8 data_80450580;
extern "C" extern s8 developmentMode__7mDoMain;
extern "C" void* mRenderModeObj__15mDoMch_render_c[1 + 1 /* padding */];
extern "C" u8 systemConsole__9JFWSystem[4];
extern "C" u8 sManager__10JFWDisplay[4];
@@ -222,16 +223,15 @@ f32 mDoGph_gInf_c::mFadeSpeed;
/* 80450BE4-80450BE8 -00001 0004+00 8/8 9/9 11/11 .sbss None */
/* 80450BE4 0001+00 data_80450BE4 None */
/* 80450BE5 0001+00 data_80450BE5 None */
/* 80450BE6 0001+00 data_80450BE6 None */
/* 80450BE6 0001+00 mFade__13mDoGph_gInf_c None */
/* 80450BE7 0001+00 data_80450BE7 None */
extern u8 struct_80450BE4;
u8 struct_80450BE4;
bool mDoGph_gInf_c::mBlureFlag;
#pragma push
#pragma force_active on
static bool data_80450BE5;
u8 data_80450BE6;
u8 mDoGph_gInf_c::mFade;
bool data_80450BE7;
#pragma pop
@@ -272,7 +272,7 @@ SECTION_SDATA2 static f32 lit_4063 = 1.0f;
/* 80007FD8-80008028 002918 0050+00 1/1 6/4 15/15 .text fadeOut__13mDoGph_gInf_cFfR8_GXColor */
void mDoGph_gInf_c::fadeOut(f32 fadeSpeed, GXColor& fadeColor) {
data_80450BE6 = 1;
mFade = 1;
mFadeSpeed = fadeSpeed;
mFadeColor = fadeColor;
@@ -286,7 +286,7 @@ void mDoGph_gInf_c::fadeOut(f32 fadeSpeed, GXColor& fadeColor) {
/* 80008028-80008078 002968 0050+00 0/0 0/0 2/2 .text fadeOut_f__13mDoGph_gInf_cFfR8_GXColor */
void mDoGph_gInf_c::fadeOut_f(f32 fadeSpeed, GXColor& fadeColor) {
data_80450BE6 = 129;
mFade = 129;
mFadeSpeed = fadeSpeed;
mFadeColor = fadeColor;
@@ -319,7 +319,7 @@ Mtx mDoGph_gInf_c::mBlureMtx;
/* 800080A0-800080D0 0029E0 0030+00 1/1 1/1 0/0 .text onBlure__13mDoGph_gInf_cFPA4_Cf */
void mDoGph_gInf_c::onBlure(const Mtx m) {
struct_80450BE4 = 1;
mBlureFlag = true;
PSMTXCopy(m, mBlureMtx);
}
@@ -393,12 +393,12 @@ SECTION_SDATA2 static f32 lit_4131 = 255.0f;
// li instead of addi
#ifdef NONMATCHING
void mDoGph_gInf_c::calcFade() {
if (data_80450BE6) {
if (mDoGph_gInf_c::mFade == 1) {
mFadeRate += mFadeSpeed;
if (mFadeRate < 0.0f) {
mFadeRate = 0.0f;
data_80450BE6 = false;
mDoGph_gInf_c::mFade = 0;
} else {
if (mFadeRate > 1.0f) {
mFadeRate = 1.0f;
@@ -468,7 +468,7 @@ int mDoGph_AfterOfDraw() {
BOOL console_visible = port3_connected && fapGmHIO_isPrint();
// Dev mode check
if (!data_80450580) {
if (!mDoMain::developmentMode) {
procBar_visible = false;
console_visible = false;
}
+23 -18
View File
@@ -105,6 +105,7 @@ extern "C" u32 VIGetDTVStatus();
extern "C" void _savegpr_28();
extern "C" void _restgpr_28();
extern "C" extern s8 data_80450580;
extern "C" extern s8 developmentMode__7mDoMain;
extern "C" u32 memMargin__7mDoMain;
extern "C" u32 maxStdHeaps__Q29JFWSystem11CSetUpParam;
extern "C" u32 sysHeapSize__Q29JFWSystem11CSetUpParam;
@@ -123,7 +124,7 @@ extern "C" u8 systemConsole__9JFWSystem[4];
extern "C" u8 sSystemHeap__7JKRHeap[4];
extern "C" u8 sRootHeap__7JKRHeap[4];
extern "C" u8 sDebugPrint__10JUTDbPrint[4 + 4 /* padding */];
extern "C" extern bool struct_80451500;
extern "C" extern bool sResetSwitchPushing__Q210JUTGamePad13C3ButtonReset;
extern "C" u8 sErrorManager__12JUTException[4];
extern "C" u8 sConsole__12JUTException[4];
extern "C" u8 sManager__17JUTConsoleManager[4];
@@ -133,7 +134,7 @@ extern "C" u8 sManager__17JUTConsoleManager[4];
//
/* 80450BF0-80450BF4 0000F0 0004+00 1/1 0/0 0/0 .sbss None */
static u8 data_80450BF0;
static u8 mDebugFill;
/* 80450BF4-80450BF8 0000F4 0004+00 1/1 0/0 0/0 .sbss solidHeapErrors */
static int solidHeapErrors;
@@ -285,30 +286,34 @@ static u8 debug_key2;
/* 8000B68C-8000B73C 005FCC 00B0+00 1/1 0/0 0/0 .text developKeyCheck__FUlUl */
static int developKeyCheck(u32 btnTrig, u32 btnHold) {
static u8 key_link;
static u8 key_ganon;
static u8 key_zelda;
if (btnHold == (CButton::L | CButton::R | CButton::Z | CButton::DPAD_DOWN) &&
btnTrig == CButton::DPAD_DOWN) {
if (debug_key0 == 3 && debug_key1 == 6 && debug_key2 == 5) {
data_80450580 = 1;
if (key_link == 3 && key_ganon == 6 && key_zelda == 5) {
mDoMain::developmentMode = 1;
} else {
debug_key0 = 0;
debug_key1 = 0;
debug_key2 = 0;
key_link = 0;
key_ganon = 0;
key_zelda = 0;
}
}
if (btnHold == (CButton::L | CButton::DPAD_RIGHT) && btnTrig == CButton::L) {
debug_key0++;
key_link++;
}
if (btnHold == (CButton::R | CButton::DPAD_UP) && btnTrig == CButton::R) {
debug_key1++;
key_ganon++;
}
if (btnHold == (CButton::Z | CButton::DPAD_LEFT) && btnTrig == CButton::Z) {
debug_key2++;
key_zelda++;
}
return data_80450580;
return mDoMain::developmentMode;
}
/* 8000B73C-8000B768 00607C 002C+00 1/1 0/0 0/0 .text mDoMch_IsProgressiveMode__Fv */
@@ -348,7 +353,7 @@ void myExceptionCallback(u16, OSContext*, u32, u32) {
PPCHalt();
} else {
manager->setTraceSuppress(0x80);
if (data_80450580 == 0) {
if (mDoMain::developmentMode == 0) {
JUTGamePad pad(JUTGamePad::Port_1);
manager->setGamePad(&pad);
@@ -356,11 +361,11 @@ void myExceptionCallback(u16, OSContext*, u32, u32) {
OSEnableInterrupts();
// "Accepting Key input\n"
OSReport("キー入力を受け付けています\n");
while (data_80450580 == 0) {
while (mDoMain::developmentMode == 0) {
exceptionReadPad(&btnTrig, &btnHold);
developKeyCheck(btnTrig, btnHold);
JUTException::waitTime(30);
if (struct_80451501) {
if (JUTGamePad::C3ButtonReset::sResetOccurred) {
exceptionRestart();
}
}
@@ -431,7 +436,7 @@ static void fault_callback_scroll(u16, OSContext* p_context, u32, u32) {
u32 btnHold, btnTrig;
exceptionReadPad(&btnTrig, &btnHold);
if (struct_80451501) {
if (JUTGamePad::C3ButtonReset::sResetOccurred) {
OSResetSystem(1, 0, 0);
}
@@ -657,11 +662,11 @@ SECTION_SDATA GXRenderModeObj* mDoMch_render_c::mRenderModeObj = &g_ntscZeldaInt
// reg alloc r30 - r31
#ifdef NONMATCHING
int mDoMch_Create() {
if (data_80450580 == 0 || !(OSGetConsoleType() & 0x10000000)) {
if (mDoMain::developmentMode == 0 || !(OSGetConsoleType() & 0x10000000)) {
OSReportDisable();
}
JKRHeap::setDefaultDebugFill(data_80450BF0);
JKRHeap::setDefaultDebugFill(mDebugFill);
JFWSystem::setMaxStdHeap(1);
u32 arenaHi = OSGetArenaHi();
@@ -700,7 +705,7 @@ int mDoMch_Create() {
mDoExt_createAssertHeap(JKRHeap::getRootHeap());
JFWSystem::init();
if (data_80450580 == 0) {
if (mDoMain::developmentMode == 0) {
JUTAssertion::setVisible(false);
JUTDbPrint::getManager()->setVisible(false);
}
+15 -15
View File
@@ -43,6 +43,7 @@ extern "C" u8 COPYDATE_STRING__7mDoMain[18 + 2 /* padding */];
extern "C" u32 memMargin__7mDoMain;
extern "C" u8 sPowerOnTime__7mDoMain[4];
extern "C" u8 sHungUpTime__7mDoMain[4];
extern "C" s8 developmentMode__7mDoMain;
extern "C" extern u8 data_80450B38[4];
extern "C" extern u8 data_80450B3C[4];
extern "C" extern u8 data_80450B40[4];
@@ -118,7 +119,6 @@ extern "C" u8 m_gamePad__8mDoCPd_c[16];
extern "C" u8 m_cpadInfo__8mDoCPd_c[256];
extern "C" extern JKRSolidHeap* g_mDoAud_audioHeap;
extern "C" u8 mResetData__6mDoRst[4 + 4 /* padding */];
extern "C" extern u8 struct_80450C80[8];
extern "C" u8 systemConsole__9JFWSystem[4];
extern "C" u8 sSystemHeap__7JKRHeap[4];
extern "C" u8 sCurrentHeap__7JKRHeap[4];
@@ -278,7 +278,7 @@ void HeapCheck::heapDisplay() const {
}
/* 80450580-80450584 000000 0004+00 3/3 6/6 0/0 .sdata None */
SECTION_SDATA s8 data_80450580 = 0xFF;
SECTION_SDATA s8 mDoMain::developmentMode = -1;
/* 80450584-80450588 000004 0004+00 0/0 1/1 0/0 .sdata memMargin__7mDoMain */
SECTION_SDATA u32 mDoMain::memMargin = 0xFFFFFFFF;
@@ -287,7 +287,7 @@ SECTION_SDATA u32 mDoMain::memMargin = 0xFFFFFFFF;
SECTION_SDATA u8 mDoMain::mHeapBriefType = 4;
/* 80450B00-80450B08 000000 0008+00 1/1 0/0 0/0 .sbss None */
static u8 data_80450B00;
static u8 fillcheck_check_frame;
/* 80450B08-80450B0C 000008 0004+00 1/1 1/1 0/0 .sbss sPowerOnTime__7mDoMain */
OSTime mDoMain::sPowerOnTime;
@@ -299,7 +299,7 @@ OSTime mDoMain::sHungUpTime;
/* 80450B18 0001+00 data_80450B18 None */
/* 80450B19 0001+00 data_80450B19 None */
/* 80450B1A 0002+00 data_80450B1A None */
static bool struct_80450B18; // sDisplayHeapDebug
static bool mDisplayHeapSize; // sDisplayHeapDebug
static u8 sDisplayHeap;
static bool sCheckHeap;
@@ -513,17 +513,17 @@ asm void* LOAD_COPYDATE(void* param_0) {
#endif
static void debug() {
if (data_80450580) {
if (mDoMain::developmentMode) {
if (sCheckHeap) {
CheckHeap(PAD_3);
}
if ((mDoCPd_c::getGamePad(PAD_3)->getButton() & ~CButton::Z) == CButton::R &&
mDoCPd_c::getGamePad(PAD_3)->testTrigger(CButton::Z)) {
struct_80450B18 ^= 1;
mDisplayHeapSize ^= 1;
}
if (struct_80450B18) {
if (mDisplayHeapSize) {
if ((mDoCPd_c::getGamePad(PAD_3)->getButton() & ~CButton::Z) == CButton::L &&
mDoCPd_c::getGamePad(PAD_3)->testTrigger(CButton::Z)) {
mDoMain::mHeapBriefType < 5 ? mDoMain::mHeapBriefType++ :
@@ -591,7 +591,7 @@ void main01(void) {
JUTConsole* console = JFWSystem::getSystemConsole();
s32 output = 0;
if (data_80450580 != 0) {
if (mDoMain::developmentMode != 0) {
output = JUTConsole::OUTPUT_OSREPORT | JUTConsole::OUTPUT_CONSOLE;
}
@@ -601,18 +601,18 @@ void main01(void) {
mDoDvdThd_callback_c::create(LOAD_COPYDATE, NULL);
fapGm_Create__Fv();
fopAcM_initManager__Fv();
struct_80450B18 = 0;
mDisplayHeapSize = 0;
cDyl_InitAsync__Fv();
g_mDoAud_audioHeap = JKRSolidHeap::create(0x14D800, JKRHeap::getCurrentHeap(), false);
do {
frame++;
if (data_80450B00 != 0 && frame % data_80450B00 == 0) {
if (fillcheck_check_frame != 0 && frame % fillcheck_check_frame == 0) {
mDoMch_HeapCheckAll__Fv();
}
if (struct_80450C80[0]) {
if (SyncWidthSound) {
g_mDoMemCd_control.update();
}
@@ -670,16 +670,16 @@ void main() {
g_dComIfG_gameInfo.ct();
if (data_80450580 < 0) {
if (mDoMain::developmentMode < 0) {
DVDDiskID* disk_id = DVDGetCurrentDiskID();
if (disk_id->game_version > 0x90) {
data_80450580 = 1;
mDoMain::developmentMode = 1;
} else if (disk_id->game_version > 0x80) {
u32 consoleType = OSGetConsoleType();
data_80450580 = (consoleType >> 0x1C) & 1;
mDoMain::developmentMode = (consoleType >> 0x1C) & 1;
} else {
data_80450580 = 0;
mDoMain::developmentMode = 0;
}
}
+4 -4
View File
@@ -113,16 +113,16 @@ static u32 print_warings;
static u32 print_systems;
/* 80450BB4-80450BB8 -00001 0004+00 3/3 0/0 0/0 .sbss None */
static bool sOSReportInit;
static bool print_initialized;
static bool data_80450BB5;
/* 800068C4-800068DC 001204 0018+00 1/1 1/1 0/0 .text OSReportInit__Fv */
void OSReportInit() {
if (sOSReportInit) {
if (print_initialized) {
return;
}
sOSReportInit = true;
print_initialized = true;
}
/* ############################################################################################## */
@@ -166,7 +166,7 @@ void mDoPrintf_vprintf(char const* fmt, va_list args) {
/* 80006A10-80006A9C 001350 008C+00 1/1 0/0 0/0 .text mDoPrintf_VReport */
void mDoPrintf_VReport(const char* fmt, va_list args) {
if (!sOSReportInit) {
if (!print_initialized) {
OSReportInit();
}
if (sOSReportForceEnable || !sOSReportDisabled) {