Skip to content

Commit

Permalink
Fix/update sprite y-coord offscreen definitions (#1108)
Browse files Browse the repository at this point in the history
  • Loading branch information
vulcandth authored Apr 14, 2024
1 parent e8079e6 commit b0b5ed2
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions constants/gfx_constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,5 @@ DEF SPRITE_GFX_LIST_CAPACITY EQU 32 ; see wUsedSprites
const ANIM_MON_HOF
const ANIM_MON_EGG1
const ANIM_MON_EGG2

DEF OAM_YCOORD_HIDDEN EQU 160 ; hides an OAM offscreen
2 changes: 1 addition & 1 deletion engine/movie/splash.asm
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ GameFreakPresentsInit:
call InitSpriteAnimStruct
ld hl, SPRITEANIMSTRUCT_YOFFSET
add hl, bc
ld [hl], 160
ld [hl], OAM_YCOORD_HIDDEN
ld hl, SPRITEANIMSTRUCT_VAR1
add hl, bc
ld [hl], 96
Expand Down
2 changes: 1 addition & 1 deletion engine/overworld/map_objects.asm
Original file line number Diff line number Diff line change
Expand Up @@ -2757,7 +2757,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 b0b5ed2

Please sign in to comment.