sub_808F608

This commit is contained in:
PikalaxALT 2017-09-13 19:21:05 -04:00
parent d72231379b
commit c2e31f0618
2 changed files with 23 additions and 30 deletions

View File

@ -5,36 +5,6 @@
.text
thumb_func_start sub_808F608
sub_808F608: @ 808F608
push {r4,lr}
lsls r0, 16
lsrs r4, r0, 16
lsls r1, 16
lsrs r0, r1, 16
lsls r2, 16
lsls r3, 16
cmp r2, r3
ble _0808F626
movs r2, 0x4
lsls r0, r4, 16
cmp r0, 0
bge _0808F630
movs r2, 0x3
b _0808F630
_0808F626:
movs r2, 0x1
lsls r0, 16
cmp r0, 0
bge _0808F630
movs r2, 0x2
_0808F630:
adds r0, r2, 0
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_808F608
thumb_func_start sub_808F638
sub_808F638: @ 808F638
push {lr}

View File

@ -1832,3 +1832,26 @@ bool8 FieldObjectIsTrainerAndCloseToPlayer(struct MapObject *mapObject)
}
return TRUE;
}
u8 sub_808F608(s16 x1, s16 x2, s16 y1, s16 y2)
{
u8 retval;
if (y1 > y2)
{
retval = DIR_EAST;
if (x1 < 0)
{
retval = DIR_WEST;
}
}
else
{
retval = DIR_SOUTH;
if (x2 < 0)
{
retval = DIR_NORTH;
}
}
return retval;
}