summaryrefslogtreecommitdiff
path: root/engine/overworld/map_sprites.asm
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2020-07-06 19:03:05 -0400
committerRangi <remy.oukaour+rangi42@gmail.com>2020-07-06 19:03:05 -0400
commit772fcc7588a4e1fbe146a02b429cf64282c81dcb (patch)
treef491fa1d38e37ab10534b3f18422e0149ad0deca /engine/overworld/map_sprites.asm
parentc480632d5494d04f7f5f0298a31877a2293b564e (diff)
Specify the ldh instruction, don't turn ld into ldh
Diffstat (limited to 'engine/overworld/map_sprites.asm')
-rwxr-xr-xengine/overworld/map_sprites.asm14
1 files changed, 7 insertions, 7 deletions
diff --git a/engine/overworld/map_sprites.asm b/engine/overworld/map_sprites.asm
index 0de1befd..26a8f1bb 100755
--- a/engine/overworld/map_sprites.asm
+++ b/engine/overworld/map_sprites.asm
@@ -39,7 +39,7 @@ LoadMapSpriteTilePatterns:
ld b, $10 ; number of sprite slots
ld hl, wSpritePlayerStateData2PictureID
xor a
- ld [hFourTileSpriteCount], a
+ ldh [hFourTileSpriteCount], a
.copyPictureIDLoop ; loop to copy picture ID from $C2XD to $C2XE
ld a, [hli] ; $C2XD (sprite picture ID)
ld [hld], a ; $C2XE
@@ -98,14 +98,14 @@ LoadMapSpriteTilePatterns:
cp SPRITE_BALL ; is it a 4-tile sprite?
jr c, .notFourTileSprite
pop af
- ld a, [hFourTileSpriteCount]
+ ldh a, [hFourTileSpriteCount]
add 11
jr .storeVRAMSlot
.notFourTileSprite
pop af
.storeVRAMSlot
ld [hl], a ; store VRAM slot at $C2XE
- ld [hVRAMSlot], a ; used to determine if it's 4-tile sprite later
+ ldh [hVRAMSlot], a ; used to determine if it's 4-tile sprite later
ld a, b ; a = current sprite picture ID
dec a
add a
@@ -128,7 +128,7 @@ LoadMapSpriteTilePatterns:
push bc
ld hl, vNPCSprites ; VRAM base address
ld bc, $c0 ; number of bytes per VRAM slot
- ld a, [hVRAMSlot]
+ ldh a, [hVRAMSlot]
cp 11 ; is it a 4-tile sprite?
jr nc, .fourTileSpriteVRAMAddr
ld d, a
@@ -141,13 +141,13 @@ LoadMapSpriteTilePatterns:
jr .loadStillTilePattern
.fourTileSpriteVRAMAddr
ld hl, vSprites + $7c0 ; address for second 4-tile sprite
- ld a, [hFourTileSpriteCount]
+ ldh a, [hFourTileSpriteCount]
and a
jr nz, .loadStillTilePattern
; if it's the first 4-tile sprite
ld hl, vSprites + $780 ; address for first 4-tile sprite
inc a
- ld [hFourTileSpriteCount], a
+ ldh [hFourTileSpriteCount], a
.loadStillTilePattern
pop bc
pop de
@@ -167,7 +167,7 @@ LoadMapSpriteTilePatterns:
.skipFirstLoad
pop de
pop hl
- ld a, [hVRAMSlot]
+ ldh a, [hVRAMSlot]
cp 11 ; is it a 4-tile sprite?
jr nc, .skipSecondLoad ; if so, there is no second block
push de