From 4c274f60305c0daaaa126ae08fc1f4b731a74101 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 27 Oct 2017 22:46:57 -0400 Subject: [PATCH] Last remaining function in secret base --- asm/secret_base.s | 53 ----------------------------------------------- ld_script.txt | 1 - src/secret_base.c | 18 ++++++++++++++++ 3 files changed, 18 insertions(+), 54 deletions(-) delete mode 100644 asm/secret_base.s diff --git a/asm/secret_base.s b/asm/secret_base.s deleted file mode 100644 index 211405ac7..000000000 --- a/asm/secret_base.s +++ /dev/null @@ -1,53 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start sub_80EBE7C -sub_80EBE7C: @ 80EBE7C - 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 - adds r1, r0, 0 - ldr r0, =0x0000028e - cmp r1, r0 - bgt _080EBECC - subs r0, 0x1 - cmp r1, r0 - blt _080EBECC - ldr r0, =0x00004054 - bl VarGet - lsls r0, 16 - cmp r0, 0 - beq _080EBECC - ldr r4, =0x000040ef - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - movs r0, 0x4 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl VarSet -_080EBECC: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EBE7C - - .align 2, 0 @ Don't pad with nop. diff --git a/ld_script.txt b/ld_script.txt index 26ccbd884..08b3cbe98 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -148,7 +148,6 @@ SECTIONS { asm/contest_effect.o(.text); asm/record_mixing.o(.text); src/secret_base.o(.text); - asm/secret_base.o(.text); src/tv.o(.text); asm/contest_link_80F57C4.o(.text); asm/script_pokemon_util_80F87D8.o(.text); diff --git a/src/secret_base.c b/src/secret_base.c index 4cdaf02a8..c8214f189 100644 --- a/src/secret_base.c +++ b/src/secret_base.c @@ -2194,3 +2194,21 @@ void sub_80EBB28(void) break; } } + +void sub_80EBE7C(void) +{ + s16 x; + s16 y; + + GetXYCoordsOneStepInFrontOfPlayer(&x, &y); + switch ((int)MapGridGetMetatileIdAt(x, y)) + { + case 0x28d: + case 0x28e: + if (VarGet(VAR_0x4054) != 0) + { + VarSet(VAR_0x40EF, VarGet(VAR_0x40EF) | 0x4); + } + break; + } +}