summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxCrystal <rgr.crystal@gmail.com>2016-02-15 23:16:45 +0100
committerxCrystal <rgr.crystal@gmail.com>2016-02-15 23:16:45 +0100
commit0ff343d6c426b5f1e3dca63746345cebe596ad18 (patch)
tree798b37ac1651693ac96889afc762e9995e82b481
parent657df44253ac8283859133afa2737d12f5df4fee (diff)
Rename battle->duel and expand on menu wram addresses
-rwxr-xr-xsrc/engine/bank1.asm26
-rwxr-xr-xsrc/wram.asm32
2 files changed, 35 insertions, 23 deletions
diff --git a/src/engine/bank1.asm b/src/engine/bank1.asm
index 2e1abe4..f1de4ea 100755
--- a/src/engine/bank1.asm
+++ b/src/engine/bank1.asm
@@ -74,7 +74,7 @@ StartDuel: ; 409f (1:409f)
ld a, h
ld [$cbe6], a
xor a
- ld [wBattleMenuSelection], a
+ ld [wCurrentDuelMenuItem], a
call $420b
ld a, [$cc18]
ld [$cc08], a
@@ -87,19 +87,19 @@ StartDuel: ; 409f (1:409f)
; the loop returns here after every turn switch
.mainDuelLoop
xor a
- ld [wBattleMenuSelection], a
+ ld [wCurrentDuelMenuItem], a
call $35e6
call $54c8
call Func_4225
call $0f58
- ld a, [wBattleFinished]
+ ld a, [wDuelFinished]
or a
jr nz, .asm_4136
call $35fa
call $6baf
call $3b31
call $0f58
- ld a, [wBattleFinished]
+ ld a, [wDuelFinished]
or a
jr nz, .asm_4136
ld hl, $cc06
@@ -140,7 +140,7 @@ StartDuel: ; 409f (1:409f)
pop af
ldh [hWhoseTurn], a
call $3b21
- ld a, [wBattleFinished]
+ ld a, [wDuelFinished]
cp $1
jr z, .activeDuelistWonBattle
cp $2
@@ -187,7 +187,7 @@ StartDuel: ; 409f (1:409f)
call Func_378a
or a
jr nz, .asm_41a7
- ld a, [wBattleFinished]
+ ld a, [wDuelFinished]
cp $3
jr z, .tiedBattle
call Func_39fc
@@ -249,7 +249,7 @@ Func_4225: ; 4225 (1:4225)
call $10cf
jr nc, .asm_4248
ld a, $02
- ld [wBattleFinished], a
+ ld [wDuelFinished], a
ret
.asm_4248
@@ -295,10 +295,10 @@ Func_4295:
ld hl, $54e9
call Func_2c08
call $669D
- ld a, [wBattleFinished]
+ ld a, [wDuelFinished]
or a
ret nz
- ld a, [wBattleMenuSelection]
+ ld a, [wCurrentDuelMenuItem]
call $2710
Func_42ac:
@@ -330,7 +330,7 @@ Func_42ac:
jr nz, Func_42ac
call $271a
ld a, e
- ld [wBattleMenuSelection], a
+ ld [wCurrentDuelMenuItem], a
jr nc, Func_42ac
ldh a, [hCurrentMenuItem]
ld hl, BattleMenuFunctionTable
@@ -493,7 +493,7 @@ OpenBattleAttackMenu: ; 46fc (1:46fc)
.asm_470c
xor a
- ld [wBattleSubMenuSelected], a
+ ld [wSelectedDuelSubMenuItem], a
Func_4710: ; 4710 (1:4710)
call $4823
@@ -505,7 +505,7 @@ Func_4710: ; 4710 (1:4710)
Func_471f: ; 471f (1:471f)
push af
- ld a, [wBattleSubMenuSelected]
+ ld a, [wSelectedDuelSubMenuItem]
ld hl, $47e4
call InitializeCursorParameters
pop af
@@ -524,7 +524,7 @@ Func_471f: ; 471f (1:471f)
jr nc, .asm_4736
cp a, $ff
jp z, Func_4295
- ld [wBattleSubMenuSelected], a
+ ld [wSelectedDuelSubMenuItem], a
call $488f
jr nc, Func_4759
ld hl, $00c0
diff --git a/src/wram.asm b/src/wram.asm
index 387ccab..0217576 100755
--- a/src/wram.asm
+++ b/src/wram.asm
@@ -274,24 +274,36 @@ wSerialRecvBuf:: ; $cba5 - $cbc4
;--- Duels 2 ----------------------------------------------
-wBattleMenuSelection:: ; $cbc6
+; In a duel, the main menu current or last selected menu item
+; From 0 to 5: Hand, Attack, Check, Pkmn Power, Retreat, Done
+wCurrentDuelMenuItem:: ; $cbc6
ds $1
- ds $4
+
+; When we're viewing a card's information, the page we are currently at
+; For Pokemon cards, values from $1 to $6 (two pages for move descriptions)
+; For Energy cards, it's always $9
+; For Trainer cards, $d or $e (two pages for trainer card descriptions)
+wCardPageNumber:: ; $cbc7
+ ds $1
+ ds $3
wBenchSelectedPokemon:: ; $cbcb
ds $1
ds $3
-;When you're in a battle menu like your hand
-;and you press a, this keeps track of where the cursor was
-wBattleSubMenuSelected:: ; $cbcf
+; When you're in a duel menu like your hand and you press a,
+; the following two addresses keep track of which item was selected by the cursor
+wSelectedDuelSubMenuItem:: ; $cbcf
+ ds $1
+
+wSelectedDuelSubMenuScrollOffset:: ; $cbd0
ds $1
- ds $37
+ ds $36
-; 0 = no one has won battle yet
-; 1 = player whose turn it is has won the battle
-; 2 = player whose turn it is has lost the battle
-wBattleFinished:: ; $cc07
+; 0 = no one has won duel yet
+; 1 = player whose turn it is has won the duel
+; 2 = player whose turn it is has lost the duel
+wDuelFinished:: ; $cc07
ds $1
ds $6