Skip to content

Commit

Permalink
Fix/update sprite y-coord offscreen definitions (pret/pokecrystal#1108)
Browse files Browse the repository at this point in the history
  • Loading branch information
vulcandth committed Apr 14, 2024
1 parent 41c224f commit 202797a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions constants/gfx_constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion engine/overworld/map_objects.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion engine/pokemon/switchpartymons.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion home/clear_sprites.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 202797a

Please sign in to comment.