More special anims with timers

This commit is contained in:
PikalaxALT 2017-09-17 10:23:18 -04:00
parent cd958b1e43
commit 43b3195bc8
2 changed files with 60 additions and 700 deletions

View File

@ -5,706 +5,6 @@
.text
thumb_func_start sub_8094454
sub_8094454: @ 8094454
push {r4,r5,lr}
adds r4, r0, 0
adds r5, r1, 0
movs r2, 0x1
movs r3, 0x1
bl do_go_anim
adds r0, r4, 0
adds r1, r5, 0
bl sub_8094474
lsls r0, 24
lsrs r0, 24
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_8094454
thumb_func_start sub_8094474
sub_8094474: @ 8094474
push {r4,lr}
adds r4, r1, 0
bl npc_obj_ministep_stop_on_arrival
lsls r0, 24
cmp r0, 0
bne _08094486
movs r0, 0
b _0809448C
_08094486:
movs r0, 0x2
strh r0, [r4, 0x32]
movs r0, 0x1
_0809448C:
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_8094474
thumb_func_start sub_8094494
sub_8094494: @ 8094494
push {r4,r5,lr}
adds r4, r0, 0
adds r5, r1, 0
movs r2, 0x2
movs r3, 0x1
bl do_go_anim
adds r0, r4, 0
adds r1, r5, 0
bl sub_80944B4
lsls r0, 24
lsrs r0, 24
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_8094494
thumb_func_start sub_80944B4
sub_80944B4: @ 80944B4
push {r4,lr}
adds r4, r1, 0
bl npc_obj_ministep_stop_on_arrival
lsls r0, 24
cmp r0, 0
bne _080944C6
movs r0, 0
b _080944CC
_080944C6:
movs r0, 0x2
strh r0, [r4, 0x32]
movs r0, 0x1
_080944CC:
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_80944B4
thumb_func_start sub_80944D4
sub_80944D4: @ 80944D4
push {r4,r5,lr}
adds r4, r0, 0
adds r5, r1, 0
movs r2, 0x3
movs r3, 0x1
bl do_go_anim
adds r0, r4, 0
adds r1, r5, 0
bl sub_80944F4
lsls r0, 24
lsrs r0, 24
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_80944D4
thumb_func_start sub_80944F4
sub_80944F4: @ 80944F4
push {r4,lr}
adds r4, r1, 0
bl npc_obj_ministep_stop_on_arrival
lsls r0, 24
cmp r0, 0
bne _08094506
movs r0, 0
b _0809450C
_08094506:
movs r0, 0x2
strh r0, [r4, 0x32]
movs r0, 0x1
_0809450C:
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_80944F4
thumb_func_start sub_8094514
sub_8094514: @ 8094514
push {r4,r5,lr}
adds r4, r0, 0
adds r5, r1, 0
movs r2, 0x4
movs r3, 0x1
bl do_go_anim
adds r0, r4, 0
adds r1, r5, 0
bl sub_8094534
lsls r0, 24
lsrs r0, 24
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_8094514
thumb_func_start sub_8094534
sub_8094534: @ 8094534
push {r4,lr}
adds r4, r1, 0
bl npc_obj_ministep_stop_on_arrival
lsls r0, 24
cmp r0, 0
bne _08094546
movs r0, 0
b _0809454C
_08094546:
movs r0, 0x2
strh r0, [r4, 0x32]
movs r0, 0x1
_0809454C:
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_8094534
thumb_func_start sub_8094554
sub_8094554: @ 8094554
push {r4-r6,lr}
mov r6, r8
push {r6}
mov r8, r0
adds r6, r1, 0
adds r1, r2, 0
adds r4, r3, 0
ldr r5, [sp, 0x14]
lsls r1, 24
lsrs r1, 24
lsls r4, 24
lsrs r4, 24
lsls r5, 16
lsrs r5, 16
bl FieldObjectSetDirection
mov r0, r8
adds r1, r6, 0
adds r2, r4, 0
bl npc_apply_anim_looping
adds r2, r6, 0
adds r2, 0x2C
ldrb r1, [r2]
movs r0, 0x41
negs r0, r0
ands r0, r1
strb r0, [r2]
movs r0, 0x1
strh r0, [r6, 0x32]
strh r5, [r6, 0x34]
pop {r3}
mov r8, r3
pop {r4-r6}
pop {r0}
bx r0
thumb_func_end sub_8094554
thumb_func_start sub_809459C
@ signed int sub_809459C(int a1, obj *a2)
sub_809459C: @ 809459C
push {lr}
ldrh r0, [r1, 0x34]
subs r0, 0x1
strh r0, [r1, 0x34]
lsls r0, 16
cmp r0, 0
beq _080945AE
movs r0, 0
b _080945C0
_080945AE:
movs r0, 0x2
strh r0, [r1, 0x32]
adds r2, r1, 0
adds r2, 0x2C
ldrb r0, [r2]
movs r1, 0x40
orrs r0, r1
strb r0, [r2]
movs r0, 0x1
_080945C0:
pop {r1}
bx r1
thumb_func_end sub_809459C
thumb_func_start sub_80945C4
@ int sub_80945C4(int a1, obj *a2)
sub_80945C4: @ 80945C4
push {r4,r5,lr}
adds r5, r0, 0
adds r4, r1, 0
ldrh r1, [r4, 0x34]
movs r0, 0x1
ands r0, r1
cmp r0, 0
beq _080945EE
adds r3, r4, 0
adds r3, 0x2C
ldrb r2, [r3]
lsls r1, r2, 26
lsrs r1, 26
adds r1, 0x1
movs r0, 0x3F
ands r1, r0
movs r0, 0x40
negs r0, r0
ands r0, r2
orrs r0, r1
strb r0, [r3]
_080945EE:
adds r0, r5, 0
adds r1, r4, 0
bl sub_809459C
lsls r0, 24
lsrs r0, 24
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_80945C4
thumb_func_start sub_8094600
sub_8094600: @ 8094600
push {r4,r5,lr}
sub sp, 0x4
adds r4, r0, 0
adds r5, r1, 0
movs r0, 0x1
bl get_go_image_anim_num
adds r3, r0, 0
lsls r3, 24
lsrs r3, 24
movs r0, 0x20
str r0, [sp]
adds r0, r4, 0
adds r1, r5, 0
movs r2, 0x1
bl sub_8094554
adds r0, r4, 0
adds r1, r5, 0
bl sub_80945C4
lsls r0, 24
lsrs r0, 24
add sp, 0x4
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_8094600
thumb_func_start sub_8094638
sub_8094638: @ 8094638
push {r4,r5,lr}
sub sp, 0x4
adds r4, r0, 0
adds r5, r1, 0
movs r0, 0x2
bl get_go_image_anim_num
adds r3, r0, 0
lsls r3, 24
lsrs r3, 24
movs r0, 0x20
str r0, [sp]
adds r0, r4, 0
adds r1, r5, 0
movs r2, 0x2
bl sub_8094554
adds r0, r4, 0
adds r1, r5, 0
bl sub_80945C4
lsls r0, 24
lsrs r0, 24
add sp, 0x4
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_8094638
thumb_func_start sub_8094670
sub_8094670: @ 8094670
push {r4,r5,lr}
sub sp, 0x4
adds r4, r0, 0
adds r5, r1, 0
movs r0, 0x3
bl get_go_image_anim_num
adds r3, r0, 0
lsls r3, 24
lsrs r3, 24
movs r0, 0x20
str r0, [sp]
adds r0, r4, 0
adds r1, r5, 0
movs r2, 0x3
bl sub_8094554
adds r0, r4, 0
adds r1, r5, 0
bl sub_80945C4
lsls r0, 24
lsrs r0, 24
add sp, 0x4
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_8094670
thumb_func_start sub_80946A8
sub_80946A8: @ 80946A8
push {r4,r5,lr}
sub sp, 0x4
adds r4, r0, 0
adds r5, r1, 0
movs r0, 0x4
bl get_go_image_anim_num
adds r3, r0, 0
lsls r3, 24
lsrs r3, 24
movs r0, 0x20
str r0, [sp]
adds r0, r4, 0
adds r1, r5, 0
movs r2, 0x4
bl sub_8094554
adds r0, r4, 0
adds r1, r5, 0
bl sub_80945C4
lsls r0, 24
lsrs r0, 24
add sp, 0x4
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_80946A8
thumb_func_start sub_80946E0
sub_80946E0: @ 80946E0
push {r4,r5,lr}
sub sp, 0x4
adds r4, r0, 0
adds r5, r1, 0
movs r0, 0x1
bl get_go_image_anim_num
adds r3, r0, 0
lsls r3, 24
lsrs r3, 24
movs r0, 0x10
str r0, [sp]
adds r0, r4, 0
adds r1, r5, 0
movs r2, 0x1
bl sub_8094554
adds r0, r4, 0
adds r1, r5, 0
bl sub_809459C
lsls r0, 24
lsrs r0, 24
add sp, 0x4
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_80946E0
thumb_func_start sub_8094718
sub_8094718: @ 8094718
push {r4,r5,lr}
sub sp, 0x4
adds r4, r0, 0
adds r5, r1, 0
movs r0, 0x2
bl get_go_image_anim_num
adds r3, r0, 0
lsls r3, 24
lsrs r3, 24
movs r0, 0x10
str r0, [sp]
adds r0, r4, 0
adds r1, r5, 0
movs r2, 0x2
bl sub_8094554
adds r0, r4, 0
adds r1, r5, 0
bl sub_809459C
lsls r0, 24
lsrs r0, 24
add sp, 0x4
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_8094718
thumb_func_start sub_8094750
sub_8094750: @ 8094750
push {r4,r5,lr}
sub sp, 0x4
adds r4, r0, 0
adds r5, r1, 0
movs r0, 0x3
bl get_go_image_anim_num
adds r3, r0, 0
lsls r3, 24
lsrs r3, 24
movs r0, 0x10
str r0, [sp]
adds r0, r4, 0
adds r1, r5, 0
movs r2, 0x3
bl sub_8094554
adds r0, r4, 0
adds r1, r5, 0
bl sub_809459C
lsls r0, 24
lsrs r0, 24
add sp, 0x4
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_8094750
thumb_func_start sub_8094788
sub_8094788: @ 8094788
push {r4,r5,lr}
sub sp, 0x4
adds r4, r0, 0
adds r5, r1, 0
movs r0, 0x4
bl get_go_image_anim_num
adds r3, r0, 0
lsls r3, 24
lsrs r3, 24
movs r0, 0x10
str r0, [sp]
adds r0, r4, 0
adds r1, r5, 0
movs r2, 0x4
bl sub_8094554
adds r0, r4, 0
adds r1, r5, 0
bl sub_809459C
lsls r0, 24
lsrs r0, 24
add sp, 0x4
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_8094788
thumb_func_start sub_80947C0
sub_80947C0: @ 80947C0
push {r4,r5,lr}
sub sp, 0x4
adds r4, r0, 0
adds r5, r1, 0
movs r0, 0x1
bl get_go_fast_image_anim_num
adds r3, r0, 0
lsls r3, 24
lsrs r3, 24
movs r0, 0x8
str r0, [sp]
adds r0, r4, 0
adds r1, r5, 0
movs r2, 0x1
bl sub_8094554
adds r0, r4, 0
adds r1, r5, 0
bl sub_809459C
lsls r0, 24
lsrs r0, 24
add sp, 0x4
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_80947C0
thumb_func_start sub_80947F8
sub_80947F8: @ 80947F8
push {r4,r5,lr}
sub sp, 0x4
adds r4, r0, 0
adds r5, r1, 0
movs r0, 0x2
bl get_go_fast_image_anim_num
adds r3, r0, 0
lsls r3, 24
lsrs r3, 24
movs r0, 0x8
str r0, [sp]
adds r0, r4, 0
adds r1, r5, 0
movs r2, 0x2
bl sub_8094554
adds r0, r4, 0
adds r1, r5, 0
bl sub_809459C
lsls r0, 24
lsrs r0, 24
add sp, 0x4
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_80947F8
thumb_func_start sub_8094830
sub_8094830: @ 8094830
push {r4,r5,lr}
sub sp, 0x4
adds r4, r0, 0
adds r5, r1, 0
movs r0, 0x3
bl get_go_fast_image_anim_num
adds r3, r0, 0
lsls r3, 24
lsrs r3, 24
movs r0, 0x8
str r0, [sp]
adds r0, r4, 0
adds r1, r5, 0
movs r2, 0x3
bl sub_8094554
adds r0, r4, 0
adds r1, r5, 0
bl sub_809459C
lsls r0, 24
lsrs r0, 24
add sp, 0x4
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_8094830
thumb_func_start sub_8094868
sub_8094868: @ 8094868
push {r4,r5,lr}
sub sp, 0x4
adds r4, r0, 0
adds r5, r1, 0
movs r0, 0x4
bl get_go_fast_image_anim_num
adds r3, r0, 0
lsls r3, 24
lsrs r3, 24
movs r0, 0x8
str r0, [sp]
adds r0, r4, 0
adds r1, r5, 0
movs r2, 0x4
bl sub_8094554
adds r0, r4, 0
adds r1, r5, 0
bl sub_809459C
lsls r0, 24
lsrs r0, 24
add sp, 0x4
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_8094868
thumb_func_start sub_80948A0
sub_80948A0: @ 80948A0
push {r4,r5,lr}
sub sp, 0x4
adds r4, r0, 0
adds r5, r1, 0
movs r0, 0x1
bl get_go_faster_image_anim_num
adds r3, r0, 0
lsls r3, 24
lsrs r3, 24
movs r0, 0x4
str r0, [sp]
adds r0, r4, 0
adds r1, r5, 0
movs r2, 0x1
bl sub_8094554
adds r0, r4, 0
adds r1, r5, 0
bl sub_809459C
lsls r0, 24
lsrs r0, 24
add sp, 0x4
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_80948A0
thumb_func_start sub_80948D8
sub_80948D8: @ 80948D8
push {r4,r5,lr}
sub sp, 0x4
adds r4, r0, 0
adds r5, r1, 0
movs r0, 0x2
bl get_go_faster_image_anim_num
adds r3, r0, 0
lsls r3, 24
lsrs r3, 24
movs r0, 0x4
str r0, [sp]
adds r0, r4, 0
adds r1, r5, 0
movs r2, 0x2
bl sub_8094554
adds r0, r4, 0
adds r1, r5, 0
bl sub_809459C
lsls r0, 24
lsrs r0, 24
add sp, 0x4
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_80948D8
thumb_func_start sub_8094910
sub_8094910: @ 8094910
push {r4,r5,lr}
sub sp, 0x4
adds r4, r0, 0
adds r5, r1, 0
movs r0, 0x3
bl get_go_faster_image_anim_num
adds r3, r0, 0
lsls r3, 24
lsrs r3, 24
movs r0, 0x4
str r0, [sp]
adds r0, r4, 0
adds r1, r5, 0
movs r2, 0x3
bl sub_8094554
adds r0, r4, 0
adds r1, r5, 0
bl sub_809459C
lsls r0, 24
lsrs r0, 24
add sp, 0x4
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_8094910
thumb_func_start sub_8094948
sub_8094948: @ 8094948
push {r4,r5,lr}
sub sp, 0x4
adds r4, r0, 0
adds r5, r1, 0
movs r0, 0x4
bl get_go_faster_image_anim_num
adds r3, r0, 0
lsls r3, 24
lsrs r3, 24
movs r0, 0x4
str r0, [sp]
adds r0, r4, 0
adds r1, r5, 0
movs r2, 0x4
bl sub_8094554
adds r0, r4, 0
adds r1, r5, 0
bl sub_809459C
lsls r0, 24
lsrs r0, 24
add sp, 0x4
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_8094948
thumb_func_start sub_8094980
sub_8094980: @ 8094980
push {r4,r5,lr}

View File

@ -4410,3 +4410,63 @@ special_anim_with_timer(sub_80943D4, 2)
special_anim_with_timer(sub_80943F4, 4)
special_anim_with_timer(sub_8094414, 8)
special_anim_with_timer(sub_8094434, 16)
an_walk_any_2_macro(sub_8094454, do_go_anim, npc_obj_ministep_stop_on_arrival, 1, 1)
an_walk_any_2_macro(sub_8094494, do_go_anim, npc_obj_ministep_stop_on_arrival, 2, 1)
an_walk_any_2_macro(sub_80944D4, do_go_anim, npc_obj_ministep_stop_on_arrival, 3, 1)
an_walk_any_2_macro(sub_8094514, do_go_anim, npc_obj_ministep_stop_on_arrival, 4, 1)
void sub_8094554(struct MapObject *mapObject, struct Sprite *sprite, u8 direction, u8 animNum, u16 duration)
{
FieldObjectSetDirection(mapObject, direction);
npc_apply_anim_looping(mapObject, sprite, animNum);
sprite->animPaused = FALSE;
sprite->data2 = 1;
sprite->data3 = duration;
}
bool8 sub_809459C(struct MapObject *mapObject, struct Sprite *sprite)
{
if (-- sprite->data3 == 0)
{
sprite->data2 = 2;
sprite->animPaused = TRUE;
return TRUE;
}
return FALSE;
}
bool8 sub_80945C4(struct MapObject *mapObject, struct Sprite *sprite)
{
if (sprite->data3 & 1)
{
sprite->animDelayCounter ++;
}
return sub_809459C(mapObject, sprite);
}
#define special_anim_with_timer_2(name, direction, images, duration, timer) \
bool8 name(struct MapObject *mapObject, struct Sprite *sprite)\
{\
u8 animId;\
animId = get_##images##_image_anim_num(direction);\
sub_8094554(mapObject, sprite, direction, animId, duration);\
return timer(mapObject, sprite);\
}
special_anim_with_timer_2(sub_8094600, DIR_SOUTH, go, 32, sub_80945C4)
special_anim_with_timer_2(sub_8094638, DIR_NORTH, go, 32, sub_80945C4)
special_anim_with_timer_2(sub_8094670, DIR_WEST, go, 32, sub_80945C4)
special_anim_with_timer_2(sub_80946A8, DIR_EAST, go, 32, sub_80945C4)
special_anim_with_timer_2(sub_80946E0, DIR_SOUTH, go, 16, sub_809459C)
special_anim_with_timer_2(sub_8094718, DIR_NORTH, go, 16, sub_809459C)
special_anim_with_timer_2(sub_8094750, DIR_WEST, go, 16, sub_809459C)
special_anim_with_timer_2(sub_8094788, DIR_EAST, go, 16, sub_809459C)
special_anim_with_timer_2(sub_80947C0, DIR_SOUTH, go_fast, 8, sub_809459C)
special_anim_with_timer_2(sub_80947F8, DIR_NORTH, go_fast, 8, sub_809459C)
special_anim_with_timer_2(sub_8094830, DIR_WEST, go_fast, 8, sub_809459C)
special_anim_with_timer_2(sub_8094868, DIR_EAST, go_fast, 8, sub_809459C)
special_anim_with_timer_2(sub_80948A0, DIR_SOUTH, go_faster, 4, sub_809459C)
special_anim_with_timer_2(sub_80948D8, DIR_NORTH, go_faster, 4, sub_809459C)
special_anim_with_timer_2(sub_8094910, DIR_WEST, go_faster, 4, sub_809459C)
special_anim_with_timer_2(sub_8094948, DIR_EAST, go_faster, 4, sub_809459C)