npc_block_way__next_tile

This commit is contained in:
PikalaxALT 2017-09-16 18:33:38 -04:00
parent ca88036ebe
commit 5812bc4ebe
4 changed files with 14 additions and 46 deletions

View File

@ -5,51 +5,6 @@
.text .text
thumb_func_start npc_running_behaviour_by_direction
npc_running_behaviour_by_direction: @ 8092B78
lsls r0, 24
lsrs r0, 24
ldr r1, =gUnknown_0850DB53
adds r0, r1
ldrb r0, [r0]
bx lr
.pool
thumb_func_end npc_running_behaviour_by_direction
thumb_func_start npc_block_way__next_tile
npc_block_way__next_tile: @ 8092B88
push {r4-r6,lr}
sub sp, 0x4
adds r6, r0, 0
lsls r5, r1, 24
lsrs r5, 24
ldrh r1, [r6, 0x10]
mov r0, sp
strh r1, [r0]
ldrh r0, [r6, 0x12]
mov r4, sp
adds r4, 0x2
strh r0, [r4]
adds r0, r5, 0
mov r1, sp
adds r2, r4, 0
bl MoveCoords
mov r0, sp
movs r2, 0
ldrsh r1, [r0, r2]
movs r0, 0
ldrsh r2, [r4, r0]
adds r0, r6, 0
adds r3, r5, 0
bl npc_block_way
lsls r0, 24
lsrs r0, 24
add sp, 0x4
pop {r4-r6}
pop {r1}
bx r1
thumb_func_end npc_block_way__next_tile
thumb_func_start npc_block_way thumb_func_start npc_block_way
@ u8 npc_block_way(struct npc_state *fieldObject, u16 x, u16 y, u8 direction) @ u8 npc_block_way(struct npc_state *fieldObject, u16 x, u16 y, u8 direction)
npc_block_way: @ 8092BC8 npc_block_way: @ 8092BC8

View File

@ -35,7 +35,6 @@ extern const u8 gUnknown_0850D8C4[5];
extern const u8 gUnknown_0850D8E8[4]; extern const u8 gUnknown_0850D8E8[4];
extern bool8 (*const gUnknown_0850DA64[])(struct MapObject *, struct Sprite *, u8, bool8(u8)); extern bool8 (*const gUnknown_0850DA64[])(struct MapObject *, struct Sprite *, u8, bool8(u8));
extern const u8 gUnknown_0850DBA0[5]; extern const u8 gUnknown_0850DBA0[5];
#endif //GUARD_DATA3_H #endif //GUARD_DATA3_H

View File

@ -68,6 +68,7 @@ u8 GetStepInPlaceDelay8AnimId(u32);
u8 GetStepInPlaceDelay16AnimId(u32); u8 GetStepInPlaceDelay16AnimId(u32);
u8 GetStepInPlaceDelay32AnimId(u32); u8 GetStepInPlaceDelay32AnimId(u32);
u8 npc_block_way(struct MapObject *, s16, s16, u32); u8 npc_block_way(struct MapObject *, s16, s16, u32);
void MoveCoords(u8, s16 *, s16 *);
// Exported data declarations // Exported data declarations

View File

@ -3635,6 +3635,19 @@ void npc_set_running_behaviour_etc(struct MapObject *mapObject, u8 animPattern)
gSprites[mapObject->spriteId].data1 = 0; gSprites[mapObject->spriteId].data1 = 0;
} }
dirn2anim(npc_running_behaviour_by_direction, gUnknown_0850DB53)
bool8 npc_block_way__next_tile(struct MapObject *mapObject, u8 direction)
{
s16 x;
s16 y;
x = mapObject->coords2.x;
y = mapObject->coords2.y;
MoveCoords(direction, &x, &y);
return npc_block_way(mapObject, x, y, direction);
}
asm(".section .text.get_face_direction_anim_id"); asm(".section .text.get_face_direction_anim_id");
void FieldObjectClearAnimIfSpecialAnimActive(struct MapObject *); void FieldObjectClearAnimIfSpecialAnimActive(struct MapObject *);