summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPrakxo <87568477+Prakxo@users.noreply.github.com>2023-08-10 16:36:44 +0100
committerGitHub <noreply@github.com>2023-08-10 11:36:44 -0400
commit04b31d912636eaea12a0b6f3d5e822605da68504 (patch)
tree089d53fd22e7c7707201f9eb94b5a4275d0fe98a /include
parent3e14e3a81fbb55f223748c72abb8f9b3de4be4cb (diff)
m_debug OK (#39)
* m_debug OK * forgor to format * replace macros for zelda64 ones * refactor * refactor 3 * refactor 4
Diffstat (limited to 'include')
-rw-r--r--include/69CB30.h1
-rw-r--r--include/code_variables.h1
-rw-r--r--include/m_debug.h117
-rw-r--r--include/unknown_structs.h7
4 files changed, 117 insertions, 9 deletions
diff --git a/include/69CB30.h b/include/69CB30.h
index 4a13af3..383e08b 100644
--- a/include/69CB30.h
+++ b/include/69CB30.h
@@ -39,6 +39,5 @@
// void func_8007A008_jp();
// void mCPk_get_pkinfo();
// void func_8007A080_jp();
-// void new_Debug_mode();
#endif
diff --git a/include/code_variables.h b/include/code_variables.h
index 86bdacd..5a8bd09 100644
--- a/include/code_variables.h
+++ b/include/code_variables.h
@@ -1836,7 +1836,6 @@ extern s32 zurumode_flag;
// extern UNK_TYPE B_80138818_jp;
// extern UNK_TYPE B_80138E40_jp;
// extern UNK_TYPE B_80138E44_jp;
-extern struct_debug_mode *debug_mode;
// extern UNK_TYPE debug_display;
// extern UNK_TYPE B_80138E70_jp;
// extern UNK_TYPE B_80138E73_jp;
diff --git a/include/m_debug.h b/include/m_debug.h
new file mode 100644
index 0000000..fb86480
--- /dev/null
+++ b/include/m_debug.h
@@ -0,0 +1,117 @@
+#ifndef M_DEBUG_H
+#define M_DEBUG_H
+
+#include "ultra64.h"
+
+typedef enum {
+ /* 0 */ DEBUG_REG_START = 0,
+ /* 0 */ DEBUG_REG_REG = DEBUG_REG_START,
+ /* 1 */ DEBUG_REG_SREG,
+ /* 2 */ DEBUG_REG_OREG,
+ /* 3 */ DEBUG_REG_PREG,
+ /* 4 */ DEBUG_REG_QREG,
+ /* 5 */ DEBUG_REG_MREG,
+ /* 6 */ DEBUG_REG_SBREG,
+ /* 7 */ DEBUG_REG_DREG,
+ /* 8 */ DEBUG_REG_UREG,
+ /* 9 */ DEBUG_REG_IREG,
+ /* 10 */ DEBUG_REG_ZREG,
+ /* 11 */ DEBUG_REG_CRV,
+ /* 12 */ DEBUG_REG_NS1,
+ /* 13 */ DEBUG_REG_SND,
+ /* 14 */ DEBUG_REG_XREG,
+ /* 15 */ DEBUG_REG_CRV2,
+ /* 16 */ DEBUG_REG_DEMOREG,
+ /* 17 */ DEBUG_REG_TREG,
+ /* 18 */ DEBUG_REG_WREG,
+ /* 19 */ DEBUG_REG_AREG,
+ /* 20 */ DEBUG_REG_VREG,
+ /* 21 */ DEBUG_REG_HREG,
+ /* 22 */ DEBUG_REG_GREG,
+ /* 23 */ DEBUG_REG_mREG,
+ /* 24 */ DEBUG_REG_nREG,
+ /* 25 */ DEBUG_REG_BREG,
+ /* 26 */ DEBUG_REG_DORO,
+ /* 27 */ DEBUG_REG_kREG,
+ /* 28 */ DEBUG_REG_BAK,
+ /* 29 */ DEBUG_REG_PLAYERREG,
+ /* 30 */ DEBUG_REG_NMREG,
+
+ /* 31 */ DEBUG_REG_NIIREG,
+ /* 32 */ DEBUG_REG_GENREG,
+ /* 33 */ DEBUG_REG_MYKREG,
+ /* 34 */ DEBUG_REG_CAMREG,
+ /* 35 */ DEBUG_REG_SAKREG,
+ /* 36 */ DEBUG_REG_TAKREG,
+ /* 37 */ DEBUG_REG_PL2REG,
+
+ /* 38 */ DEBUG_REG_MAX
+} DEBUG_REG;
+
+#define DEBUG_REG_SIZE 16
+#define DEBUG_REG_GROUP 6
+
+#define DEBUG_REG_COUNT (DEBUG_REG_SIZE * DEBUG_REG_GROUP * DEBUG_REG_MAX)
+
+typedef struct debug_mode_s {
+ /* 0x00 */ u8 mode;
+ /* 0x01 */ u8 type;
+ /* 0x02 */ s8 inputR;
+ /* 0x03 */ s8 keyWait;
+
+ /* 0x04 */ s32 oldKey;
+ /* 0x08 */ s32 pad[3];
+
+ /* 0x14 */ s16 r[DEBUG_REG_SIZE * DEBUG_REG_GROUP * DEBUG_REG_MAX];
+} Debug_mode; // size = 0x1C94
+
+extern Debug_mode* debug_mode;
+
+
+#define REGADDR(reg, idx) (debug_mode->r[DEBUG_REG_SIZE * DEBUG_REG_GROUP * DEBUG_REG_##reg + (idx)])
+
+#define GETREG(reg, idx) (REGADDR(reg, idx))
+
+#define REG(r) GETREG(REG,r)
+#define SREG(r) GETREG(SREG,r)
+#define OREG(r) GETREG(OREG,r)
+#define PREG(r) GETREG(PREG,r)
+#define QREG(r) GETREG(QREG,r)
+#define MREG(r) GETREG(MREG,r)
+#define SBREG(r) GETREG(SBREG,r)
+#define DREG(r) GETREG(DREG,r)
+#define UREG(r) GETREG(UREG,r)
+#define IREG(r) GETREG(IREG,r)
+#define ZREG(r) GETREG(ZREG,r)
+#define CRV(r) GETREG(CRV,r)
+#define NS1(r) GETREG(NS1,r)
+#define SND(r) GETREG(SND,r)
+#define XREG(r) GETREG(XREG,r)
+#define CRV2(r) GETREG(CRV2,r)
+#define DEMOREG(r) GETREG(DEMOREG,r)
+#define TREG(r) GETREG(TREG,r)
+#define WREG(r) GETREG(WREG,r)
+#define AREG(r) GETREG(AREG,r)
+#define VREG(r) GETREG(VREG,r)
+#define HREG(r) GETREG(HREG,r)
+#define GREG(r) GETREG(GREG,r)
+#define mREG(r) GETREG(mREG,r)
+#define nREG(r) GETREG(nREG,r)
+#define BREG(r) GETREG(BREG,r)
+#define DORO(r) GETREG(DORO,r)
+#define kREG(r) GETREG(kREG,r)
+#define BAK(r) GETREG(BAK,r)
+#define PLAYERREG(r) GETREG(PLAYERREG,r)
+#define NMREG(r) GETREG(NMREG,r)
+#define NIIREG(r) GETREG(NIIREG,r)
+#define GENREG(r) GETREG(GENREG,r)
+#define MYKREG(r) GETREG(MYKREG,r)
+#define CAMREG(r) GETREG(CAMREG,r)
+#define SAKKREG(r) GETREG(SAKKREG,r)
+#define TAKREG(r) GETREG(TAKREG,r)
+#define PL2REG(r) GETREG(PL2REG,r)
+
+extern void new_Debug_mode(void);
+
+#endif
+
diff --git a/include/unknown_structs.h b/include/unknown_structs.h
index 9564498..a10218f 100644
--- a/include/unknown_structs.h
+++ b/include/unknown_structs.h
@@ -6,12 +6,5 @@
#include "libc/stdbool.h"
#include "unk.h"
-typedef struct struct_debug_mode {
- /* 0x000 */ UNK_TYPE1 unk_000[0xD4];
- /* 0x0D4 */ s16 unk_0D4;
- /* 0x0D6 */ UNK_TYPE1 unk_0D6[0x2];
- /* 0x0D8 */ UNK_TYPE1 unk_0D8[0x38];
- /* 0x110 */ s16 gameframe;
-} struct_debug_mode; // size >= 0x114
#endif