summaryrefslogtreecommitdiff
path: root/arm9
diff options
context:
space:
mode:
Diffstat (limited to 'arm9')
-rw-r--r--arm9/lib/include/NNS_FND_expheap.h15
-rw-r--r--arm9/lib/include/NNS_FND_heapcommon.h24
-rw-r--r--arm9/lib/include/NNS_FND_list.h20
-rw-r--r--arm9/lib/include/consts.h1
-rw-r--r--arm9/src/error_message_reset.c12
-rw-r--r--arm9/src/game_init.c33
-rw-r--r--arm9/src/heap.c182
-rw-r--r--arm9/src/unk_02016B94.c6
8 files changed, 169 insertions, 124 deletions
diff --git a/arm9/lib/include/NNS_FND_expheap.h b/arm9/lib/include/NNS_FND_expheap.h
new file mode 100644
index 00000000..171cacf6
--- /dev/null
+++ b/arm9/lib/include/NNS_FND_expheap.h
@@ -0,0 +1,15 @@
+#ifndef GUARD_NNS_FND_EXPHEAP_H
+#define GUARD_NNS_FND_EXPHEAP_H
+
+#include "NNS_FND_heapcommon.h"
+
+NNSFndHeapHandle NNS_FndCreateExpHeapEx(void *startAddress, u32 size, u32 optFlag);
+void *NNS_FndAllocFromExpHeapEx(void *param0, u32 param1, s32 param2);
+void NNS_FndDestroyExpHeap();
+void NNS_FndFreeToExpHeap(void *ptr1, void *ptr2);
+u32 NNS_FndGetTotalFreeSizeForExpHeap(void *param0);
+void NNS_FndInitAllocatorForExpHeap(u32 param0, void *param1, u32 param2);
+u32 NNS_FndGetSizeForMBlockExpHeap(void *param0);
+void NNS_FndResizeForMBlockExpHeap(void *ptr1, void *ptr2, u32 param2);
+
+#endif //GUARD_NNS_FND_EXPHEAP_H
diff --git a/arm9/lib/include/NNS_FND_heapcommon.h b/arm9/lib/include/NNS_FND_heapcommon.h
new file mode 100644
index 00000000..6008e7e8
--- /dev/null
+++ b/arm9/lib/include/NNS_FND_heapcommon.h
@@ -0,0 +1,24 @@
+#ifndef GUARD_NNS_FND_HEAPCOMMON_H
+#define GUARD_NNS_FND_HEAPCOMMON_H
+
+#include "NNS_FND_list.h"
+
+typedef struct NNSiFndHeapHead NNSiFndHeapHead;
+
+struct NNSiFndHeapHead
+{
+ u32 signature;
+
+ NNSFndLink link;
+ NNSFndList childList;
+
+ void* heapStart; // Heap start address
+ void* heapEnd; // Heap end (+1) address
+
+ u32 attribute; // Attribute
+ // [8:Option flag]
+};
+
+typedef NNSiFndHeapHead* NNSFndHeapHandle; // Type to represent heap handle
+
+#endif //GUARD_NNS_FND_HEAPCOMMON_H
diff --git a/arm9/lib/include/NNS_FND_list.h b/arm9/lib/include/NNS_FND_list.h
new file mode 100644
index 00000000..5df01e5f
--- /dev/null
+++ b/arm9/lib/include/NNS_FND_list.h
@@ -0,0 +1,20 @@
+#ifndef GUARD_NNS_FND_LIST_H
+#define GUARD_NNS_FND_LIST_H
+
+typedef struct
+{
+ void* prevObject; // Pointer to the previous linked object.
+ void* nextObject; // Pointer to the next linked object.
+
+} NNSFndLink;
+
+typedef struct
+{
+ void* headObject; // Pointer for the object linked to the top of the list.
+ void* tailObject; // Pointer for the object linked to the end of the list.
+ u16 numObjects; // Number of objects linked in the list.
+ u16 offset; // Offset for NNSFndLink type structure member.
+
+} NNSFndList;
+
+#endif //GUARD_NNS_FND_LIST_H
diff --git a/arm9/lib/include/consts.h b/arm9/lib/include/consts.h
index a41f22ae..1ad79b93 100644
--- a/arm9/lib/include/consts.h
+++ b/arm9/lib/include/consts.h
@@ -52,6 +52,7 @@
#define OSi_TCM_REGION_BASE_MASK 0xfffff000
#define OS_IE_V_BLANK (1UL << 0)
+#define OS_IE_H_BLANK (1UL << 1)
#define HW_CPU_CLOCK_ARM9 67027964
diff --git a/arm9/src/error_message_reset.c b/arm9/src/error_message_reset.c
index 9996cbb1..f028f038 100644
--- a/arm9/src/error_message_reset.c
+++ b/arm9/src/error_message_reset.c
@@ -8,7 +8,9 @@
const struct UnkStruct_02016B94_4 UNK_020FF49C = { 0, 3, 3, 0x1a, 0x12, 1, 0x23 };
-const u32 UNK_020FF4A4[2] = { 0x00020000, 0x00000000 };
+const struct UnkStruct_020EDB10 UNK_020FF4A4[] = {
+ {0x00020000, OS_ARENA_MAIN}
+};
const struct GraphicsModes UNK_020FF4AC = { mode1 : 1 };
@@ -44,13 +46,13 @@ THUMB_FUNC void PrintErrorMessageAndReset()
OS_SetArenaHi(OS_ARENA_MAIN, OS_GetInitArenaHi(OS_ARENA_MAIN));
OS_SetArenaLo(OS_ARENA_MAIN, OS_GetInitArenaLo(OS_ARENA_MAIN));
- FUN_020166C8((u32 *)UNK_020FF4A4, 1, 1, 0);
+ FUN_020166C8(UNK_020FF4A4, NELEMS(UNK_020FF4A4), 1, 0);
FUN_0200E3A0(PM_LCD_TOP, 0);
FUN_0200E3A0(PM_LCD_BOTTOM, 0);
- OS_DisableIrqMask(1);
- OS_SetIrqFunction(1, &VBlankHandler);
- OS_EnableIrqMask(1);
+ OS_DisableIrqMask(OS_IE_V_BLANK);
+ OS_SetIrqFunction(OS_IE_V_BLANK, &VBlankHandler);
+ OS_EnableIrqMask(OS_IE_V_BLANK);
Main_SetVBlankIntrCB(NULL, NULL);
diff --git a/arm9/src/game_init.c b/arm9/src/game_init.c
index 2b8f8c8f..05b1f9bd 100644
--- a/arm9/src/game_init.c
+++ b/arm9/src/game_init.c
@@ -10,6 +10,7 @@
#include "game_init.h"
#include "registers.h"
#include "heap.h"
+#include "OS_interrupt.h"
#pragma thumb on
@@ -34,7 +35,7 @@ static struct {
struct Main gMain;
-void Main_HBlankIntr(BOOL);
+void Main_ToggleHBlankInterrupt(BOOL enableFlag);
void FUN_0201B5CC(void *);
void FUN_02015EA0(void)
@@ -66,7 +67,7 @@ void Main_SetVBlankIntrCB(void (*a0)(void *), void * a1)
void FUN_02015F1C(void)
{
- Main_HBlankIntr(FALSE);
+ Main_ToggleHBlankInterrupt(FALSE);
gMain.hBlankIntr = NULL;
gMain.hBlankIntrArg = NULL;
}
@@ -75,7 +76,7 @@ BOOL FUN_02015F34(void (*a0)(void *), void * a1)
{
if (a0 == 0)
{
- Main_HBlankIntr(FALSE);
+ Main_ToggleHBlankInterrupt(FALSE);
gMain.hBlankIntr = NULL;
gMain.hBlankIntrArg = NULL;
return TRUE;
@@ -84,7 +85,7 @@ BOOL FUN_02015F34(void (*a0)(void *), void * a1)
{
gMain.hBlankIntrArg = a1;
gMain.hBlankIntr = a0;
- Main_HBlankIntr(TRUE);
+ Main_ToggleHBlankInterrupt(TRUE);
return TRUE;
}
else
@@ -93,36 +94,36 @@ BOOL FUN_02015F34(void (*a0)(void *), void * a1)
}
}
-void FUN_02015F6C(void)
+void Main_CallHBlankCallback(void)
{
if (gMain.hBlankIntr != NULL)
gMain.hBlankIntr(gMain.hBlankIntrArg);
}
-void Main_HBlankIntr(BOOL a0)
+void Main_ToggleHBlankInterrupt(BOOL enableFlag)
{
(void)OS_DisableIrq();
- if (!a0)
+ if (!enableFlag)
{
(void)OS_GetIrqMask();
- OS_DisableIrqMask(2);
+ OS_DisableIrqMask(OS_IE_H_BLANK);
GX_HBlankIntr(FALSE);
}
else
{
(void)OS_GetIrqMask();
- OS_SetIrqFunction(2, FUN_02015F6C);
- OS_EnableIrqMask(2);
+ OS_SetIrqFunction(OS_IE_H_BLANK, Main_CallHBlankCallback);
+ OS_EnableIrqMask(OS_IE_H_BLANK);
GX_HBlankIntr(TRUE);
}
(void)OS_EnableIrq();
}
-const u32 UNK_020EDB10[][2] = {
- { 0x0000D000, 0x00000000 },
- { 0x00021000, 0x00000000 },
- { 0x00001000, 0x00000000 },
- { 0x0010D800, 0x00000000 }
+const struct UnkStruct_020EDB10 UNK_020EDB10[] = {
+ { 0x00D000, OS_ARENA_MAIN },
+ { 0x021000, OS_ARENA_MAIN },
+ { 0x001000, OS_ARENA_MAIN },
+ { 0x10D800, OS_ARENA_MAIN }
};
void FUN_02015FC8(void)
@@ -141,7 +142,7 @@ void FUN_02015FC8(void)
{
csum++;
}
- FUN_020166C8((u32 *)UNK_020EDB10, 4, 92, csum);
+ FUN_020166C8(UNK_020EDB10, NELEMS(UNK_020EDB10), 92, csum);
}
void InitSystemForTheGame(void)
diff --git a/arm9/src/heap.c b/arm9/src/heap.c
index 7f35fdcc..93ecefa4 100644
--- a/arm9/src/heap.c
+++ b/arm9/src/heap.c
@@ -1,28 +1,20 @@
#include "heap.h"
#include "error_message_reset.h"
#include "unk_02031734.h"
-
-
-extern void *NNS_FndCreateExpHeapEx(void *param0, u32 param1, u32 param2);
-extern void *NNS_FndAllocFromExpHeapEx(void *param0, u32 param1, s32 param2);
-extern void NNS_FndDestroyExpHeap();
-extern void NNS_FndFreeToExpHeap(void *ptr1, void *ptr2);
-extern u32 NNS_FndGetTotalFreeSizeForExpHeap(void *param0);
-extern void NNS_FndInitAllocatorForExpHeap(u32 param0, void *param1, u32 param2);
-extern u32 NNS_FndGetSizeForMBlockExpHeap(void *param0);
-extern void NNS_FndResizeForMBlockExpHeap(void *ptr1, void *ptr2, u32 param2);
-
+#include "NNS_FND_expheap.h"
struct UnkStruct_020166C8 UNK_021C4D28;
-
-THUMB_FUNC void FUN_020166C8(u32 *param0, u32 param1, u32 param2, u32 pre_size)
+THUMB_FUNC void FUN_020166C8(const struct UnkStruct_020EDB10 *templates, u32 nTemplates, u32 totalNumHeaps, u32 pre_size)
{
- u32 unk_size = param1 + 24;
+ void * ptr;
+ u32 unk_size, r7;
- if (param2 < unk_size)
+ unk_size = nTemplates + 24;
+
+ if (totalNumHeaps < unk_size)
{
- param2 = unk_size;
+ totalNumHeaps = unk_size;
}
if (pre_size != 0)
{
@@ -34,90 +26,80 @@ THUMB_FUNC void FUN_020166C8(u32 *param0, u32 param1, u32 param2, u32 pre_size)
OS_AllocFromArenaLo(OS_ARENA_MAIN, pre_size, 4);
}
- u32 r7 = param2 * 2;
-
- void *ptr = OS_AllocFromArenaLo(OS_ARENA_MAIN, (unk_size * 3 + 1) * sizeof(u32) + r7 + param2, 4);
- UNK_021C4D28.unk00 = ptr;
- ptr += (unk_size + 1) * 4;
- UNK_021C4D28.unk04 = ptr;
- ptr += unk_size * 4;
- UNK_021C4D28.unk08 = ptr;
- ptr += unk_size * 4;
- UNK_021C4D28.unk0c = ptr;
- ptr += r7;
- UNK_021C4D28.unk10 = ptr;
- UNK_021C4D28.unk14 = (u16)param2;
- UNK_021C4D28.unk16 = (u16)param1;
-
- r7 = 0;
+ UNK_021C4D28.heapHandles = (NNSFndHeapHandle*) OS_AllocFromArenaLo(
+ OS_ARENA_MAIN,
+ (unk_size + 1) * sizeof(NNSFndHeapHandle)
+ + unk_size * sizeof(NNSFndHeapHandle)
+ + unk_size * sizeof(void *)
+ + totalNumHeaps * sizeof(u16)
+ + totalNumHeaps,
+ 4
+ );
+ UNK_021C4D28.unk04 = UNK_021C4D28.heapHandles + (unk_size + 1);
+ UNK_021C4D28.unk08 = (void **)(UNK_021C4D28.unk04 + unk_size);
+ UNK_021C4D28.unk0c = (u16 *)(UNK_021C4D28.unk08 + unk_size);
+ UNK_021C4D28.heapIdxs = (u8 *)(UNK_021C4D28.unk0c + totalNumHeaps);
+ UNK_021C4D28.totalNumHeaps = (u16)totalNumHeaps;
+ UNK_021C4D28.nTemplates = (u16)nTemplates;
+
UNK_021C4D28.unk1a = (u16)unk_size;
UNK_021C4D28.unk18 = (u16)unk_size;
- while (r7 < param1)
+ for (r7 = 0; r7 < nTemplates; r7++)
{
- void *ptr;
- if (param0[1] == 0 || param0[1] != 2)
- {
- ptr = OS_AllocFromArenaLo(OS_ARENA_MAIN, param0[0], 4);
- }
- else
+ switch (templates[r7].arena)
{
- ptr = OS_AllocFromArenaHi(OS_ARENA_MAINEX, param0[0], 4);
+ case OS_ARENA_MAIN:
+ default:
+ ptr = OS_AllocFromArenaLo(OS_ARENA_MAIN, templates[r7].size, 4);
+ break;
+ case OS_ARENA_MAINEX:
+ ptr = OS_AllocFromArenaHi(OS_ARENA_MAINEX, templates[r7].size, 4);
+ break;
}
- if (ptr != 0)
+ if (ptr != NULL)
{
- UNK_021C4D28.unk00[r7] = NNS_FndCreateExpHeapEx(ptr, param0[0], 0);
- UNK_021C4D28.unk10[r7] = (u8)r7;
+ UNK_021C4D28.heapHandles[r7] = NNS_FndCreateExpHeapEx(ptr, templates[r7].size, 0);
+ UNK_021C4D28.heapIdxs[r7] = (u8)r7;
}
else
{
- GF_AssertFail();
+ GF_ASSERT(0);
}
-
- param0 += 2;
- r7++;
}
- while (param1 < unk_size + 1)
+ while (nTemplates < unk_size + 1)
{
- UNK_021C4D28.unk00[param1] = 0;
- UNK_021C4D28.unk10[param1] = (u8)UNK_021C4D28.unk1a;
+ UNK_021C4D28.heapHandles[nTemplates] = NULL;
+ UNK_021C4D28.heapIdxs[nTemplates] = (u8)UNK_021C4D28.unk1a;
- param1++;
+ nTemplates++;
}
- while (param1 < param2)
+ while (nTemplates < totalNumHeaps)
{
- UNK_021C4D28.unk10[param1] = (u8)UNK_021C4D28.unk1a;
+ UNK_021C4D28.heapIdxs[nTemplates] = (u8)UNK_021C4D28.unk1a;
- param1++;
+ nTemplates++;
}
- for (param1 = 0; param1 < param2; param1++)
+ for (nTemplates = 0; nTemplates < totalNumHeaps; nTemplates++)
{
- UNK_021C4D28.unk0c[param1] = 0;
+ UNK_021C4D28.unk0c[nTemplates] = 0;
}
}
THUMB_FUNC s32 FUN_020167F4()
{
- s32 i = UNK_021C4D28.unk16;
- s32 j = UNK_021C4D28.unk18;
+ s32 i;
+ s32 j;
- if (i < j)
+ for (i = UNK_021C4D28.nTemplates; i < UNK_021C4D28.unk18; i++)
{
- void **ptr = UNK_021C4D28.unk00 + i;
- do
- {
- if (*ptr == 0)
- {
- return i;
- }
- i++;
- ptr++;
- } while (i < j);
+ if (UNK_021C4D28.heapHandles[i] == NULL)
+ return i;
}
return -1;
@@ -137,10 +119,10 @@ THUMB_FUNC u32 FUN_02016834(u32 param0, u32 param1, u32 param2, s32 param3)
{
GF_ASSERT(OS_GetProcMode() != OS_PROCMODE_IRQ);
- u8 *ptr = UNK_021C4D28.unk10;
+ u8 *ptr = UNK_021C4D28.heapIdxs;
if (UNK_021C4D28.unk1a == ptr[param1])
{
- void *ptr2 = UNK_021C4D28.unk00[ptr[param0]];
+ void *ptr2 = UNK_021C4D28.heapHandles[ptr[param0]];
if (ptr2 != 0)
{
void *ptr3 = NNS_FndAllocFromExpHeapEx(ptr2, param2, param3);
@@ -149,14 +131,14 @@ THUMB_FUNC u32 FUN_02016834(u32 param0, u32 param1, u32 param2, s32 param3)
param3 = FUN_020167F4();
if (param3 >= 0)
{
- UNK_021C4D28.unk00[param3] = NNS_FndCreateExpHeapEx(ptr3, param2, 0);
+ UNK_021C4D28.heapHandles[param3] = NNS_FndCreateExpHeapEx(ptr3, param2, 0);
- if (UNK_021C4D28.unk00[param3] != 0)
+ if (UNK_021C4D28.heapHandles[param3] != 0)
{
UNK_021C4D28.unk04[param3] = ptr2;
UNK_021C4D28.unk08[param3] = ptr3;
- UNK_021C4D28.unk10[param1] = (u8)param3;
+ UNK_021C4D28.heapIdxs[param1] = (u8)param3;
return 1;
}
@@ -191,11 +173,11 @@ THUMB_FUNC void FUN_020168D0(u32 heap_id)
{
GF_ASSERT (OS_GetProcMode() != OS_PROCMODE_IRQ);
- if (UNK_021C4D28.unk00[UNK_021C4D28.unk10[heap_id]] != 0)
+ if (UNK_021C4D28.heapHandles[UNK_021C4D28.heapIdxs[heap_id]] != 0)
{
NNS_FndDestroyExpHeap();
- u8 index = UNK_021C4D28.unk10[heap_id];
+ u8 index = UNK_021C4D28.heapIdxs[heap_id];
void *ptr1 = UNK_021C4D28.unk04[index];
void *ptr2 = UNK_021C4D28.unk08[index];
if (ptr1 != 0 && ptr2 != 0)
@@ -207,11 +189,11 @@ THUMB_FUNC void FUN_020168D0(u32 heap_id)
GF_AssertFail();
}
- UNK_021C4D28.unk00[UNK_021C4D28.unk10[heap_id]] = 0;
- UNK_021C4D28.unk04[UNK_021C4D28.unk10[heap_id]] = 0;
- UNK_021C4D28.unk08[UNK_021C4D28.unk10[heap_id]] = 0;
+ UNK_021C4D28.heapHandles[UNK_021C4D28.heapIdxs[heap_id]] = 0;
+ UNK_021C4D28.unk04[UNK_021C4D28.heapIdxs[heap_id]] = 0;
+ UNK_021C4D28.unk08[UNK_021C4D28.heapIdxs[heap_id]] = 0;
- UNK_021C4D28.unk10[heap_id] = (u8)UNK_021C4D28.unk1a;
+ UNK_021C4D28.heapIdxs[heap_id] = (u8)UNK_021C4D28.unk1a;
}
}
@@ -245,10 +227,10 @@ THUMB_FUNC void FUN_02016988()
void *AllocFromHeap(u32 heap_id, u32 size)
{
void *ptr = 0;
- if (heap_id < UNK_021C4D28.unk14)
+ if (heap_id < UNK_021C4D28.totalNumHeaps)
{
- u8 index = UNK_021C4D28.unk10[heap_id];
- ptr = FUN_02016944(UNK_021C4D28.unk00[index], size, 4, heap_id);
+ u8 index = UNK_021C4D28.heapIdxs[heap_id];
+ ptr = FUN_02016944(UNK_021C4D28.heapHandles[index], size, 4, heap_id);
}
if (ptr != 0)
{
@@ -265,10 +247,10 @@ void *AllocFromHeap(u32 heap_id, u32 size)
void *AllocFromHeapAtEnd(u32 heap_id, u32 size)
{
void *ptr = 0;
- if (heap_id < UNK_021C4D28.unk14)
+ if (heap_id < UNK_021C4D28.totalNumHeaps)
{
- u8 index = UNK_021C4D28.unk10[heap_id];
- ptr = FUN_02016944(UNK_021C4D28.unk00[index], size, -4, heap_id);
+ u8 index = UNK_021C4D28.heapIdxs[heap_id];
+ ptr = FUN_02016944(UNK_021C4D28.heapHandles[index], size, -4, heap_id);
}
if (ptr != 0)
@@ -287,10 +269,10 @@ void FreeToHeap(void *ptr)
{
u8 heap_id = (u8)((u32 *)ptr)[-1];
- if ((u16)heap_id < UNK_021C4D28.unk14)
+ if ((u16)heap_id < UNK_021C4D28.totalNumHeaps)
{
- u8 index = UNK_021C4D28.unk10[heap_id];
- void *ptr2 = UNK_021C4D28.unk00[index];
+ u8 index = UNK_021C4D28.heapIdxs[heap_id];
+ void *ptr2 = UNK_021C4D28.heapHandles[index];
GF_ASSERT(ptr2);
if (UNK_021C4D28.unk0c[heap_id] == 0)
@@ -313,10 +295,10 @@ void FreeToHeapExplicit(u32 param0, void *param1)
{
GF_ASSERT (OS_GetProcMode() != OS_PROCMODE_IRQ);
- if (param0 < UNK_021C4D28.unk14)
+ if (param0 < UNK_021C4D28.totalNumHeaps)
{
- u8 index = UNK_021C4D28.unk10[param0];
- void *ptr = UNK_021C4D28.unk00[index];
+ u8 index = UNK_021C4D28.heapIdxs[param0];
+ void *ptr = UNK_021C4D28.heapHandles[index];
GF_ASSERT (ptr );
u8 heap_id = (u8)((u32 *)param1)[-1];
@@ -334,10 +316,10 @@ void FreeToHeapExplicit(u32 param0, void *param1)
THUMB_FUNC u32 FUN_02016AF8(u32 param0)
{
- if (param0 < UNK_021C4D28.unk14)
+ if (param0 < UNK_021C4D28.totalNumHeaps)
{
- u8 index = UNK_021C4D28.unk10[param0];
- return NNS_FndGetTotalFreeSizeForExpHeap(UNK_021C4D28.unk00[index]);
+ u8 index = UNK_021C4D28.heapIdxs[param0];
+ return NNS_FndGetTotalFreeSizeForExpHeap(UNK_021C4D28.heapHandles[index]);
}
GF_AssertFail();
@@ -346,11 +328,11 @@ THUMB_FUNC u32 FUN_02016AF8(u32 param0)
THUMB_FUNC void FUN_02016B20(u32 param0, u32 param1, u32 param2)
{
- if (param1 < UNK_021C4D28.unk14)
+ if (param1 < UNK_021C4D28.totalNumHeaps)
{
- u8 index = UNK_021C4D28.unk10[param1];
- NNS_FndInitAllocatorForExpHeap(param0, UNK_021C4D28.unk00[index], param2);
+ u8 index = UNK_021C4D28.heapIdxs[param1];
+ NNS_FndInitAllocatorForExpHeap(param0, UNK_021C4D28.heapHandles[index], param2);
return;
}
@@ -366,9 +348,9 @@ THUMB_FUNC void FUN_02016B44(void *ptr, u32 param1)
{
u8 heap_id = (u8)((u32 *)ptr)[-1];
- u8 index = UNK_021C4D28.unk10[heap_id];
+ u8 index = UNK_021C4D28.heapIdxs[heap_id];
- NNS_FndResizeForMBlockExpHeap(UNK_021C4D28.unk00[index], ptr - 16, param1);
+ NNS_FndResizeForMBlockExpHeap(UNK_021C4D28.heapHandles[index], ptr - 16, param1);
return;
}
GF_AssertFail();
diff --git a/arm9/src/unk_02016B94.c b/arm9/src/unk_02016B94.c
index 19ec831d..8ad78373 100644
--- a/arm9/src/unk_02016B94.c
+++ b/arm9/src/unk_02016B94.c
@@ -98,7 +98,7 @@ THUMB_FUNC void FUN_02016BF4(u32 *param0, u32 param1)
#ifdef NONMATCHING
THUMB_FUNC void FUN_02016C18(
- struct UnkStruct_02016B94_2 *param0, u8 param1, struct UnkStruct_02016B94_1 *param2, u8 param3)
+ struct UnkStruct_02016B94_2 *param0, u8 param1, const struct UnkStruct_02016B94_1 *param2, u8 param3)
{
u8 res = FUN_020177DC(param2->unk10, param3);
switch (param1)
@@ -342,7 +342,7 @@ THUMB_FUNC void FUN_02016C18(
}
#else
THUMB_FUNC asm void FUN_02016C18(
- struct UnkStruct_02016B94_2 *param0, u8 param1, struct UnkStruct_02016B94_1 *param2, u8 param3)
+ struct UnkStruct_02016B94_2 *param0, u8 param1, const struct UnkStruct_02016B94_1 *param2, u8 param3)
{
// clang-format off
push {r3-r7, lr}
@@ -4603,7 +4603,7 @@ THUMB_FUNC void FUN_020190EC(struct UnkStruct_02016B94_2 *param0,
}
THUMB_FUNC void FUN_02019150(
- struct UnkStruct_02016B94_2 *param0, struct Window *param1, struct UnkStruct_02016B94_4 *param2)
+ struct UnkStruct_02016B94_2 *param0, struct Window *param1, const struct UnkStruct_02016B94_4 *param2)
{
FUN_02019064(param0,