summaryrefslogtreecommitdiff
path: root/constants/deco_constants.asm
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2021-03-03 22:22:41 -0500
committerRangi <remy.oukaour+rangi42@gmail.com>2021-03-04 00:15:03 -0500
commit40902ffe244544d638567642e4e01b9c5801db23 (patch)
tree4abf9ac20786fdf66bb298b3ec7935cef2c71d07 /constants/deco_constants.asm
parent9c17fb14c8068d6662b9ca1cb048ed206b6770ee (diff)
Verify data table sizes with table_width and assert_table_length macros
This was discussed in #706 It also uncovered some off-by-one issues with defining some constants. A few structs now use rsreset/_RS to define their offset constants, as discussed in #739
Diffstat (limited to 'constants/deco_constants.asm')
-rw-r--r--constants/deco_constants.asm15
1 files changed, 13 insertions, 2 deletions
diff --git a/constants/deco_constants.asm b/constants/deco_constants.asm
index 29aea301e..a00849277 100644
--- a/constants/deco_constants.asm
+++ b/constants/deco_constants.asm
@@ -1,3 +1,13 @@
+; decoration attributes
+ const_def
+ const DECOATTR_TYPE
+ const DECOATTR_NAME
+ const DECOATTR_ACTION
+ const DECOATTR_EVENT_FLAG
+ const_skip ; high DECOATTR_EVENT_FLAG byte
+ const DECOATTR_SPRITE
+DECOATTR_STRUCT_LENGTH EQU const_value
+
; decoration types
const_def 1
const DECO_PLANT
@@ -6,6 +16,7 @@
const DECO_POSTER
const DECO_DOLL
const DECO_BIGDOLL
+NUM_DECO_TYPES EQU const_value - 1
; DecorationNames indexes (see data/decorations/names.asm)
const_def 1
@@ -51,8 +62,7 @@
const PUT_AWAY_BIG_DOLL
const SET_UP_DOLL
const PUT_AWAY_DOLL
- const SET_UP_ORNAMENT
- const PUT_AWAY_ORNAMENT
+NUM_DECO_ACTIONS EQU const_value - 1
__deco_value__ = 0
@@ -127,3 +137,4 @@ NUM_NON_TROPHY_DECOS EQU __deco_value__
deco GOLD_TROPHY_DOLL
deco SILVER_TROPHY_DOLL
NUM_DECOS EQU __deco_value__
+NUM_DECO_CATEGORIES EQU const_value - 1 - NUM_DECOS