FaceFixedDirection

This commit is contained in:
PikalaxALT 2017-09-14 21:30:14 -04:00
parent 68c62595f5
commit 9a13b1f34e
2 changed files with 26 additions and 94 deletions

View File

@ -5,100 +5,6 @@
.text
thumb_func_start FieldObjectCB_FaceFixedDirection
FieldObjectCB_FaceFixedDirection: @ 808FD8C
push {lr}
adds r1, r0, 0
movs r0, 0x2E
ldrsh r2, [r1, r0]
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
ldr r2, =gMapObjects
adds r0, r2
ldr r2, =FieldObjectCB2_FaceFixedDirection
bl FieldObjectStep
pop {r0}
bx r0
.pool
thumb_func_end FieldObjectCB_FaceFixedDirection
thumb_func_start FieldObjectCB2_FaceFixedDirection
@ bool8 FieldObjectCB2_FaceFixedDirection(struct npc_state *fieldObject, struct obj *object)
FieldObjectCB2_FaceFixedDirection: @ 808FDB0
push {r4,lr}
ldr r3, =gUnknown_0850D794
movs r4, 0x30
ldrsh r2, [r1, r4]
lsls r2, 2
adds r2, r3
ldr r2, [r2]
bl _call_via_r2
lsls r0, 24
lsrs r0, 24
pop {r4}
pop {r1}
bx r1
.pool
thumb_func_end FieldObjectCB2_FaceFixedDirection
thumb_func_start sub_808FDD0
@ bool8 sub_808FDD0(struct npc_state *fieldObject, struct obj *object)
sub_808FDD0: @ 808FDD0
push {r4,r5,lr}
adds r4, r0, 0
adds r5, r1, 0
bl npc_reset
ldrb r0, [r4, 0x18]
lsls r0, 28
lsrs r0, 28
bl GetFaceDirectionAnimId
adds r2, r0, 0
lsls r2, 24
lsrs r2, 24
adds r0, r4, 0
adds r1, r5, 0
bl FieldObjectSetRegularAnim
movs r0, 0x1
strh r0, [r5, 0x30]
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_808FDD0
thumb_func_start sub_808FDFC
@ bool8 sub_808FDFC(struct npc_state *fieldObject, struct obj *object)
sub_808FDFC: @ 808FDFC
push {r4,lr}
adds r4, r1, 0
bl FieldObjectExecRegularAnim
lsls r0, 24
cmp r0, 0
bne _0808FE0E
movs r0, 0
b _0808FE14
_0808FE0E:
movs r0, 0x2
strh r0, [r4, 0x30]
movs r0, 0x1
_0808FE14:
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_808FDFC
thumb_func_start sub_808FE1C
@ bool8 sub_808FE1C(struct npc_state *fieldObject, struct obj *object)
sub_808FE1C: @ 808FE1C
ldrb r2, [r0]
movs r1, 0x3
negs r1, r1
ands r1, r2
strb r1, [r0]
movs r0, 0
bx lr
thumb_func_end sub_808FE1C
thumb_func_start FieldObjectCB_BerryTree
FieldObjectCB_BerryTree: @ 808FE2C
push {r4,r5,lr}

View File

@ -2246,3 +2246,29 @@ bool8 sub_808FD64(struct MapObject *mapObject, struct Sprite *sprite)
}
return FALSE;
}
field_object_step(FaceFixedDirection, gUnknown_0850D794)
bool8 sub_808FDD0(struct MapObject *mapObject, struct Sprite *sprite)
{
npc_reset(mapObject, sprite);
FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(mapObject->mapobj_unk_18));
sprite->data1 = 1;
return TRUE;
}
bool8 sub_808FDFC(struct MapObject *mapObject, struct Sprite *sprite)
{
if (FieldObjectExecRegularAnim(mapObject, sprite))
{
sprite->data1 = 2;
return TRUE;
}
return FALSE;
}
bool8 sub_808FE1C(struct MapObject *mapObject, struct Sprite *sprite)
{
mapObject->mapobj_bit_1 = FALSE;
return FALSE;
}