From 772fcc7588a4e1fbe146a02b429cf64282c81dcb Mon Sep 17 00:00:00 2001 From: Rangi Date: Mon, 6 Jul 2020 19:03:05 -0400 Subject: Specify the ldh instruction, don't turn ld into ldh --- engine/overworld/map_sprites.asm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'engine/overworld/map_sprites.asm') 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 -- cgit v1.3.1-sl0p