shithub: pokecrystal

Download patch

ref: 89e2edf1f7e973cab9c799a7f624f94c8b3dc373
parent: 78e0e17e53635f35a0ce1416b700696077287269
author: yenatch <[email protected]>
date: Sat Feb 23 23:17:09 EST 2013

More title screen asm

--- a/main.asm
+++ b/main.asm
@@ -3641,8 +3641,67 @@
 	db %11100100
 ; 6182
 
-INCBIN "baserom.gbc",$6182,$669f - $6182
+INCBIN "baserom.gbc",$6182,$6274 - $6182
 
+FarStartTitleScreen: ; 6274
+	callba StartTitleScreen
+	ret
+; 627b
+
+INCBIN "baserom.gbc",$627b,$62bc - $627b
+
+TitleScreenEntrance: ; 62bc
+
+; Animate the logo:
+; Move each line by 4 pixels until our count hits 0.
+	ld a, [$ffcf]
+	and a
+	jr z, .done
+	sub 4
+	ld [$ffcf], a
+	
+; Lay out a base (all lines scrolling together).
+	ld e, a
+	ld hl, $d100
+	ld bc, 8 * 10 ; logo height
+	call ByteFill
+	
+; Alternate signage for each line's position vector.
+; This is responsible for the interlaced effect.
+	ld a, e
+	xor $ff
+	inc a
+	
+	ld b, 8 * 10 / 2 ; logo height / 2
+	ld hl, $d101
+.loop
+	ld [hli], a
+	inc hl
+	dec b
+	jr nz, .loop
+	
+	callba AnimateTitleCrystal
+	ret
+	
+	
+.done
+; Next scene
+	ld hl, $cf63
+	inc [hl]
+	xor a
+	ld [$ffc6], a
+	
+; Play the title screen music.
+	ld de, MUSIC_TITLE
+	call StartMusic
+	
+	ld a, $88
+	ld [$ffd2], a
+	ret
+; 62f6
+
+INCBIN "baserom.gbc",$62f6,$669f - $62f6
+
 CheckNickErrors: ; 669f
 ; error-check monster nick before use
 ; must be a peace offering to gamesharkers
@@ -12760,7 +12819,7 @@
 
 INCBIN "baserom.gbc", $10c000, $10ed67 - $10c000
 
-TitleScreen: ; 10ed67
+StartTitleScreen: ; 10ed67
 
 	call WhiteBGMap
 	call ClearSprites
@@ -12996,7 +13055,32 @@
 	ret
 ; 10eea7
 
-INCBIN "baserom.gbc", $10eea7, $10ef46 - $10eea7
+INCBIN "baserom.gbc", $10eea7, $10ef32 - $10eea7
+
+AnimateTitleCrystal: ; 10ef32
+; Move the title screen crystal downward until it's fully visible
+
+; Stop at y=6
+; y is really from the bottom of the sprite, which is two tiles high
+	ld hl, Sprites
+	ld a, [hl]
+	cp 6 + 16
+	ret z
+	
+; Move all 30 parts of the crystal down by 2
+	ld c, 30
+.loop
+	ld a, [hl]
+	add 2
+	ld [hli], a
+	inc hl
+	inc hl
+	inc hl
+	dec c
+	jr nz, .loop
+	
+	ret
+; 10ef46
 
 TitleSuicuneGFX: ; 10ef46
 INCBIN "gfx/title/suicune.lz"