Don't pass redundant label names to table_width and list_start (#484)

This commit is contained in:
Rangi 2024-12-27 12:52:24 -05:00 committed by GitHub
parent cd1065b7a9
commit cd647df3b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
48 changed files with 74 additions and 63 deletions

View File

@ -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"

View File

@ -1,7 +1,7 @@
; Stats that vitamins can raise or lower
VitaminStats:
list_start VitaminStats
list_start
li "HEALTH"
li "ATTACK"
li "DEFENSE"

View File

@ -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

View File

@ -1,5 +1,5 @@
FrameBlockPointers:
table_width 2, FrameBlockPointers
table_width 2
dw FrameBlock00
dw FrameBlock01
dw FrameBlock02

View File

@ -1,5 +1,5 @@
SubanimationPointers:
table_width 2, SubanimationPointers
table_width 2
dw Subanim_0Star
dw Subanim_0StarTwice
dw Subanim_0StarThrice

View File

@ -1,6 +1,6 @@
CreditsTextPointers:
; entries correspond to CRED_* constants
table_width 2, CreditsTextPointers
table_width 2
dw CredVersion
dw CredTajiri
dw CredTaOota

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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

View File

@ -1,5 +1,5 @@
ItemNames::
list_start ItemNames
list_start
li "MASTER BALL"
li "ULTRA BALL"
li "GREAT BALL"

View File

@ -1,5 +1,5 @@
ItemPrices::
table_width 3, ItemPrices
table_width 3
bcd3 0 ; MASTER_BALL
bcd3 1200 ; ULTRA_BALL
bcd3 600 ; GREAT_BALL

View File

@ -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:

View File

@ -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)

View File

@ -1,6 +1,6 @@
; see also MapHeaderBanks
MapHeaderPointers::
table_width 2, MapHeaderPointers
table_width 2
dw PalletTown_h
dw ViridianCity_h
dw PewterCity_h

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -1,5 +1,5 @@
AttackAnimationPointers:
table_width 2, AttackAnimationPointers
table_width 2
dw PoundAnim
dw KarateChopAnim
dw DoubleSlapAnim

View File

@ -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

View File

@ -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

View File

@ -1,5 +1,5 @@
MoveNames::
list_start MoveNames
list_start
li "POUND"
li "KARATE CHOP"
li "DOUBLESLAP"

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -1,5 +1,5 @@
PokedexEntryPointers:
table_width 2, PokedexEntryPointers
table_width 2
dw RhydonDexEntry
dw KangaskhanDexEntry
dw NidoranMDexEntry

View File

@ -1,5 +1,5 @@
PokedexOrder:
table_width 1, PokedexOrder
table_width 1
db DEX_RHYDON
db DEX_KANGASKHAN
db DEX_NIDORAN_M

View File

@ -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

View File

@ -1,5 +1,5 @@
MonsterNames::
table_width NAME_LENGTH - 1, MonsterNames
table_width NAME_LENGTH - 1
db "RHYDON@@@@"
db "KANGASKHAN"
db "NIDORAN♂@@"

View File

@ -1,5 +1,5 @@
MonsterPalettes:
table_width 1, MonsterPalettes
table_width 1
db PAL_MEWMON ; MISSINGNO
db PAL_GREENMON ; BULBASAUR
db PAL_GREENMON ; IVYSAUR

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -1,5 +1,5 @@
WarpTileIDPointers:
table_width 2, WarpTileIDPointers
table_width 2
dw .OverworldWarpTileIDs
dw .RedsHouse1WarpTileIDs
dw .MartWarpTileIDs

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -1,5 +1,5 @@
TrainerNames::
list_start TrainerNames
list_start
li "YOUNGSTER"
li "BUG CATCHER"
li "LASS"

View File

@ -1,5 +1,5 @@
TrainerDataPointers:
table_width 2, TrainerDataPointers
table_width 2
dw YoungsterData
dw BugCatcherData
dw LassData

View File

@ -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

View File

@ -1,5 +1,5 @@
TypeNames:
table_width 2, TypeNames
table_width 2
dw .Normal
dw .Fighting

View File

@ -1,5 +1,5 @@
WildDataPointers:
table_width 2, WildDataPointers
table_width 2
dw NothingWildMons ; PALLET_TOWN
dw NothingWildMons ; VIRIDIAN_CITY
dw NothingWildMons ; PEWTER_CITY

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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