Formatting

This commit is contained in:
jdflyer 2023-01-01 22:13:55 -07:00
parent 1ee0488a2d
commit d0167c1f62
4 changed files with 87 additions and 96 deletions

View File

@ -10,23 +10,23 @@
class JAISoundID {
public:
operator u32() const { return this->mId.mId; }
void operator=(JAISoundID const& other) {mId.mId = other.mId.mId;};
operator u32() const { return this->mId.mFullId; }
void operator=(JAISoundID const& other) { mId.mFullId = other.mId.mFullId; };
JAISoundID(u32 pId) { mId.mId = pId; };
JAISoundID(u32 pId) { mId.mFullId = pId; };
JAISoundID(JAISoundID const& other) {mId = other.mId;};
JAISoundID(JAISoundID const& other) { mId = other.mId; };
JAISoundID() {}
union {
u32 mId;
u32 mFullId;
struct {
u16 mSoundType;
u16 mShortId;
}mAdvancedId; //Debug doesn't have an inline for referencing the short ID so I assume it's similar to this
} mAdvancedId; // Debug doesn't have an inline for referencing the short ID so I assume
// it's similar to this
} mId;
};
struct JASTrack {
@ -36,11 +36,9 @@ struct JASTrack {
/* 80292918 */ void writePort(u32, u16);
/* 8029297C */ void readPort(u32);
inline int getChannelMgrCount() {
return channelMgrCount;
}
inline int getChannelMgrCount() { return channelMgrCount; }
/* 0x0 */u8 field_0x0[0x1d0];
/* 0x0 */ u8 field_0x0[0x1d0];
/* 0x1d0 */ int channelMgrCount;
};
@ -55,54 +53,50 @@ struct JAISoundStatus_ {
user_data = 0;
}
bool isAlive(); //used in assert
bool isAlive(); // used in assert
inline bool isPlaying() {
return state.unk==5;
}
inline bool isPlaying() { return state.unk == 5; }
inline bool isPaused() {
return field_0x0.flags.paused;
}
inline bool isPaused() { return field_0x0.flags.paused; }
/* 0x0 */ union {
u8 value;
struct{
u8 flag1:1;
u8 paused:1;
u8 flag3:1;
u8 flag4:1;
u8 flag5:1;
u8 flag6:1;
u8 flag7:1;
u8 flag8:1;
}flags;
}field_0x0;
struct {
u8 flag1 : 1;
u8 paused : 1;
u8 flag3 : 1;
u8 flag4 : 1;
u8 flag5 : 1;
u8 flag6 : 1;
u8 flag7 : 1;
u8 flag8 : 1;
} flags;
} field_0x0;
/* 0x1 */ union {
u8 value;
struct{
u8 flag1:1;
u8 flag2:1;
u8 flag3:1;
u8 flag4:1;
u8 flag5:1;
u8 flag6:1;
u8 flag7:1;
u8 flag8:1;
}flags;
}field_0x1;
struct {
u8 flag1 : 1;
u8 flag2 : 1;
u8 flag3 : 1;
u8 flag4 : 1;
u8 flag5 : 1;
u8 flag6 : 1;
u8 flag7 : 1;
u8 flag8 : 1;
} flags;
} field_0x1;
/* 0x2 */ struct {
u8 unk;
struct {
u8 flag1:1;
u8 flag2:1;
u8 flag3:1;
u8 flag4:1;
u8 flag5:1;
u8 flag6:1;
u8 flag7:1;
u8 flag8:1;
}flags;
u8 flag1 : 1;
u8 flag2 : 1;
u8 flag3 : 1;
u8 flag4 : 1;
u8 flag5 : 1;
u8 flag6 : 1;
u8 flag7 : 1;
u8 flag8 : 1;
} flags;
} state;
/* 0x4 */ u32 user_data;
}; // Size: 0x6
@ -117,21 +111,19 @@ struct JAISoundFader {
mTransition.zero();
}
void fadeOut(u32 fadeCount) {
if (fadeCount!=0) {
mTransition.set(0.0f,mIntensity,fadeCount);
}else{
if (fadeCount != 0) {
mTransition.set(0.0f, mIntensity, fadeCount);
} else {
forceOut();
}
}
bool isOut() {
if(mTransition.mCount != 0 || mIntensity < 0.01f) {
if (mTransition.mCount != 0 || mIntensity < 0.01f) {
return true;
}
return false;
}
inline void calc() {
mIntensity = mTransition.apply(mIntensity);
}
inline void calc() { mIntensity = mTransition.apply(mIntensity); }
/* 0x00 */ f32 mIntensity;
/* 0x04 */ JAISoundParamsTransition::TTransition mTransition;
@ -187,16 +179,14 @@ public:
u32 getUserData() const { return status_.user_data; }
bool isHandleAttached() const { return handle_ != NULL; }
void removeLifeTime_() {
status_.field_0x1.flags.flag1 = false;
}
void removeLifeTime_() { status_.field_0x1.flags.flag1 = false; }
void stop_JAISound_() {
status_.state.flags.flag5 = 0;
status_.state.flags.flag1 = 1;
}
bool isStopping() {
bool isStopping = false;
if(status_.state.flags.flag1) {
if (status_.state.flags.flag1) {
isStopping = status_.state.flags.flag5 ? fader.isOut() : true;
}
return isStopping;

View File

@ -15,7 +15,7 @@
struct JASDisposer {
JASDisposer(){};
/* 8029A7B8 */ virtual ~JASDisposer(){};
/* 8029A7B8 */ virtual ~JASDisposer() {}
/* 80290BCC */ virtual void onDispose();
};
@ -29,14 +29,14 @@ struct JASHeap : JSUTree<JASHeap> {
/* 802906F0 */ void getTailHeap();
/* 8029077C */ void getTailOffset();
/* 802907E0 */ void getCurOffset();
/* 80290B54 */ ~JASHeap(){};
/* 80290B54 */ ~JASHeap() {}
void* getBase() { return mBase; }
/*0x1c*/ OSMutex mMutex;
/*0x38*/ JASDisposer* mDisposer;
/*0x3c*/ void* mBase;
/*0x40*/ u32 _3c;
/*0x44*/ u32 _40;
/* 0x1C */ OSMutex mMutex;
/* 0x38 */ JASDisposer* mDisposer;
/* 0x3C */ void* mBase;
/* 0x40 */ u32 _3c;
/* 0x44 */ u32 _40;
};
struct JASKernel {
@ -81,20 +81,20 @@ struct JASWaveArc : JASDisposer {
struct loadToAramCallbackParams {
// not official struct name
JASWaveArc* mWavArc;
long mEntryNum;
u32 mBase;
u32 _c;
/* 0x0 */ JASWaveArc* mWavArc;
/* 0x4 */ long mEntryNum;
/* 0x8 */ u32 mBase;
/* 0xC */ u32 _c;
};
/*0x04*/ JASHeap mHeap;
/*0x48*/ u32 _48;
/*0x4c*/ volatile s32 _4c;
/*0x50*/ int mEntryNum;
/*0x54*/ u32 mFileLength;
/*0x58*/ u16 _58;
/*0x5a*/ u16 _5a;
/*0x5c*/ OSMutex mMutex;
/* 0x04 */ JASHeap mHeap;
/* 0x48 */ u32 _48;
/* 0x4C */ volatile s32 _4c;
/* 0x50 */ int mEntryNum;
/* 0x54 */ u32 mFileLength;
/* 0x58 */ u16 _58;
/* 0x5A */ u16 _5a;
/* 0x5C */ OSMutex mMutex;
};
struct JASMutexLock {
@ -103,7 +103,8 @@ struct JASMutexLock {
OSLockMutex(mMutex);
}
~JASMutexLock() { OSUnlockMutex(mMutex); }
OSMutex* mMutex;
/* 0x0 */ OSMutex* mMutex;
};
#endif /* JASWAVEARCLOADER_H */

View File

@ -15,6 +15,7 @@ struct JAUStreamFileTable {
/* 802A742C */ void init(void const*);
/* 802A7478 */ int getNumFiles() const;
/* 802A7484 */ const char* getFilePath(int) const;
/* 0x0 */ const BinaryStreamFileTable* mData;
};
@ -24,7 +25,7 @@ struct JAIStreamDataMgr {
struct JAUStreamDataMgr_StreamFileTable : JAIStreamDataMgr {
/* 802A74AC */ virtual int getStreamFileEntry(JAISoundID);
/* 802A74E8 */ virtual ~JAUStreamDataMgr_StreamFileTable(){};
/* 802A74E8 */ virtual ~JAUStreamDataMgr_StreamFileTable() {}
/* 0x4 */ JAUStreamFileTable mStreamFileTable;
};

View File

@ -4,10 +4,10 @@
//
#include "f_op/f_op_scene.h"
#include "f_op/f_op_scene_tag.h"
#include "f_pc/f_pc_manager.h"
#include "dol2asm.h"
#include "dolphin/types.h"
#include "f_op/f_op_scene_tag.h"
#include "f_pc/f_pc_manager.h"
/* 8001EB34-8001EB5C 019474 0028+00 1/0 0/0 0/0 .text fopScn_Draw__FP11scene_class */
static void fopScn_Draw(scene_class* pScene) {
@ -21,29 +21,30 @@ static void fopScn_Execute(scene_class* pScene) {
/* 8001EB84-8001EBAC 0194C4 0028+00 1/0 0/0 0/0 .text fopScn_IsDelete__FPv */
static s32 fopScn_IsDelete(void* pScene) {
return fpcMtd_IsDelete(((scene_class*)pScene)->mpMtd, pScene);
return fpcMtd_IsDelete(static_cast<scene_class*>(pScene)->mpMtd, pScene);
}
/* 8001EBAC-8001EC00 0194EC 0054+00 1/0 0/0 0/0 .text fopScn_Delete__FPv */
static s32 fopScn_Delete(void* param_1) {
scene_class* pScene = (scene_class*)param_1;
s32 ret = fpcMtd_Delete(pScene->mpMtd, pScene);
static s32 fopScn_Delete(void* pScene) {
scene_class* scene = static_cast<scene_class*>(pScene);
s32 ret = fpcMtd_Delete(scene->mpMtd, scene);
if (ret == 1) {
fopScnTg_QueueTo(&pScene->mScnTg);
fopScnTg_QueueTo(&scene->mScnTg);
}
return ret;
}
/* 8001EC00-8001EC74 019540 0074+00 1/0 0/0 0/0 .text fopScn_Create__FPv */
static s32 fopScn_Create(void * pScene) {
scene_class* scene = (scene_class*)pScene;
static s32 fopScn_Create(void* pScene) {
scene_class* scene = static_cast<scene_class*>(pScene);
if (fpcM_IsFirstCreating(pScene)) {
scene_process_profile_definition* profile = (scene_process_profile_definition*) fpcM_GetProfile(pScene);
scene_process_profile_definition* profile =
(scene_process_profile_definition*)fpcM_GetProfile(pScene);
scene->mpMtd = profile->mpMtd;
fopScnTg_Init(&scene->mScnTg, pScene);
fopScnTg_ToQueue(&scene->mScnTg);
u32 * append = (u32*)fpcM_GetAppend(pScene);
u32* append = (u32*)fpcM_GetAppend(pScene);
if (append != NULL) {
scene->mBase.mBase.mParameters = *append;
}
@ -55,9 +56,7 @@ static s32 fopScn_Create(void * pScene) {
/* ############################################################################################## */
/* 803A38B0-803A38C8 -00001 0014+04 0/0 9/0 0/0 .data g_fopScn_Method */
nodedraw_method_class g_fopScn_Method = {
(process_method_func)fopScn_Create,
(process_method_func)fopScn_Delete,
(process_method_func)fopScn_Execute,
(process_method_func)fopScn_IsDelete,
(process_method_func)fopScn_Create, (process_method_func)fopScn_Delete,
(process_method_func)fopScn_Execute, (process_method_func)fopScn_IsDelete,
(process_method_func)fopScn_Draw,
};