From f46db37d508f0111ad44ad062ed3d83ba3282d1d Mon Sep 17 00:00:00 2001 From: SatoMew Date: Sat, 15 Jul 2023 23:36:59 +0100 Subject: Thoroughly document debug code (#410) --- engine/debug/debug_menu.asm | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'engine/debug/debug_menu.asm') diff --git a/engine/debug/debug_menu.asm b/engine/debug/debug_menu.asm index 907acb8a..fbf136fe 100644 --- a/engine/debug/debug_menu.asm +++ b/engine/debug/debug_menu.asm @@ -56,7 +56,7 @@ IF DEF(_DEBUG) ; DEBUG ld hl, wd732 - set 1, [hl] + set BIT_DEBUG_MODE, [hl] jp StartNewGameDebug DebugBattlePlayerName: @@ -72,18 +72,23 @@ ELSE ret ENDC -TestBattle: +TestBattle: ; unreferenced except in _DEBUG .loop call GBPalNormal - ; Don't mess around - ; with obedience. + ; Don't mess around with obedience. ld a, 1 << BIT_EARTHBADGE ld [wObtainedBadges], a ld hl, wFlags_D733 set BIT_TEST_BATTLE, [hl] + ; wNumBagItems and wBagItems are not initialized here, + ; and their garbage values happen to act as if EXP_ALL + ; is in the bag at the end of the test battle. + ; pokeyellow fixes this by initializing them with a + ; list of items. + ; Reset the party. ld hl, wPartyCount xor a @@ -91,8 +96,7 @@ TestBattle: dec a ld [hl], a - ; Give the player a - ; level 20 Rhydon. + ; Give the player a level 20 Rhydon. ld a, RHYDON ld [wcf91], a ld a, 20 @@ -102,15 +106,14 @@ TestBattle: ld [wCurMap], a call AddPartyMon - ; Fight against a - ; level 20 Rhydon. + ; Fight against a level 20 Rhydon. ld a, RHYDON ld [wCurOpponent], a predef InitOpponent - ; When the battle ends, - ; do it all again. + ; When the battle ends, do it all again. + ; There are some graphical quirks in SGB mode. ld a, 1 ld [wUpdateSpritesEnabled], a ldh [hAutoBGTransferEnabled], a -- cgit v1.3.1-sl0p