sub_808F080

This commit is contained in:
scnorton 2017-09-10 17:47:37 -04:00
parent 8456991837
commit bcf844f965
2 changed files with 11 additions and 33 deletions

View File

@ -5,39 +5,6 @@
.text
thumb_func_start sub_808F080
sub_808F080: @ 808F080
push {lr}
sub sp, 0x4
lsls r0, 24
lsrs r0, 24
lsls r1, 24
lsrs r1, 24
lsls r2, 24
lsrs r2, 24
mov r3, sp
bl TryGetFieldObjectIdByLocalIdAndMap
lsls r0, 24
cmp r0, 0
bne _0808F0B4
ldr r2, =gMapObjects
mov r0, sp
ldrb r1, [r0]
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
adds r0, r2
ldrb r0, [r0, 0x7]
b _0808F0B6
.pool
_0808F0B4:
movs r0, 0xFF
_0808F0B6:
add sp, 0x4
pop {r1}
bx r1
thumb_func_end sub_808F080
thumb_func_start sub_808F0BC
sub_808F0BC: @ 808F0BC
lsls r0, 24

View File

@ -1510,3 +1510,14 @@ u16 GetFieldObjectFlagIdByFieldObjectId(u8 mapObjectId)
{
return GetFieldObjectFlagIdByLocalIdAndMap(gMapObjects[mapObjectId].localId, gMapObjects[mapObjectId].mapNum, gMapObjects[mapObjectId].mapGroup);
}
u8 sub_808F080(u8 localId, u8 mapNum, u8 mapGroup)
{
u8 mapObjectId;
if (TryGetFieldObjectIdByLocalIdAndMap(localId, mapNum, mapGroup, &mapObjectId))
{
return 0xFF;
}
return gMapObjects[mapObjectId].trainerType;
}