Unify step_sleep macro

This commit is contained in:
pikalaxalt 2016-05-14 12:28:00 -04:00
parent 1a84ca4e55
commit 3108c9fa6a
13 changed files with 49 additions and 84 deletions

View File

@ -1876,8 +1876,8 @@ Function5000: ; unscripted?
ld a, [wPlayerNextMovement]
ld hl, wPlayerMovement
ld [hl], a
; load [wPlayerNextMovement] with movement_step_sleep_1
ld a, movement_step_sleep_1
; load [wPlayerNextMovement] with movement_step_sleep
ld a, movement_step_sleep
ld [wPlayerNextMovement], a
; recover the previous value of [wPlayerNextMovement]
ld a, [hl]
@ -1987,7 +1987,7 @@ ApplyMovementToFollower: ; 54b8
cp d
ret nz
ld a, e
cp movement_step_sleep_1
cp movement_step_sleep
ret z
cp movement_step_end
ret z
@ -2034,7 +2034,7 @@ GetFollowerNextMovementByte: ; 54e6
.done
call .CancelFollowIfLeaderMissing
ret c
ld a, movement_step_sleep_1
ld a, movement_step_sleep
ret
.CancelFollowIfLeaderMissing:
@ -2505,7 +2505,7 @@ HandleNPCStep:: ; 576a
; 579d
RefreshPlayerSprite: ; 579d
ld a, movement_step_sleep_1
ld a, movement_step_sleep
ld [wPlayerNextMovement], a
ld [wPlayerMovement], a
xor a

View File

@ -55,8 +55,8 @@ MovementPointers: ; 5075
dw Movement_fast_jump_step_up ; 35
dw Movement_fast_jump_step_left ; 36
dw Movement_fast_jump_step_right ; 37
dw Movement_remove_sliding ; 38
dw Movement_set_sliding ; 39
dw Movement_remove_sliding ; 38
dw Movement_set_sliding ; 39
dw Movement_remove_fixed_facing ; 3a
dw Movement_fix_facing ; 3b
dw Movement_show_person ; 3c
@ -85,10 +85,10 @@ MovementPointers: ; 5075
dw Movement_hide_emote ; 53
dw Movement_show_emote ; 54
dw Movement_step_shake ; 55
dw Movement_tree_shake ; 56
dw Movement_tree_shake ; 56
dw Movement_rock_smash ; 57
dw Movement_return_dig ; 58
dw Movement_skyfall_top ; 59
dw Movement_skyfall_top ; 59
; 5129

View File

@ -1,7 +1,7 @@
DoPlayerMovement:: ; 80000
call .GetDPad
ld a, movement_step_sleep_1
ld a, movement_step_sleep
ld [MovementAnimation], a
xor a
ld [wd041], a
@ -528,7 +528,7 @@ DoPlayerMovement:: ; 80000
.StandInPlace: ; 802b3
ld a, 0
ld [wd04e], a
ld a, movement_step_sleep_1
ld a, movement_step_sleep
ld [MovementAnimation], a
xor a
ret
@ -835,7 +835,7 @@ CheckStandingOnIce:: ; 80404
Function80422:: ; 80422
ld hl, wPlayerNextMovement
ld a, movement_step_sleep_1
ld a, movement_step_sleep
cp [hl]
ret z

View File

@ -516,7 +516,7 @@ CopyTempObjectToObjectStruct: ; 8286
TrainerWalkToPlayer: ; 831e
ld a, [hLastTalked]
call InitMovementBuffer
ld a, movement_step_sleep_1
ld a, movement_step_sleep
call AppendToMovementBuffer
ld a, [wd03f]
dec a

View File

@ -1427,12 +1427,12 @@ ShowEmoteScript: ; 973b6
.Show:
show_emote
step_sleep_1
step_sleep 1
step_end
.Hide:
hide_emote
step_sleep_1
step_sleep 1
step_end
; 973c7

View File

@ -1632,7 +1632,7 @@ Script_GotABite: ; 0xd035
fish_got_bite
fish_got_bite
fish_got_bite
step_sleep_1
step_sleep 1
show_emote
step_end

View File

@ -311,51 +311,16 @@ hide_person: macro
db movement_hide_person ; $3d
endm
enum movement_step_sleep_1
step_sleep_1: macro
db movement_step_sleep_1 ; $3e
endm
enum movement_step_sleep_2
step_sleep_2: macro
db movement_step_sleep_2 ; $3f
endm
enum movement_step_sleep_3
step_sleep_3: macro
db movement_step_sleep_3 ; $40
endm
enum movement_step_sleep_4
step_sleep_4: macro
db movement_step_sleep_4 ; $41
endm
enum movement_step_sleep_5
step_sleep_5: macro
db movement_step_sleep_5 ; $42
endm
enum movement_step_sleep_6
step_sleep_6: macro
db movement_step_sleep_6 ; $43
endm
enum movement_step_sleep_7
step_sleep_7: macro
db movement_step_sleep_7 ; $44
endm
enum movement_step_sleep_8
step_sleep_8: macro
db movement_step_sleep_8 ; $45
endm
enum movement_step_sleep
step_sleep: macro
db movement_step_sleep ; $46
db \1 ; duration
endm
if \1 <= 8
db movement_step_sleep + \1 - 1
else
db movement_step_sleep + 8, \1
endc
endm
__enum__ SET $47
enum movement_step_end
step_end: macro

View File

@ -184,8 +184,8 @@ MovementData_0x1884eb:
jump_step_up
db $38 ; movement
remove_fixed_facing
step_sleep_8
step_sleep_8
step_sleep 8
step_sleep 8
step_down
step_down
step_end

View File

@ -578,17 +578,17 @@ MovementData_Farfetched_Pos5_Pos4_Up:
MovementData_Farfetched_Pos5_Pos4_Right:
big_step_right
turn_head_up
step_sleep_1
step_sleep 1
turn_head_down
step_sleep_1
step_sleep 1
turn_head_up
step_sleep_1
step_sleep 1
big_step_down
big_step_down
fix_facing
jump_step_up
step_sleep_8
step_sleep_8
step_sleep 8
step_sleep 8
remove_fixed_facing
big_step_up
big_step_up
@ -679,8 +679,8 @@ MovementData_Farfetched_Pos9_Pos10:
big_step_left
fix_facing
jump_step_right
step_sleep_8
step_sleep_8
step_sleep 8
step_sleep 8
remove_fixed_facing
big_step_left
big_step_left
@ -709,8 +709,8 @@ MovementData_Farfetched_Pos9_Pos8_Down:
big_step_left
fix_facing
jump_step_right
step_sleep_8
step_sleep_8
step_sleep 8
step_sleep 8
remove_fixed_facing
big_step_right
big_step_right

View File

@ -136,8 +136,8 @@ MovementData_0x60c68:
slow_step_right
slow_step_up
slow_step_up
step_sleep_8
step_sleep_8
step_sleep 8
step_sleep 8
step_end
MovementData_0x60c70:
@ -158,7 +158,7 @@ MovementData_0x60c79:
slow_step_up
slow_step_up
slow_step_up
step_sleep_8
step_sleep 8
step_end
UnknownText_0x60c81:

View File

@ -132,15 +132,15 @@ KurtSlowpokeWellVictoryMovementData:
step_left
step_left
step_up
step_sleep_8
step_sleep_8
step_sleep_8
step_sleep 8
step_sleep 8
step_sleep 8
step_left
step_up
step_up
step_sleep_8
step_sleep_8
step_sleep_8
step_sleep 8
step_sleep 8
step_sleep 8
turn_head_left
step_end

View File

@ -465,17 +465,17 @@ MovementData_0x6d254:
step_end
MovementData_0x6d258:
step_sleep_8
step_sleep 8
step_left
step_left
turn_head_up
step_sleep_8
step_sleep 8
step_right
step_right
step_right
step_right
turn_head_up
step_sleep_8
step_sleep 8
step_left
step_left
turn_head_down

View File

@ -270,8 +270,8 @@ MovementData_0x6e147:
fix_facing
fast_jump_step_left
remove_fixed_facing
step_sleep_8
step_sleep_8
step_sleep 8
step_sleep 8
slow_step_right
big_step_down
big_step_down