ref: 2cdca754410fc97878b99a673eeaa9cfad49ed9e
parent: be082943ed8fa746ae345b9f93783e5993550373
author: PikalaxALT <[email protected]>
date: Wed Dec 2 12:59:05 EST 2015
Crystal Intro
--- a/data/sprite_engine.asm
+++ b/data/sprite_engine.asm
@@ -56,10 +56,10 @@
dw Unknown_8d907 ; 36
dw Unknown_8d90c ; 37
dw Unknown_8d913 ; 38
- dw Unknown_8d916 ; 39
- dw Unknown_8d91d ; 3a
- dw Unknown_8d924 ; 3b
- dw Unknown_8d92b ; 3c
+ dw Unknown_8d916 ; 39 unown in intro
+ dw Unknown_8d91d ; 3a unown in intro
+ dw Unknown_8d924 ; 3b unown in intro
+ dw Unknown_8d92b ; 3c unown in intro
dw Unknown_8d932 ; 3d
dw Unknown_8d93d ; 3e
dw Unknown_8d940 ; 3f
--- a/engine/breeding/egg.asm
+++ b/engine/breeding/egg.asm
@@ -731,7 +731,7 @@
ld a, 2
ld [hSCX], a
ld a, -2
- ld [wc3c0], a
+ ld [wGlobalAnimXOffset], a
call EggHatch_DoAnimFrame
ld c, 2
call DelayFrames
@@ -738,7 +738,7 @@
ld a, -2
ld [hSCX], a
ld a, 2
- ld [wc3c0], a
+ ld [wGlobalAnimXOffset], a
call EggHatch_DoAnimFrame
ld c, 2
call DelayFrames
@@ -754,7 +754,7 @@
call PlaySFX
xor a
ld [hSCX], a
- ld [wc3c0], a
+ ld [wGlobalAnimXOffset], a
call ClearSprites
call Function173b3
hlcoord 6, 3
--- a/engine/crystal_intro.asm
+++ b/engine/crystal_intro.asm
@@ -1,21 +1,3 @@
-Functione455c: ; e455c
- hlcoord 1, 1
- ld de, SCREEN_WIDTH
- ld c, $10
-.asm_e4564
- ld [hl], $7f
- add hl, de
- dec c
- jr nz, .asm_e4564
- hlcoord 1, 2
- ld bc, $28
- ld a, [wJumptableIndex]
- call AddNTimes
- ld [hl], $ed
- ret
-; e4579
-
-
Functione4579: ; e4579
ld de, MUSIC_NONE
call PlayMusic
@@ -111,7 +93,7 @@
ld [hl], $30
xor a
ld [wJumptableIndex], a
- ld [wcf64], a
+ ld [wIntroSceneFrameCounter], a
ld [wcf65], a
ld [hSCX], a
ld [hSCY], a
@@ -230,7 +212,6 @@
; e46ed
-
GameFreakLogoJumper: ; e46ed (39:46ed)
ld hl, $b
add hl, bc
@@ -252,7 +233,6 @@
dw GameFreakLogoScene4
dw GameFreakLogoScene5
-
GameFreakLogoScene1: ; e4707 (39:4707)
ld hl, $b
add hl, bc
@@ -369,20 +349,24 @@
RGB 23, 12, 27
RGB 23, 13, 26
RGB 23, 13, 24
+
RGB 24, 14, 22
RGB 24, 14, 20
RGB 24, 15, 18
RGB 24, 15, 16
+
RGB 25, 16, 14
RGB 25, 16, 12
RGB 25, 17, 10
RGB 25, 17, 08
+
RGB 26, 18, 06
RGB 26, 18, 04
RGB 26, 19, 02
RGB 26, 19, 00
-;' e47cc
+; e47cc
+
GameFreakLogo: ; e47cc
INCBIN "gfx/splash/logo.1bpp"
; e48ac
@@ -459,7 +443,6 @@
jp [hl]
; e491e
-
IntroScenes: ; e491e (39:491e)
dw IntroScene1
dw IntroScene2
@@ -490,7 +473,6 @@
dw IntroScene27
dw IntroScene28
-
NextIntroScene: ; e4956 (39:4956)
ld hl, wJumptableIndex
inc [hl]
@@ -498,7 +480,7 @@
IntroScene1: ; e495b (39:495b)
; Setup the next scene.
- call Functione54a3
+ call Intro_ClearBGPals
call ClearSprites
call ClearTileMap
xor a
@@ -507,18 +489,18 @@
ld [rVBK], a
ld hl, IntroTilemap001
debgcoord 0, 0
- call Functione54fa
+ call Intro_DecompressRequest2bpp_64Tiles
ld a, $0
ld [rVBK], a
ld hl, IntroUnownsGFX
ld de, VTiles2 tile $00
- call Functione54c2
+ call Intro_DecompressRequest2bpp_128Tiles
ld hl, IntroPulseGFX
ld de, VTiles0 tile $00
- call Functione54c2
+ call Intro_DecompressRequest2bpp_128Tiles
ld hl, IntroTilemap002
debgcoord 0, 0
- call Functione54fa
+ call Intro_DecompressRequest2bpp_64Tiles
ld a, [rSVBK]
push af
ld a, $5
@@ -541,7 +523,7 @@
ld a, $90
ld [hWY], a
callba ClearSpriteAnims
- call Functione549e
+ call Intro_SetCGBPalUpdate
xor a
ld [wIntroSceneFrameCounter], a
ld [wcf65], a
@@ -558,8 +540,8 @@
cp $60
jr nz, .DontPlaySound
push af
- ld de, $5858
- call Functione51dc
+ depixel 11, 11
+ call CrystalIntro_InitUnownAnim
ld de, SFX_INTRO_UNOWN_1
call PlaySFX
pop af
@@ -566,7 +548,7 @@
.DontPlaySound
ld [wcf65], a
xor a
- call Functione5223
+ call CrystalIntro_UnownFade
ret
.endscene
call NextIntroScene
@@ -574,7 +556,7 @@
IntroScene3: ; e49fd (39:49fd)
; More setup. Transition to the outdoor scene.
- call Functione54a3
+ call Intro_ClearBGPals
call ClearSprites
call ClearTileMap
xor a
@@ -583,15 +565,15 @@
ld [rVBK], a
ld hl, IntroTilemap003
debgcoord 0, 0
- call Functione54fa
+ call Intro_DecompressRequest2bpp_64Tiles
ld a, $0
ld [rVBK], a
ld hl, IntroBackgroundGFX
ld de, VTiles2 tile $00
- call Functione54c2
+ call Intro_DecompressRequest2bpp_128Tiles
ld hl, IntroTilemap004
debgcoord 0, 0
- call Functione54fa
+ call Intro_DecompressRequest2bpp_64Tiles
ld a, [rSVBK]
push af
ld a, $5
@@ -613,8 +595,8 @@
ld [hWX], a
ld a, $90
ld [hWY], a
- call Functione5516
- call Functione549e
+ call Intro_ResetLYOverrides
+ call Intro_SetCGBPalUpdate
xor a
ld [wIntroSceneFrameCounter], a
call NextIntroScene
@@ -622,7 +604,7 @@
IntroScene4: ; e4a69 (39:4a69)
; Scroll the outdoor panorama for a bit.
- call Functione552f
+ call Intro_PerspectiveScrollBG
ld hl, wIntroSceneFrameCounter
ld a, [hl]
cp $80
@@ -629,6 +611,7 @@
jr z, .endscene
inc [hl]
ret
+
.endscene
call NextIntroScene
ret
@@ -635,7 +618,7 @@
IntroScene5: ; e4a7a (39:4a7a)
; Go back to the Unown.
- call Functione54a3
+ call Intro_ClearBGPals
call ClearSprites
call ClearTileMap
xor a
@@ -645,18 +628,18 @@
ld [rVBK], a
ld hl, IntroTilemap005
debgcoord 0, 0
- call Functione54fa
+ call Intro_DecompressRequest2bpp_64Tiles
ld a, $0
ld [rVBK], a
ld hl, IntroUnownsGFX
ld de, VTiles2 tile $00
- call Functione54c2
+ call Intro_DecompressRequest2bpp_128Tiles
ld hl, IntroPulseGFX
ld de, VTiles0 tile $00
- call Functione54c2
+ call Intro_DecompressRequest2bpp_128Tiles
ld hl, IntroTilemap006
debgcoord 0, 0
- call Functione54fa
+ call Intro_DecompressRequest2bpp_64Tiles
ld a, [rSVBK]
push af
ld a, $5
@@ -679,9 +662,9 @@
ld a, $90
ld [hWY], a
callba ClearSpriteAnims
- call Functione549e
+ call Intro_SetCGBPalUpdate
xor a
- ld [wcf64], a
+ ld [wIntroSceneFrameCounter], a
ld [wcf65], a
call NextIntroScene
ret
@@ -688,7 +671,7 @@
IntroScene6: ; e4af7 (39:4af7)
; Two more Unown (I, H) fade in.
- ld hl, wcf64
+ ld hl, wIntroSceneFrameCounter
ld a, [hl]
inc [hl]
cp $80
@@ -700,10 +683,11 @@
cp $20
jr z, .FirstUnown
jr .NoUnown
+
.FirstUnown
push af
- ld de, $3878
- call Functione51dc
+ depixel 7, 15
+ call CrystalIntro_InitUnownAnim
ld de, SFX_INTRO_UNOWN_2
call PlaySFX
pop af
@@ -710,12 +694,13 @@
.NoUnown
ld [wcf65], a
xor a
- call Functione5223
+ call CrystalIntro_UnownFade
ret
+
.SecondUnown
push af
- ld de, $7030
- call Functione51dc
+ depixel 14, 6
+ call CrystalIntro_InitUnownAnim
ld de, SFX_INTRO_UNOWN_1
call PlaySFX
pop af
@@ -722,8 +707,9 @@
.StopUnown
ld [wcf65], a
ld a, $1
- call Functione5223
+ call CrystalIntro_UnownFade
ret
+
.endscene
call NextIntroScene
ret
@@ -730,44 +716,54 @@
IntroScene7: ; e4b3f (39:4b3f)
; Back to the outdoor scene.
- call Functione54a3
+ call Intro_ClearBGPals
call ClearSprites
call ClearTileMap
xor a
ld [hBGMapMode], a
+
ld a, $1
ld [rVBK], a
ld hl, IntroTilemap003
debgcoord 0, 0
- call Functione54fa
+ call Intro_DecompressRequest2bpp_64Tiles
+
ld hl, IntroPichuWooperGFX
ld de, VTiles0 tile $00
- call Functione54c2
+ call Intro_DecompressRequest2bpp_128Tiles
+
ld a, $0
ld [rVBK], a
ld hl, IntroSuicuneRunGFX
ld de, VTiles0 tile $00
- call Functione54de
+ call Intro_DecompressRequest2bpp_255Tiles
+
ld hl, IntroBackgroundGFX
ld de, VTiles2 tile $00
- call Functione54c2
+ call Intro_DecompressRequest2bpp_128Tiles
+
ld hl, IntroTilemap004
debgcoord 0, 0
- call Functione54fa
+ call Intro_DecompressRequest2bpp_64Tiles
+
ld a, [rSVBK]
push af
ld a, $5
ld [rSVBK], a
+
ld hl, Palette_e5edd
ld de, UnknBGPals
ld bc, $80
call CopyBytes
+
ld hl, Palette_e5edd
ld de, BGPals
ld bc, $80
call CopyBytes
+
pop af
ld [rSVBK], a
+
xor a
ld [hSCX], a
ld [hSCY], a
@@ -775,14 +771,14 @@
ld [hWX], a
ld a, $90
ld [hWY], a
- call Functione5516
+ call Intro_ResetLYOverrides
callba ClearSpriteAnims
depixel 13, 27, 4, 0
ld a, SPRITE_ANIM_INDEX_26
call _InitSpriteAnimStruct
ld a, $f0
- ld [wc3c0], a
- call Functione549e
+ ld [wGlobalAnimXOffset], a
+ call Intro_SetCGBPalUpdate
xor a
ld [wIntroSceneFrameCounter], a
ld [wcf65], a
@@ -795,21 +791,23 @@
ld a, [hl]
inc [hl]
cp $40
- jr z, .asm_e4be2
- jr nc, .asm_e4be8
- call Functione552f
+ jr z, .suicune_sound
+ jr nc, .animate_suicune
+ call Intro_PerspectiveScrollBG
ret
-.asm_e4be2
+
+.suicune_sound
ld de, SFX_INTRO_SUICUNE_3
call PlaySFX
-.asm_e4be8
- ld a, [wc3c0]
+.animate_suicune
+ ld a, [wGlobalAnimXOffset]
and a
- jr z, .asm_e4bf4
+ jr z, .finish
sub $8
- ld [wc3c0], a
+ ld [wGlobalAnimXOffset], a
ret
-.asm_e4bf4
+
+.finish
ld de, SFX_INTRO_SUICUNE_2
call PlaySFX
callba Function8d03d
@@ -822,13 +820,16 @@
ld [hLCDStatCustom], a
call ClearSprites
hlcoord 0, 0, AttrMap
- ld bc, $f0
+ ; first 12 rows have palette 1
+ ld bc, 12 * SCREEN_WIDTH
ld a, $1
call ByteFill
- ld bc, $3c
+ ; middle 3 rows have palette 2
+ ld bc, 3 * SCREEN_WIDTH
ld a, $2
call ByteFill
- ld bc, $3c
+ ; last three rows have palette 3
+ ld bc, 3 * SCREEN_WIDTH
ld a, $3
call ByteFill
ld a, $2
@@ -836,7 +837,7 @@
call DelayFrame
call DelayFrame
call DelayFrame
- ld a, $c
+ ld a, $c ; $980c
ld [hBGMapAddress], a
call DelayFrame
call DelayFrame
@@ -844,16 +845,16 @@
xor a
ld [hBGMapMode], a
ld [hBGMapAddress], a
- ld [wc3c0], a
+ ld [wGlobalAnimXOffset], a
xor a
- ld [wcf64], a
+ ld [wIntroSceneFrameCounter], a
call NextIntroScene
ret
IntroScene10: ; e4c4f (39:4c4f)
; Wooper and Pichu enter.
- call Functione546d
- ld hl, wcf64
+ call Intro_RustleGrass
+ ld hl, wIntroSceneFrameCounter
ld a, [hl]
inc [hl]
cp $c0
@@ -885,7 +886,7 @@
IntroScene11: ; e4c86 (39:4c86)
; Back to Unown again.
- call Functione54a3
+ call Intro_ClearBGPals
call ClearSprites
call ClearTileMap
xor a
@@ -895,15 +896,15 @@
ld [rVBK], a
ld hl, IntroTilemap007
debgcoord 0, 0
- call Functione54fa
+ call Intro_DecompressRequest2bpp_64Tiles
ld a, $0
ld [rVBK], a
ld hl, IntroUnownsGFX
ld de, VTiles2 tile $00
- call Functione54c2
+ call Intro_DecompressRequest2bpp_128Tiles
ld hl, IntroTilemap008
debgcoord 0, 0
- call Functione54fa
+ call Intro_DecompressRequest2bpp_64Tiles
ld a, [rSVBK]
push af
ld a, $5
@@ -926,7 +927,7 @@
ld a, $90
ld [hWY], a
callba ClearSpriteAnims
- call Functione549e
+ call Intro_SetCGBPalUpdate
xor a
ld [wIntroSceneFrameCounter], a
ld [wcf65], a
@@ -935,14 +936,15 @@
IntroScene12: ; e4cfa (39:4cfa)
; Even more Unown.
- call Functione4d36
+ call .PlayUnownSound
ld hl, wIntroSceneFrameCounter
ld a, [hl]
inc [hl]
cp $c0
- jr nc, .asm_e4d32
+ jr nc, .done
cp $80
- jr nc, .asm_e4d1d
+ jr nc, .second_half
+; first half
ld c, a
and $1f
sla a
@@ -951,9 +953,11 @@
and $e0
srl a
swap a
- call Functione5223
+ call CrystalIntro_UnownFade
ret
-.asm_e4d1d
+
+.second_half
+; double speed
ld c, a
and $f
sla a
@@ -963,13 +967,14 @@
and $70
or $40
swap a
- call Functione5223
+ call CrystalIntro_UnownFade
ret
-.asm_e4d32
+
+.done
call NextIntroScene
ret
-Functione4d36: ; e4d36 (39:4d36)
+.PlayUnownSound: ; e4d36 (39:4d36)
ld a, [wIntroSceneFrameCounter]
ld c, a
ld hl, .UnownSounds
@@ -1003,12 +1008,11 @@
dbw $90, SFX_INTRO_UNOWN_2
dbw $a0, SFX_INTRO_UNOWN_1
dbw $b0, SFX_INTRO_UNOWN_2
- db $ff
-; e4d6d
+ db -1 ; e4d6d
IntroScene13: ; e4d6d (39:4d6d)
; Switch scenes again.
- call Functione54a3
+ call Intro_ClearBGPals
call ClearSprites
call ClearTileMap
xor a
@@ -1017,18 +1021,18 @@
ld [rVBK], a
ld hl, IntroTilemap003
debgcoord 0, 0
- call Functione54fa
+ call Intro_DecompressRequest2bpp_64Tiles
ld a, $0
ld [rVBK], a
ld hl, IntroSuicuneRunGFX
ld de, VTiles0 tile $00
- call Functione54de
+ call Intro_DecompressRequest2bpp_255Tiles
ld hl, IntroBackgroundGFX
ld de, VTiles2 tile $00
- call Functione54c2
+ call Intro_DecompressRequest2bpp_128Tiles
ld hl, IntroTilemap004
debgcoord 0, 0
- call Functione54fa
+ call Intro_DecompressRequest2bpp_64Tiles
ld a, [rSVBK]
push af
ld a, $5
@@ -1057,10 +1061,10 @@
ld de, MUSIC_CRYSTAL_OPENING
call PlayMusic
xor a
- ld [wc3c0], a
- call Functione549e
+ ld [wGlobalAnimXOffset], a
+ call Intro_SetCGBPalUpdate
xor a
- ld [wcf64], a
+ ld [wIntroSceneFrameCounter], a
ld [wcf65], a
call NextIntroScene
ret
@@ -1070,7 +1074,7 @@
ld a, [hSCX]
sub 10
ld [hSCX], a
- ld hl, wcf64
+ ld hl, wIntroSceneFrameCounter
ld a, [hl]
inc [hl]
cp $80
@@ -1089,11 +1093,11 @@
.asm_e4e1a
ld a, $1
ld [wcf65], a
- ld a, [wc3c0]
+ ld a, [wGlobalAnimXOffset]
cp $88
jr c, .asm_e4e2c
sub $8
- ld [wc3c0], a
+ ld [wGlobalAnimXOffset], a
ret
.asm_e4e2c
@@ -1101,9 +1105,9 @@
ret
.asm_e4e33
- ld a, [wc3c0]
+ ld a, [wGlobalAnimXOffset]
sub $2
- ld [wc3c0], a
+ ld [wGlobalAnimXOffset], a
ret
.done
@@ -1112,7 +1116,7 @@
IntroScene15: ; e4e40 (39:4e40)
; Transition to a new scene.
- call Functione54a3
+ call Intro_ClearBGPals
call ClearSprites
call ClearTileMap
xor a
@@ -1121,23 +1125,23 @@
ld [rVBK], a
ld hl, IntroTilemap009
debgcoord 0, 0
- call Functione54fa
+ call Intro_DecompressRequest2bpp_64Tiles
ld a, $0
ld [rVBK], a
ld hl, IntroSuicuneJumpGFX
ld de, VTiles2 tile $00
- call Functione54c2
+ call Intro_DecompressRequest2bpp_128Tiles
ld hl, IntroUnownBackGFX
ld de, VTiles0 tile $00
- call Functione54c2
- ld de, GFX_e7a5d
+ call Intro_DecompressRequest2bpp_128Tiles
+ ld de, IntroGrass4GFX
ld hl, VTiles1 tile $00
- lb bc, BANK(GFX_e7a5d), 1
+ lb bc, BANK(IntroGrass4GFX), 1
call Request2bpp
ld hl, IntroTilemap010
debgcoord 0, 0
- call Functione54fa
- call Functione541b
+ call Intro_DecompressRequest2bpp_64Tiles
+ call Intro_LoadTilemap
ld a, [rSVBK]
push af
ld a, $5
@@ -1161,7 +1165,7 @@
ld a, $90
ld [hWY], a
callba ClearSpriteAnims
- call Functione549e
+ call Intro_SetCGBPalUpdate
depixel 8, 5
ld a, SPRITE_ANIM_INDEX_2A
call _InitSpriteAnimStruct
@@ -1169,7 +1173,7 @@
ld a, SPRITE_ANIM_INDEX_2B
call _InitSpriteAnimStruct
xor a
- ld [wcf64], a
+ ld [wIntroSceneFrameCounter], a
ld [wcf65], a
call NextIntroScene
ret
@@ -1176,12 +1180,12 @@
IntroScene16: ; e4edc (39:4edc)
; Suicune shows its face. An Unown appears in front.
- ld hl, wcf64
+ ld hl, wIntroSceneFrameCounter
ld a, [hl]
inc [hl]
cp $80
jr nc, .done
- call Functione5441
+ call Intro_Scene16_AnimateSuicune
ld a, [hSCY]
and a
ret z
@@ -1194,7 +1198,7 @@
IntroScene17: ; e4ef5 (39:4ef5)
; ...
- call Functione54a3
+ call Intro_ClearBGPals
call ClearSprites
call ClearTileMap
xor a
@@ -1203,15 +1207,15 @@
ld [rVBK], a
ld hl, IntroTilemap011
debgcoord 0, 0
- call Functione54fa
+ call Intro_DecompressRequest2bpp_64Tiles
ld a, $0
ld [rVBK], a
ld hl, IntroSuicuneCloseGFX
ld de, VTiles1 tile $00
- call Functione54de
+ call Intro_DecompressRequest2bpp_255Tiles
ld hl, IntroTilemap012
debgcoord 0, 0
- call Functione54fa
+ call Intro_DecompressRequest2bpp_64Tiles
ld a, [rSVBK]
push af
ld a, $5
@@ -1234,9 +1238,9 @@
ld a, $90
ld [hWY], a
callba ClearSpriteAnims
- call Functione549e
+ call Intro_SetCGBPalUpdate
xor a
- ld [wcf64], a
+ ld [wIntroSceneFrameCounter], a
ld [wcf65], a
call NextIntroScene
ret
@@ -1243,7 +1247,7 @@
IntroScene18: ; e4f67 (39:4f67)
; Suicune close up.
- ld hl, wcf64
+ ld hl, wIntroSceneFrameCounter
ld a, [hl]
inc [hl]
cp $60
@@ -1260,7 +1264,7 @@
IntroScene19: ; e4f7e (39:4f7e)
; More setup.
- call Functione54a3
+ call Intro_ClearBGPals
call ClearSprites
call ClearTileMap
xor a
@@ -1269,23 +1273,23 @@
ld [rVBK], a
ld hl, IntroTilemap013
debgcoord 0, 0
- call Functione54fa
+ call Intro_DecompressRequest2bpp_64Tiles
ld a, $0
ld [rVBK], a
ld hl, IntroSuicuneBackGFX
ld de, VTiles2 tile $00
- call Functione54c2
+ call Intro_DecompressRequest2bpp_128Tiles
ld hl, IntroUnownsGFX
ld de, VTiles1 tile $00
- call Functione54c2
- ld de, GFX_e7a5d
+ call Intro_DecompressRequest2bpp_128Tiles
+ ld de, IntroGrass4GFX
ld hl, VTiles1 tile $7f
- lb bc, BANK(GFX_e7a5d), 1
+ lb bc, BANK(IntroGrass4GFX), 1
call Request2bpp
ld hl, IntroTilemap014
debgcoord 0, 0
- call Functione54fa
- call Functione541b
+ call Intro_DecompressRequest2bpp_64Tiles
+ call Intro_LoadTilemap
ld a, [rSVBK]
push af
ld a, $5
@@ -1313,12 +1317,12 @@
xor a
ld [hli], a
ld [hl], $7f
- call Functione549e
+ call Intro_SetCGBPalUpdate
depixel 12, 0
ld a, SPRITE_ANIM_INDEX_2B
call _InitSpriteAnimStruct
xor a
- ld [wcf64], a
+ ld [wIntroSceneFrameCounter], a
ld [wcf65], a
call NextIntroScene
ret
@@ -1325,15 +1329,15 @@
IntroScene20: ; e5019 (39:5019)
; Suicune running away. A bunch of Unown appear.
- ld hl, wcf64
+ ld hl, wIntroSceneFrameCounter
ld a, [hl]
inc [hl]
cp $98
- jr nc, .asm_e5059
+ jr nc, .finished
cp $58
ret nc
cp $40
- jr nc, .asm_e5032
+ jr nc, .AppearUnown
cp $28
ret nc
ld a, [hSCY]
@@ -1341,7 +1345,7 @@
ld [hSCY], a
ret
-.asm_e5032
+.AppearUnown
sub $18
ld c, a
and $3
@@ -1353,10 +1357,10 @@
srl a
ld [wcf65], a
xor a
- call Functione5348
+ call Intro_Scene20_AppearUnown
ret
; e5049 (39:5049)
-
+; unused
ld a, c
and $1c
srl a
@@ -1363,27 +1367,27 @@
srl a
ld [wcf65], a
ld a, 1
- call Functione5348
+ call Intro_Scene20_AppearUnown
ret
-.asm_e5059
+.finished
call NextIntroScene
ret
IntroScene21: ; e505d (39:505d)
; Suicune gets more distant and turns black.
- call Functione5451
+ call Intro_ColoredSuicuneFrameSwap
ld c, 3
call DelayFrames
xor a
ld [hBGMapMode], a
- ld [wcf64], a
+ ld [wIntroSceneFrameCounter], a
ld [wcf65], a
call NextIntroScene
ret
IntroScene22: ; e5072 (39:5072)
- ld hl, wcf64
+ ld hl, wIntroSceneFrameCounter
ld a, [hl]
inc [hl]
cp $8
@@ -1396,13 +1400,13 @@
IntroScene23: ; e5086 (39:5086)
xor a
- ld [wcf64], a
+ ld [wIntroSceneFrameCounter], a
call NextIntroScene
ret
IntroScene24: ; e508e (39:508e)
; Fade to white.
- ld hl, wcf64
+ ld hl, wIntroSceneFrameCounter
ld a, [hl]
inc [hl]
cp $20
@@ -1411,25 +1415,27 @@
ld c, a
and $3
ret nz
+
ld a, c
and $1c
sla a
- call Functione5172
+ call Intro_Scene24_ApplyPaletteFade
ret
.done
ld a, $40
- ld [wcf64], a
+ ld [wIntroSceneFrameCounter], a
call NextIntroScene
ret
IntroScene25: ; e50ad (39:50ad)
; Wait around a bit.
- ld a, [wcf64]
+ ld a, [wIntroSceneFrameCounter]
dec a
jr z, .done
- ld [wcf64], a
+ ld [wIntroSceneFrameCounter], a
ret
+
.done
call NextIntroScene
ret
@@ -1445,15 +1451,15 @@
ld [rVBK], a
ld hl, IntroTilemap015
debgcoord 0, 0
- call Functione54fa
+ call Intro_DecompressRequest2bpp_64Tiles
ld a, $0
ld [rVBK], a
ld hl, IntroCrystalUnownsGFX
ld de, VTiles2 tile $00
- call Functione54c2
+ call Intro_DecompressRequest2bpp_128Tiles
ld hl, IntroTilemap017
debgcoord 0, 0
- call Functione54fa
+ call Intro_DecompressRequest2bpp_64Tiles
ld a, [rSVBK]
push af
ld a, $5
@@ -1476,9 +1482,9 @@
ld a, $90
ld [hWY], a
callba ClearSpriteAnims
- call Functione549e
+ call Intro_SetCGBPalUpdate
xor a
- ld [wcf64], a
+ ld [wIntroSceneFrameCounter], a
ld [wcf65], a
call NextIntroScene
ret
@@ -1487,7 +1493,7 @@
; Spell out C R Y S T A L with Unown.
ld hl, wcf65
inc [hl]
- ld hl, wcf64
+ ld hl, wIntroSceneFrameCounter
ld a, [hl]
inc [hl]
cp $80
@@ -1499,18 +1505,18 @@
ld a, c
and $70
swap a
- call Functione539d
+ call Intro_FadeUnownWordPals
ret
.done
call NextIntroScene
ld a, $80
- ld [wcf64], a
+ ld [wIntroSceneFrameCounter], a
ret
IntroScene28: ; e5152 (39:5152)
; Cut out when the music ends, and lead into the title screen.
- ld hl, wcf64
+ ld hl, wIntroSceneFrameCounter
ld a, [hl]
and a
jr z, .done
@@ -1533,32 +1539,33 @@
set 7, [hl]
ret
-
-Functione5172: ; e5172 (39:5172)
- ld hl, Unknown_e519c
+Intro_Scene24_ApplyPaletteFade: ; e5172 (39:5172)
+; load the (a)th palette from .FadePals to all BGPals
+ ld hl, .FadePals
add l
ld l, a
ld a, $0
adc h
ld h, a
+
ld a, [rSVBK]
push af
ld a, $5
ld [rSVBK], a
ld de, BGPals
- ld b, $8
-.asm_e5187
+ ld b, 8 ; number of BG pals
+.loop1
push hl
- ld c, $8
-.asm_e518a
+ ld c, 8 ; number of bytes per pal
+.loop2
ld a, [hli]
ld [de], a
inc de
dec c
- jr nz, .asm_e518a
+ jr nz, .loop2
pop hl
dec b
- jr nz, .asm_e5187
+ jr nz, .loop1
pop af
ld [rSVBK], a
ld a, $1
@@ -1566,7 +1573,7 @@
ret
; e519c (39:519c)
-Unknown_e519c: ; e519c
+.FadePals: ; e519c
; Fade to white.
RGB 24, 12, 09
RGB 31, 31, 31
@@ -1607,13 +1614,14 @@
RGB 31, 31, 31
RGB 31, 31, 31
RGB 31, 31, 31
+
; e51dc
-Functione51dc: ; e51dc (39:51dc)
+CrystalIntro_InitUnownAnim: ; e51dc (39:51dc)
push de
ld a, SPRITE_ANIM_INDEX_29
call _InitSpriteAnimStruct
- ld hl, $c
+ ld hl, SPRITEANIMSTRUCT_0C
add hl, bc
ld [hl], $8
ld a, $3c
@@ -1623,7 +1631,7 @@
push de
ld a, SPRITE_ANIM_INDEX_29
call _InitSpriteAnimStruct
- ld hl, $c
+ ld hl, SPRITEANIMSTRUCT_0C
add hl, bc
ld [hl], $18
ld a, $3b
@@ -1633,7 +1641,7 @@
push de
ld a, SPRITE_ANIM_INDEX_29
call _InitSpriteAnimStruct
- ld hl, $c
+ ld hl, SPRITEANIMSTRUCT_0C
add hl, bc
ld [hl], $28
ld a, $39
@@ -1642,7 +1650,7 @@
ld a, SPRITE_ANIM_INDEX_29
call _InitSpriteAnimStruct
- ld hl, $c
+ ld hl, SPRITEANIMSTRUCT_0C
add hl, bc
ld [hl], $38
ld a, $3a
@@ -1649,7 +1657,7 @@
call Function3b3c
ret
-Functione5223: ; e5223 (39:5223)
+CrystalIntro_UnownFade: ; e5223 (39:5223)
rept 3
add a
endr
@@ -1663,12 +1671,13 @@
ld a, [wcf65]
and $3f
cp $1f
- jr z, .asm_e523e
- jr c, .asm_e523e
+ jr z, .okay
+ jr c, .okay
ld c, a
ld a, $3f
sub c
-.asm_e523e
+.okay
+
ld c, a
ld b, $0
ld a, [rSVBK]
@@ -1675,16 +1684,18 @@
push af
ld a, $5
ld [rSVBK], a
+
push hl
push bc
ld hl, BGPals
- ld bc, $40
+ ld bc, 4 * 16
xor a
call ByteFill
pop bc
pop hl
+
push hl
- ld hl, Unknown_e5288
+ ld hl, .BWFade
rept 2
add hl, bc
endr
@@ -1696,8 +1707,9 @@
ld [hli], a
ld a, d
ld [hli], a
+
push hl
- ld hl, Unknown_e52c8
+ ld hl, .BlackLBlueFade
rept 2
add hl, bc
endr
@@ -1709,8 +1721,9 @@
ld [hli], a
ld a, d
ld [hli], a
+
push hl
- ld hl, Unknown_e5308
+ ld hl, .BlackBlueFade
rept 2
add hl, bc
endr
@@ -1722,6 +1735,7 @@
ld [hli], a
ld a, d
ld [hli], a
+
pop af
ld [rSVBK], a
ld a, $1
@@ -1729,7 +1743,7 @@
ret
; e5288 (39:5288)
-Unknown_e5288: ; e5288
+.BWFade: ; e5288
; Fade between black and white.
hue = 0
rept 32
@@ -1738,7 +1752,7 @@
endr
; e52c8
-Unknown_e52c8: ; e52c8
+.BlackLBlueFade: ; e52c8
; Fade between black and light blue.
hue = 0
rept 32
@@ -1747,7 +1761,7 @@
endr
; e5308
-Unknown_e5308: ; e5308
+.BlackBlueFade: ; e5308
; Fade between black and blue.
hue = 0
rept 32
@@ -1756,14 +1770,18 @@
endr
; e5348
-Functione5348: ; e5348 (39:5348)
+Intro_Scene20_AppearUnown: ; e5348 (39:5348)
+; Spawn the palette for the nth Unown
and a
- jr nz, .asm_e5350
- ld hl, Palette_e538d
- jr .asm_e5353
-.asm_e5350
- ld hl, Palette_e5395
-.asm_e5353
+ jr nz, .load_pal_2
+
+ ld hl, .pal1
+ jr .got_pointer
+
+.load_pal_2
+ ld hl, .pal2
+
+.got_pointer
ld a, [wcf65]
and $7
rept 3
@@ -1774,8 +1792,10 @@
push af
ld a, $5
ld [rSVBK], a
+
push bc
ld de, BGPals
+
ld a, c
add e
ld e, a
@@ -1782,9 +1802,11 @@
ld a, $0
adc d
ld d, a
- ld bc, $8
+
+ ld bc, 8
call CopyBytes
pop bc
+
ld de, UnknBGPals
ld a, c
add e
@@ -1792,8 +1814,10 @@
ld a, $0
adc d
ld d, a
- ld bc, $8
+
+ ld bc, 8
call CopyBytes
+
pop af
ld [rSVBK], a
ld a, $1
@@ -1801,21 +1825,23 @@
ret
; e538d (39:538d)
-Palette_e538d: ; e538d
+.pal1: ; e538d
RGB 24, 12, 09
RGB 31, 31, 31
RGB 12, 00, 31
RGB 00, 00, 00
+
; e5395
-Palette_e5395: ; e5395
+.pal2: ; e5395
RGB 24, 12, 09
RGB 31, 31, 31
RGB 31, 31, 31
RGB 31, 31, 31
+
; e539d
-Functione539d: ; e539d (39:539d)
+Intro_FadeUnownWordPals: ; e539d (39:539d)
rept 3
add a
endr
@@ -1830,12 +1856,14 @@
add a
ld c, a
ld b, $0
+
ld a, [rSVBK]
push af
ld a, $5
ld [rSVBK], a
+
push hl
- ld hl, Palette_e53db
+ ld hl, .FastFadePalettes
add hl, bc
ld a, [hli]
ld d, [hl]
@@ -1845,8 +1873,9 @@
ld [hli], a
ld a, d
ld [hli], a
+
push hl
- ld hl, Palette_e53fb
+ ld hl, .SlowFadePalettes
add hl, bc
ld a, [hli]
ld d, [hl]
@@ -1856,6 +1885,7 @@
ld [hli], a
ld a, d
ld [hli], a
+
pop af
ld [rSVBK], a
ld a, $1
@@ -1863,7 +1893,7 @@
ret
; e53db (39:53db)
-Palette_e53db: ; e53db
+.FastFadePalettes: ; e53db
hue = 31
rept 8
RGB hue, hue, hue
@@ -1873,7 +1903,7 @@
endr
; e53fb
-Palette_e53fb: ; e53fb
+.SlowFadePalettes: ; e53fb
hue = 31
rept 16
RGB hue, hue, hue
@@ -1881,23 +1911,25 @@
endr
; e541b
-Functione541b: ; e541b (39:541b)
+Intro_LoadTilemap: ; e541b (39:541b)
ld a, [rSVBK]
push af
ld a, $6
ld [rSVBK], a
+
ld hl, wBackupTilemap
decoord 0, 0
ld b, SCREEN_HEIGHT
-.asm_e542a
+.row
ld c, SCREEN_WIDTH
-.asm_e542c
+.col
ld a, [hli]
ld [de], a
inc de
dec c
- jr nz, .asm_e542c
- ld a, $c
+ jr nz, .col
+ ; add hl, $20 - SCREEN_WIDTH
+ ld a, $20 - SCREEN_WIDTH
add l
ld l, a
ld a, $0
@@ -1904,53 +1936,55 @@
adc h
ld h, a
dec b
- jr nz, .asm_e542a
+ jr nz, .row
+
pop af
ld [rSVBK], a
ret
-Functione5441: ; e5441 (39:5441)
- ld a, [wcf64]
+Intro_Scene16_AnimateSuicune: ; e5441 (39:5441)
+ ld a, [wIntroSceneFrameCounter]
and $3
- jr z, Functione5451
+ jr z, Intro_ColoredSuicuneFrameSwap
cp $3
- jr z, .asm_e544d
+ jr z, .PrepareForSuicuneSwap
ret
-.asm_e544d
+
+.PrepareForSuicuneSwap
xor a
ld [hBGMapMode], a
ret
-Functione5451: ; e5451 (39:5451)
+Intro_ColoredSuicuneFrameSwap: ; e5451 (39:5451)
hlcoord 0, 0
ld bc, SCREEN_HEIGHT * SCREEN_WIDTH
-.asm_e5457
+.loop
ld a, [hl]
and a
- jr z, .asm_e5462
+ jr z, .skip
cp $80
- jr nc, .asm_e5462
+ jr nc, .skip
xor $8
ld [hl], a
-.asm_e5462
+.skip
inc hl
dec bc
ld a, c
or b
- jr nz, .asm_e5457
+ jr nz, .loop
ld a, $1
ld [hBGMapMode], a
ret
-Functione546d: ; e546d (39:546d)
- ld a, [wcf64]
- cp $24
+Intro_RustleGrass: ; e546d (39:546d)
+ ld a, [wIntroSceneFrameCounter]
+ cp 36
ret nc
and $c
srl a
ld e, a
ld d, $0
- ld hl, Unknown_e5496
+ ld hl, .RustlingGrassPointers
add hl, de
ld a, [hli]
ld [Requested2bppSource], a
@@ -1960,32 +1994,34 @@
ld [Requested2bppDest], a
ld a, (VTiles2 tile $09) / $100
ld [Requested2bppDest + 1], a
- ld a, $4
- ld [Requested2bpp], a
+ ld a, 4
+ ld [Requested2bppSize], a
ret
; e5496 (39:5496)
-Unknown_e5496: ; e5496
- dw GFX_e799d
- dw GFX_e79dd
- dw GFX_e7a1d
- dw GFX_e79dd
+.RustlingGrassPointers: ; e5496
+ dw IntroGrass1GFX
+ dw IntroGrass2GFX
+ dw IntroGrass3GFX
+ dw IntroGrass2GFX
; e549e
-Functione549e: ; e549e (39:549e)
+Intro_SetCGBPalUpdate: ; e549e (39:549e)
ld a, $1
ld [hCGBPalUpdate], a
ret
-Functione54a3: ; e54a3 (39:54a3)
+Intro_ClearBGPals: ; e54a3 (39:54a3)
ld a, [rSVBK]
push af
ld a, $5
ld [rSVBK], a
+
ld hl, BGPals
- ld bc, $80
+ ld bc, 16 * 8
xor a
call ByteFill
+
pop af
ld [rSVBK], a
ld a, $1
@@ -1994,63 +2030,74 @@
call DelayFrame
ret
-Functione54c2: ; e54c2 (39:54c2)
+Intro_DecompressRequest2bpp_128Tiles: ; e54c2 (39:54c2)
ld a, [rSVBK]
push af
ld a, $6
ld [rSVBK], a
+
push de
ld de, wBackupTilemap
call Decompress
pop hl
+
ld de, wBackupTilemap
- ld bc, $180
+ lb bc, $01, $80
call Request2bpp
+
pop af
ld [rSVBK], a
ret
-Functione54de: ; e54de (39:54de)
+Intro_DecompressRequest2bpp_255Tiles: ; e54de (39:54de)
ld a, [rSVBK]
push af
ld a, $6
ld [rSVBK], a
+
push de
ld de, wBackupTilemap
call Decompress
pop hl
+
ld de, wBackupTilemap
- ld bc, $1ff
+ lb bc, $01, $ff
call Request2bpp
+
pop af
ld [rSVBK], a
ret
-Functione54fa: ; e54fa (39:54fa)
+Intro_DecompressRequest2bpp_64Tiles: ; e54fa (39:54fa)
ld a, [rSVBK]
push af
ld a, $6
ld [rSVBK], a
+
push de
ld de, wBackupTilemap
call Decompress
pop hl
+
ld de, wBackupTilemap
- ld bc, $140
+ lb bc, $01, $40
call Request2bpp
+
pop af
ld [rSVBK], a
ret
-Functione5516: ; e5516 (39:5516)
+Intro_ResetLYOverrides: ; e5516 (39:5516)
ld a, [rSVBK]
push af
ld a, $5
ld [rSVBK], a
+
ld hl, LYOverrides
- ld bc, $90
+ ld bc, LYOverridesEnd - LYOverrides
xor a
call ByteFill
+
pop af
ld [rSVBK], a
ld a, $43
@@ -2057,20 +2104,25 @@
ld [hLCDStatCustom], a
ret
-Functione552f: ; e552f (39:552f)
+Intro_PerspectiveScrollBG: ; e552f (39:552f)
ld a, [rSVBK]
push af
ld a, $5
ld [rSVBK], a
- ld a, [wcf64]
+ ; Scroll the grass every frame.
+ ; Scroll the trees every other frame and at half speed.
+ ; This creates an illusion of perspective.
+ ld a, [wIntroSceneFrameCounter]
and $1
- jr z, .asm_e5548
+ jr z, .skip
+ ; trees in the back
ld hl, LYOverrides
ld a, [hl]
inc a
ld bc, $5f
call ByteFill
-.asm_e5548
+.skip
+ ; grass in the front
ld hl, LYOverrides + $5f
ld a, [hl]
rept 2
@@ -2109,62 +2161,77 @@
RGB 20, 20, 20
RGB 11, 11, 11
RGB 0, 0, 0
+
RGB 0, 4, 5
RGB 1, 8, 5
RGB 4, 12, 9
RGB 24, 12, 9
+
RGB 0, 4, 5
RGB 9, 6, 8
RGB 8, 16, 5
RGB 5, 10, 4
+
RGB 31, 31, 31
RGB 9, 6, 8
RGB 18, 9, 9
RGB 13, 8, 9
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 31, 31, 31
RGB 2, 5, 22
RGB 1, 5, 12
+
RGB 31, 31, 31
RGB 31, 10, 25
RGB 31, 21, 0
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 21, 31
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
@@ -2207,62 +2274,77 @@
RGB 0, 0, 0
RGB 0, 0, 0
RGB 0, 0, 0
+
RGB 0, 0, 0
RGB 0, 0, 0
RGB 0, 0, 0
RGB 0, 0, 0
+
RGB 0, 0, 0
RGB 0, 0, 0
RGB 0, 0, 0
RGB 0, 0, 0
+
RGB 0, 0, 0
RGB 0, 0, 0
RGB 0, 0, 0
RGB 0, 0, 0
+
RGB 0, 0, 0
RGB 0, 0, 0
RGB 0, 0, 0
RGB 0, 0, 0
+
RGB 0, 0, 0
RGB 0, 0, 0
RGB 0, 0, 0
RGB 0, 0, 0
+
RGB 0, 0, 0
RGB 0, 0, 0
RGB 0, 0, 0
RGB 0, 0, 0
+
RGB 0, 0, 0
RGB 0, 0, 0
RGB 0, 0, 0
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 10, 0, 10
RGB 19, 0, 19
RGB 31, 0, 31
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
@@ -2285,62 +2367,77 @@
RGB 31, 31, 31
RGB 31, 31, 31
RGB 31, 31, 31
+
RGB 31, 31, 31
RGB 31, 31, 31
RGB 31, 31, 31
RGB 31, 31, 31
+
RGB 31, 31, 31
RGB 31, 31, 31
RGB 31, 31, 31
RGB 31, 31, 31
+
RGB 31, 31, 31
RGB 31, 31, 31
RGB 31, 31, 31
RGB 31, 31, 31
+
RGB 31, 31, 31
RGB 31, 31, 31
RGB 31, 31, 31
RGB 31, 31, 31
+
RGB 31, 31, 31
RGB 31, 31, 31
RGB 31, 31, 31
RGB 31, 31, 31
+
RGB 31, 31, 31
RGB 31, 31, 31
RGB 31, 31, 31
RGB 31, 31, 31
+
RGB 31, 31, 31
RGB 31, 31, 31
RGB 31, 31, 31
RGB 31, 31, 31
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
@@ -2363,62 +2460,77 @@
RGB 20, 20, 20
RGB 11, 11, 11
RGB 0, 0, 0
+
RGB 24, 12, 9
RGB 31, 31, 31
RGB 8, 9, 31
RGB 0, 0, 0
+
RGB 24, 12, 9
RGB 12, 20, 31
RGB 19, 8, 31
RGB 0, 0, 0
+
RGB 12, 20, 31
RGB 8, 9, 31
RGB 19, 8, 31
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 12, 20, 31
RGB 8, 9, 31
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
@@ -2453,62 +2565,77 @@
RGB 20, 20, 20
RGB 11, 11, 11
RGB 0, 0, 0
+
RGB 24, 12, 9
RGB 31, 31, 31
RGB 8, 9, 31
RGB 0, 0, 0
+
RGB 24, 12, 9
RGB 24, 12, 9
RGB 24, 12, 9
RGB 24, 12, 9
+
RGB 24, 12, 9
RGB 24, 12, 9
RGB 24, 12, 9
RGB 24, 12, 9
+
RGB 24, 12, 9
RGB 24, 12, 9
RGB 24, 12, 9
RGB 24, 12, 9
+
RGB 24, 12, 9
RGB 24, 12, 9
RGB 24, 12, 9
RGB 24, 12, 9
+
RGB 24, 12, 9
RGB 24, 12, 9
RGB 24, 12, 9
RGB 24, 12, 9
+
RGB 24, 12, 9
RGB 24, 12, 9
RGB 24, 12, 9
RGB 24, 12, 9
+
RGB 31, 31, 31
RGB 31, 31, 31
RGB 12, 0, 31
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 21, 9, 0
RGB 21, 9, 0
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
RGB 0, 0, 0
+
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
@@ -2518,14 +2645,12 @@
INCBIN "gfx/intro/unown_back.2bpp.lz"
; e799d
-GFX_e799d: ; e799d
-INCBIN "gfx/unknown/0e799d.2bpp"
-GFX_e79dd: ; e79dd
-INCBIN "gfx/unknown/0e79dd.2bpp"
-GFX_e7a1d: ; e7a1d
-INCBIN "gfx/unknown/0e7a1d.2bpp"
-
-GFX_e7a5d: ; e7a5d
-INCBIN "gfx/unknown/0e7a5d.2bpp"
-
+IntroGrass1GFX: ; e799d
+INCBIN "gfx/intro/grass1.2bpp"
+IntroGrass2GFX: ; e79dd
+INCBIN "gfx/intro/grass2.2bpp"
+IntroGrass3GFX: ; e7a1d
+INCBIN "gfx/intro/grass3.2bpp"
+IntroGrass4GFX: ; e7a5d
+INCBIN "gfx/intro/grass4.2bpp"
--- a/engine/intro_menu.asm
+++ b/engine/intro_menu.asm
@@ -7,7 +7,7 @@
ld [wMapMusic], a
call PlayMusic
callba MainMenu
- jp Function6219
+ jp StartTitleScreen
; 5b04
; unreferenced
@@ -1003,19 +1003,19 @@
.sprites ; 61fe
db 4
- db $4c, $48, 0
- db $4c, $50, 1
- db $54, $48, 2
- db $54, $50, 3
+ db 9 * 8 + 4, 9 * 8, 0
+ db 9 * 8 + 4, 10 * 8, 1
+ db 10 * 8 + 4, 9 * 8, 2
+ db 10 * 8 + 4, 10 * 8, 3
; 620b
Function620b: ; 620b
callab Functione4579
- jr c, Function6219
+ jr c, StartTitleScreen
callba CrystalIntro
-Function6219: ; 6219
+StartTitleScreen: ; 6219
ld a, [rSVBK]
push af
ld a, $5
--- a/engine/namingscreen.asm
+++ b/engine/namingscreen.asm
@@ -898,9 +898,9 @@
ld [hl], $7e
xor a
ld [hSCY], a
- ld [wc3bf], a
+ ld [wGlobalAnimYOffset], a
ld [hSCX], a
- ld [wc3c0], a
+ ld [wGlobalAnimXOffset], a
ld [wJumptableIndex], a
ld [wcf64], a
ld [hBGMapMode], a
--- a/engine/options_menu.asm
+++ b/engine/options_menu.asm
@@ -47,7 +47,7 @@
jr c, .ExitOptions
.dpad
- call Functione455c
+ call Options_UpdateCursorPosition
ld c, 3
call DelayFrames
jr .joypad_loop
@@ -563,3 +563,20 @@
scf
ret
; e455c
+
+Options_UpdateCursorPosition: ; e455c
+ hlcoord 1, 1
+ ld de, SCREEN_WIDTH
+ ld c, $10
+.loop
+ ld [hl], " "
+ add hl, de
+ dec c
+ jr nz, .loop
+ hlcoord 1, 2
+ ld bc, 2 * SCREEN_WIDTH
+ ld a, [wJumptableIndex]
+ call AddNTimes
+ ld [hl], "▶"
+ ret
+; e4579
--- a/engine/sprites.asm
+++ b/engine/sprites.asm
@@ -259,13 +259,13 @@
ld c, a ; number of objects
.loop
; first byte: y (px)
- ; [de] = [wCurrAnimYCoord] + [wCurrAnimYOffset] + [wc3bf] + Function8d0be([hl])
+ ; [de] = [wCurrAnimYCoord] + [wCurrAnimYOffset] + [wGlobalAnimYOffset] + Function8d0be([hl])
ld a, [wCurrAnimYCoord]
ld b, a
ld a, [wCurrAnimYOffset]
add b
ld b, a
- ld a, [wc3bf]
+ ld a, [wGlobalAnimYOffset]
add b
ld b, a
call Function8d0be
@@ -274,13 +274,13 @@
inc hl
inc de
; second byte: x (px)
- ; [de] = [wCurrAnimXCoord] + [wCurrAnimXOffset] + [wc3c0] + Function8d0ce([hl])
+ ; [de] = [wCurrAnimXCoord] + [wCurrAnimXOffset] + [wGlobalAnimXOffset] + Function8d0ce([hl])
ld a, [wCurrAnimXCoord]
ld b, a
ld a, [wCurrAnimXOffset]
add b
ld b, a
- ld a, [wc3c0]
+ ld a, [wGlobalAnimXOffset]
add b
ld b, a
call Function8d0ce
@@ -411,15 +411,15 @@
; 8d120
Function8d120:: ; 8d120
- ld hl, $1
+ ld hl, SPRITEANIMSTRUCT_01
add hl, bc
ld [hl], a
- ld hl, $8
+ ld hl, SPRITEANIMSTRUCT_DURATION
add hl, bc
- ld [hl], $0
- ld hl, $a
+ ld [hl], 0
+ ld hl, SPRITEANIMSTRUCT_FRAME
add hl, bc
- ld [hl], $ff
+ ld [hl], -1
ret
; 8d132
@@ -593,7 +593,7 @@
db $35, SPRITE_ANIM_SEQ_1D, $00 ; 26
db $37, SPRITE_ANIM_SEQ_1E, $00 ; 27
db $38, SPRITE_ANIM_SEQ_1E, $00 ; 28
- db $39, SPRITE_ANIM_SEQ_20, $00 ; 29
+ db $39, SPRITE_ANIM_SEQ_20, $00 ; 29 intro unown
db $3f, SPRITE_ANIM_SEQ_21, $00 ; 2a
db $3e, SPRITE_ANIM_SEQ_22, $00 ; 2b
db $40, SPRITE_ANIM_SEQ_00, $00 ; 2c
--- a/event/magnet_train.asm
+++ b/event/magnet_train.asm
@@ -359,7 +359,7 @@
inc a
add e
ld [wcf65], a
- ld hl, wc3c0
+ ld hl, wGlobalAnimXOffset
ld a, [wd191]
add [hl]
ld [hl], a
@@ -400,7 +400,7 @@
add d
endr
ld [wcf65], a
- ld hl, wc3c0
+ ld hl, wGlobalAnimXOffset
ld a, [wd191]
ld d, a
ld a, [hl]
binary files /dev/null b/gfx/intro/grass1.2bpp differ
binary files /dev/null b/gfx/intro/grass2.2bpp differ
binary files /dev/null b/gfx/intro/grass3.2bpp differ
binary files /dev/null b/gfx/intro/grass4.2bpp differ
binary files a/gfx/unknown/0e799d.2bpp /dev/null differ
binary files a/gfx/unknown/0e79dd.2bpp /dev/null differ
binary files a/gfx/unknown/0e7a1d.2bpp /dev/null differ
binary files a/gfx/unknown/0e7a5d.2bpp /dev/null differ
--- a/wram.asm
+++ b/wram.asm
@@ -476,8 +476,8 @@
wCurrAnimYCoord:: ds 1
wCurrAnimXOffset:: ds 1
wCurrAnimYOffset:: ds 1
-wc3bf:: ds 1
-wc3c0:: ds 1
+wGlobalAnimYOffset:: ds 1
+wGlobalAnimXOffset:: ds 1
wSpriteAnimsEnd::
wc3c1:: ds 11
@@ -1365,6 +1365,7 @@
wcf66:: ds 1
Requested2bpp:: ; cf67
+Requested2bppSize::
ds 1
Requested2bppSource:: ; cf68
ds 2
@@ -1372,6 +1373,7 @@
ds 2
Requested1bpp:: ; cf6c
+Requested1bppSize::
ds 1
Requested1bppSource:: ; cf6d
ds 2
@@ -2170,6 +2172,8 @@
ds 1
ds 1
+
+SECTION "Enemy Party", WRAMX, BANK [1]
wPokedexShowPointerAddr::
wd26b:: ds 1
wd26c:: ds 1
@@ -2180,7 +2184,8 @@
wd276:: ds 10
ds wd26b - @
-SECTION "Enemy Party", WRAMX, BANK [1]
+
+; SECTION "Enemy Party", WRAMX, BANK [1]
OTPlayerName:: ds NAME_LENGTH
OTPlayerID:: ds 2
ds 8