From cd647df3b551cea154317a572ace9052727aa72b Mon Sep 17 00:00:00 2001 From: Rangi <35663410+Rangi42@users.noreply.github.com> Date: Fri, 27 Dec 2024 12:52:24 -0500 Subject: [PATCH] Don't pass redundant label names to `table_width` and `list_start` (#484) --- data/battle/stat_mod_names.asm | 2 +- data/battle/stat_names.asm | 2 +- data/battle_anims/base_coords.asm | 2 +- data/battle_anims/frame_blocks.asm | 2 +- data/battle_anims/subanimations.asm | 2 +- data/credits/credits_text.asm | 2 +- data/events/hidden_coins.asm | 2 +- data/events/hidden_item_coords.asm | 2 +- data/events/trades.asm | 2 +- data/growth_rates.asm | 2 +- data/items/names.asm | 2 +- data/items/prices.asm | 2 +- data/maps/hide_show_data.asm | 4 ++-- data/maps/map_header_banks.asm | 2 +- data/maps/map_header_pointers.asm | 2 +- data/maps/songs.asm | 2 +- data/maps/sprite_sets.asm | 6 ++--- data/maps/town_map_entries.asm | 2 +- data/moves/animations.asm | 2 +- data/moves/effects_pointers.asm | 2 +- data/moves/moves.asm | 2 +- data/moves/names.asm | 2 +- data/moves/sfx.asm | 2 +- data/moves/tmhm_moves.asm | 2 +- data/pokemon/base_stats.asm | 2 +- data/pokemon/cries.asm | 2 +- data/pokemon/dex_entries.asm | 2 +- data/pokemon/dex_order.asm | 2 +- data/pokemon/evos_moves.asm | 2 +- data/pokemon/names.asm | 2 +- data/pokemon/palettes.asm | 2 +- data/sgb/sgb_palettes.asm | 2 +- data/sprites/sprites.asm | 2 +- data/tilemaps.asm | 2 +- data/tilesets/tileset_headers.asm | 2 +- data/tilesets/warp_tile_ids.asm | 2 +- data/trainers/ai_pointers.asm | 2 +- data/trainers/move_choices.asm | 2 +- data/trainers/name_pointers.asm | 2 +- data/trainers/names.asm | 2 +- data/trainers/parties.asm | 2 +- data/trainers/pic_pointers_money.asm | 2 +- data/types/names.asm | 2 +- data/wild/grass_water.asm | 2 +- data/yes_no_menu_strings.asm | 2 +- engine/battle/battle_transitions.asm | 2 +- macros/asserts.asm | 35 ++++++++++++++++++---------- scripts/CeruleanBadgeHouse.asm | 4 ++-- 48 files changed, 74 insertions(+), 63 deletions(-) diff --git a/data/battle/stat_mod_names.asm b/data/battle/stat_mod_names.asm index 287e87e3a5..63c956d73a 100644 --- a/data/battle/stat_mod_names.asm +++ b/data/battle/stat_mod_names.asm @@ -2,7 +2,7 @@ ; The relevant move effect IDs correspond to the stats StatModTextStrings: - list_start StatModTextStrings + list_start li "ATTACK" li "DEFENSE" li "SPEED" diff --git a/data/battle/stat_names.asm b/data/battle/stat_names.asm index 413ab9914d..30401a99bc 100644 --- a/data/battle/stat_names.asm +++ b/data/battle/stat_names.asm @@ -1,7 +1,7 @@ ; Stats that vitamins can raise or lower VitaminStats: - list_start VitaminStats + list_start li "HEALTH" li "ATTACK" li "DEFENSE" diff --git a/data/battle_anims/base_coords.asm b/data/battle_anims/base_coords.asm index 109a06e810..72efb04acb 100644 --- a/data/battle_anims/base_coords.asm +++ b/data/battle_anims/base_coords.asm @@ -1,5 +1,5 @@ FrameBlockBaseCoords: - table_width 2, FrameBlockBaseCoords + table_width 2 db $10, $68 ; BASECOORD_00 db $10, $70 ; BASECOORD_01 db $10, $78 ; BASECOORD_02 diff --git a/data/battle_anims/frame_blocks.asm b/data/battle_anims/frame_blocks.asm index 549c1c3cc6..0e0de32f97 100644 --- a/data/battle_anims/frame_blocks.asm +++ b/data/battle_anims/frame_blocks.asm @@ -1,5 +1,5 @@ FrameBlockPointers: - table_width 2, FrameBlockPointers + table_width 2 dw FrameBlock00 dw FrameBlock01 dw FrameBlock02 diff --git a/data/battle_anims/subanimations.asm b/data/battle_anims/subanimations.asm index 74097e2260..33a4a2f2cb 100644 --- a/data/battle_anims/subanimations.asm +++ b/data/battle_anims/subanimations.asm @@ -1,5 +1,5 @@ SubanimationPointers: - table_width 2, SubanimationPointers + table_width 2 dw Subanim_0Star dw Subanim_0StarTwice dw Subanim_0StarThrice diff --git a/data/credits/credits_text.asm b/data/credits/credits_text.asm index 37ba04bdcb..58c8e55e20 100644 --- a/data/credits/credits_text.asm +++ b/data/credits/credits_text.asm @@ -1,6 +1,6 @@ CreditsTextPointers: ; entries correspond to CRED_* constants - table_width 2, CreditsTextPointers + table_width 2 dw CredVersion dw CredTajiri dw CredTaOota diff --git a/data/events/hidden_coins.asm b/data/events/hidden_coins.asm index 1fa5af23ef..b3244da202 100644 --- a/data/events/hidden_coins.asm +++ b/data/events/hidden_coins.asm @@ -3,7 +3,7 @@ MACRO hidden_coin ENDM HiddenCoinCoords: - table_width 3, HiddenCoinCoords + table_width 3 ; map id, x, y hidden_coin GAME_CORNER, 0, 8 hidden_coin GAME_CORNER, 1, 16 diff --git a/data/events/hidden_item_coords.asm b/data/events/hidden_item_coords.asm index 04f0c2f466..3f45a1edbb 100644 --- a/data/events/hidden_item_coords.asm +++ b/data/events/hidden_item_coords.asm @@ -3,7 +3,7 @@ MACRO hidden_item ENDM HiddenItemCoords: - table_width 3, HiddenItemCoords + table_width 3 ; map id, x, y hidden_item VIRIDIAN_FOREST, 1, 18 hidden_item VIRIDIAN_FOREST, 16, 42 diff --git a/data/events/trades.asm b/data/events/trades.asm index b230a918de..f4963bde0b 100644 --- a/data/events/trades.asm +++ b/data/events/trades.asm @@ -1,6 +1,6 @@ TradeMons: ; entries correspond to TRADE_FOR_* constants - table_width 3 + NAME_LENGTH, TradeMons + table_width 3 + NAME_LENGTH ; give mon, get mon, dialog id, nickname ; The two instances of TRADE_DIALOGSET_EVOLUTION are a leftover ; from the Japanese Blue trades, which used species that evolve. diff --git a/data/growth_rates.asm b/data/growth_rates.asm index aaba27a8d9..a4f7b5d11c 100644 --- a/data/growth_rates.asm +++ b/data/growth_rates.asm @@ -11,7 +11,7 @@ ENDM GrowthRateTable: ; entries correspond to GROWTH_* (see constants/pokemon_data_constants.asm) - table_width 4, GrowthRateTable + table_width 4 growth_rate 1, 1, 0, 0, 0 ; Medium Fast growth_rate 3, 4, 10, 0, 30 ; Slightly Fast growth_rate 3, 4, 20, 0, 70 ; Slightly Slow diff --git a/data/items/names.asm b/data/items/names.asm index 44a21c38a2..bab26efc96 100644 --- a/data/items/names.asm +++ b/data/items/names.asm @@ -1,5 +1,5 @@ ItemNames:: - list_start ItemNames + list_start li "MASTER BALL" li "ULTRA BALL" li "GREAT BALL" diff --git a/data/items/prices.asm b/data/items/prices.asm index d01c0b7e35..aefd10785b 100644 --- a/data/items/prices.asm +++ b/data/items/prices.asm @@ -1,5 +1,5 @@ ItemPrices:: - table_width 3, ItemPrices + table_width 3 bcd3 0 ; MASTER_BALL bcd3 1200 ; ULTRA_BALL bcd3 600 ; GREAT_BALL diff --git a/data/maps/hide_show_data.asm b/data/maps/hide_show_data.asm index e3ece94254..08d2151170 100644 --- a/data/maps/hide_show_data.asm +++ b/data/maps/hide_show_data.asm @@ -2,7 +2,7 @@ MapHSPointers: ; entries correspond to map ids - table_width 2, MapHSPointers + table_width 2 dw PalletTownHS dw ViridianCityHS dw PewterCityHS @@ -259,7 +259,7 @@ NoHS: MissableObjects: ; entries correspond to HS_* constants (see constants/hide_show_constants) - table_width 3, MissableObjects + table_width 3 ; format: map id, object id, HIDE/SHOW PalletTownHS: diff --git a/data/maps/map_header_banks.asm b/data/maps/map_header_banks.asm index 87ec01cfcd..de7ae84b02 100644 --- a/data/maps/map_header_banks.asm +++ b/data/maps/map_header_banks.asm @@ -1,6 +1,6 @@ ; see also MapHeaderPointers MapHeaderBanks:: - table_width 1, MapHeaderBanks + table_width 1 db BANK(PalletTown_h) db BANK(ViridianCity_h) db BANK(PewterCity_h) diff --git a/data/maps/map_header_pointers.asm b/data/maps/map_header_pointers.asm index 44457ce6b1..8d9eba2e68 100644 --- a/data/maps/map_header_pointers.asm +++ b/data/maps/map_header_pointers.asm @@ -1,6 +1,6 @@ ; see also MapHeaderBanks MapHeaderPointers:: - table_width 2, MapHeaderPointers + table_width 2 dw PalletTown_h dw ViridianCity_h dw PewterCity_h diff --git a/data/maps/songs.asm b/data/maps/songs.asm index 111b87b835..bb62b5524c 100644 --- a/data/maps/songs.asm +++ b/data/maps/songs.asm @@ -1,5 +1,5 @@ MapSongBanks:: - table_width 2, MapSongBanks + table_width 2 db MUSIC_PALLET_TOWN, BANK(Music_PalletTown) ; PALLET_TOWN db MUSIC_CITIES1, BANK(Music_Cities1) ; VIRIDIAN_CITY db MUSIC_CITIES1, BANK(Music_Cities1) ; PEWTER_CITY diff --git a/data/maps/sprite_sets.asm b/data/maps/sprite_sets.asm index 0bf49db6a7..7b2a4e8792 100644 --- a/data/maps/sprite_sets.asm +++ b/data/maps/sprite_sets.asm @@ -1,7 +1,7 @@ ; Valid sprite IDs for each outdoor map. MapSpriteSets: - table_width 1, MapSpriteSets + table_width 1 db SPRITESET_PALLET_VIRIDIAN ; PALLET_TOWN db SPRITESET_PALLET_VIRIDIAN ; VIRIDIAN_CITY db SPRITESET_PEWTER_CERULEAN ; PEWTER_CITY @@ -47,7 +47,7 @@ MapSpriteSets: ; #3: sprite set ID if on the west or north side ; #4: sprite set ID if on the east or south side SplitMapSpriteSets: - table_width 4, SplitMapSpriteSets + table_width 4 db NORTH_SOUTH, 37, SPRITESET_PEWTER_CERULEAN, SPRITESET_PALLET_VIRIDIAN ; SPLITSET_ROUTE_2 db NORTH_SOUTH, 50, SPRITESET_PEWTER_CERULEAN, SPRITESET_LAVENDER ; SPLITSET_ROUTE_10 db EAST_WEST, 57, SPRITESET_VERMILION, SPRITESET_SILENCE_BRIDGE ; SPLITSET_ROUTE_11 @@ -63,7 +63,7 @@ SplitMapSpriteSets: assert_table_length NUM_SPLIT_SETS SpriteSets: - table_width SPRITE_SET_LENGTH, SpriteSets + table_width SPRITE_SET_LENGTH ; SPRITESET_PALLET_VIRIDIAN db SPRITE_BLUE diff --git a/data/maps/town_map_entries.asm b/data/maps/town_map_entries.asm index 78b7ff62d3..c93ba57bea 100644 --- a/data/maps/town_map_entries.asm +++ b/data/maps/town_map_entries.asm @@ -5,7 +5,7 @@ ENDM ; the appearance of towns and routes in the town map ExternalMapEntries: - table_width 3, ExternalMapEntries + table_width 3 ; x, y, name external_map 2, 11, PalletTownName external_map 2, 8, ViridianCityName diff --git a/data/moves/animations.asm b/data/moves/animations.asm index e9fdc34ce0..bd362c5306 100644 --- a/data/moves/animations.asm +++ b/data/moves/animations.asm @@ -1,5 +1,5 @@ AttackAnimationPointers: - table_width 2, AttackAnimationPointers + table_width 2 dw PoundAnim dw KarateChopAnim dw DoubleSlapAnim diff --git a/data/moves/effects_pointers.asm b/data/moves/effects_pointers.asm index 63350efc85..fc7c08c5c9 100644 --- a/data/moves/effects_pointers.asm +++ b/data/moves/effects_pointers.asm @@ -1,6 +1,6 @@ MoveEffectPointerTable: ; entries correspond to *_EFFECT constants - table_width 2, MoveEffectPointerTable + table_width 2 dw SleepEffect ; EFFECT_01 dw PoisonEffect ; POISON_SIDE_EFFECT1 dw DrainHPEffect ; DRAIN_HP_EFFECT diff --git a/data/moves/moves.asm b/data/moves/moves.asm index e59ed0070c..f435ab6b99 100644 --- a/data/moves/moves.asm +++ b/data/moves/moves.asm @@ -10,7 +10,7 @@ ENDM Moves: ; Characteristics of each move. - table_width MOVE_LENGTH, Moves + table_width MOVE_LENGTH move POUND, NO_ADDITIONAL_EFFECT, 40, NORMAL, 100, 35 move KARATE_CHOP, NO_ADDITIONAL_EFFECT, 50, NORMAL, 100, 25 move DOUBLESLAP, TWO_TO_FIVE_ATTACKS_EFFECT, 15, NORMAL, 85, 10 diff --git a/data/moves/names.asm b/data/moves/names.asm index e959161939..025172d5b1 100644 --- a/data/moves/names.asm +++ b/data/moves/names.asm @@ -1,5 +1,5 @@ MoveNames:: - list_start MoveNames + list_start li "POUND" li "KARATE CHOP" li "DOUBLESLAP" diff --git a/data/moves/sfx.asm b/data/moves/sfx.asm index c3f01f4e54..f1466ac117 100644 --- a/data/moves/sfx.asm +++ b/data/moves/sfx.asm @@ -1,5 +1,5 @@ MoveSoundTable: - table_width 3, MoveSoundTable + table_width 3 ; ID, pitch mod, tempo mod db SFX_POUND, $00, $80 ; POUND db SFX_BATTLE_0C, $10, $80 ; KARATE_CHOP diff --git a/data/moves/tmhm_moves.asm b/data/moves/tmhm_moves.asm index 6b279f5ada..ee9b37f856 100644 --- a/data/moves/tmhm_moves.asm +++ b/data/moves/tmhm_moves.asm @@ -2,7 +2,7 @@ ; define constants for the item IDs and for the corresponding move values. TechnicalMachines: - table_width 1, TechnicalMachines + table_width 1 FOR n, 1, NUM_TMS + 1 db TM{02d:n}_MOVE diff --git a/data/pokemon/base_stats.asm b/data/pokemon/base_stats.asm index 691e75b0d6..76f7a0bdb2 100644 --- a/data/pokemon/base_stats.asm +++ b/data/pokemon/base_stats.asm @@ -1,5 +1,5 @@ BaseStats:: - table_width BASE_DATA_SIZE, BaseStats + table_width BASE_DATA_SIZE INCLUDE "data/pokemon/base_stats/bulbasaur.asm" INCLUDE "data/pokemon/base_stats/ivysaur.asm" INCLUDE "data/pokemon/base_stats/venusaur.asm" diff --git a/data/pokemon/cries.asm b/data/pokemon/cries.asm index 290f5625f9..eab1818ed5 100644 --- a/data/pokemon/cries.asm +++ b/data/pokemon/cries.asm @@ -4,7 +4,7 @@ MACRO mon_cry ENDM CryData:: - table_width 3, CryData + table_width 3 ; base cry, pitch, length mon_cry SFX_CRY_11, $00, $80 ; Rhydon mon_cry SFX_CRY_03, $00, $80 ; Kangaskhan diff --git a/data/pokemon/dex_entries.asm b/data/pokemon/dex_entries.asm index ceb431b76a..58e815ac7b 100644 --- a/data/pokemon/dex_entries.asm +++ b/data/pokemon/dex_entries.asm @@ -1,5 +1,5 @@ PokedexEntryPointers: - table_width 2, PokedexEntryPointers + table_width 2 dw RhydonDexEntry dw KangaskhanDexEntry dw NidoranMDexEntry diff --git a/data/pokemon/dex_order.asm b/data/pokemon/dex_order.asm index 32e7a79bb6..7c47ddcc54 100644 --- a/data/pokemon/dex_order.asm +++ b/data/pokemon/dex_order.asm @@ -1,5 +1,5 @@ PokedexOrder: - table_width 1, PokedexOrder + table_width 1 db DEX_RHYDON db DEX_KANGASKHAN db DEX_NIDORAN_M diff --git a/data/pokemon/evos_moves.asm b/data/pokemon/evos_moves.asm index d900dde69a..6a6704f98b 100644 --- a/data/pokemon/evos_moves.asm +++ b/data/pokemon/evos_moves.asm @@ -9,7 +9,7 @@ ; - db 0 ; no more level-up moves EvosMovesPointerTable: - table_width 2, EvosMovesPointerTable + table_width 2 dw RhydonEvosMoves dw KangaskhanEvosMoves dw NidoranMEvosMoves diff --git a/data/pokemon/names.asm b/data/pokemon/names.asm index 56aa9f5de6..5d447c9296 100644 --- a/data/pokemon/names.asm +++ b/data/pokemon/names.asm @@ -1,5 +1,5 @@ MonsterNames:: - table_width NAME_LENGTH - 1, MonsterNames + table_width NAME_LENGTH - 1 db "RHYDON@@@@" db "KANGASKHAN" db "NIDORAN♂@@" diff --git a/data/pokemon/palettes.asm b/data/pokemon/palettes.asm index 4aec84eaa5..f0485e1655 100644 --- a/data/pokemon/palettes.asm +++ b/data/pokemon/palettes.asm @@ -1,5 +1,5 @@ MonsterPalettes: - table_width 1, MonsterPalettes + table_width 1 db PAL_MEWMON ; MISSINGNO db PAL_GREENMON ; BULBASAUR db PAL_GREENMON ; IVYSAUR diff --git a/data/sgb/sgb_palettes.asm b/data/sgb/sgb_palettes.asm index eb6bc584d1..d8016d64be 100644 --- a/data/sgb/sgb_palettes.asm +++ b/data/sgb/sgb_palettes.asm @@ -1,6 +1,6 @@ SuperPalettes: ; entries correspond to PAL_* constants - table_width 2 * 4, SuperPalettes + table_width 2 * 4 RGB 31,29,31, 21,28,11, 20,26,31, 03,02,02 ; PAL_ROUTE RGB 31,29,31, 25,28,27, 20,26,31, 03,02,02 ; PAL_PALLET RGB 31,29,31, 17,26,03, 20,26,31, 03,02,02 ; PAL_VIRIDIAN diff --git a/data/sprites/sprites.asm b/data/sprites/sprites.asm index 612ce10c15..3c923e2d0c 100644 --- a/data/sprites/sprites.asm +++ b/data/sprites/sprites.asm @@ -5,7 +5,7 @@ MACRO overworld_sprite ENDM SpriteSheetPointerTable: - table_width 4, SpriteSheetPointerTable + table_width 4 ; graphics, tile count overworld_sprite RedSprite, 12 ; SPRITE_RED overworld_sprite BlueSprite, 12 ; SPRITE_BLUE diff --git a/data/tilemaps.asm b/data/tilemaps.asm index 3e1033beb9..ba67fae01d 100644 --- a/data/tilemaps.asm +++ b/data/tilemaps.asm @@ -5,7 +5,7 @@ ENDM TileIDListPointerTable: ; entries correspond to TILEMAP_* constants (see constants/gfx_constants.asm) - table_width 3, TileIDListPointerTable + table_width 3 ; tilemap pointer, width, height tile_ids MonTiles, 7, 7 tile_ids SlideDownMonTiles_7x5, 7, 5 diff --git a/data/tilesets/tileset_headers.asm b/data/tilesets/tileset_headers.asm index a8500ef228..30db7b95ea 100644 --- a/data/tilesets/tileset_headers.asm +++ b/data/tilesets/tileset_headers.asm @@ -7,7 +7,7 @@ MACRO tileset ENDM Tilesets: - table_width 12, Tilesets + table_width 12 ; name, 3 counter tiles, grass tile, animations tileset Overworld, -1, -1, -1, $52, TILEANIM_WATER_FLOWER tileset RedsHouse1, -1, -1, -1, -1, TILEANIM_NONE diff --git a/data/tilesets/warp_tile_ids.asm b/data/tilesets/warp_tile_ids.asm index 823b4b36ec..3a4cdbd7dc 100644 --- a/data/tilesets/warp_tile_ids.asm +++ b/data/tilesets/warp_tile_ids.asm @@ -1,5 +1,5 @@ WarpTileIDPointers: - table_width 2, WarpTileIDPointers + table_width 2 dw .OverworldWarpTileIDs dw .RedsHouse1WarpTileIDs dw .MartWarpTileIDs diff --git a/data/trainers/ai_pointers.asm b/data/trainers/ai_pointers.asm index a2c6975bad..eaab9a7ab1 100644 --- a/data/trainers/ai_pointers.asm +++ b/data/trainers/ai_pointers.asm @@ -1,5 +1,5 @@ TrainerAIPointers: - table_width 3, TrainerAIPointers + table_width 3 ; one entry per trainer class ; first byte, number of times (per Pokémon) it can occur ; next two bytes, pointer to AI subroutine for trainer class diff --git a/data/trainers/move_choices.asm b/data/trainers/move_choices.asm index 3741f06b97..1624b326ea 100644 --- a/data/trainers/move_choices.asm +++ b/data/trainers/move_choices.asm @@ -8,7 +8,7 @@ ENDM ; move choice modification methods that are applied for each trainer class TrainerClassMoveChoiceModifications: - list_start TrainerClassMoveChoiceModifications + list_start move_choices ; YOUNGSTER move_choices 1 ; BUG CATCHER move_choices 1 ; LASS diff --git a/data/trainers/name_pointers.asm b/data/trainers/name_pointers.asm index 914fe9d4f3..9bcce4189a 100644 --- a/data/trainers/name_pointers.asm +++ b/data/trainers/name_pointers.asm @@ -2,7 +2,7 @@ TrainerNamePointers: ; These are only used for trainers' defeat speeches. ; They were originally shortened variants of the trainer class names ; in the Japanese versions, but are now redundant with TrainerNames. - table_width 2, TrainerNamePointers + table_width 2 dw .YoungsterName dw .BugCatcherName dw .LassName diff --git a/data/trainers/names.asm b/data/trainers/names.asm index dc6ded77b8..d7c5677c0f 100644 --- a/data/trainers/names.asm +++ b/data/trainers/names.asm @@ -1,5 +1,5 @@ TrainerNames:: - list_start TrainerNames + list_start li "YOUNGSTER" li "BUG CATCHER" li "LASS" diff --git a/data/trainers/parties.asm b/data/trainers/parties.asm index b2ad5e0802..cf5eb1519a 100644 --- a/data/trainers/parties.asm +++ b/data/trainers/parties.asm @@ -1,5 +1,5 @@ TrainerDataPointers: - table_width 2, TrainerDataPointers + table_width 2 dw YoungsterData dw BugCatcherData dw LassData diff --git a/data/trainers/pic_pointers_money.asm b/data/trainers/pic_pointers_money.asm index 4515d8806d..f300fb29cf 100644 --- a/data/trainers/pic_pointers_money.asm +++ b/data/trainers/pic_pointers_money.asm @@ -4,7 +4,7 @@ MACRO pic_money ENDM TrainerPicAndMoneyPointers:: - table_width 5, TrainerPicAndMoneyPointers + table_width 5 ; pic pointer, base reward money ; money received after battle = base money × level of last enemy mon pic_money YoungsterPic, 1500 diff --git a/data/types/names.asm b/data/types/names.asm index 87da5c5fd6..8fbcacb6a2 100644 --- a/data/types/names.asm +++ b/data/types/names.asm @@ -1,5 +1,5 @@ TypeNames: - table_width 2, TypeNames + table_width 2 dw .Normal dw .Fighting diff --git a/data/wild/grass_water.asm b/data/wild/grass_water.asm index a09fdce625..f15bed503c 100644 --- a/data/wild/grass_water.asm +++ b/data/wild/grass_water.asm @@ -1,5 +1,5 @@ WildDataPointers: - table_width 2, WildDataPointers + table_width 2 dw NothingWildMons ; PALLET_TOWN dw NothingWildMons ; VIRIDIAN_CITY dw NothingWildMons ; PEWTER_CITY diff --git a/data/yes_no_menu_strings.asm b/data/yes_no_menu_strings.asm index 82c3a3a5dc..445bf83042 100644 --- a/data/yes_no_menu_strings.asm +++ b/data/yes_no_menu_strings.asm @@ -5,7 +5,7 @@ ENDM TwoOptionMenuStrings: ; entries correspond to *_MENU constants - table_width 5, TwoOptionMenuStrings + table_width 5 ; width, height, blank line before first menu item?, text pointer two_option_menu 4, 3, FALSE, .YesNoMenu two_option_menu 6, 3, FALSE, .NorthWestMenu diff --git a/engine/battle/battle_transitions.asm b/engine/battle/battle_transitions.asm index 85d2177ee9..fe731c5dc9 100644 --- a/engine/battle/battle_transitions.asm +++ b/engine/battle/battle_transitions.asm @@ -77,7 +77,7 @@ DEF NUM_BATTLE_TRANSITION_BITS EQU const_value ; bit 1: set if enemy is at least 3 levels higher than player ; bit 2: set if dungeon map BattleTransitions: - table_width 2, BattleTransitions + table_width 2 dw BattleTransition_DoubleCircle ; %000 dw BattleTransition_Spiral ; %001 dw BattleTransition_Circle ; %010 diff --git a/macros/asserts.asm b/macros/asserts.asm index bc5b25820b..7fb7f96b70 100644 --- a/macros/asserts.asm +++ b/macros/asserts.asm @@ -1,13 +1,29 @@ ; Macros to verify assumptions about the data or code +MACRO _redef_current_label + IF DEF(\1) + PURGE \1 + ENDC + IF _NARG == 3 + (\3) + DEF \1 EQUS "\<_NARG>" + ELIF DEF(..) + IF .. - @ == 0 + DEF \1 EQUS "{..}" + ENDC + ELIF DEF(.) + if . - @ == 0 + DEF \1 EQUS "{.}" + ENDC + ENDC + if !DEF(\1) + DEF \1 EQUS \2 + {\1}: + ENDC +ENDM + MACRO table_width DEF CURRENT_TABLE_WIDTH = \1 - IF _NARG == 2 - REDEF CURRENT_TABLE_START EQUS "\2" - ELSE - REDEF CURRENT_TABLE_START EQUS "._table_width\@" - {CURRENT_TABLE_START}: - ENDC + _redef_current_label CURRENT_TABLE_START, "._table_width\@", 2, \# ENDM MACRO assert_table_length @@ -24,12 +40,7 @@ ENDM MACRO list_start DEF list_index = 0 - IF _NARG == 1 - REDEF CURRENT_LIST_START EQUS "\1" - ELSE - REDEF CURRENT_LIST_START EQUS "._list_start\@" - {CURRENT_LIST_START}: - ENDC + _redef_current_label CURRENT_LIST_START, "._list_start\@", 1, \# ENDM MACRO li diff --git a/scripts/CeruleanBadgeHouse.asm b/scripts/CeruleanBadgeHouse.asm index 541865236e..1c7e02003f 100644 --- a/scripts/CeruleanBadgeHouse.asm +++ b/scripts/CeruleanBadgeHouse.asm @@ -53,7 +53,7 @@ CeruleanBadgeHouseMiddleAgedManText: jp TextScriptEnd .BadgeItemList: - table_width 1, .BadgeItemList + table_width 1 db NUM_BADGES ; # db BOULDERBADGE db CASCADEBADGE @@ -79,7 +79,7 @@ CeruleanBadgeHouseMiddleAgedManText: text_end CeruleanBadgeHouseBadgeTextPointers: - table_width 2, CeruleanBadgeHouseBadgeTextPointers + table_width 2 dw CeruleanBadgeHouseBoulderBadgeText dw CeruleanBadgeHouseCascadeBadgeText dw CeruleanBadgeHouseThunderBadgeText