Use some of the SPRITE_XXX_COUNT constants

This commit is contained in:
Raymond Dodge 2023-10-03 13:59:37 -04:00
parent 891ee4b8cb
commit 214ddbcb2e
No known key found for this signature in database
GPG Key ID: 59073651374C1D73
5 changed files with 7 additions and 6 deletions

View File

@ -174,7 +174,7 @@ SpriteDataPointers: ; 0x4000
SpriteDataPointer HighScoresErrorDialog2Sprite, SPRITE_HIGH_SCORES_ERROR_DIALOG_2
SpriteDataPointer HighScoresErrorDialog3Sprite, SPRITE_HIGH_SCORES_ERROR_DIALOG_3
SpriteDataPointer HighScoresErrorDialog4Sprite, SPRITE_HIGH_SCORES_ERROR_DIALOG_4
DEF SPRITE_HIGH_SCORES_ERROR_DIALOGS_LENGTH = const_value - SPRITE_HIGH_SCORES_ERROR_DIALOGS
DEF SPRITE_HIGH_SCORES_ERROR_DIALOGS_COUNT = const_value - SPRITE_HIGH_SCORES_ERROR_DIALOGS
SpriteDataPointer HighScoresDeleteDataSprite, SPRITE_HIGH_SCORES_DELETE_DATA
SpriteDataPointer HighScoresRightArrowSprite, SPRITE_HIGH_SCORES_ARROW_RIGHT
SpriteDataPointer HighScoresLeftArrowSprite, SPRITE_HIGH_SCORES_ARROW_LEFT

View File

@ -624,7 +624,7 @@ SendHighScoresAnimationData: ; 0xcf4b
db $00 ; terminator
Func_cf58: ; 0xcf58
cp $5
cp SPRITE_HIGH_SCORES_ERROR_DIALOGS_COUNT + 1
ret z
push af
lb de, $00, $02

View File

@ -189,7 +189,7 @@ DrawPikachuSavers_BlueStage: ; 0x1f448
sub e
ld c, a
ld a, [wPikachuSaverAnimationFrame]
add SPRITE_PIKACHU_SAVER_0
add SPRITE_PIKACHU_SAVER
call LoadSpriteData
ret
@ -381,8 +381,8 @@ DrawSlotGlow_BlueField: ; 0x1f55e
srl a
srl a
and $3
add SPRITE_SLOT_GLOW_0
cp SPRITE_SLOT_GLOW_2 + 1
add SPRITE_SLOT_GLOW
cp SPRITE_SLOT_GLOW + SPRITE_SLOT_GLOW_COUNT
call nz, LoadSpriteData
ret

View File

@ -22,6 +22,7 @@ DrawPinball: ; 0x17e81
srl a
srl a ; divide wBallRotation by 8 because
srl a ; there are 8 frames of the ball spinning
assert SPRITE_BALL_SPIN_COUNT == 8 ; or any power of two
and SPRITE_BALL_SPIN_COUNT - 1
add SPRITE_BALL_SPIN
call LoadSpriteData

View File

@ -594,6 +594,6 @@ DrawSlotGlow_RedField: ; 0x17fca
srl a
and $3
add SPRITE_SLOT_GLOW
cp SPRITE_SLOT_GLOW + 3
cp SPRITE_SLOT_GLOW + SPRITE_SLOT_GLOW_COUNT
call nz, LoadSpriteData
ret