Fix/update sprite y-coord offscreen definitions (pret/pokecrystal#1108)

This commit is contained in:
vulcandth 2024-04-14 15:55:46 -05:00
parent 41c224f460
commit 202797a008
4 changed files with 5 additions and 3 deletions

View File

@ -43,3 +43,5 @@ DEF SPRITEOAMSTRUCT_LENGTH EQU _RS
DEF NUM_SPRITE_OAM_STRUCTS EQU 40 ; see wShadowOAM
DEF SPRITE_GFX_LIST_CAPACITY EQU 12 ; see wUsedSprites
DEF OAM_YCOORD_HIDDEN EQU 160 ; hides an OAM offscreen

View File

@ -2692,7 +2692,7 @@ _UpdateSprites::
ld h, HIGH(wShadowOAM)
ld de, SPRITEOAMSTRUCT_LENGTH
ld a, b
ld c, SCREEN_HEIGHT_PX + 2 * TILE_WIDTH
ld c, OAM_YCOORD_HIDDEN
.loop
ld [hl], c ; y
add hl, de

View File

@ -31,7 +31,7 @@ _SwitchPartyMons:
ld de, SPRITEOAMSTRUCT_LENGTH
ld c, 4
.gfx_loop
ld [hl], SCREEN_WIDTH_PX ; y (off-screen)
ld [hl], OAM_YCOORD_HIDDEN
add hl, de
dec c
jr nz, .gfx_loop

View File

@ -14,7 +14,7 @@ HideSprites::
ld hl, wShadowOAMSprite00YCoord
ld de, SPRITEOAMSTRUCT_LENGTH
ld b, NUM_SPRITE_OAM_STRUCTS
ld a, SCREEN_WIDTH_PX
ld a, OAM_YCOORD_HIDDEN
.loop
ld [hl], a ; y
add hl, de