summaryrefslogtreecommitdiff
path: root/include/m_Do
diff options
context:
space:
mode:
authorTakaRikka <takarikka@outlook.com>2022-06-01 03:49:32 -0700
committerTakaRikka <takarikka@outlook.com>2022-06-01 03:49:32 -0700
commit3f22fa448376893fffd83815ecd4cdccb197f1a4 (patch)
treeee4fc3c63d8d1d36d5705c7d75a6ba3c47c6549c /include/m_Do
parent36e62e0b80225b6ef6cbe6a7322397899d3a0ffd (diff)
m_Do / d_a_npc work
Diffstat (limited to 'include/m_Do')
-rw-r--r--include/m_Do/m_Do_DVDError.h5
-rw-r--r--include/m_Do/m_Do_MemCard.h6
-rw-r--r--include/m_Do/m_Do_Reset.h4
-rw-r--r--include/m_Do/m_Do_audio.h2
-rw-r--r--include/m_Do/m_Do_controller_pad.h6
-rw-r--r--include/m_Do/m_Do_machine.h1
-rw-r--r--include/m_Do/m_Do_main.h28
7 files changed, 43 insertions, 9 deletions
diff --git a/include/m_Do/m_Do_DVDError.h b/include/m_Do/m_Do_DVDError.h
index 5559ee3166..d4d162a959 100644
--- a/include/m_Do/m_Do_DVDError.h
+++ b/include/m_Do/m_Do_DVDError.h
@@ -2,5 +2,10 @@
#define M_DO_M_DO_DVDERROR_H
#include "dolphin/types.h"
+#include "JSystem/JKernel/JKRThread.h"
+
+void mDoDvdErr_ThdCleanup();
+static void mDoDvdErr_Watch(void*);
+static void AlarmHandler(OSAlarm*, OSContext*);
#endif /* M_DO_M_DO_DVDERROR_H */
diff --git a/include/m_Do/m_Do_MemCard.h b/include/m_Do/m_Do_MemCard.h
index b91cb63326..f1513f7b1c 100644
--- a/include/m_Do/m_Do_MemCard.h
+++ b/include/m_Do/m_Do_MemCard.h
@@ -39,6 +39,8 @@ public:
/* 800172D4 */ s32 checkspace();
/* 80017360 */ void setCardState(s32);
+ bool isCardCommNone() { return mCardCommand == CARD_NO_COMMAND; }
+
/* 0x0000 */ u8 mData[0x1FBC];
/* 0x1FBC */ u8 mChannel;
/* 0x1FBD */ u8 mCopyToPos;
@@ -59,4 +61,8 @@ static int mDoMemCd_main(void*);
extern mDoMemCd_Ctrl_c g_mDoMemCd_control;
+inline bool mDoMemCd_isCardCommNone() {
+ return g_mDoMemCd_control.isCardCommNone();
+}
+
#endif /* M_DO_M_DO_MEMCARD_H */
diff --git a/include/m_Do/m_Do_Reset.h b/include/m_Do/m_Do_Reset.h
index 3045816bd8..5d9609065c 100644
--- a/include/m_Do/m_Do_Reset.h
+++ b/include/m_Do/m_Do_Reset.h
@@ -38,7 +38,7 @@ public:
static u8 getProgSeqFlag() { return mResetData->mProgSeqFlag; }
static u8 getWarningDispFlag() { return mResetData->mWarningDispFlag; }
static BOOL isReturnToMenu() { return mResetData->mReturnToMenu; }
- static bool isShutdown() { return mResetData->mShutdown; }
+ static BOOL isShutdown() { return mResetData->mShutdown; }
static int isReset() { return mResetData->mReset; }
static int get3ButtonResetPort() { return mResetData->m3ButtonResetPort; }
static int is3ButtonReset() { return mResetData->m3ButtonReset; }
@@ -54,4 +54,6 @@ public:
static mDoRstData* mResetData;
};
+extern u8 data_80450C88;
+
#endif /* M_DO_M_DO_RESET_H */
diff --git a/include/m_Do/m_Do_audio.h b/include/m_Do/m_Do_audio.h
index c589030a83..6798ece84d 100644
--- a/include/m_Do/m_Do_audio.h
+++ b/include/m_Do/m_Do_audio.h
@@ -20,6 +20,7 @@ extern bool sResetFlag;
class mDoAud_zelAudio_c {
public:
void reset();
+ mDoAud_zelAudio_c() {}
~mDoAud_zelAudio_c() {}
static void onInitFlag() { struct_80450BB8 = true; }
@@ -28,6 +29,7 @@ public:
static void onResetFlag() { sResetFlag = true; }
static void offResetFlag() { sResetFlag = false; }
static bool isBgmSet() { return data_80450bba; }
+ static void onBgmSet() { data_80450bba = true; }
static void offBgmSet() { data_80450bba = false; }
Z2AudioMgr mAudioMgr;
diff --git a/include/m_Do/m_Do_controller_pad.h b/include/m_Do/m_Do_controller_pad.h
index 31cfd81b4a..a9875b6c8e 100644
--- a/include/m_Do/m_Do_controller_pad.h
+++ b/include/m_Do/m_Do_controller_pad.h
@@ -6,11 +6,11 @@
#include "dolphin/types.h"
#include "m_Do/m_Do_Reset.h"
+// Controller Ports 1 - 4
+enum { PAD_1, PAD_2, PAD_3, PAD_4 };
+
class mDoCPd_c {
public:
- // Controller Ports 1 - 4
- enum { PAD_0, PAD_1, PAD_2, PAD_3 };
-
static void create();
static void read();
static void convert(interface_of_controller_pad*, JUTGamePad*);
diff --git a/include/m_Do/m_Do_machine.h b/include/m_Do/m_Do_machine.h
index 8ea5888795..669ee1aecd 100644
--- a/include/m_Do/m_Do_machine.h
+++ b/include/m_Do/m_Do_machine.h
@@ -14,6 +14,7 @@ bool exceptionReadPad(u32*, u32*);
void exceptionRestart();
void myExceptionCallback(u16, OSContext*, u32, u32);
void my_SysPrintHeap(char const*, void*, u32);
+void mDoMch_HeapCheckAll();
extern GXRenderModeObj g_ntscZeldaProg;
diff --git a/include/m_Do/m_Do_main.h b/include/m_Do/m_Do_main.h
index 09a01987a6..6015b935fb 100644
--- a/include/m_Do/m_Do_main.h
+++ b/include/m_Do/m_Do_main.h
@@ -10,6 +10,20 @@ void* LOAD_COPYDATE(void*);
class HeapCheck {
public:
+ // needed for sinit
+ /* HeapCheck(JKRExpHeap* heap, const char* name, const char* jName) {
+ mName = name;
+ mJName = jName;
+ setHeap(heap);
+ mMaxTotalUsedSize = 0;
+ mMaxTotalFreeSize = 0;
+ field_0x14 = 0;
+ field_0x18 = 0;
+ mTargetHeapSize = 0;
+ mUsedCount = 0;
+ mTotalUsedSize = 0;
+ } */
+
void CheckHeap1(void);
s32 getUsedCount(void) const;
void heapDisplay(void) const;
@@ -21,19 +35,23 @@ public:
void setHeapSize(u32 i_size) { mTargetHeapSize = i_size; }
s32 getMaxTotalUsedSize() { return mMaxTotalUsedSize; }
s32 getMaxTotalFreeSize() { return mMaxTotalFreeSize; }
- char* getName() const { return mName; }
+ const char* getName() const { return mName; }
void saveRelBase() {
mUsedCount = getUsedCount();
mTotalUsedSize = mHeap->getTotalUsedSize();
}
+ u32 getRelUsedCount() const { return getUsedCount() - mUsedCount; }
+ u32 getRelTotalUsedSize() const { return mHeap->getTotalUsedSize() - mTotalUsedSize; }
+
private:
- /* 0x00 */ char* mName;
- /* 0x04 */ char* mJName;
+ /* 0x00 */ const char* mName;
+ /* 0x04 */ const char* mJName;
/* 0x08 */ JKRExpHeap* mHeap;
/* 0x0C */ s32 mMaxTotalUsedSize;
/* 0x10 */ s32 mMaxTotalFreeSize;
- /* 0x14 */ u8 unk20[8];
+ /* 0x14 */ s32 field_0x14;
+ /* 0x18 */ s32 field_0x18;
/* 0x1C */ u32 mTargetHeapSize;
/* 0x20 */ u32 mUsedCount;
/* 0x24 */ u32 mTotalUsedSize;
@@ -47,7 +65,7 @@ struct mDoMain {
static OSTime sHungUpTime;
};
-extern s8 data_80450580;
+extern s8 data_80450580; // Debug enabled
extern bool sOSReportDisabled;
extern bool data_80450B99;