mirror of
https://github.com/zeldaret/tp
synced 2026-08-14 04:32:38 -04:00
move / fix bunch of stuff (#133)
* fix some class structures / d_event wip * d_event wip * move gamepad stuff * move m_Do_main * move d_bomb / partial m_Do_reset * format * remove asm * add Z2SoundID enum * move some Z2 classes * fix * move more Z2 stuff * fix fopAc_ac_c more
This commit is contained in:
@@ -3,4 +3,46 @@
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
struct mDoRstData {
|
||||
/* 0x00 */ int mReset;
|
||||
/* 0x04 */ int mResetPrepare;
|
||||
/* 0x08 */ int m3ButtonReset;
|
||||
/* 0x0C */ int m3ButtonResetPort;
|
||||
/* 0x10 */ bool mShutdown;
|
||||
/* 0x11 */ bool mReturnToMenu;
|
||||
/* 0x12 */ u8 mLogoScnFlag;
|
||||
/* 0x13 */ u8 mProgSeqFlag;
|
||||
/* 0x14 */ u8 mProgChgFlag;
|
||||
/* 0x15 */ u8 mWarningDispFlag;
|
||||
}; // Size = 0x18
|
||||
|
||||
class mDoRst {
|
||||
public:
|
||||
static void offReturnToMenu() { mResetData->mReturnToMenu = false; }
|
||||
static void offShutdown() { mResetData->mShutdown = false; }
|
||||
static void setWarningDispFlag(u8 flag) { mResetData->mWarningDispFlag = flag; }
|
||||
static void setProgChgFlag(u8 flag) { mResetData->mProgChgFlag = flag; }
|
||||
static void setProgSeqFlag(u8 flag) { mResetData->mProgSeqFlag = flag; }
|
||||
static void setLogoScnFlag(u8 flag) { mResetData->mLogoScnFlag = flag; }
|
||||
static void set3ButtonResetPort(int port) { mResetData->m3ButtonResetPort = port; }
|
||||
static void off3ButtonReset() { mResetData->m3ButtonReset = 0; }
|
||||
static void offResetPrepare() { mResetData->mResetPrepare = 0; }
|
||||
static void offReset() { mResetData->mReset = 0; }
|
||||
static u8 getLogoScnFlag() { return mResetData->mLogoScnFlag; }
|
||||
static bool isReturnToMenu() { return mResetData->mReturnToMenu; }
|
||||
static bool isShutdown() { return mResetData->mShutdown; }
|
||||
static int isReset() { return mResetData->mReset; }
|
||||
static int get3ButtonResetPort() { return mResetData->m3ButtonResetPort; }
|
||||
static int is3ButtonReset() { return mResetData->m3ButtonReset; }
|
||||
static void onReset() { mResetData->mReset = 1; }
|
||||
static void onReturnToMenu() { mResetData->mReturnToMenu = true; }
|
||||
static void on3ButtonReset() { mResetData->m3ButtonReset = 1; }
|
||||
static void onShutdown() { mResetData->mShutdown = true; }
|
||||
|
||||
static mDoRstData* getResetData();
|
||||
static void setResetData(mDoRstData* rstData) { mResetData = rstData; }
|
||||
|
||||
static mDoRstData* mResetData;
|
||||
};
|
||||
|
||||
#endif /* M_DO_M_DO_RESET_H */
|
||||
|
||||
@@ -3,4 +3,24 @@
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
// move/fix later
|
||||
template <typename T>
|
||||
class JASGlobalInstance {
|
||||
public:
|
||||
JASGlobalInstance(bool param_0) {
|
||||
if (param_0) {
|
||||
sInstance = this;
|
||||
}
|
||||
};
|
||||
~JASGlobalInstance() {
|
||||
if (sInstance == this) {
|
||||
sInstance = NULL;
|
||||
}
|
||||
};
|
||||
|
||||
T* getInstance() { return sInstance; };
|
||||
|
||||
static T* sInstance;
|
||||
};
|
||||
|
||||
#endif /* M_DO_M_DO_AUDIO_H */
|
||||
|
||||
@@ -1,6 +1,60 @@
|
||||
#ifndef M_DO_M_DO_CONTROLLER_PAD_H
|
||||
#define M_DO_M_DO_CONTROLLER_PAD_H
|
||||
|
||||
#include "JSystem/JUtility/JUTGamePad.h"
|
||||
#include "SSystem/SComponent/c_API_controller_pad.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
class mDoCPd_c {
|
||||
public:
|
||||
enum { PAD_0, PAD_1, PAD_2, PAD_3 };
|
||||
|
||||
void create();
|
||||
void read();
|
||||
void convert(interface_of_controller_pad*, JUTGamePad*);
|
||||
void LRlockCheck(interface_of_controller_pad*);
|
||||
void recalibrate();
|
||||
|
||||
static interface_of_controller_pad& getCpadInfo(u32 pad) { return m_cpadInfo[pad]; }
|
||||
static JUTGamePad* getGamePad(u32 pad) { return m_gamePad[pad]; }
|
||||
static u32 getTrig(u32 pad) { return getCpadInfo(pad).mPressedButtonFlags; }
|
||||
static u32 getTrigLockL(u32 pad) { return getCpadInfo(pad).mTrigLockL; }
|
||||
static u32 getTrigLockR(u32 pad) { return getCpadInfo(pad).mTrigLockR; }
|
||||
static u32 getTrigUp(u32 pad) { return getTrig(pad) & CButton::DPAD_UP; }
|
||||
static u32 getTrigDown(u32 pad) { return getTrig(pad) & CButton::DPAD_DOWN; }
|
||||
static u32 getTrigLeft(u32 pad) { return getTrig(pad) & CButton::DPAD_LEFT; }
|
||||
static u32 getTrigRight(u32 pad) { return getTrig(pad) & CButton::DPAD_RIGHT; }
|
||||
static u32 getTrigL(u32 pad) { return getTrig(pad) & CButton::L; }
|
||||
static u32 getTrigR(u32 pad) { return getTrig(pad) & CButton::R; }
|
||||
static u32 getTrigA(u32 pad) { return getTrig(pad) & CButton::A; }
|
||||
static u32 getTrigB(u32 pad) { return getTrig(pad) & CButton::B; }
|
||||
static u32 getTrigZ(u32 pad) { return getTrig(pad) & CButton::Z; }
|
||||
static u32 getTrigY(u32 pad) { return getTrig(pad) & CButton::Y; }
|
||||
static u32 getTrigX(u32 pad) { return getTrig(pad) & CButton::X; }
|
||||
static u32 getTrigStart(u32 pad) { return getTrig(pad) & CButton::START; }
|
||||
static u32 getHold(u32 pad) { return getCpadInfo(pad).mButtonFlags; }
|
||||
static u32 getHoldLockL(u32 pad) { return getCpadInfo(pad).mHoldLockL; }
|
||||
static u32 getHoldLockR(u32 pad) { return getCpadInfo(pad).mHoldLockR; }
|
||||
static u32 getHoldUp(u32 pad) { return getHold(pad) & CButton::DPAD_UP; }
|
||||
static u32 getHoldDown(u32 pad) { return getHold(pad) & CButton::DPAD_DOWN; }
|
||||
static u32 getHoldLeft(u32 pad) { return getHold(pad) & CButton::DPAD_LEFT; }
|
||||
static u32 getHoldRight(u32 pad) { return getHold(pad) & CButton::DPAD_RIGHT; }
|
||||
static u32 getHoldL(u32 pad) { return getHold(pad) & CButton::L; }
|
||||
static u32 getHoldR(u32 pad) { return getHold(pad) & CButton::R; }
|
||||
static u32 getHoldA(u32 pad) { return getHold(pad) & CButton::A; }
|
||||
static u32 getHoldB(u32 pad) { return getHold(pad) & CButton::B; }
|
||||
static u32 getHoldZ(u32 pad) { return getHold(pad) & CButton::Z; }
|
||||
static u32 getHoldY(u32 pad) { return getHold(pad) & CButton::Y; }
|
||||
static u32 getHoldX(u32 pad) { return getHold(pad) & CButton::X; }
|
||||
static f32 getStickX(u32 pad) { return getCpadInfo(pad).mMainStickPosX; }
|
||||
static f32 getStickY(u32 pad) { return getCpadInfo(pad).mMainStickPosY; }
|
||||
static f32 getSubStickX(u32 pad) { return getCpadInfo(pad).mCStickPosX; }
|
||||
static f32 getSubStickY(u32 pad) { return getCpadInfo(pad).mCStickPosY; }
|
||||
static f32 getAnalogR(u32 pad) { return getCpadInfo(pad).mTriggerRight; }
|
||||
static f32 getAnalogL(u32 pad) { return getCpadInfo(pad).mTriggerLeft; }
|
||||
|
||||
static JUTGamePad* m_gamePad[4];
|
||||
static interface_of_controller_pad m_cpadInfo[4];
|
||||
};
|
||||
|
||||
#endif /* M_DO_M_DO_CONTROLLER_PAD_H */
|
||||
|
||||
@@ -1,6 +1,39 @@
|
||||
#ifndef M_DO_M_DO_MAIN_H
|
||||
#define M_DO_M_DO_MAIN_H
|
||||
|
||||
#include "JSystem/JKernel/JKRExpHeap.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
class HeapCheck {
|
||||
public:
|
||||
void CheckHeap1(void);
|
||||
s32 getUsedCount(void) const;
|
||||
void heapDisplay(void) const;
|
||||
u32& getUsedCountRef() { return mUsedCount; }
|
||||
u32& getTotalUsedSizeRef() { return mTotalUsedSize; }
|
||||
JKRExpHeap* getHeap() { return mHeap; }
|
||||
void setHeap(JKRExpHeap* i_heap) { mHeap = i_heap; }
|
||||
void setHeapSize(u32 i_size) { mTargetHeapSize = i_size; }
|
||||
s32 getMaxTotalUsedSize() { return mMaxTotalUsedSize; }
|
||||
s32 getMaxTotalFreeSize() { return mMaxTotalFreeSize; }
|
||||
|
||||
private:
|
||||
/* 0x00 */ char* mName;
|
||||
/* 0x04 */ char* mJName;
|
||||
/* 0x08 */ JKRExpHeap* mHeap;
|
||||
/* 0x0C */ s32 mMaxTotalUsedSize;
|
||||
/* 0x10 */ s32 mMaxTotalFreeSize;
|
||||
/* 0x14 */ u8 unk20[8];
|
||||
/* 0x1C */ u32 mTargetHeapSize;
|
||||
/* 0x20 */ u32 mUsedCount;
|
||||
/* 0x24 */ u32 mTotalUsedSize;
|
||||
};
|
||||
|
||||
struct mDoMain {
|
||||
static u8 COPYDATE_STRING[18 + 2 /* padding */];
|
||||
static u32 memMargin;
|
||||
static u8 sPowerOnTime[4]; // should be OSTime
|
||||
static u8 sHungUpTime[4]; // should be OSTime
|
||||
};
|
||||
|
||||
#endif /* M_DO_M_DO_MAIN_H */
|
||||
|
||||
Reference in New Issue
Block a user