diff --git a/asm/include/main_0205C870.inc b/asm/include/main_0205C8E0.inc similarity index 99% rename from asm/include/main_0205C870.inc rename to asm/include/main_0205C8E0.inc index 21738fa7..6f3217ac 100644 --- a/asm/include/main_0205C870.inc +++ b/asm/include/main_0205C8E0.inc @@ -372,4 +372,5 @@ .public sub_0205BD40 .public sub_0205BD5C .public sub_0205C73C +.public sub_0205C870 .public vsprintf diff --git a/asm/main_0205C870.s b/asm/main_0205C8E0.s similarity index 99% rename from asm/main_0205C870.s rename to asm/main_0205C8E0.s index 93e49dce..27e85efd 100644 --- a/asm/main_0205C870.s +++ b/asm/main_0205C8E0.s @@ -1,45 +1,8 @@ .include "asm/macros.inc" - .include "main_0205C870.inc" + .include "main_0205C8E0.inc" .text - arm_func_start sub_0205C870 -sub_0205C870: ; 0x0205C870 - cmp r0, #6 - addls pc, pc, r0, lsl #2 - b _0205C8D8 -_0205C87C: ; jump table - b _0205C898 ; case 0 - b _0205C898 ; case 1 - b _0205C898 ; case 2 - b _0205C898 ; case 3 - b _0205C898 ; case 4 - b _0205C8B4 ; case 5 - b _0205C8BC ; case 6 -_0205C898: - ldrsh r1, [r1] - ldrsh r0, [r2] - cmp r1, r0 - moveq r0, #1 - movne r0, #0 - and r0, r0, #0xff - bx lr -_0205C8B4: - mov r0, #1 - bx lr -_0205C8BC: - ldrsh r1, [r1] - ldrsh r0, [r2] - cmp r1, r0 - moveq r0, #1 - movne r0, #0 - and r0, r0, #0xff - bx lr -_0205C8D8: - mov r0, #0 - bx lr - arm_func_end sub_0205C870 - arm_func_start sub_0205C8E0 sub_0205C8E0: ; 0x0205C8E0 ldrb ip, [r0] diff --git a/include/main_0205C73C.h b/include/main_0205C73C.h index f5b44c70..e5c5fcbc 100644 --- a/include/main_0205C73C.h +++ b/include/main_0205C73C.h @@ -6,5 +6,6 @@ void sub_0205C73C(void); void sub_0205C75C(void); bool8 IsMissionSuspendedAndValid(struct mission *mission); +u8 sub_0205C870(u32 type, s16 *ptr1, s16 *ptr2); #endif //PMDSKY_MAIN_0205C73C_H diff --git a/main.lsf b/main.lsf index a84f6450..68fa26d5 100644 --- a/main.lsf +++ b/main.lsf @@ -162,7 +162,7 @@ Static main Object src/main_0205C440.o Object asm/main_0205C548.o Object src/main_0205C73C.o - Object asm/main_0205C870.o + Object asm/main_0205C8E0.o Object src/dungeon_init_2.o Object asm/main_0206A750.o Object src/main_0206C98C.o diff --git a/src/main_0205C73C.c b/src/main_0205C73C.c index 3d26d8b9..ddd3e4b6 100644 --- a/src/main_0205C73C.c +++ b/src/main_0205C73C.c @@ -52,3 +52,22 @@ bool8 IsMissionSuspendedAndValid(struct mission *mission) return IsMissionValid(mission); } + +u8 sub_0205C870(u32 type, s16 *ptr1, s16 *ptr2) +{ + switch (type) + { + case 0: + case 1: + case 2: + case 3: + case 4: + return *ptr1 == *ptr2; + case 5: + return TRUE; + case 6: + return *ptr1 == *ptr2; + default: + return FALSE; + } +}