diff options
-rw-r--r-- | arm9/asm/unk_02025484.s | 41 | ||||
-rw-r--r-- | arm9/global.inc | 4 | ||||
-rw-r--r-- | arm9/src/unk_02025484.c | 28 | ||||
-rw-r--r-- | include/unk_02025484.h | 18 |
4 files changed, 50 insertions, 41 deletions
diff --git a/arm9/asm/unk_02025484.s b/arm9/asm/unk_02025484.s deleted file mode 100644 index 5f869289..00000000 --- a/arm9/asm/unk_02025484.s +++ /dev/null @@ -1,41 +0,0 @@ - .include "asm/macros.inc" - .include "global.inc" - - .text - - thumb_func_start FUN_02025484 -FUN_02025484: ; 0x02025484 - ldr r3, _0202548C ; =MI_CpuFill8 - mov r1, #0x0 - mov r2, #0x24 - bx r3 - .balign 4 -_0202548C: .word MI_CpuFill8 - - thumb_func_start FUN_02025490 -FUN_02025490: ; 0x02025490 - push {r3-r5, lr} - add r5, r0, #0x0 - add r4, r1, #0x0 - bl FUN_02025484 - str r4, [r5, #0x0] - add r0, r5, #0x4 - pop {r3-r5, pc} - - thumb_func_start FUN_020254A0 -FUN_020254A0: ; 0x020254A0 - push {r4, lr} - add r4, r0, #0x0 - ldr r0, [r4, #0x0] - cmp r0, r1 - beq _020254AE - bl ErrorHandling -_020254AE: - add r0, r4, #0x4 - pop {r4, pc} - .balign 4 - - thumb_func_start FUN_020254B4 -FUN_020254B4: ; 0x020254B4 - ldr r0, [r0, #0x0] - bx lr diff --git a/arm9/global.inc b/arm9/global.inc index 621d07ec..c6076947 100644 --- a/arm9/global.inc +++ b/arm9/global.inc @@ -8517,3 +8517,7 @@ .extern CARDi_InitCommon .extern MonNotFaintedOrEgg .extern CountAlivePokemon +.extern FUN_02025484 +.extern FUN_02025490 +.extern FUN_020254A0 +.extern FUN_020254B4 diff --git a/arm9/src/unk_02025484.c b/arm9/src/unk_02025484.c new file mode 100644 index 00000000..7a394da8 --- /dev/null +++ b/arm9/src/unk_02025484.c @@ -0,0 +1,28 @@ +#include "global.h" +#include "MI_memory.h" +#include "error_handling.h" +#include "unk_02025484.h" + +THUMB_FUNC void FUN_02025484(struct unk_2025484 *r0, u32 r1) +{ + MI_CpuFill8(r0, 0, sizeof(struct unk_2025484)); +} + +THUMB_FUNC u32 *FUN_02025490(struct unk_2025484 *r0, u32 r1) +{ + FUN_02025484(r0, r1); + r0->unk0 = r1; + return &r0->unk4; +} + +THUMB_FUNC u32 *FUN_020254A0(struct unk_2025484 *r0, u32 r1) +{ + if(r0->unk0 != r1) + ErrorHandling(); + return &r0->unk4; +} + +THUMB_FUNC u32 FUN_020254B4(struct unk_2025484 *r0) +{ + return r0->unk0; +} diff --git a/include/unk_02025484.h b/include/unk_02025484.h new file mode 100644 index 00000000..0412dda1 --- /dev/null +++ b/include/unk_02025484.h @@ -0,0 +1,18 @@ +#ifndef POKEDIAMOND_UNK_02025484_H +#define POKEDIAMOND_UNK_02025484_H + +struct unk_2025484 +{ + // size: 0x24 + u32 unk0; + u32 unk4; + u8 padding[0x1C]; +}; + +void FUN_02025484(struct unk_2025484 *r0, u32 r1); +u32 *FUN_02025490(struct unk_2025484 *r0, u32 r1); +u32 *FUN_020254A0(struct unk_2025484 *r0, u32 r1); +u32 FUN_020254B4(struct unk_2025484 *r0); + +#endif POKEDIAMOND_UNK_02025484_H + |