summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorxCrystal <rgr.crystal@gmail.com>2018-07-03 13:22:50 +0200
committerxCrystal <rgr.crystal@gmail.com>2018-07-03 13:22:50 +0200
commit7fe9f49ccabcc33ce6ab988e605352df2e8837ce (patch)
tree0929158e48ea213ff2b1e85aebc605d03ba88e06 /src
parentd201196bea11e71887a826b5b364d2d11f94abc9 (diff)
Misc bank 1 stuff
Diffstat (limited to 'src')
-rw-r--r--src/engine/bank01.asm45
-rw-r--r--src/engine/bank02.asm8
-rw-r--r--src/engine/effect_functions.asm8
-rw-r--r--src/engine/home.asm15
-rw-r--r--src/macros/data.asm5
-rw-r--r--src/wram.asm8
6 files changed, 55 insertions, 34 deletions
diff --git a/src/engine/bank01.asm b/src/engine/bank01.asm
index 6f1fe91..cb66e0a 100644
--- a/src/engine/bank01.asm
+++ b/src/engine/bank01.asm
@@ -357,8 +357,8 @@ DuelMainInterface: ; 426d (1:426d)
PrintDuelMenu: ; 4295 (1:4295)
call DrawWideTextBox
- ld hl, $54e9
- call Func_2c08
+ ld hl, DuelMenuData
+ call PlaceTextItems
.asm_429e
call $669d
ld a, [wDuelFinished]
@@ -801,7 +801,7 @@ DuelMenu_Check: ; 4585 (1:4585)
jp DuelMainInterface
; triggered by pressing SELECT in the duel menu
-DuelMenuShortcut_BothActivePokemon:: ; 458e (1:458e)
+DuelMenuShortcut_BothActivePokemon: ; 458e (1:458e)
call Func_3b31
call Func_4597
jp DuelMainInterface
@@ -964,7 +964,7 @@ Func_4693: ; 4693 (1:4693)
call DrawWideTextBox_PrintTextNoDelay
call EnableLCD
call CountCardsInDuelTempList
- ld hl, MenuParameters_46f3
+ ld hl, EnergyDiscardCardListParameters
lb de, 0, 0 ; initial page scroll offset, initial item (in the visible page)
call PrintCardListItems
ld a, $04
@@ -1006,7 +1006,7 @@ Func_46b7: ; 46b7 (1:46b7)
ret
; 0x46f3
-MenuParameters_46f3:
+EnergyDiscardCardListParameters:
db 1, 5 ; cursor x, cursor y
db 4 ; item x
db 14 ; maximum length, in tiles, occupied by the name and level string of each card in the list
@@ -2285,7 +2285,7 @@ DoPracticeDuelAction: ; 51e7 (1:51e7)
jp JumpToFunctionInTable
; 0x51f8
-PracticeDuelActionTable:: ; 51f8 (1:51f8)
+PracticeDuelActionTable: ; 51f8 (1:51f8)
dw $0000
dw Func_520e
dw Func_521a
@@ -2409,7 +2409,20 @@ Func_52bc: ; 52bc (1:52bc)
ret
; 0x52c5
- INCROM $52c5, $5550
+ INCROM $52c5, $54e9
+
+DuelMenuData: ; 54e9 (1:54e9)
+ ; x, y, text id
+ textitem 3, 14, HandText
+ textitem 9, 14, CheckText
+ textitem 15, 14, RetreatText
+ textitem 3, 16, AttackText
+ textitem 9, 16, PKMNPowerText
+ textitem 15, 16, DoneText
+ db $ff
+; 0x5502
+
+ INCROM $5502, $5550
; draw the turn holder's discard pile screen
OpenDiscardPileScreen: ; 5550 (1:5550)
@@ -3312,7 +3325,7 @@ HasAlivePokemonOnBench: ; 5fd9 (1:5fd9)
HasAlivePokemonInPlayArea: ; 5fdd (1:5fdd)
xor a
_HasAlivePokemonInPlayArea: ; 5fde (1:5fde)
- ld [wcbd2], a
+ ld [wExcludeArenaPokemon], a
ld b, a
ld a, DUELVARS_NUMBER_OF_POKEMON_IN_PLAY_AREA
call GetTurnDuelistVariable
@@ -3369,11 +3382,11 @@ _OpenPlayAreaScreen: ; 600e (1:600e)
call $61c7
call EnableLCD
.asm_6034
- ld hl, MenuParameters_60be
- ld a, [wcbd2]
+ ld hl, PlayAreaScreenMenuParameters_ActivePokemonIncluded
+ ld a, [wExcludeArenaPokemon]
or a
jr z, .asm_6040
- ld hl, MenuParameters_60c6
+ ld hl, PlayAreaScreenMenuParameters_ActivePokemonExcluded
.asm_6040
ld a, [wSelectedDuelSubMenuItem]
call InitializeMenuParameters
@@ -3387,14 +3400,14 @@ _OpenPlayAreaScreen: ; 600e (1:600e)
jp z, $60ac
pop af
ldh [hTempCardIndex_ff98], a
- ld a, [wcbd4]
+ ld a, [wcbd4] ; useless
jr OpenPlayAreaScreenForSelection
.asm_6061
call HandleMenuInput
jr nc, .asm_604c
ld a, e
ld [wSelectedDuelSubMenuItem], a
- ld a, [wcbd2]
+ ld a, [wExcludeArenaPokemon]
add e
ld [wcbc9], a
ld a, [wcbd6]
@@ -3412,7 +3425,7 @@ _OpenPlayAreaScreen: ; 600e (1:600e)
call Func_576a
jr .asm_6022
.asm_6091
- ld a, [wcbd2]
+ ld a, [wExcludeArenaPokemon]
ld c, a
ldh a, [hCurrentMenuItem]
add c
@@ -3442,7 +3455,7 @@ _OpenPlayAreaScreen: ; 600e (1:600e)
ret
; 0x60be
-MenuParameters_60be: ; 60be (1:60be)
+PlayAreaScreenMenuParameters_ActivePokemonIncluded: ; 60be (1:60be)
db 0, 0 ; cursor x, cursor y
db 3 ; y displacement between items
db 6 ; number of items
@@ -3450,7 +3463,7 @@ MenuParameters_60be: ; 60be (1:60be)
db SYM_SPACE ; tile behind cursor
dw $60ce ; function pointer if non-0
-MenuParameters_60c6: ; 60c6 (1:60c6)
+PlayAreaScreenMenuParameters_ActivePokemonExcluded: ; 60c6 (1:60c6)
db 0, 3 ; cursor x, cursor y
db 3 ; y displacement between items
db 6 ; number of items
diff --git a/src/engine/bank02.asm b/src/engine/bank02.asm
index e9f2868..daa51a5 100644
--- a/src/engine/bank02.asm
+++ b/src/engine/bank02.asm
@@ -147,7 +147,7 @@ Func_8e1f: ; 8e1f (2:4e1f)
Func_8e42: ; 8e42 (2:4e42)
call DrawWideTextBox
ld hl, Unknown_9027
- call Func_2c08
+ call PlaceTextItems
call Func_905a
.asm_8e4e
call DoFrame
@@ -580,7 +580,7 @@ Func_9168: ; 9168 (2:5168)
ld bc, $1404
call DrawRegularTextBox
ld hl, Unknown_9242
- call Func_2c08
+ call PlaceTextItems
ld a, $4
ld hl, wceb2
call Func_9843
@@ -819,7 +819,7 @@ Func_b19d: ; b19d (2:719d)
call Func_905a
call DrawWideTextBox
ld hl, $7274
- call Func_2c08
+ call PlaceTextItems
call DoFrame
call Func_9065
jp nc, $71e7
@@ -989,7 +989,7 @@ Func_ba04: ; ba04 (2:7a04)
ld [wce5e], a
call DrawWideTextBox
ld hl, $7b76
- call Func_2c08
+ call PlaceTextItems
call DoFrame
call $46ac
jp nc, $7acc
diff --git a/src/engine/effect_functions.asm b/src/engine/effect_functions.asm
index 0d7a910..0f9bd72 100644
--- a/src/engine/effect_functions.asm
+++ b/src/engine/effect_functions.asm
@@ -97,14 +97,14 @@ CommentedOut_2c086: ; 2c086 (b:4086)
ret
; 0x2c087
-Func_2c087: ; 2c087 (b:4087)
+PlaceTextItems7: ; 2c087 (b:4087)
xor a
- jr Func_2c08c
+ jr PlaceTextItemsc
-Func_2c08a: ; 2c08a (b:408a)
+PlaceTextItemsa: ; 2c08a (b:408a)
ld a, $1
-Func_2c08c:
+PlaceTextItemsc:
push de
push af
ld a, $11
diff --git a/src/engine/home.asm b/src/engine/home.asm
index 3a03bd8..ab60567 100644
--- a/src/engine/home.asm
+++ b/src/engine/home.asm
@@ -7477,20 +7477,23 @@ Func_2bdb: ; 2bdb (0:2bdb)
ld a, c
ret
-Func_2c08: ; 2c08 (0:2c08)
- ld d, [hl]
+; writes n items of text each given in the following format in hl:
+; x coord, y coord, text id
+; $ff-terminated
+PlaceTextItems: ; 2c08 (0:2c08)
+ ld d, [hl] ; x coord
inc hl
bit 7, d
- ret nz
- ld e, [hl]
- inc hl
+ ret nz ; return if no more items of text
+ ld e, [hl] ; y coord
+ inc hl ; hl = text id
call Func_22ae
push hl
call Func_2c23
pop hl
inc hl
inc hl
- jr Func_2c08
+ jr PlaceTextItems ; do next item
Func_2c1b: ; 2c1b (0:2c1b)
call Func_22ae
diff --git a/src/macros/data.asm b/src/macros/data.asm
index 7028636..ddb7443 100644
--- a/src/macros/data.asm
+++ b/src/macros/data.asm
@@ -89,3 +89,8 @@ txsymbol: MACRO
const SYM_\1
charmap "\1>", const_value + -1
ENDM
+
+textitem: MACRO
+ db \1, \2
+ tx \3
+ENDM
diff --git a/src/wram.asm b/src/wram.asm
index 02b6296..ad078c7 100644
--- a/src/wram.asm
+++ b/src/wram.asm
@@ -623,7 +623,9 @@ wSelectedDuelSubMenuScrollOffset:: ; cbd0
wcbd1:: ; cbd1
ds $1
-wcbd2:: ; cbd2
+; when processing or displaying the play area Pokemon cards of a duelist,
+; whether to account for only the benched Pokemon ($01) or also the arena Pokemon ($00).
+wExcludeArenaPokemon:: ; cbd2
ds $1
wcbd3:: ; cbd3
@@ -1946,7 +1948,7 @@ wd697:: ; d697
ds $6e8
-SECTION "WRAM Music", WRAMX
+SECTION "WRAM Audio", WRAMX
; bit 7 is set once the song has been started
wCurSongID:: ; dd80
@@ -2116,8 +2118,6 @@ wMusicCh3Stack:: ; de13
wMusicCh4Stack:: ; de1f
ds $c
-SECTION "WRAM Sfx", WRAMX
-
wde2b:: ; de2b
ds $3