From 9a5320135bbb811250c943fdf57c1fd49d2fb7e4 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 27 Oct 2017 22:38:33 -0400 Subject: [PATCH] sub_80EB9E0 --- asm/secret_base.s | 107 ---------------------------------------------- src/secret_base.c | 27 ++++++++++++ 2 files changed, 27 insertions(+), 107 deletions(-) diff --git a/asm/secret_base.s b/asm/secret_base.s index 3eb71e8ed..2bb2003b1 100644 --- a/asm/secret_base.s +++ b/asm/secret_base.s @@ -5,113 +5,6 @@ .text - thumb_func_start sub_80EB9E0 -sub_80EB9E0: @ 80EB9E0 - push {r4,lr} - sub sp, 0x4 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl GetXYCoordsOneStepInFrontOfPlayer - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r4, r2] - bl MapGridGetMetatileIdAt - ldr r1, =0xfffffd6f - adds r0, r1 - cmp r0, 0x35 - bls _080EBA08 - b _080EBB18 -_080EBA08: - lsls r0, 2 - ldr r1, =_080EBA1C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080EBA1C: - .4byte _080EBAF4 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBAF4 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBAF4 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBAF4 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBAF4 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBAF4 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBAF4 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBAF4 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBAF4 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBAF4 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBAF4 -_080EBAF4: - ldr r0, =0x00004054 - bl VarGet - lsls r0, 16 - cmp r0, 0 - beq _080EBB18 - ldr r4, =0x000040ef - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - movs r0, 0x8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl VarSet -_080EBB18: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EB9E0 - thumb_func_start sub_80EBB28 sub_80EBB28: @ 80EBB28 push {r4,lr} diff --git a/src/secret_base.c b/src/secret_base.c index a51cd0ff9..b17575a9b 100644 --- a/src/secret_base.c +++ b/src/secret_base.c @@ -2114,3 +2114,30 @@ void sub_80EB56C(void) break; } } + +void sub_80EB9E0(void) +{ + s16 x; + s16 y; + + GetXYCoordsOneStepInFrontOfPlayer(&x, &y); + switch (MapGridGetMetatileIdAt(x, y)) + { + case 0x291: + case 0x294: + case 0x297: + case 0x2a1: + case 0x2a5: + case 0x2a9: + case 0x2ad: + case 0x2bb: + case 0x2be: + case 0x2c3: + case 0x2c6: + if (VarGet(VAR_0x4054) != 0) + { + VarSet(VAR_0x40EF, VarGet(VAR_0x40EF) | 0x8); + } + break; + } +}