sub_80EB498

This commit is contained in:
PikalaxALT 2017-10-27 22:24:54 -04:00
parent b8b2a7ca40
commit 69d206c255
2 changed files with 31 additions and 78 deletions

View File

@ -5,84 +5,6 @@
.text
thumb_func_start sub_80EB498
sub_80EB498: @ 80EB498
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, =0xfffffce4
adds r0, r1
cmp r0, 0x18
bhi _080EB55C
lsls r0, 2
ldr r1, =_080EB4D0
adds r0, r1
ldr r0, [r0]
mov pc, r0
.pool
.align 2, 0
_080EB4D0:
.4byte _080EB534
.4byte _080EB534
.4byte _080EB534
.4byte _080EB534
.4byte _080EB55C
.4byte _080EB55C
.4byte _080EB55C
.4byte _080EB55C
.4byte _080EB534
.4byte _080EB534
.4byte _080EB534
.4byte _080EB534
.4byte _080EB55C
.4byte _080EB55C
.4byte _080EB55C
.4byte _080EB55C
.4byte _080EB534
.4byte _080EB534
.4byte _080EB55C
.4byte _080EB55C
.4byte _080EB534
.4byte _080EB534
.4byte _080EB534
.4byte _080EB534
.4byte _080EB534
_080EB534:
ldr r0, =0x00004054
bl VarGet
lsls r0, 16
cmp r0, 0
beq _080EB55C
ldr r4, =0x000040ee
adds r0, r4, 0
bl VarGet
adds r1, r0, 0
movs r2, 0x80
lsls r2, 7
adds r0, r2, 0
orrs r1, r0
lsls r1, 16
lsrs r1, 16
adds r0, r4, 0
bl VarSet
_080EB55C:
add sp, 0x4
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end sub_80EB498
thumb_func_start sub_80EB56C
sub_80EB56C: @ 80EB56C
push {r4,lr}

View File

@ -1992,3 +1992,34 @@ void sub_80EB438(void)
VarSet(VAR_0x40EF, VarGet(VAR_0x40EF) | 0x001);
}
}
void sub_80EB498(void)
{
s16 x;
s16 y;
GetXYCoordsOneStepInFrontOfPlayer(&x, &y);
switch (MapGridGetMetatileIdAt(x, y))
{
case 0x31C:
case 0x31D:
case 0x31E:
case 0x31F:
case 0x324:
case 0x325:
case 0x326:
case 0x327:
case 0x32C:
case 0x32D:
case 0x330:
case 0x331:
case 0x332:
case 0x333:
case 0x334:
if (VarGet(VAR_0x4054) != 0)
{
VarSet(VAR_0x40EE, VarGet(VAR_0x40EE) | 0x4000);
}
break;
}
}