Skip to content

Commit

Permalink
Add comments associating constants with data, and identify some more …
Browse files Browse the repository at this point in the history
…data
  • Loading branch information
Rangi42 committed Jul 20, 2020
1 parent 0177688 commit 69788c5
Show file tree
Hide file tree
Showing 45 changed files with 318 additions and 299 deletions.
8 changes: 4 additions & 4 deletions constants/battle_constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ NUM_DVS EQU 2
; D733 flags
BIT_TEST_BATTLE EQU 0

; battle type constants
; battle type constants (wBattleType values)
const_def
const BATTLE_TYPE_NORMAL ; 0
const BATTLE_TYPE_OLD_MAN ; 1
Expand Down Expand Up @@ -43,7 +43,7 @@ MAX_STAT_VALUE EQU 999
ATKDEFDV_TRAINER EQU $98
SPDSPCDV_TRAINER EQU $88

; volatile statuses 1
; wPlayerBattleStatus1 or wEnemyBattleStatus1 bit flags
const_def
const STORING_ENERGY ; 0 ; Bide
const THRASHING_ABOUT ; 1 ; e.g. Thrash
Expand All @@ -54,7 +54,7 @@ SPDSPCDV_TRAINER EQU $88
const INVULNERABLE ; 6 ; charging up Fly/Dig
const CONFUSED ; 7

; volatile statuses 2
; wPlayerBattleStatus2 or wEnemyBattleStatus2 bit flags
const_def
const USING_X_ACCURACY ; 0
const PROTECTED_BY_MIST ; 1
Expand All @@ -65,7 +65,7 @@ SPDSPCDV_TRAINER EQU $88
const USING_RAGE ; 6
const SEEDED ; 7

; volatile statuses 3
; wPlayerBattleStatus3 or wEnemyBattleStatus3 bit flags
const_def
const BADLY_POISONED ; 0
const HAS_LIGHT_SCREEN_UP ; 1
Expand Down
1 change: 1 addition & 0 deletions constants/credits_constants.asm
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
; CreditsTextPointers indexes (see data/credits/credits_text.asm)
const_def
const CRED_VERSION ; $00
const CRED_TAJIRI ; $01
Expand Down
2 changes: 2 additions & 0 deletions constants/event_constants.asm
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
; wEventFlags bit flags

; Pallet Town events
const_def
const EVENT_FOLLOWED_OAK_INTO_LAB
Expand Down
1 change: 1 addition & 0 deletions constants/gfx_constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ REDRAW_COL EQU 1
REDRAW_ROW EQU 2

; tile list ids
; TileIDListPointerTable indexes (see data/tilemaps.asm)
const_def
const TILEMAP_MON_PIC
const TILEMAP_SLIDE_DOWN_MON_PIC_7X5
Expand Down
1 change: 1 addition & 0 deletions constants/hide_show_constants.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
HIDE EQU $11
SHOW EQU $15

; MissableObjects indexes (see data/maps/hide_show_data.asm)
; this is a list of the sprites that can be enabled/disabled during the game
; sprites marked with an X are constants that are never used
; because those sprites are not (de)activated in a map's script
Expand Down
5 changes: 5 additions & 0 deletions constants/icon_constants.asm
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; party menu icons
; used in MonPartySpritePointers (see data/icon_pointers.asm)
const_def
const ICON_MON ; $0
const ICON_BALL ; $1
Expand All @@ -10,3 +11,7 @@
const ICON_GRASS ; $7
const ICON_SNAKE ; $8
const ICON_QUADRUPED ; $9

ICON_TRADEBUBBLE EQU $e

ICONOFFSET EQU $40 ; difference between alternating icon frames' tile IDs
1 change: 1 addition & 0 deletions constants/input_constants.asm
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
; joypad buttons
const_def
const BIT_A_BUTTON
const BIT_B_BUTTON
Expand Down
7 changes: 7 additions & 0 deletions constants/item_constants.asm
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
; item ids
; indexes for:
; - ItemNames (see data/items/names.asm)
; - ItemPrices (see data/items/prices.asm)
; - TechnicalMachinePrices (see data/items/tm_prices.asm)
; - KeyItemBitfield (see data/items/key_items.asm)
; - ItemUsePtrTable (see engine/items/item_effects.asm)
const_def
const NO_ITEM ; $00
const MASTER_BALL ; $01
Expand Down
1 change: 1 addition & 0 deletions constants/list_constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
const ITEMLISTMENU ; $03 ; Start menu Item menu / Pokemart sell menu
const SPECIALLISTMENU ; $04 ; list of special "items" e.g. floor list in elevators / list of badges

; NamePointers indexes (see home/names2.asm)
const_def 1
const MONSTER_NAME ; 1
const MOVE_NAME ; 2
Expand Down
9 changes: 9 additions & 0 deletions constants/map_constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ mapconst: MACRO
\1_WIDTH EQU \3
ENDM

; map ids
; indexes for:
; - MapHeaderBanks (see data/maps/map_header_banks.asm)
; - MapHeaderPointers (see data/maps/map_header_pointers.asm)
; - MapSongBanks (see data/maps/songs.asm)
; - MapHSPointers (see data/maps/hide_show_data.asm)
; - MapSpriteSets (see data/maps/sprite_sets.asm)
; - ExternalMapEntries (see data/maps/town_map_entries.asm)
; Each map also has associated data in maps.asm.
const_def
mapconst PALLET_TOWN, 9, 10 ; $00
mapconst VIRIDIAN_CITY, 18, 20 ; $01
Expand Down
11 changes: 6 additions & 5 deletions constants/menu_constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ PC_ITEM_CAPACITY EQU 50
const_def 1
const MESSAGE_BOX ; $01
const_skip ; $02
const_skip ; $03
const MENU_TEMPLATE_03 ; $03 unused
const FIELD_MOVE_MON_MENU ; $04
const JP_MOCHIMONO_MENU_TEMPLATE ; $05
const USE_TOSS_MENU_TEMPLATE ; $06
const_skip ; $07
const MENU_TEMPLATE_07 ; $07 unused
const JP_SAVE_MESSAGE_MENU_TEMPLATE ; $08
const JP_SPEED_OPTIONS_MENU_TEMPLATE ; $09
const_skip ; $0a
Expand All @@ -18,7 +18,7 @@ PC_ITEM_CAPACITY EQU 50
const LIST_MENU_BOX ; $0d
const BUY_SELL_QUIT_MENU_TEMPLATE ; $0e
const MONEY_BOX_TEMPLATE ; $0f
const_skip ; $10
const MENU_TEMPLATE_10 ; $10 unused
const MON_SPRITE_POPUP ; $11
const JP_AH_MENU_TEMPLATE ; $12
const MONEY_BOX ; $13
Expand All @@ -32,6 +32,7 @@ PC_ITEM_CAPACITY EQU 50
const SAFARI_BATTLE_MENU_TEMPLATE ; $1b

; two option menu constants
; TwoOptionMenuStrings indexes (see data/yes_no_menu_strings.asm)
const_def
const YES_NO_MENU ; 0
const NORTH_WEST_MENU ; 1
Expand All @@ -58,7 +59,7 @@ CHOSE_SECOND_ITEM EQU 2
const PARTY_TO_DAYCARE ; 3

; party menu types
; PartyMenuMessagePointers indexes
; PartyMenuMessagePointers indexes (see engine/menus/party_menu.asm)
const_def
const NORMAL_PARTY_MENU ; $00
const USE_ITEM_PARTY_MENU ; $01
Expand All @@ -67,7 +68,7 @@ CHOSE_SECOND_ITEM EQU 2
const SWAP_MONS_PARTY_MENU ; $04
const EVO_STONE_PARTY_MENU ; $05
; party menu message IDs
; PartyMenuItemUseMessagePointers indexes
; PartyMenuItemUseMessagePointers indexes (see engine/menus/party_menu.asm)
const_next $F0
FIRST_PARTY_MENU_TEXT_ID EQU const_value
const ANTIDOTE_MSG ; $F0
Expand Down
4 changes: 4 additions & 0 deletions constants/move_animation_constants.asm
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; 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
FIRST_SE_ID EQU const_value
const_skip $18
Expand Down Expand Up @@ -43,6 +44,7 @@ FIRST_SE_ID EQU const_value
const SE_DARK_SCREEN_FLASH ; $FE used in Cut/Take Down/etc.

; subanimations that are part of move animations
; SubanimationPointers indexes (see data/battle_anims/subanimations.asm)
const_def
const SUBANIM_00
const SUBANIM_01
Expand Down Expand Up @@ -141,6 +143,7 @@ FIRST_SE_ID EQU const_value
const SUBANIMTYPE_ENEMY

; frame blocks that are part of subanimations
; FrameBlockPointers indexes (see data/battle_anims/frame_blocks.asm)
const_def
const FRAMEBLOCK_00
const FRAMEBLOCK_01
Expand Down Expand Up @@ -266,6 +269,7 @@ FIRST_SE_ID EQU const_value
const FRAMEBLOCK_79

; base coordinates that are part of subanimations
; FrameBlockBaseCoords indexes (see data/battle_anims/base_coords.asm)
const_def
const BASECOORD_00
const BASECOORD_01
Expand Down
6 changes: 6 additions & 0 deletions constants/move_constants.asm
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
; move ids
; indexes for:
; - Moves (see data/moves/moves.asm)
; - MoveNames (see data/moves/names.asm)
; - AttackAnimationPointers (see data/moves/animations.asm)
; - MoveSoundTable (see data/moves/sfx.asm)
const_def
const NO_MOVE ; 00
const POUND ; 01
Expand Down
6 changes: 3 additions & 3 deletions constants/move_effect_constants.asm
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
; tentative move effect constants
; {stat}_(UP|DOWN)(1|2) means that the move raises the user's (or lowers the target's) corresponding stat modifier by 1 (or 2) stages
; {status condition}_side_effect means that the move has a side chance of causing that condition
; {status condition}_effect means that the move causes the status condition every time it hits the target
; {status condition}_SIDE_EFFECT means that the move has a side chance of causing that condition
; {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
const NO_ADDITIONAL_EFFECT ; $00
const EFFECT_01 ; $01 unused
Expand Down
1 change: 1 addition & 0 deletions constants/music_constants.asm
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; Song ids are calculated by address to save space.
; SFX_Headers_(1|2|3) indexes (see audio/headers/*.asm)

music_const: MACRO
\1 EQUS "((\2 - SFX_Headers_1) / 3)"
Expand Down
2 changes: 2 additions & 0 deletions constants/palette_constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
const BLACK

; pal/blk packets
; SetPalFunctions indexes (see engine/gfx/palettes.asm)
const_def
const SET_PAL_BATTLE_BLACK ; $00
const SET_PAL_BATTLE ; $01
Expand All @@ -26,6 +27,7 @@ SET_PAL_PARTY_MENU_HP_BARS EQU $fc
SET_PAL_DEFAULT EQU $ff

; sgb palettes
; SuperPalettes indexes (see data/sgb/sgb_palettes.asm)
const_def
const PAL_ROUTE ; $00
const PAL_PALLET ; $01
Expand Down
5 changes: 5 additions & 0 deletions constants/pokedex_constants.asm
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
; pokedex ids
; indexes for:
; - BaseStats (see data/pokemon/base_stats.asm)
; - MonPartyData (see data/pokemon/menu_icons.asm)
; - MonsterPalettes (see data/pokemon/palettes.asm)
const_def 1
const DEX_BULBASAUR ; 1
const DEX_IVYSAUR ; 2
Expand Down
7 changes: 7 additions & 0 deletions constants/pokemon_constants.asm
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
; pokemon ids
; indexes for:
; - MonsterNames (see data/pokemon/names.asm)
; - EvosMovesPointerTable (see data/pokemon/evos_moves.asm)
; - CryData (see data/pokemon/cries.asm)
; - PokedexOrder (see data/pokemon/dex_order.asm)
; - PokedexEntryPointers (see data/pokemon/dex_entries.asm)
const_def
const NO_MON ; $00
const RHYDON ; $01
Expand Down
4 changes: 3 additions & 1 deletion constants/script_constants.asm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; emotion bubbles
; EmotionBubblesPointerTable indexes (see engine/overworld/emotion_bubbles.asm)
const_def
const EXCLAMATION_BUBBLE ; 0
const QUESTION_BUBBLE ; 1
Expand All @@ -13,6 +13,7 @@ SLOTSBIRD EQU $1210
SLOTSMOUSE EQU $1614

; in game trades
; TradeMons indexes (see data/events/trades.asm)
const_def
const TRADE_FOR_TERRY
const TRADE_FOR_MARCEL
Expand All @@ -26,6 +27,7 @@ SLOTSMOUSE EQU $1614
const TRADE_FOR_SPOT

; in game trade dialog sets
; InGameTradeTextPointers indexes (see engine/events/in_game_trades.asm)
const_def
const TRADE_DIALOGSET_CASUAL
const TRADE_DIALOGSET_POLITE
Expand Down
1 change: 1 addition & 0 deletions constants/sprite_constants.asm
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; overworld sprites
; SpriteSheetPointerTable indexes (see data/sprites/sprites.asm)
const_def
const SPRITE_NONE ; $00
const SPRITE_RED ; $01
Expand Down
2 changes: 2 additions & 0 deletions constants/tileset_constants.asm
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
; tileset ids
; Tilesets indexes (see data/tilesets/tileset_headers.asm)
const_def
const OVERWORLD ; 0
const REDS_HOUSE_1 ; 1
Expand Down
8 changes: 8 additions & 0 deletions constants/trainer_constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ trainer_const: MACRO
OPP_\1 EQU OPP_ID_OFFSET + \1
ENDM

; trainer class ids
; indexes for:
; - TrainerNames (see data/trainers/names.asm)
; - TrainerNamePointers (see data/trainers/name_pointers.asm)
; - TrainerDataPointers (see data/trainers/parties.asm)
; - 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
Expand Down
1 change: 1 addition & 0 deletions constants/type_constants.asm
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
; TypeNames indexes (see data/types/names.asm)
const_def

PHYSICAL EQU const_value
Expand Down
1 change: 1 addition & 0 deletions data/credits/credits_text.asm
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
CreditsTextPointers:
; entries correspond to CRED_* constants
dw CredVersion
dw CredTajiri
dw CredTaOota
Expand Down
1 change: 1 addition & 0 deletions data/events/trades.asm
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
TradeMons:
; entries correspond to TRADE_FOR_* constants
; give mon, get mon, dialog id, nickname
db NIDORINO, NIDORINA, TRADE_DIALOGSET_CASUAL, "TERRY@@@@@@"
db ABRA, MR_MIME, TRADE_DIALOGSET_CASUAL, "MARCEL@@@@@"
Expand Down
58 changes: 29 additions & 29 deletions data/icon_pointers.asm
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,36 @@ mon_icon_header: MACRO
dw \1 tile \2
db \3
db BANK(\1)
dw vSprites tile \4
dw vSprites tile (\4)
ENDM

MonPartySpritePointers:
; gfx pointer, gfx tile offset, # tiles, vSprites tile offset
mon_icon_header MonsterSprite, 12, 4, $00
mon_icon_header PokeBallSprite, 0, 8, $04
mon_icon_header FairySprite, 12, 4, $0c
mon_icon_header BirdSprite, 12, 4, $10
mon_icon_header SeelSprite, 0, 4, $14
mon_icon_header BugIconFrame2, 0, 1, $18
mon_icon_header BugIconFrame2, 1, 1, $1a
mon_icon_header PlantIconFrame2, 0, 1, $1c
mon_icon_header PlantIconFrame2, 1, 1, $1e
mon_icon_header SnakeIconFrame1, 0, 1, $20
mon_icon_header SnakeIconFrame1, 1, 1, $22
mon_icon_header QuadrupedIconFrame1, 0, 1, $24
mon_icon_header QuadrupedIconFrame1, 1, 1, $26
mon_icon_header TradeBubbleIconGFX, 0, 4, $38
mon_icon_header MonsterSprite, 0, 4, $40
mon_icon_header PokeBallSprite, 0, 8, $44
mon_icon_header FairySprite, 0, 4, $4c
mon_icon_header BirdSprite, 0, 4, $50
mon_icon_header SeelSprite, 12, 4, $54
mon_icon_header BugIconFrame1, 0, 1, $58
mon_icon_header BugIconFrame1, 1, 1, $5a
mon_icon_header PlantIconFrame1, 0, 1, $5c
mon_icon_header PlantIconFrame1, 1, 1, $5e
mon_icon_header SnakeIconFrame2, 0, 1, $60
mon_icon_header SnakeIconFrame2, 1, 1, $62
mon_icon_header QuadrupedIconFrame2, 0, 1, $64
mon_icon_header QuadrupedIconFrame2, 1, 1, $66
mon_icon_header TradeBubbleIconGFX, 4, 4, $78
mon_icon_header MonsterSprite, 12, 4, ICON_MON << 2
mon_icon_header PokeBallSprite, 0, 8, ICON_BALL << 2
mon_icon_header FairySprite, 12, 4, ICON_FAIRY << 2
mon_icon_header BirdSprite, 12, 4, ICON_BIRD << 2
mon_icon_header SeelSprite, 0, 4, ICON_WATER << 2
mon_icon_header BugIconFrame2, 0, 1, ICON_BUG << 2
mon_icon_header BugIconFrame2, 1, 1, ICON_BUG << 2 + 2
mon_icon_header PlantIconFrame2, 0, 1, ICON_GRASS << 2
mon_icon_header PlantIconFrame2, 1, 1, ICON_GRASS << 2 + 2
mon_icon_header SnakeIconFrame1, 0, 1, ICON_SNAKE << 2
mon_icon_header SnakeIconFrame1, 1, 1, ICON_SNAKE << 2 + 2
mon_icon_header QuadrupedIconFrame1, 0, 1, ICON_QUADRUPED << 2
mon_icon_header QuadrupedIconFrame1, 1, 1, ICON_QUADRUPED << 2 + 2
mon_icon_header TradeBubbleIconGFX, 0, 4, ICON_TRADEBUBBLE << 2
mon_icon_header MonsterSprite, 0, 4, ICONOFFSET + ICON_MON << 2
mon_icon_header PokeBallSprite, 0, 8, ICONOFFSET + ICON_BALL << 2
mon_icon_header FairySprite, 0, 4, ICONOFFSET + ICON_FAIRY << 2
mon_icon_header BirdSprite, 0, 4, ICONOFFSET + ICON_BIRD << 2
mon_icon_header SeelSprite, 12, 4, ICONOFFSET + ICON_WATER << 2
mon_icon_header BugIconFrame1, 0, 1, ICONOFFSET + ICON_BUG << 2
mon_icon_header BugIconFrame1, 1, 1, ICONOFFSET + ICON_BUG << 2 + 2
mon_icon_header PlantIconFrame1, 0, 1, ICONOFFSET + ICON_GRASS << 2
mon_icon_header PlantIconFrame1, 1, 1, ICONOFFSET + ICON_GRASS << 2 + 2
mon_icon_header SnakeIconFrame2, 0, 1, ICONOFFSET + ICON_SNAKE << 2
mon_icon_header SnakeIconFrame2, 1, 1, ICONOFFSET + ICON_SNAKE << 2 + 2
mon_icon_header QuadrupedIconFrame2, 0, 1, ICONOFFSET + ICON_QUADRUPED << 2
mon_icon_header QuadrupedIconFrame2, 1, 1, ICONOFFSET + ICON_QUADRUPED << 2 + 2
mon_icon_header TradeBubbleIconGFX, 4, 4, ICONOFFSET + ICON_TRADEBUBBLE << 2
Loading

0 comments on commit 69788c5

Please sign in to comment.