From 27ae64893aec81af4c78036f309b9aa9e7874c2e Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Wed, 12 Feb 2025 12:50:35 +0100 Subject: started debug display/error --- include/DTCM/UnkStruct_027e02a0.hpp | 10 +++++++ include/DTCM/UnkStruct_027e05f8.hpp | 4 +++ include/DTCM/UnkStruct_027e0618.hpp | 9 +++++++ include/DTCM/UnkStruct_027e08f8.hpp | 9 +++++++ include/Unknown/UnkStruct_02063220.hpp | 48 ++++++++++++++++++++++++++++++++++ include/Unknown/UnkStruct_0206322c.hpp | 39 +++++++++++++++++++++++++++ include/Unknown/UnkStruct_020ee734.hpp | 7 +++++ include/global.h | 3 ++- include/types.h | 1 + 9 files changed, 129 insertions(+), 1 deletion(-) create mode 100644 include/DTCM/UnkStruct_027e02a0.hpp create mode 100644 include/DTCM/UnkStruct_027e0618.hpp create mode 100644 include/DTCM/UnkStruct_027e08f8.hpp create mode 100644 include/Unknown/UnkStruct_02063220.hpp create mode 100644 include/Unknown/UnkStruct_0206322c.hpp create mode 100644 include/Unknown/UnkStruct_020ee734.hpp (limited to 'include') diff --git a/include/DTCM/UnkStruct_027e02a0.hpp b/include/DTCM/UnkStruct_027e02a0.hpp new file mode 100644 index 00000000..d533bb4f --- /dev/null +++ b/include/DTCM/UnkStruct_027e02a0.hpp @@ -0,0 +1,10 @@ +#pragma once + +#include "types.h" + +struct UnkStruct_027e02a0 { + unk8 mUnk_00[0x94]; + unk32 mUnk_94[23]; +}; + +extern UnkStruct_027e02a0* data_027e02a0; diff --git a/include/DTCM/UnkStruct_027e05f8.hpp b/include/DTCM/UnkStruct_027e05f8.hpp index 43e83540..40d8d731 100644 --- a/include/DTCM/UnkStruct_027e05f8.hpp +++ b/include/DTCM/UnkStruct_027e05f8.hpp @@ -5,6 +5,8 @@ struct UnkStruct_027e05f8 { // TODO: Add fields + unk16 mUnk_00; + u16 mUnk_02; void func_0202adf4(unk32 param1, s32 param2); ~UnkStruct_027e05f8(); @@ -15,3 +17,5 @@ struct UnkStruct_027e05f8 { void func_02037480(); static unk32 func_02037490(unk32 param1); }; + +extern UnkStruct_027e05f8 data_027e05f8; diff --git a/include/DTCM/UnkStruct_027e0618.hpp b/include/DTCM/UnkStruct_027e0618.hpp new file mode 100644 index 00000000..7489cee5 --- /dev/null +++ b/include/DTCM/UnkStruct_027e0618.hpp @@ -0,0 +1,9 @@ +#pragma once + +#include "types.h" + +struct UnkStruct_027e0618 { + void func_0202cf34(void); +}; + +extern UnkStruct_027e0618 data_027e0618; diff --git a/include/DTCM/UnkStruct_027e08f8.hpp b/include/DTCM/UnkStruct_027e08f8.hpp new file mode 100644 index 00000000..c4f91b86 --- /dev/null +++ b/include/DTCM/UnkStruct_027e08f8.hpp @@ -0,0 +1,9 @@ +#pragma once + +#include "types.h" + +struct UnkStruct_027e08f8 { + void func_0202f9a0(unk32); +}; + +extern UnkStruct_027e08f8 data_027e08f8; diff --git a/include/Unknown/UnkStruct_02063220.hpp b/include/Unknown/UnkStruct_02063220.hpp new file mode 100644 index 00000000..ccdaea85 --- /dev/null +++ b/include/Unknown/UnkStruct_02063220.hpp @@ -0,0 +1,48 @@ +#pragma once + +#include "global.h" +#include "types.h" + +struct Registers { + /* 00 */ unk32 mUnk_00; // CPSR + /* 04 */ unk32 mUnk_04[12]; + /* 08 */ unk32 mUnk_08; + /* 0C */ unk32 mUnk_0C; // SP + /* 10 */ unk32 mUnk_10; // LR + /* 14 */ unk32 mUnk_14; // PC + /* 18 */ unk32 mUnk_18; + /* 1C */ unk32 mUnk_1C; + /* 20 */ unk32 mUnk_20; + /* 24 */ unk32 mUnk_24; + /* 28 */ unk32 mUnk_28; + /* 2C */ unk32 mUnk_2C; + /* 30 */ unk32 mUnk_30; + /* 34 */ unk32 mUnk_34; + /* 38 */ unk32 mUnk_38; // CP15 + /* 3C */ unk32 mUnk_3C; // SPSR +}; + +struct UnkStruct_02063220_08 { + unk32 mUnk_00; + + void func_0202fd9c(unk32); +}; + +class UnkStruct_02063220 { +public: + /* 00 */ char* path; + /* 04 */ u8 mUnk_04; + /* 05 */ u8 mUnk_05; + /* 06 */ unk16 mUnk_06; + /* 08 */ UnkStruct_02063220_08 mUnk_08; + + void DisplayAssertError(char* file, u16 line, char* msg, ...); + void DisplayException(Registers* param1); + static bool func_0202f3f0(unk32 param1); + static unk32 func_0202f400(unk32 param1); + void func_0202f4b4(void); + void func_0202f500(void); + void func_0202f754(unk32); +}; + +extern UnkStruct_02063220 data_02063220; diff --git a/include/Unknown/UnkStruct_0206322c.hpp b/include/Unknown/UnkStruct_0206322c.hpp new file mode 100644 index 00000000..d28cd0f4 --- /dev/null +++ b/include/Unknown/UnkStruct_0206322c.hpp @@ -0,0 +1,39 @@ +#pragma once + +#include "types.h" + +#define SCREEN_WIDTH 32 +#define SCREEN_HEIGHT 24 + +struct Screen { + /* 000 */ unk16 mUnk_00; + /* 002 */ unk16 mUnk_02; + /* 004 */ unk16 mUnk_04; + /* 004 */ unk16 mUnk_06; + /* 008 */ unk32 mUnk_08; + /* 00c */ u16 data[SCREEN_WIDTH * SCREEN_HEIGHT]; + /* 60c */ +}; + +class UnkStruct_0206322c { +public: + /* 000 */ UNK_PTR mUnk_00; // tile + /* 004 */ UNK_PTR mUnk_04; // palette + /* 008 */ Screen topScreen; + /* 614 */ Screen bottomScreen; + /* c20 */ + + // loads the debug font (palette and tile files) + void func_02030354(bool doTopScreen, bool doBottomScreen); + + // ctor? + void* func_02030408(void); + + // copy the screen data to VRAM + void func_02030464(bool doTopScreen, bool doBottomScreen); + + // reset screen data + void func_020304a8(bool doTopScreen, bool doBottomScreen); +}; + +extern UnkStruct_0206322c data_0206322c; diff --git a/include/Unknown/UnkStruct_020ee734.hpp b/include/Unknown/UnkStruct_020ee734.hpp new file mode 100644 index 00000000..18e24d39 --- /dev/null +++ b/include/Unknown/UnkStruct_020ee734.hpp @@ -0,0 +1,7 @@ +#pragma once + +struct UnkStruct_020ee734 { + void func_ov000_020d6620(void); +}; + +extern UnkStruct_020ee734 data_ov000_020ee734; diff --git a/include/global.h b/include/global.h index 593c720b..ca961164 100644 --- a/include/global.h +++ b/include/global.h @@ -5,7 +5,8 @@ #define SET_FLAG(arr, pos) ((arr)[((u32) (pos)) >> 5] |= 1 << ((pos) & 0x1f)) #define RESET_FLAG(arr, pos) ((arr)[((u32) (pos)) >> 5] &= ~(1 << ((pos) & 0x1f))) -#define ARRAY_LEN(arr) ((sizeof(arr) / sizeof(*arr))) +#define ARRAY_LEN_U(arr) (u32)((sizeof(arr) / sizeof(*arr))) +#define ARRAY_LEN(arr) (s32)(sizeof(arr) / sizeof(*arr)) // Prevent the IDE from reporting errors that the compiler/linker won't report #ifdef __INTELLISENSE__ diff --git a/include/types.h b/include/types.h index 03e8352f..4d6bc6c1 100644 --- a/include/types.h +++ b/include/types.h @@ -22,5 +22,6 @@ typedef s32 bool; #endif #define CEIL_DIV(a, b) (((a) + (b) - 1) / (b)) +#define UNK_PTR unk32* #endif -- cgit v1.2.3 From 53cc55fb20d3526dd9181781216a341df5e53f63 Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Wed, 12 Feb 2025 20:20:59 +0100 Subject: format --- include/DTCM/UnkStruct_027e02a0.hpp | 2 +- include/Unknown/UnkStruct_02063220.hpp | 6 +++--- include/Unknown/UnkStruct_0206322c.hpp | 2 +- include/types.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/DTCM/UnkStruct_027e02a0.hpp b/include/DTCM/UnkStruct_027e02a0.hpp index d533bb4f..2cfcf4f7 100644 --- a/include/DTCM/UnkStruct_027e02a0.hpp +++ b/include/DTCM/UnkStruct_027e02a0.hpp @@ -7,4 +7,4 @@ struct UnkStruct_027e02a0 { unk32 mUnk_94[23]; }; -extern UnkStruct_027e02a0* data_027e02a0; +extern UnkStruct_027e02a0 *data_027e02a0; diff --git a/include/Unknown/UnkStruct_02063220.hpp b/include/Unknown/UnkStruct_02063220.hpp index ccdaea85..5a07303b 100644 --- a/include/Unknown/UnkStruct_02063220.hpp +++ b/include/Unknown/UnkStruct_02063220.hpp @@ -30,14 +30,14 @@ struct UnkStruct_02063220_08 { class UnkStruct_02063220 { public: - /* 00 */ char* path; + /* 00 */ char *path; /* 04 */ u8 mUnk_04; /* 05 */ u8 mUnk_05; /* 06 */ unk16 mUnk_06; /* 08 */ UnkStruct_02063220_08 mUnk_08; - void DisplayAssertError(char* file, u16 line, char* msg, ...); - void DisplayException(Registers* param1); + void DisplayAssertError(char *file, u16 line, char *msg, ...); + void DisplayException(Registers *param1); static bool func_0202f3f0(unk32 param1); static unk32 func_0202f400(unk32 param1); void func_0202f4b4(void); diff --git a/include/Unknown/UnkStruct_0206322c.hpp b/include/Unknown/UnkStruct_0206322c.hpp index d28cd0f4..534fc26b 100644 --- a/include/Unknown/UnkStruct_0206322c.hpp +++ b/include/Unknown/UnkStruct_0206322c.hpp @@ -27,7 +27,7 @@ public: void func_02030354(bool doTopScreen, bool doBottomScreen); // ctor? - void* func_02030408(void); + void *func_02030408(void); // copy the screen data to VRAM void func_02030464(bool doTopScreen, bool doBottomScreen); diff --git a/include/types.h b/include/types.h index 4d6bc6c1..5d42ab41 100644 --- a/include/types.h +++ b/include/types.h @@ -22,6 +22,6 @@ typedef s32 bool; #endif #define CEIL_DIV(a, b) (((a) + (b) - 1) / (b)) -#define UNK_PTR unk32* +#define UNK_PTR unk32 * #endif -- cgit v1.2.3