summaryrefslogtreecommitdiff
path: root/engine/overworld/map_sprites.asm
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2020-07-05 17:29:11 -0400
committerRangi <remy.oukaour+rangi42@gmail.com>2020-07-05 17:51:29 -0400
commit2b2ed54bbf017943ba2343cd6c1dbe88b8f34a4e (patch)
treea418c4ef57d272e7e2a70337ac8c2a8194545541 /engine/overworld/map_sprites.asm
parent7ab43f4d17aa63d4ef1050d80560379f19200088 (diff)
Identify wSpriteStateData1 and wSpriteStateData2 offsets, like pokeyellow
Diffstat (limited to 'engine/overworld/map_sprites.asm')
-rwxr-xr-xengine/overworld/map_sprites.asm20
1 files changed, 10 insertions, 10 deletions
diff --git a/engine/overworld/map_sprites.asm b/engine/overworld/map_sprites.asm
index 00981b51..0de1befd 100755
--- a/engine/overworld/map_sprites.asm
+++ b/engine/overworld/map_sprites.asm
@@ -12,8 +12,8 @@ InitMapSprites::
call InitOutsideMapSprites
ret c ; return if the map is an outside map (already handled by above call)
; if the map is an inside map (i.e. mapID >= $25)
- ld hl, wSpriteStateData1
- ld de, wSpriteStateData2 + $0d
+ ld hl, wSpritePlayerStateData1PictureID
+ ld de, wSpritePlayerStateData2PictureID
; Loop to copy picture ID's from $C1X0 to $C2XD for LoadMapSpriteTilePatterns.
.copyPictureIDLoop
ld a, [hl] ; $C1X0 (picture ID)
@@ -37,7 +37,7 @@ LoadMapSpriteTilePatterns:
.spritesExist
ld c, a ; c = [wNumSprites]
ld b, $10 ; number of sprite slots
- ld hl, wSpriteStateData2 + $0d
+ ld hl, wSpritePlayerStateData2PictureID
xor a
ld [hFourTileSpriteCount], a
.copyPictureIDLoop ; loop to copy picture ID from $C2XD to $C2XE
@@ -48,9 +48,9 @@ LoadMapSpriteTilePatterns:
ld l, a
dec b
jr nz, .copyPictureIDLoop
- ld hl, wSpriteStateData2 + $1e
+ ld hl, wSprite01StateData2ImageBaseOffset
.loadTilePatternLoop
- ld de, wSpriteStateData2 + $1d
+ ld de, wSprite01StateData2PictureID
; Check if the current picture ID has already had its tile patterns loaded.
; This done by looping through the previous sprite slots and seeing if any of
; their picture ID's match that of the current sprite slot.
@@ -70,7 +70,7 @@ LoadMapSpriteTilePatterns:
ld e, a
jr .checkIfAlreadyLoadedLoop
.notAlreadyLoaded
- ld de, wSpriteStateData2 + $0e
+ ld de, wSpritePlayerStateData2ImageBaseOffset
ld b, $01
; loop to find the highest tile pattern VRAM slot (among the first 10 slots) used by a previous sprite slot
; this is done in order to find the first free VRAM slot available
@@ -215,7 +215,7 @@ LoadMapSpriteTilePatterns:
ld l, a
dec c
jp nz, .loadTilePatternLoop
- ld hl, wSpriteStateData2 + $0d
+ ld hl, wSpritePlayerStateData2PictureID
ld b, $10
; the pictures ID's stored at $C2XD are no longer needed, so zero them
.zeroStoredPictureIDLoop
@@ -287,7 +287,7 @@ InitOutsideMapSprites:
jr nc, .noCarry2
inc d
.noCarry2
- ld hl, wSpriteStateData2 + $0d
+ ld hl, wSpritePlayerStateData2PictureID
ld a, SPRITE_RED
ld [hl], a
ld bc, wSpriteSet
@@ -323,7 +323,7 @@ InitOutsideMapSprites:
call LoadMapSpriteTilePatterns
pop af
ld [wNumSprites], a ; restore number of sprites
- ld hl, wSpriteStateData2 + $1e
+ ld hl, wSprite01StateData2ImageBaseOffset
ld b, $0f
; The VRAM tile pattern slots that LoadMapSpriteTilePatterns set are in the
; order of the map's sprite set, not the order of the actual sprites loaded
@@ -337,7 +337,7 @@ InitOutsideMapSprites:
dec b
jr nz, .zeroVRAMSlotsLoop
.skipLoadingSpriteSet
- ld hl, wSpriteStateData1 + $10
+ ld hl, wSprite01StateData1
; This loop stores the correct VRAM tile pattern slots according the sprite
; data from the map's header. Since the VRAM tile pattern slots are filled in
; the order of the sprite set, in order to find the VRAM tile pattern slot