aboutsummaryrefslogtreecommitdiffstats
path: root/engine/battle
diff options
context:
space:
mode:
authorSatoMew <SatoMew@users.noreply.github.com>2023-07-15 23:36:59 +0100
committerGitHub <noreply@github.com>2023-07-15 18:36:59 -0400
commitf46db37d508f0111ad44ad062ed3d83ba3282d1d (patch)
tree170af31852384f5a207918decf05e45a837d95d1 /engine/battle
parentAdd macros, constants, and labels for map scripts and text (#367) (diff)
downloadpokeyellow-f46db37d508f0111ad44ad062ed3d83ba3282d1d.tar.gz
pokeyellow-f46db37d508f0111ad44ad062ed3d83ba3282d1d.tar.xz
pokeyellow-f46db37d508f0111ad44ad062ed3d83ba3282d1d.zip
Thoroughly document debug code (#410)
Diffstat (limited to 'engine/battle')
-rw-r--r--engine/battle/core.asm25
-rw-r--r--engine/battle/init_battle_variables.asm2
2 files changed, 17 insertions, 10 deletions
diff --git a/engine/battle/core.asm b/engine/battle/core.asm
index 4a0263e2..f976674a 100644
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -2493,9 +2493,9 @@ MoveSelectionMenu:
; so it is necessary to put the di ei block to not cause tearing
call TextBoxBorder
hlcoord 4, 12
- ld [hl], $7a
+ ld [hl], "─"
hlcoord 10, 12
- ld [hl], $7e
+ ld [hl], "┘"
ei
hlcoord 6, 13
call .writemoves
@@ -2557,11 +2557,12 @@ MoveSelectionMenu:
ld a, [wLinkState]
cp LINK_STATE_BATTLING
jr z, .matchedkeyspicked
+ ; Disable left, right, and START buttons in regular battles.
ld a, [wFlags_D733]
bit BIT_TEST_BATTLE, a
ld b, D_UP | D_DOWN | A_BUTTON | B_BUTTON | SELECT
jr z, .matchedkeyspicked
- ld b, $ff
+ ld b, D_UP | D_DOWN | D_LEFT | D_RIGHT | A_BUTTON | B_BUTTON | SELECT | START
.matchedkeyspicked
ld a, b
ld [hli], a ; wMenuWatchedKeys
@@ -2585,8 +2586,12 @@ SelectMenuItem:
call PlaceString
jr .select
.battleselect
+ ; Hide move swap cursor in TestBattle.
ld a, [wFlags_D733]
bit BIT_TEST_BATTLE, a
+ ; This causes PrintMenuItem to not run in TestBattle.
+ ; MoveSelectionMenu still draws part of its window, an issue
+ ; which did not seem to exist in the Japanese versions.
jr nz, .select
call PrintMenuItem
ld a, [wMenuItemToSwap]
@@ -2648,8 +2653,9 @@ SelectMenuItem:
jr z, .disabled
ld a, [wPlayerBattleStatus3]
bit 3, a ; transformed
- jr nz, .dummy ; game freak derp
-.dummy
+ jr nz, .transformedMoveSelected
+.transformedMoveSelected ; pointless
+ ; Allow moves copied by Transform to be used.
ld a, [wCurrentMenuItem]
ld hl, wBattleMonMoves
ld c, a
@@ -6085,6 +6091,7 @@ GetCurrentMove:
jr .selected
.player
ld de, wPlayerMoveNum
+ ; Apply InitBattleVariables to TestBattle.
ld a, [wFlags_D733]
bit BIT_TEST_BATTLE, a
ld a, [wTestBattlePlayerSelectedMove]
@@ -6768,12 +6775,12 @@ InitOpponent:
DetermineWildOpponent:
ld a, [wd732]
- bit 1, a
- jr z, .notDebug
+ bit BIT_DEBUG_MODE, a
+ jr z, .notDebugMode
ldh a, [hJoyHeld]
- bit BIT_B_BUTTON, a
+ bit BIT_B_BUTTON, a ; disable wild encounters
ret nz
-.notDebug
+.notDebugMode
ld a, [wNumberOfNoRandomBattleStepsLeft]
and a
ret nz
diff --git a/engine/battle/init_battle_variables.asm b/engine/battle/init_battle_variables.asm
index dd9f9714..aa081296 100644
--- a/engine/battle/init_battle_variables.asm
+++ b/engine/battle/init_battle_variables.asm
@@ -20,7 +20,7 @@ InitBattleVariables:
ld [hli], a ; wPlayerHPBarColor
ld [hl], a ; wEnemyHPBarColor
ld hl, wCanEvolveFlags
- ld b, $3c
+ ld b, wMiscBattleDataEnd - wMiscBattleData
.loop
ld [hli], a
dec b