diff options
| author | SatoMew <SatoMew@users.noreply.github.com> | 2023-07-15 23:36:59 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-15 18:36:59 -0400 |
| commit | f46db37d508f0111ad44ad062ed3d83ba3282d1d (patch) | |
| tree | 170af31852384f5a207918decf05e45a837d95d1 /home | |
| parent | Add macros, constants, and labels for map scripts and text (#367) (diff) | |
| download | pokeyellow-f46db37d508f0111ad44ad062ed3d83ba3282d1d.tar.gz pokeyellow-f46db37d508f0111ad44ad062ed3d83ba3282d1d.tar.xz pokeyellow-f46db37d508f0111ad44ad062ed3d83ba3282d1d.zip | |
Thoroughly document debug code (#410)
Diffstat (limited to 'home')
| -rw-r--r-- | home/npc_movement.asm | 6 | ||||
| -rw-r--r-- | home/overworld.asm | 10 | ||||
| -rw-r--r-- | home/text.asm | 6 | ||||
| -rw-r--r-- | home/trainers.asm | 2 |
4 files changed, 16 insertions, 8 deletions
diff --git a/home/npc_movement.asm b/home/npc_movement.asm index a3367f9a..23a85427 100644 --- a/home/npc_movement.asm +++ b/home/npc_movement.asm @@ -50,10 +50,12 @@ RunNPCMovementScript:: EndNPCMovementScript:: farjp _EndNPCMovementScript -DebugPressedOrHeldB:: +DebugPressedOrHeldB:: ; dummy except in _DEBUG +; This is used to skip Trainer battles, the +; Safari Game step counter, and some NPC scripts. IF DEF(_DEBUG) ld a, [wd732] - bit 1, a + bit BIT_DEBUG_MODE, a ret z ldh a, [hJoyHeld] bit BIT_B_BUTTON, a diff --git a/home/overworld.asm b/home/overworld.asm index be1e6b24..1ebc794b 100644 --- a/home/overworld.asm +++ b/home/overworld.asm @@ -117,7 +117,7 @@ OverworldLoopLessDelay:: predef LoadSAV ld a, [wCurMap] ld [wDestinationMap], a - call SpecialWarpIn + call PrepareForSpecialWarp ld a, [wCurMap] call SwitchToMapRomBank ; switch to the ROM bank of the current map ld hl, wCurMapTileset @@ -762,11 +762,11 @@ HandleBlackOut:: call StopMusic ld hl, wd72e res 5, [hl] - ld a, BANK(ResetStatusAndHalveMoneyOnBlackout) ; also BANK(SpecialWarpIn) and BANK(SpecialEnterMap) + ld a, BANK(ResetStatusAndHalveMoneyOnBlackout) ; also BANK(PrepareForSpecialWarp) and BANK(SpecialEnterMap) ldh [hLoadedROMBank], a ld [MBC1RomBank], a call ResetStatusAndHalveMoneyOnBlackout - call SpecialWarpIn + call PrepareForSpecialWarp call PlayDefaultMusicFadeOutCurrent jp SpecialEnterMap @@ -793,10 +793,10 @@ HandleFlyWarpOrDungeonWarp:: set 2, [hl] ; fly warp or dungeon warp res 5, [hl] ; forced to ride bike call LeaveMapAnim - ld a, BANK(SpecialWarpIn) + ld a, BANK(PrepareForSpecialWarp) ldh [hLoadedROMBank], a ld [MBC1RomBank], a - call SpecialWarpIn + call PrepareForSpecialWarp jp SpecialEnterMap LeaveMapAnim:: diff --git a/home/text.asm b/home/text.asm index 836f3986..9462c749 100644 --- a/home/text.asm +++ b/home/text.asm @@ -111,10 +111,14 @@ NextChar:: inc de jp PlaceNextChar -NullChar:: +NullChar:: ; unused ld b, h ld c, l pop hl + ; A "<NULL>" character in a printed string + ; displays an error message with the current value + ; of hSpriteIndexOrTextID in decimal format. + ; This is a debugging leftover. ld de, TextIDErrorText dec de ret diff --git a/home/trainers.asm b/home/trainers.asm index 4dc63fef..e0195729 100644 --- a/home/trainers.asm +++ b/home/trainers.asm @@ -135,7 +135,9 @@ ENDC ld a, [wSpriteIndex] cp $ff jr nz, .trainerEngaging +IF DEF(_DEBUG) .trainerNotEngaging +ENDC xor a ld [wSpriteIndex], a ld [wTrainerHeaderFlagBit], a |
