summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElectroDeoxys <ElectroDeoxys@gmail.com>2021-05-22 12:44:50 +0100
committerElectroDeoxys <ElectroDeoxys@gmail.com>2021-05-22 12:44:50 +0100
commite4075b930031c5554583c6de322e52b96d614bc3 (patch)
tree38d91ecc69ce19abc8394d27acf02ad6183e489e
parent183219ee6479320b6dadc1eba4fbea211de24a11 (diff)
Finish referenced functions
-rw-r--r--src/engine/bank04.asm12
-rw-r--r--src/engine/bank07.asm80
-rw-r--r--src/engine/sequences/credits_sequence_commands.asm4
-rw-r--r--src/text/text3.asm2
-rw-r--r--src/text/text_offsets.asm2
5 files changed, 85 insertions, 15 deletions
diff --git a/src/engine/bank04.asm b/src/engine/bank04.asm
index 50cb01c..d1d6bfa 100644
--- a/src/engine/bank04.asm
+++ b/src/engine/bank04.asm
@@ -393,7 +393,7 @@ Func_10ab4: ; 10ab4 (4:4ab4)
ld bc, NUM_BACKGROUND_PALETTES palettes
call FillMemoryWithDE
call RestoreFirstColorInOBPals
- call Func_10b5e
+ call FadeScreenToTempPals
call DisableLCD
ret
@@ -415,7 +415,7 @@ Func_10af9: ; 10af9 (4:4af9)
call RestoreFirstColorInOBPals
call FlushAllPalettes
call EnableLCD
- jp Func_10b5e
+ jp FadeScreenToTempPals
; 0x10b08
BackupPalsAndSetWhite: ; 10b08 (4:4b08)
@@ -471,15 +471,15 @@ RestoreFirstColorInOBPals: ; 10b41 (4:4b41)
ret
; 0x10b5e
-Func_10b5e: ; 10b5e (4:4b5e)
+FadeScreenToTempPals: ; 10b5e (4:4b5e)
ld a, [wVBlankCounter]
push af
ld c, $10
.loop
push bc
ld a, c
- and $03
- cp $00
+ and %11
+ cp 0
call z, Func_10b85
call FadeBGPalIntoTemp3
call FadeOBPalIntoTemp
@@ -3868,7 +3868,7 @@ MainMenu_NewGame: ; 12704 (4:6704)
ld a, MUSIC_OVERWORLD
ld [wDefaultSong], a
call PlayDefaultSong
- farcall Func_1d306
+ farcall DrawPlayerPortraitAndPrintNewGameText
ld a, GAME_EVENT_OVERWORLD
ld [wGameEvent], a
farcall $03, ExecuteGameEvent
diff --git a/src/engine/bank07.asm b/src/engine/bank07.asm
index 9fee1d9..d915491 100644
--- a/src/engine/bank07.asm
+++ b/src/engine/bank07.asm
@@ -2282,8 +2282,23 @@ ShowCardPopCGBDisclaimer: ; 1d2dd (7:52dd)
ret
; 0x1d306
-Func_1d306: ; 1d306 (7:5306)
- INCROM $1d306, $1d335
+DrawPlayerPortraitAndPrintNewGameText: ; 1d306 (7:5306)
+ call DisableLCD
+ farcall Func_10a9b
+ farcall Func_10000
+ call Func_3ca0
+ ld hl, HandleAllSpriteAnimations
+ call SetDoFrameFunction
+ lb bc, 7, 3
+ farcall $4, DrawPlayerPortrait
+ farcall Func_10af9
+ call DoFrameIfLCDEnabled
+ ldtx hl, IsCrazyAboutPokemonAndPokemonCardCollectingText
+ call PrintScrollableText_NoTextBoxLabel
+ call ResetDoFrameFunction
+ call Func_3ca0
+ ret
+; 0x1d335
PlayOpeningSequence: ; 1d335 (7:5335)
call DisableLCD
@@ -2510,10 +2525,58 @@ Credits_1d6ad: ; 1d6ad (7:56ad)
ret
Func_1d705: ; 1d705 (7:5705)
- INCROM $1d705, $1d758
+ call DisableLCD
+ farcall Func_10a9b
+ call Func_3ca0
+ farcall Func_10000
+ call Func_1d7ee
+ ld hl, Func_3e31
+ call SetDoFrameFunction
+ call .Func_1d720 ; can be fallthrough
+ ret
+
+.Func_1d720
+ ld a, $91
+ ld [wd647], a
+ ld [wd649], a
+ ld a, $01
+ ld [wd648], a
+ ld [wd64a], a
+ call Func_1d765
+ call Set_WD_on
+ call .Func_1d73a ; can bee fallthrough
+ ret
+
+.Func_1d73a
+ push hl
+ di
+ xor a
+ ld [wd657], a
+ ld hl, wLCDCFunctionTrampoline + 1
+ ld [hl], LOW(Func_3e44)
+ inc hl
+ ld [hl], HIGH(Func_3e44)
+ ei
+
+ ld hl, rSTAT
+ set STAT_LYC, [hl]
+ xor a
+ ldh [rLYC], a
+ ld hl, rIE
+ set INT_LCD_STAT, [hl]
+ pop hl
+ ret
+; 0x1d758
Func_1d758: ; 1d758 (7:5758)
- INCROM $1d758, $1d765
+ push hl
+ ld hl, rSTAT
+ res STAT_LYC, [hl]
+ ld hl, rIE
+ res INT_LCD_STAT, [hl]
+ pop hl
+ ret
+; 0x1d765
Func_1d765: ; 1d765 (7:5765)
push hl
@@ -2611,4 +2674,11 @@ Func_1d765: ; 1d765 (7:5765)
ret
; 0x1d7ee
- INCROM $1d7ee, $1d7fc
+Func_1d7ee: ; 1d7ee (7:57ee)
+ xor a
+ lb de, 0, 32
+ lb bc, 20, 18
+ lb hl, 0, 0
+ call FillRectangle
+ ret
+; 0x1d7fc
diff --git a/src/engine/sequences/credits_sequence_commands.asm b/src/engine/sequences/credits_sequence_commands.asm
index dece700..5a7d4eb 100644
--- a/src/engine/sequences/credits_sequence_commands.asm
+++ b/src/engine/sequences/credits_sequence_commands.asm
@@ -434,7 +434,7 @@ CreditsSequenceCmd_InitVolcanoSprite: ; 1da9e (7:5a9e)
CreditsSequenceCmd_TransformOverlay: ; 1daa5 (7:5aa5)
; either stretches or shrinks overlay
; to the input configurations
- ld l, $00
+ ld l, 0
ld a, [wd647]
call .Func_1dade
ld [wd647], a
@@ -453,7 +453,7 @@ CreditsSequenceCmd_TransformOverlay: ; 1daa5 (7:5aa5)
ld a, l
or a
jr z, .advance_sequence
- ld a, $01
+ ld a, 1
ld [wSequenceDelay], a
ret
diff --git a/src/text/text3.asm b/src/text/text3.asm
index ff1565c..acc143b 100644
--- a/src/text/text3.asm
+++ b/src/text/text3.asm
@@ -1357,7 +1357,7 @@ YouCanAccessCardPopOnlyWithGameBoyColorsText: ; 3ef66 (f:6f66)
line "Please play using a Game Boy Color."
done
-Text0379: ; 3efc3 (f:6fc3)
+IsCrazyAboutPokemonAndPokemonCardCollectingText: ; 3efc3 (f:6fc3)
text "<RAMNAME> is crazy about Pokémon"
line "and Pokémon card collecting!"
line "One day,"
diff --git a/src/text/text_offsets.asm b/src/text/text_offsets.asm
index 9753cb6..7040fc8 100644
--- a/src/text/text_offsets.asm
+++ b/src/text/text_offsets.asm
@@ -890,7 +890,7 @@ TextOffsets:: ; 34000 (d:4000)
textpointer DataExistsWhenPowerWasTurnedOFFDuringDuelText ; 0x0376
textpointer ContinueFromDiaryText ; 0x0377
textpointer YouCanAccessCardPopOnlyWithGameBoyColorsText ; 0x0378
- textpointer Text0379 ; 0x0379
+ textpointer IsCrazyAboutPokemonAndPokemonCardCollectingText ; 0x0379
textpointer Text037a ; 0x037a
textpointer Text037b ; 0x037b
textpointer Text037c ; 0x037c