summaryrefslogtreecommitdiff
path: root/src/engine
diff options
context:
space:
mode:
authorjidoc01 <jidoc01@naver.com>2019-07-07 22:50:09 +0900
committerjidoc01 <jidoc01@naver.com>2019-07-07 22:50:09 +0900
commitca2034184fa5f5e7dc4d9a779d5e2a2a17a024c5 (patch)
tree045bc79cfeebd2014530050aed7a1d334c324444 /src/engine
parenta1dcd04fc19fd14776c94a7b41d993a270aae8f6 (diff)
parent87ddb7aaeb884e9f4d73aeeb66d747ccb6077bf3 (diff)
Merge branch 'master' of https://github.com/pret/poketcg
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/bank01.asm30
-rw-r--r--src/engine/bank02.asm4
-rw-r--r--src/engine/bank03.asm2
-rw-r--r--src/engine/bank04.asm8
-rw-r--r--src/engine/bank06.asm59
-rw-r--r--src/engine/bank07.asm2
-rw-r--r--src/engine/home.asm20
7 files changed, 64 insertions, 61 deletions
diff --git a/src/engine/bank01.asm b/src/engine/bank01.asm
index 79035fc..e81f95d 100644
--- a/src/engine/bank01.asm
+++ b/src/engine/bank01.asm
@@ -1921,7 +1921,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
@@ -3139,7 +3139,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 +3150,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 +3503,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 +3525,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 +4327,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 +4428,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 +4549,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 +4665,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 +4713,7 @@ PrintCardPageRarityIcon: ; 5dd3 (1:5dd3)
ld c, a
ld b, $00
add hl, bc
- call ProcessTextFromPointerToID_InitTextPrinting
+ call InitTextPrinting_ProcessTextFromPointerToID
ret
; 0x5ddd
@@ -4782,7 +4782,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 +5740,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 +6428,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 +7556,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 4bbf7ca..f22d584 100644
--- a/src/engine/bank02.asm
+++ b/src/engine/bank02.asm
@@ -532,10 +532,10 @@ Func_90fb: ; 90fb (2:50fb)
push af
inc a
jr z, .asm_9103
- ld a, $2
+ ld a, SFX_02
jr .asm_9105
.asm_9103
- ld a, $3
+ ld a, SFX_03
.asm_9105
call PlaySFX
pop af
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 de83a1e..e6793d5 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
@@ -248,7 +253,7 @@ PrintCardName_HandlePlayAreaView: ; 18171 (6:4171)
push af
lb de, 1, 17
call InitTextPrinting
- ldtx hl, Text0251
+ ldtx hl, EmptyLineText
call ProcessTextFromID
ld hl, hffb0
@@ -261,8 +266,7 @@ PrintCardName_HandlePlayAreaView: ; 18171 (6:4171)
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
@@ -438,24 +442,23 @@ Func_006_42b1:
ldh [hWhoseTurn], a
ret
-Data_006_42bb:
-;
- db $01, $00
- db $02, $00
- db $03, $00
- db $04, $00
- db $05, $00
- db $00, $00
- db $4f, $02
- db $50, $02
- db $00, $00
- db $4f, $02
- db $50, $02
- db $01, $00
- db $02, $00
- db $03, $00
- db $04, $00
- db $05, $00
+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
Data_006_42db:
; transitions[]
@@ -1686,16 +1689,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 23095e1..7739545 100644
--- a/src/engine/home.asm
+++ b/src/engine/home.asm
@@ -7376,17 +7376,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
@@ -7490,7 +7490,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
@@ -7940,7 +7940,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
@@ -8172,7 +8172,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
@@ -8348,7 +8348,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
@@ -9995,7 +9995,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]
@@ -10009,7 +10009,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