Skip to content

Commit

Permalink
Verify that there aren't too many OAM constants
Browse files Browse the repository at this point in the history
Fixes pret#1062
  • Loading branch information
Rangi42 authored and Idain committed Sep 11, 2023
1 parent 99d5ce2 commit f3db4a2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions constants/battle_anim_constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,9 @@ DEF NUM_BATTLEANIMFRAMESETS EQU const_value
const BATTLEANIMOAMSET_D7
DEF NUM_BATTLEANIMOAMSETS EQU const_value

assert NUM_BATTLEANIMOAMSETS <= FIRST_OAM_CMD, \
"BATTLEANIMOAMSET_* constants overlap oam*_command constants"

; BattleBGEffects indexes (see engine/battle_anims/bg_effects.asm)
const_def 1
const ANIM_BG_FLASH_INVERTED
Expand Down
3 changes: 3 additions & 0 deletions constants/sprite_anim_constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -342,3 +342,6 @@ DEF NUM_SPRITE_ANIM_FRAMESETS EQU const_value
const SPRITE_ANIM_OAMSET_MAGNET_TRAIN_GREEN_1 ; 8e
const SPRITE_ANIM_OAMSET_MAGNET_TRAIN_GREEN_2 ; 8f
DEF NUM_SPRITE_ANIM_OAMSETS EQU const_value

assert NUM_SPRITE_ANIM_OAMSETS <= FIRST_OAM_CMD, \
"SPRITE_ANIM_OAMSET_* constants overlap oam*_command constants"
2 changes: 2 additions & 0 deletions macros/scripts/oam_anims.asm
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@ ENDM
MACRO oamdelete
db oamdelete_command
ENDM

DEF FIRST_OAM_CMD EQU LOW(const_value + 1)

0 comments on commit f3db4a2

Please sign in to comment.