summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xengine/hidden_object_functions14.asm2
-rwxr-xr-xengine/hidden_object_functions17.asm2
-rwxr-xr-xengine/hidden_object_functions18.asm6
-rwxr-xr-xengine/hidden_object_functions3.asm2
-rwxr-xr-xengine/hidden_object_functions7.asm6
-rw-r--r--engine/menu/bills_pc.asm6
-rwxr-xr-xengine/overworld/card_key.asm2
-rw-r--r--engine/overworld/check_player_state.asm4
-rwxr-xr-xengine/overworld/cut.asm2
-rw-r--r--engine/overworld/get_coords_tile_in_front_of_player.asm4
-rwxr-xr-xengine/overworld/hidden_objects.asm2
-rwxr-xr-xengine/overworld/ledges.asm2
-rwxr-xr-xengine/overworld/map_sprites.asm14
-rw-r--r--engine/overworld/movement.asm4
-rwxr-xr-xengine/overworld/ssanne.asm2
-rw-r--r--engine/overworld/try_pushing_boulder.asm2
-rwxr-xr-xengine/pikachu_emotions.asm8
-rwxr-xr-xengine/pikachu_follow.asm218
-rwxr-xr-xengine/pikachu_movement.asm42
-rw-r--r--home/overworld.asm2
-rwxr-xr-xhome/pikachu.asm4
-rw-r--r--macros.asm2
-rw-r--r--replace.sh2
-rwxr-xr-xscripts/billshouse.asm8
-rwxr-xr-xscripts/cinnabarisland.asm2
-rwxr-xr-xscripts/copycatshouse2f.asm2
-rwxr-xr-xscripts/mansion1.asm2
-rwxr-xr-xscripts/mansion2.asm2
-rwxr-xr-xscripts/mansion3.asm2
-rwxr-xr-xscripts/mansion4.asm2
-rwxr-xr-xscripts/oakslab.asm4
-rwxr-xr-xscripts/pallettown.asm2
-rwxr-xr-xscripts/pokemontower7.asm2
-rwxr-xr-xscripts/redshouse1f2.asm2
-rwxr-xr-xscripts/route11gateupstairs.asm2
-rwxr-xr-xscripts/route12gateupstairs.asm2
-rwxr-xr-xscripts/route22.asm2
-rwxr-xr-xscripts/route22gate.asm2
-rwxr-xr-xscripts/route23.asm2
-rwxr-xr-xscripts/safarizoneentrance.asm6
-rwxr-xr-xscripts/vermilioncity.asm4
-rwxr-xr-xscripts/viridiancity.asm6
-rwxr-xr-xwram.asm115
43 files changed, 252 insertions, 259 deletions
diff --git a/engine/hidden_object_functions14.asm b/engine/hidden_object_functions14.asm
index 2781e182..4bb76433 100755
--- a/engine/hidden_object_functions14.asm
+++ b/engine/hidden_object_functions14.asm
@@ -89,7 +89,7 @@ FightingDojoText:
db "@"
PrintIndigoPlateauHQText:
- ld a, [wPlayerFacingDirection]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
ret nz
call EnableAutoTextBoxDrawing
diff --git a/engine/hidden_object_functions17.asm b/engine/hidden_object_functions17.asm
index 8269bbed..6019eb4a 100755
--- a/engine/hidden_object_functions17.asm
+++ b/engine/hidden_object_functions17.asm
@@ -14,7 +14,7 @@ RedBedroomPCText:
TX_PLAYERS_PC
Route15GateLeftBinoculars:
- ld a, [wPlayerFacingDirection]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
ret nz
call EnableAutoTextBoxDrawing
diff --git a/engine/hidden_object_functions18.asm b/engine/hidden_object_functions18.asm
index 1bb31e00..8d468988 100755
--- a/engine/hidden_object_functions18.asm
+++ b/engine/hidden_object_functions18.asm
@@ -3,7 +3,7 @@ GymStatues:
; if in a gym and don’t have the corresponding badge, a = GymStatueText1_id and jp PrintPredefTextID
; else ret
call EnableAutoTextBoxDrawing
- ld a, [wPlayerFacingDirection]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
ret nz
ld hl, .BadgeFlags
@@ -64,7 +64,7 @@ PrintBenchGuyText:
.match
ld a, [hli]
ld b, a
- ld a, [wPlayerFacingDirection]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp b
jr nz, .loop ; player isn't facing left at the bench guy
ld a, [hl]
@@ -192,7 +192,7 @@ BookcaseText:
db "@"
OpenPokemonCenterPC:
- ld a, [wPlayerFacingDirection]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP ; check to see if player is facing up
ret nz
call EnableAutoTextBoxDrawing
diff --git a/engine/hidden_object_functions3.asm b/engine/hidden_object_functions3.asm
index 9456e76f..03836917 100755
--- a/engine/hidden_object_functions3.asm
+++ b/engine/hidden_object_functions3.asm
@@ -1,6 +1,6 @@
; prints text for bookshelves in buildings without sign events
PrintBookshelfText:
- ld a, [wPlayerFacingDirection] ; player's sprite facing direction
+ ld a, [wSpritePlayerStateData1FacingDirection] ; player's sprite facing direction
cp SPRITE_FACING_UP
jr nz, .noMatch
; facing up
diff --git a/engine/hidden_object_functions7.asm b/engine/hidden_object_functions7.asm
index a8676fed..9d27ad20 100755
--- a/engine/hidden_object_functions7.asm
+++ b/engine/hidden_object_functions7.asm
@@ -116,7 +116,7 @@ GameOverText:
db "@"
PrintCinnabarQuiz:
- ld a, [wPlayerFacingDirection]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
ret nz
call EnableAutoTextBoxDrawing
@@ -367,7 +367,7 @@ MagazinesText:
BillsHousePC:
call EnableAutoTextBoxDrawing
- ld a, [wPlayerFacingDirection]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
ret nz
CheckEvent EVENT_LEFT_BILLS_HOUSE_AFTER_HELPING
@@ -498,7 +498,7 @@ BillsHousePokemonListText2:
db "@"
DisplayOakLabEmailText:
- ld a, [wPlayerFacingDirection]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
ret nz
call EnableAutoTextBoxDrawing
diff --git a/engine/menu/bills_pc.asm b/engine/menu/bills_pc.asm
index cbeffcf0..2f7dcaa9 100644
--- a/engine/menu/bills_pc.asm
+++ b/engine/menu/bills_pc.asm
@@ -553,7 +553,7 @@ CableClubLeftGameboy::
ld a, [hSerialConnectionStatus]
cp USING_EXTERNAL_CLOCK
ret z
- ld a, [wPlayerFacingDirection] ; player's sprite facing direction
+ ld a, [wSpritePlayerStateData1FacingDirection] ; player's sprite facing direction
cp SPRITE_FACING_RIGHT
ret nz
ld a, [wCurMap]
@@ -570,7 +570,7 @@ CableClubRightGameboy::
ld a, [hSerialConnectionStatus]
cp USING_INTERNAL_CLOCK
ret z
- ld a, [wPlayerFacingDirection] ; player's sprite facing direction
+ ld a, [wSpritePlayerStateData1FacingDirection] ; player's sprite facing direction
cp SPRITE_FACING_LEFT
ret nz
ld a, [wCurMap]
@@ -587,7 +587,7 @@ JustAMomentText::
TX_FAR _JustAMomentText
db "@"
- ld a, [wPlayerFacingDirection] ; player's sprite facing direction
+ ld a, [wSpritePlayerStateData1FacingDirection] ; player's sprite facing direction
cp SPRITE_FACING_UP
ret nz
call EnableAutoTextBoxDrawing
diff --git a/engine/overworld/card_key.asm b/engine/overworld/card_key.asm
index e1fc9160..9026960c 100755
--- a/engine/overworld/card_key.asm
+++ b/engine/overworld/card_key.asm
@@ -89,7 +89,7 @@ GetCoordsInFrontOfPlayer:
ld d, a
ld a, [wXCoord]
ld e, a
- ld a, [wPlayerFacingDirection] ; player's sprite facing direction
+ ld a, [wSpritePlayerStateData1FacingDirection] ; player's sprite facing direction
and a
jr nz, .notFacingDown
; facing down
diff --git a/engine/overworld/check_player_state.asm b/engine/overworld/check_player_state.asm
index b3eab447..2fcb5b9d 100644
--- a/engine/overworld/check_player_state.asm
+++ b/engine/overworld/check_player_state.asm
@@ -90,7 +90,7 @@ IsPlayerFacingEdgeOfMap:
push hl
push de
push bc
- ld a, [wPlayerFacingDirection] ; player sprite's facing direction
+ ld a, [wSpritePlayerStateData1FacingDirection] ; player sprite's facing direction
srl a
ld c, a
ld b, $0
@@ -160,7 +160,7 @@ IsWarpTileInFrontOfPlayer:
ld a, [wCurMap]
cp SS_ANNE_5
jr z, .ssAnne5
- ld a, [wPlayerFacingDirection] ; player sprite's facing direction
+ ld a, [wSpritePlayerStateData1FacingDirection] ; player sprite's facing direction
srl a
ld c, a
ld b, 0
diff --git a/engine/overworld/cut.asm b/engine/overworld/cut.asm
index 462e3e8e..bc7d092d 100755
--- a/engine/overworld/cut.asm
+++ b/engine/overworld/cut.asm
@@ -188,7 +188,7 @@ ReplaceTreeTileBlock:
ld h, [hl]
ld l, a
add hl, bc
- ld a, [wPlayerFacingDirection] ; player sprite's facing direction
+ ld a, [wSpritePlayerStateData1FacingDirection] ; player sprite's facing direction
and a
jr z, .down
cp SPRITE_FACING_UP
diff --git a/engine/overworld/get_coords_tile_in_front_of_player.asm b/engine/overworld/get_coords_tile_in_front_of_player.asm
index e8bbc660..67f154bc 100644
--- a/engine/overworld/get_coords_tile_in_front_of_player.asm
+++ b/engine/overworld/get_coords_tile_in_front_of_player.asm
@@ -6,7 +6,7 @@ _GetTileAndCoordsInFrontOfPlayer:
ld d, a
ld a, [wXCoord]
ld e, a
- ld a, [wPlayerFacingDirection] ; player's sprite facing direction
+ ld a, [wSpritePlayerStateData1FacingDirection] ; player's sprite facing direction
and a ; cp SPRITE_FACING_DOWN
jr nz, .notFacingDown
; facing down
@@ -45,7 +45,7 @@ GetTileTwoStepsInFrontOfPlayer:
ld a, [hli]
ld d, a
ld e, [hl]
- ld a, [wPlayerFacingDirection] ; player's sprite facing direction
+ ld a, [wSpritePlayerStateData1FacingDirection] ; player's sprite facing direction
and a ; cp SPRITE_FACING_DOWN
jr nz, .notFacingDown
; facing down
diff --git a/engine/overworld/hidden_objects.asm b/engine/overworld/hidden_objects.asm
index 9a81dcfc..66815b60 100755
--- a/engine/overworld/hidden_objects.asm
+++ b/engine/overworld/hidden_objects.asm
@@ -61,7 +61,7 @@ CheckForHiddenObject:
; checks if the coordinates in front of the player's sprite match Y in b and X in c
; [hCoordsInFrontOfPlayerMatch] = $00 if they match, $ff if they don't match
CheckIfCoordsInFrontOfPlayerMatch:
- ld a, [wPlayerFacingDirection] ; player's sprite facing direction
+ ld a, [wSpritePlayerStateData1FacingDirection] ; player's sprite facing direction
cp SPRITE_FACING_UP
jr z, .facingUp
cp SPRITE_FACING_LEFT
diff --git a/engine/overworld/ledges.asm b/engine/overworld/ledges.asm
index e7874637..a44ddf8b 100755
--- a/engine/overworld/ledges.asm
+++ b/engine/overworld/ledges.asm
@@ -6,7 +6,7 @@ HandleLedges:
and a ; OVERWORLD
ret nz
predef GetTileAndCoordsInFrontOfPlayer
- ld a, [wPlayerFacingDirection]
+ ld a, [wSpritePlayerStateData1FacingDirection]
ld b, a
aCoord 8, 9
ld c, a
diff --git a/engine/overworld/map_sprites.asm b/engine/overworld/map_sprites.asm
index 32d3d47b..1a877b4a 100755
--- a/engine/overworld/map_sprites.asm
+++ b/engine/overworld/map_sprites.asm
@@ -64,7 +64,7 @@ LoadSpriteSetFromMapHeader:
call FillMemory
ld a, SPRITE_PIKACHU ; load Pikachu separately
ld [wSpriteSet], a
- ld hl, wSprite01SpriteStateData1
+ ld hl, wSprite01StateData1
ld a, 14
.storeVRAMSlotsLoop
push af
@@ -86,7 +86,7 @@ LoadSpriteSetFromMapHeader:
ld b, 9
call CheckIfPictureIDAlreadyLoaded
.continue
- ld de, wSprite02SpriteStateData1 - wSprite01SpriteStateData1
+ ld de, wSprite02StateData1 - wSprite01StateData1
add hl, de
pop af
dec a
@@ -251,11 +251,11 @@ ReadSpriteSheetData:
Func_14150:
ld a, $1
- ld [wPlayerSpriteImageBaseOffset], a ; vram slot for player
+ ld [wSpritePlayerStateData2ImageBaseOffset], a ; vram slot for player
ld a, $2
- ld [wPikachuSpriteImageBaseOffset], a ; vram slot for Pikachu
+ ld [wSpritePikachuStateData2ImageBaseOffset], a ; vram slot for Pikachu
ld a, $e
- ld hl, wSprite01SpriteStateData1
+ ld hl, wSprite01StateData1
.loop
ld [hVRAMSlot], a ; store current sprite set slot as a counter
ld a, [hl] ; $c1x0 (picture ID)
@@ -263,12 +263,12 @@ Func_14150:
jr z, .spriteUnused
call Func_14179
push hl
- ld de, (wPlayerSpriteImageBaseOffset) - (wSpriteStateData1) ; $10e
+ ld de, (wSpritePlayerStateData2ImageBaseOffset) - (wSpriteStateData1) ; $10e
add hl, de ; get $c2xe (sprite image base offset)
ld [hl], a ; write offset
pop hl
.spriteUnused
- ld de, wSprite02SpriteStateData1 - wSprite01SpriteStateData1
+ ld de, wSprite02StateData1 - wSprite01StateData1
add hl, de
ld a, [hVRAMSlot]
dec a
diff --git a/engine/overworld/movement.asm b/engine/overworld/movement.asm
index ad4515ff..cc4a818f 100644
--- a/engine/overworld/movement.asm
+++ b/engine/overworld/movement.asm
@@ -53,7 +53,7 @@ UpdatePlayerSprite:
ld a, SPRITE_FACING_RIGHT
jr .next
.next
- ld [wPlayerFacingDirection], a ; facing direction
+ ld [wSpritePlayerStateData1FacingDirection], a ; facing direction
ld a, [wFontLoaded]
bit 0, a
jr z, .moving
@@ -89,7 +89,7 @@ UpdatePlayerSprite:
Func_4e32:
ld a, [wSpriteStateData1 + 8]
ld b, a
- ld a, [wPlayerFacingDirection]
+ ld a, [wSpritePlayerStateData1FacingDirection]
add b
ld [wSpriteStateData1 + 2], a
ret
diff --git a/engine/overworld/ssanne.asm b/engine/overworld/ssanne.asm
index dc4ad130..cf3b1284 100755
--- a/engine/overworld/ssanne.asm
+++ b/engine/overworld/ssanne.asm
@@ -32,7 +32,7 @@ AnimateBoulderDust:
jp LoadPlayerSpriteGraphics
GetMoveBoulderDustFunctionPointer:
- ld a, [wPlayerFacingDirection] ; player's sprite facing direction
+ ld a, [wSpritePlayerStateData1FacingDirection] ; player's sprite facing direction
ld hl, MoveBoulderDustFunctionPointerTable
ld c, a
ld b, $0
diff --git a/engine/overworld/try_pushing_boulder.asm b/engine/overworld/try_pushing_boulder.asm
index a00790b9..8a385345 100644
--- a/engine/overworld/try_pushing_boulder.asm
+++ b/engine/overworld/try_pushing_boulder.asm
@@ -38,7 +38,7 @@ Func_f0a7:
jp nz, ResetBoulderPushFlags
ld a, [hJoyHeld]
ld b, a
- ld a, [wPlayerFacingDirection] ; player's sprite facing direction
+ ld a, [wSpritePlayerStateData1FacingDirection] ; player's sprite facing direction
cp SPRITE_FACING_UP
jr z, .pushBoulderUp
cp SPRITE_FACING_LEFT
diff --git a/engine/pikachu_emotions.asm b/engine/pikachu_emotions.asm
index 8702bc3f..b3b64970 100755
--- a/engine/pikachu_emotions.asm
+++ b/engine/pikachu_emotions.asm
@@ -174,9 +174,9 @@ StarterPikachuEmotionCommand_9:
ret
StarterPikachuEmotionCommand_turnawayfromplayer:
- ld a, [wPlayerFacingDirection]
+ ld a, [wSpritePlayerStateData1FacingDirection]
xor $4
- ld [wPikachuFacingDirection], a
+ ld [wSpritePikachuStateData1FacingDirection], a
ret
DeletedFunction_fcffb:
@@ -370,9 +370,9 @@ PikachuWalksToNurseJoy:
ret
.GetMovementData:
- ld a, [wPikachuMapY]
+ ld a, [wSpritePikachuStateData2MapY]
ld e, a
- ld a, [wPikachuMapX]
+ ld a, [wSpritePikachuStateData2MapX]
ld d, a
ld a, [wYCoord]
add 4
diff --git a/engine/pikachu_follow.asm b/engine/pikachu_follow.asm
index c0b20d9d..6092eabe 100755
--- a/engine/pikachu_follow.asm
+++ b/engine/pikachu_follow.asm
@@ -26,7 +26,7 @@ SchedulePikachuSpawnForAfterText::
call EnablePikachuFollowingPlayer
call ClearPikachuSpriteStateData
ld a, $ff
- ld [wPikachuSpriteImageIdx], a
+ ld [wSpritePikachuStateData1ImageIndex], a
call ClearPikachuFollowCommandBuffer
call CalculatePikachuFacingDirection
ret
@@ -35,14 +35,14 @@ SchedulePikachuSpawnForAfterText::
call CalculatePikachuPlacementCoords
xor a
ld [wPikachuSpawnState], a
- ld a, [wPlayerFacingDirection]
- ld [wPikachuFacingDirection], a
+ ld a, [wSpritePlayerStateData1FacingDirection]
+ ld [wSpritePikachuStateData1FacingDirection], a
ret
ClearPikachuSpriteStateData::
- ld hl, wPikachuPictureID
+ ld hl, wSpritePikachuStateData1PictureID
call .clear
- ld hl, wPikachuSpriteStateData2
+ ld hl, wSpritePikachuStateData2
.clear
ld bc, $10
xor a
@@ -57,7 +57,7 @@ CalculatePikachuSpawnCoordsAndFacing::
ret
CalculatePikachuPlacementCoords::
- ld bc, wPikachuPictureID
+ ld bc, wSpritePikachuStateData1PictureID
ld a, [wYCoord]
add $4
ld e, a
@@ -84,7 +84,7 @@ CalculatePikachuPlacementCoords::
jr .right_of_player
.check_player_facing
- ld a, [wPlayerFacingDirection]
+ ld a, [wSpritePlayerStateData1FacingDirection]
and a ; SPRITE_FACING_DOWN
jr z, .below_player
cp SPRITE_FACING_UP
@@ -94,7 +94,7 @@ CalculatePikachuPlacementCoords::
cp SPRITE_FACING_RIGHT
jr z, .right_of_player
.check_player_facing2
- ld a, [wPlayerFacingDirection]
+ ld a, [wSpritePlayerStateData1FacingDirection]
and a
jr nz, .check_up
dec e
@@ -132,7 +132,7 @@ CalculatePikachuPlacementCoords::
dec e
jr .load_coords ; useless jr
.load_coords
- ld hl, wPlayerMapY - wPlayerSpriteStateData1
+ ld hl, wSpritePlayerStateData2MapY - wSpritePlayerStateData1
add hl, bc
ld [hl], e
inc hl
@@ -147,9 +147,9 @@ CalculatePikachuPlacementCoords::
CalculatePikachuFacingDirection::
ld a, $49
- ld [wPikachuPictureID], a
+ ld [wSpritePikachuStateData1PictureID], a
ld a, $ff
- ld [wPikachuSpriteImageIdx], a
+ ld [wSpritePikachuStateData1ImageIndex], a
ld a, [wPikachuSpawnState]
and a
jr z, .copy_player_facing
@@ -167,19 +167,19 @@ CalculatePikachuFacingDirection::
ret
.copy_player_facing
- ld a, [wPlayerFacingDirection]
- ld [wPikachuFacingDirection], a
+ ld a, [wSpritePlayerStateData1FacingDirection]
+ ld [wSpritePikachuStateData1FacingDirection], a
ret
.force_facing_down
ld a, SPRITE_FACING_DOWN
- ld [wPikachuFacingDirection], a
+ ld [wSpritePikachuStateData1FacingDirection], a
ret
.face_the_other_way
- ld a, [wPlayerFacingDirection]
+ ld a, [wSpritePlayerStateData1FacingDirection]
xor $4
- ld [wPikachuFacingDirection], a
+ ld [wSpritePikachuStateData1FacingDirection], a
ret
CalculatePikachuSpawnState1::
@@ -200,14 +200,14 @@ CalculatePikachuSpawnState1::
ld hl, Pointer_fc653
call Pikachu_IsInArray
jr nc, .not_map_list_2
- ld a, [wPlayerFacingDirection]
+ ld a, [wSpritePlayerStateData1FacingDirection]
and a
jr nz, .not_map_list_2
ld a, $3
jr .load
.route_22_gate
- ld a, [wPlayerFacingDirection]
+ ld a, [wSpritePlayerStateData1FacingDirection]
and a
jr z, .rock_tunnel_1
jr .not_map_list_2
@@ -267,13 +267,13 @@ CalculatePikachuSpawnState2::
jr .not_in_array
.viridian_forest_exit
- ld a, [wPlayerFacingDirection]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
jr z, .in_array
jr .not_in_array
.viridian_forest_entrance
- ld a, [wPlayerFacingDirection]
+ ld a, [wSpritePlayerStateData1FacingDirection]
and a ; SPRITE_FACING_DOWN
jr z, .not_in_array
jr .in_array
@@ -311,13 +311,13 @@ CalculatePikachuSpawnState3::
jr .asm_fc6bd
.asm_fc6a7
- ld a, [wPlayerFacingDirection]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
jr z, .asm_fc6b9
jr .asm_fc6bd
.asm_fc6b0
- ld a, [wPlayerFacingDirection]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
jr z, .asm_fc6b9
jr .asm_fc6bd
@@ -358,8 +358,8 @@ SpawnPikachu_::
pop bc
ret c
- ld bc, wPikachuSpriteStateData1
- ld hl, wPikachuMovementStatus - wPikachuSpriteStateData1
+ ld bc, wSpritePikachuStateData1
+ ld hl, wSpritePikachuStateData1MovementStatus - wSpritePikachuStateData1
add hl, bc
bit 7, [hl]
jp nz, Func_fc745
@@ -403,7 +403,7 @@ PointerTable_fc710:
TrySpawnPikachu:
call ShouldPikachuSpawn
jr nc, .dont_spawn
- ld a, [wPikachuMovementStatus]
+ ld a, [wSpritePikachuStateData1MovementStatus]
and a
jr nz, .already_spawned
push bc
@@ -416,7 +416,7 @@ TrySpawnPikachu:
ret
.dont_spawn
- ld hl, wPikachuSpriteImageIdx
+ ld hl, wSpritePikachuStateData1ImageIndex
ld [hl], $ff
dec hl
ld [hl], $0
@@ -424,23 +424,23 @@ TrySpawnPikachu:
ret
Func_fc745:
- ld hl, wPikachuMovementStatus - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData1MovementStatus - wSpritePikachuStateData1
add hl, bc
res 7, [hl]
- ld hl, wPikachuWalkAnimationCounter - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData2WalkAnimationCounter - wSpritePikachuStateData1
add hl, bc
ld [hl], a
call CheckPikachuFollowingPlayer
jr nz, .okay
; Have Pikachu face in the opposite direction of you
- ld a, [wPlayerFacingDirection]
+ ld a, [wSpritePlayerStateData1FacingDirection]
xor $4
- ld hl, wPikachuFacingDirection - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData1FacingDirection - wSpritePikachuStateData1
add hl, bc
ld [hl], a
.okay
xor a
- ld hl, wPikachuIntraAnimFrameCounter - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData1IntraAnimFrameCounter - wSpritePikachuStateData1
add hl, bc
ld [hli], a
ld [hl], a
@@ -449,7 +449,7 @@ Func_fc745:
Func_fc76a:
xor a
- ld hl, wPikachuIntraAnimFrameCounter - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData1IntraAnimFrameCounter - wSpritePikachuStateData1
add hl, bc
ld [hli], a
ld [hl], a
@@ -460,10 +460,10 @@ Func_fc76a:
callab InitializeSpriteScreenPosition
pop bc
.skip
- ld hl, wPikachuMovementStatus - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData1MovementStatus - wSpritePikachuStateData1
add hl, bc
ld [hl], $1
- ld hl, wPikachuWalkAnimationCounter - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData2WalkAnimationCounter - wSpritePikachuStateData1
add hl, bc
ld [hl], $0
call RefreshPikachuFollow
@@ -474,7 +474,7 @@ Func_fc793:
push bc
callab InitializeSpriteScreenPosition
pop bc
- ld hl, wPikachuSpriteImageIdx - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData1ImageIndex - wSpritePikachuStateData1
add hl, bc
ld [hl], $ff
dec hl
@@ -495,12 +495,12 @@ Func_fc7aa:
ld e, l
ld a, [de]
inc de
- ld hl, wPikachuFacingDirection - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData1FacingDirection - wSpritePikachuStateData1
add hl, bc
ld [hl], a
ld a, [de]
inc de
- ld hl, wPikachuXStepVector - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData1XStepVector - wSpritePikachuStateData1
add hl, bc
ld [hl], a
dec hl
@@ -509,7 +509,7 @@ Func_fc7aa:
ld [hl], a
inc de
ld a, [de]
- ld hl, wPikachuMovementStatus - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData1MovementStatus - wSpritePikachuStateData1
add hl, bc
ld [hl], a
cp $4
@@ -539,7 +539,7 @@ Pointer_fc7e3:
Func_fc803:
call Func_fcae2
ret c
- ld hl, wPikachuWalkAnimationCounter - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData2WalkAnimationCounter - wSpritePikachuStateData1
add hl, bc
dec [hl]
jr nz, .asm_fc823
@@ -551,12 +551,12 @@ Func_fc803:
ld [hl], $20
call Random
and $c
- ld hl, wPikachuFacingDirection - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData1FacingDirection - wSpritePikachuStateData1
add hl, bc
ld [hl], a
.asm_fc823
xor a
- ld hl, wPikachuIntraAnimFrameCounter - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData1IntraAnimFrameCounter - wSpritePikachuStateData1
add hl, bc
ld [hli], a
ld [hl], a
@@ -571,10 +571,10 @@ Func_fc82e:
ret
Func_fc835:
- ld hl, wPikachuWalkAnimationCounter - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData2WalkAnimationCounter - wSpritePikachuStateData1
add hl, bc
ld [hl], $10
- ld hl, wPikachuMovementStatus - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData1MovementStatus - wSpritePikachuStateData1
add hl, bc
ld [hl], $1
ret
@@ -607,16 +607,16 @@ Func_fc862:
add a
add a
and $c
- ld hl, wPikachuFacingDirection - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData1FacingDirection - wSpritePikachuStateData1
add hl, bc
ld [hl], a
- ld hl, wPikachuMovementStatus - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData1MovementStatus - wSpritePikachuStateData1
add hl, bc
ld [hl], $6
xor a
ld [wd432], a
ld [wd433], a
- ld hl, wPikachuWalkAnimationCounter - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData2WalkAnimationCounter - wSpritePikachuStateData1
add hl, bc
ld [hl], $11
asm_fc87f:
@@ -627,7 +627,7 @@ asm_fc87f:
call Func_fc82e
jr c, Func_fc8c7
call SetPikachuOverworldStateFlag2
- ld hl, wPikachuYPixels - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData1YPixels - wSpritePikachuStateData1
add hl, bc
ld a, [hl]
sub e
@@ -637,7 +637,7 @@ asm_fc87f:
ld a, [hl]
sub d
ld d, a
- ld hl, wPikachuWalkAnimationCounter - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData2WalkAnimationCounter - wSpritePikachuStateData1
add hl, bc
ld a, [hl]
dec a
@@ -655,20 +655,20 @@ asm_fc87f:
ld [wd433], a
add d
ld d, a
- ld hl, wPikachuYPixels - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData1YPixels - wSpritePikachuStateData1
add hl, bc
ld [hl], e
inc hl
inc hl
ld [hl], d
- ld hl, wPikachuWalkAnimationCounter - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData2WalkAnimationCounter - wSpritePikachuStateData1
add hl, bc
dec [hl]
ret nz
jp Func_fc835
Func_fc8c7:
- ld hl, wPikachuYPixels - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData1YPixels - wSpritePikachuStateData1
add hl, bc
ld a, [hl]
sub e
@@ -700,17 +700,17 @@ Pointer_fc8d6:
db 0, 0
Func_fc8f8:
- ld hl, wPikachuMovementStatus - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData1MovementStatus - wSpritePikachuStateData1
add hl, bc
ld [hl], $7
- ld hl, wPikachuWalkAnimationCounter - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData2WalkAnimationCounter - wSpritePikachuStateData1
add hl, bc
ld [hl], $30
asm_fc904:
call Func_fc82e
jp c, Func_fc835
call SetPikachuOverworldStateFlag2
- ld hl, wPikachuIntraAnimFrameCounter - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData1IntraAnimFrameCounter - wSpritePikachuStateData1
add hl, bc
ld a, [hl]
inc a
@@ -725,24 +725,24 @@ asm_fc904:
ld [hl], a
.asm_fc91f
call UpdatePikachuWalkingSprite
- ld hl, wPikachuWalkAnimationCounter - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData2WalkAnimationCounter - wSpritePikachuStateData1
add hl, bc
dec [hl]
ret nz
jp Func_fc835
Func_fc92b:
- ld hl, wPikachuWalkAnimationCounter - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData2WalkAnimationCounter - wSpritePikachuStateData1
add hl, bc
ld [hl], $20
- ld hl, wPikachuMovementStatus - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData1MovementStatus - wSpritePikachuStateData1
add hl, bc
ld [hl], $8
asm_fc937:
call Func_fc82e
jp c, Func_fc835
call SetPikachuOverworldStateFlag2
- ld hl, wPikachuIntraAnimFrameCounter - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData1IntraAnimFrameCounter - wSpritePikachuStateData1
add hl, bc
ld a, [hl]
inc a
@@ -756,24 +756,24 @@ asm_fc937:
ld [hl], a
.asm_fc951
call UpdatePikachuWalkingSprite
- ld hl, wPikachuWalkAnimationCounter - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData2WalkAnimationCounter - wSpritePikachuStateData1
add hl, bc
dec [hl]
ret nz
jp Func_fc835
Func_fc95d:
- ld hl, wPikachuWalkAnimationCounter - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData2WalkAnimationCounter - wSpritePikachuStateData1
add hl, bc
ld [hl], $20
- ld hl, wPikachuMovementStatus - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData1MovementStatus - wSpritePikachuStateData1
add hl, bc
ld [hl], $9
asm_fc969:
call Func_fc82e
jp c, Func_fc835
call SetPikachuOverworldStateFlag2
- ld hl, wPikachuIntraAnimFrameCounter - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData1IntraAnimFrameCounter - wSpritePikachuStateData1
add hl, bc
ld a, [hl]
inc a
@@ -782,14 +782,14 @@ asm_fc969:
jr nz, .skip
xor a
ld [hl], a
- ld hl, wPikachuFacingDirection - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData1FacingDirection - wSpritePikachuStateData1
add hl, bc
ld a, [hl]
call .TurnClockwise
ld [hl], a
.skip
call UpdatePikachuWalkingSprite
- ld hl, wPikachuWalkAnimationCounter - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData2WalkAnimationCounter - wSpritePikachuStateData1
add hl, bc
dec [hl]
ret nz
@@ -825,10 +825,10 @@ asm_fc969:
.Facings_End:
NormalPikachuFollow:
- ld hl, wPikachuWalkAnimationCounter - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData2WalkAnimationCounter - wSpritePikachuStateData1
add hl, bc
ld [hl], $8
- ld hl, wPikachuMovementStatus - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData1MovementStatus - wSpritePikachuStateData1
add hl, bc
ld [hl], $3
call AddPikachuStepVector
@@ -836,22 +836,22 @@ asm_fc9c3:
call TryDoubleAddPikachuStepVectorToScreenPixelCoords
call GetPikachuWalkingAnimationSpeed
call UpdatePikachuWalkingSprite
- ld hl, wPikachuWalkAnimationCounter - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData2WalkAnimationCounter - wSpritePikachuStateData1
add hl, bc
dec [hl]
ret nz
call ResetPikachuStepVector
call ComputePikachuFacingDirection
- ld hl, wPikachuMovementStatus - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData1MovementStatus - wSpritePikachuStateData1
add hl, bc
ld [hl], $1
ret
FastPikachuFollow:
- ld hl, wPikachuWalkAnimationCounter - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData2WalkAnimationCounter - wSpritePikachuStateData1
add hl, bc
ld [hl], $4
- ld hl, wPikachuMovementStatus - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData1MovementStatus - wSpritePikachuStateData1
add hl, bc
ld [hl], $5
call AddPikachuStepVector
@@ -859,22 +859,22 @@ asm_fc9ee:
call DoubleAddPikachuStepVectorToScreenPixelCoords
call GetPikachuWalkingAnimationSpeed
call UpdatePikachuWalkingSprite
- ld hl, wPikachuWalkAnimationCounter - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData2WalkAnimationCounter - wSpritePikachuStateData1
add hl, bc
dec [hl]
ret nz
call ResetPikachuStepVector
call ComputePikachuFacingDirection
- ld hl, wPikachuMovementStatus - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData1MovementStatus - wSpritePikachuStateData1
add hl, bc
ld [hl], $1
ret
Func_fca0a:
- ld hl, wPikachuWalkAnimationCounter - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData2WalkAnimationCounter - wSpritePikachuStateData1
add hl, bc
ld [hl], $8
- ld hl, wPikachuMovementStatus - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData1MovementStatus - wSpritePikachuStateData1
add hl, bc
ld [hl], $4
call AddPikachuStepVector
@@ -883,25 +883,25 @@ asm_fca1c:
call DoubleAddPikachuStepVectorToScreenPixelCoords
call GetPikachuWalkingAnimationSpeed
call UpdatePikachuWalkingSprite
- ld hl, wPikachuWalkAnimationCounter - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData2WalkAnimationCounter - wSpritePikachuStateData1
add hl, bc
dec [hl]
ret nz
call ResetPikachuStepVector
call ComputePikachuFacingDirection
- ld hl, wPikachuMovementStatus - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData1MovementStatus - wSpritePikachuStateData1
add hl, bc
ld [hl], $1
ret
AddPikachuStepVector:
- ld hl, wPikachuYStepVector - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData1YStepVector - wSpritePikachuStateData1
add hl, bc
ld e, [hl]
inc hl
inc hl
ld d, [hl]
- ld hl, wPikachuMapY - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData2MapY - wSpritePikachuStateData1
add hl, bc
ld a, [hl]
add e
@@ -919,7 +919,7 @@ TryDoubleAddPikachuStepVectorToScreenPixelCoords:
bit 6, a
jr nz, AddPikachuStepVectorToScreenPixelCoords
DoubleAddPikachuStepVectorToScreenPixelCoords:
- ld hl, wPikachuYStepVector - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData1YStepVector - wSpritePikachuStateData1
add hl, bc
ld a, [hli]
add a
@@ -934,7 +934,7 @@ DoubleAddPikachuStepVectorToScreenPixelCoords:
ret
AddPikachuStepVectorToScreenPixelCoords:
- ld hl, wPikachuYStepVector - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData1YStepVector - wSpritePikachuStateData1
add hl, bc
ld a, [hli]
add a
@@ -947,7 +947,7 @@ AddPikachuStepVectorToScreenPixelCoords:
ret
ResetPikachuStepVector:
- ld hl, wPikachuYStepVector - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData1YStepVector - wSpritePikachuStateData1
add hl, bc
xor a
ld [hli], a
@@ -961,7 +961,7 @@ GetPikachuWalkingAnimationSpeed:
jr nc, .happy
ld d, $5
.happy
- ld hl, wPikachuIntraAnimFrameCounter - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData1IntraAnimFrameCounter - wSpritePikachuStateData1
add hl, bc
ld a, [hl]
inc a
@@ -981,7 +981,7 @@ UpdatePikachuWalkingSprite:
ld a, [wPikachuOverworldStateFlags]
bit 3, a
jr nz, .uninitialized
- ld hl, wPikachuSpriteImageBaseOffset - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData2ImageBaseOffset - wSpritePikachuStateData1
add hl, bc
ld a, [hl]
dec a
@@ -990,7 +990,7 @@ UpdatePikachuWalkingSprite:
ld a, [wd736]
bit 7, a
jr nz, .copy_player
- ld hl, wPikachuFacingDirection - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData1FacingDirection - wSpritePikachuStateData1
add hl, bc
ld a, [hl]
or d
@@ -1003,32 +1003,32 @@ UpdatePikachuWalkingSprite:
jr .load_sprite_index
.normal_get_sprite_index
- ld hl, wPikachuAnimFrameCounter - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData1AnimFrameCounter - wSpritePikachuStateData1
add hl, bc
ld a, d
or [hl]
ld d, a
.load_sprite_index
- ld hl, wPikachuSpriteImageIdx - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData1ImageIndex - wSpritePikachuStateData1
add hl, bc
ld [hl], d
ret
.uninitialized
- ld hl, wPikachuSpriteImageIdx - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData1ImageIndex - wSpritePikachuStateData1
add hl, bc
ld [hl], $ff
ret
.copy_player
- ld a, [wPlayerSpriteImageIdx]
+ ld a, [wSpritePlayerStateData1ImageIndex]
and $f
or d
- ld [wPikachuSpriteImageIdx], a
+ ld [wSpritePikachuStateData1ImageIndex], a
ret
Func_fcae2:
- ld hl, wPikachuMapY - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData2MapY - wSpritePikachuStateData1
add hl, bc
ld a, [wYCoord]
add $4
@@ -1039,7 +1039,7 @@ Func_fcae2:
add $4
cp [hl]
jr nz, .on_screen
- ld hl, wPikachuSpriteImageIdx - wPikachuSpriteStateData1
+ ld hl, wSpritePikachuStateData1ImageIndex - wSpritePikachuStateData1
add hl, bc
ld [hl], $ff
scf
@@ -1053,14 +1053,14 @@ IsPikachuRightNextToPlayer:
push bc
push de
push hl
- ld bc, wPikachuPictureID
+ ld bc, wSpritePikachuStateData1PictureID
ld a, [wXCoord]
add $4
ld d, a
ld a, [wYCoord]
add $4
ld e, a
- ld hl, wPlayerMapY - wPlayerSpriteStateData1
+ ld hl, wSpritePlayerStateData2MapY - wSpritePlayerStateData1
add hl, bc
ld a, [hl]
sub e
@@ -1073,7 +1073,7 @@ IsPikachuRightNextToPlayer:
jr .bad
.one_away
- ld hl, wPlayerMapX - wPlayerSpriteStateData1
+ ld hl, wSpritePlayerStateData2MapX - wSpritePlayerStateData1
add hl, bc
ld a, [hl]
sub d
@@ -1081,7 +1081,7 @@ IsPikachuRightNextToPlayer:
jr .bad
.equal
- ld hl, wPlayerMapX - wPlayerSpriteStateData1
+ ld hl, wSpritePlayerStateData2MapX - wSpritePlayerStateData1
add hl, bc
ld a, [hl]
sub d
@@ -1113,14 +1113,14 @@ GetPikachuFacingDirectionAndReturnToE:
ret
GetPikachuFacingDirection:
- ld bc, wPikachuPictureID
+ ld bc, wSpritePikachuStateData1PictureID
ld a, [wXCoord]
add $4
ld d, a
ld a, [wYCoord]
add $4
ld e, a
- ld hl, wPlayerMapY - wPlayerSpriteStateData1
+ ld hl, wSpritePlayerStateData2MapY - wSpritePlayerStateData1
add hl, bc
ld a, [hl]
cp e
@@ -1134,7 +1134,7 @@ GetPikachuFacingDirection:
ret
.asm_fcb71
- ld hl, wPlayerMapX - wPlayerSpriteStateData1
+ ld hl, wSpritePlayerStateData2MapX - wSpritePlayerStateData1
add hl, bc
ld a, [hl]
cp d
@@ -1180,8 +1180,8 @@ RefreshPikachuFollow:
ret
ComputePikachuFollowCommand:
- ld bc, wPikachuPictureID
- ld hl, wPlayerMapY - wPlayerSpriteStateData1
+ ld bc, wSpritePikachuStateData1PictureID
+ ld hl, wSpritePlayerStateData2MapY - wSpritePlayerStateData1
add hl, bc
ld a, [wYCoord]
add $4
@@ -1212,7 +1212,7 @@ ComputePikachuFollowCommand:
ret
.checkXCoord
- ld hl, wPlayerMapX - wPlayerSpriteStateData1
+ ld hl, wSpritePlayerStateData2MapX - wSpritePlayerStateData1
add hl, bc
ld a, [wXCoord]
add $4
@@ -1403,7 +1403,7 @@ ComputePikachuFacingDirection::
ld a, [wXCoord]
add $4
ld e, a
- ld a, [wPikachuMapY]
+ ld a, [wSpritePikachuStateData2MapY]
cp d
jr z, .check_x
ld a, SPRITE_FACING_DOWN
@@ -1412,7 +1412,7 @@ ComputePikachuFacingDirection::
jr .load
.check_x
- ld a, [wPikachuMapX]
+ ld a, [wSpritePikachuStateData2MapX]
cp e
jr z, .copy_from_player
ld a, SPRITE_FACING_RIGHT
@@ -1421,9 +1421,9 @@ ComputePikachuFacingDirection::
jr .load
.copy_from_player
- ld a, [wPlayerFacingDirection]
+ ld a, [wSpritePlayerStateData1FacingDirection]
.load
- ld [wPikachuFacingDirection], a
+ ld [wSpritePikachuStateData1FacingDirection], a
ret
GetPikachuFollowCommand:
@@ -1476,7 +1476,7 @@ AreThereAtLeastTwoStepsInPikachuFollowCommandBuffer:
WillPikachuSpawnOnTheScreen:
ld h, wSpriteStateData2 / $100
ld a, [H_CURRENTSPRITEOFFSET] ; If we're here, this can only be $f0
- add wPikachuMapY - wPikachuSpriteStateData2
+ add wSpritePikachuStateData2MapY - wSpritePikachuStateData2
ld l, a
ld b, [hl]
ld a, [wYCoord]
@@ -1517,7 +1517,7 @@ WillPikachuSpawnOnTheScreen:
.not_on_screen
ld h, wSpriteStateData1 / $100
ld a, [H_CURRENTSPRITEOFFSET]
- add wPikachuSpriteImageIdx - wPikachuSpriteStateData1
+ add wSpritePikachuStateData1ImageIndex - wSpritePikachuStateData1
ld l, a
ld [hl], $ff
scf
@@ -1526,7 +1526,7 @@ WillPikachuSpawnOnTheScreen:
.on_screen
ld h, wSpriteStateData2 / $100
ld a, [H_CURRENTSPRITEOFFSET]
- add wPikachuGrassPriority - wPikachuSpriteStateData2
+ add wSpritePikachuStateData2GrassPriority - wSpritePikachuStateData2
ld l, a
ld a, [wGrassTile]
cp e
@@ -1542,7 +1542,7 @@ WillPikachuSpawnOnTheScreen:
.GetNPCCurrentTile:
ld h, wSpriteStateData1 / $100
ld a, [H_CURRENTSPRITEOFFSET]
- add wPikachuYPixels - wPikachuSpriteStateData1
+ add wSpritePikachuStateData1YPixels - wSpritePikachuStateData1
ld l, a
ld a, [hli]
add $4
diff --git a/engine/pikachu_movement.asm b/engine/pikachu_movement.asm
index e2e27348..938715a4 100755
--- a/engine/pikachu_movement.asm
+++ b/engine/pikachu_movement.asm
@@ -26,13 +26,13 @@ ApplyPikachuMovementData_::
push de
push bc
- ld hl, wPlayerSpriteStateData1
- ld de, wPikachuSpriteStateData1
+ ld hl, wSpritePlayerStateData1
+ ld de, wSpritePikachuStateData1
ld c, $10
call .SwapBytes
- ld hl, wPlayerSpriteStateData2
- ld de, wPikachuSpriteStateData2
+ ld hl, wSpritePlayerStateData2
+ ld de, wSpritePikachuStateData2
ld c, $10
call .SwapBytes
@@ -91,10 +91,10 @@ ExecutePikachuMovementCommand:
ld [wPikachuMovementFlags], a
ld [wPikachuStepTimer], a
ld [wPikachuStepSubtimer], a
- ld a, [wPlayerGrassPriority]
+ ld a, [wSpritePlayerStateData2GrassPriority]
push af
.loop
- ld bc, wPlayerSpriteStateData1 ; Currently holds Pikachu's sprite state data
+ ld bc, wSpritePlayerStateData1 ; Currently holds Pikachu's sprite state data
ld a, [wCurPikaMovementFunc1]
ld hl, PikaMovementFunc1Jumptable
call .JumpTable
@@ -109,7 +109,7 @@ ExecutePikachuMovementCommand:
bit 7, [hl]
jr z, .loop
pop af
- ld [wPlayerGrassPriority], a
+ ld [wSpritePlayerStateData2GrassPriority], a
scf
ret
@@ -124,7 +124,7 @@ ExecutePikachuMovementCommand:
jp hl
GetCoordsForPikachuShadow:
- ld hl, wPlayerSpriteImageIdx - wPlayerSpriteStateData1
+ ld hl, wSpritePlayerStateData1ImageIndex - wSpritePlayerStateData1
add hl, bc
ld a, [wCurPikaMovementSpriteImageIdx]
ld [hl], a
@@ -132,20 +132,20 @@ GetCoordsForPikachuShadow:
ld d, a
ld a, [wPikachuMovementYOffset]
add d
- ld hl, wPlayerYPixels - wPlayerSpriteStateData1
+ ld hl, wSpritePlayerStateData1YPixels - wSpritePlayerStateData1
add hl, bc
ld [hl], a
ld a, [wPikaSpriteX]
ld d, a
ld a, [wPikachuMovementXOffset]
add d
- ld hl, wPlayerXPixels - wPlayerSpriteStateData1
+ ld hl, wSpritePlayerStateData1XPixels - wSpritePlayerStateData1
add hl, bc
ld [hl], a
ld hl, wPikachuMovementFlags
bit 6, [hl]
ret z
- ld hl, wPlayerGrassPriority - wPlayerSpriteStateData1
+ ld hl, wSpritePlayerStateData2GrassPriority - wSpritePlayerStateData1
add hl, bc
ld [hl], 0
ret
@@ -272,11 +272,11 @@ PikaMovementFunc1_EndCommand_:
ret
PikaMovementFunc1_LoadPikachuCurrentPosition:
- ld hl, wPlayerYPixels - wPlayerSpriteStateData1
+ ld hl, wSpritePlayerStateData1YPixels - wSpritePlayerStateData1
add hl, bc
ld a, [hl]
ld [wPikaSpriteY], a
- ld hl, wPlayerXPixels - wPlayerSpriteStateData1
+ ld hl, wSpritePlayerStateData1XPixels - wSpritePlayerStateData1
add hl, bc
ld a, [hl]
ld [wPikaSpriteX], a
@@ -577,7 +577,7 @@ PikaMovement_SetSpawnShadow:
ret
PikaMovementFunc2_ResetFrameCounterAndFaceCurrent:
- ld hl, wPlayerIntraAnimFrameCounter - wPlayerSpriteStateData1
+ ld hl, wSpritePlayerStateData1IntraAnimFrameCounter - wSpritePlayerStateData1
add hl, bc
xor a
ld [hli], a
@@ -615,7 +615,7 @@ PikaMovementFunc2_UpdateSpriteImageIdxWithPreviousImageIdxDirection:
or d
ld d, a
PikaMovementFunc2_UpdateSpriteImageIdx:
- ld hl, wPlayerAnimFrameCounter - wPlayerSpriteStateData1
+ ld hl, wSpritePlayerStateData1AnimFrameCounter - wSpritePlayerStateData1
add hl, bc
call CheckPikachuStepTimer2 ; does not preserve hl
jr nz, .skip
@@ -712,7 +712,7 @@ Data_fd731End:
PikaMovementFunc2_Timer:
push hl
- ld hl, wPlayerIntraAnimFrameCounter - wPlayerSpriteStateData1
+ ld hl, wSpritePlayerStateData1IntraAnimFrameCounter - wSpritePlayerStateData1
add hl, bc
ld a, [hl]
inc a
@@ -730,7 +730,7 @@ PikaMovementFunc2_Timer:
PikaMovementFunc2_GetImageBaseOffset:
push hl
- ld hl, wPlayerSpriteImageBaseOffset - wPlayerSpriteStateData1
+ ld hl, wSpritePlayerStateData2ImageBaseOffset - wSpritePlayerStateData1
add hl, bc
ld a, [hl]
dec a
@@ -740,7 +740,7 @@ PikaMovementFunc2_GetImageBaseOffset:
PikaMovementFunc2_GetSpriteImageIdxDirection:
push hl
- ld hl, wPlayerSpriteImageIdx - wPlayerSpriteStateData1
+ ld hl, wSpritePlayerStateData1ImageIndex - wSpritePlayerStateData1
add hl, bc
ld a, [hl]
and $c
@@ -749,7 +749,7 @@ PikaMovementFunc2_GetSpriteImageIdxDirection:
GetPikachuFacing:
push hl
- ld hl, wPlayerFacingDirection - wPlayerSpriteStateData1
+ ld hl, wSpritePlayerStateData1FacingDirection - wSpritePlayerStateData1
add hl, bc
ld a, [hl]
and $c
@@ -758,7 +758,7 @@ GetPikachuFacing:
SetPikachuFacing:
push hl
- ld hl, wPlayerFacingDirection - wPlayerSpriteStateData1
+ ld hl, wSpritePlayerStateData1FacingDirection - wSpritePlayerStateData1
add hl, bc
add a
add a
@@ -842,7 +842,7 @@ ApplyPikachuStepVector:
inc hl
ld e, [hl]
pop bc
- ld hl, wPlayerMapY - wPlayerSpriteStateData1
+ ld hl, wSpritePlayerStateData2MapY - wSpritePlayerStateData1
add hl, bc
ld a, [hl]
add e
diff --git a/home/overworld.asm b/home/overworld.asm
index 29e4f18d..9c53a3be 100644
--- a/home/overworld.asm
+++ b/home/overworld.asm
@@ -1081,7 +1081,7 @@ IsSpriteInFrontOfPlayer::
ld d, $10 ; talking range in pixels (normal range)
IsSpriteInFrontOfPlayer2::
lb bc, $3c, $40 ; Y and X position of player sprite
- ld a, [wPlayerFacingDirection] ; direction the player is facing
+ ld a, [wSpritePlayerStateData1FacingDirection] ; direction the player is facing
.checkIfPlayerFacingUp
cp SPRITE_FACING_UP
jr nz, .checkIfPlayerFacingDown
diff --git a/home/pikachu.asm b/home/pikachu.asm
index d16e95db..336c80b3 100755
--- a/home/pikachu.asm
+++ b/home/pikachu.asm
@@ -2,7 +2,7 @@ Func_1510::
push hl
ld hl, wPikachuOverworldStateFlags
set 7, [hl]
- ld hl, wPikachuSpriteImageIdx ; pikachu data?
+ ld hl, wSpritePikachuStateData1ImageIndex ; pikachu data?
ld [hl], $ff
pop hl
ret
@@ -25,7 +25,7 @@ DisablePikachuOverworldSpriteDrawing::
push hl
ld hl, wPikachuOverworldStateFlags
set 3, [hl]
- ld hl, wPikachuSpriteImageIdx ; pikachu data?
+ ld hl, wSpritePikachuStateData1ImageIndex ; pikachu data?
ld [hl], $ff
pop hl
ret
diff --git a/macros.asm b/macros.asm
index b318c999..b854b25f 100644
--- a/macros.asm
+++ b/macros.asm
@@ -14,7 +14,7 @@ dex EQUS "db $5f, $50" ; End a Pokedex entry.
percent EQUS "* $ff / 100"
lb: MACRO ; r, hi, lo
- ld \1, (\2) << 8 + ((\3) & $ff)
+ ld \1, ((\2) & $ff) << 8 + ((\3) & $ff)
ENDM
SHADE_BLACK EQU %11
diff --git a/replace.sh b/replace.sh
index a4688225..fe0e1ffb 100644
--- a/replace.sh
+++ b/replace.sh
@@ -1,3 +1,3 @@
-sed -i 's/\<'$1'\>/'$2'/' $(grep -lwr --include "*.asm" $1)
+sed -i 's/\<'$1'\>/'$2'/' $(grep -lwr --include "*.asm" --exclude-dir=".git" --exclude-dir="extras" --exclude-dir="pic" --exclude-dir="gfx" $1)
# $1: phrase to find
# $2: phrase to replace $1 \ No newline at end of file
diff --git a/scripts/billshouse.asm b/scripts/billshouse.asm
index 02183977..3e13ba51 100755
--- a/scripts/billshouse.asm
+++ b/scripts/billshouse.asm
@@ -57,7 +57,7 @@ BillsHouseScript1:
BillsHouseScript2:
ld a, $ff
ld [wJoyIgnore], a
- ld a, [wPlayerFacingDirection]
+ ld a, [wSpritePlayerStateData1FacingDirection]
and a ; cp SPRITE_FACING_DOWN
ld de, MovementData_1e79c
jr nz, .notDown
@@ -99,7 +99,7 @@ BillsHouseScript3:
call CheckPikachuFollowingPlayer
jr z, .asm_1e13e
ld hl, PikachuMovementData_1e14d
- ld a, [wPlayerFacingDirection]
+ ld a, [wSpritePlayerStateData1FacingDirection]
and a ; cp SPRITE_FACING_DOWN
jr nz, .asm_1e133
ld hl, PikachuMovementData_1e152
@@ -211,7 +211,7 @@ BillsHouseScript7:
xor a
ld [wPlayerMovingDirection], a
ld a, SPRITE_FACING_UP
- ld [wPlayerFacingDirection], a
+ ld [wSpritePlayerStateData1FacingDirection], a
ld a, $FF ^ (A_BUTTON | B_BUTTON)
ld [wJoyIgnore], a
ld de, RLE_1e219
@@ -235,7 +235,7 @@ BillsHouseScript8:
xor a
ld [wPlayerMovingDirection], a
ld a, SPRITE_FACING_UP
- ld [wPlayerFacingDirection], a
+ ld [wSpritePlayerStateData1FacingDirection], a
ld a, $2
ld [H_SPRITEINDEX], a
ld a, SPRITE_FACING_DOWN
diff --git a/scripts/cinnabarisland.asm b/scripts/cinnabarisland.asm
index 4dbec159..c608f53d 100755
--- a/scripts/cinnabarisland.asm
+++ b/scripts/cinnabarisland.asm
@@ -35,7 +35,7 @@ CinnabarIslandScript0:
ld [wSimulatedJoypadStatesEnd], a
call StartSimulatingJoypadStates
xor a
- ld [wPlayerFacingDirection], a
+ ld [wSpritePlayerStateData1FacingDirection], a
ld [wJoyIgnore], a
ld a, $1
ld [wCinnabarIslandCurScript], a
diff --git a/scripts/copycatshouse2f.asm b/scripts/copycatshouse2f.asm
index 7bf8d0e9..ee8f2cc7 100755
--- a/scripts/copycatshouse2f.asm
+++ b/scripts/copycatshouse2f.asm
@@ -82,7 +82,7 @@ CopycatsHouse2FText6:
CopycatsHouse2FText7:
TX_ASM
- ld a, [wPlayerFacingDirection]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
ld hl, CopycatsHouse2FText_5cd1c
jr nz, .notUp
diff --git a/scripts/mansion1.asm b/scripts/mansion1.asm
index fb0a92bc..d659d993 100755
--- a/scripts/mansion1.asm
+++ b/scripts/mansion1.asm
@@ -46,7 +46,7 @@ Mansion1ReplaceBlock:
ret
Mansion1Script_Switches:
- ld a, [wPlayerFacingDirection]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
ret nz
xor a
diff --git a/scripts/mansion2.asm b/scripts/mansion2.asm
index 0ba8a245..7edfd097 100755
--- a/scripts/mansion2.asm
+++ b/scripts/mansion2.asm
@@ -42,7 +42,7 @@ Mansion2Script_5202f:
predef_jump ReplaceTileBlock
Mansion2Script_Switches:
- ld a, [wPlayerFacingDirection]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
ret nz
xor a
diff --git a/scripts/mansion3.asm b/scripts/mansion3.asm
index c71979d5..990ad434 100755
--- a/scripts/mansion3.asm
+++ b/scripts/mansion3.asm
@@ -73,7 +73,7 @@ Mansion3Script_5225b:
ret
Mansion3Script_Switches:
- ld a, [wPlayerFacingDirection]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
ret nz
xor a
diff --git a/scripts/mansion4.asm b/scripts/mansion4.asm
index 12420990..57687fec 100755
--- a/scripts/mansion4.asm
+++ b/scripts/mansion4.asm
@@ -44,7 +44,7 @@ Mansion4Script_523cf:
ret
Mansion4Script_Switches:
- ld a, [wPlayerFacingDirection]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
ret nz
xor a
diff --git a/scripts/oakslab.asm b/scripts/oakslab.asm
index d3082256..4bc8198c 100755
--- a/scripts/oakslab.asm
+++ b/scripts/oakslab.asm
@@ -464,13 +464,13 @@ OaksLabScript16:
ret nz
xor a
.asm_1c707
- ld [wPlayerFacingDirection], a
+ ld [wSpritePlayerStateData1FacingDirection], a
ret
OaksLabScript17:
; Pikachu comes out
ld a, SPRITE_FACING_UP
- ld [wPlayerFacingDirection], a
+ ld [wSpritePlayerStateData1FacingDirection], a
ld a, $2
ld [wPikachuSpawnState], a
callba SchedulePikachuSpawnForAfterText
diff --git a/scripts/pallettown.asm b/scripts/pallettown.asm
index 49546a44..e98464ce 100755
--- a/scripts/pallettown.asm
+++ b/scripts/pallettown.asm
@@ -174,7 +174,7 @@ PalletTownScript5:
PalletTownScript6:
xor a
- ld [wPlayerFacingDirection], a
+ ld [wSpritePlayerStateData1FacingDirection], a
ld a, $1
ld [wSpriteIndex], a
xor a
diff --git a/scripts/pokemontower7.asm b/scripts/pokemontower7.asm
index 6a2cdad5..abfb1468 100755
--- a/scripts/pokemontower7.asm
+++ b/scripts/pokemontower7.asm
@@ -235,7 +235,7 @@ PokemonTower7Script11:
ld [wMissableObjectIndex], a
predef HideObject
ld a, SPRITE_FACING_UP
- ld [wPlayerFacingDirection], a
+ ld [wSpritePlayerStateData1FacingDirection], a
ld a, LAVENDER_HOUSE_1
ld [hWarpDestinationMap], a
ld a, $1
diff --git a/scripts/redshouse1f2.asm b/scripts/redshouse1f2.asm
index 871f2e31..8f44d30d 100755
--- a/scripts/redshouse1f2.asm
+++ b/scripts/redshouse1f2.asm
@@ -40,7 +40,7 @@ MomHealText2:
Func_f1bc4:
ld hl, TVWrongSideText
- ld a, [wPlayerFacingDirection]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
jp nz, .notUp
ld hl, StandByMeText
diff --git a/scripts/route11gateupstairs.asm b/scripts/route11gateupstairs.asm
index 300b299a..6188e122 100755
--- a/scripts/route11gateupstairs.asm
+++ b/scripts/route11gateupstairs.asm
@@ -47,7 +47,7 @@ Route11GateUpstairsText_494a3:
Route11GateUpstairsText3:
TX_ASM
- ld a, [wPlayerFacingDirection]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
jp nz, GateUpstairsScript_PrintIfFacingUp
CheckEvent EVENT_BEAT_ROUTE12_SNORLAX
diff --git a/scripts/route12gateupstairs.asm b/scripts/route12gateupstairs.asm
index bdbbf526..b80ca186 100755
--- a/scripts/route12gateupstairs.asm
+++ b/scripts/route12gateupstairs.asm
@@ -64,7 +64,7 @@ Route12GateUpstairsText_495c4:
db "@"
GateUpstairsScript_PrintIfFacingUp:
- ld a, [wPlayerFacingDirection]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
jr z, .up
ld a, $1
diff --git a/scripts/route22.asm b/scripts/route22.asm
index fe881366..41f77680 100755
--- a/scripts/route22.asm
+++ b/scripts/route22.asm
@@ -153,7 +153,7 @@ Route22Script2:
ld a, $1
ld [wRivalStarter], a
.asm_50fc9
- ld a, [wPlayerFacingDirection]
+ ld a, [wSpritePlayerStateData1FacingDirection]
and a ; cp SPRITE_FACING_DOWN
jr nz, .notDown
ld a, SPRITE_FACING_UP
diff --git a/scripts/route22gate.asm b/scripts/route22gate.asm
index 05fbc7e9..2b622a43 100755
--- a/scripts/route22gate.asm
+++ b/scripts/route22gate.asm
@@ -40,7 +40,7 @@ Route22GateScript_1e6ba:
ld [wSimulatedJoypadStatesIndex], a
ld a, D_DOWN
ld [wSimulatedJoypadStatesEnd], a
- ld [wPlayerFacingDirection], a
+ ld [wSpritePlayerStateData1FacingDirection], a
ld [wJoyIgnore], a
jp StartSimulatingJoypadStates
diff --git a/scripts/route23.asm b/scripts/route23.asm
index b82ab505..c2863f89 100755
--- a/scripts/route23.asm
+++ b/scripts/route23.asm
@@ -118,7 +118,7 @@ Route23Script_512d8:
ld a, D_DOWN
ld [wSimulatedJoypadStatesEnd], a
xor a
- ld [wPlayerFacingDirection], a
+ ld [wSpritePlayerStateData1FacingDirection], a
ld [wJoyIgnore], a
jp StartSimulatingJoypadStates
diff --git a/scripts/safarizoneentrance.asm b/scripts/safarizoneentrance.asm
index 97578475..063a6d0b 100755
--- a/scripts/safarizoneentrance.asm
+++ b/scripts/safarizoneentrance.asm
@@ -26,7 +26,7 @@ SafariZoneEntranceScriptPointers:
xor a
ld [hJoyHeld], a
ld a, SPRITE_FACING_RIGHT
- ld [wPlayerFacingDirection], a
+ ld [wSpritePlayerStateData1FacingDirection], a
ld a, [wCoordIndex]
cp $1
jr z, .asm_7520f
@@ -160,7 +160,7 @@ SafariZoneEntranceTextPointers:
ld hl, .SafariZoneEntranceText_753bb
call PrintText
xor a
- ld [wPlayerFacingDirection], a
+ ld [wSpritePlayerStateData1FacingDirection], a
ld a, D_DOWN
ld c, $3
call SafariZoneEntranceAutoWalk
@@ -172,7 +172,7 @@ SafariZoneEntranceTextPointers:
ld hl, .SafariZoneEntranceText_753c0
call PrintText
ld a, SPRITE_FACING_UP
- ld [wPlayerFacingDirection], a
+ ld [wSpritePlayerStateData1FacingDirection], a
ld a, D_UP
ld c, $1
call SafariZoneEntranceAutoWalk
diff --git a/scripts/vermilioncity.asm b/scripts/vermilioncity.asm
index b73797bb..6f0f4cc2 100755
--- a/scripts/vermilioncity.asm
+++ b/scripts/vermilioncity.asm
@@ -53,7 +53,7 @@ VermilionCityScriptPointers:
dw VermilionCityScript4
VermilionCityScript0:
- ld a, [wPlayerFacingDirection]
+ ld a, [wSpritePlayerStateData1FacingDirection]
and a ; cp SPRITE_FACING_DOWN
jr nz, .asm_198de
ld hl, CoordsData_19823
@@ -176,7 +176,7 @@ VermilionCityText3:
TX_ASM
CheckEvent EVENT_SS_ANNE_LEFT
jr nz, .asm_198f6
- ld a, [wPlayerFacingDirection]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_RIGHT
jr z, .asm_198c8
ld hl, VermilionCityCoords1
diff --git a/scripts/viridiancity.asm b/scripts/viridiancity.asm
index 5aa1dbbc..f7b7b97f 100755
--- a/scripts/viridiancity.asm
+++ b/scripts/viridiancity.asm
@@ -54,7 +54,7 @@ ViridianCityScript_1905b:
ld a, D_DOWN
ld [wSimulatedJoypadStatesEnd], a
xor a
- ld [wPlayerFacingDirection], a
+ ld [wSpritePlayerStateData1FacingDirection], a
ld [wJoyIgnore], a
ld [hJoyHeld], a
ld a, $6
@@ -161,7 +161,7 @@ ViridianCityScript_1914d:
ld a, D_DOWN
ld [wSimulatedJoypadStatesEnd], a
xor a
- ld [wPlayerFacingDirection], a
+ ld [wSpritePlayerStateData1FacingDirection], a
ld [wJoyIgnore], a
ret
@@ -180,7 +180,7 @@ ViridianCityScript_19162:
ld [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
ld a, $8
- ld [wPlayerFacingDirection], a
+ ld [wSpritePlayerStateData1FacingDirection], a
ld a, $8
ld [hSpriteIndexOrTextID], a
call DisplayTextID
diff --git a/wram.asm b/wram.asm
index b8b77044..c542d042 100755
--- a/wram.asm
+++ b/wram.asm
@@ -230,41 +230,36 @@ wSpriteStateData1:: ; c100
; C1xE
; C1xF
spritestatedata1: MACRO
-w\1SpriteStateData1::
-w\1PictureID:: db ; 0
-w\1MovementStatus:: db ; 1
-w\1SpriteImageIdx:: db ; 2
-w\1YStepVector:: db ; 3
-w\1YPixels:: db ; 4
-w\1XStepVector:: db ; 5
-w\1XPixels:: db ; 6
-w\1IntraAnimFrameCounter:: db ; 7
-w\1AnimFrameCounter:: db ; 8
-w\1FacingDirection:: db ; 9
+\1PictureID:: db
+\1MovementStatus:: db
+\1ImageIndex:: db
+\1YStepVector:: db
+\1YPixels:: db
+\1XStepVector:: db
+\1XPixels:: db
+\1IntraAnimFrameCounter:: db
+\1AnimFrameCounter:: db
+\1FacingDirection:: db
ds 6
-w\1SpriteStateData1End::
+\1End::
endm
- spritestatedata1 Player
- spritestatedata1 Sprite01
- spritestatedata1 Sprite02
- spritestatedata1 Sprite03
- spritestatedata1 Sprite04
- spritestatedata1 Sprite05
- spritestatedata1 Sprite06
- spritestatedata1 Sprite07
- spritestatedata1 Sprite08
- spritestatedata1 Sprite09
- spritestatedata1 Sprite10
- spritestatedata1 Sprite11
- spritestatedata1 Sprite12
- spritestatedata1 Sprite13
- spritestatedata1 Sprite14
- spritestatedata1 Pikachu
- ; ds $10 * $10
-
-
-;SECTION "Sprite State Data 2", WRAM0[$c200]
+wSpritePlayerStateData1:: spritestatedata1 wSpritePlayerStateData1
+wSprite01StateData1:: spritestatedata1 wSprite01StateData1
+wSprite02StateData1:: spritestatedata1 wSprite02StateData1
+wSprite03StateData1:: spritestatedata1 wSprite03StateData1
+wSprite04StateData1:: spritestatedata1 wSprite04StateData1
+wSprite05StateData1:: spritestatedata1 wSprite05StateData1
+wSprite06StateData1:: spritestatedata1 wSprite06StateData1
+wSprite07StateData1:: spritestatedata1 wSprite07StateData1
+wSprite08StateData1:: spritestatedata1 wSprite08StateData1
+wSprite09StateData1:: spritestatedata1 wSprite09StateData1
+wSprite10StateData1:: spritestatedata1 wSprite10StateData1
+wSprite11StateData1:: spritestatedata1 wSprite11StateData1
+wSprite12StateData1:: spritestatedata1 wSprite12StateData1
+wSprite13StateData1:: spritestatedata1 wSprite13StateData1
+wSprite14StateData1:: spritestatedata1 wSprite14StateData1
+wSpritePikachuStateData1:: spritestatedata1 wSpritePikachuStateData1
wSpriteStateData2:: ; c200
; more data for all sprites on the current map
@@ -287,39 +282,37 @@ wSpriteStateData2:: ; c200
; C2xE: sprite image base offset (in video ram, player always has value 1, used to compute c1x2)
; C2xF
spritestatedata2: MACRO
-w\1SpriteStateData2::
-w\1WalkAnimationCounter:: db ; 0
- ds 1
-w\1YDisplacement:: db ; 2
-w\1XDisplacement:: db ; 3
-w\1MapY:: db ; 4
-w\1MapX:: db ; 5
-w\1MovementByte1:: db ; 6
-w\1GrassPriority:: db ; 7
-w\1MovementDelay:: db ; 8
+\1WalkAnimationCounter:: db
+ ds 1
+\1YDisplacement:: db
+\1XDisplacement:: db
+\1MapY:: db
+\1MapX:: db
+\1MovementByte1:: db
+\1GrassPriority:: db
+\1MovementDelay:: db
ds 5
-w\1SpriteImageBaseOffset:: db ; e
+\1ImageBaseOffset:: db
ds 1
-w\1SpriteStateData2End::
+\1End::
endm
- spritestatedata2 Player
- spritestatedata2 Sprite01
- spritestatedata2 Sprite02
- spritestatedata2 Sprite03
- spritestatedata2 Sprite04
- spritestatedata2 Sprite05
- spritestatedata2 Sprite06
- spritestatedata2 Sprite07
- spritestatedata2 Sprite08
- spritestatedata2 Sprite09
- spritestatedata2 Sprite10
- spritestatedata2 Sprite11
- spritestatedata2 Sprite12
- spritestatedata2 Sprite13
- spritestatedata2 Sprite14
- spritestatedata2 Pikachu
- ; ds $10 * $10
+wSpritePlayerStateData2:: spritestatedata2 wSpritePlayerStateData2
+wSprite01StateData2:: spritestatedata2 wSprite01StateData2
+wSprite02StateData2:: spritestatedata2 wSprite02StateData2
+wSprite03StateData2:: spritestatedata2 wSprite03StateData2
+wSprite04StateData2:: spritestatedata2 wSprite04StateData2
+wSprite05StateData2:: spritestatedata2 wSprite05StateData2
+wSprite06StateData2:: spritestatedata2 wSprite06StateData2
+wSprite07StateData2:: spritestatedata2 wSprite07StateData2
+wSprite08StateData2:: spritestatedata2 wSprite08StateData2
+wSprite09StateData2:: spritestatedata2 wSprite09StateData2
+wSprite10StateData2:: spritestatedata2 wSprite10StateData2
+wSprite11StateData2:: spritestatedata2 wSprite11StateData2
+wSprite12StateData2:: spritestatedata2 wSprite12StateData2
+wSprite13StateData2:: spritestatedata2 wSprite13StateData2
+wSprite14StateData2:: spritestatedata2 wSprite14StateData2
+wSpritePikachuStateData2:: spritestatedata2 wSpritePikachuStateData2
wSpriteDataEnd::