pokered/engine/oak_speech.asm

234 lines
4.3 KiB
NASM
Raw Normal View History

2014-05-22 22:13:20 +00:00
SetDefaultNames: ; 60ca (1:60ca)
2015-07-15 02:46:52 +00:00
ld a, [wLetterPrintingDelayFlags]
2014-05-22 22:13:20 +00:00
push af
ld a, [W_OPTIONS]
2014-05-22 22:13:20 +00:00
push af
ld a, [wd732]
2014-05-22 22:13:20 +00:00
push af
ld hl, wPlayerName
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
ld [wd732], a
2014-05-22 22:13:20 +00:00
pop af
ld [W_OPTIONS], a
2014-05-22 22:13:20 +00:00
pop af
2015-07-15 02:46:52 +00:00
ld [wLetterPrintingDelayFlags], a
2015-07-19 03:49:52 +00:00
ld a, [wOptionsInitialized]
2014-05-22 22:13:20 +00:00
and a
2015-07-19 03:49:52 +00:00
call z, InitOptions
2014-05-22 22:13:20 +00:00
ld hl, NintenText
ld de, wPlayerName
2014-05-22 22:13:20 +00:00
ld bc, $b
call CopyData
ld hl, SonyText
ld de, W_RIVALNAME
2014-05-22 22:13:20 +00:00
ld bc, $b
jp CopyData
OakSpeech: ; 6115 (1:6115)
ld a,$FF
call PlaySound ; stop music
2015-07-18 15:17:29 +00:00
ld a, BANK(Music_Routes2)
2014-05-22 22:13:20 +00:00
ld c,a
2015-07-18 15:17:29 +00:00
ld a, MUSIC_ROUTES2
call PlayMusic
2014-05-22 22:13:20 +00:00
call ClearScreen
call LoadTextBoxTilePatterns
call SetDefaultNames
predef InitPlayerData2
ld hl,wNumBoxItems
2014-05-22 22:13:20 +00:00
ld a,POTION
ld [wcf91],a
2014-05-22 22:13:20 +00:00
ld a,1
2015-07-13 06:00:48 +00:00
ld [wItemQuantity],a
2014-05-22 22:13:20 +00:00
call AddItemToInventory ; give one potion
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
ld a,[wd732]
2015-07-18 15:17:29 +00:00
bit 1,a ; possibly a debug mode bit
jp nz,.skipChoosingNames
2014-05-22 22:13:20 +00:00
ld de,ProfOakPic
ld bc, (Bank(ProfOakPic) << 8) | $00
2015-07-18 15:17:29 +00:00
call IntroDisplayPicCenteredOrUpperRight
2014-05-22 22:13:20 +00:00
call FadeInIntroPic
ld hl,OakSpeechText1
2015-07-18 15:17:29 +00:00
call PrintText
2014-09-13 07:50:56 +00:00
call GBFadeOutToWhite
2014-05-22 22:13:20 +00:00
call ClearScreen
ld a,NIDORINO
2015-07-18 15:17:29 +00:00
ld [wd0b5],a
ld [wcf91],a
2015-07-18 15:17:29 +00:00
call GetMonHeader
2015-07-18 20:52:03 +00:00
coord hl, 6, 4
2015-07-18 15:17:29 +00:00
call LoadFlippedFrontSpriteByMonIndex
2014-05-22 22:13:20 +00:00
call MovePicLeft
ld hl,OakSpeechText2
2015-07-18 15:17:29 +00:00
call PrintText
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
2015-07-18 15:17:29 +00:00
call IntroDisplayPicCenteredOrUpperRight
2014-05-22 22:13:20 +00:00
call MovePicLeft
ld hl,IntroducePlayerText
call PrintText
2015-07-18 15:17:29 +00:00
call ChoosePlayerName
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
2015-07-18 15:17:29 +00:00
call IntroDisplayPicCenteredOrUpperRight
2014-05-22 22:13:20 +00:00
call FadeInIntroPic
ld hl,IntroduceRivalText
call PrintText
2015-07-18 15:17:29 +00:00
call ChooseRivalName
.skipChoosingNames
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
2015-07-18 15:17:29 +00:00
call IntroDisplayPicCenteredOrUpperRight
2014-09-13 07:50:56 +00:00
call GBFadeInFromWhite
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
2015-07-19 08:46:12 +00:00
ld a,SFX_SHRINK
2014-05-22 22:13:20 +00:00
call PlaySound
pop af
ld [H_LOADEDROMBANK],a
ld [MBC1RomBank],a
2014-05-22 22:13:20 +00:00
ld c,4
call DelayFrames
ld de,RedSprite
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
2015-07-18 15:17:29 +00:00
call IntroDisplayPicCenteredOrUpperRight
2014-05-22 22:13:20 +00:00
ld c,4
call DelayFrames
ld de,ShrinkPic2
ld bc,(BANK(ShrinkPic2) << 8) | $00
2015-07-18 15:17:29 +00:00
call IntroDisplayPicCenteredOrUpperRight
2014-05-22 22:13:20 +00:00
call ResetPlayerSpriteData
ld a,[H_LOADEDROMBANK]
push af
ld a, BANK(Music_PalletTown)
ld [wc0ef],a
ld [wc0f0],a
2014-05-22 22:13:20 +00:00
ld a,$A
ld [wMusicHeaderPointer],a
ld a,$FF
ld [wc0ee],a
2014-05-22 22:13:20 +00:00
call PlaySound ; stop music
pop af
ld [H_LOADEDROMBANK],a
ld [MBC1RomBank],a
ld c,20
2014-05-22 22:13:20 +00:00
call DelayFrames
2015-07-18 20:52:03 +00:00
coord hl, 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
ld c,50
2014-05-22 22:13:20 +00:00
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
2015-07-15 02:46:52 +00:00
ld [rWX],a
2014-05-22 22:13:20 +00:00
call DelayFrame
ld a,$E4
ld [rBGP],a
.next
call DelayFrame
2015-07-15 02:46:52 +00:00
ld a,[rWX]
2014-05-22 22:13:20 +00:00
sub 8
cp $FF
ret z
2015-07-15 02:46:52 +00:00
ld [rWX],a
2014-05-22 22:13:20 +00:00
jr .next
2015-07-18 15:17:29 +00:00
DisplayPicCenteredOrUpperRight: ; 62a1 (1:62a1)
call GetPredefRegisters
2015-07-18 15:17:29 +00:00
IntroDisplayPicCenteredOrUpperRight: ; 62a4 (1:62a4)
; b = bank
; de = address of compressed pic
; c: 0 = centred, non-zero = upper-right
2014-05-22 22:13:20 +00:00
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
2015-07-18 20:52:03 +00:00
coord hl, 15, 1
2014-05-22 22:13:20 +00:00
jr nz,.next
2015-07-18 20:52:03 +00:00
coord hl, 6, 4
2014-05-22 22:13:20 +00:00
.next
xor a
ld [$FFE1],a
predef_jump CopyUncompressedPicToTilemap