mirror of
https://github.com/thornAvery/kep-hack.git
synced 2026-02-06 15:45:24 +13:00
Specify the ldh instruction, don't turn ld into ldh
This commit is contained in:
parent
c480632d54
commit
772fcc7588
219 changed files with 2556 additions and 2556 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue