summaryrefslogtreecommitdiff
path: root/src/engine
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/bank01.asm55
-rw-r--r--src/engine/bank02.asm13
-rw-r--r--src/engine/bank03.asm2
-rw-r--r--src/engine/bank04.asm8
-rw-r--r--src/engine/bank06.asm46
-rw-r--r--src/engine/bank07.asm2
-rw-r--r--src/engine/home.asm21
7 files changed, 84 insertions, 63 deletions
diff --git a/src/engine/bank01.asm b/src/engine/bank01.asm
index 680555b..868d284 100644
--- a/src/engine/bank01.asm
+++ b/src/engine/bank01.asm
@@ -466,18 +466,17 @@ OpenNonTurnHolderDiscardPileScreen: ; 4339 (1:4339)
OpenTurnHolderDiscardPileScreen: ; 4342 (1:4342)
jp OpenDiscardPileScreen
-; draw the non-turn holder's hand screen.
-; simpler version of OpenPlayerHandScreen where any selected card is directly submitted
-; and the duelist could also be the opponent.
+; draw the non-turn holder's hand screen. simpler version of OpenPlayerHandScreen
+; used only for checking the cards rather than for playing them.
OpenNonTurnHolderHandScreen_Simple: ; 4345 (1:4345)
call SwapTurn
call OpenTurnHolderHandScreen_Simple
jp SwapTurn
; 0x434e
-; draw the turn holder's hand screen.
-; simpler version of OpenPlayerHandScreen where any selected card is directly submitted
-; and the duelist could also be the opponent.
+; draw the turn holder's hand screen. simpler version of OpenPlayerHandScreen
+; used only for checking the cards rather than for playing them.
+; used for example in the "Your Play Area" screen of the Check menu
OpenTurnHolderHandScreen_Simple: ; 434e (1:434e)
call CreateHandCardList
jr c, .no_cards_in_hand
@@ -1921,7 +1920,7 @@ Func_4b60: ; 4b60 (1:4b60)
call .asm_4cb4
call .asm_4cb4
push hl
- ld a, $08
+ ld a, SFX_08
call PlaySFX
lb bc, 3, 5
ld a, e
@@ -2213,19 +2212,19 @@ Func_4e6e: ; 4e6e (1:4e6e)
ld b, $52
ld c, $57
.asm_4e7c
- ld hl, $63
- ld de, $67
+ ldtx hl, ShufflesTheDeckText
+ ldtx de, Drew7CardsText
jr Func_4e98
Func_4e84: ; 4e84 (1:4e84)
ld b, $53
ld c, $55
- ld hl, $65
- ld de, $66
+ ldtx hl, EachPlayerShuffleOpponentsDeckText
+ ldtx de, EachPlayerDraw7CardsText
ld a, [wDuelType]
cp DUELTYPE_PRACTICE
jr nz, Func_4e98
- ld hl, $64
+ ldtx hl, ThisIsJustPracticeDoNotShuffleText
; fallthrough
Func_4e98: ; 4e98 (1:4e98)
@@ -2243,10 +2242,10 @@ Func_4e98: ; 4e98 (1:4e98)
call EnableLCD
ld a, [wDuelType]
cp DUELTYPE_PRACTICE
- jr nz, .asm_4ebf
+ jr nz, .not_practice
call WaitForWideTextBoxInput
jr .asm_4ee0
-.asm_4ebf
+.not_practice
call Func_3b21
ld hl, sp+$03
ld a, [hl]
@@ -3139,7 +3138,7 @@ ReturnWrongAction:
; 0x54c8
; display BOXMSG_PLAYERS_TURN or BOXMSG_OPPONENTS_TURN and print
-; DuelistsTurnText in a textbox. also call ExchangeRNG.
+; DuelistTurnText in a textbox. also call ExchangeRNG.
DisplayDuelistTurnScreen: ; 54c8 (1:54c8)
call EmptyScreen
ld c, BOXMSG_PLAYERS_TURN
@@ -3150,7 +3149,7 @@ DisplayDuelistTurnScreen: ; 54c8 (1:54c8)
.got_turn
ld a, c
call DrawDuelBoxMessage
- ldtx hl, DuelistsTurnText
+ ldtx hl, DuelistTurnText
call DrawWideTextBox_WaitForInput
call ExchangeRNG
ret
@@ -3503,7 +3502,7 @@ CardListItemSelectionMenu: ; 56c2 (1:56c2)
ldtx hl, PlayCheck1Text
.got_text
call DrawNarrowTextBox_PrintTextNoDelay
- ld hl, ItemSelectionMenuParamenters
+ ld hl, ItemSelectionMenuParameters
xor a
call InitializeMenuParameters
.wait_a_or_b
@@ -3525,7 +3524,7 @@ CardListItemSelectionMenu: ; 56c2 (1:56c2)
ret
; 0x5708
-ItemSelectionMenuParamenters ; 5708 (1:5708)
+ItemSelectionMenuParameters: ; 5708 (1:5708)
db 1, 14 ; corsor x, cursor y
db 2 ; y displacement between items
db 2 ; number of items
@@ -4327,7 +4326,7 @@ DisplayCardPage_PokemonOverview: ; 5b7d (1:5b7d)
jr z, .basic
ld hl, wLoadedCard1PreEvoName
lb de, 1, 3
- call ProcessTextFromPointerToID_InitTextPrinting
+ call InitTextPrinting_ProcessTextFromPointerToID
.basic
; print card level and maximum HP
lb bc, 12, 2
@@ -4428,7 +4427,7 @@ PrintMoveOrPkmnPowerInformation: ; 5c33 (1:5c33)
dec hl
; print text ID pointed to by hl at 7,e
ld d, 7
- call ProcessTextFromPointerToID_InitTextPrinting
+ call InitTextPrinting_ProcessTextFromPointerToID
pop hl
inc hl
inc hl
@@ -4549,7 +4548,7 @@ PrintPokemonCardPageGenericInformation: ; 5cc4 (1:5cc4)
call DrawCardPageSurroundingBox
lb de, 5, 1
ld hl, wLoadedCard1Name
- call ProcessTextFromPointerToID_InitTextPrinting
+ call InitTextPrinting_ProcessTextFromPointerToID
ld a, [wCardPageType]
or a
jr z, .from_loaded_card
@@ -4665,7 +4664,7 @@ DisplayCardPage_PokemonDescription: ; 5d54 (1:5d54)
; print the Pokemon's category at 1,10 (just above the length and weight texts)
lb de, 1, 10
ld hl, wLoadedCard1Category
- call ProcessTextFromPointerToID_InitTextPrinting
+ call InitTextPrinting_ProcessTextFromPointerToID
ld a, TX_KATAKANA
call ProcessSpecialTextCharacter
ldtx hl, PokemonText
@@ -4713,7 +4712,7 @@ PrintCardPageRarityIcon: ; 5dd3 (1:5dd3)
ld c, a
ld b, $00
add hl, bc
- call ProcessTextFromPointerToID_InitTextPrinting
+ call InitTextPrinting_ProcessTextFromPointerToID
ret
; 0x5ddd
@@ -4782,7 +4781,7 @@ DisplayEnergyOrTrainerCardPage: ; 5e2d (1:5e2d)
; print the card's name at 4,3
lb de, 4, 3
ld hl, wLoadedCard1Name
- call ProcessTextFromPointerToID_InitTextPrinting
+ call InitTextPrinting_ProcessTextFromPointerToID
; colorize the card image
lb de, 6, 4
call ApplyBGP6OrSGB3ToCardImage
@@ -5740,7 +5739,7 @@ DisplayUsePokemonPowerScreen: ; 6510 (1:6510)
lb de, 1, 4
call InitTextPrinting
ld hl, wLoadedCard1Move1Name
- call ProcessTextFromPointerToID_InitTextPrinting
+ call InitTextPrinting_ProcessTextFromPointerToID
lb de, 1, 6
ld hl, wLoadedCard1Move1Description
call PrintMoveOrCardDescription
@@ -6428,7 +6427,7 @@ PrintAttachedEnergyToPokemon: ; 68e4 (1:68e4)
; print the PokemonEvolvedIntoPokemonText, given the Pokemon card to evolve in wccee,
; and the evolved Pokemon card in hTempCardIndex_ff98. also play a sound effect.
PrintPokemonEvolvedIntoPokemon: ; 68fa (1:68fa)
- ld a, $5e
+ ld a, SFX_5E
call PlaySFX
ld a, [wccee]
call LoadCardNameToTxRam2
@@ -7556,11 +7555,11 @@ _TossCoin: ; 71ad (1:71ad)
ld e, a
.asm_728a
- ld d, $54
+ ld d, SFX_54
ld a, e
or a
jr nz, .asm_7292
- ld d, $55
+ ld d, SFX_55
.asm_7292
ld a, d
diff --git a/src/engine/bank02.asm b/src/engine/bank02.asm
index e6957cc..2b4d598 100644
--- a/src/engine/bank02.asm
+++ b/src/engine/bank02.asm
@@ -2323,13 +2323,12 @@ DisplayCheckMenuCursor: ; 90f7 (2:50f7)
PlaySFXConfirmOrCancel: ; 90fb (2:50fb)
push af
inc a
- jr z, .cancel
- ld a, $2 ; confirmation sfx
- jr .sfx
-.cancel
- ld a, $3 ; cancellation sfx
-
-.sfx
+ jr z, .asm_9103
+ ld a, SFX_02 ; confirmation sfx
+ jr .asm_9105
+.asm_9103
+ ld a, SFX_03 ; cancellation sfx
+.asm_9105
call PlaySFX
pop af
ret
diff --git a/src/engine/bank03.asm b/src/engine/bank03.asm
index 00c6c88..b33fd35 100644
--- a/src/engine/bank03.asm
+++ b/src/engine/bank03.asm
@@ -64,7 +64,7 @@ LoadMap: ; c000 (3:4000)
ld a, [hl]
bit 4, [hl]
jr z, .asm_c0b6
- ld a, $c
+ ld a, SFX_0C
call PlaySFX
jp .asm_c037
.asm_c0b6
diff --git a/src/engine/bank04.asm b/src/engine/bank04.asm
index 290b004..e2ca66c 100644
--- a/src/engine/bank04.asm
+++ b/src/engine/bank04.asm
@@ -372,7 +372,7 @@ Func_10e71: ; 10e71 (4:4e71)
ldh a, [hKeysPressed]
and A_BUTTON
jr z, .asm_10e96
- ld a, $2
+ ld a, SFX_02
call PlaySFX
call Func_11016
call Func_11024
@@ -398,7 +398,7 @@ Func_10e97: ; 10e97 (4:4e97)
jr z, .asm_10eb9
ld [wd32e], a
call Func_10f2e
- ld a, $1
+ ld a, SFX_01
call PlaySFX
.asm_10eb9
pop bc
@@ -548,7 +548,7 @@ Func_11016: ; 11016 (4:5016)
ret
Func_11024: ; 11024 (4:5024)
- ld a, $57
+ ld a, SFX_57
call PlaySFX
ld a, [wd336]
ld [wWhichSprite], a
@@ -1191,7 +1191,7 @@ DisplayPlayerNamingScreen:: ; 128a9 (4:68a9)
; from the user into hl.
ld hl, wNameBuffer
farcall InputPlayerName
-
+
farcall WhiteOutDMGPals
call DoFrameIfLCDEnabled
call DisableLCD
diff --git a/src/engine/bank06.asm b/src/engine/bank06.asm
index e0d1672..7a20b2f 100644
--- a/src/engine/bank06.asm
+++ b/src/engine/bank06.asm
@@ -1,3 +1,5 @@
+; copy the name and level of the card at wLoadedCard1 to wDefaultText
+; a = length in number of tiles (the resulting string will be padded with spaces to match it)
_CopyCardNameAndLevel: ; 18000 (6:4000)
push bc
push de
@@ -12,7 +14,10 @@ _CopyCardNameAndLevel: ; 18000 (6:4000)
pop hl
ld a, [hli]
cp TX_HALFWIDTH
- jp z, Func_18086
+ jp z, _CopyCardNameAndLevel_HalfwidthText
+
+; the name doesn't start with TX_HALFWIDTH
+; this doesn't appear to be ever the case (unless caller manipulates wLoadedCard1Name)
ld a, [wcd9b]
ld c, a
ld a, [wLoadedCard1Type]
@@ -83,9 +88,9 @@ _CopyCardNameAndLevel: ; 18000 (6:4000)
pop de
pop bc
ret
-; 0x18086
-Func_18086: ; 18086 (6:4086)
+; the name starts with TX_HALFWIDTH
+_CopyCardNameAndLevel_HalfwidthText:
ld a, [wcd9b]
inc a
add a
@@ -224,18 +229,18 @@ Func_180d5: ; 180d5 (6:40d5)
push af
lb de, 1, 17
call InitTextPrinting
- ldtx hl, Text0251
+ ldtx hl, EmptyLineText
call ProcessTextFromID
ld hl, hffb0
ld [hl], $01
- ldtx hl, HandText2
+ ldtx hl, HandText_2
call ProcessTextFromID
ld hl, hffb0
ld [hl], $00
lb de, 1, 17
call InitTextPrinting
pop af
- ld hl, Data_006_42bb
+ ld hl, TextIDTable_182bb
ld b, 0
sla a
ld c, a
@@ -399,8 +404,25 @@ Func_006_42b1:
ldh [hWhoseTurn], a
ret
-Data_006_42bb:
- INCROM $182bb, $183bb
+TextIDTable_182bb:
+ tx HandText
+ tx CheckText
+ tx AttackText
+ tx PKMNPowerText
+ tx DoneText
+ dw NONE
+ tx DuelistHandText_2
+ tx DuelistDiscardPileText
+ dw NONE
+ tx DuelistHandText_2
+ tx DuelistDiscardPileText
+ tx HandText
+ tx CheckText
+ tx AttackText
+ tx PKMNPowerText
+ tx DoneText
+
+ INCROM $182db, $183bb
Func_006_43bb: ; 183bb (6:43bb)
xor a
@@ -1510,16 +1532,16 @@ ClearMemory: ; (6:6787)
ret
; play different sfx by a.
-; if a is 0xff play sfx with 0x03 (usually following a B press),
-; else with 0x02 (usually following an A press).
+; if a is 0xff play SFX_03 (usually following a B press),
+; else play SFX_02 (usually following an A press).
PlayAcceptOrDeclineSFX: ; (6:6794)
push af
inc a
jr z, .sfx_decline
- ld a, $02
+ ld a, SFX_02
jr .sfx_accept
.sfx_decline
- ld a, $03
+ ld a, SFX_03
.sfx_accept
call PlaySFX
pop af
diff --git a/src/engine/bank07.asm b/src/engine/bank07.asm
index dfae95a..a79f27a 100644
--- a/src/engine/bank07.asm
+++ b/src/engine/bank07.asm
@@ -451,7 +451,7 @@ Func_1d078: ; 1d078 (7:5078)
ldh a, [hKeysPressed]
and A_BUTTON | START
jr z, .asm_1d095
- ld a, $2
+ ld a, SFX_02
call PlaySFX
farcall Func_10ab4
diff --git a/src/engine/home.asm b/src/engine/home.asm
index 10298fe..40a1f85 100644
--- a/src/engine/home.asm
+++ b/src/engine/home.asm
@@ -858,6 +858,7 @@ CallIndirect: ; 05b6 (0:05b6)
ld h, a
pop af
; fallthrough
+
CallHL: ; 05c1 (0:05c1)
jp hl
; 0x5c2
@@ -7379,17 +7380,17 @@ HandleMenuInput: ; 264b (0:264b)
scf
ret
-; plays an "open screen" sound if [hCurMenuItem] != 0xff
-; plays an "exit screen" sound if [hCurMenuItem] == 0xff
+; plays an "open screen" sound (SFX_02) if [hCurMenuItem] != 0xff
+; plays an "exit screen" sound (SFX_03) if [hCurMenuItem] == 0xff
PlayOpenOrExitScreenSFX: ; 26c0 (0:26c0)
push af
ldh a, [hCurMenuItem]
inc a
jr z, .play_exit_sfx
- ld a, $2
+ ld a, SFX_02
jr .play_sfx
.play_exit_sfx
- ld a, $3
+ ld a, SFX_03
.play_sfx
call PlaySFX
pop af
@@ -7493,7 +7494,7 @@ HandleDuelMenuInput: ; 271a (0:271a)
and 1
.dpad_pressed
push af
- ld a, $1
+ ld a, SFX_01
call PlaySFX
call .erase_cursor
pop af
@@ -7943,7 +7944,7 @@ CardSymbolTable:
db $dc, $02 ; TYPE_TRAINER
; copy the name and level of the card at wLoadedCard1 to wDefaultText
-; a = string length in number of tiles (padded with spaces to fit)
+; a = length in number of tiles (the resulting string will be padded with spaces to match it)
CopyCardNameAndLevel: ; 29f5 (0:29f5)
farcall _CopyCardNameAndLevel
ret
@@ -8175,7 +8176,7 @@ HandleYesOrNoMenu:
and D_RIGHT | D_LEFT
jr z, .wait_button_loop
; left or right pressed, so switch to the other menu item
- ld a, $1
+ ld a, SFX_01
call PlaySFX
call EraseCursor
.refresh_menu
@@ -8351,7 +8352,7 @@ InitTextPrinting_ProcessTextFromID: ; 2c1b (0:2c1b)
jr ProcessTextFromID
; like ProcessTextFromPointerToID, except it calls InitTextPrinting first
-ProcessTextFromPointerToID_InitTextPrinting: ; 2c20 (0:2c20)
+InitTextPrinting_ProcessTextFromPointerToID: ; 2c20 (0:2c20)
call InitTextPrinting
; fallthrough
@@ -9998,7 +9999,7 @@ CheckNoDamageOrEffect: ; 34b7 (0:34b7)
add a
ld e, a
ld d, $0
- ld hl, NoDamageOrEffectTextPointerTable
+ ld hl, NoDamageOrEffectTextIDTable
add hl, de
ld a, [hli]
ld h, [hl]
@@ -10012,7 +10013,7 @@ CheckNoDamageOrEffect: ; 34b7 (0:34b7)
ret
; 0x34d8
-NoDamageOrEffectTextPointerTable: ; 34d8 (0:34d8)
+NoDamageOrEffectTextIDTable: ; 34d8 (0:34d8)
tx NoDamageOrEffectDueToAgilityText ; NO_DAMAGE_OR_EFFECT_AGILITY
tx NoDamageOrEffectDueToBarrierText ; NO_DAMAGE_OR_EFFECT_BARRIER
tx NoDamageOrEffectDueToFlyText ; NO_DAMAGE_OR_EFFECT_FLY