decomp start of unk_02016B94.s

This commit is contained in:
Rémi Calixte
2021-03-24 19:41:23 +01:00
parent 954605b27b
commit d84e1e2a35
4 changed files with 119 additions and 109 deletions
+1
View File
@@ -49,6 +49,7 @@ Static arm9
Object unk_02015E30.o
Object game_init.o
Object heap.o
Object unk_02016B94_c.o
Object unk_02016B94.o
Object unk_0201B1A8.o
Object unk_0201B4E8.o
-109
View File
@@ -2,117 +2,8 @@
.include "global.inc"
.section .rodata
.global UNK_020EDB30
UNK_020EDB30: ; 0x020EDB30
.byte 0x10, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00
.global UNK_020EDB38
UNK_020EDB38: ; 0x020EDB38
.word FUN_020192D4
.word FUN_02019358
.word FUN_020192D4
.global UNK_020EDB44
UNK_020EDB44: ; 0x020EDB44
.word FUN_020195D0
.word FUN_0201960C
.word FUN_020195D0
.global UNK_020EDB50
UNK_020EDB50: ; 0x020EDB50
.word FUN_020195A8
.word FUN_020195E4
.word FUN_020195A8
.global UNK_020EDB5C
UNK_020EDB5C: ; 0x020EDB5C
.word FUN_020194C8
.word FUN_0201951C
.word FUN_020194C8
.global UNK_020EDB68
UNK_020EDB68: ; 0x020EDB68
.word FUN_0201949C
.word FUN_020194E0
.word FUN_0201949C
.global UNK_020EDB74
UNK_020EDB74: ; 0x020EDB74
.word FUN_020193B4
.word FUN_02019444
.word FUN_020193B4
.text
thumb_func_start FUN_02016B94
FUN_02016B94: ; 0x02016B94
push {r3-r5, lr}
mov r1, #0x5a
lsl r1, r1, #0x2
add r5, r0, #0x0
bl AllocFromHeap
mov r2, #0x5a
mov r1, #0x0
lsl r2, r2, #0x2
add r4, r0, #0x0
bl memset
str r5, [r4, #0x0]
mov r0, #0x0
strh r0, [r4, #0x4]
strh r0, [r4, #0x6]
add r0, r4, #0x0
pop {r3-r5, pc}
thumb_func_start FUN_02016BB8
FUN_02016BB8: ; 0x02016BB8
ldr r0, [r0, #0x0]
bx lr
thumb_func_start FUN_02016BBC
FUN_02016BBC: ; 0x02016BBC
push {r4, lr}
add r4, r0, #0x0
ldr r0, [r4, #0x0]
ldr r1, [r4, #0x4]
ldr r2, [r4, #0xc]
bl GX_SetGraphicsMode
ldr r0, [r4, #0x8]
bl GXS_SetGraphicsMode
mov r2, #0x1
lsl r2, r2, #0x1a
ldr r1, [r2, #0x0]
ldr r0, _02016BF0 ; =0xC7FFFFFF
and r1, r0
str r1, [r2, #0x0]
ldr r1, [r2, #0x0]
asr r0, r0, #0x3
and r0, r1
str r0, [r2, #0x0]
bl GX_DisableEngineALayers
bl GX_DisableEngineBLayers
pop {r4, pc}
nop
_02016BF0: .word 0xC7FFFFFF
thumb_func_start FUN_02016BF4
FUN_02016BF4: ; 0x02016BF4
push {r3, lr}
add r2, r0, #0x0
cmp r1, #0x0
bne _02016C0C
ldr r0, [r2, #0x0]
ldr r1, [r2, #0x4]
ldr r2, [r2, #0xc]
bl GX_SetGraphicsMode
bl GX_DisableEngineALayers
pop {r3, pc}
_02016C0C:
ldr r0, [r2, #0x8]
bl GXS_SetGraphicsMode
bl GX_DisableEngineBLayers
pop {r3, pc}
thumb_func_start FUN_02016C18
FUN_02016C18: ; 0x02016C18
push {r3-r7, lr}
+7
View File
@@ -8517,3 +8517,10 @@
.extern CARDi_InitCommon
.extern MonNotFaintedOrEgg
.extern CountAlivePokemon
.extern UNK_020EDB30
.extern UNK_020EDB38
.extern UNK_020EDB44
.extern UNK_020EDB50
.extern UNK_020EDB5C
.extern UNK_020EDB68
.extern UNK_020EDB74
+111
View File
@@ -0,0 +1,111 @@
#include "global.h"
#include "GX_layers.h"
#include "gx.h"
#include "heap.h"
extern void FUN_020192D4();
extern void FUN_02019358();
extern void FUN_020195D0();
extern void FUN_0201960C();
extern void FUN_020195A8();
extern void FUN_020195E4();
extern void FUN_020194C8();
extern void FUN_0201951C();
extern void FUN_0201949C();
extern void FUN_020194E0();
extern void FUN_020193B4();
extern void FUN_02019444();
const u8 UNK_020EDB30[8] = {
0x10,
0x20,
0x20,
0x20,
0x20,
0x20,
0x00,
0x00,
};
void (*const UNK_020EDB5C[])() = {
FUN_020194C8,
FUN_0201951C,
FUN_020194C8,
};
void (*const UNK_020EDB50[])() = {
FUN_020195A8,
FUN_020195E4,
FUN_020195A8,
};
void (*const UNK_020EDB44[])() = {
FUN_020195D0,
FUN_0201960C,
FUN_020195D0,
};
void (*const UNK_020EDB38[])() = {
FUN_020192D4,
FUN_02019358,
FUN_020192D4,
};
void (*const UNK_020EDB68[])() = {
FUN_0201949C,
FUN_020194E0,
FUN_0201949C,
};
void (*const UNK_020EDB74[])() = {
FUN_020193B4,
FUN_02019444,
FUN_020193B4,
};
THUMB_FUNC void *FUN_02016B94(u32 heap_id)
{
void *ptr = AllocFromHeap(heap_id, 0x5a << 2);
memset(ptr, 0, 0x5a << 2);
*(u32 *)ptr = heap_id;
*(u16 *)(ptr + 4) = 0;
*(u16 *)(ptr + 6) = 0;
return ptr;
}
THUMB_FUNC u32 FUN_02016BB8(u32 *param0)
{
return *param0;
}
THUMB_FUNC void FUN_02016BBC(u32 *param0)
{
GX_SetGraphicsMode(param0[0], param0[1], param0[3]);
GXS_SetGraphicsMode(param0[2]);
reg_GX_DISPCNT &= 0xC7FFFFFF;
reg_GX_DISPCNT &= 0xF8FFFFFF;
GX_DisableEngineALayers();
GX_DisableEngineBLayers();
}
THUMB_FUNC void FUN_02016BF4(u32 *param0, u32 param1)
{
if (param1 == 0)
{
GX_SetGraphicsMode(param0[0], param0[1], param0[3]);
GX_DisableEngineALayers();
}
else
{
GXS_SetGraphicsMode(param0[2]);
GX_DisableEngineBLayers();
}
}