Commented more sprite and map code

This commit is contained in:
YamaArashi 2014-09-13 00:50:56 -07:00
parent 91793015e5
commit 0c916aea33
108 changed files with 1091 additions and 946 deletions

View file

@ -1,3 +1,6 @@
; Format: (size 2 bytes)
; 00: target map ID
; 01: which dungeon warp in the source map was used
DungeonWarpList: ; 63bf (1:63bf) DungeonWarpList: ; 63bf (1:63bf)
db SEAFOAM_ISLANDS_2,$01 db SEAFOAM_ISLANDS_2,$01
db SEAFOAM_ISLANDS_2,$02 db SEAFOAM_ISLANDS_2,$02

View file

@ -15,7 +15,7 @@ Func_525af: ; 525af (14:65af)
ld [wPartyGainExpFlags], a ld [wPartyGainExpFlags], a
ld [wPlayerMonNumber], a ; wPlayerMonNumber ld [wPlayerMonNumber], a ; wPlayerMonNumber
ld [wEscapedFromBattle], a ld [wEscapedFromBattle], a
ld [wd35d], a ld [wMapPalOffset], a
ld hl, wcf1d ld hl, wcf1d
ld [hli], a ld [hli], a
ld [hl], a ld [hl], a

View file

@ -89,7 +89,7 @@ BattleTransition: ; 7096d (1c:496d)
xor a xor a
ld [hVBlankWY], a ld [hVBlankWY], a
dec a dec a
ld [wcfcb], a ld [wUpdateSpritesEnabled], a
call DelayFrame call DelayFrame
ld hl, wSpriteStateData1 + 2 ld hl, wSpriteStateData1 + 2
ld a, [H_DOWNARROWBLINKCNT2] ld a, [H_DOWNARROWBLINKCNT2]

View file

@ -71,7 +71,7 @@ EndOfBattle: ; 137aa (4:77aa)
call WaitForSoundToFinish call WaitForSoundToFinish
call GBPalWhiteOut call GBPalWhiteOut
ld a, $ff ld a, $ff
ld [wd42f], a ld [wDestinationWarpID], a
ret ret
YouWinText: ; 13853 (4:7853) YouWinText: ; 13853 (4:7853)
@ -94,7 +94,7 @@ Func_13870: ; 13870 (4:7870)
ld a, [wd736] ld a, [wd736]
and a and a
ret nz ret nz
callab Func_c49d callab IsPlayerStandingOnDoorTileOrWarpTile
jr nc, .asm_13888 jr nc, .asm_13888
.asm_13884 .asm_13884
ld a, $1 ld a, $1

View file

@ -517,7 +517,7 @@ Func_78e01: ; 78e01 (1e:4e01)
ret ret
Func_78e23: ; 78e23 (1e:4e23) Func_78e23: ; 78e23 (1e:4e23)
ld a, [wcf1b] ld a, [wOnSGB]
and a and a
ld a, $e4 ld a, $e4
jr z, .asm_78e47 jr z, .asm_78e47
@ -1091,7 +1091,7 @@ CallWithTurnFlipped: ; 79155 (1e:5155)
AnimationFlashScreenLong: ; 79165 (1e:5165) AnimationFlashScreenLong: ; 79165 (1e:5165)
ld a,3 ; cycle through the palettes 3 times ld a,3 ; cycle through the palettes 3 times
ld [wd08a],a ld [wd08a],a
ld a,[wcf1b] ; running on SGB? ld a,[wOnSGB] ; running on SGB?
and a and a
ld hl,FlashScreenLongMonochrome ld hl,FlashScreenLongMonochrome
jr z,.loop jr z,.loop
@ -1211,7 +1211,7 @@ Func_791f9: ; 791f9 (1e:51f9)
ld bc, $4040 ld bc, $4040
Func_791fc: ; 791fc (1e:51fc) Func_791fc: ; 791fc (1e:51fc)
ld a, [wcf1b] ld a, [wOnSGB]
and a and a
ld a, b ld a, b
jr z, .asm_79204 jr z, .asm_79204

View file

@ -139,7 +139,7 @@ SlidePlayerAndEnemySilhouettesOnScreen: ; 3c04c (f:404c)
ld [$ffd7], a ld [$ffd7], a
ld [hVBlankSCY], a ld [hVBlankSCY], a
dec a dec a
ld [wcfcb], a ld [wUpdateSpritesEnabled], a
call Delay3 call Delay3
xor a xor a
ld [H_AUTOBGTRANSFERENABLED], a ld [H_AUTOBGTRANSFERENABLED], a
@ -6247,7 +6247,7 @@ DoBattleTransitionAndInitBattleVariables: ; 3ec32 (f:6c32)
ld [wMenuJoypadPollCount], a ld [wMenuJoypadPollCount], a
callab DisplayLinkBattleVersusTextBox callab DisplayLinkBattleVersusTextBox
ld a, $1 ld a, $1
ld [wcfcb], a ld [wUpdateSpritesEnabled], a
call ClearScreen call ClearScreen
.next .next
call DelayFrame call DelayFrame
@ -6256,7 +6256,7 @@ DoBattleTransitionAndInitBattleVariables: ; 3ec32 (f:6c32)
ld a, $1 ld a, $1
ld [H_AUTOBGTRANSFERENABLED], a ld [H_AUTOBGTRANSFERENABLED], a
ld a, $ff ld a, $ff
ld [wcfcb], a ld [wUpdateSpritesEnabled], a
call ClearSprites call ClearSprites
call ClearScreen call ClearScreen
xor a xor a
@ -6729,16 +6729,16 @@ asm_3ef23: ; 3ef23 (f:6f23)
bit 1, a bit 1, a
jr z, .asm_3ef2f jr z, .asm_3ef2f
ld a, [hJoyHeld] ld a, [hJoyHeld]
bit 1, a bit 1, a ; B button pressed?
ret nz ret nz
.asm_3ef2f .asm_3ef2f
ld a, [wd13c] ld a, [wNumberOfNoRandomBattleStepsLeft]
and a and a
ret nz ret nz
callab Func_13870 callab Func_13870
ret nz ret nz
asm_3ef3d: ; 3ef3d (f:6f3d) asm_3ef3d: ; 3ef3d (f:6f3d)
ld a, [wd35d] ld a, [wMapPalOffset]
push af push af
ld hl, wd358 ld hl, wd358
ld a, [hl] ld a, [hl]
@ -6849,7 +6849,7 @@ InitBattle_Common: ; 3efeb (f:6feb)
pop af pop af
ld [wd358], a ld [wd358], a
pop af pop af
ld [wd35d], a ld [wMapPalOffset], a
ld a, [wd0d4] ld a, [wd0d4]
ld [$ffd7], a ld [$ffd7], a
scf scf

View file

@ -17,7 +17,7 @@ DisplayLinkBattleVersusTextBox: ; 372d6 (d:72d6)
ld [hli], a ld [hli], a
ld [hl], $6a ld [hl], $6a
xor a xor a
ld [wcfcb], a ld [wUpdateSpritesEnabled], a
callab SetupPlayerAndEnemyPokeballs callab SetupPlayerAndEnemyPokeballs
ld c, 150 ld c, 150
jp DelayFrames jp DelayFrames

View file

@ -570,13 +570,13 @@ Func_577d: ; 577d (1:577d)
xor a xor a
ld [wd72d], a ld [wd72d], a
dec a dec a
ld [wd42f], a ld [wDestinationWarpID], a
call LoadMapData call LoadMapData
callba Func_c335 callba Func_c335
pop hl pop hl
pop af pop af
ld [hl], a ld [hl], a
call GBFadeIn2 call GBFadeInFromWhite
ret ret
Func_57a2: Func_57a2:

View file

@ -127,7 +127,7 @@ Evolution_PartyMonLoop: ; loop over party mons
ld a, $1 ld a, $1
ld [H_AUTOBGTRANSFERENABLED], a ld [H_AUTOBGTRANSFERENABLED], a
ld a, $ff ld a, $ff
ld [wcfcb], a ld [wUpdateSpritesEnabled], a
call ClearSprites call ClearSprites
callab Func_7bde9 callab Func_7bde9
jp c, CancelledEvolution jp c, CancelledEvolution

View file

@ -43,7 +43,7 @@ _GivePokemon: ; 4fda5 (13:7da5)
call SetPokedexOwnedFlag call SetPokedexOwnedFlag
call AddPartyMon call AddPartyMon
ld a, $1 ld a, $1
ld [wcc3c], a ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld [wccd3], a ld [wccd3], a
scf scf
ret ret

View file

@ -18,7 +18,7 @@ AnimateHallOfFame: ; 701a0 (1c:41a0)
ld bc, HOF_TEAM ld bc, HOF_TEAM
call FillMemory call FillMemory
xor a xor a
ld [wcfcb], a ld [wUpdateSpritesEnabled], a
ld [$ffd7], a ld [$ffd7], a
ld [W_SPRITEFLIPPED], a ld [W_SPRITEFLIPPED], a
ld [wd358], a ld [wd358], a
@ -66,7 +66,7 @@ AnimateHallOfFame: ; 701a0 (1c:41a0)
call PlaceString call PlaceString
ld c, 180 ld c, 180
call DelayFrames call DelayFrames
call GBFadeOut2 call GBFadeOutToWhite
pop bc pop bc
pop hl pop hl
jr .asm_701fb jr .asm_701fb
@ -125,7 +125,7 @@ Func_70278: ; 70278 (1c:4278)
call Func_7036d call Func_7036d
ld d, $a0 ld d, $a0
ld e, $4 ld e, $4
ld a, [wcf1b] ld a, [wOnSGB]
and a and a
jr z, .asm_702c7 jr z, .asm_702c7
sla e sla e
@ -282,4 +282,4 @@ Func_70423: ; 70423 (1c:4423)
ld [wcfc9], a ld [wcfc9], a
ld a, $ff ld a, $ff
ld [wMusicHeaderPointer], a ld [wMusicHeaderPointer], a
jp GBFadeOut2 jp GBFadeOutToWhite

View file

@ -1,7 +1,7 @@
PrintNotebookText: ; 52996 (14:6996) PrintNotebookText: ; 52996 (14:6996)
call EnableAutoTextBoxDrawing call EnableAutoTextBoxDrawing
ld a, $1 ld a, $1
ld [wcc3c], a ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld a, [wTrainerSpriteOffset] ld a, [wTrainerSpriteOffset]
jp PrintPredefTextID jp PrintPredefTextID

View file

@ -89,7 +89,7 @@ DisplayMonFrontSpriteInBox: ; 5dbd9 (17:5bd9)
PrintBlackboardLinkCableText: ; 5dc1a (17:5c1a) PrintBlackboardLinkCableText: ; 5dc1a (17:5c1a)
call EnableAutoTextBoxDrawing call EnableAutoTextBoxDrawing
ld a, $1 ld a, $1
ld [wcc3c], a ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld a, [wWhichTrade] ld a, [wWhichTrade]
call PrintPredefTextID call PrintPredefTextID
ret ret

View file

@ -181,7 +181,7 @@ OpenPokemonCenterPC: ; 62516 (18:6516)
ret nz ret nz
call EnableAutoTextBoxDrawing call EnableAutoTextBoxDrawing
ld a, $1 ld a, $1
ld [wcf0c], a ld [wAutoTextBoxDrawingControl], a
ld a, $1f ; PredefText1f ld a, $1f ; PredefText1f
jp PrintPredefTextID jp PrintPredefTextID

View file

@ -114,7 +114,7 @@ TownMapText: ; fc12 (3:7c12)
db $06 db $06
db $08 ; asm db $08 ; asm
ld a, $1 ld a, $1
ld [wcc3c], a ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld hl, wd730 ld hl, wd730
set 6, [hl] set 6, [hl]
call GBPalWhiteOutWithDelay3 call GBPalWhiteOutWithDelay3

View file

@ -83,7 +83,7 @@ asm_1e9b0: ; 1e9b0 (7:69b0)
ld a, $9c ld a, $9c
ld [H_DOWNARROWBLINKCNT1], a ; $ff8b ld [H_DOWNARROWBLINKCNT1], a ; $ff8b
ld a, $3 ld a, $3
ld [wd42f], a ld [wDestinationWarpID], a
ld a, $5 ld a, $5
ld [W_SAFARIZONEENTRANCECURSCRIPT], a ld [W_SAFARIZONEENTRANCECURSCRIPT], a
ld hl, wd790 ld hl, wd790
@ -152,7 +152,7 @@ CinnabarGymQuiz: ; 1ea25 (7:6a25)
ld l, a ld l, a
call PrintText call PrintText
ld a, $1 ld a, $1
ld [wcc3c], a ld [wDoNotWaitForButtonPressAfterDisplayingText], a
call CinnabarGymQuiz_1ea92 call CinnabarGymQuiz_1ea92
jp TextScriptEnd jp TextScriptEnd
@ -334,7 +334,7 @@ BillsHousePC: ; 1eb6e (7:6b6e)
jp PrintPredefTextID jp PrintPredefTextID
.asm_1eb8b .asm_1eb8b
ld a, $1 ld a, $1
ld [wcc3c], a ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld a, $2e ld a, $2e
call PrintPredefTextID call PrintPredefTextID
ld c, $20 ld c, $20
@ -363,7 +363,7 @@ BillsHousePC: ; 1eb6e (7:6b6e)
ret ret
.asm_1ebd2 .asm_1ebd2
ld a, $1 ld a, $1
ld [wcc3c], a ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld a, $2f ld a, $2f
call PrintPredefTextID call PrintPredefTextID
ret ret

View file

@ -88,7 +88,7 @@ Func_71c07: ; 71c07 (1c:5c07)
xor a xor a
ld [wd07d],a ld [wd07d],a
dec a dec a
ld [wcfcb],a ld [wUpdateSpritesEnabled],a
call DisplayPartyMenu call DisplayPartyMenu
push af push af
call Func_71ca2 call Func_71ca2

View file

@ -5,7 +5,7 @@ PlayIntro: ; 41682 (10:5682)
ld [H_AUTOBGTRANSFERENABLED], a ld [H_AUTOBGTRANSFERENABLED], a
call PlayShootingStar call PlayShootingStar
call PlayIntroScene call PlayIntroScene
call GBFadeOut2 call GBFadeOutToWhite
xor a xor a
ld [$ffae], a ld [$ffae], a
ld [H_AUTOBGTRANSFERENABLED], a ld [H_AUTOBGTRANSFERENABLED], a

View file

@ -507,8 +507,8 @@ ItemUseBicycle: ; d977 (3:5977)
ld a,[W_ISINBATTLE] ld a,[W_ISINBATTLE]
and a and a
jp nz,ItemUseNotTime jp nz,ItemUseNotTime
ld a,[wd700] ld a,[wWalkBikeSurfState]
ld [wd11a],a ld [wWalkBikeSurfStateCopy],a
cp a,2 ; is the player surfing? cp a,2 ; is the player surfing?
jp z,ItemUseNotTime jp z,ItemUseNotTime
dec a ; is player already bicycling? dec a ; is player already bicycling?
@ -516,7 +516,7 @@ ItemUseBicycle: ; d977 (3:5977)
.getOffBike .getOffBike
call ItemUseReloadOverworldData call ItemUseReloadOverworldData
xor a xor a
ld [wd700],a ; change player state to walking ld [wWalkBikeSurfState],a ; change player state to walking
call PlayDefaultMusic ; play walking music call PlayDefaultMusic ; play walking music
ld hl,GotOffBicycleText ld hl,GotOffBicycleText
jr .printText jr .printText
@ -527,7 +527,7 @@ ItemUseBicycle: ; d977 (3:5977)
xor a ; no keys pressed xor a ; no keys pressed
ld [hJoyHeld],a ; current joypad state ld [hJoyHeld],a ; current joypad state
inc a inc a
ld [wd700],a ; change player state to bicycling ld [wWalkBikeSurfState],a ; change player state to bicycling
ld hl,GotOnBicycleText ld hl,GotOnBicycleText
call PlayDefaultMusic ; play bike riding music call PlayDefaultMusic ; play bike riding music
.printText .printText
@ -535,8 +535,8 @@ ItemUseBicycle: ; d977 (3:5977)
; used for Surf out-of-battle effect ; used for Surf out-of-battle effect
ItemUseSurfboard: ; d9b4 (3:59b4) ItemUseSurfboard: ; d9b4 (3:59b4)
ld a,[wd700] ld a,[wWalkBikeSurfState]
ld [wd11a],a ld [wWalkBikeSurfStateCopy],a
cp a,2 ; is the player already surfing? cp a,2 ; is the player already surfing?
jr z,.tryToStopSurfing jr z,.tryToStopSurfing
.tryToSurf .tryToSurf
@ -550,7 +550,7 @@ ItemUseSurfboard: ; d9b4 (3:59b4)
ld hl,wd730 ld hl,wd730
set 7,[hl] set 7,[hl]
ld a,2 ld a,2
ld [wd700],a ; change player state to surfing ld [wWalkBikeSurfState],a ; change player state to surfing
call PlayDefaultMusic ; play surfing music call PlayDefaultMusic ; play surfing music
ld hl,SurfingGotOnText ld hl,SurfingGotOnText
jp PrintText jp PrintText
@ -570,7 +570,7 @@ ItemUseSurfboard: ; d9b4 (3:59b4)
ld a,[hli] ld a,[hli]
ld h,[hl] ld h,[hl]
ld l,a ; hl now points to passable tiles ld l,a ; hl now points to passable tiles
ld a,[wcfc6] ; tile in front of the player ld a,[wTileInFrontOfPlayer] ; tile in front of the player
ld b,a ld b,a
.passableTileLoop .passableTileLoop
ld a,[hli] ld a,[hli]
@ -586,7 +586,7 @@ ItemUseSurfboard: ; d9b4 (3:59b4)
ld hl,wd730 ld hl,wd730
set 7,[hl] set 7,[hl]
xor a xor a
ld [wd700],a ; change player state to walking ld [wWalkBikeSurfState],a ; change player state to walking
dec a dec a
ld [wJoyIgnore],a ld [wJoyIgnore],a
call PlayDefaultMusic ; play walking music call PlayDefaultMusic ; play walking music
@ -636,7 +636,7 @@ ItemUseEvoStone: ; da5b (3:5a5b)
ld a,$05 ; evolution stone party menu ld a,$05 ; evolution stone party menu
ld [wd07d],a ld [wd07d],a
ld a,$ff ld a,$ff
ld [wcfcb],a ld [wUpdateSpritesEnabled],a
call DisplayPartyMenu call DisplayPartyMenu
pop bc pop bc
jr c,.canceledItemUse jr c,.canceledItemUse
@ -681,7 +681,7 @@ ItemUseMedicine: ; dabb (3:5abb)
ld a,$01 ld a,$01
ld [wd07d],a ; item use party menu ld [wd07d],a ; item use party menu
ld a,$ff ld a,$ff
ld [wcfcb],a ld [wUpdateSpritesEnabled],a
ld a,[wd152] ld a,[wd152]
and a ; using Softboiled? and a ; using Softboiled?
jr z,.notUsingSoftboiled jr z,.notUsingSoftboiled
@ -1096,7 +1096,7 @@ ItemUseMedicine: ; dabb (3:5abb)
ld [H_AUTOBGTRANSFERENABLED],a ld [H_AUTOBGTRANSFERENABLED],a
call ClearScreen call ClearScreen
dec a dec a
ld [wcfcb],a ld [wUpdateSpritesEnabled],a
call RedrawPartyMenu ; redraws the party menu and displays the message call RedrawPartyMenu ; redraws the party menu and displays the message
ld a,1 ld a,1
ld [H_AUTOBGTRANSFERENABLED],a ld [H_AUTOBGTRANSFERENABLED],a
@ -1278,7 +1278,7 @@ ItemUseMedicine: ; dabb (3:5abb)
ld [wccd4],a ld [wccd4],a
callab TryEvolvingMon ; evolve pokemon, if appropriate callab TryEvolvingMon ; evolve pokemon, if appropriate
ld a,$01 ld a,$01
ld [wcfcb],a ld [wUpdateSpritesEnabled],a
pop af pop af
ld [wcf91],a ld [wcf91],a
pop af pop af
@ -1424,8 +1424,8 @@ ItemUseXAccuracy: ; e013 (3:6013)
ItemUseCardKey: ; e022 (3:6022) ItemUseCardKey: ; e022 (3:6022)
xor a xor a
ld [wd71f],a ld [wd71f],a
call Func_c586 call GetTileAndCoordsInFrontOfPlayer
ld a,[Func_c586] ; $4586 ld a,[GetTileAndCoordsInFrontOfPlayer] ; $4586
cp a,$18 cp a,$18
jr nz,.next0 jr nz,.next0
ld hl,CardKeyTable1 ld hl,CardKeyTable1
@ -1796,7 +1796,7 @@ RodResponse: ; e28d (3:628d)
ld [W_CUROPPONENT], a ld [W_CUROPPONENT], a
.next .next
ld hl, wd700 ld hl, wWalkBikeSurfState
ld a, [hl] ; store the value in a ld a, [hl] ; store the value in a
push af push af
push hl push hl
@ -1818,7 +1818,7 @@ FishingInit: ; e2b4 (3:62b4)
.notInBattle .notInBattle
call IsNextTileShoreOrWater call IsNextTileShoreOrWater
ret c ret c
ld a,[wd700] ld a,[wWalkBikeSurfState]
cp a,2 ; Surfing? cp a,2 ; Surfing?
jr z,.surfing jr z,.surfing
call ItemUseReloadOverworldData call ItemUseReloadOverworldData
@ -1877,7 +1877,7 @@ ItemUsePPRestore: ; e31e (3:631e)
ld [wWhichTrade],a ld [wWhichTrade],a
.chooseMon .chooseMon
xor a xor a
ld [wcfcb],a ld [wUpdateSpritesEnabled],a
ld a,$01 ; item use party menu ld a,$01 ; item use party menu
ld [wd07d],a ld [wd07d],a
call DisplayPartyMenu call DisplayPartyMenu
@ -2117,7 +2117,7 @@ ItemUseTMHM: ; e479 (3:6479)
ld bc,14 ld bc,14
call CopyData call CopyData
ld a,$ff ld a,$ff
ld [wcfcb],a ld [wUpdateSpritesEnabled],a
ld a,$03 ; teach TM/HM party menu ld a,$03 ; teach TM/HM party menu
ld [wd07d],a ld [wd07d],a
call DisplayPartyMenu call DisplayPartyMenu
@ -2744,7 +2744,7 @@ IsNextTileShoreOrWater: ; e8b8 (3:68b8)
jr nc, .notShoreOrWater jr nc, .notShoreOrWater
ld a, [W_CURMAPTILESET] ld a, [W_CURMAPTILESET]
cp SHIP_PORT ; Vermilion Dock tileset cp SHIP_PORT ; Vermilion Dock tileset
ld a, [wcfc6] ; tile in front of player ld a, [wTileInFrontOfPlayer] ; tile in front of player
jr z, .skipShoreTiles ; if it's the Vermilion Dock tileset jr z, .skipShoreTiles ; if it's the Vermilion Dock tileset
cp $48 ; eastern shore tile in Safari Zone cp $48 ; eastern shore tile in Safari Zone
jr z, .shoreOrWater jr z, .shoreOrWater

View file

@ -3,7 +3,7 @@ DisplayDiploma: ; 566e2 (15:66e2)
call GBPalWhiteOutWithDelay3 call GBPalWhiteOutWithDelay3
call ClearScreen call ClearScreen
xor a xor a
ld [wcfcb], a ld [wUpdateSpritesEnabled], a
ld hl, wd730 ld hl, wd730
set 6, [hl] set 6, [hl]
call DisableLCD call DisableLCD

View file

@ -4,14 +4,14 @@ PKMNLeaguePC: ; 0x7657e
ld hl, wd730 ld hl, wd730
set 6, [hl] set 6, [hl]
push hl push hl
ld a, [wcfcb] ld a, [wUpdateSpritesEnabled]
push af push af
ld a, [$ffD7] ld a, [$ffD7]
push af push af
xor a xor a
ld [$ffD7], a ld [$ffD7], a
ld [W_SPRITEFLIPPED], a ld [W_SPRITEFLIPPED], a
ld [wcfcb], a ld [wUpdateSpritesEnabled], a
ld [wTrainerScreenX], a ld [wTrainerScreenX], a
ld [wcd42], a ld [wcd42], a
ld a, [wd5a2] ld a, [wd5a2]
@ -40,7 +40,7 @@ PKMNLeaguePC: ; 0x7657e
pop af pop af
ld [$ffD7], a ld [$ffD7], a
pop af pop af
ld [wcfcb], a ld [wUpdateSpritesEnabled], a
pop hl pop hl
res 6, [hl] res 6, [hl]
call GBPalWhiteOutWithDelay3 call GBPalWhiteOutWithDelay3

View file

@ -111,16 +111,16 @@ MainMenu: ; 5af2 (1:5af2)
call DelayFrames call DelayFrames
ld a,[wd5a2] ld a,[wd5a2]
and a and a
jp z,Func_5d5f jp z,SpecialEnterMap
ld a,[W_CURMAP] ; map ID ld a,[W_CURMAP] ; map ID
cp a,HALL_OF_FAME cp a,HALL_OF_FAME
jp nz,Func_5d5f jp nz,SpecialEnterMap
xor a xor a
ld [wd71a],a ld [wDestinationMap],a
ld hl,wd732 ld hl,wd732
set 2,[hl] set 2,[hl] ; fly warp or dungeon warp
call Func_62ce call SpecialWarpIn
jp Func_5d5f jp SpecialEnterMap
Func_5bff: ; 5bff (1:5bff) Func_5bff: ; 5bff (1:5bff)
ld a,1 ld a,1
ld [wd358],a ld [wd358],a
@ -247,7 +247,7 @@ LinkMenu: ; 5c0a (1:5c0a)
cp $2 cp $2
jr z, .asm_5d2d jr z, .asm_5d2d
xor a xor a
ld [wd700], a ld [wWalkBikeSurfState], a
ld a, [wCurrentMenuItem] ; wCurrentMenuItem ld a, [wCurrentMenuItem] ; wCurrentMenuItem
and a and a
ld a, TRADE_CENTER ld a, TRADE_CENTER
@ -262,8 +262,8 @@ LinkMenu: ; 5c0a (1:5c0a)
ld hl, wd732 ld hl, wd732
res 1, [hl] res 1, [hl]
ld a, [W_ANIMATIONID] ; W_ANIMATIONID ld a, [W_ANIMATIONID] ; W_ANIMATIONID
ld [wd71a], a ld [wDestinationMap], a
call Func_62ce call SpecialWarpIn
ld c, $14 ld c, $14
call DelayFrames call DelayFrames
xor a xor a
@ -272,7 +272,7 @@ LinkMenu: ; 5c0a (1:5c0a)
inc a inc a
ld [W_ISLINKBATTLE], a ; W_ISLINKBATTLE ld [W_ISLINKBATTLE], a ; W_ISLINKBATTLE
ld [wcc47], a ld [wcc47], a
jr Func_5d5f jr SpecialEnterMap
.asm_5d2d .asm_5d2d
xor a xor a
ld [wMenuJoypadPollCount], a ; wMenuJoypadPollCount ld [wMenuJoypadPollCount], a ; wMenuJoypadPollCount
@ -303,16 +303,17 @@ Func_5d52: ; 5d52 (1:5d52)
ld c, $14 ld c, $14
call DelayFrames call DelayFrames
Func_5d5f: ; 5d5f (1:5d5f) ; enter map after using a special warp or loading the game from the main menu
SpecialEnterMap: ; 5d5f (1:5d5f)
xor a xor a
ld [hJoyPressed], a ld [hJoyPressed], a
ld [hJoyHeld], a ld [hJoyHeld], a
ld [$ffb5], a ld [$ffb5], a
ld [wd72d], a ld [wd72d], a
ld hl, wd732 ld hl, wd732
set 0, [hl] set 0, [hl] ; count play time
call ResetPlayerSpriteData call ResetPlayerSpriteData
ld c, $14 ld c, 20
call DelayFrames call DelayFrames
ld a, [wcc47] ld a, [wcc47]
and a and a

View file

@ -22,10 +22,10 @@ AskName: ; 64eb (1:64eb)
ld a, [wCurrentMenuItem] ; wCurrentMenuItem ld a, [wCurrentMenuItem] ; wCurrentMenuItem
and a and a
jr nz, .asm_654c jr nz, .asm_654c
ld a, [wcfcb] ld a, [wUpdateSpritesEnabled]
push af push af
xor a xor a
ld [wcfcb], a ld [wUpdateSpritesEnabled], a
push hl push hl
ld a, $2 ld a, $2
ld [wd07d], a ld [wd07d], a
@ -38,7 +38,7 @@ AskName: ; 64eb (1:64eb)
call LoadScreenTilesFromBuffer1 call LoadScreenTilesFromBuffer1
pop hl pop hl
pop af pop af
ld [wcfcb], a ld [wUpdateSpritesEnabled], a
ld a, [wcf4b] ld a, [wcf4b]
cp $50 cp $50
ret nz ret nz
@ -56,7 +56,7 @@ DoYouWantToNicknameText: ; 0x6557
Func_655c: ; 655c (1:655c) Func_655c: ; 655c (1:655c)
ld hl, wHPBarMaxHP ld hl, wHPBarMaxHP
xor a xor a
ld [wcfcb], a ld [wUpdateSpritesEnabled], a
ld a, $2 ld a, $2
ld [wd07d], a ld [wd07d], a
call DisplayNamingScreen call DisplayNamingScreen

View file

@ -86,7 +86,7 @@ BillsPC: ; 17ee4 (5:7ee4)
callba BillsPC_ callba BillsPC_
ReloadMainMenu: ; 17f06 (5:7f06) ReloadMainMenu: ; 17f06 (5:7f06)
xor a xor a
ld [wcc3c], a ld [wDoNotWaitForButtonPressAfterDisplayingText], a
call ReloadMapData call ReloadMapData
call UpdateSprites ;XXX: moves sprites call UpdateSprites ;XXX: moves sprites
jp PCMainMenu jp PCMainMenu

View file

@ -78,7 +78,7 @@ Func_796d: ; 796d (1:796d)
ld hl, wd730 ld hl, wd730
res 6, [hl] res 6, [hl]
xor a xor a
ld [wcc3c], a ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ret ret
Func_7995: ; 7995 (1:7995) Func_7995: ; 7995 (1:7995)

View file

@ -2,8 +2,8 @@ DisplayStartMenu:: ; 2acd (0:2acd)
ld a,$04 ; hardcoded Bank, not sure what's it refers to ld a,$04 ; hardcoded Bank, not sure what's it refers to
ld [H_LOADEDROMBANK],a ld [H_LOADEDROMBANK],a
ld [$2000],a ; ROM bank 4 ld [$2000],a ; ROM bank 4
ld a,[wd700] ; walking/biking/surfing ld a,[wWalkBikeSurfState] ; walking/biking/surfing
ld [wd11a],a ld [wWalkBikeSurfStateCopy],a
ld a, (SFX_02_3f - SFX_Headers_02) / 3 ; Start menu sound ld a, (SFX_02_3f - SFX_Headers_02) / 3 ; Start menu sound
call PlaySound call PlaySound

View file

@ -13,7 +13,7 @@ StartMenu_Pokemon: ; 130a9 (4:70a9)
xor a xor a
ld [wMenuItemToSwap],a ld [wMenuItemToSwap],a
ld [wd07d],a ld [wd07d],a
ld [wcfcb],a ld [wUpdateSpritesEnabled],a
call DisplayPartyMenu call DisplayPartyMenu
jr .checkIfPokemonChosen jr .checkIfPokemonChosen
.loop .loop
@ -184,7 +184,7 @@ StartMenu_Pokemon: ; 130a9 (4:70a9)
bit 0,a ; does the player have the Boulder Badge? bit 0,a ; does the player have the Boulder Badge?
jp z,.newBadgeRequired jp z,.newBadgeRequired
xor a xor a
ld [wd35d],a ld [wMapPalOffset],a
ld hl,.flashLightsAreaText ld hl,.flashLightsAreaText
call PrintText call PrintText
call GBPalWhiteOutWithDelay3 call GBPalWhiteOutWithDelay3
@ -406,7 +406,7 @@ StartMenu_Item: ; 13302 (4:7302)
jp z,ItemMenuLoop jp z,ItemMenuLoop
jp CloseStartMenu jp CloseStartMenu
.useItem_partyMenu .useItem_partyMenu
ld a,[wcfcb] ld a,[wUpdateSpritesEnabled]
push af push af
call UseItem call UseItem
ld a,[wcd6a] ld a,[wcd6a]
@ -415,11 +415,11 @@ StartMenu_Item: ; 13302 (4:7302)
call GBPalWhiteOutWithDelay3 call GBPalWhiteOutWithDelay3
call RestoreScreenTilesAndReloadTilePatterns call RestoreScreenTilesAndReloadTilePatterns
pop af pop af
ld [wcfcb],a ld [wUpdateSpritesEnabled],a
jp StartMenu_Item jp StartMenu_Item
.partyMenuNotDisplayed .partyMenuNotDisplayed
pop af pop af
ld [wcfcb],a ld [wUpdateSpritesEnabled],a
jp ItemMenuLoop jp ItemMenuLoop
.tossItem .tossItem
call IsKeyItem call IsKeyItem

View file

@ -21,7 +21,7 @@ GetAnimationSpeed: ; 7170a (1c:570a)
ld c, a ld c, a
ld hl, PartyMonSpeeds ld hl, PartyMonSpeeds
add hl, bc add hl, bc
ld a, [wcf1b] ld a, [wOnSGB]
xor $1 xor $1
add [hl] add [hl]
ld c, a ld c, a

View file

@ -49,8 +49,8 @@ OakSpeech: ; 6115 (1:6115)
ld [wcf96],a ld [wcf96],a
call AddItemToInventory ; give one potion call AddItemToInventory ; give one potion
ld a,[W_ANIMATIONID] ld a,[W_ANIMATIONID]
ld [wd71a],a ld [wDestinationMap],a
call Func_62ce call SpecialWarpIn
xor a xor a
ld [$FFD7],a ld [$FFD7],a
ld a,[wd732] ld a,[wd732]
@ -62,7 +62,7 @@ OakSpeech: ; 6115 (1:6115)
call FadeInIntroPic call FadeInIntroPic
ld hl,OakSpeechText1 ld hl,OakSpeechText1
call PrintText ; prints text box call PrintText ; prints text box
call GBFadeOut2 call GBFadeOutToWhite
call ClearScreen call ClearScreen
ld a,NIDORINO ld a,NIDORINO
ld [wd0b5],a ; pic displayed is stored at this location ld [wd0b5],a ; pic displayed is stored at this location
@ -73,7 +73,7 @@ OakSpeech: ; 6115 (1:6115)
call MovePicLeft call MovePicLeft
ld hl,OakSpeechText2 ld hl,OakSpeechText2
call PrintText ; Prints text box call PrintText ; Prints text box
call GBFadeOut2 call GBFadeOutToWhite
call ClearScreen call ClearScreen
ld de,RedPicFront ld de,RedPicFront
ld bc,(Bank(RedPicFront) << 8) | $00 ld bc,(Bank(RedPicFront) << 8) | $00
@ -82,7 +82,7 @@ OakSpeech: ; 6115 (1:6115)
ld hl,IntroducePlayerText ld hl,IntroducePlayerText
call PrintText call PrintText
call LoadDefaultNamesPlayer ; brings up NewName/Red/etc menu call LoadDefaultNamesPlayer ; brings up NewName/Red/etc menu
call GBFadeOut2 call GBFadeOutToWhite
call ClearScreen call ClearScreen
ld de,Rival1Pic ld de,Rival1Pic
ld bc,(Bank(Rival1Pic) << 8) | $00 ld bc,(Bank(Rival1Pic) << 8) | $00
@ -93,12 +93,12 @@ OakSpeech: ; 6115 (1:6115)
call LoadDefaultNamesRival call LoadDefaultNamesRival
Func_61bc: ; 61bc (1:61bc) Func_61bc: ; 61bc (1:61bc)
call GBFadeOut2 call GBFadeOutToWhite
call ClearScreen call ClearScreen
ld de,RedPicFront ld de,RedPicFront
ld bc,(Bank(RedPicFront) << 8) | $00 ld bc,(Bank(RedPicFront) << 8) | $00
call IntroPredef3B call IntroPredef3B
call GBFadeIn2 call GBFadeInFromWhite
ld a,[wd72d] ld a,[wd72d]
and a and a
jr nz,.next jr nz,.next
@ -148,10 +148,10 @@ Func_61bc: ; 61bc (1:61bc)
call ClearScreenArea call ClearScreenArea
call LoadTextBoxTilePatterns call LoadTextBoxTilePatterns
ld a,1 ld a,1
ld [wcfcb],a ld [wUpdateSpritesEnabled],a
ld c,$32 ld c,$32
call DelayFrames call DelayFrames
call GBFadeOut2 call GBFadeOutToWhite
jp ClearScreen jp ClearScreen
OakSpeechText1: ; 6253 (1:6253) OakSpeechText1: ; 6253 (1:6253)
TX_FAR _OakSpeechText1 TX_FAR _OakSpeechText1

View file

@ -8,8 +8,8 @@ PrintCardKeyText: ; 52673 (14:6673)
ret z ret z
cp b cp b
jr nz, .asm_5267a jr nz, .asm_5267a
predef Func_c586 predef GetTileAndCoordsInFrontOfPlayer
ld a, [wcfc6] ld a, [wTileInFrontOfPlayer]
cp $18 cp $18
jr z, .asm_5269c jr z, .asm_5269c
cp $24 cp $24

View file

@ -6,13 +6,13 @@ UsedCut: ; ef54 (3:6f54)
jr z, .asm_ef6b jr z, .asm_ef6b
cp GYM cp GYM
jr nz, .asm_ef77 jr nz, .asm_ef77
ld a, [wcfc6] ld a, [wTileInFrontOfPlayer]
cp $50 ; gym cut tree cp $50 ; gym cut tree
jr nz, .asm_ef77 jr nz, .asm_ef77
jr asm_ef82 jr asm_ef82
.asm_ef6b .asm_ef6b
dec a dec a
ld a, [wcfc6] ld a, [wTileInFrontOfPlayer]
cp $3d ; cut tree cp $3d ; cut tree
jr z, asm_ef82 jr z, asm_ef82
cp $52 ; grass cp $52 ; grass
@ -52,14 +52,14 @@ asm_ef82: ; ef82 (3:6f82)
ld hl, wd730 ld hl, wd730
res 6, [hl] res 6, [hl]
ld a, $ff ld a, $ff
ld [wcfcb], a ld [wUpdateSpritesEnabled], a
call AnimateCutTree call AnimateCutTree
ld de, CutTreeBlockSwaps ; $7100 ld de, CutTreeBlockSwaps ; $7100
call Func_f09f call Func_f09f
call Func_eedc call Func_eedc
callba Func_79e96 callba Func_79e96
ld a, $1 ld a, $1
ld [wcfcb], a ld [wUpdateSpritesEnabled], a
ld a, (SFX_02_56 - SFX_Headers_02) / 3 ld a, (SFX_02_56 - SFX_Headers_02) / 3
call PlaySound call PlaySound
ld a, $90 ld a, $90
@ -178,7 +178,7 @@ Func_f09f: ; f09f (3:709f)
ld c, a ld c, a
ld b, $0 ld b, $0
ld d, $0 ld d, $0
ld hl, wd35f ld hl, wCurrentTileBlockMapViewPointer
ld a, [hli] ld a, [hli]
ld h, [hl] ld h, [hl]
ld l, a ld l, a

View file

@ -1,5 +1,5 @@
; returns whether the player is standing on a door in carry ; returns whether the player is standing on a door tile in carry
IsPlayerStandingOnDoor: ; 1a609 (6:6609) IsPlayerStandingOnDoorTile: ; 1a609 (6:6609)
push de push de
ld hl, DoorTileIDPointers ; $662c ld hl, DoorTileIDPointers ; $662c
ld a, [W_CURMAPTILESET] ; W_CURMAPTILESET ld a, [W_CURMAPTILESET] ; W_CURMAPTILESET

View file

@ -11,10 +11,10 @@ EmotionBubble: ; 17c47 (5:7c47)
ld hl, vChars1 + $780 ld hl, vChars1 + $780
ld bc, (BANK(EmotionBubblesPointerTable) << 8) + $04 ld bc, (BANK(EmotionBubblesPointerTable) << 8) + $04
call CopyVideoData call CopyVideoData
ld a, [wcfcb] ld a, [wUpdateSpritesEnabled]
push af push af
ld a, $ff ld a, $ff
ld [wcfcb], a ld [wUpdateSpritesEnabled], a
ld a, [wd736] ld a, [wd736]
bit 6, a bit 6, a
ld hl, wOAMBuffer + $8f ld hl, wOAMBuffer + $8f
@ -51,7 +51,7 @@ EmotionBubble: ; 17c47 (5:7c47)
ld c, $3c ld c, $3c
call DelayFrames call DelayFrames
pop af pop af
ld [wcfcb], a ld [wUpdateSpritesEnabled], a
call DelayFrame call DelayFrame
jp UpdateSprites jp UpdateSprites

View file

@ -3,7 +3,7 @@ AnimateHealingMachine: ; 70433 (1c:4433)
ld hl, vChars0 + $7c0 ld hl, vChars0 + $7c0
ld bc, (BANK(PokeCenterFlashingMonitorAndHealBall) << 8) + $03 ld bc, (BANK(PokeCenterFlashingMonitorAndHealBall) << 8) + $03
call CopyVideoData call CopyVideoData
ld hl, wcfcb ld hl, wUpdateSpritesEnabled
ld a, [hl] ld a, [hl]
push af push af
ld [hl], $ff ld [hl], $ff

View file

@ -12,7 +12,7 @@ HiddenItems: ; 76688 (1d:6688)
ret nz ret nz
call EnableAutoTextBoxDrawing call EnableAutoTextBoxDrawing
ld a, $1 ld a, $1
ld [wcc3c], a ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld a, [wWhichTrade] ; item ID ld a, [wWhichTrade] ; item ID
ld [wd11e], a ld [wd11e], a
call GetItemName call GetItemName
@ -42,7 +42,7 @@ FoundHiddenItemText: ; 7675b (1d:675b)
.BagFull .BagFull
call WaitForTextScrollButtonPress ; wait for button press call WaitForTextScrollButtonPress ; wait for button press
xor a xor a
ld [wcc3c], a ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld hl, HiddenItemBagFullText ld hl, HiddenItemBagFullText
call PrintText call PrintText
jp TextScriptEnd jp TextScriptEnd

View file

@ -1,13 +1,13 @@
Func_46981: ; 46981 (11:6981) Func_46981: ; 46981 (11:6981)
xor a xor a
ld [wd71e], a ld [wWhichDungeonWarp], a
ld a, [wd72d] ld a, [wd72d]
bit 4, a bit 4, a
ret nz ret nz
call ArePlayerCoordsInArray call ArePlayerCoordsInArray
ret nc ret nc
ld a, [wWhichTrade] ; wWhichTrade ld a, [wWhichTrade] ; wWhichTrade
ld [wd71e], a ld [wWhichDungeonWarp], a
ld hl, wd72d ld hl, wd72d
set 4, [hl] set 4, [hl]
ld hl, wd732 ld hl, wd732

View file

@ -34,7 +34,7 @@ PickupItem:
ld [wcc4d], a ld [wcc4d], a
predef HideObject predef HideObject
ld a, 1 ld a, 1
ld [wcc3c], a ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld hl, FoundItemText ld hl, FoundItemText
jr .print jr .print

View file

@ -1,48 +1,48 @@
HandleLedges: ; 1a672 (6:6672) HandleLedges: ; 1a672 (6:6672)
ld a, [wd736] ld a, [wd736]
bit 6, a bit 6, a ; already jumping down ledge
ret nz ret nz
ld a, [W_CURMAPTILESET] ; W_CURMAPTILESET ld a, [W_CURMAPTILESET] ; W_CURMAPTILESET
and a ; OVERWORLD and a ; OVERWORLD
ret nz ret nz
predef Func_c586 predef GetTileAndCoordsInFrontOfPlayer
ld a, [wSpriteStateData1 + 9] ld a, [wSpriteStateData1 + 9]
ld b, a ld b, a
aCoord 8, 9 aCoord 8, 9
ld c, a ld c, a
ld a, [wcfc6] ld a, [wTileInFrontOfPlayer]
ld d, a ld d, a
ld hl, LedgeTiles ; $66cf ld hl, LedgeTiles
.asm_1a691 .loop
ld a, [hli] ld a, [hli]
cp $ff cp $ff
ret z ret z
cp b cp b
jr nz, .asm_1a6a4 jr nz, .nextLedgeTile1
ld a, [hli] ld a, [hli]
cp c cp c
jr nz, .asm_1a6a5 jr nz, .nextLedgeTile2
ld a, [hli] ld a, [hli]
cp d cp d
jr nz, .asm_1a6a6 jr nz, .nextLedgeTile3
ld a, [hl] ld a, [hl]
ld e, a ld e, a
jr .asm_1a6a9 jr .foundMatch
.asm_1a6a4 .nextLedgeTile1
inc hl inc hl
.asm_1a6a5 .nextLedgeTile2
inc hl inc hl
.asm_1a6a6 .nextLedgeTile3
inc hl inc hl
jr .asm_1a691 jr .loop
.asm_1a6a9 .foundMatch
ld a, [hJoyHeld] ld a, [hJoyHeld]
and e and e
ret z ret z
ld a, $ff ld a, $ff
ld [wJoyIgnore], a ld [wJoyIgnore], a
ld hl, wd736 ld hl, wd736
set 6, [hl] set 6, [hl] ; jumping down ledge
call StartSimulatingJoypadStates call StartSimulatingJoypadStates
ld a, e ld a, e
ld [wSimulatedJoypadStatesEnd], a ld [wSimulatedJoypadStatesEnd], a
@ -56,24 +56,24 @@ HandleLedges: ; 1a672 (6:6672)
; (player direction) (tile player standing on) (ledge tile) (input required) ; (player direction) (tile player standing on) (ledge tile) (input required)
LedgeTiles: ; 1a6cf (6:66cf) LedgeTiles: ; 1a6cf (6:66cf)
db $00,$2C,$37,$80 db SPRITE_FACING_DOWN, $2C,$37,D_DOWN
db $00,$39,$36,$80 db SPRITE_FACING_DOWN, $39,$36,D_DOWN
db $00,$39,$37,$80 db SPRITE_FACING_DOWN, $39,$37,D_DOWN
db $08,$2C,$27,$20 db SPRITE_FACING_LEFT, $2C,$27,D_LEFT
db $08,$39,$27,$20 db SPRITE_FACING_LEFT, $39,$27,D_LEFT
db $0C,$2C,$0D,$10 db SPRITE_FACING_RIGHT,$2C,$0D,D_RIGHT
db $0C,$2C,$1D,$10 db SPRITE_FACING_RIGHT,$2C,$1D,D_RIGHT
db $0C,$39,$0D,$10 db SPRITE_FACING_RIGHT,$39,$0D,D_RIGHT
db $FF db $FF
LoadHoppingShadowOAM: ; 1a6f0 (6:66f0) LoadHoppingShadowOAM: ; 1a6f0 (6:66f0)
ld hl, vChars1 + $7f0 ld hl, vChars1 + $7f0
ld de, LedgeHoppingShadow ; $6708 ld de, LedgeHoppingShadow
ld bc, (BANK(LedgeHoppingShadow) << 8) + $01 ld bc, (BANK(LedgeHoppingShadow) << 8) + $01
call CopyVideoDataDouble call CopyVideoDataDouble
ld a, $9 ld a, $9
ld bc, $5448 ; b, c = y, x coordinates of shadow ld bc, $5448 ; b, c = y, x coordinates of shadow
ld de, LedgeHoppingShadowOAM ; $6710 ld de, LedgeHoppingShadowOAM
call WriteOAMBlock call WriteOAMBlock
ret ret

View file

@ -1,7 +1,7 @@
PlayerStepOutFromDoor: ; 1a3e0 (6:63e0) PlayerStepOutFromDoor: ; 1a3e0 (6:63e0)
ld hl, wd730 ld hl, wd730
res 1, [hl] res 1, [hl]
call IsPlayerStandingOnDoor call IsPlayerStandingOnDoorTile
jr nc, .notStandingOnDoor jr nc, .notStandingOnDoor
ld a, $fc ld a, $fc
ld [wJoyIgnore], a ld [wJoyIgnore], a
@ -62,7 +62,7 @@ Func_1a44c: ; 1a44c (6:644c)
ld a, $80 ld a, $80
call FillMemory call FillMemory
ld [hl], $ff ld [hl], $ff
ld a, [wcf13] ld a, [wSpriteIndex]
ld [H_DOWNARROWBLINKCNT2], a ; $ff8c ld [H_DOWNARROWBLINKCNT2], a ; $ff8c
ld de, wNPCMovementDirections2 ld de, wNPCMovementDirections2
call MoveSprite call MoveSprite
@ -100,18 +100,18 @@ Func_1a4a1: ; 1a4a1 (6:64a1)
Func_1a4a6: ; 1a4a6 (6:64a6) Func_1a4a6: ; 1a4a6 (6:64a6)
xor a xor a
ld [wOverrideSimulatedJoypadStatesMask], a ld [wOverrideSimulatedJoypadStatesMask], a
ld a, [wcf13] ld a, [wSpriteIndex]
swap a swap a
ld [wNPCMovementScriptSpriteOffset], a ld [wNPCMovementScriptSpriteOffset], a
xor a xor a
ld [wSpriteStateData2 + $06], a ld [wSpriteStateData2 + $06], a
ld hl, wSimulatedJoypadStatesEnd ld hl, wSimulatedJoypadStatesEnd
ld de, RLEList_1a4e9 ld de, RLEList_PlayerWalkToLab
call DecodeRLEList call DecodeRLEList
dec a dec a
ld [wSimulatedJoypadStatesIndex], a ld [wSimulatedJoypadStatesIndex], a
ld hl, wNPCMovementDirections2 ld hl, wNPCMovementDirections2
ld de, RLEList_1a4dc ld de, RLEList_ProfOakWalkToLab
call DecodeRLEList call DecodeRLEList
ld hl, wd72e ld hl, wd72e
res 7, [hl] res 7, [hl]
@ -121,7 +121,7 @@ Func_1a4a6: ; 1a4a6 (6:64a6)
ld [wNPCMovementScriptFunctionNum], a ld [wNPCMovementScriptFunctionNum], a
ret ret
RLEList_1a4dc: ; 1a4dc (6:64dc) RLEList_ProfOakWalkToLab: ; 1a4dc (6:64dc)
db $00, $05 db $00, $05
db $80, $01 db $80, $01
db $00, $05 db $00, $05
@ -130,7 +130,7 @@ RLEList_1a4dc: ; 1a4dc (6:64dc)
db $E0, $01 db $E0, $01
db $FF db $FF
RLEList_1a4e9: ; 1a4e9 (6:64e9) RLEList_PlayerWalkToLab: ; 1a4e9 (6:64e9)
db D_UP, $02 db D_UP, $02
db D_RIGHT, $03 db D_RIGHT, $03
db D_DOWN, $05 db D_DOWN, $05
@ -162,7 +162,7 @@ Func_1a514: ; 1a514 (6:6514)
ld a, MUSIC_MUSEUM_GUY ld a, MUSIC_MUSEUM_GUY
ld [wc0ee], a ld [wc0ee], a
call PlaySound call PlaySound
ld a, [wcf13] ld a, [wSpriteIndex]
swap a swap a
ld [wNPCMovementScriptSpriteOffset], a ld [wNPCMovementScriptSpriteOffset], a
call StartSimulatingJoypadStates call StartSimulatingJoypadStates
@ -218,7 +218,7 @@ Func_1a581: ; 1a581 (6:6581)
ld a, MUSIC_MUSEUM_GUY ld a, MUSIC_MUSEUM_GUY
ld [wc0ee], a ld [wc0ee], a
call PlaySound call PlaySound
ld a, [wcf13] ld a, [wSpriteIndex]
swap a swap a
ld [wNPCMovementScriptSpriteOffset], a ld [wNPCMovementScriptSpriteOffset], a
xor a xor a
@ -276,7 +276,7 @@ Func_1a5e7: ; 1a5e7 (6:65e7)
ret z ret z
jr .loop jr .loop
.notRival .notRival
ld a, [wcf13] ld a, [wSpriteIndex]
ld [H_DOWNARROWBLINKCNT2], a ; $ff8c ld [H_DOWNARROWBLINKCNT2], a ; $ff8c
jp SetSpriteMovementBytesToFF jp SetSpriteMovementBytesToFF

View file

@ -2,13 +2,13 @@ PrepareOAMData:
; Determine OAM data for currently visible ; Determine OAM data for currently visible
; sprites and write it to wOAMBuffer. ; sprites and write it to wOAMBuffer.
ld a, [wcfcb] ld a, [wUpdateSpritesEnabled]
dec a dec a
jr z, .asm_4b1e jr z, .asm_4b1e
cp 0 - 1 cp 0 - 1
ret nz ret nz
ld [wcfcb], a ld [wUpdateSpritesEnabled], a
jp HideSprites jp HideSprites
.asm_4b1e .asm_4b1e

View file

@ -1,66 +1,67 @@
Func_70510: ; 70510 (1c:4510) EnterMapAnim: ; 70510 (1c:4510)
call Func_706ef call InitFacingDirectionBuffer
ld a, $ec ld a, $ec
ld [wSpriteStateData1 + 4], a ld [wSpriteStateData1 + 4], a ; player's sprite Y screen position
call Delay3 call Delay3
push hl push hl
call GBFadeIn2 call GBFadeInFromWhite
ld hl, W_FLAGS_D733 ld hl, W_FLAGS_D733
bit 7, [hl] bit 7, [hl] ; used fly out of battle?
res 7, [hl] res 7, [hl]
jr nz, .asm_70568 jr nz, .flyAnimation
ld a, (SFX_02_4c - SFX_Headers_02) / 3 ld a, (SFX_02_4c - SFX_Headers_02) / 3
call PlaySound call PlaySound
ld hl, wd732 ld hl, wd732
bit 4, [hl] bit 4, [hl] ; used dungeon warp?
res 4, [hl] res 4, [hl]
pop hl pop hl
jr nz, .asm_7055e jr nz, .dungeonWarpAnimation
call Func_705aa call PlayerSpinWhileMovingDown
ld a, (SFX_02_4f - SFX_Headers_02) / 3 ld a, (SFX_02_4f - SFX_Headers_02) / 3
call PlaySound call PlaySound
call Func_70787 call IsPlayerStandingOnWarpPadOrHole
ld a, b ld a, b
and a and a
jr nz, .asm_7055b jr nz, .done
ld hl, wWhichTrade ; wWhichTrade ; if the player is not standing on a warp pad or hole
ld hl, wPlayerSpinInPlaceAnimFrameDelay
xor a xor a
ld [hli], a ld [hli], a ; wPlayerSpinInPlaceAnimFrameDelay
inc a inc a
ld [hli], a ld [hli], a ; wPlayerSpinInPlaceAnimFrameDelayDelta
ld a, $8 ld a, $8
ld [hli], a ld [hli], a ; wPlayerSpinInPlaceAnimFrameDelayEndValue
ld [hl], $ff ld [hl], $ff ; wPlayerSpinInPlaceAnimSoundID
ld hl, wcd48 ld hl, wcd48
call Func_70730 call PlayerSpinInPlace
.asm_70558 .restoreDefaultMusic
call PlayDefaultMusic call PlayDefaultMusic
.asm_7055b .done
jp Func_70772 jp RestoreFacingDirectionAndYScreenPos
.asm_7055e .dungeonWarpAnimation
ld c, $32 ld c, 50
call DelayFrames call DelayFrames
call Func_705aa call PlayerSpinWhileMovingDown
jr .asm_7055b jr .done
.asm_70568 .flyAnimation
pop hl pop hl
ld de, BirdSprite ; $4d80 ld de, BirdSprite
ld hl, vNPCSprites ld hl, vNPCSprites
ld bc, (BANK(BirdSprite) << 8) + $0c ld bc, (BANK(BirdSprite) << 8) + $0c
call CopyVideoData call CopyVideoData
call Func_706d7 call LoadBirdSpriteGraphics
ld a, (SFX_02_50 - SFX_Headers_02) / 3 ld a, (SFX_02_50 - SFX_Headers_02) / 3
call PlaySound call PlaySound
ld hl, wWhichTrade ; wWhichTrade ld hl, wFlyAnimUsingCoordList
xor a xor a ; is using coord list
ld [hli], a ld [hli], a ; wFlyAnimUsingCoordList
ld a, $c ld a, 12
ld [hli], a ld [hli], a ; wFlyAnimCounter
ld [hl], $8 ld [hl], $8 ; wFlyAnimBirdSpriteImageIndex (facing right)
ld de, FlyAnimationEnterScreenCoords ; $4592 ld de, FlyAnimationEnterScreenCoords ; $4592
call Func_706ae call DoFlyAnimation
call LoadPlayerSpriteGraphics call LoadPlayerSpriteGraphics
jr .asm_70558 jr .restoreDefaultMusic
FlyAnimationEnterScreenCoords: ; 70592 (1c:4592) FlyAnimationEnterScreenCoords: ; 70592 (1c:4592)
; y, x pairs ; y, x pairs
@ -79,90 +80,92 @@ FlyAnimationEnterScreenCoords: ; 70592 (1c:4592)
db $3C, $48 db $3C, $48
db $3C, $40 db $3C, $40
Func_705aa: ; 705aa (1c:45aa) PlayerSpinWhileMovingDown: ; 705aa (1c:45aa)
ld hl, wWhichTrade ; wWhichTrade ld hl, wPlayerSpinWhileMovingUpOrDownAnimDeltaY
ld a, $10 ld a, $10
ld [hli], a ld [hli], a ; wPlayerSpinWhileMovingUpOrDownAnimDeltaY
ld a, $3c ld a, $3c
ld [hli], a ld [hli], a ; wPlayerSpinWhileMovingUpOrDownAnimMaxY
call Func_7077f call GetPlayerTeleportAnimFrameDelay
ld [hl], a ld [hl], a ; wPlayerSpinWhileMovingUpOrDownAnimFrameDelay
jp Func_70755 jp PlayerSpinWhileMovingUpOrDown
_LeaveMapAnim: ; 705ba (1c:45ba) _LeaveMapAnim: ; 705ba (1c:45ba)
call Func_706ef call InitFacingDirectionBuffer
call Func_70787 call IsPlayerStandingOnWarpPadOrHole
ld a, b ld a, b
and a and a
jr z, .asm_705ef jr z, .playerNotStandingOnWarpPadOrHole
dec a dec a
jp nz, Func_7067d jp nz, LeaveMapThroughHoleAnim
.asm_705c8 .spinWhileMovingUp
ld a, (SFX_02_4b - SFX_Headers_02) / 3 ld a, (SFX_02_4b - SFX_Headers_02) / 3
call PlaySound call PlaySound
ld hl, wWhichTrade ; wWhichTrade ld hl, wPlayerSpinWhileMovingUpOrDownAnimDeltaY
ld a, $f0 ld a, -$10
ld [hli], a ld [hli], a ; wPlayerSpinWhileMovingUpOrDownAnimDeltaY
ld a, $ec ld a, $ec
ld [hli], a ld [hli], a ; wPlayerSpinWhileMovingUpOrDownAnimMaxY
call Func_7077f call GetPlayerTeleportAnimFrameDelay
ld [hl], a ld [hl], a ; wPlayerSpinWhileMovingUpOrDownAnimFrameDelay
call Func_70755 call PlayerSpinWhileMovingUpOrDown
call Func_70787 call IsPlayerStandingOnWarpPadOrHole
ld a, b ld a, b
dec a dec a
jr z, .asm_705e9 jr z, .playerStandingOnWarpPad
ld c, $a ; if not standing on a warp pad, there is an extra delay
ld c, 10
call DelayFrames call DelayFrames
.asm_705e9 .playerStandingOnWarpPad
call GBFadeOut2 call GBFadeOutToWhite
jp Func_70772 jp RestoreFacingDirectionAndYScreenPos
.asm_705ef .playerNotStandingOnWarpPadOrHole
ld a, $4 ld a, $4
call StopMusic call StopMusic
ld a, [wd732] ld a, [wd732]
bit 6, a bit 6, a ; is the last used pokemon center the destination?
jr z, .asm_70610 jr z, .flyAnimation
ld hl, wWhichTrade ; wWhichTrade ; if going to the last used pokemon center
ld a, $10 ld hl, wPlayerSpinInPlaceAnimFrameDelay
ld [hli], a ld a, 16
ld a, $ff ld [hli], a ; wPlayerSpinInPlaceAnimFrameDelay
ld [hli], a ld a, -1
ld [hli], a ; wPlayerSpinInPlaceAnimFrameDelayDelta
xor a xor a
ld [hli], a ld [hli], a ; wPlayerSpinInPlaceAnimFrameDelayEndValue
ld [hl], $a1 ld [hl], $a1 ; wPlayerSpinInPlaceAnimSoundID
ld hl, wcd48 ld hl, wcd48
call Func_70730 call PlayerSpinInPlace
jr .asm_705c8 jr .spinWhileMovingUp
.asm_70610 .flyAnimation
call Func_706d7 call LoadBirdSpriteGraphics
ld hl, wWhichTrade ; wWhichTrade ld hl, wFlyAnimUsingCoordList
ld a, $ff ld a, $ff ; is not using coord list (flap in place)
ld [hli], a ld [hli], a ; wFlyAnimUsingCoordList
ld a, $8 ld a, 8
ld [hli], a ld [hli], a ; wFlyAnimCounter
ld [hl], $c ld [hl], $c ; wFlyAnimBirdSpriteImageIndex
call Func_706ae call DoFlyAnimation
ld a, (SFX_02_50 - SFX_Headers_02) / 3 ld a, (SFX_02_50 - SFX_Headers_02) / 3
call PlaySound call PlaySound
ld hl, wWhichTrade ; wWhichTrade ld hl, wFlyAnimUsingCoordList
xor a xor a ; is using coord list
ld [hli], a ld [hli], a ; wFlyAnimUsingCoordList
ld a, $c ld a, $c
ld [hli], a ld [hli], a ; wFlyAnimCounter
ld [hl], $c ld [hl], $c ; wFlyAnimBirdSpriteImageIndex (facing right)
ld de, FlyAnimationScreenCoords1 ; $464f ld de, FlyAnimationScreenCoords1 ; $464f
call Func_706ae call DoFlyAnimation
ld c, $28 ld c, 40
call DelayFrames call DelayFrames
ld hl, wTrainerEngageDistance ld hl, wFlyAnimCounter
ld a, $b ld a, 11
ld [hli], a ld [hli], a ; wFlyAnimCounter
ld [hl], $8 ld [hl], $8 ; wFlyAnimBirdSpriteImageIndex (facing left)
ld de, FlyAnimationScreenCoords2 ; $4667 ld de, FlyAnimationScreenCoords2 ; $4667
call Func_706ae call DoFlyAnimation
call GBFadeOut2 call GBFadeOutToWhite
jp Func_70772 jp RestoreFacingDirectionAndYScreenPos
FlyAnimationScreenCoords1: ; 7064f (1c:464f) FlyAnimationScreenCoords1: ; 7064f (1c:464f)
; y, x pairs ; y, x pairs
@ -198,33 +201,35 @@ FlyAnimationScreenCoords2: ; 70667 (1c:4667)
db $F0, $00 db $F0, $00
Func_7067d: ; 7067d (1c:467d) LeaveMapThroughHoleAnim: ; 7067d (1c:467d)
ld a, $ff ld a, $ff
ld [wcfcb], a ld [wUpdateSpritesEnabled], a ; disable UpdateSprites
ld a, [wOAMBuffer + $02] ; shift upper half of player's sprite down 8 pixels and hide lower half
ld [wOAMBuffer + $0a], a ld a, [wOAMBuffer + 0 * 4 + 2]
ld a, [wOAMBuffer + $06] ld [wOAMBuffer + 2 * 4 + 2], a
ld [wOAMBuffer + $0e], a ld a, [wOAMBuffer + 1 * 4 + 2]
ld [wOAMBuffer + 3 * 4 + 2], a
ld a, $a0 ld a, $a0
ld [wOAMBuffer], a ld [wOAMBuffer + 0 * 4], a
ld [wOAMBuffer + $04], a ld [wOAMBuffer + 1 * 4], a
ld c, $2 ld c, 2
call DelayFrames call DelayFrames
; hide lower half of player's sprite
ld a, $a0 ld a, $a0
ld [wOAMBuffer + $08], a ld [wOAMBuffer + 2 * 4], a
ld [wOAMBuffer + $0c], a ld [wOAMBuffer + 3 * 4], a
call GBFadeOut2 call GBFadeOutToWhite
ld a, $1 ld a, $1
ld [wcfcb], a ld [wUpdateSpritesEnabled], a ; enable UpdateSprites
jp Func_70772 jp RestoreFacingDirectionAndYScreenPos
Func_706ae: ; 706ae (1c:46ae) DoFlyAnimation: ; 706ae (1c:46ae)
ld a, [wTrainerFacingDirection] ld a, [wFlyAnimBirdSpriteImageIndex]
xor $1 xor $1 ; make the bird flap its wings
ld [wTrainerFacingDirection], a ld [wFlyAnimBirdSpriteImageIndex], a
ld [wSpriteStateData1 + 2], a ld [wSpriteStateData1 + 2], a
call Delay3 call Delay3
ld a, [wWhichTrade] ; wWhichTrade ld a, [wFlyAnimUsingCoordList]
cp $ff cp $ff
jr z, .asm_706cd jr z, .asm_706cd
ld hl, wSpriteStateData1 + 4 ld hl, wSpriteStateData1 + 4
@ -236,13 +241,13 @@ Func_706ae: ; 706ae (1c:46ae)
inc de inc de
ld [hl], a ld [hl], a
.asm_706cd .asm_706cd
ld a, [wTrainerEngageDistance] ld a, [wFlyAnimCounter]
dec a dec a
ld [wTrainerEngageDistance], a ld [wFlyAnimCounter], a
jr nz, Func_706ae jr nz, DoFlyAnimation
ret ret
Func_706d7: ; 706d7 (1c:46d7) LoadBirdSpriteGraphics: ; 706d7 (1c:46d7)
ld de, BirdSprite ; $4d80 ld de, BirdSprite ; $4d80
ld hl, vNPCSprites ld hl, vNPCSprites
ld bc, (BANK(BirdSprite) << 8) + $0c ld bc, (BANK(BirdSprite) << 8) + $0c
@ -252,32 +257,32 @@ Func_706d7: ; 706d7 (1c:46d7)
ld bc, (BANK(BirdSprite) << 8) + $0c ld bc, (BANK(BirdSprite) << 8) + $0c
jp CopyVideoData jp CopyVideoData
Func_706ef: ; 706ef (1c:46ef) InitFacingDirectionBuffer: ; 706ef (1c:46ef)
ld a, [wSpriteStateData1 + 2] ld a, [wSpriteStateData1 + 2] ; player's sprite facing direction (image index is locked to standing images)
ld [wcd50], a ld [wcd50], a
ld a, [wSpriteStateData1 + 4] ld a, [wSpriteStateData1 + 4] ; player's sprite Y screen position
ld [wcd4f], a ld [wcd4f], a
ld hl, PlayerSpinningFacingOrder ; $4713 ld hl, PlayerSpinningFacingOrder
ld de, wcd48 ld de, wcd48
ld bc, $4 ld bc, $4
call CopyData call CopyData
ld a, [wSpriteStateData1 + 2] ld a, [wSpriteStateData1 + 2] ; player's sprite facing direction (image index is locked to standing images)
ld hl, wcd48 ld hl, wcd48
.asm_7070d .loop
cp [hl] cp [hl]
inc hl inc hl
jr nz, .asm_7070d jr nz, .loop
dec hl dec hl
ret ret
PlayerSpinningFacingOrder: ; 70713 (1c:4713) PlayerSpinningFacingOrder: ; 70713 (1c:4713)
; The order of the direction the player's sprite is facing when teleporting ; The order of the direction the player's sprite is facing when teleporting
; away. Creates a spinning effect. ; away. Creates a spinning effect.
db $00, $08, $04, $0C ; down, left, up, right db SPRITE_FACING_DOWN, SPRITE_FACING_LEFT, SPRITE_FACING_UP, SPRITE_FACING_RIGHT
Func_70717: ; 70717 (1c:4717) SpinPlayerSprite: ; 70717 (1c:4717)
ld a, [hl] ld a, [hl]
ld [wSpriteStateData1 + 2], a ld [wSpriteStateData1 + 2], a ; player's sprite facing direction (image index is locked to standing images)
push hl push hl
ld hl, wcd48 ld hl, wcd48
ld de, wcd47 ld de, wcd47
@ -288,84 +293,85 @@ Func_70717: ; 70717 (1c:4717)
pop hl pop hl
ret ret
Func_70730: ; 70730 (1c:4730) PlayerSpinInPlace: ; 70730 (1c:4730)
call Func_70717 call SpinPlayerSprite
ld a, [wWhichTrade] ; wWhichTrade ld a, [wPlayerSpinInPlaceAnimFrameDelay]
ld c, a ld c, a
and $3 and $3
jr nz, .asm_70743 jr nz, .asm_70743
ld a, [wTrainerScreenY] ld a, [wPlayerSpinInPlaceAnimSoundID]
cp $ff cp $ff
call nz, PlaySound call nz, PlaySound
.asm_70743 .asm_70743
ld a, [wTrainerEngageDistance] ld a, [wPlayerSpinInPlaceAnimFrameDelayDelta]
add c add c
ld [wWhichTrade], a ; wWhichTrade ld [wPlayerSpinInPlaceAnimFrameDelay], a
ld c, a ld c, a
ld a, [wTrainerFacingDirection] ld a, [wPlayerSpinInPlaceAnimFrameDelayEndValue]
cp c cp c
ret z ret z
call DelayFrames call DelayFrames
jr Func_70730 jr PlayerSpinInPlace
Func_70755: ; 70755 (1c:4755) PlayerSpinWhileMovingUpOrDown: ; 70755 (1c:4755)
call Func_70717 call SpinPlayerSprite
ld a, [wWhichTrade] ; wWhichTrade ld a, [wPlayerSpinWhileMovingUpOrDownAnimDeltaY]
ld c, a ld c, a
ld a, [wSpriteStateData1 + 4] ld a, [wSpriteStateData1 + 4] ; player's sprite Y screen position
add c add c
ld [wSpriteStateData1 + 4], a ld [wSpriteStateData1 + 4], a
ld c, a ld c, a
ld a, [wTrainerEngageDistance] ld a, [wPlayerSpinWhileMovingUpOrDownAnimMaxY]
cp c cp c
ret z ret z
ld a, [wTrainerFacingDirection] ld a, [wPlayerSpinWhileMovingUpOrDownAnimFrameDelay]
ld c, a ld c, a
call DelayFrames call DelayFrames
jr Func_70755 jr PlayerSpinWhileMovingUpOrDown
Func_70772: ; 70772 (1c:4772) RestoreFacingDirectionAndYScreenPos: ; 70772 (1c:4772)
ld a, [wcd4f] ld a, [wcd4f]
ld [wSpriteStateData1 + 4], a ld [wSpriteStateData1 + 4], a
ld a, [wcd50] ld a, [wcd50]
ld [wSpriteStateData1 + 2], a ld [wSpriteStateData1 + 2], a
ret ret
Func_7077f: ; 7077f (1c:477f) ; if SGB, 2 frames, else 3 frames
ld a, [wcf1b] GetPlayerTeleportAnimFrameDelay: ; 7077f (1c:477f)
ld a, [wOnSGB]
xor $1 xor $1
inc a inc a
inc a inc a
ret ret
Func_70787: ; 70787 (1c:4787) IsPlayerStandingOnWarpPadOrHole: ; 70787 (1c:4787)
ld b, 0 ld b, 0
ld hl, DataTable_707a9 ; $47a9 ld hl, .warpPadAndHoleData
ld a, [W_CURMAPTILESET] ; W_CURMAPTILESET ld a, [W_CURMAPTILESET]
ld c, a ld c, a
.asm_70790 .loop
ld a, [hli] ld a, [hli]
cp $ff cp $ff
jr z, .asm_707a4 jr z, .done
cp c cp c
jr nz, .asm_7079e jr nz, .nextEntry
aCoord 8, 9 aCoord 8, 9
cp [hl] cp [hl]
jr z, .asm_707a2 jr z, .foundMatch
.asm_7079e .nextEntry
inc hl inc hl
inc hl inc hl
jr .asm_70790 jr .loop
.asm_707a2 .foundMatch
inc hl inc hl
ld b, [hl] ld b, [hl]
.asm_707a4 .done
ld a, b ld a, b
ld [wcd5b], a ld [wcd5b], a
ret ret
; format: db tileset id, tile id, value to be put in wcd5b ; format: db tileset id, tile id, value to be put in wcd5b
DataTable_707a9: ; 707a9 (1c:47a9) .warpPadAndHoleData: ; 707a9 (1c:47a9)
db FACILITY, $20, 1 ; warp pad db FACILITY, $20, 1 ; warp pad
db FACILITY, $11, 2 ; hole db FACILITY, $11, 2 ; hole
db CAVERN, $22, 2 ; hole db CAVERN, $22, 2 ; hole
@ -454,7 +460,7 @@ ItsABiteText: ; 70851 (1c:4851)
db "@" db "@"
FishingRodGfxProperties: ; 70856 (1c:4856) FishingRodGfxProperties: ; 70856 (1c:4856)
; specicies how the fishing rod should be drawn on the screen ; specifies how the fishing rod should be drawn on the screen
; first byte = screen y coordinate ; first byte = screen y coordinate
; second byte = screen x coordinate ; second byte = screen x coordinate
; third byte = tile number ; third byte = tile number
@ -482,21 +488,21 @@ RedFishingTiles: ; 70866 (1c:4866)
dw vNPCSprites2 + $7d0 dw vNPCSprites2 + $7d0
_HandleMidJump: ; 7087e (1c:487e) _HandleMidJump: ; 7087e (1c:487e)
ld a, [wd714] ld a, [wPlayerJumpingYScreenCoordsIndex]
ld c, a ld c, a
inc a inc a
cp $10 cp $10
jr nc, .asm_70895 jr nc, .finishedJump
ld [wd714], a ld [wPlayerJumpingYScreenCoordsIndex], a
ld b, $0 ld b, 0
ld hl, PlayerJumpingYScreenCoords ; $48ba ld hl, PlayerJumpingYScreenCoords
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
ld [wSpriteStateData1 + 4], a ; player's sprite y coordinate ld [wSpriteStateData1 + 4], a ; player's sprite y coordinate
ret ret
.asm_70895 .finishedJump
ld a, [wWalkCounter] ; wcfc5 ld a, [wWalkCounter]
cp $0 cp 0
ret nz ret nz
call UpdateSprites call UpdateSprites
call Delay3 call Delay3
@ -504,11 +510,11 @@ _HandleMidJump: ; 7087e (1c:487e)
ld [hJoyHeld], a ld [hJoyHeld], a
ld [hJoyPressed], a ld [hJoyPressed], a
ld [hJoyReleased], a ld [hJoyReleased], a
ld [wd714], a ld [wPlayerJumpingYScreenCoordsIndex], a
ld hl, wd736 ld hl, wd736
res 6, [hl] res 6, [hl] ; not jumping down a ledge any more
ld hl, wd730 ld hl, wd730
res 7, [hl] res 7, [hl] ; not simulating joypad states any more
xor a xor a
ld [wJoyIgnore], a ld [wJoyIgnore], a
ret ret

View file

@ -203,7 +203,7 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20)
ld hl,PokemartThankYouText ld hl,PokemartThankYouText
call PrintText call PrintText
ld a,$01 ld a,$01
ld [wcfcb],a ld [wUpdateSpritesEnabled],a
call UpdateSprites ; move sprites call UpdateSprites ; move sprites
ld a,[wd07e] ld a,[wd07e]
ld [wListScrollOffset],a ld [wListScrollOffset],a

View file

@ -1,10 +1,10 @@
AnimateBoulderDust: ; 79f54 (1e:5f54) AnimateBoulderDust: ; 79f54 (1e:5f54)
ld a, $1 ld a, $1
ld [wcd50], a ; select the boulder dust offsets ld [wcd50], a ; select the boulder dust offsets
ld a, [wcfcb] ld a, [wUpdateSpritesEnabled]
push af push af
ld a, $ff ld a, $ff
ld [wcfcb], a ld [wUpdateSpritesEnabled], a
ld a, %11100100 ld a, %11100100
ld [rOBP1], a ld [rOBP1], a
call LoadSmokeTileFourTimes call LoadSmokeTileFourTimes
@ -26,7 +26,7 @@ AnimateBoulderDust: ; 79f54 (1e:5f54)
dec c dec c
jr nz, .loop jr nz, .loop
pop af pop af
ld [wcfcb], a ld [wUpdateSpritesEnabled], a
jp LoadPlayerSpriteGraphics jp LoadPlayerSpriteGraphics
GetMoveBoulderDustFunctionPointer: ; 79f92 (1e:5f92) GetMoveBoulderDustFunctionPointer: ; 79f92 (1e:5f92)

View file

@ -1,7 +1,7 @@
_GetSpritePosition1: ; 567f9 (15:67f9) _GetSpritePosition1: ; 567f9 (15:67f9)
ld hl, wSpriteStateData1 ld hl, wSpriteStateData1
ld de, $4 ld de, $4
ld a, [wcf13] ld a, [wSpriteIndex]
ld [H_SPRITEINDEX], a ld [H_SPRITEINDEX], a
call GetSpriteDataPointer call GetSpriteDataPointer
ld a, [hli] ld a, [hli]
@ -20,7 +20,7 @@ _GetSpritePosition1: ; 567f9 (15:67f9)
_GetSpritePosition2: ; 56819 (15:6819) _GetSpritePosition2: ; 56819 (15:6819)
ld hl, wSpriteStateData1 ld hl, wSpriteStateData1
ld de, $4 ld de, $4
ld a, [wcf13] ld a, [wSpriteIndex]
ld [H_SPRITEINDEX], a ld [H_SPRITEINDEX], a
call GetSpriteDataPointer call GetSpriteDataPointer
ld a, [hli] ; c1x4 (screen Y pos) ld a, [hli] ; c1x4 (screen Y pos)
@ -39,7 +39,7 @@ _GetSpritePosition2: ; 56819 (15:6819)
_SetSpritePosition1: ; 5683d (15:683d) _SetSpritePosition1: ; 5683d (15:683d)
ld hl, wSpriteStateData1 ld hl, wSpriteStateData1
ld de, $4 ld de, $4
ld a, [wcf13] ld a, [wSpriteIndex]
ld [H_SPRITEINDEX], a ld [H_SPRITEINDEX], a
call GetSpriteDataPointer call GetSpriteDataPointer
ld a, [$ffeb] ; c1x4 (screen Y pos) ld a, [$ffeb] ; c1x4 (screen Y pos)
@ -58,7 +58,7 @@ _SetSpritePosition1: ; 5683d (15:683d)
_SetSpritePosition2: ; 5685d (15:685d) _SetSpritePosition2: ; 5685d (15:685d)
ld hl, wSpriteStateData1 ld hl, wSpriteStateData1
ld de, $0004 ld de, $0004
ld a, [wcf13] ld a, [wSpriteIndex]
ld [H_SPRITEINDEX], a ld [H_SPRITEINDEX], a
call GetSpriteDataPointer call GetSpriteDataPointer
ld a, [wd130] ld a, [wd130]
@ -75,7 +75,7 @@ _SetSpritePosition2: ; 5685d (15:685d)
ret ret
TrainerWalkUpToPlayer: ; 56881 (15:6881) TrainerWalkUpToPlayer: ; 56881 (15:6881)
ld a, [wcf13] ld a, [wSpriteIndex]
swap a swap a
ld [wTrainerSpriteOffset], a ; wWhichTrade ld [wTrainerSpriteOffset], a ; wWhichTrade
call ReadTrainerScreenPosition call ReadTrainerScreenPosition
@ -143,7 +143,7 @@ TrainerWalkUpToPlayer: ; 56881 (15:6881)
ld de, wNPCMovementDirections2 ld de, wNPCMovementDirections2
call FillMemory ; write the necessary steps to reach player call FillMemory ; write the necessary steps to reach player
ld [hl], $ff ; write end of list sentinel ld [hl], $ff ; write end of list sentinel
ld a, [wcf13] ld a, [wSpriteIndex]
ld [H_SPRITEINDEX], a ld [H_SPRITEINDEX], a
jp MoveSprite_ jp MoveSprite_

View file

@ -380,11 +380,11 @@ SendSGBPacket: ; 71feb (1c:5feb)
LoadSGB: ; 7202b (1c:602b) LoadSGB: ; 7202b (1c:602b)
xor a xor a
ld [wcf1b], a ld [wOnSGB], a
call Func_7209b call Func_7209b
ret nc ret nc
ld a, $1 ld a, $1
ld [wcf1b], a ld [wOnSGB], a
ld a, [wGBC] ld a, [wGBC]
and a and a
jr z, .asm_7203f jr z, .asm_7203f

View file

@ -71,19 +71,19 @@ PredefPointers:: ; 4fe79 (13:7e79)
add_predef FlagActionPredef add_predef FlagActionPredef
add_predef HideObject add_predef HideObject
add_predef IsObjectHidden add_predef IsObjectHidden
add_predef Func_c69c add_predef ApplyOutOfBattlePoisonDamage
add_predef AnyPartyAlive add_predef AnyPartyAlive
add_predef ShowObject add_predef ShowObject
add_predef ShowObject2 add_predef ShowObject2
add_predef Func_ee9e add_predef Func_ee9e
add_predef InitPlayerData2 add_predef InitPlayerData2
add_predef Func_c754 add_predef LoadTilesetHeader
add_predef LearnMoveFromLevelUp add_predef LearnMoveFromLevelUp
add_predef LearnMove add_predef LearnMove
add_predef IsItemInBag_ ; 1C, used in Pokémon Tower add_predef IsItemInBag_ ; 1C, used in Pokémon Tower
dbw $03,Func_3eb5 ; for these two, the bank number is actually 0 dbw $03,Func_3eb5 ; for these two, the bank number is actually 0
dbw $03,GiveItem dbw $03,GiveItem
add_predef Func_480eb add_predef ChangeBGPalColor0_4Frames
add_predef FindPathToPlayer add_predef FindPathToPlayer
add_predef Func_480ff add_predef Func_480ff
add_predef CalcPositionOfPlayerRelativeToNPC add_predef CalcPositionOfPlayerRelativeToNPC
@ -105,7 +105,7 @@ PredefPointers:: ; 4fe79 (13:7e79)
add_predef PlayIntro add_predef PlayIntro
add_predef Func_79869 add_predef Func_79869
add_predef FlashScreen add_predef FlashScreen
add_predef Func_c586 add_predef GetTileAndCoordsInFrontOfPlayer
add_predef StatusScreen add_predef StatusScreen
add_predef StatusScreen2 add_predef StatusScreen2
add_predef Func_410e2 add_predef Func_410e2
@ -140,9 +140,9 @@ PredefPointers:: ; 4fe79 (13:7e79)
add_predef HallOfFamePC add_predef HallOfFamePC
add_predef DisplayDexRating add_predef DisplayDexRating
dbw $1E, _LeaveMapAnim ; wrong bank dbw $1E, _LeaveMapAnim ; wrong bank
dbw $1E, Func_70510 ; wrong bank dbw $1E, EnterMapAnim ; wrong bank
add_predef Func_c5be add_predef GetTileTwoStepsInFrontOfPlayer
add_predef Func_c60b add_predef CheckForCollisionWhenPushingBoulder
add_predef PrintStrengthTxt add_predef PrintStrengthTxt
add_predef PickupItem add_predef PickupItem
add_predef Func_27d98 add_predef Func_27d98

View file

@ -1,13 +1,14 @@
Func_480eb: ; 480eb (12:40eb) ; b = new colour for BG colour 0 (usually white) for 4 frames
ChangeBGPalColor0_4Frames: ; 480eb (12:40eb)
call GetPredefRegisters call GetPredefRegisters
ld a, [rBGP] ; $ff47 ld a, [rBGP]
or b or b
ld [rBGP], a ; $ff47 ld [rBGP], a
ld c, $4 ld c, $4
call DelayFrames call DelayFrames
ld a, [rBGP] ; $ff47 ld a, [rBGP]
and $fc and %11111100
ld [rBGP], a ; $ff47 ld [rBGP], a
ret ret
Func_480ff: ; 480ff (12:40ff) Func_480ff: ; 480ff (12:40ff)

View file

@ -31,7 +31,7 @@ Func_1c9c6: ; 1c9c6 (7:49c6)
ld b, a ld b, a
ld a, [hl] ld a, [hl]
ld c, a ld c, a
ld hl, wd3af ld hl, wWarpEntries
call Func_1ca0d call Func_1ca0d
Func_1ca0d: ; 1ca0d (7:4a0d) Func_1ca0d: ; 1ca0d (7:4a0d)

View file

@ -1,7 +1,7 @@
PromptUserToPlaySlots: ; 3730e (d:730e) PromptUserToPlaySlots: ; 3730e (d:730e)
call SaveScreenTilesToBuffer2 call SaveScreenTilesToBuffer2
ld a, BANK(DisplayTextIDInit) ld a, BANK(DisplayTextIDInit)
ld [wcf0c], a ld [wAutoTextBoxDrawingControl], a
ld b, a ld b, a
ld hl, DisplayTextIDInit ld hl, DisplayTextIDInit
call Bankswitch call Bankswitch
@ -12,7 +12,7 @@ PromptUserToPlaySlots: ; 3730e (d:730e)
and a and a
jr nz, .skip jr nz, .skip
dec a dec a
ld [wcfcb], a ld [wUpdateSpritesEnabled], a
ld hl, wcd4f ld hl, wcd4f
xor a xor a
ld [hli], a ld [hli], a
@ -40,7 +40,7 @@ PromptUserToPlaySlots: ; 3730e (d:730e)
ld [W_SUBANIMSUBENTRYADDR], a ld [W_SUBANIMSUBENTRYADDR], a
call GBPalWhiteOutWithDelay3 call GBPalWhiteOutWithDelay3
ld a, $1 ld a, $1
ld [wcfcb], a ld [wUpdateSpritesEnabled], a
call GoPAL_SET_CF1C call GoPAL_SET_CF1C
call ReloadMapSpriteTilePatterns call ReloadMapSpriteTilePatterns
call ReloadTilesetTilePatterns call ReloadTilesetTilePatterns
@ -221,7 +221,7 @@ SlotMachine_374ad: ; 374ad (d:74ad)
call SlotMachine_374fb call SlotMachine_374fb
call SlotMachine_37517 call SlotMachine_37517
ret c ret c
ld a, [wcf1b] ld a, [wOnSGB]
xor $1 xor $1
inc a inc a
ld c, a ld c, a

View file

@ -1,6 +1,6 @@
DisplayTownMap: ; 70e3e (1c:4e3e) DisplayTownMap: ; 70e3e (1c:4e3e)
call LoadTownMap call LoadTownMap
ld hl, wcfcb ld hl, wUpdateSpritesEnabled
ld a, [hl] ld a, [hl]
push af push af
ld [hl], $ff ld [hl], $ff
@ -111,7 +111,7 @@ TownMapCursor: ; 70f40 (1c:4f40)
LoadTownMap_Nest: ; 70f60 (1c:4f60) LoadTownMap_Nest: ; 70f60 (1c:4f60)
call LoadTownMap call LoadTownMap
ld hl, wcfcb ld hl, wUpdateSpritesEnabled
ld a, [hl] ld a, [hl]
push af push af
ld [hl], $ff ld [hl], $ff
@ -148,7 +148,7 @@ LoadTownMap_Fly: ; 70f90 (1c:4f90)
ld bc, (BANK(TownMapUpArrow) << 8) + $01 ld bc, (BANK(TownMapUpArrow) << 8) + $01
call CopyVideoDataDouble call CopyVideoDataDouble
call Func_71070 call Func_71070
ld hl, wcfcb ld hl, wUpdateSpritesEnabled
ld a, [hl] ld a, [hl]
push af push af
ld [hl], $ff ld [hl], $ff
@ -206,7 +206,7 @@ LoadTownMap_Fly: ; 70f90 (1c:4f90)
ld a, (SFX_02_3e - SFX_Headers_02) / 3 ld a, (SFX_02_3e - SFX_Headers_02) / 3
call PlaySound call PlaySound
ld a, [hl] ld a, [hl]
ld [wd71a], a ld [wDestinationMap], a
ld hl, wd732 ld hl, wd732
set 3, [hl] set 3, [hl]
inc hl inc hl

View file

@ -119,10 +119,10 @@ LoadTradingGFXAndMonNames: ; 411a1 (10:51a1)
call FillMemory call FillMemory
call ClearSprites call ClearSprites
ld a, $ff ld a, $ff
ld [wcfcb], a ld [wUpdateSpritesEnabled], a
ld hl, wd730 ld hl, wd730
set 6, [hl] set 6, [hl]
ld a, [wcf1b] ld a, [wOnSGB]
and a and a
ld a, $e4 ld a, $e4
jr z, .asm_411e5 jr z, .asm_411e5

View file

@ -173,7 +173,7 @@ LoadDestinationWarpPosition:: ; 1313 (0:1313)
ld b,0 ld b,0
add hl,bc add hl,bc
ld bc,4 ld bc,4
ld de,wd35f ld de,wCurrentTileBlockMapViewPointer
call CopyData call CopyData
pop af pop af
ld [H_LOADEDROMBANK],a ld [H_LOADEDROMBANK],a
@ -1464,7 +1464,7 @@ INCLUDE "home/audio.asm"
UpdateSprites:: ; 2429 (0:2429) UpdateSprites:: ; 2429 (0:2429)
ld a, [wcfcb] ld a, [wUpdateSpritesEnabled]
dec a dec a
ret nz ret nz
ld a, [H_LOADEDROMBANK] ld a, [H_LOADEDROMBANK]
@ -1607,18 +1607,18 @@ DisplayTextID:: ; 2920 (0:2920)
ld l,a ; hl = map text pointer ld l,a ; hl = map text pointer
ld d,$00 ld d,$00
ld a,[$ff8c] ; text ID ld a,[$ff8c] ; text ID
ld [wcf13],a ld [wSpriteIndex],a
and a and a
jp z,DisplayStartMenu jp z,DisplayStartMenu
cp a,$d3 ; safari game over cp a,$d3
jp z,DisplaySafariGameOverText jp z,DisplaySafariGameOverText
cp a,$d0 ; fainted cp a,$d0
jp z,DisplayPokemonFaintedText jp z,DisplayPokemonFaintedText
cp a,$d1 ; blacked out cp a,$d1
jp z,DisplayPlayerBlackedOutText jp z,DisplayPlayerBlackedOutText
cp a,$d2 ; repel wore off cp a,$d2
jp z,DisplayRepelWoreOffText jp z,DisplayRepelWoreOffText
ld a,[W_NUMSPRITES] ; number of sprites ld a,[W_NUMSPRITES]
ld e,a ld e,a
ld a,[$ff8c] ; sprite ID ld a,[$ff8c] ; sprite ID
cp e cp e
@ -1678,7 +1678,7 @@ DisplayTextID:: ; 2920 (0:2920)
jr AfterDisplayingTextID jr AfterDisplayingTextID
.notSpecialCase .notSpecialCase
call Func_3c59 ; display the text call Func_3c59 ; display the text
ld a,[wcc3c] ld a,[wDoNotWaitForButtonPressAfterDisplayingText]
and a and a
jr nz,HoldTextDisplayOpen jr nz,HoldTextDisplayOpen
@ -1723,13 +1723,13 @@ CloseTextDisplay:: ; 29e8 (0:29e8)
ld hl,wcfc4 ld hl,wcfc4
res 0,[hl] res 0,[hl]
ld a,[wd732] ld a,[wd732]
bit 3,a bit 3,a ; used fly warp
call z,LoadPlayerSpriteGraphics call z,LoadPlayerSpriteGraphics
call LoadCurrentMapView call LoadCurrentMapView
pop af pop af
ld [H_LOADEDROMBANK],a ld [H_LOADEDROMBANK],a
ld [$2000],a ld [$2000],a
jp UpdateSprites ; move sprites jp UpdateSprites
DisplayPokemartDialogue:: ; 2a2e (0:2a2e) DisplayPokemartDialogue:: ; 2a2e (0:2a2e)
push hl push hl
@ -1757,7 +1757,7 @@ PokemartGreetingText:: ; 2a55 (0:2a55)
LoadItemList:: ; 2a5a (0:2a5a) LoadItemList:: ; 2a5a (0:2a5a)
ld a,$01 ld a,$01
ld [wcfcb],a ld [wUpdateSpritesEnabled],a
ld a,h ld a,h
ld [wd128],a ld [wd128],a
ld a,l ld a,l
@ -1805,7 +1805,7 @@ DisplayPlayerBlackedOutText:: ; 2aa9 (0:2aa9)
ld hl,PlayerBlackedOutText ld hl,PlayerBlackedOutText
call PrintText call PrintText
ld a,[wd732] ld a,[wd732]
res 5,a res 5,a ; reset forced to use bike bit
ld [wd732],a ld [wd732],a
jp HoldTextDisplayOpen jp HoldTextDisplayOpen
@ -2616,7 +2616,7 @@ ChooseFlyDestination:: ; 30a9 (0:30a9)
; causes the text box to close without waiting for a button press after displaying text ; causes the text box to close without waiting for a button press after displaying text
DisableWaitingAfterTextDisplay:: ; 30b6 (0:30b6) DisableWaitingAfterTextDisplay:: ; 30b6 (0:30b6)
ld a,$01 ld a,$01
ld [wcc3c],a ld [wDoNotWaitForButtonPressAfterDisplayingText],a
ret ret
; uses an item ; uses an item
@ -2872,11 +2872,11 @@ TalkToTrainer:: ; 31cc (0:31cc)
; checks if any trainers are seeing the player and wanting to fight ; checks if any trainers are seeing the player and wanting to fight
CheckFightingMapTrainers:: ; 3219 (0:3219) CheckFightingMapTrainers:: ; 3219 (0:3219)
call CheckForEngagingTrainers call CheckForEngagingTrainers
ld a, [wcf13] ld a, [wSpriteIndex]
cp $ff cp $ff
jr nz, .trainerEngaging jr nz, .trainerEngaging
xor a xor a
ld [wcf13], a ld [wSpriteIndex], a
ld [wTrainerHeaderFlagBit], a ld [wTrainerHeaderFlagBit], a
ret ret
.trainerEngaging .trainerEngaging
@ -2900,7 +2900,7 @@ Func_324c:: ; 324c (0:324c)
and $1 and $1
ret nz ret nz
ld [wJoyIgnore], a ld [wJoyIgnore], a
ld a, [wcf13] ld a, [wSpriteIndex]
ld [H_DOWNARROWBLINKCNT2], a ; $ff8c ld [H_DOWNARROWBLINKCNT2], a ; $ff8c
call DisplayTextID call DisplayTextID
@ -2939,7 +2939,7 @@ EndTrainerBattle:: ; 3275 (0:3275)
jr nc, .skipRemoveSprite ; test if trainer was fought (in that case skip removing the corresponding sprite) jr nc, .skipRemoveSprite ; test if trainer was fought (in that case skip removing the corresponding sprite)
ld hl, W_MISSABLEOBJECTLIST ld hl, W_MISSABLEOBJECTLIST
ld de, $2 ld de, $2
ld a, [wcf13] ld a, [wSpriteIndex]
call IsInArray ; search for sprite ID call IsInArray ; search for sprite ID
inc hl inc hl
ld a, [hl] ld a, [hl]
@ -3006,7 +3006,7 @@ CheckForEngagingTrainers:: ; 3306 (0:3306)
.trainerLoop .trainerLoop
call StoreTrainerHeaderPointer ; set trainer header pointer to current trainer call StoreTrainerHeaderPointer ; set trainer header pointer to current trainer
ld a, [de] ld a, [de]
ld [wcf13], a ; store trainer flag's bit ld [wSpriteIndex], a ; store trainer flag's bit
ld [wTrainerHeaderFlagBit], a ld [wTrainerHeaderFlagBit], a
cp $ff cp $ff
ret z ret z
@ -3028,7 +3028,7 @@ CheckForEngagingTrainers:: ; 3306 (0:3306)
ld a, [hl] ; read trainer engage distance ld a, [hl] ; read trainer engage distance
pop hl pop hl
ld [wTrainerEngageDistance], a ld [wTrainerEngageDistance], a
ld a, [wcf13] ld a, [wSpriteIndex]
swap a swap a
ld [wTrainerSpriteOffset], a ; wWhichTrade ld [wTrainerSpriteOffset], a ; wWhichTrade
predef TrainerEngage predef TrainerEngage
@ -3059,11 +3059,11 @@ PreBattleSaveRegisters:: ; 3354 (0:3354)
ret ret
; loads data of some trainer on the current map and plays pre-battle music ; loads data of some trainer on the current map and plays pre-battle music
; [wcf13]: sprite ID of trainer who is engaged ; [wSpriteIndex]: sprite ID of trainer who is engaged
EngageMapTrainer:: ; 336a (0:336a) EngageMapTrainer:: ; 336a (0:336a)
ld hl, W_MAPSPRITEEXTRADATA ld hl, W_MAPSPRITEEXTRADATA
ld d, $0 ld d, $0
ld a, [wcf13] ld a, [wSpriteIndex]
dec a dec a
add a add a
ld e, a ld e, a
@ -4708,9 +4708,9 @@ DisableAutoTextBoxDrawing:: ; 3c3f (0:3c3f)
ld a,$01 ld a,$01
AutoTextBoxDrawingCommon:: ; 3c41 (0:3c41) AutoTextBoxDrawingCommon:: ; 3c41 (0:3c41)
ld [wcf0c],a ; control text box drawing ld [wAutoTextBoxDrawingControl],a
xor a xor a
ld [wcc3c],a ; make DisplayTextID wait for button press ld [wDoNotWaitForButtonPressAfterDisplayingText],a ; make DisplayTextID wait for button press
ret ret
PrintText:: ; 3c49 (0:3c49) PrintText:: ; 3c49 (0:3c49)
@ -5015,7 +5015,7 @@ IsInRestOfArray::
RestoreScreenTilesAndReloadTilePatterns:: ; 3dbe (0:3dbe) RestoreScreenTilesAndReloadTilePatterns:: ; 3dbe (0:3dbe)
call ClearSprites call ClearSprites
ld a, $1 ld a, $1
ld [wcfcb], a ld [wUpdateSpritesEnabled], a
call ReloadMapSpriteTilePatterns call ReloadMapSpriteTilePatterns
call LoadScreenTilesFromBuffer2 call LoadScreenTilesFromBuffer2
call LoadTextBoxTilePatterns call LoadTextBoxTilePatterns
@ -5052,7 +5052,7 @@ GBPalWhiteOut::
GoPAL_SET_CF1C:: ; 3ded (0:3ded) GoPAL_SET_CF1C:: ; 3ded (0:3ded)
ld b,$ff ld b,$ff
GoPAL_SET:: ; 3def (0:3def) GoPAL_SET:: ; 3def (0:3def)
ld a,[wcf1b] ld a,[wOnSGB]
and a and a
ret z ret z
predef_jump Func_71ddf predef_jump Func_71ddf

View file

@ -17,7 +17,7 @@ Func_2312:: ; 2312 (0:2312)
ld c, $8 ld c, $8
ld d, c ld d, c
asm_2324:: ; 2324 (0:2324) asm_2324:: ; 2324 (0:2324)
ld a, [wd700] ld a, [wWalkBikeSurfState]
and a and a
jr z, .asm_2343 jr z, .asm_2343
cp $2 cp $2

View file

@ -1,7 +1,7 @@
; These routines manage gradual fading ; These routines manage gradual fading
; (e.g., entering a doorway) ; (e.g., entering a doorway)
LoadGBPal:: LoadGBPal::
ld a, [wd35d] ;tells if cur.map is dark (requires HM5_FLASH?) ld a, [wMapPalOffset] ;tells if cur.map is dark (requires HM5_FLASH?)
ld b, a ld b, a
ld hl, FadePal4 ld hl, FadePal4
ld a, l ld a, l
@ -18,16 +18,16 @@ LoadGBPal::
ld [rOBP1], a ld [rOBP1], a
ret ret
GBFadeOut1:: GBFadeInFromBlack::
ld hl, FadePal1 ld hl, FadePal1
ld b, 4 ld b, 4
jr GBFadeOutCommon jr GBFadeIncCommon
GBFadeOut2:: GBFadeOutToWhite::
ld hl, FadePal6 ld hl, FadePal6
ld b, 3 ld b, 3
GBFadeOutCommon:: GBFadeIncCommon:
ld a, [hli] ld a, [hli]
ld [rBGP], a ld [rBGP], a
ld a, [hli] ld a, [hli]
@ -37,19 +37,19 @@ GBFadeOutCommon::
ld c, 8 ld c, 8
call DelayFrames call DelayFrames
dec b dec b
jr nz, GBFadeOutCommon jr nz, GBFadeIncCommon
ret ret
GBFadeIn1:: GBFadeOutToBlack::
ld hl, FadePal4 + 2 ld hl, FadePal4 + 2
ld b, 4 ld b, 4
jr GBFadeInCommon jr GBFadeDecCommon
GBFadeIn2:: GBFadeInFromWhite::
ld hl, FadePal7 + 2 ld hl, FadePal7 + 2
ld b, 3 ld b, 3
GBFadeInCommon:: GBFadeDecCommon:
ld a, [hld] ld a, [hld]
ld [rOBP1], a ld [rOBP1], a
ld a, [hld] ld a, [hld]
@ -59,7 +59,7 @@ GBFadeInCommon::
ld c, 8 ld c, 8
call DelayFrames call DelayFrames
dec b dec b
jr nz, GBFadeInCommon jr nz, GBFadeDecCommon
ret ret
FadePal1:: db %11111111, %11111111, %11111111 FadePal1:: db %11111111, %11111111, %11111111

View file

@ -105,7 +105,7 @@ rLCDC_DEFAULT EQU %11100011
xor a xor a
ld [$ffbc], a ld [$ffbc], a
dec a dec a
ld [wcfcb], a ld [wUpdateSpritesEnabled], a
predef PlayIntro predef PlayIntro

View file

@ -12,11 +12,11 @@ EnterMap::
call LoadMapData call LoadMapData
callba Func_c335 ; initialize map variables callba Func_c335 ; initialize map variables
ld hl, wd72c ld hl, wd72c
bit 0, [hl] bit 0, [hl] ; has the player already made 3 steps since the last battle?
jr z, .doNotCountSteps jr z, .skipGivingThreeStepsOfNoRandomBattles
ld a, 3 ld a, 3 ; minimum number of steps between battles
ld [wd13c], a ; some kind of step counter (counts up to 3 steps?) ld [wNumberOfNoRandomBattleStepsLeft], a
.doNotCountSteps .skipGivingThreeStepsOfNoRandomBattles
ld hl, wd72e ld hl, wd72e
bit 5, [hl] ; did a battle happen immediately before this? bit 5, [hl] ; did a battle happen immediately before this?
res 5, [hl] ; unset the "battle just happened" flag res 5, [hl] ; unset the "battle just happened" flag
@ -24,12 +24,12 @@ EnterMap::
call nz, MapEntryAfterBattle call nz, MapEntryAfterBattle
ld hl, wd732 ld hl, wd732
ld a, [hl] ld a, [hl]
and 1 << 4 | 1 << 3 and 1 << 4 | 1 << 3 ; fly warp or dungeon warp
jr z, .didNotFlyOrTeleportIn jr z, .didNotEnterUsingFlyWarpOrDungeonWarp
res 3, [hl] res 3, [hl]
callba Func_70510 ; display fly/teleport in graphical effect callba EnterMapAnim ; display fly/teleport in graphical effect
call UpdateSprites call UpdateSprites
.didNotFlyOrTeleportIn .didNotEnterUsingFlyWarpOrDungeonWarp
callba CheckForceBikeOrSurf ; handle currents in SF islands and forced bike riding in cycling road callba CheckForceBikeOrSurf ; handle currents in SF islands and forced bike riding in cycling road
ld hl, wd72d ld hl, wd72d
res 5, [hl] res 5, [hl]
@ -61,8 +61,8 @@ OverworldLoopLessDelay::
res 3,[hl] res 3,[hl]
jp nz,WarpFound2 jp nz,WarpFound2
ld a,[wd732] ld a,[wd732]
and a,$18 and a,1 << 4 | 1 << 3 ; fly warp or dungeon warp
jp nz,HandleFlyOrTeleportAway jp nz,HandleFlyWarpOrDungeonWarp
ld a,[W_CUROPPONENT] ld a,[W_CUROPPONENT]
and a and a
jp nz,.newBattle jp nz,.newBattle
@ -98,8 +98,8 @@ OverworldLoopLessDelay::
and a and a
jp z,OverworldLoop jp z,OverworldLoop
.displayDialogue .displayDialogue
predef Func_c586 ; check what is in front of the player predef GetTileAndCoordsInFrontOfPlayer
call UpdateSprites ; move sprites call UpdateSprites
ld a,[wFlags_0xcd60] ld a,[wFlags_0xcd60]
bit 2,a bit 2,a
jr nz,.checkForOpponent jr nz,.checkForOpponent
@ -117,8 +117,8 @@ OverworldLoopLessDelay::
jr z,.changeMap jr z,.changeMap
predef LoadSAV predef LoadSAV
ld a,[W_CURMAP] ld a,[W_CURMAP]
ld [wd71a],a ld [wDestinationMap],a
call Func_62ce call SpecialWarpIn
ld a,[W_CURMAP] ld a,[W_CURMAP]
call SwitchToMapRomBank ; switch to the ROM bank of the current map call SwitchToMapRomBank ; switch to the ROM bank of the current map
ld hl,W_CURMAPTILESET ld hl,W_CURMAPTILESET
@ -133,7 +133,7 @@ OverworldLoopLessDelay::
.noDirectionButtonsPressed .noDirectionButtonsPressed
ld hl,wFlags_0xcd60 ld hl,wFlags_0xcd60
res 2,[hl] res 2,[hl]
call UpdateSprites ; move sprites call UpdateSprites
ld a,$01 ld a,$01
ld [wcc4b],a ld [wcc4b],a
ld a,[wd528] ; the direction that was pressed last time ld a,[wd528] ; the direction that was pressed last time
@ -225,18 +225,20 @@ OverworldLoopLessDelay::
.noDirectionChange .noDirectionChange
ld a,[wd52a] ; current direction ld a,[wd52a] ; current direction
ld [wd528],a ; save direction ld [wd528],a ; save direction
call UpdateSprites ; move sprites call UpdateSprites
ld a,[wd700] ld a,[wWalkBikeSurfState]
cp a,$02 ; surfing cp a,$02 ; surfing
jr z,.surfing jr z,.surfing
; not surfing ; not surfing
call CollisionCheckOnLand call CollisionCheckOnLand
jr nc,.noCollision jr nc,.noCollision
; collision occurred
push hl push hl
ld hl,wd736 ld hl,wd736
bit 2,[hl] bit 2,[hl] ; standing on warp flag
pop hl pop hl
jp z,OverworldLoop jp z,OverworldLoop
; collision occurred while standing on a warp
push hl push hl
call ExtraWarpCheck ; sets carry if there is a potential to warp call ExtraWarpCheck ; sets carry if there is a potential to warp
pop hl pop hl
@ -259,7 +261,7 @@ OverworldLoopLessDelay::
.moveAhead2 .moveAhead2
ld hl,wFlags_0xcd60 ld hl,wFlags_0xcd60
res 2,[hl] res 2,[hl]
ld a,[wd700] ld a,[wWalkBikeSurfState]
dec a ; riding a bike? dec a ; riding a bike?
jr nz,.normalPlayerSpriteAdvancement jr nz,.normalPlayerSpriteAdvancement
ld a,[wd736] ld a,[wd736]
@ -276,16 +278,16 @@ OverworldLoopLessDelay::
bit 7,a bit 7,a
jr nz,.doneStepCounting ; if button presses are being simulated, don't count steps jr nz,.doneStepCounting ; if button presses are being simulated, don't count steps
; step counting ; step counting
ld hl,wd13b ; step counter ld hl,wStepCounter
dec [hl] dec [hl]
ld a,[wd72c] ld a,[wd72c]
bit 0,a bit 0,a
jr z,.doneStepCounting jr z,.doneStepCounting
ld hl,wd13c ld hl,wNumberOfNoRandomBattleStepsLeft
dec [hl] dec [hl]
jr nz,.doneStepCounting jr nz,.doneStepCounting
ld hl,wd72c ld hl,wd72c
res 0,[hl] res 0,[hl] ; indicate that the player has stepped thrice since the last battle
.doneStepCounting .doneStepCounting
ld a,[wd790] ld a,[wd790]
bit 7,a ; in the safari zone? bit 7,a ; in the safari zone?
@ -298,14 +300,14 @@ OverworldLoopLessDelay::
ld a,[W_ISINBATTLE] ld a,[W_ISINBATTLE]
and a and a
jp nz,CheckWarpsNoCollision jp nz,CheckWarpsNoCollision
predef Func_c69c ; decrement HP of poisoned pokemon predef ApplyOutOfBattlePoisonDamage ; also increment daycare mon exp
ld a,[wd12d] ld a,[wd12d]
and a and a
jp nz,HandleBlackOut ; if all pokemon fainted jp nz,HandleBlackOut ; if all pokemon fainted
.newBattle .newBattle
call NewBattle call NewBattle
ld hl,wd736 ld hl,wd736
res 2,[hl] res 2,[hl] ; standing on warp flag
jp nc,CheckWarpsNoCollision ; check for warps if there was no battle jp nc,CheckWarpsNoCollision ; check for warps if there was no battle
.battleOccurred .battleOccurred
ld hl,wd72d ld hl,wd72d
@ -316,7 +318,7 @@ OverworldLoopLessDelay::
set 5,[hl] set 5,[hl]
set 6,[hl] set 6,[hl]
xor a xor a
ld [hJoyHeld],a ; clear joypad state ld [hJoyHeld],a
ld a,[W_CURMAP] ld a,[W_CURMAP]
cp a,CINNABAR_GYM cp a,CINNABAR_GYM
jr nz,.notCinnabarGym jr nz,.notCinnabarGym
@ -327,8 +329,8 @@ OverworldLoopLessDelay::
set 5,[hl] set 5,[hl]
ld a,[W_CURMAP] ld a,[W_CURMAP]
cp a,OAKS_LAB cp a,OAKS_LAB
jp z,.noFaintCheck jp z,.noFaintCheck ; no blacking out if the player lost to the rival in Oak's lab
callab AnyPartyAlive ; check if all the player's pokemon fainted callab AnyPartyAlive
ld a,d ld a,d
and a and a
jr z,.allPokemonFainted jr z,.allPokemonFainted
@ -355,7 +357,7 @@ NewBattle:: ; 0683 (0:0683)
jr nz,.noBattle jr nz,.noBattle
ld b, BANK(InitBattle) ld b, BANK(InitBattle)
ld hl, InitBattle ld hl, InitBattle
jp Bankswitch ; determines if a battle will occur and runs the battle if so jp Bankswitch
.noBattle .noBattle
and a and a
ret ret
@ -368,25 +370,25 @@ BikeSpeedup:: ; 06a0 (0:06a0)
ld a,[W_CURMAP] ld a,[W_CURMAP]
cp a,ROUTE_17 ; Cycling Road cp a,ROUTE_17 ; Cycling Road
jr nz,.goFaster jr nz,.goFaster
ld a,[hJoyHeld] ; current joypad state ld a,[hJoyHeld]
and a,%01110000 ; bit mask for up, left, right buttons and a,D_UP | D_LEFT | D_RIGHT
ret nz ret nz
.goFaster .goFaster
jp AdvancePlayerSprite jp AdvancePlayerSprite
; check if the player has stepped onto a warp after having not collided ; check if the player has stepped onto a warp after having not collided
CheckWarpsNoCollision:: ; 06b4 (0:06b4) CheckWarpsNoCollision:: ; 06b4 (0:06b4)
ld a,[wd3ae] ; number of warps ld a,[wNumberOfWarps]
and a and a
jp z,CheckMapConnections jp z,CheckMapConnections
ld a,[wd3ae] ; number of warps ld a,[wNumberOfWarps]
ld b,$00 ld b,0
ld c,a ld c,a
ld a,[W_YCOORD] ld a,[W_YCOORD]
ld d,a ld d,a
ld a,[W_XCOORD] ld a,[W_XCOORD]
ld e,a ld e,a
ld hl,wd3af ; start of warp entries ld hl,wWarpEntries
CheckWarpsNoCollisionLoop:: ; 06cc (0:06cc) CheckWarpsNoCollisionLoop:: ; 06cc (0:06cc)
ld a,[hli] ; check if the warp's Y position matches ld a,[hli] ; check if the warp's Y position matches
cp d cp d
@ -398,14 +400,14 @@ CheckWarpsNoCollisionLoop:: ; 06cc (0:06cc)
push hl push hl
push bc push bc
ld hl,wd736 ld hl,wd736
set 2,[hl] set 2,[hl] ; standing on warp flag
callba Func_c49d ; check if the player sprite is standing on a "door" tile callba IsPlayerStandingOnDoorTileOrWarpTile
pop bc pop bc
pop hl pop hl
jr c,WarpFound1 ; if it is, go to 0735 jr c,WarpFound1 ; jump if standing on door or warp
push hl push hl
push bc push bc
call ExtraWarpCheck ; sets carry if the warp is confirmed call ExtraWarpCheck
pop bc pop bc
pop hl pop hl
jr nc,CheckWarpsNoCollisionRetry2 jr nc,CheckWarpsNoCollisionRetry2
@ -418,16 +420,16 @@ CheckWarpsNoCollisionLoop:: ; 06cc (0:06cc)
call Joypad call Joypad
pop bc pop bc
pop de pop de
ld a,[hJoyHeld] ; current joypad state ld a,[hJoyHeld]
and a,%11110000 ; bit mask for directional buttons and a,D_DOWN | D_UP | D_LEFT | D_RIGHT
jr z,CheckWarpsNoCollisionRetry2 ; if directional buttons aren't being pressed, do not pass through the warp jr z,CheckWarpsNoCollisionRetry2 ; if directional buttons aren't being pressed, do not pass through the warp
jr WarpFound1 jr WarpFound1
; check if the player has stepped onto a warp after having collided ; check if the player has stepped onto a warp after having collided
CheckWarpsCollision:: ; 0706 (0:0706) CheckWarpsCollision:: ; 0706 (0:0706)
ld a,[wd3ae] ; number of warps ld a,[wNumberOfWarps]
ld c,a ld c,a
ld hl,wd3af ; start of warp entries ld hl,wWarpEntries
.loop .loop
ld a,[hli] ; Y coordinate of warp ld a,[hli] ; Y coordinate of warp
ld b,a ld b,a
@ -440,7 +442,7 @@ CheckWarpsCollision:: ; 0706 (0:0706)
cp b cp b
jr nz,.retry2 jr nz,.retry2
ld a,[hli] ld a,[hli]
ld [wd42f],a ; save target warp ID ld [wDestinationWarpID],a
ld a,[hl] ld a,[hl]
ld [$ff8b],a ; save target map ld [$ff8b],a ; save target map
jr WarpFound2 jr WarpFound2
@ -462,12 +464,12 @@ CheckWarpsNoCollisionRetry2:: ; 0730 (0:0730)
WarpFound1:: ; 0735 (0:0735) WarpFound1:: ; 0735 (0:0735)
ld a,[hli] ld a,[hli]
ld [wd42f],a ; save target warp ID ld [wDestinationWarpID],a
ld a,[hli] ld a,[hli]
ld [$ff8b],a ; save target map ld [$ff8b],a ; save target map
WarpFound2:: ; 073c (0:073c) WarpFound2:: ; 073c (0:073c)
ld a,[wd3ae] ; number of warps ld a,[wNumberOfWarps]
sub c sub c
ld [wd73b],a ; save ID of used warp ld [wd73b],a ; save ID of used warp
ld a,[W_CURMAP] ld a,[W_CURMAP]
@ -484,8 +486,8 @@ WarpFound2:: ; 073c (0:073c)
cp a,ROCK_TUNNEL_1 cp a,ROCK_TUNNEL_1
jr nz,.notRockTunnel jr nz,.notRockTunnel
ld a,$06 ld a,$06
ld [wd35d],a ld [wMapPalOffset],a
call GBFadeIn1 call GBFadeOutToBlack
.notRockTunnel .notRockTunnel
call PlayMapChangeSound call PlayMapChangeSound
jr .done jr .done
@ -496,16 +498,16 @@ WarpFound2:: ; 073c (0:073c)
jr z,.goBackOutside jr z,.goBackOutside
; if not going back to the previous map ; if not going back to the previous map
ld [W_CURMAP],a ; current map number ld [W_CURMAP],a ; current map number
callba Func_70787 ; check if the warp was a Silph Co. teleporter callba IsPlayerStandingOnWarpPadOrHole
ld a,[wcd5b] ld a,[wcd5b]
dec a dec a ; is the player on a warp pad?
jr nz,.notTeleporter jr nz,.notWarpPad
; if it's a Silph Co. teleporter ; if the player is on a warp pad
ld hl,wd732 ld hl,wd732
set 3,[hl] set 3,[hl]
call LeaveMapAnim call LeaveMapAnim
jr .skipMapChangeSound jr .skipMapChangeSound
.notTeleporter .notWarpPad
call PlayMapChangeSound call PlayMapChangeSound
.skipMapChangeSound .skipMapChangeSound
ld hl,wd736 ld hl,wd736
@ -517,7 +519,7 @@ WarpFound2:: ; 073c (0:073c)
ld [W_CURMAP],a ld [W_CURMAP],a
call PlayMapChangeSound call PlayMapChangeSound
xor a xor a
ld [wd35d],a ld [wMapPalOffset],a
.done .done
ld hl,wd736 ld hl,wd736
set 0,[hl] ; have the player's sprite step out from the door (if there is one) set 0,[hl] ; have the player's sprite step out from the door (if there is one)
@ -562,9 +564,9 @@ CheckMapConnections:: ; 07ba (0:07ba)
jr nz,.pointerAdjustmentLoop1 jr nz,.pointerAdjustmentLoop1
.savePointer1 .savePointer1
ld a,l ld a,l
ld [wd35f],a ; pointer to upper left corner of current tile block map section ld [wCurrentTileBlockMapViewPointer],a ; pointer to upper left corner of current tile block map section
ld a,h ld a,h
ld [wd360],a ld [wCurrentTileBlockMapViewPointer + 1],a
jp .loadNewMap jp .loadNewMap
.checkEastMap .checkEastMap
ld b,a ld b,a
@ -598,9 +600,9 @@ CheckMapConnections:: ; 07ba (0:07ba)
jr nz,.pointerAdjustmentLoop2 jr nz,.pointerAdjustmentLoop2
.savePointer2 .savePointer2
ld a,l ld a,l
ld [wd35f],a ; pointer to upper left corner of current tile block map section ld [wCurrentTileBlockMapViewPointer],a ; pointer to upper left corner of current tile block map section
ld a,h ld a,h
ld [wd360],a ld [wCurrentTileBlockMapViewPointer + 1],a
jp .loadNewMap jp .loadNewMap
.checkNorthMap .checkNorthMap
ld a,[W_YCOORD] ld a,[W_YCOORD]
@ -624,9 +626,9 @@ CheckMapConnections:: ; 07ba (0:07ba)
srl c srl c
add hl,bc add hl,bc
ld a,l ld a,l
ld [wd35f],a ; pointer to upper left corner of current tile block map section ld [wCurrentTileBlockMapViewPointer],a ; pointer to upper left corner of current tile block map section
ld a,h ld a,h
ld [wd360],a ld [wCurrentTileBlockMapViewPointer + 1],a
jp .loadNewMap jp .loadNewMap
.checkSouthMap .checkSouthMap
ld b,a ld b,a
@ -651,9 +653,9 @@ CheckMapConnections:: ; 07ba (0:07ba)
srl c srl c
add hl,bc add hl,bc
ld a,l ld a,l
ld [wd35f],a ; pointer to upper left corner of current tile block map section ld [wCurrentTileBlockMapViewPointer],a ; pointer to upper left corner of current tile block map section
ld a,h ld a,h
ld [wd360],a ld [wCurrentTileBlockMapViewPointer + 1],a
.loadNewMap ; load the connected map that was entered .loadNewMap ; load the connected map that was entered
call LoadMapHeader call LoadMapHeader
call Func_2312 ; music call Func_2312 ; music
@ -678,10 +680,10 @@ PlayMapChangeSound:: ; 08c9 (0:08c9)
ld a,(SFX_02_5c - SFX_Headers_02) / 3 ld a,(SFX_02_5c - SFX_Headers_02) / 3
.playSound .playSound
call PlaySound call PlaySound
ld a,[wd35d] ld a,[wMapPalOffset]
and a and a
ret nz ret nz
jp GBFadeIn1 jp GBFadeOutToBlack
CheckIfInOutsideMap:: ; 08e1 (0:08e1) CheckIfInOutsideMap:: ; 08e1 (0:08e1)
; If the player is in an outside map (a town or route), set the z flag ; If the player is in an outside map (a town or route), set the z flag
@ -719,37 +721,37 @@ ExtraWarpCheck:: ; 08e9 (0:08e9)
cp PLATEAU ; Indigo Plateau tileset cp PLATEAU ; Indigo Plateau tileset
jr z, .useFunction2 jr z, .useFunction2
.useFunction1 .useFunction1
ld hl, Func_c3ff ld hl, IsPlayerFacingEdgeOfMap
jr .doBankswitch jr .doBankswitch
.useFunction2 .useFunction2
ld hl, Func_c44e ld hl, IsWarpTileInFrontOfPlayer
.doBankswitch .doBankswitch
ld b, BANK(Func_c44e) ld b, BANK(IsWarpTileInFrontOfPlayer)
jp Bankswitch jp Bankswitch
MapEntryAfterBattle:: ; 091f (0:091f) MapEntryAfterBattle:: ; 091f (0:091f)
callba Func_c35f ; function that appears to disable warp testing after collisions if the player is standing on a warp callba IsPlayerStandingOnWarp ; for enabling warp testing after collisions
ld a,[wd35d] ld a,[wMapPalOffset]
and a and a
jp z,GBFadeIn2 jp z,GBFadeInFromWhite
jp LoadGBPal jp LoadGBPal
HandleBlackOut:: HandleBlackOut::
; For when all the player's pokemon faint. ; For when all the player's pokemon faint.
; Does not print the "blacked out" message. ; Does not print the "blacked out" message.
call GBFadeIn1 call GBFadeOutToBlack
ld a, $08 ld a, $08
call StopMusic call StopMusic
ld hl, wd72e ld hl, wd72e
res 5, [hl] res 5, [hl]
ld a, Bank(Func_40b0) ; also Bank(Func_62ce) and Bank(Func_5d5f) ld a, Bank(ResetStatusAndHalveMoneyOnBlackout) ; also Bank(SpecialWarpIn) and Bank(SpecialEnterMap)
ld [H_LOADEDROMBANK], a ld [H_LOADEDROMBANK], a
ld [MBC3RomBank], a ld [MBC3RomBank], a
call Func_40b0 call ResetStatusAndHalveMoneyOnBlackout
call Func_62ce call SpecialWarpIn
call Func_2312 call Func_2312
jp Func_5d5f jp SpecialEnterMap
StopMusic:: StopMusic::
ld [wMusicHeaderPointer], a ld [wMusicHeaderPointer], a
@ -762,23 +764,23 @@ StopMusic::
jr nz, .wait jr nz, .wait
jp StopAllSounds jp StopAllSounds
HandleFlyOrTeleportAway:: HandleFlyWarpOrDungeonWarp::
call UpdateSprites call UpdateSprites
call Delay3 call Delay3
xor a xor a
ld [wBattleResult], a ld [wBattleResult], a
ld [wd700], a ld [wWalkBikeSurfState], a
ld [W_ISINBATTLE], a ld [W_ISINBATTLE], a
ld [wd35d], a ld [wMapPalOffset], a
ld hl, wd732 ld hl, wd732
set 2, [hl] set 2, [hl] ; fly warp or dungeon warp
res 5, [hl] res 5, [hl] ; forced to ride bike
call LeaveMapAnim call LeaveMapAnim
ld a, Bank(Func_62ce) ld a, Bank(SpecialWarpIn)
ld [H_LOADEDROMBANK], a ld [H_LOADEDROMBANK], a
ld [$2000], a ld [$2000], a
call Func_62ce call SpecialWarpIn
jp Func_5d5f jp SpecialEnterMap
LeaveMapAnim:: LeaveMapAnim::
ld b, BANK(_LeaveMapAnim) ld b, BANK(_LeaveMapAnim)
@ -792,7 +794,7 @@ LoadPlayerSpriteGraphics::
; 1: biking ; 1: biking
; 2: surfing ; 2: surfing
ld a, [wd700] ld a, [wWalkBikeSurfState]
dec a dec a
jr z, .ridingBike jr z, .ridingBike
@ -809,12 +811,12 @@ LoadPlayerSpriteGraphics::
.startWalking .startWalking
xor a xor a
ld [wd700], a ld [wWalkBikeSurfState], a
ld [wd11a], a ld [wWalkBikeSurfStateCopy], a
jp LoadWalkingPlayerSpriteGraphics jp LoadWalkingPlayerSpriteGraphics
.determineGraphics .determineGraphics
ld a, [wd700] ld a, [wWalkBikeSurfState]
and a and a
jp z, LoadWalkingPlayerSpriteGraphics jp z, LoadWalkingPlayerSpriteGraphics
dec a dec a
@ -1065,7 +1067,7 @@ IsSpriteOrSignInFrontOfPlayer:: ; 0b23 (0:0b23)
and a and a
jr z,.extendRangeOverCounter jr z,.extendRangeOverCounter
; if there are signs ; if there are signs
predef Func_c586 ; get the coordinates in front of the player in de predef GetTileAndCoordsInFrontOfPlayer ; get the coordinates in front of the player in de
ld hl,wd4b1 ; start of sign coordinates ld hl,wd4b1 ; start of sign coordinates
ld a,[wd4b0] ; number of signs in the map ld a,[wd4b0] ; number of signs in the map
ld b,a ld b,a
@ -1099,7 +1101,7 @@ IsSpriteOrSignInFrontOfPlayer:: ; 0b23 (0:0b23)
jr nz,.signLoop jr nz,.signLoop
; check if the player is front of a counter in a pokemon center, pokemart, etc. and if so, extend the range at which he can talk to the NPC ; check if the player is front of a counter in a pokemon center, pokemart, etc. and if so, extend the range at which he can talk to the NPC
.extendRangeOverCounter .extendRangeOverCounter
predef Func_c586 ; get the tile in front of the player in c predef GetTileAndCoordsInFrontOfPlayer ; get the tile in front of the player in c
ld hl,W_TILESETTALKINGOVERTILES ; list of tiles that extend talking range (counter tiles) ld hl,W_TILESETTALKINGOVERTILES ; list of tiles that extend talking range (counter tiles)
ld b,$03 ld b,$03
ld d,$20 ; talking range in pixels (long range) ld d,$20 ; talking range in pixels (long range)
@ -1239,8 +1241,8 @@ CollisionCheckOnLand:: ; 0bd1 (0:0bd1)
; function that checks if the tile in front of the player is passable ; function that checks if the tile in front of the player is passable
; clears carry if it is, sets carry if not ; clears carry if it is, sets carry if not
CheckTilePassable:: ; 0c10 (0:0c10) CheckTilePassable:: ; 0c10 (0:0c10)
predef Func_c586 ; get tile in front of player predef GetTileAndCoordsInFrontOfPlayer ; get tile in front of player
ld a,[wcfc6] ; tile in front of player ld a,[wTileInFrontOfPlayer] ; tile in front of player
ld c,a ld c,a
ld hl,W_TILESETCOLLISIONPTR ; pointer to list of passable tiles ld hl,W_TILESETCOLLISIONPTR ; pointer to list of passable tiles
ld a,[hli] ld a,[hli]
@ -1263,7 +1265,7 @@ CheckTilePassable:: ; 0c10 (0:0c10)
; sets carry if there is a collision and unsets carry if not ; sets carry if there is a collision and unsets carry if not
CheckForJumpingAndTilePairCollisions:: ; 0c2a (0:0c2a) CheckForJumpingAndTilePairCollisions:: ; 0c2a (0:0c2a)
push hl push hl
predef Func_c586 ; get the tile in front of the player predef GetTileAndCoordsInFrontOfPlayer ; get the tile in front of the player
push de push de
push bc push bc
callba HandleLedges ; check if the player is trying to jump a ledge callba HandleLedges ; check if the player is trying to jump a ledge
@ -1276,12 +1278,12 @@ CheckForJumpingAndTilePairCollisions:: ; 0c2a (0:0c2a)
ret nz ret nz
; if not jumping ; if not jumping
Func_c44:: ; 0c44 (0:0c44) CheckForTilePairCollisions2:: ; 0c44 (0:0c44)
aCoord 8, 9 ; tile the player is on aCoord 8, 9 ; tile the player is on
ld [wcf0e],a ld [wcf0e],a
CheckForTilePairCollisions:: ; 0c4a (0:0c4a) CheckForTilePairCollisions:: ; 0c4a (0:0c4a)
ld a,[wcfc6] ; tile in front of the player ld a,[wTileInFrontOfPlayer]
ld c,a ld c,a
.tilePairCollisionLoop .tilePairCollisionLoop
ld a,[W_CURMAPTILESET] ; tileset number ld a,[W_CURMAPTILESET] ; tileset number
@ -1357,9 +1359,9 @@ LoadCurrentMapView:: ; 0caa (0:0caa)
ld a,[W_TILESETBANK] ; tile data ROM bank ld a,[W_TILESETBANK] ; tile data ROM bank
ld [H_LOADEDROMBANK],a ld [H_LOADEDROMBANK],a
ld [$2000],a ; switch to ROM bank that contains tile data ld [$2000],a ; switch to ROM bank that contains tile data
ld a,[wd35f] ; address of upper left corner of current map view ld a,[wCurrentTileBlockMapViewPointer] ; address of upper left corner of current map view
ld e,a ld e,a
ld a,[wd360] ld a,[wCurrentTileBlockMapViewPointer + 1]
ld d,a ld d,a
ld hl,wTileMapBackup ld hl,wTileMapBackup
ld b,$05 ld b,$05
@ -1531,9 +1533,9 @@ AdvancePlayerSprite:: ; 0d27 (0:0d27)
; moved into the tile block to the east ; moved into the tile block to the east
xor a xor a
ld [hl],a ld [hl],a
ld hl,wd4e3 ld hl,wXOffsetSinceLastSpecialWarp
inc [hl] inc [hl]
ld de,wd35f ld de,wCurrentTileBlockMapViewPointer
call MoveTileBlockMapPointerEast call MoveTileBlockMapPointerEast
jr .updateMapView jr .updateMapView
.checkForMoveToWestBlock .checkForMoveToWestBlock
@ -1542,9 +1544,9 @@ AdvancePlayerSprite:: ; 0d27 (0:0d27)
; moved into the tile block to the west ; moved into the tile block to the west
ld a,$01 ld a,$01
ld [hl],a ld [hl],a
ld hl,wd4e3 ld hl,wXOffsetSinceLastSpecialWarp
dec [hl] dec [hl]
ld de,wd35f ld de,wCurrentTileBlockMapViewPointer
call MoveTileBlockMapPointerWest call MoveTileBlockMapPointerWest
jr .updateMapView jr .updateMapView
.adjustYCoordWithinBlock .adjustYCoordWithinBlock
@ -1557,9 +1559,9 @@ AdvancePlayerSprite:: ; 0d27 (0:0d27)
; moved into the tile block to the south ; moved into the tile block to the south
xor a xor a
ld [hl],a ld [hl],a
ld hl,wd4e2 ld hl,wYOffsetSinceLastSpecialWarp
inc [hl] inc [hl]
ld de,wd35f ld de,wCurrentTileBlockMapViewPointer
ld a,[W_CURMAPWIDTH] ld a,[W_CURMAPWIDTH]
call MoveTileBlockMapPointerSouth call MoveTileBlockMapPointerSouth
jr .updateMapView jr .updateMapView
@ -1569,9 +1571,9 @@ AdvancePlayerSprite:: ; 0d27 (0:0d27)
; moved into the tile block to the north ; moved into the tile block to the north
ld a,$01 ld a,$01
ld [hl],a ld [hl],a
ld hl,wd4e2 ld hl,wYOffsetSinceLastSpecialWarp
dec [hl] dec [hl]
ld de,wd35f ld de,wCurrentTileBlockMapViewPointer
ld a,[W_CURMAPWIDTH] ld a,[W_CURMAPWIDTH]
call MoveTileBlockMapPointerNorth call MoveTileBlockMapPointerNorth
.updateMapView .updateMapView
@ -1905,8 +1907,8 @@ CollisionCheckOnWater:: ; 0fb7 (0:0fb7)
ld hl,TilePairCollisionsWater ld hl,TilePairCollisionsWater
call CheckForJumpingAndTilePairCollisions call CheckForJumpingAndTilePairCollisions
jr c,.collision jr c,.collision
predef Func_c586 ; get tile in front of player (puts it in c and [wcfc6]) predef GetTileAndCoordsInFrontOfPlayer ; get tile in front of player (puts it in c and [wTileInFrontOfPlayer])
ld a,[wcfc6] ; tile in front of player ld a,[wTileInFrontOfPlayer] ; tile in front of player
cp a,$14 ; water tile cp a,$14 ; water tile
jr z,.noCollision ; keep surfing if it's a water tile jr z,.noCollision ; keep surfing if it's a water tile
cp a,$32 ; either the left tile of the S.S. Anne boarding platform or the tile on eastern coastlines (depending on the current tileset) cp a,$32 ; either the left tile of the S.S. Anne boarding platform or the tile on eastern coastlines (depending on the current tileset)
@ -1941,7 +1943,7 @@ CollisionCheckOnWater:: ; 0fb7 (0:0fb7)
ret ret
.stopSurfing .stopSurfing
xor a xor a
ld [wd700],a ld [wWalkBikeSurfState],a
call LoadPlayerSpriteGraphics call LoadPlayerSpriteGraphics
call PlayDefaultMusic call PlayDefaultMusic
jr .noCollision jr .noCollision
@ -2089,12 +2091,12 @@ LoadMapHeader:: ; 107c (0:107c)
ld a,[hli] ld a,[hli]
ld [de],a ; save background tile ID ld [de],a ; save background tile ID
.loadWarpData .loadWarpData
ld a,[hli] ; number of warps ld a,[hli]
ld [wd3ae],a ; save the number of warps ld [wNumberOfWarps],a
and a ; are there any warps? and a
jr z,.loadSignData ; if not, skip this jr z,.loadSignData
ld c,a ld c,a
ld de,wd3af ; base address of warps ld de,wWarpEntries
.warpLoop ; one warp per loop iteration .warpLoop ; one warp per loop iteration
ld b,$04 ld b,$04
.warpInnerLoop .warpInnerLoop
@ -2258,8 +2260,8 @@ LoadMapHeader:: ; 107c (0:107c)
dec b dec b
jp nz,.loadSpriteLoop jp nz,.loadSpriteLoop
.finishUp .finishUp
predef Func_c754 ; load tileset data predef LoadTilesetHeader
callab LoadWildData ; load wild pokemon data callab LoadWildData
pop hl ; restore hl from before going to the warp/sign/sprite data (this value was saved for seemingly no purpose) pop hl ; restore hl from before going to the warp/sign/sprite data (this value was saved for seemingly no purpose)
ld a,[W_CURMAPHEIGHT] ; map height in 4x4 tile blocks ld a,[W_CURMAPHEIGHT] ; map height in 4x4 tile blocks
add a ; double it add a ; double it
@ -2312,7 +2314,7 @@ LoadMapData:: ; 1241 (0:1241)
ld [$ffae],a ld [$ffae],a
ld [wWalkCounter],a ld [wWalkCounter],a
ld [wd119],a ld [wd119],a
ld [wd11a],a ld [wWalkBikeSurfStateCopy],a
ld [W_SPRITESETID],a ld [W_SPRITESETID],a
call LoadTextBoxTilePatterns call LoadTextBoxTilePatterns
call LoadMapHeader call LoadMapHeader
@ -2341,13 +2343,13 @@ LoadMapData:: ; 1241 (0:1241)
dec b dec b
jr nz,.vramCopyLoop jr nz,.vramCopyLoop
ld a,$01 ld a,$01
ld [wcfcb],a ld [wUpdateSpritesEnabled],a
call EnableLCD call EnableLCD
ld b,$09 ld b,$09
call GoPAL_SET call GoPAL_SET
call LoadPlayerSpriteGraphics call LoadPlayerSpriteGraphics
ld a,[wd732] ld a,[wd732]
and a,$18 ; did the player fly or teleport in? and a,1 << 4 | 1 << 3 ; fly warp or dungeon warp
jr nz,.restoreRomBank jr nz,.restoreRomBank
ld a,[W_FLAGS_D733] ld a,[W_FLAGS_D733]
bit 1,a bit 1,a

View file

@ -7,7 +7,7 @@ Predef::
ld [wPredefID], a ld [wPredefID], a
; A hack for LoadDestinationWarpPosition. ; A hack for LoadDestinationWarpPosition.
; See Func_c754 (predef $19). ; See LoadTilesetHeader (predef $19).
ld a, [H_LOADEDROMBANK] ld a, [H_LOADEDROMBANK]
ld [wPredefParentBank], a ld [wPredefParentBank], a

621
main.asm

File diff suppressed because it is too large Load diff

View file

@ -57,7 +57,7 @@ BillsHouseScript3: ; 1e7c5 (7:67c5)
ld a, $f0 ld a, $f0
ld [wJoyIgnore], a ld [wJoyIgnore], a
ld a, $2 ld a, $2
ld [wcf13], a ld [wSpriteIndex], a
ld a, $c ld a, $c
ld [$ffeb], a ld [$ffeb], a
ld a, $40 ld a, $40

View file

@ -236,7 +236,7 @@ CeladonGameCornerText5: ; 48d4a (12:4d4a)
ld hl, wd77e ld hl, wd77e
set 2, [hl] set 2, [hl]
ld a, $1 ld a, $1
ld [wcc3c], a ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld hl, Received10CoinsText ld hl, Received10CoinsText
jr .asm_c7d1a ; 0x48d87 jr .asm_c7d1a ; 0x48d87
.asm_d0957 ; 0x48d89 .asm_d0957 ; 0x48d89
@ -411,7 +411,7 @@ CeladonGameCornerText11: ; 48e9d (12:4e9d)
ld de, CeladonGameCornerText_48ed3 ld de, CeladonGameCornerText_48ed3
call PreBattleSaveRegisters call PreBattleSaveRegisters
ldh a, [$8c] ldh a, [$8c]
ld [wcf13], a ld [wSpriteIndex], a
call EngageMapTrainer call EngageMapTrainer
call InitBattleEnemyParameters call InitBattleEnemyParameters
xor a xor a
@ -437,7 +437,7 @@ CeladonGameCornerText13: ; 48ed8 (12:4ed8)
CeladonGameCornerText12: ; 48edd (12:4edd) CeladonGameCornerText12: ; 48edd (12:4edd)
db $08 ; asm db $08 ; asm
ld a, $1 ld a, $1
ld [wcc3c], a ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld hl, CeladonGameCornerText_48f09 ld hl, CeladonGameCornerText_48f09
call PrintText call PrintText
call WaitForSoundToFinish call WaitForSoundToFinish

View file

@ -179,7 +179,7 @@ CeladonGymText1: ; 48a11 (12:4a11)
ld de, CeladonGymText_48a63 ld de, CeladonGymText_48a63
call PreBattleSaveRegisters call PreBattleSaveRegisters
ldh a, [$8c] ldh a, [$8c]
ld [wcf13], a ld [wSpriteIndex], a
call EngageMapTrainer call EngageMapTrainer
call InitBattleEnemyParameters call InitBattleEnemyParameters
ld a, $4 ld a, $4

View file

@ -51,7 +51,7 @@ DirectorText: ; 487b2 (12:47b2)
db $8 ; asm db $8 ; asm
callab DisplayDiploma callab DisplayDiploma
ld a, $1 ld a, $1
ld [wcc3c], a ld [wDoNotWaitForButtonPressAfterDisplayingText], a
jp TextScriptEnd jp TextScriptEnd
GameFreakPCText1: ; 487eb (12:47eb) GameFreakPCText1: ; 487eb (12:47eb)

View file

@ -9,13 +9,13 @@ CeladonMartElevatorScript: ; 48600 (12:4600)
res 7, [hl] res 7, [hl]
call nz, CeladonMartElevatorScript_48654 call nz, CeladonMartElevatorScript_48654
xor a xor a
ld [wcf0c], a ld [wAutoTextBoxDrawingControl], a
inc a inc a
ld [wcc3c], a ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ret ret
CeladonMartElevatorScript_4861c: ; 4861c (12:461c) CeladonMartElevatorScript_4861c: ; 4861c (12:461c)
ld hl, wd3af ld hl, wWarpEntries
ld a, [wd73b] ld a, [wd73b]
ld b, a ld b, a
ld a, [wd73c] ld a, [wd73c]

View file

@ -230,7 +230,7 @@ CeladonMartRoofText2: ; 4856c (12:456c)
and a and a
jr z, .asm_914b9 ; 0x48574 jr z, .asm_914b9 ; 0x48574
ld a, $1 ld a, $1
ld [wcc3c], a ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld hl, CeladonMartRoofText4 ld hl, CeladonMartRoofText4
call PrintText call PrintText
call YesNoChoice call YesNoChoice

View file

@ -64,7 +64,7 @@ CeruleanCityScript0: ; 194c8 (6:54c8)
ld hl, CeruleanCityCoords2 ld hl, CeruleanCityCoords2
call ArePlayerCoordsInArray call ArePlayerCoordsInArray
ret nc ret nc
ld a, [wd700] ld a, [wWalkBikeSurfState]
and a and a
jr z, .asm_19512 ; 0x19508 $8 jr z, .asm_19512 ; 0x19508 $8
ld a, $ff ld a, $ff
@ -279,7 +279,7 @@ CeruleanCityText2: ; 1967c (6:567c)
ld de, CeruleanCityText_196ee ld de, CeruleanCityText_196ee
call PreBattleSaveRegisters call PreBattleSaveRegisters
ld a, [$ff8c] ld a, [$ff8c]
ld [wcf13], a ld [wSpriteIndex], a
call EngageMapTrainer call EngageMapTrainer
call InitBattleEnemyParameters call InitBattleEnemyParameters
ld a, $4 ld a, $4
@ -296,7 +296,7 @@ CeruleanCityText2: ; 1967c (6:567c)
jr .Done jr .Done
.Success .Success
ld a, $1 ld a, $1
ld [wcc3c], a ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld hl, ReceivedTM28Text ld hl, ReceivedTM28Text
call PrintText call PrintText
callba Func_74872 callba Func_74872

View file

@ -2,7 +2,7 @@ Func_74872: ; 74872 (1d:4872)
; code similar to this appears in a lot of banks; this particular ; code similar to this appears in a lot of banks; this particular
; one is called after you beat the Rocket that gives you TM28 DIG. ; one is called after you beat the Rocket that gives you TM28 DIG.
; the screen then fades out, he disappears, and fades back in ; the screen then fades out, he disappears, and fades back in
call GBFadeIn1 call GBFadeOutToBlack
ld a, $07 ld a, $07
ld [wcc4d], a ld [wcc4d], a
predef ShowObject predef ShowObject
@ -12,5 +12,5 @@ Func_74872: ; 74872 (1d:4872)
ld a, $06 ld a, $06
ld [wcc4d], a ld [wcc4d], a
predef HideObject predef HideObject
call GBFadeOut1 call GBFadeInFromBlack
ret ret

View file

@ -128,7 +128,7 @@ CeruleanGymText1: ; 5c771 (17:4771)
ld de, CeruleanGymText_5c7d8 ld de, CeruleanGymText_5c7d8
call PreBattleSaveRegisters call PreBattleSaveRegisters
ldh a, [$8c] ldh a, [$8c]
ld [wcf13], a ld [wSpriteIndex], a
call EngageMapTrainer call EngageMapTrainer
call InitBattleEnemyParameters call InitBattleEnemyParameters
ld a, $2 ld a, $2

View file

@ -1,8 +1,8 @@
CeruleanHouse2Script: ; 74e09 (1d:4e09) CeruleanHouse2Script: ; 74e09 (1d:4e09)
ld a, $1 ld a, $1
ld [wcf0c], a ld [wAutoTextBoxDrawingControl], a
dec a dec a
ld [wcc3c], a ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ret ret
CeruleanHouse2TextPointers: ; 74e13 (1d:4e13) CeruleanHouse2TextPointers: ; 74e13 (1d:4e13)

View file

@ -187,13 +187,13 @@ CinnabarGymTextPointers: ; 7589f (1d:589f)
CinnabarGymScript_758b7: ; 758b7 (1d:58b7) CinnabarGymScript_758b7: ; 758b7 (1d:58b7)
ld a, [H_DOWNARROWBLINKCNT2] ; $ff8c ld a, [H_DOWNARROWBLINKCNT2] ; $ff8c
ld [wcf13], a ld [wSpriteIndex], a
call EngageMapTrainer call EngageMapTrainer
call InitBattleEnemyParameters call InitBattleEnemyParameters
ld hl, wd72d ld hl, wd72d
set 6, [hl] set 6, [hl]
set 7, [hl] set 7, [hl]
ld a, [wcf13] ld a, [wSpriteIndex]
cp $1 cp $1
jr z, .asm_758d4 jr z, .asm_758d4
ld a, $2 ld a, $2

View file

@ -16,7 +16,7 @@ CopycatsHouse2FText1: ; 5cc82 (17:4c82)
bit 0, a bit 0, a
jr nz, .asm_7ccf3 ; 0x5cc88 jr nz, .asm_7ccf3 ; 0x5cc88
ld a, $1 ld a, $1
ld [wcc3c], a ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld hl, CopycatsHouse2FText_5ccd4 ld hl, CopycatsHouse2FText_5ccd4
call PrintText call PrintText
ld b, POKE_DOLL ld b, POKE_DOLL

View file

@ -24,7 +24,7 @@ DayCareMText1: ; 56254 (15:6254)
ld hl, DayCareMText_56414 ld hl, DayCareMText_56414
call PrintText call PrintText
xor a xor a
ld [wcfcb], a ld [wUpdateSpritesEnabled], a
ld [wd07d], a ld [wd07d], a
ld [wMenuItemToSwap], a ld [wMenuItemToSwap], a
call DisplayPartyMenu call DisplayPartyMenu

View file

@ -149,7 +149,7 @@ FightingDojoText1: ; 5ce44 (17:4e44)
ld de, FightingDojoText_5ce93 ld de, FightingDojoText_5ce93
call PreBattleSaveRegisters call PreBattleSaveRegisters
ldh a, [$8c] ldh a, [$8c]
ld [wcf13], a ld [wSpriteIndex], a
call EngageMapTrainer call EngageMapTrainer
call InitBattleEnemyParameters call InitBattleEnemyParameters
ld a, $3 ld a, $3

View file

@ -168,7 +168,7 @@ FuchsiaGymText1: ; 75534 (1d:5534)
ld de, UnnamedText_75586 ld de, UnnamedText_75586
call PreBattleSaveRegisters call PreBattleSaveRegisters
ldh a, [$8c] ldh a, [$8c]
ld [wcf13], a ld [wSpriteIndex], a
call EngageMapTrainer call EngageMapTrainer
call InitBattleEnemyParameters call InitBattleEnemyParameters
ld a, $5 ld a, $5

View file

@ -106,7 +106,7 @@ Mansion1Text4: ; 4435a (11:435a)
and a and a
jr nz, .asm_4438c ; 0x44368 $22 jr nz, .asm_4438c ; 0x44368 $22
ld a, $1 ld a, $1
ld [wcc3c], a ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld hl, wd126 ld hl, wd126
set 5, [hl] set 5, [hl]
ld hl, MansionSwitchPressedText ld hl, MansionSwitchPressedText

View file

@ -112,7 +112,7 @@ Mansion2Text5: ; 52087 (14:6087)
and a and a
jr nz, .asm_520b9 ; 0x52095 $22 jr nz, .asm_520b9 ; 0x52095 $22
ld a, $1 ld a, $1
ld [wcc3c], a ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld hl, wd126 ld hl, wd126
set 5, [hl] set 5, [hl]
ld hl, Mansion2Text_520c7 ld hl, Mansion2Text_520c7

View file

@ -40,7 +40,7 @@ Mansion3ScriptPointers: ; 52235 (14:6235)
Mansion3Script0: ; 5223b (14:623b) Mansion3Script0: ; 5223b (14:623b)
ld hl, CoordsData_52254 ld hl, CoordsData_52254
call Mansion3Script_5225b call Mansion3Script_5225b
ld a, [wd71e] ld a, [wWhichDungeonWarp]
and a and a
jp z, CheckFightingMapTrainers jp z, CheckFightingMapTrainers
cp $3 cp $3
@ -48,7 +48,7 @@ Mansion3Script0: ; 5223b (14:623b)
jr nz, .asm_52250 jr nz, .asm_52250
ld a, $d6 ld a, $d6
.asm_52250 .asm_52250
ld [wd71d], a ld [wDungeonWarpDestinationMap], a
ret ret
CoordsData_52254: ; 52254 (14:6254) CoordsData_52254: ; 52254 (14:6254)
@ -59,14 +59,14 @@ CoordsData_52254: ; 52254 (14:6254)
Mansion3Script_5225b: ; 5225b (14:625b) Mansion3Script_5225b: ; 5225b (14:625b)
xor a xor a
ld [wd71e], a ld [wWhichDungeonWarp], a
ld a, [wd72d] ld a, [wd72d]
bit 4, a bit 4, a
ret nz ret nz
call ArePlayerCoordsInArray call ArePlayerCoordsInArray
ret nc ret nc
ld a, [wWhichTrade] ; wWhichTrade ld a, [wWhichTrade] ; wWhichTrade
ld [wd71e], a ld [wWhichDungeonWarp], a
ld hl, wd72d ld hl, wd72d
set 4, [hl] set 4, [hl]
ld hl, wd732 ld hl, wd732

View file

@ -138,7 +138,7 @@ MtMoon3Script5: ; 49dfb (12:5dfb)
ld a, $f0 ld a, $f0
ld [wJoyIgnore], a ld [wJoyIgnore], a
ld a, $1 ld a, $1
ld [wcc3c], a ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld a, $a ld a, $a
ld [H_DOWNARROWBLINKCNT2], a ; $ff8c ld [H_DOWNARROWBLINKCNT2], a ; $ff8c
call DisplayTextID call DisplayTextID
@ -230,7 +230,7 @@ MtMoon3Text1: ; 49e79 (12:5e79)
ld de, MtMoon3Text_49f8a ld de, MtMoon3Text_49f8a
call PreBattleSaveRegisters call PreBattleSaveRegisters
ldh a, [$8c] ldh a, [$8c]
ld [wcf13], a ld [wSpriteIndex], a
call EngageMapTrainer call EngageMapTrainer
call InitBattleEnemyParameters call InitBattleEnemyParameters
ld a, $3 ld a, $3
@ -270,7 +270,7 @@ MtMoon3Text5: ; 49edf (12:5edf)
MtMoon3Text6: ; 49ee9 (12:5ee9) MtMoon3Text6: ; 49ee9 (12:5ee9)
db $08 ; asm db $08 ; asm
ld a, $1 ld a, $1
ld [wcc3c], a ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld hl, MtMoon3Text_49f24 ld hl, MtMoon3Text_49f24
call PrintText call PrintText
call YesNoChoice call YesNoChoice
@ -299,7 +299,7 @@ MtMoon3Text_49f24: ; 49f24 (12:5f24)
MtMoon3Text7: ; 49f29 (12:5f29) MtMoon3Text7: ; 49f29 (12:5f29)
db $08 ; asm db $08 ; asm
ld a, $1 ld a, $1
ld [wcc3c], a ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld hl, MtMoon3Text_49f64 ld hl, MtMoon3Text_49f64
call PrintText call PrintText
call YesNoChoice call YesNoChoice

View file

@ -1,8 +1,8 @@
Museum1FScript: ; 5c0f7 (17:40f7) Museum1FScript: ; 5c0f7 (17:40f7)
ld a, $1 ld a, $1
ld [wcf0c], a ld [wAutoTextBoxDrawingControl], a
xor a xor a
ld [wcc3c], a ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld hl, Museum1FScriptPointers ld hl, Museum1FScriptPointers
ld a, [W_MUSEUM1FCURSCRIPT] ld a, [W_MUSEUM1FCURSCRIPT]
jp CallFunctionInTable jp CallFunctionInTable

View file

@ -50,7 +50,7 @@ NameRaterText1: ; 1da56 (7:5a56)
call PrintText call PrintText
xor a xor a
ld [wd07d], a ld [wd07d], a
ld [wcfcb], a ld [wUpdateSpritesEnabled], a
ld [wMenuItemToSwap], a ld [wMenuItemToSwap], a
call DisplayPartyMenu call DisplayPartyMenu
push af push af

View file

@ -3,9 +3,9 @@ OaksLabScript: ; 1cb0e (7:4b0e)
bit 6, a bit 6, a
call nz, OaksLabScript_1d076 call nz, OaksLabScript_1d076
ld a, $1 ld a, $1
ld [wcf0c], a ld [wAutoTextBoxDrawingControl], a
xor a xor a
ld [wcc3c], a ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld hl, OaksLabScriptPointers ld hl, OaksLabScriptPointers
ld a, [W_OAKSLABCURSCRIPT] ld a, [W_OAKSLABCURSCRIPT]
jp CallFunctionInTable jp CallFunctionInTable
@ -374,7 +374,7 @@ OaksLabScript11: ; 1cdb9 (7:4db9)
.done .done
ld [W_TRAINERNO], a ld [W_TRAINERNO], a
ld a, $1 ld a, $1
ld [wcf13], a ld [wSpriteIndex], a
call GetSpritePosition1 call GetSpritePosition1
ld hl, OaksLabText_1d3be ld hl, OaksLabText_1d3be
ld de, OaksLabText_1d3c3 ld de, OaksLabText_1d3c3
@ -397,7 +397,7 @@ OaksLabScript12: ; 1ce03 (7:4e03)
ld [wd528], a ld [wd528], a
call UpdateSprites call UpdateSprites
ld a, $1 ld a, $1
ld [wcf13], a ld [wSpriteIndex], a
call SetSpritePosition1 call SetSpritePosition1
ld a, $1 ld a, $1
ld [H_SPRITEINDEX], a ld [H_SPRITEINDEX], a
@ -680,7 +680,7 @@ OaksLabScript_1d02b: ; 1d02b (7:502b)
ld a, b ld a, b
ld [$ffed], a ld [$ffed], a
ld a, $1 ld a, $1
ld [wcf13], a ld [wSpriteIndex], a
call SetSpritePosition1 call SetSpritePosition1
ret ret
@ -801,7 +801,7 @@ OaksLabScript_1d133: ; 1d133 (7:5133)
ld [wcf91], a ld [wcf91], a
ld [wd11e], a ld [wd11e], a
ld a, b ld a, b
ld [wcf13], a ld [wSpriteIndex], a
ld a, [wd74b] ld a, [wd74b]
bit 2, a bit 2, a
jp nz, OaksLabScript_1d22d jp nz, OaksLabScript_1d22d
@ -837,7 +837,7 @@ OaksLabScript_1d157: ; 1d157 (7:5157)
call ReloadMapData call ReloadMapData
ld c, $a ld c, $a
call DelayFrames call DelayFrames
ld a, [wcf13] ld a, [wSpriteIndex]
cp $2 cp $2
jr z, OaksLabLookAtCharmander jr z, OaksLabLookAtCharmander
cp $3 cp $3
@ -868,7 +868,7 @@ OaksLabBulbasaurText: ; 1d1ae (7:51ae)
OaksLabMonChoiceMenu: ; 1d1b3 (7:51b3) OaksLabMonChoiceMenu: ; 1d1b3 (7:51b3)
call PrintText call PrintText
ld a, $1 ld a, $1
ld [wcc3c], a ld [wDoNotWaitForButtonPressAfterDisplayingText], a
call YesNoChoice ; yes/no menu call YesNoChoice ; yes/no menu
ld a, [wCurrentMenuItem] ld a, [wCurrentMenuItem]
and a and a
@ -877,7 +877,7 @@ OaksLabMonChoiceMenu: ; 1d1b3 (7:51b3)
ld [W_PLAYERSTARTER], a ld [W_PLAYERSTARTER], a
ld [wd11e], a ld [wd11e], a
call GetMonName call GetMonName
ld a, [wcf13] ld a, [wSpriteIndex]
cp $2 cp $2
jr nz, asm_1d1db ; 0x1d1d5 $4 jr nz, asm_1d1db ; 0x1d1d5 $4
ld a, $2b ld a, $2b
@ -893,7 +893,7 @@ asm_1d1e5: ; 1d1e5 (7:51e5)
ld [wcc4d], a ld [wcc4d], a
predef HideObject predef HideObject
ld a, $1 ld a, $1
ld [wcc3c], a ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld hl, OaksLabMonEnergeticText ld hl, OaksLabMonEnergeticText
call PrintText call PrintText
ld hl, OaksLabReceivedMonText ld hl, OaksLabReceivedMonText
@ -956,7 +956,7 @@ OaksLabText5: ; 1d248 (7:5248)
ld hl, OaksLabText_1d31d ld hl, OaksLabText_1d31d
call PrintText call PrintText
ld a, $1 ld a, $1
ld [wcc3c], a ld [wDoNotWaitForButtonPressAfterDisplayingText], a
predef DisplayDexRating predef DisplayDexRating
jp .asm_0f042 jp .asm_0f042
.asm_b28b0 ; 0x1d279 .asm_b28b0 ; 0x1d279

View file

@ -109,7 +109,7 @@ PalletTownScript3: ; 18f12 (6:4f12)
ld a,$FF ld a,$FF
ld [wJoyIgnore],a ld [wJoyIgnore],a
ld a,1 ld a,1
ld [wcf13],a ld [wSpriteIndex],a
xor a xor a
ld [wNPCMovementScriptFunctionNum],a ld [wNPCMovementScriptFunctionNum],a
ld a,1 ld a,1
@ -171,7 +171,7 @@ PalletTownText1: ; 18f96 (6:4f96)
and a and a
jr nz,.next jr nz,.next
ld a,1 ld a,1
ld [wcc3c],a ld [wDoNotWaitForButtonPressAfterDisplayingText],a
ld hl,OakAppearsText ld hl,OakAppearsText
jr .done jr .done
.next .next

View file

@ -68,7 +68,7 @@ PewterCityScript1: ; 19280 (6:5280)
ld a, $11 ld a, $11
ld [$ffee], a ld [$ffee], a
ld a, $3 ld a, $3
ld [wcf13], a ld [wSpriteIndex], a
call SetSpritePosition1 call SetSpritePosition1
ld a, $3 ld a, $3
ld [$ff8c], a ld [$ff8c], a
@ -94,7 +94,7 @@ PewterCityScript2: ; 192d3 (6:52d3)
PewterCityScript3: ; 192e9 (6:52e9) PewterCityScript3: ; 192e9 (6:52e9)
ld a, $3 ld a, $3
ld [wcf13], a ld [wSpriteIndex], a
call SetSpritePosition2 call SetSpritePosition2
ld a, $3 ld a, $3
ld [wcc4d], a ld [wcc4d], a
@ -132,7 +132,7 @@ PewterCityScript4: ; 19305 (6:5305)
ld a, $10 ld a, $10
ld [$ffee], a ld [$ffee], a
ld a, $5 ld a, $5
ld [wcf13], a ld [wSpriteIndex], a
call SetSpritePosition1 call SetSpritePosition1
ld a, $5 ld a, $5
ld [$ff8c], a ld [$ff8c], a
@ -158,7 +158,7 @@ PewterCityScript5: ; 19359 (6:5359)
PewterCityScript6: ; 1936f (6:536f) PewterCityScript6: ; 1936f (6:536f)
ld a, $5 ld a, $5
ld [wcf13], a ld [wSpriteIndex], a
call SetSpritePosition2 call SetSpritePosition2
ld a, $4 ld a, $4
ld [wcc4d], a ld [wcc4d], a
@ -216,7 +216,7 @@ PewterCityText3: ; 193b1 (6:53b1)
ldh a, [$b8] ldh a, [$b8]
ld [wNPCMovementScriptBank], a ld [wNPCMovementScriptBank], a
ld a, $3 ld a, $3
ld [wcf13], a ld [wSpriteIndex], a
call GetSpritePosition2 call GetSpritePosition2
ld a, $1 ld a, $1
ld [W_PEWTERCITYCURSCRIPT], a ld [W_PEWTERCITYCURSCRIPT], a
@ -280,7 +280,7 @@ PewterCityText5: ; 19436 (6:5436)
ldh a, [$b8] ldh a, [$b8]
ld [wNPCMovementScriptBank], a ld [wNPCMovementScriptBank], a
ld a, $5 ld a, $5
ld [wcf13], a ld [wSpriteIndex], a
call GetSpritePosition2 call GetSpritePosition2
ld a, $4 ld a, $4
ld [W_PEWTERCITYCURSCRIPT], a ld [W_PEWTERCITYCURSCRIPT], a

View file

@ -128,7 +128,7 @@ PewterGymText1: ; 5c44e (17:444e)
ld de, PewterGymText_5c4bc ld de, PewterGymText_5c4bc
call PreBattleSaveRegisters call PreBattleSaveRegisters
ldh a, [$8c] ldh a, [$8c]
ld [wcf13], a ld [wSpriteIndex], a
call EngageMapTrainer call EngageMapTrainer
call InitBattleEnemyParameters call InitBattleEnemyParameters
ld a, $1 ld a, $1

View file

@ -1,7 +1,7 @@
PewterMartScript: ; 74cad (1d:4cad) PewterMartScript: ; 74cad (1d:4cad)
call EnableAutoTextBoxDrawing call EnableAutoTextBoxDrawing
ld a, $1 ld a, $1
ld [wcf0c], a ld [wAutoTextBoxDrawingControl], a
ret ret
PewterMartTextPointers: ; 74cb6 (1d:4cb6) PewterMartTextPointers: ; 74cb6 (1d:4cb6)

View file

@ -18,7 +18,7 @@ PewterPokecenterText2: ; 5c596 (17:4596)
PewterPokecenterText3: ; 5c59b (17:459b) PewterPokecenterText3: ; 5c59b (17:459b)
db $8 db $8
ld a, $1 ld a, $1
ld [wcc3c], a ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld hl, PewterPokecenterText5 ld hl, PewterPokecenterText5
call PrintText call PrintText
ld a, $ff ld a, $ff

View file

@ -33,10 +33,10 @@ PokemonTower5Script0: ; 6094b (18:494b)
ld hl, wd72e ld hl, wd72e
set 4, [hl] set 4, [hl]
predef HealParty predef HealParty
call GBFadeOut2 call GBFadeOutToWhite
call Delay3 call Delay3
call Delay3 call Delay3
call GBFadeIn2 call GBFadeInFromWhite
ld a, $7 ld a, $7
ld [H_DOWNARROWBLINKCNT2], a ; $ff8c ld [H_DOWNARROWBLINKCNT2], a ; $ff8c
call DisplayTextID call DisplayTextID

View file

@ -30,7 +30,7 @@ PokemonTower7Script2: ; 60d23 (18:4d23)
call EndTrainerBattle call EndTrainerBattle
ld a, $f0 ld a, $f0
ld [wJoyIgnore], a ld [wJoyIgnore], a
ld a, [wcf13] ld a, [wSpriteIndex]
ld [H_DOWNARROWBLINKCNT2], a ; $ff8c ld [H_DOWNARROWBLINKCNT2], a ; $ff8c
call DisplayTextID call DisplayTextID
call PokemonTower7Script_60db6 call PokemonTower7Script_60db6
@ -44,7 +44,7 @@ PokemonTower7Script3: ; 60d56 (18:4d56)
bit 0, a bit 0, a
ret nz ret nz
ld hl, W_MISSABLEOBJECTLIST ld hl, W_MISSABLEOBJECTLIST
ld a, [wcf13] ld a, [wSpriteIndex]
ld b, a ld b, a
.missableObjectsListLoop .missableObjectsListLoop
ld a, [hli] ld a, [hli]
@ -55,7 +55,7 @@ PokemonTower7Script3: ; 60d56 (18:4d56)
predef HideObject predef HideObject
xor a xor a
ld [wJoyIgnore], a ld [wJoyIgnore], a
ld [wcf13], a ld [wSpriteIndex], a
ld [wTrainerHeaderFlagBit], a ld [wTrainerHeaderFlagBit], a
ld [wda38], a ld [wda38], a
ld a, $0 ld a, $0
@ -74,7 +74,7 @@ PokemonTower7Script4: ; 60d86 (18:4d86)
ld a, $95 ld a, $95
ld [H_DOWNARROWBLINKCNT1], a ; $ff8b ld [H_DOWNARROWBLINKCNT1], a ; $ff8b
ld a, $1 ld a, $1
ld [wd42f], a ld [wDestinationWarpID], a
ld a, LAVENDER_TOWN ld a, LAVENDER_TOWN
ld [wLastMap], a ld [wLastMap], a
ld hl, wd72d ld hl, wd72d
@ -86,7 +86,7 @@ PokemonTower7Script4: ; 60d86 (18:4d86)
PokemonTower7Script_60db6: ; 60db6 (18:4db6) PokemonTower7Script_60db6: ; 60db6 (18:4db6)
ld hl, CoordsData_60de3 ; $4de3 ld hl, CoordsData_60de3 ; $4de3
ld a, [wcf13] ld a, [wSpriteIndex]
dec a dec a
swap a swap a
ld d, $0 ld d, $0
@ -106,7 +106,7 @@ PokemonTower7Script_60db6: ; 60db6 (18:4db6)
ld a, [hli] ld a, [hli]
ld d, [hl] ld d, [hl]
ld e, a ld e, a
ld a, [wcf13] ld a, [wSpriteIndex]
ld [H_DOWNARROWBLINKCNT2], a ; $ff8c ld [H_DOWNARROWBLINKCNT2], a ; $ff8c
jp MoveSprite jp MoveSprite
.asm_60dde .asm_60dde

View file

@ -25,7 +25,7 @@ MomWakeUpText: ; 48185 (12:4185)
MomHealPokemon: ; 4818a (12:418a) MomHealPokemon: ; 4818a (12:418a)
ld hl, MomHealText1 ld hl, MomHealText1
call PrintText call PrintText
call GBFadeOut2 call GBFadeOutToWhite
call ReloadMapData call ReloadMapData
predef HealParty predef HealParty
ld a, MUSIC_PKMN_HEALED ld a, MUSIC_PKMN_HEALED
@ -38,7 +38,7 @@ MomHealPokemon: ; 4818a (12:418a)
ld a, [wd35b] ld a, [wd35b]
ld [wc0ee], a ld [wc0ee], a
call PlaySound call PlaySound
call GBFadeIn2 call GBFadeInFromWhite
ld hl, MomHealText2 ld hl, MomHealText2
jp PrintText jp PrintText

View file

@ -58,7 +58,7 @@ RocketHideout4Script3: ; 454b6 (11:54b6)
ld a, $a ld a, $a
ld [H_SPRITEHEIGHT], a ld [H_SPRITEHEIGHT], a
call DisplayTextID call DisplayTextID
call GBFadeIn1 call GBFadeOutToBlack
ld a, $83 ld a, $83
ld [wcc4d], a ld [wcc4d], a
predef HideObject predef HideObject
@ -66,7 +66,7 @@ RocketHideout4Script3: ; 454b6 (11:54b6)
ld [wcc4d], a ld [wcc4d], a
predef ShowObject predef ShowObject
call UpdateSprites call UpdateSprites
call GBFadeOut1 call GBFadeInFromBlack
xor a xor a
ld [wJoyIgnore], a ld [wJoyIgnore], a
ld hl, wd126 ld hl, wd126
@ -132,7 +132,7 @@ RocketHideout4Text1: ; 4553a (11:553a)
ld de, RocketHideout4Text_4557f ld de, RocketHideout4Text_4557f
call PreBattleSaveRegisters call PreBattleSaveRegisters
ldh a, [$8c] ldh a, [$8c]
ld [wcf13], a ld [wSpriteIndex], a
call EngageMapTrainer call EngageMapTrainer
call InitBattleEnemyParameters call InitBattleEnemyParameters
xor a xor a

View file

@ -9,13 +9,13 @@ RocketHideoutElevatorScript: ; 45710 (11:5710)
res 7, [hl] res 7, [hl]
call nz, RocketHideoutElevatorScript_4575f call nz, RocketHideoutElevatorScript_4575f
xor a xor a
ld [wcf0c], a ld [wAutoTextBoxDrawingControl], a
inc a inc a
ld [wcc3c], a ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ret ret
RocketHideoutElevatorScript_4572c: ; 4572c (11:572c) RocketHideoutElevatorScript_4572c: ; 4572c (11:572c)
ld hl, wd3af ld hl, wWarpEntries
ld a, [wd73b] ld a, [wd73b]
ld b, a ld b, a
ld a, [wd73c] ld a, [wd73c]

View file

@ -75,5 +75,5 @@ Route12GateUpstairsScript_495c9: ; 495c9 (12:55c9)
call PrintText call PrintText
xor a xor a
.asm_495d8 .asm_495d8
ld [wcc3c], a ld [wDoNotWaitForButtonPressAfterDisplayingText], a
jp TextScriptEnd jp TextScriptEnd

View file

@ -83,7 +83,7 @@ Route22Script0: ; 50f00 (14:4f00)
xor a xor a
ld [wcd50], a ld [wcd50], a
predef EmotionBubble predef EmotionBubble
ld a, [wd700] ld a, [wWalkBikeSurfState]
and a and a
jr z, .asm_50f4e ; 0x50f44 $8 jr z, .asm_50f4e ; 0x50f44 $8
ld a, $ff ld a, $ff
@ -222,7 +222,7 @@ Route22Script_5104e: ; 5104e (14:504e)
xor a xor a
ld [wcd50], a ld [wcd50], a
predef EmotionBubble predef EmotionBubble
ld a, [wd700] ld a, [wWalkBikeSurfState]
and a and a
jr z, .skipYVisibilityTesta jr z, .skipYVisibilityTesta
ld a, $ff ld a, $ff

View file

@ -171,7 +171,7 @@ Route24Text1: ; 514a4 (14:54a4)
ld de, Route24Text_5152b ld de, Route24Text_5152b
call PreBattleSaveRegisters call PreBattleSaveRegisters
ld a, [$ff8c] ld a, [$ff8c]
ld [wcf13], a ld [wSpriteIndex], a
call EngageMapTrainer call EngageMapTrainer
call InitBattleEnemyParameters call InitBattleEnemyParameters
xor a xor a

View file

@ -180,7 +180,7 @@ SaffronGymText1: ; 5d118 (17:5118)
ld de, SaffronGymText_5d167 ld de, SaffronGymText_5d167
call PreBattleSaveRegisters call PreBattleSaveRegisters
ldh a, [$8c] ldh a, [$8c]
ld [wcf13], a ld [wSpriteIndex], a
call EngageMapTrainer call EngageMapTrainer
call InitBattleEnemyParameters call InitBattleEnemyParameters
ld a, $6 ld a, $6

View file

@ -34,7 +34,7 @@ SeafoamIslands1Script: ; 447e9 (11:47e9)
predef_jump ShowObject predef_jump ShowObject
.asm_4483b .asm_4483b
ld a, $9f ld a, $9f
ld [wd71d], a ld [wDungeonWarpDestinationMap], a
ld hl, Seafoam1HolesCoords ld hl, Seafoam1HolesCoords
jp Func_46981 jp Func_46981

View file

@ -32,7 +32,7 @@ SeafoamIslands2Script: ; 46315 (11:6315)
predef_jump ShowObject predef_jump ShowObject
.asm_46362 .asm_46362
ld a, $a0 ld a, $a0
ld [wd71d], a ld [wDungeonWarpDestinationMap], a
ld hl, Seafoam2HolesCoords ld hl, Seafoam2HolesCoords
jp Func_46981 jp Func_46981

View file

@ -32,7 +32,7 @@ SeafoamIslands3Script: ; 46451 (11:6451)
predef_jump ShowObject predef_jump ShowObject
.asm_4649e .asm_4649e
ld a, $a1 ld a, $a1
ld [wd71d], a ld [wDungeonWarpDestinationMap], a
ld hl, Seafoam3HolesCoords ld hl, Seafoam3HolesCoords
jp Func_46981 jp Func_46981

View file

@ -33,7 +33,7 @@ SeafoamIslands4Script: ; 4658d (11:658d)
jr .asm_465ed ; 0x465da $11 jr .asm_465ed ; 0x465da $11
.asm_465dc .asm_465dc
ld a, $a2 ld a, $a2
ld [wd71d], a ld [wDungeonWarpDestinationMap], a
ld hl, Seafoam4HolesCoords ld hl, Seafoam4HolesCoords
call Func_46981 call Func_46981
ld a, [wd732] ld a, [wd732]

View file

@ -130,8 +130,8 @@ SeafoamIslands5Script3: ; 46860 (11:6860)
SeaFoamIslands5Script_46872: ; 46872 (11:6872) SeaFoamIslands5Script_46872: ; 46872 (11:6872)
xor a xor a
ld [wd700], a ld [wWalkBikeSurfState], a
ld [wd11a], a ld [wWalkBikeSurfStateCopy], a
jp ForceBikeOrSurf jp ForceBikeOrSurf
SeafoamIslands5TextPointers: ; 4687c (11:687c) SeafoamIslands5TextPointers: ; 4687c (11:687c)

View file

@ -182,11 +182,11 @@ SilphCo11Script5: ; 62227 (18:6227)
ld a, $6 ld a, $6
ld [H_DOWNARROWBLINKCNT2], a ; $ff8c ld [H_DOWNARROWBLINKCNT2], a ; $ff8c
call DisplayTextID call DisplayTextID
call GBFadeIn1 call GBFadeOutToBlack
call SilphCo11Script_6216d call SilphCo11Script_6216d
call UpdateSprites call UpdateSprites
call Delay3 call Delay3
call GBFadeOut1 call GBFadeInFromBlack
ld hl, wd838 ld hl, wd838
set 7, [hl] set 7, [hl]
xor a xor a
@ -223,7 +223,7 @@ SilphCo11Script4: ; 62293 (18:6293)
ld de, SilphCo10Text_62330 ; $6330 ld de, SilphCo10Text_62330 ; $6330
call PreBattleSaveRegisters call PreBattleSaveRegisters
ld a, [H_DOWNARROWBLINKCNT2] ; $ff8c ld a, [H_DOWNARROWBLINKCNT2] ; $ff8c
ld [wcf13], a ld [wSpriteIndex], a
call EngageMapTrainer call EngageMapTrainer
call InitBattleEnemyParameters call InitBattleEnemyParameters
xor a xor a

Some files were not shown because too many files have changed in this diff Show more