summaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2020-07-20 12:23:31 -0400
committerRangi <remy.oukaour+rangi42@gmail.com>2020-07-20 12:31:35 -0400
commit69788c536b70060c58136b07fb3a615b285de99c (patch)
treec5a21b6e4d24ad3e98c3c98982afc65a866e650d /engine
parent0177688ad4d923c4970009fa87df48605bb43ed6 (diff)
Add comments associating constants with data, and identify some more data
Diffstat (limited to 'engine')
-rwxr-xr-xengine/battle/animations.asm14
-rwxr-xr-xengine/events/in_game_trades.asm1
-rwxr-xr-xengine/gfx/mon_icons.asm8
-rwxr-xr-xengine/gfx/palettes.asm1
-rwxr-xr-xengine/items/item_effects.asm23
-rwxr-xr-xengine/menus/main_menu.asm8
-rwxr-xr-xengine/menus/naming_screen.asm4
-rw-r--r--engine/menus/text_box.asm216
-rwxr-xr-xengine/movie/trade.asm18
-rwxr-xr-xengine/overworld/emotion_bubbles.asm1
10 files changed, 42 insertions, 252 deletions
diff --git a/engine/battle/animations.asm b/engine/battle/animations.asm
index 85019fa1..e10b5e0d 100755
--- a/engine/battle/animations.asm
+++ b/engine/battle/animations.asm
@@ -848,8 +848,8 @@ TradeShakePokeball:
jp PlaySound
BallMoveDistances1:
- db -12,-12,-8
- db $ff ; terminator
+ db -12, -12, -8
+ db -1 ; end
; function to make the pokeball jump up
TradeJumpPokeball:
@@ -889,8 +889,8 @@ TradeJumpPokeball:
jr .loop
BallMoveDistances2:
- db 11,12,-12,-7,7,12,-8,8
- db $ff ; terminator
+ db 11, 12, -12, -7, 7, 12, -8, 8
+ db -1 ; end
; this function copies the current musical note graphic
; so that there are two musical notes flying towards the defending pokemon
@@ -1522,7 +1522,7 @@ SpiralBallAnimationCoordinates:
db $58, $28
db $50, $30
db $50, $28
- db $FF ; list terminator
+ db -1 ; end
AnimationSquishMonPic:
; Squishes the mon's sprite horizontally making it
@@ -1677,13 +1677,13 @@ UpwardBallsAnimXCoordinatesPlayerTurn:
; List of x coordinates for each pillar of "energy" balls in the
; AnimationShootManyBallsUpward animation. It's unused in the game.
db $10, $40, $28, $18, $38, $30
- db $FF ; list terminator
+ db -1 ; end
UpwardBallsAnimXCoordinatesEnemyTurn:
; List of x coordinates for each pillar of "energy" balls in the
; AnimationShootManyBallsUpward animation. It's unused in the game.
db $60, $90, $78, $68, $88, $80
- db $FF ; list terminator
+ db -1 ; end
AnimationMinimizeMon:
; Changes the mon's sprite to a mini black sprite. Used by the
diff --git a/engine/events/in_game_trades.asm b/engine/events/in_game_trades.asm
index 8a29d6a4..c6951615 100755
--- a/engine/events/in_game_trades.asm
+++ b/engine/events/in_game_trades.asm
@@ -233,6 +233,7 @@ InGameTrade_TrainerString:
db "<TRAINER>@@@@@@@@@@"
InGameTradeTextPointers:
+; entries correspond to TRADE_DIALOGSET_* constants
dw TradeTextPointers1
dw TradeTextPointers2
dw TradeTextPointers3
diff --git a/engine/gfx/mon_icons.asm b/engine/gfx/mon_icons.asm
index 8dd6fe75..16409640 100755
--- a/engine/gfx/mon_icons.asm
+++ b/engine/gfx/mon_icons.asm
@@ -55,11 +55,11 @@ GetAnimationSpeed:
ld bc, $10
ld a, [wCurrentMenuItem]
call AddNTimes
- ld c, $40 ; amount to increase the tile id by
+ ld c, ICONOFFSET
ld a, [hl]
- cp $4 ; tile ID for ICON_BALL
+ cp ICON_BALL << 2
jr z, .editCoords
- cp $8 ; tile ID for ICON_HELIX
+ cp ICON_HELIX << 2
jr nz, .editTileIDS
; ICON_BALL and ICON_HELIX only shake up and down
.editCoords
@@ -274,7 +274,7 @@ GetPartyMonSpriteID:
swap a ; use lower nybble if pokedex num is even
.skipSwap
and $f0
- srl a
+ srl a ; value == ICON constant << 2
srl a
ret
diff --git a/engine/gfx/palettes.asm b/engine/gfx/palettes.asm
index 618e48b3..f2019e85 100755
--- a/engine/gfx/palettes.asm
+++ b/engine/gfx/palettes.asm
@@ -241,6 +241,7 @@ SetPal_TrainerCard:
ret
SetPalFunctions:
+; entries correspond to SET_PAL_* constants
dw SetPal_BattleBlack
dw SetPal_Battle
dw SetPal_TownMap
diff --git a/engine/items/item_effects.asm b/engine/items/item_effects.asm
index a8ff1e06..05f8038f 100755
--- a/engine/items/item_effects.asm
+++ b/engine/items/item_effects.asm
@@ -16,6 +16,7 @@ UseItem_::
jp hl
ItemUsePtrTable:
+; entries correspond to item ids
dw ItemUseBall ; MASTER_BALL
dw ItemUseBall ; ULTRA_BALL
dw ItemUseBall ; GREAT_BALL
@@ -1808,23 +1809,17 @@ WakeUpEntireParty:
jr nz, .loop
ret
-; Format:
-; 00: Y
-; 01: X
Route12SnorlaxFluteCoords:
- db 62,9 ; one space West of Snorlax
- db 61,10 ; one space North of Snorlax
- db 63,10 ; one space South of Snorlax
- db 62,11 ; one space East of Snorlax
- db $ff ; terminator
+ dbmapcoord 9, 62 ; one space West of Snorlax
+ dbmapcoord 10, 61 ; one space North of Snorlax
+ dbmapcoord 10, 63 ; one space South of Snorlax
+ dbmapcoord 11, 62 ; one space East of Snorlax
+ db -1 ; end
-; Format:
-; 00: Y
-; 01: X
Route16SnorlaxFluteCoords:
- db 10,27 ; one space East of Snorlax
- db 10,25 ; one space West of Snorlax
- db $ff ; terminator
+ dbmapcoord 27, 10 ; one space East of Snorlax
+ dbmapcoord 25, 10 ; one space West of Snorlax
+ db -1 ; end
PlayedFluteNoEffectText:
text_far _PlayedFluteNoEffectText
diff --git a/engine/menus/main_menu.asm b/engine/menus/main_menu.asm
index 3ecd99b1..95404cce 100755
--- a/engine/menus/main_menu.asm
+++ b/engine/menus/main_menu.asm
@@ -678,11 +678,11 @@ SetCursorPositionsFromOptions:
; 00: X coordinate of menu cursor
; 01: delay after printing a letter (in frames)
TextSpeedOptionData:
- db 14,5 ; Slow
- db 7,3 ; Medium
- db 1,1 ; Fast
+ db 14, 5 ; Slow
+ db 7, 3 ; Medium
+ db 1, 1 ; Fast
db 7 ; default X coordinate (Medium)
- db $ff ; terminator
+ db -1 ; end
CheckForPlayerNameInSRAM:
; Check if the player name data in SRAM has a string terminator character
diff --git a/engine/menus/naming_screen.asm b/engine/menus/naming_screen.asm
index 34c1aad3..9347212e 100755
--- a/engine/menus/naming_screen.asm
+++ b/engine/menus/naming_screen.asm
@@ -231,10 +231,10 @@ DisplayNamingScreen:
ld [wNamingScreenLetter], a
call CalcStringLength
ld a, [wNamingScreenLetter]
- cp $e5
+ cp "゙"
ld de, Dakutens
jr z, .dakutensAndHandakutens
- cp $e4
+ cp "゚"
ld de, Handakutens
jr z, .dakutensAndHandakutens
ld a, [wNamingScreenType]
diff --git a/engine/menus/text_box.asm b/engine/menus/text_box.asm
index 2e69c5a4..5253ec48 100644
--- a/engine/menus/text_box.asm
+++ b/engine/menus/text_box.asm
@@ -125,148 +125,7 @@ GetAddressOfScreenCoords:
add hl, de
ret
-; Format:
-; 00: text box ID
-; 01-02: function address
-TextBoxFunctionTable:
- dbw MONEY_BOX, DisplayMoneyBox
- dbw BUY_SELL_QUIT_MENU, DoBuySellQuitMenu
- dbw FIELD_MOVE_MON_MENU, DisplayFieldMoveMonMenu
- db $ff ; terminator
-
-; Format:
-; 00: text box ID
-; 01: column of upper left corner
-; 02: row of upper left corner
-; 03: column of lower right corner
-; 04: row of lower right corner
-TextBoxCoordTable:
- db MESSAGE_BOX, 0, 12, 19, 17
- db $03, 0, 0, 19, 14
- db $07, 0, 0, 11, 6
- db LIST_MENU_BOX, 4, 2, 19, 12
- db $10, 7, 0, 19, 17
- db MON_SPRITE_POPUP, 6, 4, 14, 13
- db $ff ; terminator
-
-; Format:
-; 00: text box ID
-; 01: column of upper left corner
-; 02: row of upper left corner
-; 03: column of lower right corner
-; 04: row of lower right corner
-; 05-06: address of text
-; 07: column of beginning of text
-; 08: row of beginning of text
-; table of window positions and corresponding text [key, start column, start row, end column, end row, text pointer [2 bytes], text column, text row]
-TextBoxTextAndCoordTable:
- db JP_MOCHIMONO_MENU_TEMPLATE
- db 0,0,14,17 ; text box coordinates
- dw JapaneseMochimonoText
- db 3,0 ; text coordinates
-
- db USE_TOSS_MENU_TEMPLATE
- db 13,10,19,14 ; text box coordinates
- dw UseTossText
- db 15,11 ; text coordinates
-
- db JP_SAVE_MESSAGE_MENU_TEMPLATE
- db 0,0,7,5 ; text box coordinates
- dw JapaneseSaveMessageText
- db 2,2 ; text coordinates
-
- db JP_SPEED_OPTIONS_MENU_TEMPLATE
- db 0,6,5,10 ; text box coordinates
- dw JapaneseSpeedOptionsText
- db 2,7 ; text coordinates
-
- db BATTLE_MENU_TEMPLATE
- db 8,12,19,17 ; text box coordinates
- dw BattleMenuText
- db 10,14 ; text coordinates
-
- db SAFARI_BATTLE_MENU_TEMPLATE
- db 0,12,19,17 ; text box coordinates
- dw SafariZoneBattleMenuText
- db 2,14 ; text coordinates
-
- db SWITCH_STATS_CANCEL_MENU_TEMPLATE
- db 11,11,19,17 ; text box coordinates
- dw SwitchStatsCancelText
- db 13,12 ; text coordinates
-
- db BUY_SELL_QUIT_MENU_TEMPLATE
- db 0,0,10,6 ; text box coordinates
- dw BuySellQuitText
- db 2,1 ; text coordinates
-
- db MONEY_BOX_TEMPLATE
- db 11,0,19,2 ; text box coordinates
- dw MoneyText
- db 13,0 ; text coordinates
-
- db JP_AH_MENU_TEMPLATE
- db 7,6,11,10 ; text box coordinates
- dw JapaneseAhText
- db 8,8 ; text coordinates
-
- db JP_POKEDEX_MENU_TEMPLATE
- db 11,8,19,17 ; text box coordinates
- dw JapanesePokedexMenu
- db 12,10 ; text coordinates
-
-; note that there is no terminator
-
-BuySellQuitText:
- db "BUY"
- next "SELL"
- next "QUIT@"
-
- db "@" ; unused
-
-UseTossText:
- db "USE"
- next "TOSS@"
-
-JapaneseSaveMessageText:
- db "きろく"
- next "メッセージ@"
-
-JapaneseSpeedOptionsText:
- db "はやい"
- next "おそい@"
-
-MoneyText:
- db "MONEY@"
-
-JapaneseMochimonoText:
- db "もちもの@"
-
-JapaneseMainMenuText:
- db "つづきから"
- next "さいしょから@"
-
-BattleMenuText:
- db "FIGHT <PK><MN>"
- next "ITEM RUN@"
-
-SafariZoneBattleMenuText:
- db "BALL× BAIT"
- next "THROW ROCK RUN@"
-
-SwitchStatsCancelText:
- db "SWITCH"
- next "STATS"
- next "CANCEL@"
-
-JapaneseAhText:
- db "アッ!@"
-
-JapanesePokedexMenu:
- db "データをみる"
- next "なきごえ"
- next "ぶんぷをみる"
- next "キャンセル@"
+INCLUDE "data/text_boxes.asm"
DisplayMoneyBox:
ld hl, wd730
@@ -518,50 +377,7 @@ TwoOptionMenu_RestoreScreenTiles:
call UpdateSprites
ret
-; Format:
-; 00: byte width
-; 01: byte height
-; 02: byte put blank line before first menu item
-; 03: word text pointer
-TwoOptionMenuStrings:
- db 4,3,0
- dw .YesNoMenu
- db 6,3,0
- dw .NorthWestMenu
- db 6,3,0
- dw .SouthEastMenu
- db 6,3,0
- dw .YesNoMenu
- db 6,3,0
- dw .NorthEastMenu
- db 7,3,0
- dw .TradeCancelMenu
- db 7,4,1
- dw .HealCancelMenu
- db 4,3,0
- dw .NoYesMenu
-
-.NoYesMenu
- db "NO"
- next "YES@"
-.YesNoMenu
- db "YES"
- next "NO@"
-.NorthWestMenu
- db "NORTH"
- next "WEST@"
-.SouthEastMenu
- db "SOUTH"
- next "EAST@"
-.NorthEastMenu
- db "NORTH"
- next "EAST@"
-.TradeCancelMenu
- db "TRADE"
- next "CANCEL@"
-.HealCancelMenu
- db "HEAL"
- next "CANCEL@"
+INCLUDE "data/yes_no_menu_strings.asm"
DisplayFieldMoveMonMenu:
xor a
@@ -683,16 +499,7 @@ DisplayFieldMoveMonMenu:
ld de, PokemonMenuEntries
jp PlaceString
-FieldMoveNames:
- db "CUT@"
- db "FLY@"
- db "@"
- db "SURF@"
- db "STRENGTH@"
- db "FLASH@"
- db "DIG@"
- db "TELEPORT@"
- db "SOFTBOILED@"
+INCLUDE "data/moves/field_move_names.asm"
PokemonMenuEntries:
db "STATS"
@@ -751,19 +558,4 @@ GetMonFieldMoves:
pop hl
ret
-; Format: [Move id], [name index], [leftmost tile]
-; Move id = id of move
-; Name index = index of name in FieldMoveNames
-; Leftmost tile = -1 + tile column in which the first letter of the move's name should be displayed
-; "SOFTBOILED" is $08 because it has 4 more letters than "SURF", for example, whose value is $0C
-FieldMoveDisplayData:
- db CUT, $01, $0C
- db FLY, $02, $0C
- db $B4, $03, $0C ; unused field move
- db SURF, $04, $0C
- db STRENGTH, $05, $0A
- db FLASH, $06, $0C
- db DIG, $07, $0C
- db TELEPORT, $08, $0A
- db SOFTBOILED, $09, $08
- db $ff ; list terminator
+INCLUDE "data/moves/field_moves.asm"
diff --git a/engine/movie/trade.asm b/engine/movie/trade.asm
index fa84e01d..bb06f231 100755
--- a/engine/movie/trade.asm
+++ b/engine/movie/trade.asm
@@ -604,7 +604,7 @@ Trade_AnimCircledMon:
ld c, $14
.loop
ld a, [hl]
- xor $40
+ xor ICONOFFSET
ld [hl], a
add hl, de
dec c
@@ -710,20 +710,20 @@ Trade_CircleOAMPointers:
trade_circle_oam Trade_CircleOAM3, $18, $18
Trade_CircleOAM0:
- dbsprite 2, 7, 0, 0, $39, OAM_OBP1
- dbsprite 2, 7, 0, 2, $3b, OAM_OBP1
+ dbsprite 2, 7, 0, 0, ICON_TRADEBUBBLE << 2 + 1, OAM_OBP1
+ dbsprite 2, 7, 0, 2, ICON_TRADEBUBBLE << 2 + 3, OAM_OBP1
Trade_CircleOAM1:
- dbsprite 6, 7, 0, 1, $38, OAM_OBP1 | OAM_HFLIP
- dbsprite 6, 7, 0, 3, $3a, OAM_OBP1 | OAM_HFLIP
+ dbsprite 6, 7, 0, 1, ICON_TRADEBUBBLE << 2 + 0, OAM_OBP1 | OAM_HFLIP
+ dbsprite 6, 7, 0, 3, ICON_TRADEBUBBLE << 2 + 2, OAM_OBP1 | OAM_HFLIP
Trade_CircleOAM2:
- dbsprite 10, 7, 0, 2, $3b, OAM_OBP1 | OAM_VFLIP
- dbsprite 10, 7, 0, 0, $39, OAM_OBP1 | OAM_VFLIP
+ dbsprite 10, 7, 0, 2, ICON_TRADEBUBBLE << 2 + 3, OAM_OBP1 | OAM_VFLIP
+ dbsprite 10, 7, 0, 0, ICON_TRADEBUBBLE << 2 + 1, OAM_OBP1 | OAM_VFLIP
Trade_CircleOAM3:
- dbsprite 14, 7, 0, 3, $3a, OAM_OBP1 | OAM_HFLIP | OAM_VFLIP
- dbsprite 14, 7, 0, 1, $38, OAM_OBP1 | OAM_HFLIP | OAM_VFLIP
+ dbsprite 14, 7, 0, 3, ICON_TRADEBUBBLE << 2 + 2, OAM_OBP1 | OAM_HFLIP | OAM_VFLIP
+ dbsprite 14, 7, 0, 1, ICON_TRADEBUBBLE << 2 + 0, OAM_OBP1 | OAM_HFLIP | OAM_VFLIP
; a = species
Trade_LoadMonSprite:
diff --git a/engine/overworld/emotion_bubbles.asm b/engine/overworld/emotion_bubbles.asm
index 0315687d..5a41c226 100755
--- a/engine/overworld/emotion_bubbles.asm
+++ b/engine/overworld/emotion_bubbles.asm
@@ -62,6 +62,7 @@ EmotionBubble:
jp UpdateSprites
EmotionBubblesPointerTable:
+; entries correspond to *_BUBBLE constants
dw ShockEmote
dw QuestionEmote
dw HappyEmote