summaryrefslogtreecommitdiff
path: root/engine/oak_speech.asm
diff options
context:
space:
mode:
Diffstat (limited to 'engine/oak_speech.asm')
-rwxr-xr-xengine/oak_speech.asm47
1 files changed, 29 insertions, 18 deletions
diff --git a/engine/oak_speech.asm b/engine/oak_speech.asm
index 31c00fd0..38fe66f9 100755
--- a/engine/oak_speech.asm
+++ b/engine/oak_speech.asm
@@ -5,14 +5,22 @@ SetDefaultNames:
push af
ld a, [wd732]
push af
+ ld a, [wPrinterSettings]
+ push af
ld hl, wPlayerName
- ld bc, $d8a
+ ld bc, wBoxDataEnd - wPlayerName
xor a
call FillMemory
ld hl, wSpriteStateData1
ld bc, $200
xor a
call FillMemory
+ xor a
+ ld [wSurfingMinigameHiScore], a
+ ld [wSurfingMinigameHiScore + 1], a
+ ld [wSurfingMinigameHiScore + 2], a
+ pop af
+ ld [wPrinterSettings], a
pop af
ld [wd732], a
pop af
@@ -29,11 +37,11 @@ SetDefaultNames:
ld hl, SonyText
ld de, wRivalName
ld bc, NAME_LENGTH
- jp CopyData
+ call CopyData ; rip optimizations
+ ret
OakSpeech:
- ld a,$FF
- call PlaySound ; stop music
+ call StopAllMusic ; stop music
ld a, BANK(Music_Routes2)
ld c,a
ld a, MUSIC_ROUTES2
@@ -64,7 +72,7 @@ OakSpeech:
call PrintText
call GBFadeOutToWhite
call ClearScreen
- ld a,NIDORINO
+ ld a,PIKACHU
ld [wd0b5],a
ld [wcf91],a
call GetMonHeader
@@ -109,13 +117,13 @@ OakSpeech:
ld a,SFX_SHRINK
call PlaySound
pop af
- ld [H_LOADEDROMBANK],a
- ld [MBC1RomBank],a
+ call BankswitchCommon
ld c,4
call DelayFrames
- ld de,RedSprite
ld hl,vSprites
- lb bc, BANK(RedSprite), $0C
+ ld de,RedSprite
+ ld b, BANK(RedSprite)
+ ld c, $0C
call CopyVideoData
ld de,ShrinkPic1
lb bc, BANK(ShrinkPic1), $00
@@ -133,17 +141,13 @@ OakSpeech:
ld [wAudioSavedROMBank],a
ld a, 10
ld [wAudioFadeOutControl],a
- ld a,$FF
- ld [wNewSoundID],a
- call PlaySound ; stop music
+ call StopAllMusic ; stop music
pop af
- ld [H_LOADEDROMBANK],a
- ld [MBC1RomBank],a
+ call BankswitchCommon
ld c,20
call DelayFrames
coord hl, 6, 5
- ld b,7
- ld c,7
+ lb bc, 7, 7
call ClearScreenArea
call LoadTextBoxTilePatterns
ld a,1
@@ -151,7 +155,9 @@ OakSpeech:
ld c,50
call DelayFrames
call GBFadeOutToWhite
- jp ClearScreen
+ call ClearScreen ; rip more tail-end optimizations
+ ret
+
OakSpeechText1:
TX_FAR _OakSpeechText1
db "@"
@@ -176,6 +182,7 @@ FadeInIntroPic:
.next
ld a,[hli]
ld [rBGP],a
+ call UpdateGBCPal_BGP
ld c,10
call DelayFrames
dec b
@@ -195,8 +202,9 @@ MovePicLeft:
ld [rWX],a
call DelayFrame
- ld a,$E4
+ ld a,%11100100
ld [rBGP],a
+ call UpdateGBCPal_BGP
.next
call DelayFrame
ld a,[rWX]
@@ -215,10 +223,13 @@ IntroDisplayPicCenteredOrUpperRight:
push bc
ld a,b
call UncompressSpriteFromDE
+ ld a, $0
+ call SwitchSRAMBankAndLatchClockData
ld hl,sSpriteBuffer1
ld de,sSpriteBuffer0
ld bc,$310
call CopyData
+ call PrepareRTCDataAndDisableSRAM
ld de,vFrontPic
call InterlaceMergeSpriteBuffers
pop bc