summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorxCrystal <rgr.crystal@gmail.com>2018-03-08 22:54:05 +0100
committerxCrystal <rgr.crystal@gmail.com>2018-03-08 22:54:05 +0100
commita1bea6763a40aab00f5b7fc868f00b5df7b4d049 (patch)
treec66f96f172064fa6f954d677eeaedb89c78fde56 /src
parent525242f4987903746596e828fff657aaed10105b (diff)
Document DrawDuelHUD(s), more text symbol constants, and Pluspower/Defender duelvars
Diffstat (limited to 'src')
-rw-r--r--src/constants/duel_constants.asm86
-rw-r--r--src/constants/text_constants.asm72
-rw-r--r--src/engine/bank1.asm114
-rw-r--r--src/engine/home.asm24
-rw-r--r--src/wram.asm68
5 files changed, 226 insertions, 138 deletions
diff --git a/src/constants/duel_constants.asm b/src/constants/duel_constants.asm
index 5f6eeee..a4c6697 100644
--- a/src/constants/duel_constants.asm
+++ b/src/constants/duel_constants.asm
@@ -30,43 +30,55 @@ DUEL_LOSS EQU $1
const BOXMSG_COIN_TOSS
; wPlayerDuelVariables or wOpponentDuelVariables constants
-DUELVARS_CARD_LOCATIONS EQUS "LOW(wPlayerCardLocations)" ; 00
-DUELVARS_HAND EQUS "LOW(wPlayerHand)" ; 42
-DUELVARS_DECK_CARDS EQUS "LOW(wPlayerDeckCards)" ; 7e
-DUELVARS_NUMBER_OF_CARDS_NOT_IN_DECK EQUS "LOW(wPlayerNumberOfCardsNotInDeck)" ; ba
-DUELVARS_ARENA_CARD EQUS "LOW(wPlayerArenaCard)" ; bb
-DUELVARS_BENCH EQUS "LOW(wPlayerBench)" ; bc
-DUELVARS_ARENA_CARD_FLAGS_C2 EQU $c2
-DUELVARS_ARENA_CARD_HP EQUS "LOW(wPlayerArenaCardHP)" ; c8
-DUELVARS_BENCH1_CARD_HP EQUS "LOW(wPlayerBench1CardHP)" ; c9
-DUELVARS_BENCH2_CARD_HP EQUS "LOW(wPlayerBench2CardHP)" ; ca
-DUELVARS_BENCH3_CARD_HP EQUS "LOW(wPlayerBench3CardHP)" ; cb
-DUELVARS_BENCH4_CARD_HP EQUS "LOW(wPlayerBench4CardHP)" ; cc
-DUELVARS_BENCH5_CARD_HP EQUS "LOW(wPlayerBench5CardHP)" ; cd
-DUELVARS_ARENA_CARD_STAGE EQUS "LOW(wPlayerArenaCardStage)" ; ce
-DUELVARS_BENCH1_CARD_STAGE EQUS "LOW(wPlayerBench1CardStage)" ; cf
-DUELVARS_BENCH2_CARD_STAGE EQUS "LOW(wPlayerBench2CardStage)" ; d0
-DUELVARS_BENCH3_CARD_STAGE EQUS "LOW(wPlayerBench3CardStage)" ; d1
-DUELVARS_BENCH4_CARD_STAGE EQUS "LOW(wPlayerBench4CardStage)" ; d2
-DUELVARS_BENCH5_CARD_STAGE EQUS "LOW(wPlayerBench5CardStage)" ; d3
-DUELVARS_ARENA_CARD_CHANGED_TYPE EQUS "LOW(wPlayerArenaCardChangedType)" ; d4
-DUELVARS_BENCH1_CARD_CHANGED_TYPE EQUS "LOW(wPlayerBench1CardChangedType)" ; d5
-DUELVARS_BENCH2_CARD_CHANGED_TYPE EQUS "LOW(wPlayerBench2CardChangedType)" ; d6
-DUELVARS_BENCH3_CARD_CHANGED_TYPE EQUS "LOW(wPlayerBench3CardChangedType)" ; d7
-DUELVARS_BENCH4_CARD_CHANGED_TYPE EQUS "LOW(wPlayerBench4CardChangedType)" ; d8
-DUELVARS_BENCH5_CARD_CHANGED_TYPE EQUS "LOW(wPlayerBench5CardChangedType)" ; d9
-DUELVARS_ARENA_CARD_SUBSTATUS1 EQUS "LOW(wPlayerArenaCardSubstatus1)" ; e7
-DUELVARS_ARENA_CARD_SUBSTATUS2 EQUS "LOW(wPlayerArenaCardSubstatus2)" ; e8
-DUELVARS_ARENA_CARD_CHANGED_WEAKNESS EQUS "LOW(wPlayerArenaCardChangedWeakness)" ; e9
-DUELVARS_ARENA_CARD_CHANGED_RESISTANCE EQUS "LOW(wPlayerArenaCardChangedResistance)" ; ea
-DUELVARS_ARENA_CARD_SUBSTATUS3 EQUS "LOW(wPlayerArenaCardSubstatus3)" ; eb
-DUELVARS_PRIZES EQUS "LOW(wPlayerPrizes)" ; ec
-DUELVARS_NUMBER_OF_CARDS_IN_DISCARD_PILE EQUS "LOW(wPlayerNumberOfCardsInDiscardPile)" ; ed
-DUELVARS_NUMBER_OF_CARDS_IN_HAND EQUS "LOW(wPlayerNumberOfCardsInHand)" ; ee
-DUELVARS_NUMBER_OF_POKEMON_IN_PLAY_AREA EQUS "LOW(wPlayerNumberOfPokemonInPlayArea)" ; ef
-DUELVARS_ARENA_CARD_STATUS EQUS "LOW(wPlayerArenaCardStatus)" ; f0
-DUELVARS_DUELIST_TYPE EQUS "LOW(wPlayerDuelistType)" ; f1
-DUELVARS_ARENA_CARD_DISABLED_MOVE_INDEX EQUS "LOW(wPlayerArenaCardDisabledMoveIndex)" ; f2
+DUELVARS_CARD_LOCATIONS EQUS "LOW(wPlayerCardLocations)" ; 00
+DUELVARS_HAND EQUS "LOW(wPlayerHand)" ; 42
+DUELVARS_DECK_CARDS EQUS "LOW(wPlayerDeckCards)" ; 7e
+DUELVARS_NUMBER_OF_CARDS_NOT_IN_DECK EQUS "LOW(wPlayerNumberOfCardsNotInDeck)" ; ba
+DUELVARS_ARENA_CARD EQUS "LOW(wPlayerArenaCard)" ; bb
+DUELVARS_BENCH EQUS "LOW(wPlayerBench)" ; bc
+DUELVARS_ARENA_CARD_FLAGS_C2 EQU $c2
+DUELVARS_ARENA_CARD_HP EQUS "LOW(wPlayerArenaCardHP)" ; c8
+DUELVARS_BENCH1_CARD_HP EQUS "LOW(wPlayerBench1CardHP)" ; c9
+DUELVARS_BENCH2_CARD_HP EQUS "LOW(wPlayerBench2CardHP)" ; ca
+DUELVARS_BENCH3_CARD_HP EQUS "LOW(wPlayerBench3CardHP)" ; cb
+DUELVARS_BENCH4_CARD_HP EQUS "LOW(wPlayerBench4CardHP)" ; cc
+DUELVARS_BENCH5_CARD_HP EQUS "LOW(wPlayerBench5CardHP)" ; cd
+DUELVARS_ARENA_CARD_STAGE EQUS "LOW(wPlayerArenaCardStage)" ; ce
+DUELVARS_BENCH1_CARD_STAGE EQUS "LOW(wPlayerBench1CardStage)" ; cf
+DUELVARS_BENCH2_CARD_STAGE EQUS "LOW(wPlayerBench2CardStage)" ; d0
+DUELVARS_BENCH3_CARD_STAGE EQUS "LOW(wPlayerBench3CardStage)" ; d1
+DUELVARS_BENCH4_CARD_STAGE EQUS "LOW(wPlayerBench4CardStage)" ; d2
+DUELVARS_BENCH5_CARD_STAGE EQUS "LOW(wPlayerBench5CardStage)" ; d3
+DUELVARS_ARENA_CARD_CHANGED_TYPE EQUS "LOW(wPlayerArenaCardChangedType)" ; d4
+DUELVARS_BENCH1_CARD_CHANGED_TYPE EQUS "LOW(wPlayerBench1CardChangedType)" ; d5
+DUELVARS_BENCH2_CARD_CHANGED_TYPE EQUS "LOW(wPlayerBench2CardChangedType)" ; d6
+DUELVARS_BENCH3_CARD_CHANGED_TYPE EQUS "LOW(wPlayerBench3CardChangedType)" ; d7
+DUELVARS_BENCH4_CARD_CHANGED_TYPE EQUS "LOW(wPlayerBench4CardChangedType)" ; d8
+DUELVARS_BENCH5_CARD_CHANGED_TYPE EQUS "LOW(wPlayerBench5CardChangedType)" ; d9
+DUELVARS_ARENA_CARD_ATTACHED_DEFENDER EQUS "LOW(wPlayerArenaCardAttachedDefender)" ; da
+DUELVARS_BENCH1_CARD_ATTACHED_DEFENDER EQUS "LOW(wPlayerBench1CardAttachedDefender)" ; db
+DUELVARS_BENCH2_CARD_ATTACHED_DEFENDER EQUS "LOW(wPlayerBench2CardAttachedDefender)" ; dc
+DUELVARS_BENCH3_CARD_ATTACHED_DEFENDER EQUS "LOW(wPlayerBench3CardAttachedDefender)" ; dd
+DUELVARS_BENCH4_CARD_ATTACHED_DEFENDER EQUS "LOW(wPlayerBench4CardAttachedDefender)" ; de
+DUELVARS_BENCH5_CARD_ATTACHED_DEFENDER EQUS "LOW(wPlayerBench5CardAttachedDefender)" ; df
+DUELVARS_ARENA_CARD_ATTACHED_PLUSPOWER EQUS "LOW(wPlayerArenaCardAttachedPluspower)" ; e0
+DUELVARS_BENCH1_CARD_ATTACHED_PLUSPOWER EQUS "LOW(wPlayerBench1CardAttachedPluspower)" ; e1
+DUELVARS_BENCH2_CARD_ATTACHED_PLUSPOWER EQUS "LOW(wPlayerBench2CardAttachedPluspower)" ; e2
+DUELVARS_BENCH3_CARD_ATTACHED_PLUSPOWER EQUS "LOW(wPlayerBench3CardAttachedPluspower)" ; e3
+DUELVARS_BENCH4_CARD_ATTACHED_PLUSPOWER EQUS "LOW(wPlayerBench4CardAttachedPluspower)" ; e4
+DUELVARS_BENCH5_CARD_ATTACHED_PLUSPOWER EQUS "LOW(wPlayerBench5CardAttachedPluspower)" ; e5
+DUELVARS_ARENA_CARD_SUBSTATUS1 EQUS "LOW(wPlayerArenaCardSubstatus1)" ; e7
+DUELVARS_ARENA_CARD_SUBSTATUS2 EQUS "LOW(wPlayerArenaCardSubstatus2)" ; e8
+DUELVARS_ARENA_CARD_CHANGED_WEAKNESS EQUS "LOW(wPlayerArenaCardChangedWeakness)" ; e9
+DUELVARS_ARENA_CARD_CHANGED_RESISTANCE EQUS "LOW(wPlayerArenaCardChangedResistance)" ; ea
+DUELVARS_ARENA_CARD_SUBSTATUS3 EQUS "LOW(wPlayerArenaCardSubstatus3)" ; eb
+DUELVARS_PRIZES EQUS "LOW(wPlayerPrizes)" ; ec
+DUELVARS_NUMBER_OF_CARDS_IN_DISCARD_PILE EQUS "LOW(wPlayerNumberOfCardsInDiscardPile)" ; ed
+DUELVARS_NUMBER_OF_CARDS_IN_HAND EQUS "LOW(wPlayerNumberOfCardsInHand)" ; ee
+DUELVARS_NUMBER_OF_POKEMON_IN_PLAY_AREA EQUS "LOW(wPlayerNumberOfPokemonInPlayArea)" ; ef
+DUELVARS_ARENA_CARD_STATUS EQUS "LOW(wPlayerArenaCardStatus)" ; f0
+DUELVARS_DUELIST_TYPE EQUS "LOW(wPlayerDuelistType)" ; f1
+DUELVARS_ARENA_CARD_DISABLED_MOVE_INDEX EQUS "LOW(wPlayerArenaCardDisabledMoveIndex)" ; f2
; card location constants (DUELVARS_CARD_LOCATIONS)
CARD_LOCATION_DECK EQU $00
diff --git a/src/constants/text_constants.asm b/src/constants/text_constants.asm
index b161a63..8d23152 100644
--- a/src/constants/text_constants.asm
+++ b/src/constants/text_constants.asm
@@ -1,10 +1,10 @@
-TX_END EQU $00
+TX_END EQU $00
TX_SYMBOL EQU $05
-TX_START EQU $06
-TX_RAM1 EQU $09
-TX_LINE EQU "\n" ; $0a
-TX_RAM2 EQU $0B
-TX_RAM3 EQU $0C
+TX_START EQU $06
+TX_RAM1 EQU $09
+TX_LINE EQU "\n" ; $0a
+TX_RAM2 EQU $0B
+TX_RAM3 EQU $0C
text EQUS "db TX_START, "
line EQUS "db TX_LINE, "
@@ -16,31 +16,35 @@ done EQUS "db TX_END"
charmap "”", "\""
; TX_SYMBOL (full-tile symbols loaded into v0Tiles2)
- charmap "<", TX_SYMBOL
- charmap " >", $00
- charmap "FIRE>", $01
- charmap "GRASS>", $02
- charmap "LIGHTNING>", $03
- charmap "WATER>", $04
- charmap "FIGHTING>", $05
- charmap "PSYCHIC>", $06
- charmap "COLORLESS>", $07
- charmap "POISONED>", $08
- charmap "ASLEEP>", $09
- charmap "CONFUSED>", $0a
- charmap "PARALYZED>", $0b
- charmap "HP>", $10
- charmap "Lv>", $11
- charmap "No>", $13
- charmap "🌕>", $16
- charmap "🌑>", $17
- charmap "0>", $20
- charmap "1>", $21
- charmap "2>", $22
- charmap "3>", $23
- charmap "4>", $24
- charmap "5>", $25
- charmap "6>", $26
- charmap "7>", $27
- charmap "8>", $28
- charmap "9>", $29
+ charmap "<", TX_SYMBOL
+ charmap " >", $00
+ charmap "FIRE>", $01
+ charmap "GRASS>", $02
+ charmap "LIGHTNING>", $03
+ charmap "WATER>", $04
+ charmap "FIGHTING>", $05
+ charmap "PSYCHIC>", $06
+ charmap "COLORLESS>", $07
+ charmap "POISONED>", $08
+ charmap "ASLEEP>", $09
+ charmap "CONFUSED>", $0a
+ charmap "PARALYZED>", $0b
+ charmap "PKMN_ICON>", $0d ; icon displayed along with no. of Pkmn in duel screen
+ charmap "HP>", $10
+ charmap "Lv>", $11
+ charmap "No>", $13
+ charmap "PLUSPOWER>", $14
+ charmap "DEFENDER>", $15
+ charmap "🌕>", $16 ; HP tile
+ charmap "🌑>", $17 ; HP tile with damage counter
+ charmap "0>", $20
+ charmap "1>", $21
+ charmap "2>", $22
+ charmap "3>", $23
+ charmap "4>", $24
+ charmap "5>", $25
+ charmap "6>", $26
+ charmap "7>", $27
+ charmap "8>", $28
+ charmap "9>", $29
+ charmap "PRIZE_ICON>", $30 ; icon displayed along with no. of prizes in duel screen
diff --git a/src/engine/bank1.asm b/src/engine/bank1.asm
index c61cb02..b87d0aa 100644
--- a/src/engine/bank1.asm
+++ b/src/engine/bank1.asm
@@ -1788,30 +1788,30 @@ DrawDuelMainScene: ; 4f9d (1:4f9d)
ld hl, $5188
call WriteDataBlocksToBGMap0
call Func_516f ; draw the vertical separator
- call Func_503a ; draw the HUDs
+ call DrawDuelHUDs ; draw the HUDs
call DrawWideTextBox
call EnableLCD
ret
; 0x503a
-Func_503a: ; 503a (1:503a)
+DrawDuelHUDs: ; 503a (1:503a)
ld a, DUELVARS_DUELIST_TYPE
call GetTurnDuelistVariable
cp DUELIST_TYPE_PLAYER
- jr z, .asm_5051
+ jr z, .draw_hud
ldh a, [hWhoseTurn]
push af
ld a, PLAYER_TURN
ldh [hWhoseTurn], a
- call .asm_5051
+ call .draw_hud
pop af
ldh [hWhoseTurn], a
ret
-.asm_5051
- ld de, $10b
- ld bc, $b08
- call Func_5093
- ld bc, $805
+.draw_hud
+ lb de, 1, 11 ; coordinates for player's arena card name and info icons
+ lb bc, 11, 8 ; coordinates for player's attached energies and HP bar
+ call DrawDuelHUD
+ lb bc, 8, 5
ld a, DUELVARS_ARENA_CARD_STATUS
call GetTurnDuelistVariable
call $63ce
@@ -1820,11 +1820,11 @@ Func_503a: ; 503a (1:503a)
inc c
call $63c7
call SwapTurn
- ld de, $700
- ld bc, $301
+ lb de, 7, 0 ; coordinates for opponent's arena card name and info icons
+ lb bc, 3, 1 ; coordinates for opponent's attached energies and HP bar
call GetNonTurnDuelistVariable
- call Func_5093
- ld bc, $b06
+ call DrawDuelHUD
+ lb bc, 11, 6
ld a, DUELVARS_ARENA_CARD_STATUS
call GetTurnDuelistVariable
call $63ce
@@ -1836,34 +1836,40 @@ Func_503a: ; 503a (1:503a)
ret
; 0x5093
-Func_5093: ; 5093 (1:5093)
+DrawDuelHUD: ; 5093 (1:5093)
ld hl, wcbc9
ld [hl], b
inc hl
- ld [hl], c
- push de
- ld d, $01
+ ld [hl], c ; save coordinates for the HP bar
+ push de ; save coordinates for the arena card name
+ ld d, 1 ; opponent's info icons start in the second tile to the right
ld a, e
or a
- jr z, .asm_50a2
- ld d, $0f
-.asm_50a2
+ jr z, .go
+ ld d, 15 ; player's info icons start in the 15th tile to the right
+.go
push de
pop bc
- ld a, $0d
+
+ ; print the Pkmn icon along with the no. of play area Pokemon
+ ld a, LOW("<PKMN_ICON>")
call WriteByteToBGMap0
inc b
ld a, DUELVARS_NUMBER_OF_POKEMON_IN_PLAY_AREA
call GetTurnDuelistVariable
- add $1f
+ add LOW("<0>") - 1
call WriteByteToBGMap0
inc b
- ld a, $30
+
+ ; print the Prize icon along with the no. of prizes yet to draw
+ ld a, LOW("<PRIZE_ICON>")
call WriteByteToBGMap0
inc b
call CountPrizes
- add $20
+ add LOW("<0>")
call WriteByteToBGMap0
+
+ ; print the arena Pokemon card name and level text
pop de
ld a, DUELVARS_ARENA_CARD
call GetTurnDuelistVariable
@@ -1874,30 +1880,36 @@ Func_5093: ; 5093 (1:5093)
ld a, 32
call CopyCardNameAndLevel
ld [hl], TX_END
+
+ ; print the arena Pokemon card color symbol just before the name
pop de
ld a, e
or a
- jr nz, .asm_50e5
+ jr nz, .print_color_icon
ld hl, wDefaultText
call Func_23c1
- add $14
+ add SCREEN_WIDTH
ld d, a
-.asm_50e5
+.print_color_icon
call Func_22ae
ld hl, wDefaultText
call Func_21c5
push de
pop bc
call GetArenaCardColor
- inc a
- dec b
- call $5b7a
+ inc a ; TX_SYMBOL color tiles start at 1
+ dec b ; place the color symbol one tile to the left of the start of the card's name
+ call JPWriteByteToBGMap0
+
+ ; print attached energies
ld hl, wcbc9
ld b, [hl]
inc hl
ld c, [hl]
ld de, $900
call $63e6
+
+ ; print HP bar
ld a, DUELVARS_ARENA_CARD
call GetTurnDuelistVariable
call LoadCardDataToBuffer1_FromDeckIndex
@@ -1915,46 +1927,48 @@ Func_5093: ; 5093 (1:5093)
call BCCoordToBGMap0Address
push de
ld hl, wDefaultText
- ld b, $06
+ ld b, 6 ; first row of the HP bar
call SafeCopyDataHLtoDE
pop de
ld hl, BG_MAP_WIDTH
add hl, de
ld e, l
ld d, h
- ld hl, wDefaultText + $06
- ld b, $06
+ ld hl, wDefaultText + 6
+ ld b, 6 ; second row of the HP bar
call SafeCopyDataHLtoDE
+
+ ; print number of attached Pluspower and Defender with respective icon, if any
ld hl, wcbc9
ld a, [hli]
- add $06
+ add 6
ld b, a
ld c, [hl]
inc c
- ld a, $e0
+ ld a, DUELVARS_ARENA_CARD_ATTACHED_PLUSPOWER
call GetTurnDuelistVariable
or a
- jr z, .asm_5159
- ld a, $14
+ jr z, .check_defender
+ ld a, LOW("<PLUSPOWER>")
call WriteByteToBGMap0
inc b
- ld a, [hl]
- add $20
+ ld a, [hl] ; number of attached Pluspower
+ add LOW("<0>")
call WriteByteToBGMap0
dec b
-.asm_5159
- ld a, $da
+.check_defender
+ ld a, DUELVARS_ARENA_CARD_ATTACHED_DEFENDER
call GetTurnDuelistVariable
or a
- jr z, .asm_516e
+ jr z, .done
inc c
- ld a, $15
+ ld a, LOW("<DEFENDER>")
call WriteByteToBGMap0
inc b
- ld a, [hl]
- add $20
+ ld a, [hl] ; number of attached Defender
+ add LOW("<0>")
call WriteByteToBGMap0
-.asm_516e
+.done
ret
; 0x516f
@@ -2820,7 +2834,13 @@ ApplyCardCGBAttributes: ; 5adb (1:5adb)
; 0x5aeb
Func_5aeb: ; 5aeb (1:5aeb)
- INCROM $5aeb, $5fdd
+ INCROM $5aeb, $5b7a
+
+JPWriteByteToBGMap0: ; 5b7a (1:5b7a)
+ jp WriteByteToBGMap0
+; 0x5b7d
+
+ INCROM $5b7d, $5fdd
; return carry if the turn holder has any Pokemon with non-zero HP in the play area.
; return how many Pokemon with non-zero HP in b.
diff --git a/src/engine/home.asm b/src/engine/home.asm
index 002488d..e351722 100644
--- a/src/engine/home.asm
+++ b/src/engine/home.asm
@@ -853,7 +853,7 @@ Func_05c2: ; 5c2 (0:5c2)
call BCCoordToBGMap0Address
pop hl
ld b, $02
- call JumpToHblankCopyDataHLtoDE
+ call JPHblankCopyDataHLtoDE
pop de
pop bc
pop hl
@@ -872,7 +872,7 @@ Func_05db: ; 5db (0:5db)
call BCCoordToBGMap0Address
pop hl
ld b, $01
- call JumpToHblankCopyDataHLtoDE
+ call JPHblankCopyDataHLtoDE
pop de
pop bc
pop hl
@@ -896,7 +896,7 @@ Func_05f4: ; 5f4 (0:5f4)
call BCCoordToBGMap0Address
pop hl
ld b, $04
- call JumpToHblankCopyDataHLtoDE
+ call JPHblankCopyDataHLtoDE
pop de
pop bc
pop hl
@@ -1067,7 +1067,7 @@ CopyDataToBGMap0: ; 06ee (0:06ee)
SafeCopyDataHLtoDE: ; 6fc (0:6fc)
ld a, [wLCDC]
rla
- jr c, JumpToHblankCopyDataHLtoDE
+ jr c, JPHblankCopyDataHLtoDE
.lcd_off_loop
ld a, [hli]
ld [de], a
@@ -1075,7 +1075,7 @@ SafeCopyDataHLtoDE: ; 6fc (0:6fc)
dec b
jr nz, .lcd_off_loop
ret
-JumpToHblankCopyDataHLtoDE: ; 0709 (0:0709)
+JPHblankCopyDataHLtoDE: ; 0709 (0:0709)
jp HblankCopyDataHLtoDE
; 0x70c
@@ -1090,7 +1090,7 @@ CopyGfxData: ; 070c (0:070c)
push hl
push de
ld b, c
- call JumpToHblankCopyDataHLtoDE
+ call JPHblankCopyDataHLtoDE
ld b, $0
pop hl
add hl, bc
@@ -3734,11 +3734,11 @@ PutHandPokemonCardInPlayArea: ; 1485 (0:1485)
add e
ld l, a
ld [hl], $0
- ld a, $e0
+ ld a, DUELVARS_ARENA_CARD_ATTACHED_PLUSPOWER
add e
ld l, a
ld [hl], $0
- ld a, $da
+ ld a, DUELVARS_ARENA_CARD_ATTACHED_DEFENDER
add e
ld l, a
ld [hl], $0
@@ -3815,9 +3815,9 @@ EmptyPlayAreaSlot: ; 14f8 (0:14f8)
call .init_duelvar
ld a, DUELVARS_ARENA_CARD_CHANGED_TYPE
call .init_duelvar
- ld a, $da
+ ld a, DUELVARS_ARENA_CARD_ATTACHED_DEFENDER
call .init_duelvar
- ld a, $e0
+ ld a, DUELVARS_ARENA_CARD_ATTACHED_PLUSPOWER
.init_duelvar
add e
ld l, a
@@ -3885,9 +3885,9 @@ SwapPlayAreaPokemon: ; 1548 (0:1548)
call .swap_duelvar
ld a, DUELVARS_ARENA_CARD_CHANGED_TYPE
call .swap_duelvar
- ld a, $e0
+ ld a, DUELVARS_ARENA_CARD_ATTACHED_PLUSPOWER
call .swap_duelvar
- ld a, $da
+ ld a, DUELVARS_ARENA_CARD_ATTACHED_DEFENDER
call .swap_duelvar
set CARD_LOCATION_PLAY_AREA_F, d
set CARD_LOCATION_PLAY_AREA_F, e
diff --git a/src/wram.asm b/src/wram.asm
index 138e612..736faa4 100644
--- a/src/wram.asm
+++ b/src/wram.asm
@@ -114,7 +114,33 @@ wPlayerBench4CardChangedType:: ; c2d8
wPlayerBench5CardChangedType:: ; c2d9
ds $1
- ds $d
+wPlayerArenaCardAttachedDefender:: ; c2da
+ ds $1
+wPlayerBench1CardAttachedDefender:: ; c2db
+ ds $1
+wPlayerBench2CardAttachedDefender:: ; c2dc
+ ds $1
+wPlayerBench3CardAttachedDefender:: ; c2dd
+ ds $1
+wPlayerBench4CardAttachedDefender:: ; c2de
+ ds $1
+wPlayerBench5CardAttachedDefender:: ; c2df
+ ds $1
+
+wPlayerArenaCardAttachedPluspower:: ; c2e0
+ ds $1
+wPlayerBench1CardAttachedPluspower:: ; c2e1
+ ds $1
+wPlayerBench2CardAttachedPluspower:: ; c2e2
+ ds $1
+wPlayerBench3CardAttachedPluspower:: ; c2e3
+ ds $1
+wPlayerBench4CardAttachedPluspower:: ; c2e4
+ ds $1
+wPlayerBench5CardAttachedPluspower:: ; c2e5
+ ds $1
+
+ ds $1
wPlayerArenaCardSubstatus1:: ; c2e7
ds $1
@@ -212,20 +238,46 @@ wOpponentBench4CardStage:: ; c3d2
wOpponentBench5CardStage:: ; c3d3
ds $1
-wOpponentArenaCardChangedType:: ; c2d4
+wOpponentArenaCardChangedType:: ; c3d4
ds $1
-wOpponentBench1CardChangedType:: ; c2d5
+wOpponentBench1CardChangedType:: ; c3d5
ds $1
-wOpponentBench2CardChangedType:: ; c2d6
+wOpponentBench2CardChangedType:: ; c3d6
ds $1
-wOpponentBench3CardChangedType:: ; c2d7
+wOpponentBench3CardChangedType:: ; c3d7
ds $1
-wOpponentBench4CardChangedType:: ; c2d8
+wOpponentBench4CardChangedType:: ; c3d8
ds $1
-wOpponentBench5CardChangedType:: ; c2d9
+wOpponentBench5CardChangedType:: ; c3d9
ds $1
- ds $d
+wOpponentArenaCardAttachedDefender:: ; c3da
+ ds $1
+wOpponentBench1CardAttachedDefender:: ; c3db
+ ds $1
+wOpponentBench2CardAttachedDefender:: ; c3dc
+ ds $1
+wOpponentBench3CardAttachedDefender:: ; c3dd
+ ds $1
+wOpponentBench4CardAttachedDefender:: ; c3de
+ ds $1
+wOpponentBench5CardAttachedDefender:: ; c3df
+ ds $1
+
+wOpponentArenaCardAttachedPluspower:: ; c3e0
+ ds $1
+wOpponentBench1CardAttachedPluspower:: ; c3e1
+ ds $1
+wOpponentBench2CardAttachedPluspower:: ; c3e2
+ ds $1
+wOpponentBench3CardAttachedPluspower:: ; c3e3
+ ds $1
+wOpponentBench4CardAttachedPluspower:: ; c3e4
+ ds $1
+wOpponentBench5CardAttachedPluspower:: ; c3e5
+ ds $1
+
+ ds $1
wOpponentArenaCardSubstatus1:: ; c3e7
ds $1