Skip to content

Commit

Permalink
work on various inlines, JASSeqCtrl OK
Browse files Browse the repository at this point in the history
  • Loading branch information
LagoLunatic committed Jul 17, 2024
1 parent 4e2faca commit bad4ac2
Show file tree
Hide file tree
Showing 15 changed files with 101 additions and 88 deletions.
2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
2 changes: 1 addition & 1 deletion include/JAZelAudio/JAIZelBasic.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
14 changes: 14 additions & 0 deletions include/JSystem/JAudio/JASSeqCtrl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions include/d/actor/d_a_obj_timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace daObjTimer {

s32 prm_get_swSave() const { return daObj::PrmAbstract<Prm_e>(this, PRM_SWSAVE_W, PRM_SWSAVE_S); }
s32 prm_get_time() const { return daObj::PrmAbstract<Prm_e>(this, PRM_TIME_W, PRM_TIME_S); }
void stopTimer() {}
void stopTimer() { mIsStop = true;}

s32 _create();
bool _delete();
Expand All @@ -36,8 +36,8 @@ namespace daObjTimer {

public:
/* 0x290 */ Mode_e mMode;
/* 0x294 */ s32 m294;
/* 0x298 */ bool m298;
/* 0x294 */ s32 mTimer;
/* 0x298 */ bool mIsStop;
};
};

Expand Down
4 changes: 4 additions & 0 deletions include/d/d_com_inf_game.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
12 changes: 6 additions & 6 deletions include/d/d_file_select.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
Expand Down
36 changes: 18 additions & 18 deletions include/d/d_menu_save.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions include/d/d_s_name.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 6 additions & 6 deletions src/JAZelAudio/JAIZelBasic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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++) {
Expand Down Expand Up @@ -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;
}
}
Expand All @@ -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;
}
}
Expand Down Expand Up @@ -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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/JSystem/J3DGraphAnimator/J3DJoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand Down
31 changes: 14 additions & 17 deletions src/JSystem/JAudio/JASSeqCtrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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;
}
2 changes: 0 additions & 2 deletions src/d/actor/d_a_auction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1651,5 +1651,3 @@ actor_process_profile_definition g_profile_AUCTION = {
/* Group */ fopAc_ACTOR_e,
/* CullType */ fopAc_CULLBOX_CUSTOM_e,
};

#undef RAND_RANGE
34 changes: 17 additions & 17 deletions src/d/actor/d_a_obj_timer.cpp
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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;
}

Expand All @@ -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;
Expand All @@ -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();
}
Expand Down Expand Up @@ -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;
}

Expand Down
Loading

0 comments on commit bad4ac2

Please sign in to comment.