summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorAetias <aetias@outlook.com>2025-01-18 09:44:01 +0100
committerAetias <aetias@outlook.com>2025-01-18 09:44:01 +0100
commit13108e3ae4e95a4a9a547a3074852099d299a6b9 (patch)
tree21f3ce5b19514780bad5c1451718b4367f6fa47c /libs
parent48bbd8bb7f008ac913cabb6f7faf4a47ad86878b (diff)
Move ARM9 Main documentation from Ghidra
Diffstat (limited to 'libs')
-rw-r--r--libs/c/include/assert.h8
-rw-r--r--libs/c/include/stdlib.h1
-rw-r--r--libs/c/include/string.h6
-rw-r--r--libs/nds/include/nds/Overlay.h30
4 files changed, 45 insertions, 0 deletions
diff --git a/libs/c/include/assert.h b/libs/c/include/assert.h
new file mode 100644
index 00000000..22cdf7dc
--- /dev/null
+++ b/libs/c/include/assert.h
@@ -0,0 +1,8 @@
+#ifndef _C_ASSERT_H
+#define _C_ASSERT_H
+
+#define assert(condition) (void) ((condition) || __assert_failed(#condition, __FILE__, __FUNCTION__, __LINE__));
+
+void __assert_failed(char *condition, char *fileName, char *functionName, s32 lineNumber);
+
+#endif
diff --git a/libs/c/include/stdlib.h b/libs/c/include/stdlib.h
index 0f078d8a..fbc4dce0 100644
--- a/libs/c/include/stdlib.h
+++ b/libs/c/include/stdlib.h
@@ -2,5 +2,6 @@
#define _C_STRLIB_H
int abs(int n);
+long labs(long n);
#endif
diff --git a/libs/c/include/string.h b/libs/c/include/string.h
index 6c1c86a7..61fde219 100644
--- a/libs/c/include/string.h
+++ b/libs/c/include/string.h
@@ -3,6 +3,12 @@
typedef unsigned int size_t;
+void memset(void *dest, int ch, size_t count);
+void *memchr(const void *ptr, int ch, size_t count);
+void *memrchr(const void *ptr, int ch, size_t count);
+int memcmp(const void *ptr1, const void *ptr2, size_t count);
+void __memset_impl(void *dest, int ch, size_t count);
+
size_t strlen(const char *str);
char *strcpy(char *dest, const char *src);
char *strncpy(char *dest, const char *src, size_t num);
diff --git a/libs/nds/include/nds/Overlay.h b/libs/nds/include/nds/Overlay.h
new file mode 100644
index 00000000..7a8c6fa9
--- /dev/null
+++ b/libs/nds/include/nds/Overlay.h
@@ -0,0 +1,30 @@
+#ifndef _NDS_OVERLAY_H
+#define _NDS_OVERLAY_H
+
+typedef struct Overlay {
+ /* 00 */ unk32 mId;
+ /* 04 */ void *mBaseAddress;
+ /* 08 */ u32 mTextSize;
+ /* 0c */ s32 mBssSize;
+ /* 10 */ unk32 mCtorStart;
+ /* 14 */ unk32 mCtorEnd;
+ /* 18 */ unk32 mFileId;
+ /* 1c */ u32 mFileSize;
+ /* 20 */
+} Overlay;
+
+u32 Overlay_FileSize(Overlay *overlay);
+void Overlay_ClearCacheAndBss(Overlay *overlay);
+void Overlay_func_02042238(unk32 *param1, Overlay *overlay);
+bool Overlay_func_02042250(Overlay *param1, Overlay *param2, s32 param3, unk32 param4, s32 param5, u32 param6, s32 param7,
+ u32 param8);
+bool Overlay_func_020422ec(Overlay *param1, Overlay *param2, s32 param3);
+bool Overlay_func_0204238c(Overlay *overlay);
+bool Overlay_func_020423e8(s32 param1, unk32 param2, unk32 param3);
+void Overlay_Init(Overlay *overlay);
+void Overlay_RunGlobalDestructors(Overlay *overlay);
+bool Overlay_Destroy(Overlay *overlay);
+bool Overlay_Load(Overlay *overlay, unk32 param2);
+bool Overlay_Unload(Overlay *overlay, unk32 param2);
+
+#endif