Identify PLAYERMOVEMENT_* constants

This commit is contained in:
Rangi 2019-11-03 14:30:33 -05:00
parent d5e1b5a628
commit 717cf3f458
3 changed files with 40 additions and 28 deletions

View File

@ -92,6 +92,17 @@ RETVAR_EXECUTE EQU (2 << 6)
const PLAYEREVENT_JOYCHANGEFACING
NUM_PLAYER_EVENTS EQU const_value
; PlayerMovement.pointers indexes (see engine/overworld/events.asm)
const_def
const PLAYERMOVEMENT_NORMAL
const PLAYERMOVEMENT_WARP
const PLAYERMOVEMENT_TURN
const PLAYERMOVEMENT_FORCE_TURN
const PLAYERMOVEMENT_FINISH
const PLAYERMOVEMENT_CONTINUE
const PLAYERMOVEMENT_EXIT_WATER
const PLAYERMOVEMENT_JUMP
; script data sizes (see macros/scripts/maps.asm)
SCENE_SCRIPT_SIZE EQU 4 ; scene_script
CALLBACK_SIZE EQU 3 ; callback

View File

@ -759,40 +759,41 @@ PlayerMovement:
ret
.pointers
dw .zero
dw .one
dw .two
dw .three
dw .four
dw .five
dw .six
dw .seven
; entries correspond to PLAYERMOVEMENT_* constants
dw .normal
dw .warp
dw .turn
dw .force_turn
dw .finish
dw .continue
dw .exit_water
dw .jump
.zero
.four
.normal:
.finish:
xor a
ld c, a
ret
.seven
.jump:
call ret_968d7 ; mobile
xor a
ld c, a
ret
.one
ld a, 5
.warp:
ld a, PLAYEREVENT_WARP
ld c, a
scf
ret
.two
ld a, 9
.turn:
ld a, PLAYEREVENT_JOYCHANGEFACING
ld c, a
scf
ret
.three
.force_turn:
; force the player to move in some direction
ld a, BANK(Script_ForcedMovement)
ld hl, Script_ForcedMovement
@ -802,8 +803,8 @@ PlayerMovement:
scf
ret
.five
.six
.continue:
.exit_water:
ld a, -1
ld c, a
and a
@ -923,13 +924,13 @@ CountStep:
ret
.hatch
ld a, 8
ld a, PLAYEREVENT_HATCH
scf
ret
; unused
.unreferenced
ld a, 7
ld a, PLAYEREVENT_WHITEOUT
scf
ret

View File

@ -120,7 +120,7 @@ DoPlayerMovement::
ld c, a
call CheckWhirlpoolTile
jr c, .not_whirlpool
ld a, 3
ld a, PLAYERMOVEMENT_FORCE_TURN
scf
ret
@ -222,7 +222,7 @@ DoPlayerMovement::
.continue_walk
ld a, STEP_WALK
call .DoStep
ld a, 5
ld a, PLAYERMOVEMENT_CONTINUE
scf
ret
@ -247,7 +247,7 @@ DoPlayerMovement::
ld a, STEP_TURN
call .DoStep
ld a, 2
ld a, PLAYERMOVEMENT_TURN
scf
ret
@ -345,7 +345,7 @@ DoPlayerMovement::
call PlayMapMusic
ld a, STEP_WALK
call .DoStep
ld a, 6
ld a, PLAYERMOVEMENT_EXIT_WATER
scf
ret
@ -374,7 +374,7 @@ DoPlayerMovement::
call PlaySFX
ld a, STEP_LEDGE
call .DoStep
ld a, 7
ld a, PLAYERMOVEMENT_JUMP
scf
ret
@ -428,11 +428,11 @@ DoPlayerMovement::
call .StandInPlace
scf
ld a, 1
ld a, PLAYERMOVEMENT_WARP
ret
.not_warp
xor a
xor a ; PLAYERMOVEMENT_NORMAL
ret
.EdgeWarps:
@ -465,7 +465,7 @@ DoPlayerMovement::
ld a, [hl]
ld [wPlayerTurningDirection], a
ld a, 4
ld a, PLAYERMOVEMENT_FINISH
ret
.Steps: