diff options
| author | vulcandth <vulcandth@gmail.com> | 2022-06-06 16:25:34 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-06 17:25:34 -0400 |
| commit | c1ef7b75972fa4fbdf125bc85cc1a66f358151cd (patch) | |
| tree | bcf71939ec5573ed5001c4a4b4342d26e5d8f9b1 /constants/item_constants.asm | |
| parent | Improved Virtual Console patch identifiers (#85) (diff) | |
| download | pokeyellow-c1ef7b75972fa4fbdf125bc85cc1a66f358151cd.tar.gz pokeyellow-c1ef7b75972fa4fbdf125bc85cc1a66f358151cd.tar.xz pokeyellow-c1ef7b75972fa4fbdf125bc85cc1a66f358151cd.zip | |
RGBDS syntax updates (#86)
New MACRO and DEF syntax
Diffstat (limited to 'constants/item_constants.asm')
| -rw-r--r-- | constants/item_constants.asm | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/constants/item_constants.asm b/constants/item_constants.asm index 0d462f2e..cb4565ce 100644 --- a/constants/item_constants.asm +++ b/constants/item_constants.asm @@ -29,8 +29,8 @@ const POTION ; $14 const BOULDERBADGE ; $15 const CASCADEBADGE ; $16 -SAFARI_BAIT EQU $15 ; overload -SAFARI_ROCK EQU $16 ; overload +DEF SAFARI_BAIT EQU $15 ; overload +DEF SAFARI_ROCK EQU $16 ; overload const THUNDERBADGE ; $17 const RAINBOWBADGE ; $18 const SOULBADGE ; $19 @@ -92,7 +92,7 @@ SAFARI_ROCK EQU $16 ; overload const MAX_ETHER ; $51 const ELIXER ; $52 const MAX_ELIXER ; $53 -NUM_ITEMS EQU const_value - 1 +DEF NUM_ITEMS EQU const_value - 1 ; elevator floors use item IDs const FLOOR_B2F ; $54 @@ -109,54 +109,54 @@ NUM_ITEMS EQU const_value - 1 const FLOOR_10F ; $5F const FLOOR_11F ; $60 const FLOOR_B4F ; $61 -NUM_FLOORS EQU const_value - 1 - NUM_ITEMS +DEF NUM_FLOORS EQU const_value - 1 - NUM_ITEMS const_next $C4 ; HMs are defined before TMs, so the actual number of TM definitions ; is not yet available. The TM quantity is hard-coded here and must ; match the actual number below. -NUM_TMS EQU 50 +DEF NUM_TMS EQU 50 -__tmhm_value__ = NUM_TMS + 1 +DEF __tmhm_value__ = NUM_TMS + 1 -add_tmnum: MACRO -\1_TMNUM EQU __tmhm_value__ -__tmhm_value__ += 1 +MACRO add_tmnum + DEF \1_TMNUM EQU __tmhm_value__ + DEF __tmhm_value__ += 1 ENDM -add_hm: MACRO +MACRO add_hm ; Defines three constants: ; - HM_\1: the item id, starting at $C4 ; - \1_TMNUM: the learnable TM/HM flag, starting at 51 ; - HM##_MOVE: alias for the move id, equal to the value of \1 const HM_\1 -HM_VALUE = __tmhm_value__ - NUM_TMS -HM{02d:HM_VALUE}_MOVE EQU \1 + DEF HM_VALUE = __tmhm_value__ - NUM_TMS + DEF HM{02d:HM_VALUE}_MOVE EQU \1 add_tmnum \1 ENDM -HM01 EQU const_value +DEF HM01 EQU const_value add_hm CUT ; $C4 add_hm FLY ; $C5 add_hm SURF ; $C6 add_hm STRENGTH ; $C7 add_hm FLASH ; $C8 -NUM_HMS EQU const_value - HM01 +DEF NUM_HMS EQU const_value - HM01 -__tmhm_value__ = 1 +DEF __tmhm_value__ = 1 -add_tm: MACRO +MACRO add_tm ; Defines three constants: ; - TM_\1: the item id, starting at $C9 ; - \1_TMNUM: the learnable TM/HM flag, starting at 1 ; - TM##_MOVE: alias for the move id, equal to the value of \1 const TM_\1 -TM{02d:__tmhm_value__}_MOVE EQU \1 + DEF TM{02d:__tmhm_value__}_MOVE EQU \1 add_tmnum \1 ENDM -TM01 EQU const_value +DEF TM01 EQU const_value add_tm MEGA_PUNCH ; $C9 add_tm RAZOR_WIND ; $CA add_tm SWORDS_DANCE ; $CB @@ -209,13 +209,13 @@ TM01 EQU const_value add_tm SUBSTITUTE ; $FA ASSERT NUM_TMS == const_value - TM01, "NUM_TMS ({d:NUM_TMS}) does not match the number of add_tm definitions" -NUM_TM_HM EQU NUM_TMS + NUM_HMS +DEF NUM_TM_HM EQU NUM_TMS + NUM_HMS ; 50 TMs + 5 HMs = 55 learnable TM/HM flags per Pokémon. ; These fit in 7 bytes, with one unused bit left over. -__tmhm_value__ = NUM_TM_HM + 1 -UNUSED_TMNUM EQU __tmhm_value__ +DEF __tmhm_value__ = NUM_TM_HM + 1 +DEF UNUSED_TMNUM EQU __tmhm_value__ ; used for Time Capsule held item compatibility -TWISTEDSPOON_GSC EQU $60 -LIGHT_BALL_GSC EQU $a3 +DEF TWISTEDSPOON_GSC EQU $60 +DEF LIGHT_BALL_GSC EQU $a3 |
