-
Notifications
You must be signed in to change notification settings - Fork 910
Essential Debug Tools
The code below is from vulcandth and has the goal to significantly speed up the time to start a new game and provide you with access to the post-game when talking to the radio in your room.
In data/text/common_2.asm, go to _OakText1:: and do this to only print the first paragraph instead of his full speech:
_OakText1::
text "Hello! Sorry to"
line "keep you waiting!"
+if !DEF(_DEBUG)
para "Welcome to the"
line "world of #MON!"
para "My name is OAK."
para "People call me the"
line "#MON PROF."
+
+ endc
promptIn data/text/common_3.asm, go to _OakText7:: and do this to only print the first paragraph instead of his full speech:
_OakText7::
text "<PLAYER>, are you"
line "ready?"
+if !DEF(_DEBUG)
para "Your very own"
line "#MON story is"
cont "about to unfold."
para "You'll face fun"
line "times and tough"
cont "challenges."
para "A world of dreams"
line "and adventures"
para "with #MON"
line "awaits! Let's go!"
para "I'll be seeing you"
line "later!"
+
+endc
doneIn engine\menus\intro_menu.asm, go to OakSpeech: to not print more parts of his speech:
OakSpeech:
farcall InitClock
call RotateFourPalettesLeft
call ClearTilemap
[...]
ld hl, OakText1
call PrintText
+if !DEF(_DEBUG)
call RotateThreePalettesRight
call ClearTilemap
[...]
ld b, SCGB_TRAINER_OR_MON_FRONTPIC_PALS
call GetSGBLayout
call Intro_RotatePalettesLeftFrontpic
+
+endc
ld hl, OakText6
call PrintText
call NamePlayer
ld hl, OakText7
call PrintText
retIn engine\rtc\timeset.asm, go to InitClock: to not print OakTimeWokeUpText:
InitClock:
; Ask the player to set the time.
ldh a, [hInMenu]
push af
ld a, $1
ldh [hInMenu], a
[...]
ld de, TimeSetDownArrowGFX
ld hl, vTiles2 tile $02
lb bc, BANK(TimeSetDownArrowGFX), 1
call Request1bpp
call .ClearScreen
call WaitBGMap
call RotateFourPalettesRight
+if !DEF(_DEBUG)
ld hl, OakTimeWokeUpText
call PrintText
+endc
ld hl, wTimeSetBuffer
ld bc, wTimeSetBufferEnd - wTimeSetBuffer
xor a
call ByteFill
ld a, 10 ; default hour = 10 AM
ld [wInitHourBuffer], aIn maps/PlayersHouse2F.asm, go to PlayersHouseRadioScript:
PlayersHouseRadioScript:
+if DEF(_DEBUG)
+ opentext
+ ; full pokegear
+ setflag ENGINE_POKEGEAR
+ setflag ENGINE_PHONE_CARD
+ setflag ENGINE_MAP_CARD
+ setflag ENGINE_RADIO_CARD
+ setflag ENGINE_EXPN_CARD
+ ; pokedex
+ setflag ENGINE_POKEDEX
+ ; useful items
+ giveitem MAX_REPEL, 99
+ giveitem MASTER_BALL, 99
+ ; all badges
+ setflag ENGINE_ZEPHYRBADGE
+ setflag ENGINE_HIVEBADGE
+ setflag ENGINE_PLAINBADGE
+ setflag ENGINE_FOGBADGE
+ setflag ENGINE_STORMBADGE
+ setflag ENGINE_MINERALBADGE
+ setflag ENGINE_GLACIERBADGE
+ setflag ENGINE_RISINGBADGE
+ setflag ENGINE_BOULDERBADGE
+ setflag ENGINE_CASCADEBADGE
+ setflag ENGINE_THUNDERBADGE
+ setflag ENGINE_RAINBOWBADGE
+ setflag ENGINE_MARSHBADGE
+ setflag ENGINE_SOULBADGE
+ setflag ENGINE_VOLCANOBADGE
+ setflag ENGINE_EARTHBADGE
+ setevent EVENT_BEAT_FALKNER
+ setevent EVENT_BEAT_BUGSY
+ setevent EVENT_BEAT_WHITNEY
+ setevent EVENT_BEAT_MORTY
+ setevent EVENT_BEAT_CHUCK
+ setevent EVENT_BEAT_JASMINE
+ setevent EVENT_BEAT_PRYCE
+ setevent EVENT_BEAT_CLAIR
+ setevent EVENT_BEAT_BROCK
+ setevent EVENT_BEAT_MISTY
+ setevent EVENT_BEAT_LTSURGE
+ setevent EVENT_BEAT_ERIKA
+ setevent EVENT_BEAT_JANINE
+ setevent EVENT_BEAT_SABRINA
+ setevent EVENT_BEAT_BLAINE
+ setevent EVENT_BEAT_BLUE
+ setevent EVENT_BEAT_ELITE_FOUR
+ ; fly anywhere
+ setflag ENGINE_FLYPOINT_NEW_BARK
+ setflag ENGINE_FLYPOINT_CHERRYGROVE
+ setflag ENGINE_FLYPOINT_VIOLET
+ setflag ENGINE_FLYPOINT_AZALEA
+ setflag ENGINE_FLYPOINT_GOLDENROD
+ setflag ENGINE_FLYPOINT_ECRUTEAK
+ setflag ENGINE_FLYPOINT_OLIVINE
+ setflag ENGINE_FLYPOINT_CIANWOOD
+ setflag ENGINE_FLYPOINT_MAHOGANY
+ setflag ENGINE_FLYPOINT_LAKE_OF_RAGE
+ setflag ENGINE_FLYPOINT_BLACKTHORN
+ setflag ENGINE_FLYPOINT_SILVER_CAVE
+ setflag ENGINE_FLYPOINT_INDIGO_PLATEAU
+ setflag ENGINE_FLYPOINT_PALLET
+ setflag ENGINE_FLYPOINT_VIRIDIAN
+ setflag ENGINE_FLYPOINT_PEWTER
+ setflag ENGINE_FLYPOINT_CERULEAN
+ setflag ENGINE_FLYPOINT_VERMILION
+ setflag ENGINE_FLYPOINT_CELADON
+ setflag ENGINE_FLYPOINT_ROCK_TUNNEL
+ setflag ENGINE_FLYPOINT_LAVENDER
+ setflag ENGINE_FLYPOINT_FUCHSIA
+ setflag ENGINE_FLYPOINT_SAFFRON
+ setflag ENGINE_FLYPOINT_CINNABAR
+ ; post-e4
+ setflag ENGINE_CREDITS_SKIP
+ ; good party
+ givepoke MEWTWO, 100, BRIGHTPOWDER
+ ; hm slaves
+ givepoke MEW, 100, LEFTOVERS
+ givepoke MEW, 100, LEFTOVERS
+ loadmem wPartyMon2Moves+0, FLY
+ loadmem wPartyMon2Moves+1, SURF
+ loadmem wPartyMon2Moves+2, STRENGTH
+ loadmem wPartyMon2Moves+3, CUT
+ loadmem wPartyMon3Moves+0, FLASH
+ loadmem wPartyMon3Moves+1, ROCK_SMASH
+ loadmem wPartyMon3Moves+2, HEADBUTT
+ loadmem wPartyMon3Moves+3, WATERFALL
+ ; intro events
+ addcellnum PHONE_MOM
+ setmapscene PLAYERS_HOUSE_1F, $1
+ setevent EVENT_PLAYERS_HOUSE_MOM_1
+ clearevent EVENT_PLAYERS_HOUSE_MOM_2
+ setmapscene VERMILION_CITY, $1
+ closetext
+ end
+else
checkevent EVENT_GOT_A_POKEMON_FROM_ELM
iftrue .NormalRadio
checkevent EVENT_LISTENED_TO_INITIAL_RADIO
iftrue .AbbreviatedRadio
playmusic MUSIC_POKEMON_TALK
opentext
writetext PlayersRadioText1
pause 45
writetext PlayersRadioText2
pause 45
writetext PlayersRadioText3
pause 45
musicfadeout MUSIC_NEW_BARK_TOWN, 16
writetext PlayersRadioText4
pause 45
closetext
setevent EVENT_LISTENED_TO_INITIAL_RADIO
.NormalRadio:
jumpstd Radio1Script
.AbbreviatedRadio:
opentext
writetext PlayersRadioText4
pause 45
closetext
end
+
+endcThis will provide you with a good party and all post-game content.
In maps/ElmsLab.asm, go to .ElmGetsEmail: and significantly shorten his actions:
.ElmGetsEmail:
+if !DEF(_DEBUG)
writetext ElmText_Accepted
promptbutton
writetext ElmText_ResearchAmbitions
waitbutton
closetext
playsound SFX_GLASS_TING
pause 30
showemote EMOTE_SHOCK, ELMSLAB_ELM, 10
turnobject ELMSLAB_ELM, DOWN
opentext
writetext ElmText_GotAnEmail
waitbutton
closetext
opentext
turnobject ELMSLAB_ELM, RIGHT
writetext ElmText_MissionFromMrPokemon
waitbutton
+endc
closetext
applymovement ELMSLAB_ELM, ElmsLab_ElmToDefaultPositionMovement1
turnobject PLAYER, UP
applymovement ELMSLAB_ELM, ElmsLab_ElmToDefaultPositionMovement2
turnobject PLAYER, RIGHT
opentext
writetext ElmText_ChooseAPokemon
waitbutton
setscene SCENE_ELMSLAB_CANT_LEAVE
closetext
endNow, move on to ElmDirectionsScript:
ElmDirectionsScript:
turnobject PLAYER, UP
+if !DEF(_DEBUG)
opentext
writetext ElmDirectionsText1
waitbutton
closetext
+endc
addcellnum PHONE_ELM
opentext
writetext GotElmsNumberText
playsound SFX_REGISTER_PHONE_NUMBER
waitsfx
waitbutton
[...]Lastly, you can also stop some of his text from being printed in ElmText_Intro: and ElmAfterTheftText5::
ElmText_Intro:
text "ELM: <PLAY_G>!"
line "There you are!"
+if !DEF(_DEBUG)
para "I needed to ask"
line "you a favor."
para "I'm conducting new"
line "#MON research"
para "right now. I was"
line "wondering if you"
para "could help me with"
line "it, <PLAY_G>."
para "You see…"
para "I'm writing a"
line "paper that I want"
para "to present at a"
line "conference."
para "But there are some"
line "things I don't"
para "quite understand"
line "yet."
para "So!"
para "I'd like you to"
line "raise a #MON"
para "that I recently"
line "caught."
+endc
doneElmAfterTheftText5:
text "ELM: What?!?"
+if !DEF(_DEBUG)
para "PROF.OAK gave you"
line "a #DEX?"
para "<PLAY_G>, is that"
line "true? Th-that's"
cont "incredible!"
para "He is superb at"
line "seeing the poten-"
cont "tial of people as"
cont "trainers."
para "Wow, <PLAY_G>. You"
line "may have what it"
para "takes to become"
line "the CHAMPION."
para "You seem to be"
line "getting on great"
cont "with #MON too."
para "You should take"
line "the #MON GYM"
cont "challenge."
para "The closest GYM"
line "would be the one"
cont "in VIOLET CITY."
+endc
doneIn engine\overworld\player_movement.asm, go to DoPlayerMovement::
.update
ld a, [hli]
ld [wWalkingDirection], a
ld a, [hli]
ld [wFacingDirection], a
ld a, [hli]
ld [wWalkingX], a
ld a, [hli]
ld [wWalkingY], a
ld a, [hli]
ld h, [hl]
ld l, a
+if DEF(_DEBUG)
+ ldh a, [hJoyDown]
+ or ~(PAD_A | PAD_B)
+ inc a
+ ld a, [hl]
+ jr nz, .no_wtw
+ cp COLL_01
+ jr z, .no_wtw
+ ld a, COLL_LADDER
+.no_wtw
+else
ld a, [hl]
+endc
ld [wWalkingTileCollision], a
retWhat this does is to enable the player to walk around any block regardless of collision data by pressing A + B simultaneously. This is done by using garbage collision data in constants\collision_constants.asm:
; collision data types (see data/tilesets/*_collision.asm)
; CollisionPermissionTable indexes (see data/collision/collision_permissions.asm)
DEF COLL_FLOOR EQU $00
-DEF COLL_01 EQU $01 ; garbage
+DEF COLL_01 EQU $01 ; used for wtw in debug mode
DEF COLL_03 EQU $03 ; garbage
DEF COLL_04 EQU $04 ; garbage