summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/engine/bank1.asm70
-rw-r--r--src/engine/bank2.asm8
-rw-r--r--src/engine/bank20.asm4
-rw-r--r--src/engine/bank4.asm12
-rw-r--r--src/engine/bank5.asm4
-rw-r--r--src/engine/bank8.asm4
-rw-r--r--src/engine/effect_functions.asm2
-rw-r--r--src/engine/home.asm80
-rw-r--r--src/hram.asm24
-rw-r--r--src/text/text1.asm2
-rw-r--r--src/text/text_offsets.asm8
-rw-r--r--src/wram.asm3
12 files changed, 123 insertions, 98 deletions
diff --git a/src/engine/bank1.asm b/src/engine/bank1.asm
index 3e924be..1c4fd43 100644
--- a/src/engine/bank1.asm
+++ b/src/engine/bank1.asm
@@ -300,7 +300,7 @@ HandleTurn: ; 4225 (1:4225)
ret
.deck_not_empty
- ldh [hTempCardNumber], a
+ ldh [hTempCardNumber_ff98], a
call AddCardToHand
ld a, [wcc0d]
cp DUELIST_TYPE_PLAYER
@@ -443,7 +443,7 @@ DuelMenu_Done: ; 439a (1:439a)
call $51e7
jp c, Func_4268
ld a, $05
- call Func_0f7f
+ call SetDuelAIAction
call $717a
ret
@@ -467,9 +467,9 @@ DuelMenu_Retreat: ; 43ab (1:43ab)
jr c, Func_441c
ld [wBenchSelectedPokemon], a
ld a, [wBenchSelectedPokemon]
- ldh [$ffa1], a
+ ldh [hTempPlayAreaLocationOffset_ffa1], a
ld a, $04
- call Func_0f7f
+ call SetDuelAIAction
call $657a
jr nc, Func_441c
call $4f9d
@@ -489,13 +489,13 @@ Func_43f1: ; 43f1 (1:43f1)
call DrawWideTextBox_WaitForInput
call $600c
ld [wBenchSelectedPokemon], a
- ldh [$ffa1], a
+ ldh [hTempPlayAreaLocationOffset_ffa1], a
push af
call $6564
pop af
jp c, Func_426d
ld a, $04
- call Func_0f7f
+ call SetDuelAIAction
call $657a
Func_441c: ; 441c (1:441c)
@@ -536,15 +536,15 @@ PlayerUseEnergyCard: ; 4477 (1:4477)
ld a, $1
ld [wAlreadyPlayedEnergy], a
.asm_4495
- ld a, [$ff9d]
- ld [$ffa1], a
+ ldh a, [hTempPlayAreaLocationOffset_ff9d]
+ ldh [hTempPlayAreaLocationOffset_ffa1], a
ld e, a
- ld a, [$ff98]
+ ldh a, [hTempCardNumber_ff98]
ld [$ffa0], a
call $14d2
call $61b8
ld a, $3
- call Func_0f7f
+ call SetDuelAIAction
call $68e4
jp Func_426d
@@ -639,7 +639,7 @@ DuelMenu_Attack: ; 46fc (1:46fc)
ld d, [hl] ; card number within the deck (0 to 59)
inc hl
ld e, [hl] ; attack index (0 or 1)
- call CopyMoveDataAndDamageToBuffer
+ call CopyMoveDataAndDamage
call HandleAmnesiaSubstatus
jr c, .cannot_use_due_to_amnesia
ld a, $07
@@ -763,7 +763,7 @@ LoadPokemonMovesToDuelCardOrAttackList: ; 4823 (1:4823)
call DrawWideTextBox
ld a, DUELVARS_ARENA_CARD
call GetTurnDuelistVariable
- ldh [hTempCardNumber], a
+ ldh [hTempCardNumber_ff98], a
call LoadDeckCardToBuffer1
ld c, $00
ld b, $0d
@@ -773,7 +773,7 @@ LoadPokemonMovesToDuelCardOrAttackList: ; 4823 (1:4823)
ld de, wLoadedCard1Move1Name
call CheckIfMoveExists
jr c, .check_for_second_attack_slot
- ldh a, [hTempCardNumber]
+ ldh a, [hTempCardNumber_ff98]
ld [hli], a
xor a
ld [hli], a
@@ -792,7 +792,7 @@ LoadPokemonMovesToDuelCardOrAttackList: ; 4823 (1:4823)
ld de, wLoadedCard1Move2Name
call CheckIfMoveExists
jr c, .finish_loading_attacks
- ldh a, [hTempCardNumber]
+ ldh a, [hTempCardNumber_ff98]
ld [hli], a
ld a, $01
ld [hli], a
@@ -1032,10 +1032,10 @@ Func_4b60: ; 4b60 (1:4b60)
jp Func_4b60
.asm_4bd0
- ld a, [$ff97]
+ ldh a, [hWhoseTurn]
push af
- ld a, $c2
- ld [$ff97], a
+ ld a, PLAYER_TURN
+ ldh [hWhoseTurn], a
call Func_4cd5
call SwapTurn
call Func_4cd5
@@ -1055,7 +1055,7 @@ Func_4b60: ; 4b60 (1:4b60)
call $4c7c
call WaitForWideTextBoxInput
pop af
- ld [$ff97], a
+ ldh [hWhoseTurn], a
call $7133
call SwapTurn
call $7133
@@ -1065,8 +1065,8 @@ Func_4b60: ; 4b60 (1:4b60)
call DrawDuelBoxMessage
ldtx hl, CoinTossToDetermineWhoFirstText
call DrawWideTextBox_WaitForInput
- ld a, [$ff97]
- cp $c2
+ ldh a, [hWhoseTurn]
+ cp PLAYER_TURN
jr nz, .asm_4c52
ld de, wc590
call PrintPlayerName
@@ -1158,14 +1158,14 @@ Func_4cd5: ; 4cd5 (1:4cd5)
ld hl, $006e
call $5502
jr c, .asm_4d28
- ld a, [$ff98]
+ ldh a, [hTempCardNumber_ff98]
call LoadDeckCardToBuffer1
ld a, $2
call $51e7
jr c, .asm_4d28
- ld a, [$ff98]
+ ldh a, [hTempCardNumber_ff98]
call Func_1485
- ld a, [$ff98]
+ ldh a, [hTempCardNumber_ff98]
ld hl, $0062
call $4b31
jr .asm_4d4c
@@ -1174,7 +1174,7 @@ Func_4cd5: ; 4cd5 (1:4cd5)
call EmptyScreen
ld a, BOXMSG_BENCH_POKEMON
call DrawDuelBoxMessage
- ld hl, $006d
+ ldtx hl, ChooseUpTo5BasicPkmnToPlaceOnBenchText
call Func_2c73
ld a, $3
call $51e7
@@ -1183,13 +1183,13 @@ Func_4cd5: ; 4cd5 (1:4cd5)
ld hl, $006f
call $5502
jr c, .asm_4d8e
- ld a, $ef
+ ld a, DUELVARS_NUMBER_OF_POKEMON_IN_PLAY
call GetTurnDuelistVariable
- cp $6
+ cp MAX_POKEMON_IN_PLAY
jr nc, .asm_4d86
- ld a, [$ff98]
+ ldh a, [hTempCardNumber_ff98]
call Func_1485
- ld a, [$ff98]
+ ldh a, [hTempCardNumber_ff98]
ld hl, $0061
call $4b31
ld a, $5
@@ -1252,7 +1252,7 @@ LoadPlayerDeck: ; 6793 (1:6793)
; related to ai taking their turn in a duel
; called multiple times during one ai turn
AIMakeDecision: ; 67be (1:67be)
- ld [$ff9e], a
+ ldh [hAIActionTableIndex], a
ld hl, $cbf9
ld a, [hl]
ld [hl], $0
@@ -1265,10 +1265,10 @@ AIMakeDecision: ; 67be (1:67be)
jr c, .delay_loop
.skip_delay
- ld a, [$ff9e]
+ ldh a, [hAIActionTableIndex]
ld hl, $cbe1
ld [hl], $0
- ld hl, AIMoveTable
+ ld hl, AIActionTable
call JumpToFunctionInTable
ld a, [wDuelFinished]
ld hl, $cbe1
@@ -1290,7 +1290,7 @@ AIMakeDecision: ; 67be (1:67be)
INCROM $67fb, $695e
-AIMoveTable: ; 695e (1:695e)
+AIActionTable: ; 695e (1:695e)
dw Func_0f35
dw $69e0
dw $69c5
@@ -1318,11 +1318,11 @@ AIMoveTable: ; 695e (1:695e)
INCROM $698c, $69a5
AIUseEnergyCard: ; 69a5 (1:69a5)
- ld a, [$ffa1]
- ld [$ff9d], a
+ ldh a, [hTempPlayAreaLocationOffset_ffa1]
+ ldh [hTempPlayAreaLocationOffset_ff9d], a
ld e, a
ld a, [$ffa0]
- ld [$ff98], a
+ ldh [hTempCardNumber_ff98], a
call $14d2
ld a, [$ffa0]
call LoadDeckCardToBuffer1
diff --git a/src/engine/bank2.asm b/src/engine/bank2.asm
index a9871fd..2f66195 100644
--- a/src/engine/bank2.asm
+++ b/src/engine/bank2.asm
@@ -925,13 +925,13 @@ Func_ba04: ; ba04 (2:7a04)
call DoFrame
call HandleMenuInput
jr c, .asm_baa3
- ld a, [$ff8f]
- and $c0
+ ldh a, [hButtonsPressed2]
+ and D_UP | D_DOWN
jr z, .asm_ba4e
.asm_ba4e
- ld a, [$ff8f]
- and $8
+ ldh a, [hButtonsPressed2]
+ and START
jr z, .asm_ba40
ld a, [$cea1]
ld [$d087], a
diff --git a/src/engine/bank20.asm b/src/engine/bank20.asm
index b8dffd0..e0ed703 100644
--- a/src/engine/bank20.asm
+++ b/src/engine/bank20.asm
@@ -61,7 +61,7 @@ Func_801a1: ; 801a1 (20:41a1)
push hl
push bc
push de
- ld a, [$ff81]
+ ldh a, [hBankSRAM]
push af
ld a, $1
call BankswitchSRAM
@@ -111,7 +111,7 @@ Func_801a1: ; 801a1 (20:41a1)
Func_801f1: ; 801f1 (20:41f1)
push hl
push bc
- ld a, [$ff81]
+ ldh a, [hBankSRAM]
push af
ld a, $1
call BankswitchSRAM
diff --git a/src/engine/bank4.asm b/src/engine/bank4.asm
index c2a95ac..0e9b4c8 100644
--- a/src/engine/bank4.asm
+++ b/src/engine/bank4.asm
@@ -7,8 +7,8 @@ Func_10000: ; 10000 (4:4000)
call Func_2275
call Set_OBJ_8x8
xor a
- ld [$ff92], a
- ld [$ff93], a
+ ldh [hSCX], a
+ ldh [hSCY], a
ld a, [wLCDC]
bit 7, a
jr nz, .asm_10025
@@ -24,7 +24,7 @@ Func_10000: ; 10000 (4:4000)
ret
Func_10031: ; 10031 (4:4031)
- ld a, [$ff81]
+ ldh a, [hBankSRAM]
push af
ld a, $1
call BankswitchSRAM
@@ -286,7 +286,7 @@ Func_10af9: ; 10af9 (4:4af9)
INCROM $10af9, $10c96
Func_10c96: ; 10c96 (4:4c96)
- ld a, [$ff81]
+ ldh a, [hBankSRAM]
push af
push bc
ld a, $1
@@ -839,9 +839,9 @@ INCLUDE "data/map_scripts.asm"
Func_1184a: ; 1184a (4:584a)
; this may have been a macro
rlca
- add (PointerTable_118f5 & $ff)
+ add LOW(PointerTable_118f5)
ld l, a
- ld a, PointerTable_118f5 >> 8
+ ld a, HIGH(PointerTable_118f5)
adc $00
ld h, a
ld a, [hli]
diff --git a/src/engine/bank5.asm b/src/engine/bank5.asm
index 7a22558..4e21b6b 100644
--- a/src/engine/bank5.asm
+++ b/src/engine/bank5.asm
@@ -61,7 +61,7 @@ Func_14226: ; 14226 (5:4226)
ld hl, wDuelCardOrAttackList
.check_for_next_pokemon
ld a, [hli]
- ld [$ff98], a
+ ldh [hTempCardNumber_ff98], a
cp $ff
ret z
call LoadDeckCardToBuffer1
@@ -72,7 +72,7 @@ Func_14226: ; 14226 (5:4226)
or a
jr nz, .check_for_next_pokemon
push hl
- ld a, [$ff98]
+ ldh a, [hTempCardNumber_ff98]
call Func_1485
pop hl
jr .check_for_next_pokemon
diff --git a/src/engine/bank8.asm b/src/engine/bank8.asm
index 260ffbf..0dbe211 100644
--- a/src/engine/bank8.asm
+++ b/src/engine/bank8.asm
@@ -45,7 +45,7 @@ Func_200e5: ; 200e5 (8:40e5)
push hl
push de
ld a, [$ce16]
- ld [$ff9f], a
+ ldh [hTempCardNumber_ff9f], a
bank1call $35a9
jp c, $41a8
call Func_1944
@@ -66,7 +66,7 @@ Func_200e5: ; 200e5 (8:40e5)
push de
push hl
ld a, [$ce16]
- ld [$ff9f], a
+ ldh [hTempCardNumber_ff9f], a
ld a, $6
bank1call $67be
pop hl
diff --git a/src/engine/effect_functions.asm b/src/engine/effect_functions.asm
index 88a8361..1d49838 100644
--- a/src/engine/effect_functions.asm
+++ b/src/engine/effect_functions.asm
@@ -108,7 +108,7 @@ asm_2c08c
push de
push af
ld a, $11
- call Func_0f7f
+ call SetDuelAIAction
pop af
pop de
call Func_0fac
diff --git a/src/engine/home.asm b/src/engine/home.asm
index 7ccea04..7257af3 100644
--- a/src/engine/home.asm
+++ b/src/engine/home.asm
@@ -1220,7 +1220,7 @@ BankswitchHome: ; 07a3 (0:07a3)
; switch SRAM bank
BankswitchSRAM: ; 07a9 (0:07a9)
push af
- ldh [hBankRAM], a
+ ldh [hBankSRAM], a
ld [MBC3SRamBank], a
ld a, SRAM_ENABLE
ld [MBC3SRamEnable], a
@@ -2492,15 +2492,17 @@ Func_0f58: ; 0f58 (0:0f58)
jp c, Func_0f35
ret
-Func_0f7f: ; 0f7f (0:0f7f)
+; sets hAIActionTableIndex to an AI action specified in register a
+; also appears to handle sending data in a link duel
+SetDuelAIAction: ; 0f7f (0:0f7f)
push hl
push bc
- ld [$ff9e], a
+ ldh [hAIActionTableIndex], a
ld a, DUELVARS_DUELIST_TYPE
call GetNonTurnDuelistVariable
cp DUELIST_TYPE_LINK_OPP
jr nz, .not_link
- ld hl, $ff9e
+ ld hl, hAIActionTableIndex
ld bc, $000a
call Func_0ebf
call Func_0f58
@@ -2513,7 +2515,7 @@ Func_0f7f: ; 0f7f (0:0f7f)
Func_0f9b: ; 0f9b (0:0f9b)
push hl
push bc
- ld hl, $ff9e
+ ld hl, hAIActionTableIndex
ld bc, $000a
call Func_0ed5
call Func_0f58
@@ -3191,7 +3193,7 @@ GetCardInDeckPosition_bc: ; 12fa (0:12fa)
ret
; 0x1303
-; return [wDuelCardOrAttackList + a] in a and in hTempCardNumber
+; return [wDuelCardOrAttackList + a] in a and in hTempCardNumber_ff98
Func_1303: ; 1303 (0:1303)
push hl
push de
@@ -3200,7 +3202,7 @@ Func_1303: ; 1303 (0:1303)
ld hl, wDuelCardOrAttackList
add hl, de
ld a, [hl]
- ldh [hTempCardNumber], a
+ ldh [hTempCardNumber_ff98], a
pop de
pop hl
ret
@@ -3208,7 +3210,7 @@ Func_1303: ; 1303 (0:1303)
; given the deck position (0-59) of a card in [wDuelCardOrAttackList + a], return:
; - the id of the card located in that deck position in register de
-; - [wDuelCardOrAttackList + a] in hTempCardNumber and in register a
+; - [wDuelCardOrAttackList + a] in hTempCardNumber_ff98 and in register a
GetCardInList: ; 1312 (0:1312)
push hl
ld e, a
@@ -3216,14 +3218,14 @@ GetCardInList: ; 1312 (0:1312)
ld hl, wDuelCardOrAttackList
add hl, de
ld a, [hl]
- ldh [hTempCardNumber], a
+ ldh [hTempCardNumber_ff98], a
call GetCardInDeckPosition
pop hl
- ldh a, [hTempCardNumber]
+ ldh a, [hTempCardNumber_ff98]
ret
; 0x1324
-; returns, in register de, the id of the card in the deck position specified by register a
+; returns, in register de, the id of the card in the deck position (0-59) specified by register a
; preserves af and hl
GetCardInDeckPosition: ; 1324 (0:1324)
push af
@@ -3238,7 +3240,7 @@ GetCardInDeckPosition: ; 1324 (0:1324)
INCROM $132f, $1362
-; returns, in register a, the id of the card in the deck position specified in register a
+; returns, in register a, the id of the card in the deck position (0-59) specified in register a
_GetCardInDeckPosition: ; 1362 (0:1362)
push de
ld e, a
@@ -3254,7 +3256,7 @@ _GetCardInDeckPosition: ; 1362 (0:1362)
pop de
ret
-; load data of card in position a to wLoadedCard1
+; load data of card in deck position a (0-59) to wLoadedCard1
LoadDeckCardToBuffer1: ; 1376 (0:1376)
push hl
push de
@@ -3271,7 +3273,7 @@ LoadDeckCardToBuffer1: ; 1376 (0:1376)
pop hl
ret
-; load data of card in position a to wLoadedCard2
+; load data of card in deck position a (0-59) to wLoadedCard2
LoadDeckCardToBuffer2: ; 138c (0:138c)
push hl
push de
@@ -3472,11 +3474,14 @@ GetNonTurnDuelistVariable: ; 1611 (0:1611)
INCROM $161e, $16c0
-CopyMoveDataAndDamageToBuffer: ; 16c0 (0:16c0)
+; copies from card identified by register d (0-59):
+; - Move1 (if e == 0) or Move2 (if e == 1) data into wLoadedMove
+; - Also from that move, its Damage field into wDamage
+CopyMoveDataAndDamage: ; 16c0 (0:16c0)
ld a, e
ld [wSelectedMoveIndex], a
ld a, d
- ld [$ff9f], a
+ ldh [hTempCardNumber_ff9f], a
call LoadDeckCardToBuffer1
ld a, [wLoadedCard1ID]
ld [wTempCardId], a
@@ -3507,7 +3512,7 @@ CopyMoveDataAndDamageToBuffer: ; 16c0 (0:16c0)
Func_16f6: ; 16f6 (0:16f6)
ld a, DUELVARS_ARENA_CARD
call GetTurnDuelistVariable
- ld [$ff9f], a
+ ldh [hTempCardNumber_ff9f], a
call GetCardInDeckPosition
ld a, e
ld [wTempTurnDuelistCardId], a
@@ -3532,7 +3537,7 @@ Func_16f6: ; 16f6 (0:16f6)
Func_1730: ; 1730 (0:1730)
ld a, [wSelectedMoveIndex]
ld [wcc10], a
- ld a, [$ff9f]
+ ldh a, [hTempCardNumber_ff9f]
ld [wcc11], a
ld a, [wTempCardId]
ld [wcc12], a
@@ -3559,7 +3564,7 @@ Func_1730: ; 1730 (0:1730)
jp c, Func_1821
.asm_1777
ld a, $9
- call Func_0f7f
+ call SetDuelAIAction
ld a, $6
call TryExecuteEffectCommandFunction
call CheckSelfConfusionDamage
@@ -3570,7 +3575,7 @@ Func_1730: ; 1730 (0:1730)
ld a, $5
call TryExecuteEffectCommandFunction
ld a, $a
- call Func_0f7f
+ call SetDuelAIAction
call $7415
ld a, [wLoadedMoveCategory]
and RESIDUAL
@@ -3580,7 +3585,7 @@ Func_1730: ; 1730 (0:1730)
call SwapTurn
.asm_17ad
xor a
- ld [$ff9d], a
+ ldh [hTempPlayAreaLocationOffset_ff9d], a
ld a, $3
call TryExecuteEffectCommandFunction
call Func_1994
@@ -3677,14 +3682,14 @@ Func_184b: ; 184b (0:184b)
call TryExecuteEffectCommandFunction
jr c, Func_1821
ld a, $c
- call Func_0f7f
+ call SetDuelAIAction
call Func_0f58
ld a, $d
- call Func_0f7f
+ call SetDuelAIAction
ld a, $3
call TryExecuteEffectCommandFunction
ld a, $16
- call Func_0f7f
+ call SetDuelAIAction
ret
Func_1874: ; 1874 (0:1874)
@@ -3693,19 +3698,19 @@ Func_1874: ; 1874 (0:1874)
ret nz
ld a, [$ffa0]
push af
- ld a, [$ff9f]
+ ldh a, [hTempCardNumber_ff9f]
push af
ld a, $1
ld [wccec], a
ld a, [wcc11]
- ld [$ff9f], a
+ ldh [hTempCardNumber_ff9f], a
ld a, [wcc10]
ld [$ffa0], a
ld a, $8
- call Func_0f7f
+ call SetDuelAIAction
call Func_0f58
pop af
- ld [$ff9f], a
+ ldh [hTempCardNumber_ff9f], a
pop af
ld [$ffa0], a
ret
@@ -3769,9 +3774,10 @@ CheckSelfConfusionDamage: ; 18d7 (0:18d7)
INCROM $18f9, $1944
-; this loads HP and Stage (1 byte each) of card with id at $ff9f into wLoadedMoveEffectCommands
+; this loads HP and Stage (1 byte each) of the card with deck index (0-59) at hTempCardNumber_ff9f
+; into wLoadedMoveEffectCommands
Func_1944: ; 1944 (0:1944)
- ld a, [$ff9f]
+ ldh a, [hTempCardNumber_ff9f]
call LoadDeckCardToBuffer1
ld hl, wLoadedCard1HP
ld de, wLoadedMoveEffectCommands
@@ -3827,7 +3833,7 @@ Func_1994: ; 1994 (0:1994)
ret
.non_zero_damage
xor a
- ld [$ff9d], a
+ ldh [hTempPlayAreaLocationOffset_ff9d], a
ld d, [hl]
dec hl
ld e, [hl]
@@ -3843,7 +3849,7 @@ Func_1994: ; 1994 (0:1994)
ld a, e
or d
ret z
- ld a, [$ff9d]
+ ldh a, [hTempPlayAreaLocationOffset_ff9d]
call Func_36f7
call Func_1a0e
ld b, a
@@ -4066,7 +4072,7 @@ Func_1bb4: ; 1bb4 (0:1bb4)
bank1call $4f9d
call $503a
xor a
- ld [$ff9d], a
+ ldh [hTempPlayAreaLocationOffset_ff9d], a
call Func_1bca
call WaitForWideTextBoxInput
call Func_0f58
@@ -4078,7 +4084,7 @@ Func_1bca: ; 1bca (0:1bca)
ret z
cp $1
jr z, .asm_1bfd
- ld a, [$ff9d]
+ ldh a, [hTempPlayAreaLocationOffset_ff9d]
add DUELVARS_ARENA_CARD
call GetTurnDuelistVariable
call LoadDeckCardToBuffer1
@@ -5469,7 +5475,7 @@ Func_256d: ; 256d (0:256d)
; initializes cursor parameters given the 8 bytes starting at hl,
; which represent the following:
-; x position, y position, y displacement between items, number of items,
+; x coord, y coord, y displacement between items, number of items,
; cursor tile number, tile behind cursor, ???? (unknown function pointer if non-0)
; also sets the current menu item to the one specified in register a
InitializeCursorParameters: ; 2636 (0:2636)
@@ -6082,7 +6088,7 @@ Func_2bc3: ; 2bc3 (0:2bc3)
Func_2bc7: ; 2bc7 (0:2bc7)
ld a, $3
call Func_2bdb
- ld [$ff9d], a
+ ldh [hTempPlayAreaLocationOffset_ff9d], a
ret
Func_2bcf: ; 2bcf (0:2bcf)
@@ -6242,7 +6248,7 @@ Func_2cd7: ; 2cd7 (0:2cd7)
Func_2ceb: ; 2ceb (0:2ceb)
call Func_2cd7
- ld hl, $ce48
+ ld hl, wce48
inc [hl]
ret
diff --git a/src/hram.asm b/src/hram.asm
index 1951d99..56837e7 100644
--- a/src/hram.asm
+++ b/src/hram.asm
@@ -3,7 +3,7 @@ SECTION "HRAM", HRAM
hBankROM:: ; ff80
ds 1
-hBankRAM:: ; ff81
+hBankSRAM:: ; ff81
ds 1
hBankVRAM:: ; ff82
@@ -45,10 +45,28 @@ hWY:: ; ff95
hWhoseTurn:: ; ff97
ds 1
-hTempCardNumber:: ; ff98
+; deck position (index) of a card (0-59)
+hTempCardNumber_ff98:: ; ff98
ds 1
- ds 22
+ ds 4
+
+; 0: arena card ; 1-5: bench card
+hTempPlayAreaLocationOffset_ff9d:: ; ff9d
+ ds 1
+
+hAIActionTableIndex:: ; ff9e
+ ds 1
+
+hTempCardNumber_ff9f:: ; ff9f
+ ds 1
+
+ ds 1
+
+hTempPlayAreaLocationOffset_ffa1:: ; ffa1
+ ds 1
+
+ ds 13
hffaf:: ; ffaf
ds 1
diff --git a/src/text/text1.asm b/src/text/text1.asm
index 40e92a1..f21f081 100644
--- a/src/text/text1.asm
+++ b/src/text/text1.asm
@@ -477,7 +477,7 @@ Text006c: ; 36c54 (d:6c54)
line "and draw again."
done
-Text006d: ; 36c82 (d:6c82)
+ChooseUpTo5BasicPkmnToPlaceOnBenchText: ; 36c82 (d:6c82)
text "You may choose up to 5 Basic Pok`mon"
line "to place on the Bench."
done
diff --git a/src/text/text_offsets.asm b/src/text/text_offsets.asm
index 425fd2e..8afb421 100644
--- a/src/text/text_offsets.asm
+++ b/src/text/text_offsets.asm
@@ -88,7 +88,7 @@ TextOffsets:: ; 34000 (d:4000)
textpointer YouPlaySecondText ; 0x0054
textpointer TransmissionErrorText ; 0x0055
textpointer Text0056 ; 0x0056
- textpointer TransmitingDataText ; 0x0057
+ textpointer TransmitingDataText ; 0x0057
textpointer Text0058 ; 0x0058
textpointer Text0059 ; 0x0059
textpointer Text005a ; 0x005a
@@ -106,11 +106,11 @@ TextOffsets:: ; 34000 (d:4000)
textpointer Text0066 ; 0x0066
textpointer Text0067 ; 0x0067
textpointer Text0068 ; 0x0068
- textpointer ChooseBasicPkmnToPlaceInArenaText ; 0x0069
+ textpointer ChooseBasicPkmnToPlaceInArenaText ; 0x0069
textpointer Text006a ; 0x006a
textpointer NeitherPlayerHasBasicPkmnText ; 0x006b
textpointer Text006c ; 0x006c
- textpointer Text006d ; 0x006d
+ textpointer ChooseUpTo5BasicPkmnToPlaceOnBenchText ; 0x006d
textpointer Text006e ; 0x006e
textpointer Text006f ; 0x006f
textpointer Text0070 ; 0x0070
@@ -179,7 +179,7 @@ TextOffsets:: ; 34000 (d:4000)
textpointer Text00af ; 0x00af
textpointer Text00b0 ; 0x00b0
textpointer Text00b1 ; 0x00b1
- textpointer NoSpaceOnTheBenchText ; 0x00b2
+ textpointer NoSpaceOnTheBenchText ; 0x00b2
textpointer Text00b3 ; 0x00b3
textpointer Text00b4 ; 0x00b4
textpointer Text00b5 ; 0x00b5
diff --git a/src/wram.asm b/src/wram.asm
index f081eb5..82f4ab8 100644
--- a/src/wram.asm
+++ b/src/wram.asm
@@ -13,7 +13,7 @@ wTempCardCollection:: ; c000
SECTION "WRAM Duels 1", WRAM0
; In order to be identified during a duel, the 60 cards of each duelist are given an index between 0 and 59.
-; These indexes are assigned following the internal order of the cards that make up the deck.
+; These indexes are assigned following the internal order (id) of the cards that make up the deck.
; This temporary index identifies the card during the current duel and within the duelist's deck.
wPlayerDuelVariables:: ; c200
@@ -434,6 +434,7 @@ wCardPageNumber:: ; cbc7
wcbc9:: ; cbc9
ds $2
+; selected bench slot (1-5)
wBenchSelectedPokemon:: ; cbcb
ds $1