This commit is contained in:
Rangi 2026-01-31 17:32:54 -05:00 committed by GitHub
commit 6edbed23bb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
33 changed files with 213 additions and 156 deletions

View File

@ -55,7 +55,7 @@ DEF HW_CH4_DISABLE_MASK EQU (~HW_CH4_ENABLE_MASK & $ff)
const REG_FREQUENCY_LO ; 3
; wChannelFlags1 constants
const_def
bit_const_def
const BIT_PERFECT_PITCH ; 0 ; controlled by toggle_perfect_pitch command
const BIT_SOUND_CALL ; 1 ; if in sound call
const BIT_NOISE_OR_SFX ; 2 ; if channel is the music noise channel or an SFX channel

View File

@ -60,7 +60,7 @@ DEF NO_EFFECT EQU 00
; non-volatile statuses
DEF SLP_MASK EQU %111 ; 0-7 turns
const_def 3
bit_const_def 3
const PSN ; 3
const BRN ; 4
const FRZ ; 5
@ -77,7 +77,7 @@ DEF BIT_STAB_DAMAGE EQU 7
DEF EFFECTIVENESS_MASK EQU %01111111
; wPlayerBattleStatus1 or wEnemyBattleStatus1 bit flags
const_def
bit_const_def
const STORING_ENERGY ; 0 ; Bide
const THRASHING_ABOUT ; 1 ; Thrash, Petal Dance
const ATTACKING_MULTIPLE_TIMES ; 2 ; e.g. Double Kick, Fury Attack
@ -88,7 +88,7 @@ DEF EFFECTIVENESS_MASK EQU %01111111
const CONFUSED ; 7
; wPlayerBattleStatus2 or wEnemyBattleStatus2 bit flags
const_def
bit_const_def
const USING_X_ACCURACY ; 0
const PROTECTED_BY_MIST ; 1
const GETTING_PUMPED ; 2 ; Focus Energy
@ -99,7 +99,7 @@ DEF EFFECTIVENESS_MASK EQU %01111111
const SEEDED ; 7 ; Leech Seed
; wPlayerBattleStatus3 or wEnemyBattleStatus3 bit flags
const_def
bit_const_def
const BADLY_POISONED ; 0 ; Toxic
const HAS_LIGHT_SCREEN_UP ; 1
const HAS_REFLECT_UP ; 2

View File

@ -66,7 +66,7 @@
const CRED_PAAD ; $3F
DEF NUM_CRED_STRINGS EQU const_value
const_def -1, -1
const_def $ff, -1, NUM_CRED_STRINGS
const CRED_TEXT_FADE_MON ; $FF
const CRED_TEXT_MON ; $FE
const CRED_TEXT_FADE ; $FD

View File

@ -1,7 +1,7 @@
; wEventFlags bit flags
; Pallet Town events
const_def
word_const_def
const EVENT_FOLLOWED_OAK_INTO_LAB
const_skip 2
const EVENT_HALL_OF_FAME_DEX_RATING

View File

@ -28,7 +28,7 @@ DEF REDRAW_COL EQU 1
DEF REDRAW_ROW EQU 2
; hUILayoutFlags
const_def
bit_const_def
const BIT_PARTY_MENU_HP_BAR ; 0
const BIT_DOUBLE_SPACED_MENU ; 1
const BIT_SINGLE_SPACED_LINES ; 2

View File

@ -5,7 +5,7 @@
; - TechnicalMachinePrices (see data/items/tm_prices.asm)
; - KeyItemFlags (see data/items/key_items.asm)
; - ItemUsePtrTable (see engine/items/item_effects.asm)
const_def
listable_const_def
const NO_ITEM ; $00
const MASTER_BALL ; $01
const ULTRA_BALL ; $02

View File

@ -22,7 +22,7 @@ ENDM
; - WildDataPointers (see data/wild/grass_water.asm)
; Each map also has associated data in maps.asm.
; Order: towns/cities, then routes, then indoor/dungeon maps
const_def
listable_const_def
map_const PALLET_TOWN, 10, 9 ; $00
map_const VIRIDIAN_CITY, 20, 18 ; $01
map_const PEWTER_CITY, 20, 18 ; $02
@ -401,5 +401,3 @@ DEF NUM_MAPS EQU const_value
; Indoor maps, such as houses, use this as the Map ID in their exit warps
; This map ID takes the player back to the last outdoor map they were on, stored in wLastMap
DEF LAST_MAP EQU $ff
ASSERT NUM_MAPS <= LAST_MAP, "map IDs overlap LAST_MAP"

View File

@ -3,14 +3,14 @@
DEF MAP_BORDER EQU 3
; connection directions
const_def
bit_const_def
const EAST_F
const WEST_F
const SOUTH_F
const NORTH_F
; wCurMapConnections
const_def
bit_const_def
shift_const EAST ; 1
shift_const WEST ; 2
shift_const SOUTH ; 4

View File

@ -40,7 +40,7 @@ DEF SPRITESTATEDATA2_LENGTH EQU const_value
DEF NUM_SPRITESTATEDATA_STRUCTS EQU 16
const_def 6
bit_const_def 6
const BIT_TRAINER ; 6
const BIT_ITEM ; 7

View File

@ -1,7 +1,9 @@
; SUBANIM_* and SE_* constants use the same series
DEF FIRST_SE_ID EQU $C0
; special effects that are part of move animations
; SpecialEffectPointers associates them with effect routines (see data/battle_anims/special_effect_pointers.asm)
const_def $C0
DEF FIRST_SE_ID EQU const_value
listable_const_def FIRST_SE_ID
const_skip $18
const SE_WAVY_SCREEN ; $D8 used in Psywave/Night Shade/Psychic etc.
const SE_SUBSTITUTE_MON ; $D9 used in Substitute (turns the pokemon into a mini sprite)
@ -48,7 +50,7 @@ DEF FIRST_SE_ID EQU const_value
; The 0 or 1 in the name of a subanim indicates whether to use tileset 0 or 1 data/moves/animations.asm.
; "Both" indicates either can be used for different images using the same animation.
const_def
const_def 0, 1, FIRST_SE_ID - 1
const SUBANIM_0_STAR
const SUBANIM_0_STAR_TWICE
const SUBANIM_0_STAR_THRICE
@ -138,7 +140,7 @@ DEF FIRST_SE_ID EQU const_value
DEF NUM_SUBANIMS EQU const_value
; types of subanimations
const_def
const_def 0, 1, 7 ; (see MACRO subanim in data/battle_anims/subanimations.asm)
const SUBANIMTYPE_NORMAL
const SUBANIMTYPE_HVFLIP
const SUBANIMTYPE_HFLIP

View File

@ -4,7 +4,7 @@
; - MoveNames (see data/moves/names.asm)
; - AttackAnimationPointers (see data/moves/animations.asm)
; - MoveSoundTable (see data/moves/sfx.asm)
const_def
listable_const_def
const NO_MOVE ; 00
const POUND ; 01
const KARATE_CHOP ; 02

View File

@ -3,7 +3,7 @@
; {status condition}_EFFECT means that the move causes the status condition every time it hits the target
; MoveEffectPointerTable indexes (see data/moves/effects_pointers.asm)
const_def
listable_const_def
const NO_ADDITIONAL_EFFECT ; $00
const EFFECT_01 ; $01 unused
const POISON_SIDE_EFFECT1 ; $02

View File

@ -1,5 +1,5 @@
; Pseudo-OAM flags used by game logic
const_def
bit_const_def
const BIT_END_OF_OAM_DATA ; 0
const BIT_SPRITE_UNDER_GRASS ; 1

View File

@ -16,8 +16,10 @@
const SET_PAL_GAME_FREAK_INTRO ; $0C
const SET_PAL_TRAINER_CARD ; $0D
DEF SET_PAL_PARTY_MENU_HP_BARS EQU $fc
DEF SET_PAL_DEFAULT EQU $ff
const_def $ff, -1, {const_value}
const SET_PAL_DEFAULT ; $FF
const_skip 2
const SET_PAL_PARTY_MENU_HP_BARS ; $FC
; sgb palettes
; SuperPalettes indexes (see data/sgb/sgb_palettes.asm)

View File

@ -3,7 +3,8 @@
; - BaseStats (see data/pokemon/base_stats.asm)
; - MonPartyData (see data/pokemon/menu_icons.asm)
; - MonsterPalettes (see data/pokemon/palettes.asm)
const_def 1
const_def
const DEX_MISSINGNO ; 0
const DEX_BULBASAUR ; 1
const DEX_IVYSAUR ; 2
const DEX_VENUSAUR ; 3

View File

@ -5,7 +5,7 @@
; - CryData (see data/pokemon/cries.asm)
; - PokedexOrder (see data/pokemon/dex_order.asm)
; - PokedexEntryPointers (see data/pokemon/dex_entries.asm)
const_def
const_def 0, 1, OPP_ID_OFFSET - 1 ; pokemon and trainer constants use the same series
const NO_MON ; $00
const RHYDON ; $01
const KANGASKHAN ; $02

View File

@ -1,10 +1,10 @@
; wSlotMachineFlags
const_def 6
bit_const_def 6
const BIT_SLOTS_CAN_WIN ; 6
const BIT_SLOTS_CAN_WIN_WITH_7_OR_BAR ; 7
; wMiscFlags
const_def
bit_const_def
const BIT_SEEN_BY_TRAINER ; 0
const BIT_BOULDER_DUST ; 1
const BIT_TURNING ; 2
@ -24,14 +24,14 @@ DEF BIT_TEXT_PREDEF EQU 0
DEF BIT_FONT_LOADED EQU 0
; wCurrentMapScriptFlags
const_def 5
bit_const_def 5
const BIT_CUR_MAP_LOADED_1 ; 5
const BIT_CUR_MAP_LOADED_2 ; 6
const BIT_CUR_MAP_USED_ELEVATOR ; 7
; wOptions
DEF TEXT_DELAY_MASK EQU %111
const_def 6
bit_const_def 6
const BIT_BATTLE_SHIFT ; 6
const BIT_BATTLE_ANIMATION ; 7
@ -40,7 +40,7 @@ DEF TEXT_DELAY_MEDIUM EQU %011 ; 3
DEF TEXT_DELAY_SLOW EQU %101 ; 5
; wLetterPrintingDelayFlags
const_def
bit_const_def
const BIT_FAST_TEXT_DELAY ; 0
const BIT_TEXT_DELAY ; 1
@ -52,7 +52,7 @@ DEF BIT_HAS_CHANGED_BOXES EQU 7
DEF BOX_NUM_MASK EQU %01111111
; wObtainedBadges, wBeatGymFlags
const_def
bit_const_def
const BIT_BOULDERBADGE ; 0
const BIT_CASCADEBADGE ; 1
const BIT_THUNDERBADGE ; 2
@ -64,7 +64,7 @@ DEF BOX_NUM_MASK EQU %01111111
DEF NUM_BADGES EQU const_value
; wStatusFlags1
const_def
bit_const_def
const BIT_STRENGTH_ACTIVE ; 0
const BIT_SURF_ALLOWED ; 1
const_skip ; 2 ; unused
@ -75,12 +75,12 @@ DEF NUM_BADGES EQU const_value
const BIT_UNUSED_CARD_KEY ; 7
; wStatusFlags2
const_def
bit_const_def
const BIT_WILD_ENCOUNTER_COOLDOWN ; 0
const BIT_NO_AUDIO_FADE_OUT ; 1
; wStatusFlags3
const_def
bit_const_def
const BIT_INIT_TRADE_CENTER_FACING ; 0
const_skip 2 ; 1-2 ; unused
const BIT_WARP_FROM_CUR_SCRIPT ; 3
@ -90,7 +90,7 @@ DEF NUM_BADGES EQU const_value
const BIT_PRINT_END_BATTLE_TEXT ; 7
; wStatusFlags4
const_def
bit_const_def
const BIT_GOT_LAPRAS ; 0
const BIT_UNKNOWN_4_1 ; 1
const BIT_USED_POKECENTER ; 2
@ -101,7 +101,7 @@ DEF NUM_BADGES EQU const_value
const BIT_INIT_SCRIPTED_MOVEMENT ; 7
; wStatusFlags5
const_def
bit_const_def
const BIT_SCRIPTED_NPC_MOVEMENT ; 0
const BIT_UNKNOWN_5_1 ; 1
const BIT_UNKNOWN_5_2 ; 2
@ -112,7 +112,7 @@ DEF NUM_BADGES EQU const_value
const BIT_SCRIPTED_MOVEMENT_STATE ; 7
; wStatusFlags6
const_def
bit_const_def
const BIT_GAME_TIMER_COUNTING ; 0
const BIT_DEBUG_MODE ; 1
const BIT_FLY_OR_DUNGEON_WARP ; 2
@ -122,7 +122,7 @@ DEF NUM_BADGES EQU const_value
const BIT_ESCAPE_WARP ; 6
; wStatusFlags7
const_def
bit_const_def
const BIT_TEST_BATTLE ; 0
const BIT_NO_MAP_MUSIC ; 1
const BIT_FORCED_WARP ; 2
@ -132,12 +132,12 @@ DEF NUM_BADGES EQU const_value
const BIT_USED_FLY ; 7
; wElite4Flags
const_def
bit_const_def
const BIT_UNUSED_BEAT_ELITE_4 ; 0
const BIT_STARTED_ELITE_4 ; 1
; wMovementFlags
const_def
bit_const_def
const BIT_STANDING_ON_DOOR ; 0
const BIT_EXITING_DOOR ; 1
const BIT_STANDING_ON_WARP ; 2
@ -146,12 +146,12 @@ DEF NUM_BADGES EQU const_value
const BIT_SPINNING ; 7
; hFindPathFlags
const_def
bit_const_def
const BIT_PATH_FOUND_Y ; 0
const BIT_PATH_FOUND_X ; 1
; hNPCPlayerRelativePosFlags
const_def
bit_const_def
const BIT_PLAYER_LOWER_Y ; 0
const BIT_PLAYER_LOWER_X ; 1

View File

@ -1,6 +1,6 @@
; overworld sprites
; SpriteSheetPointerTable indexes (see data/sprites/sprites.asm)
const_def
const_def 0, 1, 127 ; (see LoadMapSpriteTilePatterns in engine/overworld/map_sprites.asm)
const SPRITE_NONE ; $00
const SPRITE_RED ; $01
const SPRITE_BLUE ; $02

View File

@ -1,5 +1,5 @@
; sprite facing directions
const_def 0, $04
nybble_const_def 0, $04
const SPRITE_FACING_DOWN ; $00
const SPRITE_FACING_UP ; $04
const SPRITE_FACING_LEFT ; $08
@ -14,7 +14,7 @@
DEF NPC_CHANGE_FACING EQU $E0
; player direction constants
const_def
bit_const_def
const PLAYER_DIR_BIT_RIGHT ; 0
const PLAYER_DIR_BIT_LEFT ; 1
const PLAYER_DIR_BIT_DOWN ; 2

View File

@ -8,7 +8,7 @@ DEF GYM_CITY_LENGTH EQU 17
DEF NAME_BUFFER_LENGTH EQU 20
; PrintNumber, PrintBCDNumber
const_def 5
bit_const_def 5
const BIT_MONEY_SIGN ; 5
const BIT_LEFT_ALIGN ; 6
const BIT_LEADING_ZEROES ; 7

View File

@ -1,6 +1,6 @@
; tileset ids
; Tilesets indexes (see data/tilesets/tileset_headers.asm)
const_def
const_def 0, 1, 31 ; (see LoadTilesetHeader in engine/overworld/tilesets.asm)
const OVERWORLD ; 0
const REDS_HOUSE_1 ; 1
const MART ; 2

View File

@ -1,8 +1,8 @@
DEF OPP_ID_OFFSET EQU 200
DEF OPP_ID_OFFSET EQU 200 ; pokemon and trainer constants use the same series
MACRO trainer_const
const \1
DEF OPP_\1 EQU OPP_ID_OFFSET + \1
const OPP_\1
DEF \1 EQU OPP_\1 - OPP_ID_OFFSET
ENDM
; trainer class ids
@ -13,53 +13,53 @@ ENDM
; - TrainerPicAndMoneyPointers (see data/trainers/pic_pointers_money.asm)
; - TrainerAIPointers (see data/trainers/ai_pointers.asm)
; - TrainerClassMoveChoiceModifications (see data/trainers/move_choices.asm)
const_def
trainer_const NOBODY ; $00
trainer_const YOUNGSTER ; $01
trainer_const BUG_CATCHER ; $02
trainer_const LASS ; $03
trainer_const SAILOR ; $04
trainer_const JR_TRAINER_M ; $05
trainer_const JR_TRAINER_F ; $06
trainer_const POKEMANIAC ; $07
trainer_const SUPER_NERD ; $08
trainer_const HIKER ; $09
trainer_const BIKER ; $0A
trainer_const BURGLAR ; $0B
trainer_const ENGINEER ; $0C
trainer_const UNUSED_JUGGLER ; $0D
trainer_const FISHER ; $0E
trainer_const SWIMMER ; $0F
trainer_const CUE_BALL ; $10
trainer_const GAMBLER ; $11
trainer_const BEAUTY ; $12
trainer_const PSYCHIC_TR ; $13
trainer_const ROCKER ; $14
trainer_const JUGGLER ; $15
trainer_const TAMER ; $16
trainer_const BIRD_KEEPER ; $17
trainer_const BLACKBELT ; $18
trainer_const RIVAL1 ; $19
trainer_const PROF_OAK ; $1A
trainer_const CHIEF ; $1B
trainer_const SCIENTIST ; $1C
trainer_const GIOVANNI ; $1D
trainer_const ROCKET ; $1E
trainer_const COOLTRAINER_M ; $1F
trainer_const COOLTRAINER_F ; $20
trainer_const BRUNO ; $21
trainer_const BROCK ; $22
trainer_const MISTY ; $23
trainer_const LT_SURGE ; $24
trainer_const ERIKA ; $25
trainer_const KOGA ; $26
trainer_const BLAINE ; $27
trainer_const SABRINA ; $28
trainer_const GENTLEMAN ; $29
trainer_const RIVAL2 ; $2A
trainer_const RIVAL3 ; $2B
trainer_const LORELEI ; $2C
trainer_const CHANNELER ; $2D
trainer_const AGATHA ; $2E
trainer_const LANCE ; $2F
DEF NUM_TRAINERS EQU const_value - 1
listable_const_def OPP_ID_OFFSET
trainer_const NOBODY ; $00 (opp $C8)
trainer_const YOUNGSTER ; $01 (opp $C9)
trainer_const BUG_CATCHER ; $02 (opp $CA)
trainer_const LASS ; $03 (opp $CB)
trainer_const SAILOR ; $04 (opp $CC)
trainer_const JR_TRAINER_M ; $05 (opp $CD)
trainer_const JR_TRAINER_F ; $06 (opp $CE)
trainer_const POKEMANIAC ; $07 (opp $CF)
trainer_const SUPER_NERD ; $08 (opp $D0)
trainer_const HIKER ; $09 (opp $D1)
trainer_const BIKER ; $0A (opp $D2)
trainer_const BURGLAR ; $0B (opp $D3)
trainer_const ENGINEER ; $0C (opp $D4)
trainer_const UNUSED_JUGGLER ; $0D (opp $D5)
trainer_const FISHER ; $0E (opp $D6)
trainer_const SWIMMER ; $0F (opp $D7)
trainer_const CUE_BALL ; $10 (opp $D8)
trainer_const GAMBLER ; $11 (opp $D9)
trainer_const BEAUTY ; $12 (opp $DA)
trainer_const PSYCHIC_TR ; $13 (opp $DB)
trainer_const ROCKER ; $14 (opp $DC)
trainer_const JUGGLER ; $15 (opp $DD)
trainer_const TAMER ; $16 (opp $DE)
trainer_const BIRD_KEEPER ; $17 (opp $DF)
trainer_const BLACKBELT ; $18 (opp $E0)
trainer_const RIVAL1 ; $19 (opp $E1)
trainer_const PROF_OAK ; $1A (opp $E2)
trainer_const CHIEF ; $1B (opp $E3)
trainer_const SCIENTIST ; $1C (opp $E4)
trainer_const GIOVANNI ; $1D (opp $E5)
trainer_const ROCKET ; $1E (opp $E6)
trainer_const COOLTRAINER_M ; $1F (opp $E7)
trainer_const COOLTRAINER_F ; $20 (opp $E8)
trainer_const BRUNO ; $21 (opp $E9)
trainer_const BROCK ; $22 (opp $EA)
trainer_const MISTY ; $23 (opp $EB)
trainer_const LT_SURGE ; $24 (opp $EC)
trainer_const ERIKA ; $25 (opp $ED)
trainer_const KOGA ; $26 (opp $EE)
trainer_const BLAINE ; $27 (opp $EF)
trainer_const SABRINA ; $28 (opp $F0)
trainer_const GENTLEMAN ; $29 (opp $F1)
trainer_const RIVAL2 ; $2A (opp $F2)
trainer_const RIVAL3 ; $2B (opp $F3)
trainer_const LORELEI ; $2C (opp $F4)
trainer_const CHANNELER ; $2D (opp $F5)
trainer_const AGATHA ; $2E (opp $F6)
trainer_const LANCE ; $2F (opp $F7)
DEF NUM_TRAINERS EQU const_value - 1 - OPP_ID_OFFSET

View File

@ -1,5 +1,5 @@
; TypeNames indexes (see data/types/names.asm)
const_def
listable_const_def
DEF PHYSICAL EQU const_value
const NORMAL ; $00

View File

@ -30,8 +30,8 @@ PokedexOrder:
db DEX_BLASTOISE
db DEX_PINSIR
db DEX_TANGELA
db 0 ; MISSINGNO.
db 0 ; MISSINGNO.
db DEX_MISSINGNO
db DEX_MISSINGNO
db DEX_GROWLITHE
db DEX_ONIX
db DEX_FEAROW
@ -49,26 +49,26 @@ PokedexOrder:
db DEX_PSYDUCK
db DEX_DROWZEE
db DEX_GOLEM
db 0 ; MISSINGNO.
db DEX_MISSINGNO
db DEX_MAGMAR
db 0 ; MISSINGNO.
db DEX_MISSINGNO
db DEX_ELECTABUZZ
db DEX_MAGNETON
db DEX_KOFFING
db 0 ; MISSINGNO.
db DEX_MISSINGNO
db DEX_MANKEY
db DEX_SEEL
db DEX_DIGLETT
db DEX_TAUROS
db 0 ; MISSINGNO.
db 0 ; MISSINGNO.
db 0 ; MISSINGNO.
db DEX_MISSINGNO
db DEX_MISSINGNO
db DEX_MISSINGNO
db DEX_FARFETCHD
db DEX_VENONAT
db DEX_DRAGONITE
db 0 ; MISSINGNO.
db 0 ; MISSINGNO.
db 0 ; MISSINGNO.
db DEX_MISSINGNO
db DEX_MISSINGNO
db DEX_MISSINGNO
db DEX_DODUO
db DEX_POLIWAG
db DEX_JYNX
@ -78,23 +78,23 @@ PokedexOrder:
db DEX_DITTO
db DEX_MEOWTH
db DEX_KRABBY
db 0 ; MISSINGNO.
db 0 ; MISSINGNO.
db 0 ; MISSINGNO.
db DEX_MISSINGNO
db DEX_MISSINGNO
db DEX_MISSINGNO
db DEX_VULPIX
db DEX_NINETALES
db DEX_PIKACHU
db DEX_RAICHU
db 0 ; MISSINGNO.
db 0 ; MISSINGNO.
db DEX_MISSINGNO
db DEX_MISSINGNO
db DEX_DRATINI
db DEX_DRAGONAIR
db DEX_KABUTO
db DEX_KABUTOPS
db DEX_HORSEA
db DEX_SEADRA
db 0 ; MISSINGNO.
db 0 ; MISSINGNO.
db DEX_MISSINGNO
db DEX_MISSINGNO
db DEX_SANDSHREW
db DEX_SANDSLASH
db DEX_OMANYTE
@ -114,38 +114,38 @@ PokedexOrder:
db DEX_WEEDLE
db DEX_KAKUNA
db DEX_BEEDRILL
db 0 ; MISSINGNO.
db DEX_MISSINGNO
db DEX_DODRIO
db DEX_PRIMEAPE
db DEX_DUGTRIO
db DEX_VENOMOTH
db DEX_DEWGONG
db 0 ; MISSINGNO.
db 0 ; MISSINGNO.
db DEX_MISSINGNO
db DEX_MISSINGNO
db DEX_CATERPIE
db DEX_METAPOD
db DEX_BUTTERFREE
db DEX_MACHAMP
db 0 ; MISSINGNO.
db DEX_MISSINGNO
db DEX_GOLDUCK
db DEX_HYPNO
db DEX_GOLBAT
db DEX_MEWTWO
db DEX_SNORLAX
db DEX_MAGIKARP
db 0 ; MISSINGNO.
db 0 ; MISSINGNO.
db DEX_MISSINGNO
db DEX_MISSINGNO
db DEX_MUK
db 0 ; MISSINGNO.
db DEX_MISSINGNO
db DEX_KINGLER
db DEX_CLOYSTER
db 0 ; MISSINGNO.
db DEX_MISSINGNO
db DEX_ELECTRODE
db DEX_CLEFABLE
db DEX_WEEZING
db DEX_PERSIAN
db DEX_MAROWAK
db 0 ; MISSINGNO.
db DEX_MISSINGNO
db DEX_HAUNTER
db DEX_ABRA
db DEX_ALAKAZAM
@ -155,13 +155,13 @@ PokedexOrder:
db DEX_BULBASAUR
db DEX_VENUSAUR
db DEX_TENTACRUEL
db 0 ; MISSINGNO.
db DEX_MISSINGNO
db DEX_GOLDEEN
db DEX_SEAKING
db 0 ; MISSINGNO.
db 0 ; MISSINGNO.
db 0 ; MISSINGNO.
db 0 ; MISSINGNO.
db DEX_MISSINGNO
db DEX_MISSINGNO
db DEX_MISSINGNO
db DEX_MISSINGNO
db DEX_PONYTA
db DEX_RAPIDASH
db DEX_RATTATA
@ -171,19 +171,19 @@ PokedexOrder:
db DEX_GEODUDE
db DEX_PORYGON
db DEX_AERODACTYL
db 0 ; MISSINGNO.
db DEX_MISSINGNO
db DEX_MAGNEMITE
db 0 ; MISSINGNO.
db 0 ; MISSINGNO.
db DEX_MISSINGNO
db DEX_MISSINGNO
db DEX_CHARMANDER
db DEX_SQUIRTLE
db DEX_CHARMELEON
db DEX_WARTORTLE
db DEX_CHARIZARD
db 0 ; MISSINGNO.
db 0 ; MISSINGNO.
db 0 ; MISSINGNO.
db 0 ; MISSINGNO.
db DEX_MISSINGNO
db DEX_MISSINGNO
db DEX_MISSINGNO
db DEX_MISSINGNO
db DEX_ODDISH
db DEX_GLOOM
db DEX_VILEPLUME

View File

@ -64,7 +64,7 @@ BattleTransition:
ld l, a
jp hl
const_def
bit_const_def
const BIT_TRAINER_BATTLE_TRANSITION ; 0
const BIT_STRONGER_BATTLE_TRANSITION ; 1
const BIT_DUNGEON_BATTLE_TRANSITION ; 2

View File

@ -110,6 +110,8 @@ LoadMapSpriteTilePatterns:
ld [hl], a ; store VRAM slot at [x#SPRITESTATEDATA2_IMAGEBASEOFFSET]
ldh [hVRAMSlot], a ; used to determine if it's 4-tile sprite later
ld a, b ; a = current sprite picture ID
; hl = SpriteSheetPointerTable + (a - 1) * 4
; (this would overflow for a sprite picture ID greater than 127)
dec a
add a
add a

View File

@ -295,7 +295,7 @@ _GetTileAndCoordsInFrontOfPlayer:
ret
; hPlayerFacing
const_def
bit_const_def
const BIT_FACING_DOWN ; 0
const BIT_FACING_UP ; 1
const BIT_FACING_LEFT ; 2

View File

@ -1,13 +1,15 @@
LoadTilesetHeader:
call GetPredefRegisters
push hl
; hl = Tilesets + [wCurMapTileset] * 12
; (this would overflow for a tileset ID greater than 31)
ld d, 0
ld a, [wCurMapTileset]
add a
add a
ld b, a
add a
add b ; a = tileset * 12
add b
jr nc, .noCarry
inc d
.noCarry

View File

@ -1,5 +1,5 @@
; wSpriteLoadFlags bits, streamed from compressed sprite data
const_def
bit_const_def
const BIT_USE_SPRITE_BUFFER_2 ; 0
const BIT_LAST_SPRITE_CHUNK ; 1

View File

@ -28,11 +28,11 @@ INCLUDE "constants/move_constants.asm"
INCLUDE "constants/move_animation_constants.asm"
INCLUDE "constants/move_effect_constants.asm"
INCLUDE "constants/item_constants.asm"
INCLUDE "constants/pokemon_constants.asm"
INCLUDE "constants/trainer_constants.asm"
INCLUDE "constants/pokedex_constants.asm"
INCLUDE "constants/pokemon_data_constants.asm"
INCLUDE "constants/player_constants.asm"
INCLUDE "constants/trainer_constants.asm"
INCLUDE "constants/pokemon_constants.asm"
INCLUDE "constants/icon_constants.asm"
INCLUDE "constants/sprite_constants.asm"
INCLUDE "constants/sprite_data_constants.asm"

View File

@ -11,9 +11,57 @@ MACRO? const_def
ELSE
DEF const_inc = 1
ENDC
IF _NARG >= 3
DEF const_max = \3
ELSE
DEF const_max = $ff
ENDC
ENDM
MACRO? max_const_def
IF _NARG == 1
const_def 0, 1, \1
ELIF _NARG == 2
const_def \2, 1, \1
ELSE
const_def \2, \3, \1
ENDC
ENDM
MACRO? bit_const_def
max_const_def 7, \#
ENDM
MACRO? nybble_const_def
max_const_def $f, \#
ENDM
MACRO? listable_const_def
max_const_def $fe, \# ; $ff aka -1 is reserved for the end-of-list marker
ENDM
MACRO? word_const_def
max_const_def $ffff, \#
ENDM
MACRO? unlimited_const_def
max_const_def 0, \#
ENDM
MACRO? check_const_value
IF const_max
IF const_inc > 0
ASSERT const_value <= const_max, \
"\1 would be {d:const_value}, but cannot be greater than {d:const_max}"
ELSE
ASSERT const_value >= const_max, \
"\1 would be {d:const_value}, but cannot be less than {d:const_max}"
ENDC
ENDC
ENDM
MACRO? const
check_const_value \1
DEF \1 EQU const_value
DEF const_value += const_inc
ENDM
@ -24,6 +72,7 @@ MACRO? const_export
ENDM
MACRO? shift_const
check_const_value \1
DEF \1 EQU 1 << const_value
DEF const_value += const_inc
ENDM
@ -34,6 +83,7 @@ MACRO? const_skip
else
DEF const_value += const_inc
endc
check_const_value The next constant
ENDM
MACRO? const_next
@ -41,6 +91,7 @@ MACRO? const_next
fail "const_next cannot go backwards from {const_value} to \1"
else
DEF const_value = \1
check_const_value The next constant
endc
ENDM

View File

@ -183,7 +183,7 @@ ENDM
; Text script IDs (see home/text_script.asm)
const_def -1, -1
const_def $ff, -1, {const_value}
const TX_SCRIPT_POKECENTER_NURSE ; $ff
MACRO script_pokecenter_nurse

View File

@ -63,19 +63,18 @@ ViridianMartNoopScript:
ret
ViridianMart_TextPointers:
dw ViridianMartClerkSayHiToOakText
dw ViridianMartYoungsterText
dw ViridianMartCooltrainerMText
const_def 4
def_text_pointers
dw_const ViridianMartClerkSayHiToOakText, TEXT_VIRIDIANMART_CLERK
dw_const ViridianMartYoungsterText, TEXT_VIRIDIANMART_YOUNGSTER
dw_const ViridianMartCooltrainerMText, TEXT_VIRIDIANMART_COOLTRAINER_M
dw_const ViridianMartClerkYouCameFromPalletTownText, TEXT_VIRIDIANMART_CLERK_YOU_CAME_FROM_PALLET_TOWN
dw_const ViridianMartClerkParcelQuestText, TEXT_VIRIDIANMART_CLERK_PARCEL_QUEST
ViridianMart_TextPointers2:
; This becomes the primary text pointers table when Oak's parcel has been delivered.
def_text_pointers
dw_const ViridianMartClerkText, TEXT_VIRIDIANMART_CLERK
dw_const ViridianMartYoungsterText, TEXT_VIRIDIANMART_YOUNGSTER
dw_const ViridianMartCooltrainerMText, TEXT_VIRIDIANMART_COOLTRAINER_M
dw ViridianMartClerkText ; TEXT_VIRIDIANMART_CLERK
dw ViridianMartYoungsterText ; TEXT_VIRIDIANMART_YOUNGSTER
dw ViridianMartCooltrainerMText ; TEXT_VIRIDIANMART_COOLTRAINER_M
ViridianMartClerkSayHiToOakText:
text_far _ViridianMartClerkSayHiToOakText