From 476f9ba40d5b59fd724ac1234b34448df372d52c Mon Sep 17 00:00:00 2001 From: mid-kid Date: Sun, 12 May 2019 16:46:40 +0200 Subject: [PATCH] Define appropriate constants as EQU These constants are defined only once and shouldn't be redefined anyway. --- constants/deco_constants.asm | 8 ++++---- constants/item_constants.asm | 10 +++++----- docs/design_flaws.md | 2 +- macros/enum.asm | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/constants/deco_constants.asm b/constants/deco_constants.asm index f385e7cd7..d18018214 100644 --- a/constants/deco_constants.asm +++ b/constants/deco_constants.asm @@ -62,8 +62,8 @@ ENDM ; decorations: ; - DecorationAttributes (see data/decorations/attributes.asm) ; - DecorationIDs (see data/decorations/decorations.asm) -const_value = 1 -__enum__ = 0 + const_def 1 + enum_start ; FindOwnedBeds.beds values (see engine/overworld/decorations.asm) const BEDS deco FEATHERY_BED @@ -121,7 +121,7 @@ __enum__ = 0 deco GEODUDE_DOLL deco MACHOP_DOLL deco TENTACOOL_DOLL -NUM_NON_TROPHY_DECOS = __enum__ +NUM_NON_TROPHY_DECOS EQU __enum__ deco GOLD_TROPHY_DOLL deco SILVER_TROPHY_DOLL -NUM_DECOS = __enum__ +NUM_DECOS EQU __enum__ diff --git a/constants/item_constants.asm b/constants/item_constants.asm index ec70ebf01..4f7888c4b 100644 --- a/constants/item_constants.asm +++ b/constants/item_constants.asm @@ -199,7 +199,7 @@ add_tm: MACRO if !DEF(TM01) -TM01 = const_value +TM01 EQU const_value enum_start 1 endc define _\@_1, "TM_\1" @@ -260,11 +260,11 @@ ENDM add_tm FIRE_PUNCH ; f0 add_tm FURY_CUTTER ; f1 add_tm NIGHTMARE ; f2 -NUM_TMS = const_value - TM01 - 2 ; discount ITEM_C3 and ITEM_DC +NUM_TMS EQU const_value - TM01 - 2 ; discount ITEM_C3 and ITEM_DC add_hm: MACRO if !DEF(HM01) -HM01 = const_value +HM01 EQU const_value endc define _\@_1, "HM_\1" const _\@_1 @@ -278,7 +278,7 @@ ENDM add_hm FLASH ; f7 add_hm WHIRLPOOL ; f8 add_hm WATERFALL ; f9 -NUM_HMS = const_value - HM01 +NUM_HMS EQU const_value - HM01 add_mt: MACRO enum \1_TMNUM @@ -287,7 +287,7 @@ ENDM add_mt FLAMETHROWER add_mt THUNDERBOLT add_mt ICE_BEAM -NUM_TM_HM_TUTOR = __enum__ + -1 +NUM_TM_HM_TUTOR EQU __enum__ + -1 const ITEM_FA ; fa diff --git a/docs/design_flaws.md b/docs/design_flaws.md index 8669bc7a6..bcabff901 100644 --- a/docs/design_flaws.md +++ b/docs/design_flaws.md @@ -332,7 +332,7 @@ Edit `GetMapMusic`: add_tm PSYCHIC_M ; dd ... add_tm NIGHTMARE ; f2 -NUM_TMS = const_value - TM01 - 2 ; discount ITEM_C3 and ITEM_DC +NUM_TMS EQU const_value - TM01 - 2 ; discount ITEM_C3 and ITEM_DC ``` `GetTMHMNumber` and `GetNumberedTMHM` in [engine/items/items.asm](https://github.com/pret/pokecrystal/blob/master/engine/items/items.asm) have to compensate for this. diff --git a/macros/enum.asm b/macros/enum.asm index 009400743..003445be7 100644 --- a/macros/enum.asm +++ b/macros/enum.asm @@ -14,7 +14,7 @@ endc ENDM enum: MACRO -\1 = __enum__ +\1 EQU __enum__ __enum__ = __enum__ + __enumdir__ ENDM