2014-05-22 22:13:20 +00:00
|
|
|
SetDefaultNames: ; 60ca (1:60ca)
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a, [wd358]
|
2014-05-22 22:13:20 +00:00
|
|
|
push af
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a, [W_OPTIONS] ; W_OPTIONS
|
2014-05-22 22:13:20 +00:00
|
|
|
push af
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a, [wd732]
|
2014-05-22 22:13:20 +00:00
|
|
|
push af
|
2014-06-14 11:12:40 +00:00
|
|
|
ld hl, wPlayerName ; wd158
|
2014-05-22 22:13:20 +00:00
|
|
|
ld bc, $d8a
|
|
|
|
xor a
|
|
|
|
call FillMemory
|
|
|
|
ld hl, wSpriteStateData1
|
|
|
|
ld bc, $200
|
|
|
|
xor a
|
|
|
|
call FillMemory
|
|
|
|
pop af
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wd732], a
|
2014-05-22 22:13:20 +00:00
|
|
|
pop af
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [W_OPTIONS], a ; W_OPTIONS
|
2014-05-22 22:13:20 +00:00
|
|
|
pop af
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wd358], a
|
|
|
|
ld a, [wd08a]
|
2014-05-22 22:13:20 +00:00
|
|
|
and a
|
|
|
|
call z, Func_5bff
|
|
|
|
ld hl, NintenText
|
2014-06-14 11:12:40 +00:00
|
|
|
ld de, wPlayerName ; wd158
|
2014-05-22 22:13:20 +00:00
|
|
|
ld bc, $b
|
|
|
|
call CopyData
|
|
|
|
ld hl, SonyText
|
2014-05-26 21:04:56 +00:00
|
|
|
ld de, W_RIVALNAME ; wd34a
|
2014-05-22 22:13:20 +00:00
|
|
|
ld bc, $b
|
|
|
|
jp CopyData
|
|
|
|
|
|
|
|
OakSpeech: ; 6115 (1:6115)
|
|
|
|
ld a,$FF
|
|
|
|
call PlaySound ; stop music
|
|
|
|
ld a, BANK(Music_Routes2) ; bank of song
|
|
|
|
ld c,a
|
|
|
|
ld a, MUSIC_ROUTES2 ; song #
|
|
|
|
call PlayMusic ; plays music
|
|
|
|
call ClearScreen
|
|
|
|
call LoadTextBoxTilePatterns
|
|
|
|
call SetDefaultNames
|
2014-06-16 20:57:26 +00:00
|
|
|
predef InitPlayerData2
|
2014-05-26 21:04:56 +00:00
|
|
|
ld hl,wNumBoxItems
|
2014-05-22 22:13:20 +00:00
|
|
|
ld a,POTION
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wcf91],a
|
2014-05-22 22:13:20 +00:00
|
|
|
ld a,1
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wcf96],a
|
2014-05-22 22:13:20 +00:00
|
|
|
call AddItemToInventory ; give one potion
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a,[W_ANIMATIONID]
|
2014-09-13 07:50:56 +00:00
|
|
|
ld [wDestinationMap],a
|
|
|
|
call SpecialWarpIn
|
2014-05-22 22:13:20 +00:00
|
|
|
xor a
|
2014-09-14 18:29:18 +00:00
|
|
|
ld [hTilesetType],a
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a,[wd732]
|
2014-05-22 22:13:20 +00:00
|
|
|
bit 1,a ; XXX when is bit 1 set?
|
|
|
|
jp nz,Func_61bc ; easter egg: skip the intro
|
|
|
|
ld de,ProfOakPic
|
|
|
|
ld bc, (Bank(ProfOakPic) << 8) | $00
|
|
|
|
call IntroPredef3B ; displays Oak pic?
|
|
|
|
call FadeInIntroPic
|
|
|
|
ld hl,OakSpeechText1
|
|
|
|
call PrintText ; prints text box
|
2014-09-13 07:50:56 +00:00
|
|
|
call GBFadeOutToWhite
|
2014-05-22 22:13:20 +00:00
|
|
|
call ClearScreen
|
|
|
|
ld a,NIDORINO
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wd0b5],a ; pic displayed is stored at this location
|
|
|
|
ld [wcf91],a
|
2014-05-22 22:13:20 +00:00
|
|
|
call GetMonHeader ; this is also related to the pic
|
2014-06-25 20:58:27 +00:00
|
|
|
hlCoord 6, 4 ; position on tilemap the pic is displayed
|
2014-05-22 22:13:20 +00:00
|
|
|
call LoadFlippedFrontSpriteByMonIndex ; displays pic?
|
|
|
|
call MovePicLeft
|
|
|
|
ld hl,OakSpeechText2
|
|
|
|
call PrintText ; Prints text box
|
2014-09-13 07:50:56 +00:00
|
|
|
call GBFadeOutToWhite
|
2014-05-22 22:13:20 +00:00
|
|
|
call ClearScreen
|
|
|
|
ld de,RedPicFront
|
|
|
|
ld bc,(Bank(RedPicFront) << 8) | $00
|
|
|
|
call IntroPredef3B ; displays player pic?
|
|
|
|
call MovePicLeft
|
|
|
|
ld hl,IntroducePlayerText
|
|
|
|
call PrintText
|
|
|
|
call LoadDefaultNamesPlayer ; brings up NewName/Red/etc menu
|
2014-09-13 07:50:56 +00:00
|
|
|
call GBFadeOutToWhite
|
2014-05-22 22:13:20 +00:00
|
|
|
call ClearScreen
|
|
|
|
ld de,Rival1Pic
|
|
|
|
ld bc,(Bank(Rival1Pic) << 8) | $00
|
|
|
|
call IntroPredef3B ; displays rival pic
|
|
|
|
call FadeInIntroPic
|
|
|
|
ld hl,IntroduceRivalText
|
|
|
|
call PrintText
|
|
|
|
call LoadDefaultNamesRival
|
|
|
|
|
|
|
|
Func_61bc: ; 61bc (1:61bc)
|
2014-09-13 07:50:56 +00:00
|
|
|
call GBFadeOutToWhite
|
2014-05-22 22:13:20 +00:00
|
|
|
call ClearScreen
|
|
|
|
ld de,RedPicFront
|
|
|
|
ld bc,(Bank(RedPicFront) << 8) | $00
|
|
|
|
call IntroPredef3B
|
2014-09-13 07:50:56 +00:00
|
|
|
call GBFadeInFromWhite
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a,[wd72d]
|
2014-05-22 22:13:20 +00:00
|
|
|
and a
|
|
|
|
jr nz,.next
|
|
|
|
ld hl,OakSpeechText3
|
|
|
|
call PrintText
|
|
|
|
.next
|
|
|
|
ld a,[H_LOADEDROMBANK]
|
|
|
|
push af
|
|
|
|
ld a,(SFX_02_48 - SFX_Headers_02) / 3
|
|
|
|
call PlaySound
|
|
|
|
pop af
|
|
|
|
ld [H_LOADEDROMBANK],a
|
|
|
|
ld [$2000],a
|
|
|
|
ld c,4
|
|
|
|
call DelayFrames
|
|
|
|
ld de,RedSprite ; $4180
|
2014-05-29 08:31:46 +00:00
|
|
|
ld hl,vSprites
|
2014-05-22 22:13:20 +00:00
|
|
|
ld bc,(BANK(RedSprite) << 8) | $0C
|
|
|
|
call CopyVideoData
|
|
|
|
ld de,ShrinkPic1
|
|
|
|
ld bc,(BANK(ShrinkPic1) << 8) | $00
|
|
|
|
call IntroPredef3B
|
|
|
|
ld c,4
|
|
|
|
call DelayFrames
|
|
|
|
ld de,ShrinkPic2
|
|
|
|
ld bc,(BANK(ShrinkPic2) << 8) | $00
|
|
|
|
call IntroPredef3B
|
|
|
|
call ResetPlayerSpriteData
|
|
|
|
ld a,[H_LOADEDROMBANK]
|
|
|
|
push af
|
2014-06-10 05:10:11 +00:00
|
|
|
ld a, BANK(Music_PalletTown)
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wc0ef],a
|
|
|
|
ld [wc0f0],a
|
2014-05-22 22:13:20 +00:00
|
|
|
ld a,$A
|
|
|
|
ld [wMusicHeaderPointer],a
|
|
|
|
ld a,$FF
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wc0ee],a
|
2014-05-22 22:13:20 +00:00
|
|
|
call PlaySound ; stop music
|
|
|
|
pop af
|
|
|
|
ld [H_LOADEDROMBANK],a
|
|
|
|
ld [$2000],a
|
|
|
|
ld c,$14
|
|
|
|
call DelayFrames
|
2014-06-25 20:58:27 +00:00
|
|
|
hlCoord 6, 5
|
2014-05-22 22:13:20 +00:00
|
|
|
ld b,7
|
|
|
|
ld c,7
|
|
|
|
call ClearScreenArea
|
|
|
|
call LoadTextBoxTilePatterns
|
|
|
|
ld a,1
|
2014-09-13 07:50:56 +00:00
|
|
|
ld [wUpdateSpritesEnabled],a
|
2014-05-22 22:13:20 +00:00
|
|
|
ld c,$32
|
|
|
|
call DelayFrames
|
2014-09-13 07:50:56 +00:00
|
|
|
call GBFadeOutToWhite
|
2014-05-22 22:13:20 +00:00
|
|
|
jp ClearScreen
|
|
|
|
OakSpeechText1: ; 6253 (1:6253)
|
|
|
|
TX_FAR _OakSpeechText1
|
|
|
|
db "@"
|
|
|
|
OakSpeechText2: ; 6258 (1:6258)
|
|
|
|
TX_FAR _OakSpeechText2A
|
|
|
|
db $14 ; play NIDORINA cry from TextCommandSounds
|
|
|
|
TX_FAR _OakSpeechText2B
|
|
|
|
db "@"
|
|
|
|
IntroducePlayerText: ; 6262 (1:6262)
|
|
|
|
TX_FAR _IntroducePlayerText
|
|
|
|
db "@"
|
|
|
|
IntroduceRivalText: ; 6267 (1:6267)
|
|
|
|
TX_FAR _IntroduceRivalText
|
|
|
|
db "@"
|
|
|
|
OakSpeechText3: ; 626c (1:626c)
|
|
|
|
TX_FAR _OakSpeechText3
|
|
|
|
db "@"
|
|
|
|
|
|
|
|
FadeInIntroPic: ; 6271 (1:6271)
|
|
|
|
ld hl,IntroFadePalettes
|
|
|
|
ld b,6
|
|
|
|
.next
|
|
|
|
ld a,[hli]
|
|
|
|
ld [rBGP],a
|
|
|
|
ld c,10
|
|
|
|
call DelayFrames
|
|
|
|
dec b
|
|
|
|
jr nz,.next
|
|
|
|
ret
|
|
|
|
|
|
|
|
IntroFadePalettes: ; 6282 (1:6282)
|
|
|
|
db %01010100
|
|
|
|
db %10101000
|
|
|
|
db %11111100
|
|
|
|
db %11111000
|
|
|
|
db %11110100
|
|
|
|
db %11100100
|
|
|
|
|
|
|
|
MovePicLeft: ; 6288 (1:6288)
|
|
|
|
ld a,119
|
|
|
|
ld [$FF4B],a
|
|
|
|
call DelayFrame
|
|
|
|
|
|
|
|
ld a,$E4
|
|
|
|
ld [rBGP],a
|
|
|
|
.next
|
|
|
|
call DelayFrame
|
|
|
|
ld a,[$FF4B]
|
|
|
|
sub 8
|
|
|
|
cp $FF
|
|
|
|
ret z
|
|
|
|
ld [$FF4B],a
|
|
|
|
jr .next
|
|
|
|
|
|
|
|
Predef3B: ; 62a1 (1:62a1)
|
2014-05-23 22:11:09 +00:00
|
|
|
call GetPredefRegisters
|
2014-05-22 22:13:20 +00:00
|
|
|
IntroPredef3B: ; 62a4 (1:62a4)
|
|
|
|
; bank of sprite given in b
|
|
|
|
push bc
|
|
|
|
ld a,b
|
|
|
|
call UncompressSpriteFromDE
|
|
|
|
ld hl,S_SPRITEBUFFER1
|
2014-06-25 22:49:52 +00:00
|
|
|
ld de,S_SPRITEBUFFER0
|
2014-05-29 08:31:46 +00:00
|
|
|
ld bc,$310
|
2014-05-22 22:13:20 +00:00
|
|
|
call CopyData
|
2014-05-29 08:31:46 +00:00
|
|
|
ld de,vFrontPic
|
2014-05-22 22:13:20 +00:00
|
|
|
call InterlaceMergeSpriteBuffers
|
|
|
|
pop bc
|
|
|
|
ld a,c
|
|
|
|
and a
|
2014-06-25 20:58:27 +00:00
|
|
|
hlCoord 15, 1
|
2014-05-22 22:13:20 +00:00
|
|
|
jr nz,.next
|
2014-06-25 20:58:27 +00:00
|
|
|
hlCoord 6, 4
|
2014-05-22 22:13:20 +00:00
|
|
|
.next
|
|
|
|
xor a
|
|
|
|
ld [$FFE1],a
|
2014-06-16 20:57:26 +00:00
|
|
|
predef_jump Func_3f0c6
|