diff --git a/configure.py b/configure.py index 1abf74b65..a402fa2d0 100644 --- a/configure.py +++ b/configure.py @@ -716,7 +716,7 @@ def JSystemLib(lib_name, objects): Object(Matching, "JSystem/JAudio/JASOuterParam.cpp"), Object(Matching, "JSystem/JAudio/JASPlayer_impl.cpp"), Object(Matching, "JSystem/JAudio/JASRegisterParam.cpp"), - Object(NonMatching, "JSystem/JAudio/JASSeqCtrl.cpp"), + Object(Matching, "JSystem/JAudio/JASSeqCtrl.cpp"), Object(NonMatching, "JSystem/JAudio/JASSeqParser.cpp"), Object(NonMatching, "JSystem/JAudio/JASTrack.cpp"), Object(Matching, "JSystem/JAudio/JASTrackInterrupt.cpp"), diff --git a/include/JAZelAudio/JAIZelBasic.h b/include/JAZelAudio/JAIZelBasic.h index cc38a7ab1..320e4d743 100644 --- a/include/JAZelAudio/JAIZelBasic.h +++ b/include/JAZelAudio/JAIZelBasic.h @@ -281,7 +281,7 @@ class JAIZelBasic : public JAIBasic { /* 0x00CF */ u8 field_0x00CF[0x00D0 - 0x00CF]; /* 0x00D0 */ int field_0x00d0; /* 0x00D4 */ JAISound* mpSeSound[MAX_CONCURRENT_SE_NUM]; - /* 0x0134 */ u32 mpSeNum[MAX_CONCURRENT_SE_NUM]; + /* 0x0134 */ u32 mSeNum[MAX_CONCURRENT_SE_NUM]; /* 0x0194 */ u32 field_0x0194[MAX_CONCURRENT_SE_NUM]; /* 0x01F4 */ int field_0x01f4; /* 0x01F8 */ u8 field_0x01f8; diff --git a/include/JSystem/JAudio/JASSeqCtrl.h b/include/JSystem/JAudio/JASSeqCtrl.h index 15a49b1d7..8cf93ee96 100644 --- a/include/JSystem/JAudio/JASSeqCtrl.h +++ b/include/JSystem/JAudio/JASSeqCtrl.h @@ -8,6 +8,20 @@ namespace JASystem { class TSeqCtrl { public: + void call(u32) {} + void clrIntr() {} + void getAddr(u32) {} + void getBase() {} + u8 getByte(u32 offset) const { return field_0x0[offset]; } + void getLoopCount() const {} + void getWait() const {} + void isIntr() const {} + void jump(u32) {} + void loopStart(u32) {} + u8 readByte() { return *field_0x4++; } + void ret() {} + void wait(s32) {} + void init(); void start(void*, u32); int loopEnd(); diff --git a/include/d/actor/d_a_obj_timer.h b/include/d/actor/d_a_obj_timer.h index 67ec9ba21..ae7561e60 100644 --- a/include/d/actor/d_a_obj_timer.h +++ b/include/d/actor/d_a_obj_timer.h @@ -24,7 +24,7 @@ namespace daObjTimer { s32 prm_get_swSave() const { return daObj::PrmAbstract(this, PRM_SWSAVE_W, PRM_SWSAVE_S); } s32 prm_get_time() const { return daObj::PrmAbstract(this, PRM_TIME_W, PRM_TIME_S); } - void stopTimer() {} + void stopTimer() { mIsStop = true;} s32 _create(); bool _delete(); @@ -36,8 +36,8 @@ namespace daObjTimer { public: /* 0x290 */ Mode_e mMode; - /* 0x294 */ s32 m294; - /* 0x298 */ bool m298; + /* 0x294 */ s32 mTimer; + /* 0x298 */ bool mIsStop; }; }; diff --git a/include/d/d_com_inf_game.h b/include/d/d_com_inf_game.h index adea495a7..5b70d56b8 100644 --- a/include/d/d_com_inf_game.h +++ b/include/d/d_com_inf_game.h @@ -1749,6 +1749,10 @@ inline u8* dComIfGs_getPEventBit() { return g_dComIfG_gameInfo.save.getEvent().getPEventBit(); } +inline void dComIfGs_setCardToMemory(u8* i_cardPtr, int i_dataNum) { + g_dComIfG_gameInfo.save.card_to_memory((char*)i_cardPtr, i_dataNum); +} + u8 dComIfGs_checkGetItemNum(u8 i_itemNo); stage_scls_info_class* dComIfGd_getMeshSceneList(Vec& vec); diff --git a/include/d/d_file_select.h b/include/d/d_file_select.h index 1bce5f3ce..48a37eb5c 100644 --- a/include/d/d_file_select.h +++ b/include/d/d_file_select.h @@ -29,9 +29,9 @@ class dFile_select_c { void isDataNew(u8) {} void isSelectEnd() {} void setIconMode(u8) {} - void setSaveDataPtr(u8*) {} - void setSavePicDataPtr(u8*) {} - void setUseType(u8) {} + void setSaveDataPtr(u8* dataPtr) { mSaveDataPtr = dataPtr; } + void setSavePicDataPtr(u8* dataPtr) { mSavePicDataPtr = dataPtr; } + void setUseType(u8 useType) { mUseType = useType; } dFile_select_c() {} void _create(); @@ -243,9 +243,9 @@ class dFile_select_c { /* 0x3932 */ s16 field_0x3932; /* 0x3934 */ u8 field_0x3934[0x3936 - 0x3934]; /* 0x3936 */ u8 field_0x3936; - /* 0x3938 */ void* field_0x3938; - /* 0x393C */ void* field_0x393c; - /* 0x3940 */ u8 field_0x3940; + /* 0x3938 */ u8* mSaveDataPtr; + /* 0x393C */ u8* mSavePicDataPtr; + /* 0x3940 */ u8 mUseType; /* 0x3941 */ u8 field_0x3941; /* 0x3942 */ u8 field_0x3942[0x3948 - 0x3942]; /* 0x3948 */ f32 field_0x3948; diff --git a/include/d/d_menu_save.h b/include/d/d_menu_save.h index 8e923a1c5..2cc0edbc2 100644 --- a/include/d/d_menu_save.h +++ b/include/d/d_menu_save.h @@ -14,12 +14,12 @@ class dDlst_MenuSave_c : public dDlst_base_c { class dMenu_save_c { public: - void getDataBufPtr() {} - void getEndStatus() {} - void getSaveStatus() {} - void setErrorFlag(unsigned char) {} - void setErrorType(unsigned char) {} - void setUseType(unsigned char) {} + u8* getDataBufPtr() { return mDataBuf; } + u8 getEndStatus() { return mEndStatus; } + u8 getSaveStatus() { return mSaveStatus; } + void setErrorFlag(u8) {} + void setErrorType(u8) {} + void setUseType(u8 useType) { mUseType = useType; } virtual ~dMenu_save_c() {} void _create(); @@ -97,13 +97,13 @@ class dMenu_save_c { void initializeEx(); void menuUp(); void menuDown(); - void PaneAlphaMsgTxt(short, unsigned char); - void PaneTranceBase(short, unsigned char, float, float, unsigned char, int); - void PaneScaleAlphaWipe(short, unsigned char, float, unsigned char, int); - void PaneAlphaMask(short, unsigned char, unsigned char, int); - void PaneTranceTitle(short, unsigned char, float, float, unsigned char, int); - void PaneRotate(short, unsigned char, fopMsgM_pane_class*, float, float, float, unsigned char); - void PaneTranceMenu(short, unsigned char, fopMsgM_pane_class*, float, float, unsigned char, int); + void PaneAlphaMsgTxt(s16, u8); + void PaneTranceBase(s16, u8, f32, f32, u8, int); + void PaneScaleAlphaWipe(s16, u8, f32, u8, int); + void PaneAlphaMask(s16, u8, u8, int); + void PaneTranceTitle(s16, u8, f32, f32, u8, int); + void PaneRotate(s16, u8, fopMsgM_pane_class*, f32, f32, f32, u8); + void PaneTranceMenu(s16, u8, fopMsgM_pane_class*, f32, f32, u8, int); public: /* 0x0004 */ u8 field_0x0004; @@ -114,20 +114,20 @@ class dMenu_save_c { #endif /* 0x000C */ u8 field_0x000c[0x0524]; /* 0x0530 */ u8 field_0x0530; - /* 0x0531 */ u8 field_0x0531; + /* 0x0531 */ u8 mSaveStatus; /* 0x0532 */ u8 field_0x0532; /* 0x0533 */ u8 field_0x0533; /* 0x0534 */ u8 field_0x0534; /* 0x0535 */ u8 field_0x0535; /* 0x0536 */ u8 field_0x0536; - /* 0x0537 */ u8 field_0x0537; - /* 0x0538 */ u8 field_0x0538; + /* 0x0537 */ u8 mUseType; + /* 0x0538 */ u8 mEndStatus; /* 0x0539 */ u8 field_0x0539[0x053C - 0x0539]; /* 0x053C */ u8 field_0x053c; /* 0x053D */ u8 field_0x053d; /* 0x053E */ u8 field_0x053e[0x0554 - 0x053E]; - /* 0x0554 */ u8 field_0x0554[0x1BA4 - 0x0554]; -}; + /* 0x0554 */ u8 mDataBuf[0x1650]; +}; // Size: 0x1BA4 class dMs_HIO_c { public: diff --git a/include/d/d_s_name.h b/include/d/d_s_name.h index d95c13c08..58d360cb0 100644 --- a/include/d/d_s_name.h +++ b/include/d/d_s_name.h @@ -165,8 +165,8 @@ class dScnName_c : public scene_class { /* 0x55E */ u8 field_0x55e; /* 0x55F */ u8 field_0x55f; /* 0x560 */ u8 saveMemory[0x1650]; - /* 0x1BB0 */ void* savePicDatabuf; - /* 0x1BB4 */ short field_0x1bb4; + /* 0x1BB0 */ u8* savePicDatabuf; + /* 0x1BB4 */ s16 field_0x1bb4; /* 0x1BB6 */ u8 field_0x1bb6; /* 0x1BB7 */ u8 field_0x1bb7; /* 0x1BB8 */ u8 field_0x1bb8; diff --git a/src/JAZelAudio/JAIZelBasic.cpp b/src/JAZelAudio/JAIZelBasic.cpp index d33930136..c5c012bb5 100644 --- a/src/JAZelAudio/JAIZelBasic.cpp +++ b/src/JAZelAudio/JAIZelBasic.cpp @@ -189,7 +189,7 @@ void JAIZelBasic::resetProcess() { if (mpSeSound[i]) { mpSeSound[i]->stop(1); mpSeSound[i] = NULL; - mpSeNum[i] = 0; + mSeNum[i] = 0; field_0x0194[i] = 0; } } @@ -649,7 +649,7 @@ void JAIZelBasic::initSe() { field_0x01f4 = 0; for (int i = 0; i < MAX_CONCURRENT_SE_NUM; i++) { mpSeSound[i] = NULL; - mpSeNum[i] = 0; + mSeNum[i] = 0; field_0x0194[i] = 0; } for (int i = 0; i < 4; i++) { @@ -702,10 +702,10 @@ void JAIZelBasic::seStop(u32 i_seNum, s32 param_2) { param_2 = 8; } for (int i = 0; i < MAX_CONCURRENT_SE_NUM; i++) { - if (mpSeNum[i] == i_seNum && mpSeSound[i]) { + if (mSeNum[i] == i_seNum && mpSeSound[i]) { mpSeSound[i]->stop(param_2); mpSeSound[i] = NULL; - mpSeNum[i] = 0; + mSeNum[i] = 0; field_0x0194[i] = 0; } } @@ -714,7 +714,7 @@ void JAIZelBasic::seStop(u32 i_seNum, s32 param_2) { /* 802A85F4-802A8634 .text checkSePlaying__11JAIZelBasicFUl */ BOOL JAIZelBasic::checkSePlaying(u32 param_1) { for (int i = 0; i < MAX_CONCURRENT_SE_NUM; i++) { - if (mpSeNum[i] == param_1 && mpSeSound[i]) { + if (mSeNum[i] == param_1 && mpSeSound[i]) { return true; } } @@ -1398,7 +1398,7 @@ void JAIZelBasic::setSceneName(char* param_1, s32 roomNo, s32 param_3) { if (mpSeSound[i]) { mpSeSound[i]->stop(1); mpSeSound[i] = NULL; - mpSeNum[i] = 0; + mSeNum[i] = 0; field_0x0194[i] = 0; } } diff --git a/src/JSystem/J3DGraphAnimator/J3DJoint.cpp b/src/JSystem/J3DGraphAnimator/J3DJoint.cpp index 80e967c81..31f2ab631 100644 --- a/src/JSystem/J3DGraphAnimator/J3DJoint.cpp +++ b/src/JSystem/J3DGraphAnimator/J3DJoint.cpp @@ -84,7 +84,7 @@ void J3DMtxCalcBasic::calcTransform(u16 param_0, const J3DTransformInfo& info) { /* 802F525C-802F52BC .text calc__15J3DMtxCalcBasicFUs */ void J3DMtxCalcBasic::calc(u16 param_0) { - j3dSys.mCurrentMtxCalc = this; + j3dSys.setCurrentMtxCalc(this); calcTransform(param_0, j3dSys.getModel()->getModelData()->getJointNodePointer(param_0)->getTransformInfo()); } diff --git a/src/JSystem/JAudio/JASSeqCtrl.cpp b/src/JSystem/JAudio/JASSeqCtrl.cpp index 23799cfdb..2fcf74fb3 100644 --- a/src/JSystem/JAudio/JASSeqCtrl.cpp +++ b/src/JSystem/JAudio/JASSeqCtrl.cpp @@ -28,7 +28,6 @@ void JASystem::TSeqCtrl::start(void* param_1, u32 param_2) { /* 8027E45C-8027E500 .text loopEnd__Q28JASystem8TSeqCtrlFv */ int JASystem::TSeqCtrl::loopEnd() { - /* Nonmatching */ u32 var1 = field_0xc; if (var1 == 0) { JUT_WARN(45, "%s", "cannot loopE for call-stack is NULL"); @@ -83,45 +82,43 @@ bool JASystem::TSeqCtrl::retIntr() { /* 8027E59C-8027E5B4 .text get16__Q28JASystem8TSeqCtrlCFUl */ u16 JASystem::TSeqCtrl::get16(u32 param_1) const { - u16 result = field_0x0[param_1++] << 8; - result |= field_0x0[param_1++]; + u16 result = getByte(param_1++) << 8; + result |= getByte(param_1); return result; } /* 8027E5B4-8027E5DC .text get24__Q28JASystem8TSeqCtrlCFUl */ u32 JASystem::TSeqCtrl::get24(u32 param_1) const { - /* Nonmatching */ - u32 result = field_0x0[param_1++] << 8; - result |= field_0x0[param_1++]; + u32 result = getByte(param_1++) << 8; + result |= getByte(param_1++); result <<= 8; - result |= field_0x0[param_1++]; + result |= getByte(param_1); return result; } /* 8027E5DC-8027E614 .text get32__Q28JASystem8TSeqCtrlCFUl */ u32 JASystem::TSeqCtrl::get32(u32 param_1) const { - /* Nonmatching */ - u32 result = field_0x0[param_1++] << 8; - result |= field_0x0[param_1++]; + u32 result = getByte(param_1++) << 8; + result |= getByte(param_1++); result <<= 8; - result |= field_0x0[param_1++]; + result |= getByte(param_1++); result <<= 8; - result |= field_0x0[param_1++]; + result |= getByte(param_1); return result; } /* 8027E614-8027E63C .text read16__Q28JASystem8TSeqCtrlFv */ u32 JASystem::TSeqCtrl::read16() { - u32 result = *(field_0x4++) << 8; - result |= *(field_0x4++); + u32 result = readByte() << 8; + result |= readByte(); return result; } /* 8027E63C-8027E680 .text read24__Q28JASystem8TSeqCtrlFv */ u32 JASystem::TSeqCtrl::read24() { - u32 result = *(field_0x4++) << 8; - result |= *(field_0x4++); + u32 result = readByte() << 8; + result |= readByte(); result <<= 8; - result |= *(field_0x4++); + result |= readByte(); return result; } diff --git a/src/d/actor/d_a_auction.cpp b/src/d/actor/d_a_auction.cpp index a963ac172..1059a47a2 100644 --- a/src/d/actor/d_a_auction.cpp +++ b/src/d/actor/d_a_auction.cpp @@ -1651,5 +1651,3 @@ actor_process_profile_definition g_profile_AUCTION = { /* Group */ fopAc_ACTOR_e, /* CullType */ fopAc_CULLBOX_CUSTOM_e, }; - -#undef RAND_RANGE diff --git a/src/d/actor/d_a_obj_timer.cpp b/src/d/actor/d_a_obj_timer.cpp index c96f0f7b1..92c796f10 100644 --- a/src/d/actor/d_a_obj_timer.cpp +++ b/src/d/actor/d_a_obj_timer.cpp @@ -1,7 +1,7 @@ -// -// Generated by dtk -// Translation Unit: d_a_obj_timer.cpp -// +/** + * d_a_obj_timer.cpp + * Object - Timer + */ #include "d/actor/d_a_obj_timer.h" #include "d/d_procname.h" @@ -35,7 +35,7 @@ bool daObjTimer::Act_c::_delete() { /* 0000011C-0000012C .text mode_wait_init__Q210daObjTimer5Act_cFv */ void daObjTimer::Act_c::mode_wait_init() { - m294 = 0; + mTimer = 0; mMode = Mode_WAIT_e; } @@ -48,24 +48,24 @@ void daObjTimer::Act_c::mode_wait() { /* 00000188-000001CC .text mode_count_init__Q210daObjTimer5Act_cFv */ void daObjTimer::Act_c::mode_count_init() { - m294 = 15 * prm_get_time(); + mTimer = 15 * prm_get_time(); mMode = Mode_COUNT_e; } /* 000001CC-00000304 .text mode_count__Q210daObjTimer5Act_cFv */ void daObjTimer::Act_c::mode_count() { - if (m298) return; + if (mIsStop) return; - m294 -= 1; - if (m294 % 30 == 0) { - s32 time = m294 / 30; - if (time <= 20) { + mTimer -= 1; + if (mTimer % 30 == 0) { + s32 secondsLeft = mTimer / 30; + if (secondsLeft <= 20) { u32 soundId; - if (time > 10) { + if (secondsLeft > 10) { soundId = JA_SE_SYS_EV_TIMER_20; - } else if (time > 5) { + } else if (secondsLeft > 5) { soundId = JA_SE_SYS_EV_TIMER_10; - } else if (time > 0) { + } else if (secondsLeft > 0) { soundId = JA_SE_SYS_EV_TIMER_5; } else { soundId = JA_SE_SYS_EV_TIMER_0; @@ -75,7 +75,7 @@ void daObjTimer::Act_c::mode_count() { } } - if (m294 <= 0 || !fopAcM_isSwitch(this, prm_get_swSave())) { + if (mTimer <= 0 || !fopAcM_isSwitch(this, prm_get_swSave())) { fopAcM_offSwitch(this, prm_get_swSave()); mode_wait_init(); } @@ -110,12 +110,12 @@ BOOL Mthd_Execute(void* i_this) { } /* 000003FC-00000404 .text Mthd_Draw__Q210daObjTimer27@unnamed@d_a_obj_timer_cpp@FPv */ -BOOL Mthd_Draw(void*) { +BOOL Mthd_Draw(void* i_this) { return TRUE; } /* 00000404-0000040C .text Mthd_IsDelete__Q210daObjTimer27@unnamed@d_a_obj_timer_cpp@FPv */ -BOOL Mthd_IsDelete(void*) { +BOOL Mthd_IsDelete(void* i_this) { return TRUE; } diff --git a/src/d/d_gameover.cpp b/src/d/d_gameover.cpp index c96be69ee..a31435347 100644 --- a/src/d/d_gameover.cpp +++ b/src/d/d_gameover.cpp @@ -84,7 +84,7 @@ s32 dGameover_c::_create() { dMs_c = new dMenu_save_c(); JUT_ASSERT(VERSION_SELECT(0xa7, 0xb6, 0xb6), dMs_c != NULL); - dMs_c->field_0x0537 = 2; + dMs_c->setUseType(2); dMs_c->_create(); dgo_capture_c = new dDlst_Gameover_CAPTURE_c(); @@ -112,15 +112,15 @@ BOOL dGameover_c::_execute() { } } else if (mState == 4) { dMs_c->_move(); - if (dMs_c->field_0x0531 == 3) + if (dMs_c->getSaveStatus() == 3) mState = 5; } else if (mState == 5) { if (dMs_c->_close()) { - if (dMs_c->field_0x0538 == 0) { + if (dMs_c->getEndStatus() == 0) { dComIfGp_setGameoverStatus(3); dMenu_flagSet(0); mDoRst::onReset(); - } else if (dMs_c->field_0x0538 == 1) { + } else if (dMs_c->getEndStatus() == 1) { dComIfGp_setGameoverStatus(2); dMenu_flagSet(0); } diff --git a/src/d/d_s_name.cpp b/src/d/d_s_name.cpp index e3fe797ec..e33840169 100644 --- a/src/d/d_s_name.cpp +++ b/src/d/d_s_name.cpp @@ -119,7 +119,7 @@ s32 dScnName_c::create() { savePicDatabuf = new (0x20) u8[0x12000]; JUT_ASSERT(476, savePicDatabuf != NULL); if (fpcM_GetName(this) == PROC_NAME_SCENE) { - dFs_c->field_0x3940 = 0; + dFs_c->setUseType(0); dNm_c = new dName_c(); JUT_ASSERT(484, dNm_c != NULL); dNm_c->_create(); @@ -132,10 +132,10 @@ s32 dScnName_c::create() { } if (fpcM_GetName(this) == PROC_NAMEEX_SCENE) { dComIfGs_setClearCount(1); - dFs_c->field_0x3940 = 1; + dFs_c->setUseType(1); dMs_c = new dMenu_save_c(); JUT_ASSERT(511, dMs_c != NULL); - dMs_c->field_0x0537 = 3; + dMs_c->setUseType(3); dMs_c->_create(); dFe_c = NULL; dNm_c = NULL; @@ -512,12 +512,12 @@ void dScnName_c::NoteOpenWait() { } if (g_snHIO.field_0x8 == 0) { if (fpcM_GetName(this) == PROC_NAME_SCENE) { - dFs_c->field_0x3938 = saveMemory; - dFs_c->field_0x393c = savePicDatabuf; + dFs_c->setSaveDataPtr(saveMemory); + dFs_c->setSavePicDataPtr(savePicDatabuf); } if (fpcM_GetName(this) == PROC_NAMEEX_SCENE) { - dFs_c->field_0x3938 = dMs_c->field_0x0554; - dFs_c->field_0x393c = savePicDatabuf; + dFs_c->setSaveDataPtr(dMs_c->getDataBufPtr()); + dFs_c->setSavePicDataPtr(savePicDatabuf); } dFs_c->initial(); mMainProc = 3; @@ -663,7 +663,7 @@ void dScnName_c::FileSelectMainNormal() { field_0x1bb6 = 3; mMainProc = 5; } else { - g_dComIfG_gameInfo.save.card_to_memory((char *)saveMemory, dFs_c->saveSlot); + dComIfGs_setCardToMemory(saveMemory, dFs_c->saveSlot); if (dFs_c->saveStatus[dFs_c->saveSlot] != 0 && !dComIfGs_isEventBit(0x3510)) { field_0x1bb9 = 1; } @@ -871,10 +871,10 @@ void dScnName_c::SaveOpen() { /* 802321AC-8023222C .text SaveMain__10dScnName_cFv */ void dScnName_c::SaveMain() { - switch (dMs_c->field_0x0531) { + switch (dMs_c->getSaveStatus()) { case 2: dMs_c->_move(); - if (!dMs_c->field_0x0538) { + if (dMs_c->getEndStatus() == 0) { field_0x558 = 0x2d; mMainProc = 13; }