summaryrefslogtreecommitdiff
path: root/include/utils.h
diff options
context:
space:
mode:
authortheo3 <arisstephenson2@gmail.com>2021-03-21 22:59:52 -0700
committertheo3 <arisstephenson2@gmail.com>2021-03-21 22:59:52 -0700
commitf56a1cade6911129ea32d48727a70ce8f9bc783f (patch)
treea3bb7d9a96555fd227aae887921af20c228e9e71 /include/utils.h
parent8734f766b467b5f469afd6b24b5cf07be7e53ad0 (diff)
parent41684172807db9cb74cfe2879e527eb2fcb6b230 (diff)
fix merge conflict
Diffstat (limited to 'include/utils.h')
-rw-r--r--include/utils.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/include/utils.h b/include/utils.h
new file mode 100644
index 00000000..040eacee
--- /dev/null
+++ b/include/utils.h
@@ -0,0 +1,64 @@
+typedef struct {
+ u16 heldKeys;
+ u16 newKeys;
+ u16 unk4;
+ u8 unk6;
+ u8 unk7;
+} Input;
+
+extern Input gInput;
+
+/**
+ * Fill memory with 16 bit value.
+ */
+void MemFill16(u32 value, void* dest, u32 size);
+
+/**
+ * Fill memory with 32 bit value.
+ */
+void MemFill32(u32 value, void* dest, u32 size);
+
+/**
+ * Clear memory.
+ */
+void MemClear(void* dest, u32 size);
+
+/**
+ * Copy memory.
+ */
+void MemCopy(const void* src, void* dest, u32 size);
+
+/**
+ * Refresh gInput from hardware registers.
+ */
+void ReadKeyInput(void);
+
+void LoadPalettes(const u8*, int, int);
+void LoadPaletteGroup(u32 group);
+
+/**
+ * Allocate memory on heap.
+ *
+ * The heap size is 0x1000 bytes and should be used sparingly.
+ * It is customary for entities store the returned handle in their 'myHeap' field.
+ *
+ * @param size u32 Size to be allocated
+ * @return void* Pointer to allocated memory
+ */
+void* zMalloc(u32 size);
+
+/**
+ * Free memory from heap.
+ *
+ * The entity system will automatically free the address stored in the 'myHeap' field.
+ *
+ * @param ptr void* Handle to be freed
+ */
+void zFree(void* ptr);
+
+/**
+ * Reset All display hardware registers.
+ *
+ * @param updateHUD bool32 Request refresh of HUD layer (bg 0)
+ */
+void DispReset(bool32 updateHUD);