diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2020-05-29 11:29:42 -0400 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2020-05-29 11:29:42 -0400 |
commit | a56c25246a4b14d22ac5fc3b7d0dab6b0fc32908 (patch) | |
tree | bbe8325b4900b2c6aca9ccd5cd64b1458f467107 /arm9/src | |
parent | ea5d879160e36cab09abd44c8ed68a4008580f4a (diff) |
Decompile unk_02006234
Diffstat (limited to 'arm9/src')
-rw-r--r-- | arm9/src/main.c | 6 | ||||
-rw-r--r-- | arm9/src/unk_02006234.c | 78 |
2 files changed, 81 insertions, 3 deletions
diff --git a/arm9/src/main.c b/arm9/src/main.c index 44f4127a..82b8b734 100644 --- a/arm9/src/main.c +++ b/arm9/src/main.c @@ -156,18 +156,18 @@ THUMB_FUNC void FUN_02000E0C(void) { if (gBacklightTop.unk14 == NULL) return; - if (gBacklightTop.unk10 != -1u) + if (gBacklightTop.unk10 != SDK_OVERLAY_INVALID_ID) HandleLoadOverlay(gBacklightTop.unk10, 0); gBacklightTop.unk8 = gBacklightTop.unk10; gBacklightTop.unkC = FUN_02006234(gBacklightTop.unk14, &gBacklightTop.unk18, 0); - gBacklightTop.unk10 = -1u; + gBacklightTop.unk10 = SDK_OVERLAY_INVALID_ID; gBacklightTop.unk14 = NULL; } if (FUN_02006290(gBacklightTop.unkC)) { FUN_02006260(gBacklightTop.unkC); gBacklightTop.unkC = 0; - if (gBacklightTop.unk8 != -1u) + if (gBacklightTop.unk8 != SDK_OVERLAY_INVALID_ID) UnloadOverlayByID(gBacklightTop.unk8); } } diff --git a/arm9/src/unk_02006234.c b/arm9/src/unk_02006234.c new file mode 100644 index 00000000..8915ab83 --- /dev/null +++ b/arm9/src/unk_02006234.c @@ -0,0 +1,78 @@ +#include "global.h" +#include "main.h" +#include "poke_overlay.h" +#include "heap.h" + +THUMB_FUNC struct UnkStruct_02006234 * FUN_02006234(struct Unk21DBE18 * ovly_mgr, int * a1, u32 heap_id) +{ + struct UnkStruct_02006234 * ret = (struct UnkStruct_02006234 *)AllocFromHeap(heap_id, sizeof(struct UnkStruct_02006234)); + ret->ovly_mgr = *ovly_mgr; + ret->unk10 = 0; + ret->unk14 = 0; + ret->unk18 = a1; + ret->unk1C = NULL; + ret->unk20 = 0; + ret->unk24 = 0; + return ret; +} + +THUMB_FUNC void FUN_02006260(struct UnkStruct_02006234 * a0) +{ + FreeToHeap(a0); +} + +THUMB_FUNC void * FUN_02006268(struct UnkStruct_02006234 * a0, u32 size, u32 heap_id) +{ + return a0->unk1C = AllocFromHeap(heap_id, size); +} + +THUMB_FUNC void * FUN_02006278(struct UnkStruct_02006234 * a0) +{ + return a0->unk1C; +} + +THUMB_FUNC void FUN_0200627C(struct UnkStruct_02006234 * a0) +{ + FreeToHeap(a0->unk1C); + a0->unk1C = NULL; +} + +THUMB_FUNC int * FUN_0200628C(struct UnkStruct_02006234 * a0) +{ + return a0->unk18; +} + +THUMB_FUNC BOOL FUN_02006290(struct UnkStruct_02006234 * a0) +{ + switch (a0->unk10) + { + case 0: + if (a0->ovly_mgr.ovly != SDK_OVERLAY_INVALID_ID) + HandleLoadOverlay(a0->ovly_mgr.ovly, 2); + a0->unk10 = 1; + // fallthrough + case 1: + if (a0->ovly_mgr.unk0(a0, &a0->unk14) == TRUE) + { + a0->unk10 = 2; + a0->unk14 = 0; + } + break; + case 2: + if (a0->ovly_mgr.unk4(a0, &a0->unk14) == TRUE) + { + a0->unk10 = 3; + a0->unk14 = 0; + } + break; + case 3: + if (a0->ovly_mgr.unk8(a0, &a0->unk14) == TRUE) + { + if (a0->ovly_mgr.ovly != SDK_OVERLAY_INVALID_ID) + UnloadOverlayByID(a0->ovly_mgr.ovly); + return TRUE; + } + break; + } + return FALSE; +} |