diff --git a/asm/include/main_0205B7C8.inc b/asm/include/main_0205B80C.inc similarity index 99% rename from asm/include/main_0205B7C8.inc rename to asm/include/main_0205B80C.inc index a29cdb1f..7c859dd9 100644 --- a/asm/include/main_0205B7C8.inc +++ b/asm/include/main_0205B80C.inc @@ -388,4 +388,5 @@ .public sub_0205B44C .public sub_0205B560 .public sub_0205B77C +.public sub_0205B7C8 .public vsprintf diff --git a/asm/main_0205B7C8.s b/asm/main_0205B80C.s similarity index 99% rename from asm/main_0205B7C8.s rename to asm/main_0205B80C.s index be6f53ad..67cd20cd 100644 --- a/asm/main_0205B7C8.s +++ b/asm/main_0205B80C.s @@ -1,30 +1,8 @@ .include "asm/macros.inc" - .include "main_0205B7C8.inc" + .include "main_0205B80C.inc" .text - arm_func_start sub_0205B7C8 -sub_0205B7C8: ; 0x0205B7C8 - stmdb sp!, {r4, lr} - mov r2, #0xb0 - mul r4, r0, r2 - ldr r0, _0205B808 ; =_020B0A54 - mov r1, #0 - ldr r0, [r0] - add r0, r0, r4 - bl MemsetSimple - ldr r0, _0205B808 ; =_020B0A54 - mov r2, #0 - ldr r1, [r0] - strb r2, [r1, r4] - ldr r0, [r0] - add r0, r0, r4 - strh r2, [r0, #0xa2] - ldmia sp!, {r4, pc} - .align 2, 0 -_0205B808: .word _020B0A54 - arm_func_end sub_0205B7C8 - arm_func_start sub_0205B80C sub_0205B80C: ; 0x0205B80C stmdb sp!, {r4, r5, r6, r7, r8, sb, sl, lr} diff --git a/include/main_0205B7C8.h b/include/main_0205B7C8.h new file mode 100644 index 00000000..ee2a396a --- /dev/null +++ b/include/main_0205B7C8.h @@ -0,0 +1,6 @@ +#ifndef PMDSKY_MAIN_0205B7C8_H +#define PMDSKY_MAIN_0205B7C8_H + +void sub_0205B7C8(s32 index); + +#endif //PMDSKY_MAIN_0205B7C8_H diff --git a/main.lsf b/main.lsf index c5788de4..6d678ae9 100644 --- a/main.lsf +++ b/main.lsf @@ -152,7 +152,8 @@ Static main Object src/main_0205B6EC.o Object asm/main_0205B738.o Object src/main_0205B77C.o - Object asm/main_0205B7C8.o + Object src/main_0205B7C8.o + Object asm/main_0205B80C.o Object src/dungeon_init_2.o Object asm/main_0206A750.o Object src/main_0206C98C.o diff --git a/src/main_0205B7C8.c b/src/main_0205B7C8.c new file mode 100644 index 00000000..ebb61018 --- /dev/null +++ b/src/main_0205B7C8.c @@ -0,0 +1,20 @@ +#include "main_0205B7C8.h" +#include "main_0200330C.h" + +struct unkStruct_020B0A54 { + u8 f0; + u8 pad[161]; + u16 fA2; + u8 pad2[12]; +}; + +// Should match the struct in main_0205B77C, but haven't gotten it to match yet. +// https://decomp.me/scratch/WXX6d +extern struct unkStruct_020B0A54 *_020B0A54; + +void sub_0205B7C8(s32 index) +{ + MemsetSimple((u8*) &_020B0A54[index], 0, 0xB0); + _020B0A54[index].f0 = 0; + _020B0A54[index].fA2 = 0; +}