aboutsummaryrefslogtreecommitdiffstats
path: root/engine/overworld/auto_movement.asm
diff options
context:
space:
mode:
authordannye <33dannye@gmail.com>2024-09-25 00:45:00 -0500
committerdannye <33dannye@gmail.com>2024-09-25 00:45:00 -0500
commita02a98ee7ada1a658e28698484058be2796dc0df (patch)
tree945986054565bd8b5212fc755415096050d1d3a8 /engine/overworld/auto_movement.asm
parentUse long option flags for rgbgfx, same as tools/gfx (diff)
parentUse `const_skip` (diff)
downloadpokeyellow-a02a98ee7ada1a658e28698484058be2796dc0df.tar.gz
pokeyellow-a02a98ee7ada1a658e28698484058be2796dc0df.tar.xz
pokeyellow-a02a98ee7ada1a658e28698484058be2796dc0df.zip
Merge branch 'master' of https://github.com/pret/pokered
Diffstat (limited to 'engine/overworld/auto_movement.asm')
-rw-r--r--engine/overworld/auto_movement.asm80
1 files changed, 40 insertions, 40 deletions
diff --git a/engine/overworld/auto_movement.asm b/engine/overworld/auto_movement.asm
index 39c1f380..8174b273 100644
--- a/engine/overworld/auto_movement.asm
+++ b/engine/overworld/auto_movement.asm
@@ -1,12 +1,12 @@
PlayerStepOutFromDoor::
- ld hl, wd730
- res 1, [hl]
+ ld hl, wStatusFlags5 ; should this be wMovementFlags?
+ res BIT_EXITING_DOOR, [hl]
call IsPlayerStandingOnDoorTile
jr nc, .notStandingOnDoor
ld a, SELECT | START | D_RIGHT | D_LEFT | D_UP | D_DOWN
ld [wJoyIgnore], a
- ld hl, wd736
- set 1, [hl]
+ ld hl, wMovementFlags
+ set BIT_EXITING_DOOR, [hl]
ld a, $1
ld [wSimulatedJoypadStatesIndex], a
ld a, D_DOWN
@@ -17,29 +17,29 @@ PlayerStepOutFromDoor::
ret
.notStandingOnDoor
xor a
- ld [wUnusedCD3A], a
+ ld [wUnusedOverrideSimulatedJoypadStatesIndex], a
ld [wSimulatedJoypadStatesIndex], a
ld [wSimulatedJoypadStatesEnd], a
- ld hl, wd736
- res 0, [hl]
- res 1, [hl]
- ld hl, wd730
- res 7, [hl]
+ ld hl, wMovementFlags
+ res BIT_STANDING_ON_DOOR, [hl]
+ res BIT_EXITING_DOOR, [hl]
+ ld hl, wStatusFlags5
+ res BIT_SCRIPTED_MOVEMENT_STATE, [hl]
ret
_EndNPCMovementScript::
- ld hl, wd730
- res 7, [hl]
- ld hl, wd72e
- res 7, [hl]
- ld hl, wd736
- res 0, [hl]
- res 1, [hl]
+ ld hl, wStatusFlags5
+ res BIT_SCRIPTED_MOVEMENT_STATE, [hl]
+ ld hl, wStatusFlags4
+ res BIT_INIT_SCRIPTED_MOVEMENT, [hl]
+ ld hl, wMovementFlags
+ res BIT_STANDING_ON_DOOR, [hl]
+ res BIT_EXITING_DOOR, [hl]
xor a
ld [wNPCMovementScriptSpriteOffset], a
ld [wNPCMovementScriptFunctionNum], a
ld [wNPCMovementScriptPointerTableNum], a
- ld [wUnusedCD3A], a
+ ld [wUnusedOverrideSimulatedJoypadStatesIndex], a
ld [wSimulatedJoypadStatesIndex], a
ld [wSimulatedJoypadStatesEnd], a
ret
@@ -83,15 +83,15 @@ PalletMovementScript_OakMoveLeft:
ld c, a
ld a, MUSIC_MUSEUM_GUY
call PlayMusic
- ld hl, wFlags_D733
- set 1, [hl]
+ ld hl, wStatusFlags7
+ set BIT_NO_MAP_MUSIC, [hl]
ld a, SELECT | START | D_RIGHT | D_LEFT | D_UP | D_DOWN
ld [wJoyIgnore], a
ret
PalletMovementScript_PlayerMoveLeft:
- ld a, [wd730]
- bit 0, a ; is an NPC being moved by a script?
+ ld a, [wStatusFlags5]
+ bit BIT_SCRIPTED_NPC_MOVEMENT, a
ret nz ; return if Oak is still moving
ld a, [wNumStepsToTake]
ld [wSimulatedJoypadStatesIndex], a
@@ -123,10 +123,10 @@ PalletMovementScript_WalkToLab:
ld hl, wNPCMovementDirections2
ld de, RLEList_ProfOakWalkToLab
call DecodeRLEList
- ld hl, wd72e
- res 7, [hl]
- ld hl, wd730
- set 7, [hl]
+ ld hl, wStatusFlags4
+ res BIT_INIT_SCRIPTED_MOVEMENT, [hl]
+ ld hl, wStatusFlags5
+ set BIT_SCRIPTED_MOVEMENT_STATE, [hl]
ld a, $4
ld [wNPCMovementScriptFunctionNum], a
ret
@@ -156,10 +156,10 @@ PalletMovementScript_Done:
ld a, HS_PALLET_TOWN_OAK
ld [wMissableObjectIndex], a
predef HideObject
- ld hl, wd730
- res 7, [hl]
- ld hl, wd72e
- res 7, [hl]
+ ld hl, wStatusFlags5
+ res BIT_SCRIPTED_MOVEMENT_STATE, [hl]
+ ld hl, wStatusFlags4
+ res BIT_INIT_SCRIPTED_MOVEMENT, [hl]
jp EndNPCMovementScript
PewterMuseumGuyMovementScriptPointerTable::
@@ -186,8 +186,8 @@ PewterMovementScript_WalkToMuseum:
ld hl, wNPCMovementDirections2
ld de, RLEList_PewterMuseumGuy
call DecodeRLEList
- ld hl, wd72e
- res 7, [hl]
+ ld hl, wStatusFlags4
+ res BIT_INIT_SCRIPTED_MOVEMENT, [hl]
ld a, $1
ld [wNPCMovementScriptFunctionNum], a
ret
@@ -210,10 +210,10 @@ PewterMovementScript_Done:
ld a, [wSimulatedJoypadStatesIndex]
and a
ret nz
- ld hl, wd730
- res 7, [hl]
- ld hl, wd72e
- res 7, [hl]
+ ld hl, wStatusFlags5
+ res BIT_SCRIPTED_MOVEMENT_STATE, [hl]
+ ld hl, wStatusFlags4
+ res BIT_INIT_SCRIPTED_MOVEMENT, [hl]
jp EndNPCMovementScript
PewterGymGuyMovementScriptPointerTable::
@@ -241,10 +241,10 @@ PewterMovementScript_WalkToGym:
ld hl, wNPCMovementDirections2
ld de, RLEList_PewterGymGuy
call DecodeRLEList
- ld hl, wd72e
- res 7, [hl]
- ld hl, wd730
- set 7, [hl]
+ ld hl, wStatusFlags4
+ res BIT_INIT_SCRIPTED_MOVEMENT, [hl]
+ ld hl, wStatusFlags5
+ set BIT_SCRIPTED_MOVEMENT_STATE, [hl]
ld a, $1
ld [wNPCMovementScriptFunctionNum], a
ret