From c086de0c986330b09cd5e9fa384b950107ee4955 Mon Sep 17 00:00:00 2001 From: Rangi Date: Wed, 8 Jul 2020 16:20:15 -0400 Subject: [PATCH] Use const_skip and const_next macros for brevity --- constants/battle_anim_constants.asm | 8 +- constants/battle_constants.asm | 14 +- constants/credits_constants.asm | 14 +- constants/deco_constants.asm | 6 +- constants/event_flags.asm | 736 +++------------------------ constants/item_data_constants.asm | 34 +- constants/map_object_constants.asm | 33 +- constants/menu_constants.asm | 2 +- constants/move_constants.asm | 5 +- constants/phone_constants.asm | 16 +- constants/pokemon_constants.asm | 3 +- constants/sprite_constants.asm | 6 +- constants/sprite_data_constants.asm | 2 +- constants/trainer_data_constants.asm | 37 +- constants/type_constants.asm | 10 +- engine/items/items.asm | 2 +- engine/phone/phone.asm | 2 +- macros/const.asm | 16 + macros/scripts/audio.asm | 4 +- macros/scripts/battle_commands.asm | 4 +- macros/scripts/gfx_anims.asm | 40 +- macros/scripts/movement.asm | 2 +- macros/scripts/text.asm | 2 +- macros/scripts/trade_anims.asm | 14 +- maps/SproutTower1F.asm | 2 +- maps/SproutTower2F.asm | 2 +- wram.asm | 2 - 27 files changed, 198 insertions(+), 820 deletions(-) diff --git a/constants/battle_anim_constants.asm b/constants/battle_anim_constants.asm index fcd512b97..cfcdda84a 100644 --- a/constants/battle_anim_constants.asm +++ b/constants/battle_anim_constants.asm @@ -17,13 +17,7 @@ const BATTLEANIMSTRUCT_ANON_JT_INDEX const BATTLEANIMSTRUCT_0F const BATTLEANIMSTRUCT_10 - const BATTLEANIMSTRUCT_11 - const BATTLEANIMSTRUCT_12 - const BATTLEANIMSTRUCT_13 - const BATTLEANIMSTRUCT_14 - const BATTLEANIMSTRUCT_15 - const BATTLEANIMSTRUCT_16 - const BATTLEANIMSTRUCT_17 + const_skip 7 BATTLEANIMSTRUCT_LENGTH EQU const_value NUM_ANIM_OBJECTS EQU 10 ; see wActiveAnimObjects diff --git a/constants/battle_constants.asm b/constants/battle_constants.asm index 7c323f627..99b573690 100644 --- a/constants/battle_constants.asm +++ b/constants/battle_constants.asm @@ -192,7 +192,7 @@ ALL_STATUS EQU (1 << PSN) | (1 << BRN) | (1 << FRZ) | (1 << PAR) | SLP const SUBSTATUS_X_ACCURACY const SUBSTATUS_MIST const SUBSTATUS_FOCUS_ENERGY - const SUBSTATUS_UNKNOWN_1 + const_skip const SUBSTATUS_SUBSTITUTE const SUBSTATUS_RECHARGE const SUBSTATUS_RAGE @@ -201,8 +201,8 @@ ALL_STATUS EQU (1 << PSN) | (1 << BRN) | (1 << FRZ) | (1 << PAR) | SLP ; wPlayerSubStatus5 or wEnemySubStatus5 bit flags const_def const SUBSTATUS_TOXIC - const SUBSTATUS_UNKNOWN_2 - const SUBSTATUS_UNKNOWN_3 + const_skip + const_skip const SUBSTATUS_TRANSFORMED const SUBSTATUS_ENCORED const SUBSTATUS_LOCK_ON @@ -212,7 +212,7 @@ ALL_STATUS EQU (1 << PSN) | (1 << BRN) | (1 << FRZ) | (1 << PAR) | SLP ; wPlayerScreens or wEnemyScreens bit flags const_def const SCREENS_SPIKES - const SCREENS_UNUSED + const_skip const SCREENS_SAFEGUARD const SCREENS_LIGHT_SCREEN const SCREENS_REFLECT @@ -239,9 +239,9 @@ ALL_STATUS EQU (1 << PSN) | (1 << BRN) | (1 << FRZ) | (1 << PAR) | SLP const BATTLEACTION_SWITCH4 const BATTLEACTION_SWITCH5 const BATTLEACTION_SWITCH6 - const BATTLEACTION_A - const BATTLEACTION_B - const BATTLEACTION_C + const_skip + const_skip + const_skip const BATTLEACTION_SKIPTURN const BATTLEACTION_STRUGGLE const BATTLEACTION_FORFEIT diff --git a/constants/credits_constants.asm b/constants/credits_constants.asm index a9669b05d..a3d20eb46 100644 --- a/constants/credits_constants.asm +++ b/constants/credits_constants.asm @@ -105,11 +105,11 @@ const PAAD_TESTING ; CreditsScript indexes (see data/credits_script.asm) - const_def -7 - const CREDITS_THEEND - const CREDITS_WAIT2 - const CREDITS_MUSIC - const CREDITS_CLEAR - const CREDITS_SCENE - const CREDITS_WAIT + const_def -1, -1 const CREDITS_END + const CREDITS_WAIT + const CREDITS_SCENE + const CREDITS_CLEAR + const CREDITS_MUSIC + const CREDITS_WAIT2 + const CREDITS_THEEND diff --git a/constants/deco_constants.asm b/constants/deco_constants.asm index 4aab559dc..29aea301e 100644 --- a/constants/deco_constants.asm +++ b/constants/deco_constants.asm @@ -1,5 +1,5 @@ ; decoration types -const_value = 1 + const_def 1 const DECO_PLANT const DECO_BED const DECO_CARPET @@ -8,7 +8,7 @@ const_value = 1 const DECO_BIGDOLL ; DecorationNames indexes (see data/decorations/names.asm) -const_value = 1 + const_def 1 const PUT_IT_AWAY const MAGNAPLANT const TROPICPLANT @@ -36,7 +36,7 @@ const_value = 1 const GREEN_CARPET ; DoDecorationAction2.DecoActions indexes (see engine/overworld/decorations.asm) -const_value = 1 + const_def 1 const SET_UP_BED const PUT_AWAY_BED const SET_UP_CARPET diff --git a/constants/event_flags.asm b/constants/event_flags.asm index f01e50baa..86b0a3380 100644 --- a/constants/event_flags.asm +++ b/constants/event_flags.asm @@ -1,4 +1,5 @@ ; wEventFlags bit flags + const_def ; The first eight flags are reset upon reloading the map const EVENT_TEMPORARY_UNTIL_MAP_RELOAD_1 @@ -25,7 +26,7 @@ const EVENT_GOT_HM04_STRENGTH const EVENT_GOT_HM05_FLASH const EVENT_GOT_HM06_WHIRLPOOL - const EVENT_016 ; unused + const_skip ; unused ; Rods const EVENT_GOT_OLD_ROD const EVENT_GOT_GOOD_ROD @@ -64,8 +65,8 @@ const EVENT_LAKE_OF_RAGE_EXPLAINED_WEIRD_MAGIKARP const EVENT_LAKE_OF_RAGE_ASKED_FOR_MAGIKARP const EVENT_LAKE_OF_RAGE_ELIXIR_ON_STANDBY - const EVENT_03B ; unused - const EVENT_03C ; unused + const_skip ; unused + const_skip ; unused const EVENT_HEALED_MOOMOO const EVENT_GOT_TM13_SNORE_FROM_MOOMOO_FARM const EVENT_TALKED_TO_FARMER_ABOUT_MOOMOO @@ -135,9 +136,9 @@ const EVENT_TIN_TOWER_5F_HIDDEN_FULL_RESTORE const EVENT_TIN_TOWER_5F_HIDDEN_CARBOS const EVENT_BURNED_TOWER_1F_HIDDEN_ETHER - const EVENT_081 ; unused - const EVENT_082 ; unused - const EVENT_083 ; unused + const_skip ; unused + const_skip ; unused + const_skip ; unused const EVENT_NATIONAL_PARK_HIDDEN_FULL_HEAL const EVENT_OLIVINE_LIGHTHOUSE_5F_HIDDEN_HYPER_POTION const EVENT_TEAM_ROCKET_BASE_B1F_HIDDEN_REVIVE @@ -201,13 +202,9 @@ const EVENT_GAVE_GS_BALL_TO_KURT const EVENT_FOREST_IS_RESTLESS const EVENT_ANSWERED_DRAGON_MASTER_QUIZ_WRONG -; Unused - const EVENT_0C2 - const EVENT_0C3 - const EVENT_0C4 - const EVENT_0C5 - const EVENT_0C6 - const EVENT_0C7 +; Unused: next 6 events + + const_next 200 ; Kanto story events const EVENT_GOT_NUGGET_FROM_GUY const EVENT_RETURNED_MACHINE_PART @@ -271,346 +268,9 @@ const EVENT_DANA_GAVE_THUNDERSTONE const EVENT_TULLY_GAVE_WATER_STONE const EVENT_TIFFANY_GAVE_PINK_BOW -; Unused - const EVENT_105 - const EVENT_106 - const EVENT_107 - const EVENT_108 - const EVENT_109 - const EVENT_10A - const EVENT_10B - const EVENT_10C - const EVENT_10D - const EVENT_10E - const EVENT_10F - const EVENT_110 - const EVENT_111 - const EVENT_112 - const EVENT_113 - const EVENT_114 - const EVENT_115 - const EVENT_116 - const EVENT_117 - const EVENT_118 - const EVENT_119 - const EVENT_11A - const EVENT_11B - const EVENT_11C - const EVENT_11D - const EVENT_11E - const EVENT_11F - const EVENT_120 - const EVENT_121 - const EVENT_122 - const EVENT_123 - const EVENT_124 - const EVENT_125 - const EVENT_126 - const EVENT_127 - const EVENT_128 - const EVENT_129 - const EVENT_12A - const EVENT_12B - const EVENT_12C - const EVENT_12D - const EVENT_12E - const EVENT_12F - const EVENT_130 - const EVENT_131 - const EVENT_132 - const EVENT_133 - const EVENT_134 - const EVENT_135 - const EVENT_136 - const EVENT_137 - const EVENT_138 - const EVENT_139 - const EVENT_13A - const EVENT_13B - const EVENT_13C - const EVENT_13D - const EVENT_13E - const EVENT_13F - const EVENT_140 - const EVENT_141 - const EVENT_142 - const EVENT_143 - const EVENT_144 - const EVENT_145 - const EVENT_146 - const EVENT_147 - const EVENT_148 - const EVENT_149 - const EVENT_14A - const EVENT_14B - const EVENT_14C - const EVENT_14D - const EVENT_14E - const EVENT_14F - const EVENT_150 - const EVENT_151 - const EVENT_152 - const EVENT_153 - const EVENT_154 - const EVENT_155 - const EVENT_156 - const EVENT_157 - const EVENT_158 - const EVENT_159 - const EVENT_15A - const EVENT_15B - const EVENT_15C - const EVENT_15D - const EVENT_15E - const EVENT_15F - const EVENT_160 - const EVENT_161 - const EVENT_162 - const EVENT_163 - const EVENT_164 - const EVENT_165 - const EVENT_166 - const EVENT_167 - const EVENT_168 - const EVENT_169 - const EVENT_16A - const EVENT_16B - const EVENT_16C - const EVENT_16D - const EVENT_16E - const EVENT_16F - const EVENT_170 - const EVENT_171 - const EVENT_172 - const EVENT_173 - const EVENT_174 - const EVENT_175 - const EVENT_176 - const EVENT_177 - const EVENT_178 - const EVENT_179 - const EVENT_17A - const EVENT_17B - const EVENT_17C - const EVENT_17D - const EVENT_17E - const EVENT_17F - const EVENT_180 - const EVENT_181 - const EVENT_182 - const EVENT_183 - const EVENT_184 - const EVENT_185 - const EVENT_186 - const EVENT_187 - const EVENT_188 - const EVENT_189 - const EVENT_18A - const EVENT_18B - const EVENT_18C - const EVENT_18D - const EVENT_18E - const EVENT_18F - const EVENT_190 - const EVENT_191 - const EVENT_192 - const EVENT_193 - const EVENT_194 - const EVENT_195 - const EVENT_196 - const EVENT_197 - const EVENT_198 - const EVENT_199 - const EVENT_19A - const EVENT_19B - const EVENT_19C - const EVENT_19D - const EVENT_19E - const EVENT_19F - const EVENT_1A0 - const EVENT_1A1 - const EVENT_1A2 - const EVENT_1A3 - const EVENT_1A4 - const EVENT_1A5 - const EVENT_1A6 - const EVENT_1A7 - const EVENT_1A8 - const EVENT_1A9 - const EVENT_1AA - const EVENT_1AB - const EVENT_1AC - const EVENT_1AD - const EVENT_1AE - const EVENT_1AF - const EVENT_1B0 - const EVENT_1B1 - const EVENT_1B2 - const EVENT_1B3 - const EVENT_1B4 - const EVENT_1B5 - const EVENT_1B6 - const EVENT_1B7 - const EVENT_1B8 - const EVENT_1B9 - const EVENT_1BA - const EVENT_1BB - const EVENT_1BC - const EVENT_1BD - const EVENT_1BE - const EVENT_1BF - const EVENT_1C0 - const EVENT_1C1 - const EVENT_1C2 - const EVENT_1C3 - const EVENT_1C4 - const EVENT_1C5 - const EVENT_1C6 - const EVENT_1C7 - const EVENT_1C8 - const EVENT_1C9 - const EVENT_1CA - const EVENT_1CB - const EVENT_1CC - const EVENT_1CD - const EVENT_1CE - const EVENT_1CF - const EVENT_1D0 - const EVENT_1D1 - const EVENT_1D2 - const EVENT_1D3 - const EVENT_1D4 - const EVENT_1D5 - const EVENT_1D6 - const EVENT_1D7 - const EVENT_1D8 - const EVENT_1D9 - const EVENT_1DA - const EVENT_1DB - const EVENT_1DC - const EVENT_1DD - const EVENT_1DE - const EVENT_1DF - const EVENT_1E0 - const EVENT_1E1 - const EVENT_1E2 - const EVENT_1E3 - const EVENT_1E4 - const EVENT_1E5 - const EVENT_1E6 - const EVENT_1E7 - const EVENT_1E8 - const EVENT_1E9 - const EVENT_1EA - const EVENT_1EB - const EVENT_1EC - const EVENT_1ED - const EVENT_1EE - const EVENT_1EF - const EVENT_1F0 - const EVENT_1F1 - const EVENT_1F2 - const EVENT_1F3 - const EVENT_1F4 - const EVENT_1F5 - const EVENT_1F6 - const EVENT_1F7 - const EVENT_1F8 - const EVENT_1F9 - const EVENT_1FA - const EVENT_1FB - const EVENT_1FC - const EVENT_1FD - const EVENT_1FE - const EVENT_1FF - const EVENT_200 - const EVENT_201 - const EVENT_202 - const EVENT_203 - const EVENT_204 - const EVENT_205 - const EVENT_206 - const EVENT_207 - const EVENT_208 - const EVENT_209 - const EVENT_20A - const EVENT_20B - const EVENT_20C - const EVENT_20D - const EVENT_20E - const EVENT_20F - const EVENT_210 - const EVENT_211 - const EVENT_212 - const EVENT_213 - const EVENT_214 - const EVENT_215 - const EVENT_216 - const EVENT_217 - const EVENT_218 - const EVENT_219 - const EVENT_21A - const EVENT_21B - const EVENT_21C - const EVENT_21D - const EVENT_21E - const EVENT_21F - const EVENT_220 - const EVENT_221 - const EVENT_222 - const EVENT_223 - const EVENT_224 - const EVENT_225 - const EVENT_226 - const EVENT_227 - const EVENT_228 - const EVENT_229 - const EVENT_22A - const EVENT_22B - const EVENT_22C - const EVENT_22D - const EVENT_22E - const EVENT_22F - const EVENT_230 - const EVENT_231 - const EVENT_232 - const EVENT_233 - const EVENT_234 - const EVENT_235 - const EVENT_236 - const EVENT_237 - const EVENT_238 - const EVENT_239 - const EVENT_23A - const EVENT_23B - const EVENT_23C - const EVENT_23D - const EVENT_23E - const EVENT_23F - const EVENT_240 - const EVENT_241 - const EVENT_242 - const EVENT_243 - const EVENT_244 - const EVENT_245 - const EVENT_246 - const EVENT_247 - const EVENT_248 - const EVENT_249 - const EVENT_24A - const EVENT_24B - const EVENT_24C - const EVENT_24D - const EVENT_24E - const EVENT_24F - const EVENT_250 - const EVENT_251 - const EVENT_252 - const EVENT_253 - const EVENT_254 - const EVENT_255 - const EVENT_256 - const EVENT_257 +; Unused: next 339 events + + const_next 600 ; Kurt Apricorn events const EVENT_GAVE_KURT_RED_APRICORN const EVENT_GAVE_KURT_BLU_APRICORN @@ -621,11 +281,11 @@ const EVENT_GAVE_KURT_PNK_APRICORN ; Phone events const EVENT_JACK_ASKED_FOR_PHONE_NUMBER - const EVENT_260 ; unused + const_skip ; unused const EVENT_BEVERLY_ASKED_FOR_PHONE_NUMBER - const EVENT_262 ; unused + const_skip ; unused const EVENT_HUEY_ASKED_FOR_PHONE_NUMBER - const EVENT_264 ; unused + const_skip ; unused const EVENT_GOT_PROTEIN_FROM_HUEY const EVENT_GOT_HP_UP_FROM_JOEY const EVENT_GOT_CARBOS_FROM_VANCE @@ -633,58 +293,58 @@ const EVENT_GOT_CALCIUM_FROM_ERIN const EVENT_KENJI_ON_BREAK const EVENT_GAVEN_ASKED_FOR_PHONE_NUMBER - const EVENT_26C ; unused + const_skip ; unused const EVENT_BETH_ASKED_FOR_PHONE_NUMBER - const EVENT_26E ; unused + const_skip ; unused const EVENT_JOSE_ASKED_FOR_PHONE_NUMBER - const EVENT_270 ; unused + const_skip ; unused const EVENT_REENA_ASKED_FOR_PHONE_NUMBER - const EVENT_272 ; unused + const_skip ; unused const EVENT_JOEY_ASKED_FOR_PHONE_NUMBER - const EVENT_274 ; unused + const_skip ; unused const EVENT_WADE_ASKED_FOR_PHONE_NUMBER - const EVENT_276 ; unused + const_skip ; unused const EVENT_RALPH_ASKED_FOR_PHONE_NUMBER - const EVENT_278 ; unused + const_skip ; unused const EVENT_LIZ_ASKED_FOR_PHONE_NUMBER - const EVENT_27A ; unused + const_skip ; unused const EVENT_ANTHONY_ASKED_FOR_PHONE_NUMBER - const EVENT_27C ; unused + const_skip ; unused const EVENT_TODD_ASKED_FOR_PHONE_NUMBER - const EVENT_27E ; unused + const_skip ; unused const EVENT_GINA_ASKED_FOR_PHONE_NUMBER - const EVENT_280 ; 280 ; unused + const_skip ; unused const EVENT_IRWIN_ASKED_FOR_PHONE_NUMBER - const EVENT_282 ; unused + const_skip ; unused const EVENT_ARNIE_ASKED_FOR_PHONE_NUMBER - const EVENT_284 ; unused + const_skip ; unused const EVENT_ALAN_ASKED_FOR_PHONE_NUMBER - const EVENT_286 ; unused - const EVENT_287 ; unused - const EVENT_288 ; unused + const_skip ; unused + const_skip ; unused + const_skip ; unused const EVENT_DANA_ASKED_FOR_PHONE_NUMBER - const EVENT_28A ; unused + const_skip ; unused const EVENT_CHAD_ASKED_FOR_PHONE_NUMBER - const EVENT_28C ; unused + const_skip ; unused const EVENT_DEREK_ASKED_FOR_PHONE_NUMBER - const EVENT_28E ; unused + const_skip ; unused const EVENT_TULLY_ASKED_FOR_PHONE_NUMBER - const EVENT_290 ; 290 ; unused + const_skip ; unused const EVENT_BRENT_ASKED_FOR_PHONE_NUMBER - const EVENT_292 ; unused + const_skip ; unused const EVENT_TIFFANY_ASKED_FOR_PHONE_NUMBER - const EVENT_294 ; unused + const_skip ; unused const EVENT_VANCE_ASKED_FOR_PHONE_NUMBER - const EVENT_296 ; unused + const_skip ; unused const EVENT_WILTON_ASKED_FOR_PHONE_NUMBER - const EVENT_298 ; unused + const_skip ; unused const EVENT_KENJI_ASKED_FOR_PHONE_NUMBER - const EVENT_29A ; unused + const_skip ; unused const EVENT_PARRY_ASKED_FOR_PHONE_NUMBER - const EVENT_29C ; unused + const_skip ; unused const EVENT_ERIN_ASKED_FOR_PHONE_NUMBER const EVENT_BUENA_OFFERED_HER_PHONE_NUMBER_NO_BLUE_CARD - const EVENT_29F ; unused + const_skip ; unused ; Ruins of Alph puzzles const EVENT_SOLVED_HO_OH_PUZZLE const EVENT_SOLVED_KABUTO_PUZZLE @@ -848,176 +508,11 @@ const EVENT_BUENA_OFFERED_HER_PHONE_NUMBER const EVENT_MET_BUENA const EVENT_GOT_ODD_EGG - const EVENT_33F ; unused + const_skip ; unused const EVENT_GOT_GS_BALL_FROM_POKECOM_CENTER -; Unused - const EVENT_341 - const EVENT_342 - const EVENT_343 - const EVENT_344 - const EVENT_345 - const EVENT_346 - const EVENT_347 - const EVENT_348 - const EVENT_349 - const EVENT_34A - const EVENT_34B - const EVENT_34C - const EVENT_34D - const EVENT_34E - const EVENT_34F - const EVENT_350 - const EVENT_351 - const EVENT_352 - const EVENT_353 - const EVENT_354 - const EVENT_355 - const EVENT_356 - const EVENT_357 - const EVENT_358 - const EVENT_359 - const EVENT_35A - const EVENT_35B - const EVENT_35C - const EVENT_35D - const EVENT_35E - const EVENT_35F - const EVENT_360 - const EVENT_361 - const EVENT_362 - const EVENT_363 - const EVENT_364 - const EVENT_365 - const EVENT_366 - const EVENT_367 - const EVENT_368 - const EVENT_369 - const EVENT_36A - const EVENT_36B - const EVENT_36C - const EVENT_36D - const EVENT_36E - const EVENT_36F - const EVENT_370 - const EVENT_371 - const EVENT_372 - const EVENT_373 - const EVENT_374 - const EVENT_375 - const EVENT_376 - const EVENT_377 - const EVENT_378 - const EVENT_379 - const EVENT_37A - const EVENT_37B - const EVENT_37C - const EVENT_37D - const EVENT_37E - const EVENT_37F - const EVENT_380 - const EVENT_381 - const EVENT_382 - const EVENT_383 - const EVENT_384 - const EVENT_385 - const EVENT_386 - const EVENT_387 - const EVENT_388 - const EVENT_389 - const EVENT_38A - const EVENT_38B - const EVENT_38C - const EVENT_38D - const EVENT_38E - const EVENT_38F - const EVENT_390 - const EVENT_391 - const EVENT_392 - const EVENT_393 - const EVENT_394 - const EVENT_395 - const EVENT_396 - const EVENT_397 - const EVENT_398 - const EVENT_399 - const EVENT_39A - const EVENT_39B - const EVENT_39C - const EVENT_39D - const EVENT_39E - const EVENT_39F - const EVENT_3A0 - const EVENT_3A1 - const EVENT_3A2 - const EVENT_3A3 - const EVENT_3A4 - const EVENT_3A5 - const EVENT_3A6 - const EVENT_3A7 - const EVENT_3A8 - const EVENT_3A9 - const EVENT_3AA - const EVENT_3AB - const EVENT_3AC - const EVENT_3AD - const EVENT_3AE - const EVENT_3AF - const EVENT_3B0 - const EVENT_3B1 - const EVENT_3B2 - const EVENT_3B3 - const EVENT_3B4 - const EVENT_3B5 - const EVENT_3B6 - const EVENT_3B7 - const EVENT_3B8 - const EVENT_3B9 - const EVENT_3BA - const EVENT_3BB - const EVENT_3BC - const EVENT_3BD - const EVENT_3BE - const EVENT_3BF - const EVENT_3C0 - const EVENT_3C1 - const EVENT_3C2 - const EVENT_3C3 - const EVENT_3C4 - const EVENT_3C5 - const EVENT_3C6 - const EVENT_3C7 - const EVENT_3C8 - const EVENT_3C9 - const EVENT_3CA - const EVENT_3CB - const EVENT_3CC - const EVENT_3CD - const EVENT_3CE - const EVENT_3CF - const EVENT_3D0 - const EVENT_3D1 - const EVENT_3D2 - const EVENT_3D3 - const EVENT_3D4 - const EVENT_3D5 - const EVENT_3D6 - const EVENT_3D7 - const EVENT_3D8 - const EVENT_3D9 - const EVENT_3DA - const EVENT_3DB - const EVENT_3DC - const EVENT_3DD - const EVENT_3DE - const EVENT_3DF - const EVENT_3E0 - const EVENT_3E1 - const EVENT_3E2 - const EVENT_3E3 - const EVENT_3E4 - const EVENT_3E5 - const EVENT_3E6 - const EVENT_3E7 +; Unused: next 167 events + + const_next 1000 ; Trainer flags ; Swimmer F const EVENT_BEAT_SWIMMERF_ELAINE @@ -1097,7 +592,7 @@ const EVENT_BEAT_BURGLAR_DUNCAN const EVENT_BEAT_BURGLAR_EDDIE const EVENT_BEAT_BURGLAR_COREY - const EVENT_430 ; unused + const_skip ; unused ; Biker const EVENT_BEAT_BIKER_BENNY const EVENT_BEAT_BIKER_KAZU @@ -1289,7 +784,7 @@ const EVENT_BEAT_POKEFANF_BEVERLY3 const EVENT_BEAT_POKEFANF_GEORGIA ; Kimono Girl - const EVENT_4DE ; unused + const_skip ; unused const EVENT_BEAT_KIMONO_GIRL_NAOKO const EVENT_BEAT_KIMONO_GIRL_SAYO const EVENT_BEAT_KIMONO_GIRL_ZUKI @@ -1547,123 +1042,9 @@ const EVENT_BEAT_SAGE_GAKU const EVENT_BEAT_SAGE_MASA const EVENT_BEAT_SAGE_KOJI -; Unused - const EVENT_5CC - const EVENT_5CD - const EVENT_5CE - const EVENT_5CF - const EVENT_5D0 - const EVENT_5D1 - const EVENT_5D2 - const EVENT_5D3 - const EVENT_5D4 - const EVENT_5D5 - const EVENT_5D6 - const EVENT_5D7 - const EVENT_5D8 - const EVENT_5D9 - const EVENT_5DA - const EVENT_5DB - const EVENT_5DC - const EVENT_5DD - const EVENT_5DE - const EVENT_5DF - const EVENT_5E0 - const EVENT_5E1 - const EVENT_5E2 - const EVENT_5E3 - const EVENT_5E4 - const EVENT_5E5 - const EVENT_5E6 - const EVENT_5E7 - const EVENT_5E8 - const EVENT_5E9 - const EVENT_5EA - const EVENT_5EB - const EVENT_5EC - const EVENT_5ED - const EVENT_5EE - const EVENT_5EF - const EVENT_5F0 - const EVENT_5F1 - const EVENT_5F2 - const EVENT_5F3 - const EVENT_5F4 - const EVENT_5F5 - const EVENT_5F6 - const EVENT_5F7 - const EVENT_5F8 - const EVENT_5F9 - const EVENT_5FA - const EVENT_5FB - const EVENT_5FC - const EVENT_5FD - const EVENT_5FE - const EVENT_5FF - const EVENT_600 - const EVENT_601 - const EVENT_602 - const EVENT_603 - const EVENT_604 - const EVENT_605 - const EVENT_606 - const EVENT_607 - const EVENT_608 - const EVENT_609 - const EVENT_60A - const EVENT_60B - const EVENT_60C - const EVENT_60D - const EVENT_60E - const EVENT_60F - const EVENT_610 - const EVENT_611 - const EVENT_612 - const EVENT_613 - const EVENT_614 - const EVENT_615 - const EVENT_616 - const EVENT_617 - const EVENT_618 - const EVENT_619 - const EVENT_61A - const EVENT_61B - const EVENT_61C - const EVENT_61D - const EVENT_61E - const EVENT_61F - const EVENT_620 - const EVENT_621 - const EVENT_622 - const EVENT_623 - const EVENT_624 - const EVENT_625 - const EVENT_626 - const EVENT_627 - const EVENT_628 - const EVENT_629 - const EVENT_62A - const EVENT_62B - const EVENT_62C - const EVENT_62D - const EVENT_62E - const EVENT_62F - const EVENT_630 - const EVENT_631 - const EVENT_632 - const EVENT_633 - const EVENT_634 - const EVENT_635 - const EVENT_636 - const EVENT_637 - const EVENT_638 - const EVENT_639 - const EVENT_63A - const EVENT_63B - const EVENT_63C - const EVENT_63D - const EVENT_63E - const EVENT_63F +; Unused: next 116 events + + const_next 1600 ; Sprite visibility flags ; When these events are cleared, the sprite becomes visible; when set, the sprite is hidden. ; The map script command macros `disappear` and `appear` set/clear these flags and immediately apply the effect on visibility. @@ -1676,8 +1057,8 @@ const EVENT_VIOLET_CITY_RARE_CANDY const EVENT_LAKE_OF_RAGE_ELIXER const EVENT_LAKE_OF_RAGE_TM_DETECT - const EVENT_SPROUT_TOWER1F_PARLYZ_HEAL - const EVENT_SPROUT_TOWER2F_X_ACCURACY + const EVENT_SPROUT_TOWER_1F_PARLYZ_HEAL + const EVENT_SPROUT_TOWER_2F_X_ACCURACY const EVENT_SPROUT_TOWER_3F_POTION const EVENT_SPROUT_TOWER_3F_ESCAPE_ROPE const EVENT_TIN_TOWER_3F_FULL_HEAL @@ -1848,7 +1229,7 @@ const EVENT_COPYCAT_2 const EVENT_GOLDENROD_SALE_OFF const EVENT_GOLDENROD_SALE_ON - const EVENT_6F2 ; unused + const_skip ; unused const EVENT_ILEX_FOREST_APPRENTICE const EVENT_ILEX_FOREST_CHARCOAL_MASTER const EVENT_CHARCOAL_KILN_FARFETCH_D @@ -1970,6 +1351,8 @@ const EVENT_FLORIA_AT_SUDOWOODO const EVENT_GOLDENROD_CITY_MOVE_TUTOR const EVENT_GOLDENROD_GAME_CORNER_MOVE_TUTOR + + const_next 1900 ; Kanto people const EVENT_ROUTE_24_ROCKET const EVENT_CERULEAN_GYM_ROCKET @@ -2073,4 +1456,7 @@ const EVENT_RADIO_TOWER_5F_ULTRA_BALL const EVENT_DARK_CAVE_VIOLET_ENTRANCE_DIRE_HIT const EVENT_BATTLE_TOWER_OUTSIDE_SAILOR -NUM_EVENTS EQU const_value ; 7d0 +; Unused: next 48 events + + const_next 2048 +NUM_EVENTS EQU const_value ; 800 diff --git a/constants/item_data_constants.asm b/constants/item_data_constants.asm index 5040ab047..4c295d5b3 100644 --- a/constants/item_data_constants.asm +++ b/constants/item_data_constants.asm @@ -1,6 +1,6 @@ ; item_attributes struct members (see data/items/attributes.asm) const_def - const ITEMATTR_PRICE + const ITEMATTR_PRICE_LO const ITEMATTR_PRICE_HI const ITEMATTR_EFFECT const ITEMATTR_PARAM @@ -19,10 +19,12 @@ ITEMATTR_STRUCT_LENGTH EQU const_value ; item menu types ; UseItem.dw indexes (see engine/items/pack.asm) ; UseRegisteredItem.SwitchTo indexes (see engine/overworld/select_menu.asm) -ITEMMENU_NOUSE EQU 0 -ITEMMENU_CURRENT EQU 4 -ITEMMENU_PARTY EQU 5 -ITEMMENU_CLOSE EQU 6 + const_def + const ITEMMENU_NOUSE ; 0 + const_skip 3 + const ITEMMENU_CURRENT ; 4 + const ITEMMENU_PARTY ; 5 + const ITEMMENU_CLOSE ; 6 ; item actions CANT_SELECT_F EQU 6 @@ -57,13 +59,13 @@ MAIL_STRUCT_LENGTH EQU $2f ; mailmsg struct const HELD_BERRY const HELD_2 const HELD_LEFTOVERS - const HELD_4 + const_skip const HELD_5 const HELD_RESTORE_PP - const HELD_7 + const_skip const HELD_CLEANSE_TAG - const_def 10 + const_next 10 const HELD_HEAL_POISON const HELD_HEAL_FREEZE const HELD_HEAL_BURN @@ -72,7 +74,7 @@ MAIL_STRUCT_LENGTH EQU $2f ; mailmsg struct const HELD_HEAL_STATUS const HELD_HEAL_CONFUSION - const_def 20 + const_next 20 const HELD_PREVENT_POISON const HELD_PREVENT_BURN const HELD_PREVENT_FREEZE @@ -80,7 +82,7 @@ MAIL_STRUCT_LENGTH EQU $2f ; mailmsg struct const HELD_PREVENT_PARALYZE const HELD_PREVENT_CONFUSE - const_def 30 + const_next 30 const HELD_30 const HELD_ATTACK_UP const HELD_DEFENSE_UP @@ -91,12 +93,12 @@ MAIL_STRUCT_LENGTH EQU $2f ; mailmsg struct const HELD_EVASION_UP const HELD_38 - const_def 40 - const HELD_40 - const HELD_41 + const_next 40 + const_skip + const_skip const HELD_METAL_POWDER - const_def 50 + const_next 50 const HELD_NORMAL_BOOST const HELD_FIGHTING_BOOST const HELD_FLYING_BOOST @@ -115,7 +117,7 @@ MAIL_STRUCT_LENGTH EQU $2f ; mailmsg struct const HELD_DARK_BOOST const HELD_STEEL_BOOST - const_def 70 + const_next 70 const HELD_CATCH_CHANCE const HELD_71 const HELD_ESCAPE @@ -124,5 +126,5 @@ MAIL_STRUCT_LENGTH EQU $2f ; mailmsg struct const HELD_FLINCH const HELD_AMULET_COIN const HELD_BRIGHTPOWDER - const HELD_78 + const_skip const HELD_FOCUS_BAND diff --git a/constants/map_object_constants.asm b/constants/map_object_constants.asm index f1f81d64c..a0f625226 100644 --- a/constants/map_object_constants.asm +++ b/constants/map_object_constants.asm @@ -33,8 +33,8 @@ const OBJECT_1E ; 1e const OBJECT_1F ; 1f const OBJECT_RANGE ; 20 - ; 21-27 are not used -OBJECT_LENGTH EQU 40 + const_skip 7 +OBJECT_LENGTH EQU const_value NUM_OBJECT_STRUCTS EQU 13 ; see wObjectStructs ; object_struct OBJECT_FACING values @@ -99,21 +99,20 @@ ABSOLUTE_TILE_ID EQU 1 << ABSOLUTE_TILE_ID_F ; map_object struct members (see macros/wram.asm) const_def const MAPOBJECT_OBJECT_STRUCT_ID ; 0 - const MAPOBJECT_SPRITE ; 1 - const MAPOBJECT_Y_COORD ; 2 - const MAPOBJECT_X_COORD ; 3 - const MAPOBJECT_MOVEMENT ; 4 - const MAPOBJECT_RADIUS ; 5 - const MAPOBJECT_HOUR ; 6 - const MAPOBJECT_TIMEOFDAY ; 7 - const MAPOBJECT_COLOR ; 8 - const MAPOBJECT_RANGE ; 9 - const MAPOBJECT_SCRIPT_POINTER ; a - const MAPOBJECT_POINTER_HI ; b - const MAPOBJECT_EVENT_FLAG ; c - const MAPOBJECT_FLAG_HI ; d - const MAPOBJECT_E ; unused - const MAPOBJECT_F ; unused + const MAPOBJECT_SPRITE ; 1 + const MAPOBJECT_Y_COORD ; 2 + const MAPOBJECT_X_COORD ; 3 + const MAPOBJECT_MOVEMENT ; 4 + const MAPOBJECT_RADIUS ; 5 + const MAPOBJECT_HOUR ; 6 + const MAPOBJECT_TIMEOFDAY ; 7 + const MAPOBJECT_COLOR ; 8 + const MAPOBJECT_RANGE ; 9 + const MAPOBJECT_SCRIPT_POINTER ; a + const_skip ; high MAPOBJECT_SCRIPT_POINTER byte + const MAPOBJECT_EVENT_FLAG ; c + const_skip ; high MAPOBJECT_EVENT_FLAG byte + const_skip 2 ; unused MAPOBJECT_LENGTH EQU const_value ; SpriteMovementData struct members (see data/sprites/map_objects.asm) diff --git a/constants/menu_constants.asm b/constants/menu_constants.asm index b2249db06..031a5e2bf 100644 --- a/constants/menu_constants.asm +++ b/constants/menu_constants.asm @@ -87,7 +87,7 @@ HMENURETURN_ASM EQU %11111111 const PARTYMENUACTION_GIVE_ITEM const PARTYMENUACTION_MOBILE ; mobile ; PrintPartyMenuActionText arguments (see engine/pokemon/party_menu.asm) - const_def $f0 + const_next $f0 const PARTYMENUTEXT_HEAL_PSN const PARTYMENUTEXT_HEAL_BRN const PARTYMENUTEXT_HEAL_FRZ diff --git a/constants/move_constants.asm b/constants/move_constants.asm index b26f86d03..1a3d4f1ae 100644 --- a/constants/move_constants.asm +++ b/constants/move_constants.asm @@ -259,11 +259,8 @@ const BEAT_UP ; fb NUM_ATTACKS EQU const_value - 1 - const MOVE_OR_ANIM_FC ; fc - const MOVE_OR_ANIM_FD ; fd - const MOVE_OR_ANIM_FE ; fe - ; Battle animations use the same constants as the moves up to this point + const_next $ff const ANIM_SWEET_SCENT_2 ; ff const ANIM_THROW_POKE_BALL ; 100 const ANIM_SEND_OUT_MON ; 101 diff --git a/constants/phone_constants.asm b/constants/phone_constants.asm index 2005bd3cb..273044c4d 100644 --- a/constants/phone_constants.asm +++ b/constants/phone_constants.asm @@ -8,9 +8,9 @@ const PHONE_SCHOOLBOY_JACK const PHONE_POKEFAN_BEVERLY const PHONE_SAILOR_HUEY - const PHONE_08 - const PHONE_09 - const PHONE_0A + const_skip + const_skip + const_skip const PHONE_COOLTRAINERM_GAVEN const PHONE_COOLTRAINERF_BETH const PHONE_BIRDKEEPER_JOSE @@ -25,7 +25,7 @@ const PHONE_JUGGLER_IRWIN const PHONE_BUG_CATCHER_ARNIE const PHONE_SCHOOLBOY_ALAN - const PHONE_19 + const_skip const PHONE_LASS_DANA const PHONE_SCHOOLBOY_CHAD const PHONE_POKEFANM_DEREK @@ -59,12 +59,12 @@ const PHONE_CONTACT_MAP_NUMBER const PHONE_CONTACT_SCRIPT1_TIME const PHONE_CONTACT_SCRIPT1_BANK - const PHONE_CONTACT_SCRIPT1_ADDR_LO - const PHONE_CONTACT_SCRIPT1_ADDR_HI + const PHONE_CONTACT_SCRIPT1_ADDR + const_skip ; high PHONE_CONTACT_SCRIPT1_ADDR byte const PHONE_CONTACT_SCRIPT2_TIME const PHONE_CONTACT_SCRIPT2_BANK - const PHONE_CONTACT_SCRIPT2_ADDR_LO - const PHONE_CONTACT_SCRIPT2_ADDR_HI + const PHONE_CONTACT_SCRIPT2_ADDR + const_skip ; high PHONE_CONTACT_SCRIPT2_ADDR byte PHONE_CONTACT_SIZE EQU const_value ; maximum number of pokegear contacts diff --git a/constants/pokemon_constants.asm b/constants/pokemon_constants.asm index c28657b83..edb9fc2e0 100644 --- a/constants/pokemon_constants.asm +++ b/constants/pokemon_constants.asm @@ -272,9 +272,8 @@ JOHTO_POKEMON EQU const_value const HO_OH ; fa const CELEBI ; fb NUM_POKEMON EQU const_value - 1 - const MON_FC ; fc + const_skip ; fc const EGG ; fd - const MON_FE ; fe ; Unown forms ; indexes for: diff --git a/constants/sprite_constants.asm b/constants/sprite_constants.asm index 8f089ee39..e93ca5da2 100644 --- a/constants/sprite_constants.asm +++ b/constants/sprite_constants.asm @@ -106,7 +106,7 @@ const SPRITE_STANDING_YOUNGSTER ; 66 ; SpriteMons indexes (see data/sprites/sprite_mons.asm) - const_def $80 + const_next $80 SPRITE_POKEMON EQU const_value const SPRITE_UNOWN ; 80 const SPRITE_GEODUDE ; 81 @@ -145,12 +145,12 @@ SPRITE_POKEMON EQU const_value const SPRITE_HO_OH ; a2 ; special GetMonSprite values (see engine/overworld/overworld.asm) - const_def $e0 + const_next $e0 const SPRITE_DAY_CARE_MON_1 ; e0 const SPRITE_DAY_CARE_MON_2 ; e1 ; wVariableSprites indexes (see wram.asm) - const_def $f0 + const_next $f0 SPRITE_VARS EQU const_value const SPRITE_CONSOLE ; f0 const SPRITE_DOLL_1 ; f1 diff --git a/constants/sprite_data_constants.asm b/constants/sprite_data_constants.asm index 329833b1e..271faca15 100644 --- a/constants/sprite_data_constants.asm +++ b/constants/sprite_data_constants.asm @@ -1,7 +1,7 @@ ; overworld_sprite struct members (see data/sprites.asm) const_def const SPRITEDATA_ADDR ; 0 - const SPRITEDATA_ADDR_HI ; 1 + const_skip ; high SPRITEDATA_ADDR byte const SPRITEDATA_SIZE ; 2 const SPRITEDATA_BANK ; 3 const SPRITEDATA_TYPE ; 4 diff --git a/constants/trainer_data_constants.asm b/constants/trainer_data_constants.asm index 00c1c6c38..0f8932535 100644 --- a/constants/trainer_data_constants.asm +++ b/constants/trainer_data_constants.asm @@ -4,16 +4,14 @@ const TRNATTR_ITEM2 ; 1 const TRNATTR_BASEMONEY ; 2 const TRNATTR_AI_MOVE_WEIGHTS ; 3 - const TRNATTR_AI2 ; 4 + const_skip ; high TRNATTR_AI_MOVE_WEIGHTS byte const TRNATTR_AI_ITEM_SWITCH ; 5 - const TRNATTR_AI4 ; 6 + const_skip ; high TRNATTR_AI_ITEM_SWITCH byte NUM_TRAINER_ATTRIBUTES EQU const_value ; TRNATTR_AI_MOVE_WEIGHTS bit flags (wEnemyTrainerAIFlags) ; AIScoringPointers indexes (see engine/battle/ai/move.asm) const_def - const NO_AI -const_value = 0 shift_const AI_BASIC shift_const AI_SETUP shift_const AI_TYPES @@ -24,27 +22,24 @@ const_value = 0 shift_const AI_CAUTIOUS shift_const AI_STATUS shift_const AI_RISKY - shift_const AI_10 - shift_const AI_11 - shift_const AI_12 - shift_const AI_13 - shift_const AI_14 - shift_const AI_15 +NO_AI EQU 0 ; TRNATTR_AI_ITEM_SWITCH bit flags -CONTEXT_USE_F EQU 6 -UNKNOWN_USE_F EQU 5 -ALWAYS_USE_F EQU 4 -SWITCH_SOMETIMES_F EQU 2 -SWITCH_RARELY_F EQU 1 -SWITCH_OFTEN_F EQU 0 + const_def + const SWITCH_OFTEN_F ; 0 + const SWITCH_RARELY_F ; 1 + const SWITCH_SOMETIMES_F ; 2 + const_skip ; 3 + const ALWAYS_USE_F ; 4 + const UNKNOWN_USE_F ; 5 + const CONTEXT_USE_F ; 6 -CONTEXT_USE EQU 1 << CONTEXT_USE_F -UNKNOWN_USE EQU 1 << UNKNOWN_USE_F -ALWAYS_USE EQU 1 << ALWAYS_USE_F -SWITCH_SOMETIMES EQU 1 << SWITCH_SOMETIMES_F -SWITCH_RARELY EQU 1 << SWITCH_RARELY_F SWITCH_OFTEN EQU 1 << SWITCH_OFTEN_F +SWITCH_RARELY EQU 1 << SWITCH_RARELY_F +SWITCH_SOMETIMES EQU 1 << SWITCH_SOMETIMES_F +ALWAYS_USE EQU 1 << ALWAYS_USE_F +UNKNOWN_USE EQU 1 << UNKNOWN_USE_F +CONTEXT_USE EQU 1 << CONTEXT_USE_F ; TrainerTypes indexes (see engine/battle/read_trainer_party.asm) const_def diff --git a/constants/type_constants.asm b/constants/type_constants.asm index 3fb9649aa..c18d71c73 100644 --- a/constants/type_constants.asm +++ b/constants/type_constants.asm @@ -19,15 +19,7 @@ PHYSICAL EQU const_value const STEEL UNUSED_TYPES EQU const_value - const TYPE_10 - const TYPE_11 - const TYPE_12 - const TYPE_13 - const TYPE_14 - const TYPE_15 - const TYPE_16 - const TYPE_17 - const TYPE_18 + const_next 19 const CURSE_TYPE UNUSED_TYPES_END EQU const_value diff --git a/engine/items/items.asm b/engine/items/items.asm index ef0f10dda..a08f76d31 100644 --- a/engine/items/items.asm +++ b/engine/items/items.asm @@ -570,7 +570,7 @@ GetItemPrice: ; Return the price of wCurItem in de. push hl push bc - ld a, ITEMATTR_PRICE + ld a, ITEMATTR_PRICE_LO call GetItemAttr ld e, a ld a, ITEMATTR_PRICE_HI diff --git a/engine/phone/phone.asm b/engine/phone/phone.asm index cb11aefde..042fe38f3 100644 --- a/engine/phone/phone.asm +++ b/engine/phone/phone.asm @@ -353,7 +353,7 @@ Function90199: ld hl, PHONE_CONTACT_SCRIPT1_BANK add hl, de ld b, [hl] - ld hl, PHONE_CONTACT_SCRIPT1_ADDR_LO + ld hl, PHONE_CONTACT_SCRIPT1_ADDR add hl, de ld a, [hli] ld h, [hl] diff --git a/macros/const.asm b/macros/const.asm index 40179cdb5..5dfc3bca1 100644 --- a/macros/const.asm +++ b/macros/const.asm @@ -22,3 +22,19 @@ shift_const: MACRO \1 EQU (1 << const_value) const_value = const_value + const_inc ENDM + +const_skip: MACRO +if _NARG >= 1 +const_value = const_value + const_inc * (\1) +else +const_value = const_value + const_inc +endc +ENDM + +const_next: MACRO +if (const_value > 0 && \1 < const_value) || (const_value < 0 && \1 > const_value) +fail "const_next cannot go backwards from {const_value} to \1" +else +const_value = \1 +endc +ENDM diff --git a/macros/scripts/audio.asm b/macros/scripts/audio.asm index 1447ea625..2776c293f 100644 --- a/macros/scripts/audio.asm +++ b/macros/scripts/audio.asm @@ -41,7 +41,7 @@ noise_note: MACRO ENDM ; MusicCommands indexes (see audio/engine.asm) - const_def $d0, 8 + const_def $d0 FIRST_MUSIC_CMD EQU const_value const octave_cmd ; $d0 @@ -49,7 +49,7 @@ octave: MACRO db octave_cmd | 8 - (\1) ; octave ENDM -const_inc = 1 + const_skip 7 ; all octave values const note_type_cmd ; $d8 note_type: MACRO diff --git a/macros/scripts/battle_commands.asm b/macros/scripts/battle_commands.asm index da694858e..ad4480199 100644 --- a/macros/scripts/battle_commands.asm +++ b/macros/scripts/battle_commands.asm @@ -181,6 +181,6 @@ ENDM command startloop ; ae command curl ; af - const_def $fe - command endturn ; fe + const_def -1, -1 command endmove ; ff + command endturn ; fe diff --git a/macros/scripts/gfx_anims.asm b/macros/scripts/gfx_anims.asm index ded61b87f..61c18fa8b 100644 --- a/macros/scripts/gfx_anims.asm +++ b/macros/scripts/gfx_anims.asm @@ -12,12 +12,16 @@ endc db x ENDM - const_def $fc + const_def -1, -1 - const delanim_command ; $fc -delanim: MACRO -; Removes the object from the screen, as opposed to `endanim` which just stops all motion - db delanim_command + const endanim_command ; $ff +endanim: MACRO + db endanim_command +ENDM + + const dorestart_command ; $fe +dorestart: MACRO + db dorestart_command ENDM const dowait_command ; $fd @@ -26,28 +30,24 @@ dowait: MACRO db \1 ; frames ENDM - const dorestart_command ; $fe -dorestart: MACRO - db dorestart_command -ENDM - - const endanim_command ; $ff -endanim: MACRO - db endanim_command + const delanim_command ; $fc +delanim: MACRO +; Removes the object from the screen, as opposed to `endanim` which just stops all motion + db delanim_command ENDM ; Used for pic animations -const_value = $fd - - const dorepeat_command ; $fd -dorepeat: MACRO - db dorepeat_command - db \1 ; command offset to jump to -ENDM + const_def -2, -1 const setrepeat_command ; $fe setrepeat: MACRO db setrepeat_command db \1 ; amount of times to repeat ENDM + + const dorepeat_command ; $fd +dorepeat: MACRO + db dorepeat_command + db \1 ; command offset to jump to +ENDM diff --git a/macros/scripts/movement.asm b/macros/scripts/movement.asm index 0bbb335d8..76e06b8e4 100644 --- a/macros/scripts/movement.asm +++ b/macros/scripts/movement.asm @@ -117,7 +117,7 @@ else endc ENDM -const_value = const_value + 8 + const_skip 8 ; all step_sleep values const movement_step_end ; $47 step_end: MACRO diff --git a/macros/scripts/text.asm b/macros/scripts/text.asm index 726294cad..2622cee54 100644 --- a/macros/scripts/text.asm +++ b/macros/scripts/text.asm @@ -137,7 +137,7 @@ text_far: MACRO db BANK(\1) ENDM - const_def $50 + const_next $50 const TX_END ; $50 text_end: MACRO diff --git a/macros/scripts/trade_anims.asm b/macros/scripts/trade_anims.asm index c704ddfc6..29299d534 100644 --- a/macros/scripts/trade_anims.asm +++ b/macros/scripts/trade_anims.asm @@ -21,7 +21,7 @@ tradeanim_enter_link_tube: MACRO db tradeanim_enter_link_tube_command ENDM - const_def $05 + const_skip ; continues tradeanim_enter_link_tube_command const tradeanim_exit_link_tube_command ; $05 tradeanim_exit_link_tube: MACRO @@ -33,14 +33,14 @@ tradeanim_tube_to_ot: MACRO db tradeanim_tube_to_ot_command ENDM - const_def $0e + const_skip 7 ; continues tradeanim_tube_to_ot_command const tradeanim_tube_to_player_command ; $0e tradeanim_tube_to_player: MACRO db tradeanim_tube_to_player_command ENDM - const_def $16 + const_skip 7 ; continues tradeanim_tube_to_player_command const tradeanim_sent_to_ot_text_command ; $16 tradeanim_sent_to_ot_text: MACRO @@ -92,7 +92,7 @@ tradeanim_scroll_out_right: MACRO db tradeanim_scroll_out_right_command ENDM - const_def $21 + const_skip ; continues tradeanim_scroll_out_right_command const tradeanim_wait_80_command ; $21 tradeanim_wait_80: MACRO @@ -119,7 +119,7 @@ tradeanim_wait_anim: MACRO db tradeanim_wait_anim_command ENDM - const_def $27 + const_skip ; continues tradeanim_wait_anim_command const tradeanim_poof_command ; $27 tradeanim_poof: MACRO @@ -184,7 +184,7 @@ mobiletradeanim_sendmon: MACRO db mobiletradeanim_sendmon_command ENDM - const_def $05 + const_skip ; continues mobiletradeanim_sendmon_command const mobiletradeanim_05_command ; $05 mobiletradeanim_05: MACRO @@ -206,7 +206,7 @@ mobiletradeanim_receivemon: MACRO db mobiletradeanim_receivemon_command ENDM - const_def $0b + const_skip 2 ; continues mobiletradeanim_receivemon_command const mobiletradeanim_showgetmon_command ; $0b mobiletradeanim_showgetmon: MACRO diff --git a/maps/SproutTower1F.asm b/maps/SproutTower1F.asm index 19766d205..5bb526ee6 100644 --- a/maps/SproutTower1F.asm +++ b/maps/SproutTower1F.asm @@ -122,4 +122,4 @@ SproutTower1F_MapEvents: object_event 11, 12, SPRITE_GRANNY, SPRITEMOVEDATA_STANDING_LEFT, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, SproutTower1FGrannyScript, -1 object_event 9, 9, SPRITE_TEACHER, SPRITEMOVEDATA_STANDING_UP, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, SproutTower1FTeacherScript, -1 object_event 3, 5, SPRITE_SAGE, SPRITEMOVEDATA_STANDING_UP, 0, 0, -1, -1, PAL_NPC_BLUE, OBJECTTYPE_TRAINER, 4, TrainerSageChow, -1 - object_event 16, 7, SPRITE_POKE_BALL, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_ITEMBALL, 0, SproutTower1FParlyzHeal, EVENT_SPROUT_TOWER1F_PARLYZ_HEAL + object_event 16, 7, SPRITE_POKE_BALL, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_ITEMBALL, 0, SproutTower1FParlyzHeal, EVENT_SPROUT_TOWER_1F_PARLYZ_HEAL diff --git a/maps/SproutTower2F.asm b/maps/SproutTower2F.asm index 6f145aff2..c2dfa415d 100644 --- a/maps/SproutTower2F.asm +++ b/maps/SproutTower2F.asm @@ -99,4 +99,4 @@ SproutTower2F_MapEvents: db 3 ; object events object_event 12, 3, SPRITE_SAGE, SPRITEMOVEDATA_SPINRANDOM_FAST, 0, 0, -1, -1, PAL_NPC_BLUE, OBJECTTYPE_TRAINER, 4, TrainerSageNico, -1 object_event 9, 14, SPRITE_SAGE, SPRITEMOVEDATA_STANDING_LEFT, 0, 0, -1, -1, PAL_NPC_BLUE, OBJECTTYPE_TRAINER, 5, TrainerSageEdmond, -1 - object_event 3, 1, SPRITE_POKE_BALL, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_ITEMBALL, 0, SproutTower2FXAccuracy, EVENT_SPROUT_TOWER2F_X_ACCURACY + object_event 3, 1, SPRITE_POKE_BALL, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_ITEMBALL, 0, SproutTower2FXAccuracy, EVENT_SPROUT_TOWER_2F_X_ACCURACY diff --git a/wram.asm b/wram.asm index 938015078..cc278956c 100644 --- a/wram.asm +++ b/wram.asm @@ -2752,8 +2752,6 @@ wErinFightCount:: db wEventFlags:: flag_array NUM_EVENTS - ds 6 - wCurBox:: db ds 2