shithub: pokecrystal

Download patch

ref: 476f9ba40d5b59fd724ac1234b34448df372d52c
parent: 649c8d38da25569a7789128a0da5da72bc280d1a
author: mid-kid <[email protected]>
date: Sun May 12 12:46:40 EDT 2019

Define appropriate constants as EQU

These constants are defined only once and shouldn't be redefined anyway.

--- a/constants/deco_constants.asm
+++ b/constants/deco_constants.asm
@@ -62,8 +62,8 @@
 ; 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 @@
 	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__
--- 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 @@
 	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 @@
 	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 @@
 	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
 
--- a/docs/design_flaws.md
+++ b/docs/design_flaws.md
@@ -332,7 +332,7 @@
 	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.
--- a/macros/enum.asm
+++ b/macros/enum.asm
@@ -14,7 +14,7 @@
 ENDM
 
 enum: MACRO
-\1 = __enum__
+\1 EQU __enum__
 __enum__ = __enum__ + __enumdir__
 ENDM