diff options
author | Revo <projectrevotpp@hotmail.com> | 2021-08-08 14:13:02 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-08 14:13:02 -0400 |
commit | 3b396519495ce258e203e9cdec5716406b450711 (patch) | |
tree | e41c29adb3c12aefaa30d53222afcffdb402b5ed | |
parent | 38f3650189f8989aed91618745aa74029fa60247 (diff) | |
parent | 7ab3252bf751152c746f1f395105d919ffd35600 (diff) |
Merge pull request #444 from remicalixte/unk_02008AA4
decompile unk_02008AA4.s
-rw-r--r-- | arm9/asm/unk_02008AA4.s | 428 | ||||
-rw-r--r-- | arm9/src/unk_02008AA4.c | 257 | ||||
-rw-r--r-- | arm9/src/unk_0200BB14.c | 60 | ||||
-rw-r--r-- | include/unk_02008AA4.h | 55 | ||||
-rw-r--r-- | include/unk_0200BB14.h | 29 |
5 files changed, 349 insertions, 480 deletions
diff --git a/arm9/asm/unk_02008AA4.s b/arm9/asm/unk_02008AA4.s deleted file mode 100644 index 0b8d98e7..00000000 --- a/arm9/asm/unk_02008AA4.s +++ /dev/null @@ -1,428 +0,0 @@ - .include "asm/macros.inc" - .include "global.inc" - - .text - - thumb_func_start FUN_02008AA4 -FUN_02008AA4: ; 0x02008AA4 - push {r3-r7, lr} - sub sp, #0x18 - mov r4, #0x0 - add r5, r0, #0x0 - add r0, r4, #0x0 - str r0, [sp, #0x8] - ldr r0, [sp, #0x44] - add r6, r1, #0x0 - str r2, [sp, #0x0] - str r3, [sp, #0x4] - str r4, [sp, #0xc] - cmp r0, #0x0 - bne _02008AC2 - bl GF_AssertFail -_02008AC2: - ldr r0, [sp, #0x48] - cmp r0, #0x0 - bne _02008ACC - bl GF_AssertFail -_02008ACC: - ldr r0, [sp, #0x50] - cmp r0, #0x0 - bne _02008AD6 - bl GF_AssertFail -_02008AD6: - ldr r0, [sp, #0x4c] - cmp r0, #0x0 - bne _02008AE0 - bl GF_AssertFail -_02008AE0: - cmp r5, #0x0 - bne _02008AE8 - bl GF_AssertFail -_02008AE8: - ldr r0, [sp, #0x44] - add r1, r6, #0x0 - bl FUN_020094F0 - add r7, r0, #0x0 - bne _02008AF8 - bl GF_AssertFail -_02008AF8: - ldr r0, [sp, #0x48] - ldr r1, [sp, #0x0] - bl FUN_020094F0 - str r0, [sp, #0x14] - cmp r0, #0x0 - bne _02008B0A - bl GF_AssertFail -_02008B0A: - ldr r0, [sp, #0x4c] - ldr r1, [sp, #0x4] - bl FUN_020094F0 - str r0, [sp, #0x10] - cmp r0, #0x0 - bne _02008B1C - bl GF_AssertFail -_02008B1C: - ldr r0, [sp, #0x50] - cmp r0, #0x0 - beq _02008B3A - mov r2, #0x0 - ldr r1, [sp, #0x30] - mvn r2, r2 - cmp r1, r2 - beq _02008B3A - bl FUN_020094F0 - str r0, [sp, #0xc] - cmp r0, #0x0 - bne _02008B3A - bl GF_AssertFail -_02008B3A: - ldr r0, [sp, #0x54] - cmp r0, #0x0 - beq _02008B62 - mov r2, #0x0 - ldr r1, [sp, #0x34] - mvn r2, r2 - cmp r1, r2 - beq _02008B50 - bl FUN_020094F0 - add r4, r0, #0x0 -_02008B50: - mov r0, #0x0 - ldr r1, [sp, #0x38] - mvn r0, r0 - cmp r1, r0 - beq _02008B62 - ldr r0, [sp, #0x58] - bl FUN_020094F0 - str r0, [sp, #0x8] -_02008B62: - ldr r0, [sp, #0x3c] - cmp r0, #0x0 - beq _02008B82 - ldr r1, [sp, #0x10] - add r0, r7, #0x0 - bl FUN_02009C80 - add r6, r0, #0x0 - bne _02008B78 - bl GF_AssertFail -_02008B78: - add r0, r7, #0x0 - bl FUN_02009544 - str r0, [r5, #0x4] - b _02008B94 -_02008B82: - add r0, r7, #0x0 - bl FUN_02009C5C - add r6, r0, #0x0 - bne _02008B90 - bl GF_AssertFail -_02008B90: - mov r0, #0x0 - str r0, [r5, #0x4] -_02008B94: - ldr r0, [sp, #0x14] - add r1, r6, #0x0 - bl FUN_02009E54 - str r0, [r5, #0x8] - ldr r0, [sp, #0x10] - str r6, [r5, #0x0] - bl FUN_02009574 - str r0, [r5, #0xc] - ldr r0, [sp, #0xc] - cmp r0, #0x0 - beq _02008BB4 - bl FUN_0200958C - b _02008BB6 -_02008BB4: - mov r0, #0x0 -_02008BB6: - str r0, [r5, #0x10] - cmp r4, #0x0 - beq _02008BCC - add r0, r4, #0x0 - bl FUN_020095A4 - str r0, [r5, #0x14] - ldr r0, [sp, #0x8] - bl FUN_020095BC - b _02008BD0 -_02008BCC: - mov r0, #0x0 - str r0, [r5, #0x14] -_02008BD0: - str r0, [r5, #0x18] - ldr r0, [sp, #0x3c] - str r0, [r5, #0x1c] - ldr r0, [sp, #0x40] - add r5, #0x20 - strb r0, [r5, #0x0] - add sp, #0x18 - pop {r3-r7, pc} - - thumb_func_start FUN_02008BE0 -FUN_02008BE0: ; 0x02008BE0 - push {r4-r7, lr} - sub sp, #0x34 - add r5, r0, #0x0 - ldr r0, [sp, #0x48] - add r7, r1, #0x0 - str r0, [sp, #0x48] - ldr r0, [sp, #0x4c] - mov r4, #0x0 - str r0, [sp, #0x4c] - ldr r0, [sp, #0x50] - ldr r1, [r5, #0x0] - str r0, [sp, #0x50] - ldr r0, [sp, #0x54] - str r2, [sp, #0x2c] - str r0, [sp, #0x54] - sub r0, r4, #0x2 - str r3, [sp, #0x30] - cmp r1, r0 - beq _02008C14 - add r2, r5, #0x0 - sub r0, r4, #0x2 -_02008C0A: - add r2, #0x20 - ldr r1, [r2, #0x0] - add r4, r4, #0x1 - cmp r1, r0 - bne _02008C0A -_02008C14: - add r0, r7, #0x0 - mov r1, #0x8 - bl AllocFromHeap - mov r1, #0x24 - add r6, r0, #0x0 - add r0, r7, #0x0 - mul r1, r4 - bl AllocFromHeap - str r0, [r6, #0x0] - mov r7, #0x0 - str r4, [r6, #0x4] - cmp r4, #0x0 - ble _02008C7A - add r4, r7, #0x0 -_02008C34: - ldr r0, [r5, #0xc] - str r0, [sp, #0x0] - ldr r0, [r5, #0x10] - str r0, [sp, #0x4] - ldr r0, [r5, #0x14] - str r0, [sp, #0x8] - ldr r0, [r5, #0x18] - str r0, [sp, #0xc] - ldr r0, [r5, #0x1c] - str r0, [sp, #0x10] - ldr r0, [sp, #0x2c] - str r0, [sp, #0x14] - ldr r0, [sp, #0x30] - str r0, [sp, #0x18] - ldr r0, [sp, #0x48] - str r0, [sp, #0x1c] - ldr r0, [sp, #0x4c] - str r0, [sp, #0x20] - ldr r0, [sp, #0x50] - str r0, [sp, #0x24] - ldr r0, [sp, #0x54] - str r0, [sp, #0x28] - ldr r0, [r6, #0x0] - ldr r1, [r5, #0x0] - ldr r2, [r5, #0x4] - ldr r3, [r5, #0x8] - add r0, r0, r4 - bl FUN_02008AA4 - ldr r0, [r6, #0x4] - add r7, r7, #0x1 - add r5, #0x20 - add r4, #0x24 - cmp r7, r0 - blt _02008C34 -_02008C7A: - add r0, r6, #0x0 - add sp, #0x34 - pop {r4-r7, pc} - - thumb_func_start FUN_02008C80 -FUN_02008C80: ; 0x02008C80 - push {r4, lr} - add r4, r0, #0x0 - bne _02008C8A - bl GF_AssertFail -_02008C8A: - ldr r0, [r4, #0x0] - cmp r0, #0x0 - beq _02008C94 - bl FreeToHeap -_02008C94: - add r0, r4, #0x0 - bl FreeToHeap - pop {r4, pc} - - thumb_func_start FUN_02008C9C -FUN_02008C9C: ; 0x02008C9C - push {r3-r6, lr} - sub sp, #0x1c - add r4, r1, #0x0 - add r5, r0, #0x0 - ldr r1, _02008D00 ; =0xFFFFF000 - add r0, r4, #0x0 - add r6, r2, #0x0 - bl FUN_0202134C - mov r0, #0x0 - str r0, [sp, #0x0] - str r0, [sp, #0x4] - mov r0, #0xff - lsl r0, r0, #0xc - str r0, [sp, #0x8] - mov r0, #0x3 - lsl r0, r0, #0x12 - str r0, [sp, #0xc] - add r0, r4, #0x0 - add r0, #0x98 - add r1, sp, #0x0 - mov r2, #0x1 - add r3, r4, #0x0 - bl FUN_02009FD8 - mov r0, #0x0 - str r0, [sp, #0x0] - mov r0, #0xff - mov r1, #0x3 - lsl r1, r1, #0x12 - lsl r0, r0, #0xc - str r0, [sp, #0x8] - add r0, r4, #0x0 - str r1, [sp, #0x4] - str r1, [sp, #0xc] - add r0, #0xe0 - add r1, sp, #0x0 - mov r2, #0x2 - add r3, r4, #0x0 - bl FUN_02009FD8 - add r0, sp, #0x10 - str r5, [sp, #0x10] - str r4, [sp, #0x14] - str r6, [sp, #0x18] - bl FUN_0201FCB0 - add sp, #0x1c - pop {r3-r6, pc} - nop -_02008D00: .word 0xFFFFF000 - - thumb_func_start FUN_02008D04 -FUN_02008D04: ; 0x02008D04 - push {r3, lr} - sub sp, #0x10 - str r1, [sp, #0x0] - mov r1, #0xff - lsl r1, r1, #0xc - str r1, [sp, #0x8] - mov r1, #0x3 - lsl r1, r1, #0x12 - str r1, [sp, #0xc] - add r0, #0x98 - add r1, sp, #0x0 - str r2, [sp, #0x4] - bl FUN_02021390 - add sp, #0x10 - pop {r3, pc} - - thumb_func_start FUN_02008D24 -FUN_02008D24: ; 0x02008D24 - push {r3, lr} - sub sp, #0x10 - str r1, [sp, #0x0] - mov r1, #0xff - lsl r1, r1, #0xc - str r1, [sp, #0x8] - mov r1, #0x3 - lsl r1, r1, #0x12 - str r1, [sp, #0xc] - add r0, #0xe0 - add r1, sp, #0x0 - str r2, [sp, #0x4] - bl FUN_02021390 - add sp, #0x10 - pop {r3, pc} - - thumb_func_start FUN_02008D44 -FUN_02008D44: ; 0x02008D44 - push {r4, lr} - add r4, r0, #0x0 - cmp r1, #0x10 - beq _02008D5A - ldr r2, _02008DCC ; =0x00100010 - cmp r1, r2 - beq _02008D8A - ldr r0, _02008DD0 ; =0x00200010 - cmp r1, r0 - beq _02008D98 - b _02008DC4 -_02008D5A: - bl GX_GetBankForOBJ - cmp r0, #0x40 - beq _02008D6A - bl GX_GetBankForOBJ - cmp r0, #0x20 - bne _02008D7A -_02008D6A: - mov r0, #0x3e - mov r1, #0x2 - lsl r0, r0, #0x8 - lsl r1, r1, #0x8 - add r2, r4, #0x0 - bl FUN_0201D194 - pop {r4, pc} -_02008D7A: - mov r0, #0x7e - mov r1, #0x2 - lsl r0, r0, #0x8 - lsl r1, r1, #0x8 - add r2, r4, #0x0 - bl FUN_0201D194 - pop {r4, pc} -_02008D8A: - mov r0, #0xfe - lsr r1, r2, #0xb - lsl r0, r0, #0x8 - add r2, r4, #0x0 - bl FUN_0201D194 - pop {r4, pc} -_02008D98: - bl GX_GetBankForOBJ - cmp r0, #0x30 - beq _02008DA8 - bl GX_GetBankForOBJ - cmp r0, #0x50 - bne _02008DB6 -_02008DA8: - mov r1, #0x2 - ldr r0, _02008DD4 ; =0x00013E00 - lsl r1, r1, #0x8 - add r2, r4, #0x0 - bl FUN_0201D194 - pop {r4, pc} -_02008DB6: - mov r1, #0x2 - ldr r0, _02008DD8 ; =0x0001FE00 - lsl r1, r1, #0x8 - add r2, r4, #0x0 - bl FUN_0201D194 - pop {r4, pc} -_02008DC4: - bl GF_AssertFail - pop {r4, pc} - nop -_02008DCC: .word 0x00100010 -_02008DD0: .word 0x00200010 -_02008DD4: .word 0x00013E00 -_02008DD8: .word 0x0001FE00 - - thumb_func_start FUN_02008DDC -FUN_02008DDC: ; 0x02008DDC - ldr r3, _02008DE8 ; =FUN_0201E068 - add r1, r0, #0x0 - mov r0, #0x3 - lsl r0, r0, #0xe - bx r3 - nop -_02008DE8: .word FUN_0201E068 diff --git a/arm9/src/unk_02008AA4.c b/arm9/src/unk_02008AA4.c new file mode 100644 index 00000000..2d7fb77d --- /dev/null +++ b/arm9/src/unk_02008AA4.c @@ -0,0 +1,257 @@ +#include "global.h" +#include "unk_02008AA4.h" +#include "GX_vramcnt.h" +#include "heap.h" +#include "unk_0200BB14.h" + +extern u32 FUN_020094F0(u32 param0, s32 param1); +extern u32 FUN_02009C80(u32, u32); +extern u32 FUN_02009544(u32); +extern u32 FUN_02009E54(u32 param0, u32 param1); +extern u32 FUN_02009C5C(u32); +extern u32 FUN_02009574(u32); +extern u32 FUN_0200958C(u32); +extern u32 FUN_020095A4(u32); +extern u32 FUN_020095BC(u32); +extern void FUN_0202134C(void *, u32); +extern void FUN_02009FD8(void *param0, u32 *param1, u32 param2, u32 param3); +extern u32 FUN_0201FCB0(u32 *); +extern void FUN_02021390(u32, u32 *); +extern void FUN_0201D194(u32, u32, u32); +extern void FUN_0201E068(u32, u32); + +THUMB_FUNC void FUN_02008AA4(struct UnkStruct_0200BB14_sub *param0, + s32 param1, + s32 param2, + s32 param3, + s32 param4, + s32 param5, + s32 param6, + u32 param7, + u32 param8, + u32 param9, + u32 param10, + u32 param11, + u32 param12, + u32 param13, + u32 param14) +{ + u32 r7; + u32 st14; + u32 st10; + + u32 stc = 0; + u32 r4 = 0; + u32 st8 = 0; + + GF_ASSERT(param9); + GF_ASSERT(param10); + GF_ASSERT(param12); + GF_ASSERT(param11); + GF_ASSERT(param0); + + r7 = FUN_020094F0(param9, param1); + GF_ASSERT(r7); + + st14 = FUN_020094F0(param10, param2); + GF_ASSERT(st14); + + st10 = FUN_020094F0(param11, param3); + GF_ASSERT(st10); + + if (param12 != 0 && param4 != -1) + { + stc = FUN_020094F0(param12, param4); + GF_ASSERT(stc); + } + + if (param13 != 0) + { + if (param5 != -1) + { + r4 = FUN_020094F0(param13, param5); + } + + if (param6 != -1) + { + st8 = FUN_020094F0(param14, param6); + } + } + + u32 r6; + if (param7 != 0) + { + r6 = FUN_02009C80(r7, st10); + GF_ASSERT(r6); + + param0->unk04 = FUN_02009544(r7); + } + else + { + r6 = FUN_02009C5C(r7); + GF_ASSERT(r6); + + param0->unk04 = 0; + } + + param0->unk08 = FUN_02009E54(st14, r6); + param0->unk00 = r6; + param0->unk0C = FUN_02009574(st10); + + if (stc != 0) + { + param0->unk10 = FUN_0200958C(stc); + } + else + { + param0->unk10 = 0; + } + + if (r4 != 0) + { + param0->unk14 = FUN_020095A4(r4); + param0->unk18 = FUN_020095BC(st8); + } + else + { + param0->unk14 = 0; + param0->unk18 = 0; + } + + param0->unk1C = param7; + param0->unk20 = (u8)param8; +} + +THUMB_FUNC struct UnkStruct_02008AA4_1 *FUN_02008BE0(struct UnkStruct_02008AA4_2 *param0, + u32 param1, + u32 param2, + u32 param3, + u32 param4, + u32 param5, + u32 param6, + u32 param7) +{ + + s32 r4 = 0; + while (param0[r4].unk00 != -2) + { + r4++; + } + + struct UnkStruct_02008AA4_1 *r6 = AllocFromHeap(param1, sizeof(struct UnkStruct_02008AA4_1)); + r6->unk00 = AllocFromHeap(param1, r4 * sizeof(struct UnkStruct_0200BB14_sub)); + r6->unk04 = r4; + + for (int r7 = 0; r7 < r6->unk04; r7++) + { + FUN_02008AA4(&r6->unk00[r7], + param0[r7].unk00, + param0[r7].unk04, + param0[r7].unk08, + param0[r7].unk0C, + param0[r7].unk10, + param0[r7].unk14, + param0[r7].unk18, + param0[r7].unk1C, + param2, + param3, + param4, + param5, + param6, + param7); + } + + return r6; +} + +THUMB_FUNC void FUN_02008C80(struct UnkStruct_02008AA4_1 *param0) +{ + GF_ASSERT(param0); + + if (param0->unk00 != NULL) + { + FreeToHeap(param0->unk00); + } + FreeToHeap(param0); +} + +THUMB_FUNC u32 FUN_02008C9C(u32 param0, void *param1, u32 param2) +{ + FUN_0202134C(param1, 0xFFFFF000); + + u32 st10[3]; + u32 st0[4]; + + st0[0] = 0; + st0[1] = 0; + st0[2] = 0xFF000; + st0[3] = 0xC0000; + FUN_02009FD8(param1 + 0x98, st0, 1, param1); + + st0[0] = 0; + st0[1] = 0xC0000; + st0[2] = 0xFF000; + st0[3] = 0xC0000; + + FUN_02009FD8(param1 + 0xe0, st0, 2, param1); + + st10[0] = param0; + st10[1] = (u32)param1; + st10[2] = param2; + + return FUN_0201FCB0(st10); +} + +THUMB_FUNC void FUN_02008D04(u32 param0, u32 param1, u32 param2) +{ + u32 st0[4]; + st0[0] = param1; + st0[2] = 0xFF000; + st0[3] = 0xC0000; + st0[1] = param2; + FUN_02021390(param0 + 0x98, st0); +} + +THUMB_FUNC void FUN_02008D24(u32 param0, u32 param1, u32 param2) +{ + u32 st0[4]; + st0[0] = param1; + st0[2] = 0xFF000; + st0[3] = 0xC0000; + st0[1] = param2; + FUN_02021390(param0 + 0xe0, st0); +} + +THUMB_FUNC void FUN_02008D44(u32 param0, u32 param1) +{ + switch (param1) + { + case 0x10: + if (GX_GetBankForOBJ() == 0x40 || GX_GetBankForOBJ() == 0x20) + { + FUN_0201D194(0x3E00, 0x200, param0); + return; + } + + FUN_0201D194(0x7E00, 0x200, param0); + return; + case 0x00100010: + FUN_0201D194(0xfe00, 0x200, param0); + return; + case 0x00200010: + if (GX_GetBankForOBJ() == 0x30 || GX_GetBankForOBJ() == 0x50) + { + FUN_0201D194(0x13E00, 0x200, param0); + return; + } + FUN_0201D194(0x1FE00, 0x200, param0); + return; + } + + GF_AssertFail(); +} + +THUMB_FUNC void FUN_02008DDC(u32 param0) +{ + FUN_0201E068(0xC000, param0); +} diff --git a/arm9/src/unk_0200BB14.c b/arm9/src/unk_0200BB14.c index 4ed957d6..ac8d048e 100644 --- a/arm9/src/unk_0200BB14.c +++ b/arm9/src/unk_0200BB14.c @@ -2,6 +2,7 @@ #include "unk_0200BB14.h" #include "game_init.h" #include "heap.h" +#include "unk_02008AA4.h" extern void FUN_0201D060(u32 *param0, u32 param1, u32 param2); extern void FUN_0201E00C(u32 param0, u32 param1); @@ -18,13 +19,11 @@ extern void FUN_02009EAC(u32 param0, extern u32 FUN_0201C328(u32 param0, u32 param1); extern void FUN_0201D168(); extern void FUN_0201E0BC(); -extern u32 FUN_02008C9C(u32 param0, void *param1, u32 param2); extern void FUN_0201FFC8(u32 param0); extern void FUN_0201FDEC(u32 param0); extern void FUN_02009F80(); extern void FUN_0201C348(); extern void FUN_0201FD58(u32 param0); -extern void FUN_02008C80(u32 param0); extern u32 FUN_02009660(u32 *param0, s32 param1); extern void FUN_020096B4(u32 param0); extern void FUN_02009C30(u32 *param0); @@ -43,14 +42,6 @@ extern u32 *FUN_02009424(u32 param0, u32 param1); extern u32 FUN_020093A8(u32 param0, u32 param1, u32 *param2, u32 param3); extern void FUN_02009A90(u32 *param0); extern void FUN_02009D34(u32 *param0); -extern u32 FUN_02008BE0(void *param0, - u32 param1, - u32 param2, - u32 param3, - u32 param4, - u32 param5, - u32 param6, - u32 param7); extern u32 FUN_0201FE94(struct UnkStruct_0200BB14_4 *param0); extern void FUN_02020130(u32 param0, u32 param1); extern void FUN_02020248(u32 param0, u32 param1); @@ -63,21 +54,6 @@ extern u32 FUN_02008FEC( extern u32 FUN_02009D68(u32 param0); extern u32 FUN_02009E88(u32 param0, u32 param1); extern void FUN_02003108(u32 param0, u32 param1, u16 param2, u32 param3); -extern void FUN_02008AA4(struct UnkStruct_0200BB14_sub *param0, - s32 param1, - s32 param2, - s32 param3, - s32 param4, - s32 param5, - s32 param6, - u32 param7, - u32 param8, - u32 param9, - u32 param10, - u32 param11, - u32 param12, - u32 param13, - u32 param14); extern u8 FUN_020202A0(u32 param0); extern u32 FUN_020094F0(u32 param0, u32 param1); extern u32 FUN_02009E54(u32 param0, u32 param1); @@ -344,7 +320,7 @@ THUMB_FUNC BOOL FUN_0200BD20( FUN_02009A90(param1->unk24[0]); FUN_02009D34(param1->unk24[1]); - void *r6 = AllocAndReadFile(param0->unk000, st10[6]); + struct UnkStruct_02008AA4_2 *r6 = AllocAndReadFile(param0->unk000, st10[6]); param1->unk04 = FUN_02008BE0(r6, param0->unk000, param1->unk0c[0], @@ -568,7 +544,7 @@ THUMB_FUNC u8 FUN_0200C0DC(u32 param0, return (u8)r4; } -THUMB_FUNC u32 FUN_0200C124(u32 *param0, +THUMB_FUNC BOOL FUN_0200C124(u32 *param0, struct UnkStruct_0200BB14_2 *param1, u32 param2, u32 param3, @@ -578,7 +554,7 @@ THUMB_FUNC u32 FUN_0200C124(u32 *param0, return FUN_0200C404(param0, param1, param2, param3, param4, 2, param5); } -THUMB_FUNC u32 FUN_0200C13C(u32 *param0, +THUMB_FUNC BOOL FUN_0200C13C(u32 *param0, struct UnkStruct_0200BB14_2 *param1, u32 param2, u32 param3, @@ -732,22 +708,22 @@ THUMB_FUNC u32 FUN_0200C344(u32 *param0, u32 param1, u32 param2) return FUN_02009E88(FUN_020094F0(param0[4], param1), param2); } -THUMB_FUNC u32 FUN_0200C358(struct UnkStruct_0200BB14_2 *param0, u32 param1) +THUMB_FUNC BOOL FUN_0200C358(struct UnkStruct_0200BB14_2 *param0, u32 param1) { return FUN_0200C4F4(param0->unk0c[0], param0->unk24[0], param1); } -THUMB_FUNC u32 FUN_0200C368(struct UnkStruct_0200BB14_2 *param0, u32 param1) +THUMB_FUNC BOOL FUN_0200C368(struct UnkStruct_0200BB14_2 *param0, u32 param1) { return FUN_0200C548(param0->unk0c[1], param0->unk24[1], param1); } -THUMB_FUNC u32 FUN_0200C378(struct UnkStruct_0200BB14_2 *param0, u32 param1) +THUMB_FUNC BOOL FUN_0200C378(struct UnkStruct_0200BB14_2 *param0, u32 param1) { return FUN_0200C4A8(param0->unk0c[2], param0->unk24[2], param1); } -THUMB_FUNC u32 FUN_0200C388(struct UnkStruct_0200BB14_2 *param0, u32 param1) +THUMB_FUNC BOOL FUN_0200C388(struct UnkStruct_0200BB14_2 *param0, u32 param1) { return FUN_0200C4A8(param0->unk0c[3], param0->unk24[3], param1); } @@ -796,8 +772,8 @@ THUMB_FUNC BOOL FUN_0200C404(u32 *param0, u32 r5 = FUN_020090AC(param1->unk0c[param5], param2, param3, param4, param6, param5, param0[0]); if (r5 != 0) { - u32 r4 = FUN_0200C474(param1->unk24[param5], r5); - GF_ASSERT(r4 == 1); + BOOL r4 = FUN_0200C474(param1->unk24[param5], r5); + GF_ASSERT(r4 == TRUE); return r4; } GF_ASSERT(0); @@ -1085,18 +1061,18 @@ THUMB_FUNC void FUN_0200C75C(u32 param0, u16 *param1, u16 *param2) { s32 *r4 = FUN_0202011C(param0, param1, param2); - param1[0] = r4[0] / 0x1000; + param1[0] = (u16)(r4[0] / 0x1000); if (FUN_02020380(param0) == 2) { s32 r1 = r4[1] - 0xc0000; - param2[0] = r1 / 0x1000; + param2[0] = (u16)(r1 / 0x1000); return; } - param2[0] = r4[1] / 0x1000; + param2[0] = (u16)(r4[1] / 0x1000); } THUMB_FUNC void FUN_0200C7A0(u32 *param0, u16 *param1, u16 *param2) @@ -1104,25 +1080,25 @@ THUMB_FUNC void FUN_0200C7A0(u32 *param0, u16 *param1, u16 *param2) FUN_0200C75C(*param0, param1, param2); } -THUMB_FUNC void FUN_0200C7AC(u32 param0, u16 *param1, u16 *param2, u32 param3) +THUMB_FUNC void FUN_0200C7AC(u32 param0, u16 *param1, u16 *param2, s32 param3) { s32 *r4 = FUN_0202011C(param0, param1, param2); - param1[0] = r4[0] / 0x1000; + param1[0] = (u16)(r4[0] / 0x1000); if (FUN_02020380(param0) == 2) { s32 r1 = r4[1] - param3; - param2[0] = r1 / 0x1000; + param2[0] = (u16)(r1 / 0x1000); return; } - param2[0] = r4[1] / 0x1000; + param2[0] = (u16)(r4[1] / 0x1000); } -THUMB_FUNC void FUN_0200C7F0(u32 *param0, u16 *param1, u16 *param2, u32 param3) +THUMB_FUNC void FUN_0200C7F0(u32 *param0, u16 *param1, u16 *param2, s32 param3) { FUN_0200C7AC(*param0, param1, param2, param3); } diff --git a/include/unk_02008AA4.h b/include/unk_02008AA4.h new file mode 100644 index 00000000..448a7101 --- /dev/null +++ b/include/unk_02008AA4.h @@ -0,0 +1,55 @@ +#ifndef POKEDIAMOND_UNK_02008AA4_H +#define POKEDIAMOND_UNK_02008AA4_H + +#include "global.h" +#include "unk_0200BB14.h" + +struct UnkStruct_02008AA4_1 +{ + struct UnkStruct_0200BB14_sub *unk00; + s32 unk04; +}; + +struct UnkStruct_02008AA4_2 +{ + s32 unk00; + s32 unk04; + s32 unk08; + s32 unk0C; + s32 unk10; + s32 unk14; + u32 unk18; + u32 unk1C; +}; + +void FUN_02008AA4(struct UnkStruct_0200BB14_sub *param0, + s32 param1, + s32 param2, + s32 param3, + s32 param4, + s32 param5, + s32 param6, + u32 param7, + u32 param8, + u32 param9, + u32 param10, + u32 param11, + u32 param12, + u32 param13, + u32 param14); +struct UnkStruct_02008AA4_1 *FUN_02008BE0(struct UnkStruct_02008AA4_2 *param0, + u32 param1, + u32 param2, + u32 param3, + u32 param4, + u32 param5, + u32 param6, + u32 param7); +void FUN_02008C80(struct UnkStruct_02008AA4_1 *param0); +u32 FUN_02008C9C(u32 param0, void *param1, u32 param2); +void FUN_02008D04(u32 param0, u32 param1, u32 param2); +void FUN_02008D24(u32 param0, u32 param1, u32 param2); +void FUN_02008D44(u32 param0, u32 param1); +void FUN_02008DDC(u32 param0); + +#endif // POKEDIAMOND_UNK_02008AA4_H diff --git a/include/unk_0200BB14.h b/include/unk_0200BB14.h index a252fd93..04c6dcb0 100644 --- a/include/unk_0200BB14.h +++ b/include/unk_0200BB14.h @@ -15,7 +15,7 @@ struct UnkStruct_0200BB14_1 struct UnkStruct_0200BB14_2 { u32 unk00; - u32 unk04; + struct UnkStruct_02008AA4_1 *unk04; u32 *unk08; u32 unk0c[6]; u32 *unk24[6]; @@ -41,7 +41,16 @@ struct UnkStruct_0200BB14_3 struct UnkStruct_0200BB14_sub { - u8 unk00[0x24]; + u32 unk00; + u32 unk04; + u32 unk08; + u32 unk0C; + u32 unk10; + u32 unk14; + u32 unk18; + u32 unk1C; + u8 unk20; + u8 unk21[0x3]; }; struct UnkStruct_0200BB14_4 @@ -134,13 +143,13 @@ u8 FUN_0200C0DC(u32 param0, u32 param7, u32 param8, s32 param9); -u32 FUN_0200C124(u32 *param0, +BOOL FUN_0200C124(u32 *param0, struct UnkStruct_0200BB14_2 *param1, u32 param2, u32 param3, u32 param4, s32 param5); -u32 FUN_0200C13C(u32 *param0, +BOOL FUN_0200C13C(u32 *param0, struct UnkStruct_0200BB14_2 *param1, u32 param2, u32 param3, @@ -150,10 +159,10 @@ struct UnkStruct_0200BB14_5 *FUN_0200C154( struct UnkStruct_0200BB14_1 *param0, struct UnkStruct_0200BB14_2 *param1, u32 *param2); u32 FUN_0200C334(u32 *param0, u32 param1); u32 FUN_0200C344(u32 *param0, u32 param1, u32 param2); -u32 FUN_0200C358(struct UnkStruct_0200BB14_2 *param0, u32 param1); -u32 FUN_0200C368(struct UnkStruct_0200BB14_2 *param0, u32 param1); -u32 FUN_0200C378(struct UnkStruct_0200BB14_2 *param0, u32 param1); -u32 FUN_0200C388(struct UnkStruct_0200BB14_2 *param0, u32 param1); +BOOL FUN_0200C358(struct UnkStruct_0200BB14_2 *param0, u32 param1); +BOOL FUN_0200C368(struct UnkStruct_0200BB14_2 *param0, u32 param1); +BOOL FUN_0200C378(struct UnkStruct_0200BB14_2 *param0, u32 param1); +BOOL FUN_0200C388(struct UnkStruct_0200BB14_2 *param0, u32 param1); void FUN_0200C398(struct UnkStruct_0200BB14_1 *param0, struct UnkStruct_0200BB14_2 *param1); void FUN_0200C3DC(u32 *param0); BOOL FUN_0200C404(u32 *param0, @@ -204,8 +213,8 @@ void FUN_0200C720(u32 param0, u32 param1, u32 param2, u32 param3); void FUN_0200C750(u32 *param0, u32 param1, u32 param2, u32 param3); void FUN_0200C75C(u32 param0, u16 *param1, u16 *param2); void FUN_0200C7A0(u32 *param0, u16 *param1, u16 *param2); -void FUN_0200C7AC(u32 param0, u16 *param1, u16 *param2, u32 param3); -void FUN_0200C7F0(u32 *param0, u16 *param1, u16 *param2, u32 param3); +void FUN_0200C7AC(u32 param0, u16 *param1, u16 *param2, s32 param3); +void FUN_0200C7F0(u32 *param0, u16 *param1, u16 *param2, s32 param3); void FUN_0200C7FC(u32 param0, u16 *param1, u16 *param2); void FUN_0200C82C(u32 *param0, u16 *param1, u16 *param2); void FUN_0200C838(u32 param0, u32 param1); |