pokecrystal-board/engine/movie/intro.asm

1780 lines
28 KiB
NASM
Raw Normal View History

2018-06-24 07:09:41 -07:00
CrystalIntro:
ld a, TRUE
ldh [hLCDStatIntRequired], a
ldh a, [rSVBK]
2015-11-19 15:07:20 -08:00
push af
ld a, BANK(wGBCPalettes)
ldh [rSVBK], a
ldh a, [hInMenu]
2015-11-19 15:07:20 -08:00
push af
ldh a, [hVBlank]
2015-11-19 15:07:20 -08:00
push af
call .InitRAMAddrs
2018-06-24 07:09:41 -07:00
.loop
2015-11-19 15:07:20 -08:00
call JoyTextDelay
ldh a, [hJoyLast]
2015-11-19 15:07:20 -08:00
and BUTTONS
jr nz, .ShutOffMusic
ld a, [wJumptableIndex]
bit 7, a
jr nz, .done
call IntroSceneJumper
2017-12-24 09:47:30 -08:00
farcall PlaySpriteAnimations
2015-11-19 15:07:20 -08:00
call DelayFrame
jp .loop
.ShutOffMusic
2015-11-19 15:07:20 -08:00
ld de, MUSIC_NONE
call PlayMusic
.done
call ClearBGPalettes
call ClearSprites
call ClearTilemap
2015-11-19 15:07:20 -08:00
xor a
ldh [hSCX], a
ldh [hSCY], a
2022-04-05 12:02:37 -07:00
ld a, 7
ldh [hWX], a
2022-04-05 12:02:37 -07:00
ld a, SCREEN_HEIGHT_PX
ldh [hWY], a
2015-11-19 15:07:20 -08:00
pop af
ldh [hVBlank], a
2015-11-19 15:07:20 -08:00
pop af
ldh [hInMenu], a
2015-11-19 15:07:20 -08:00
pop af
ldh [rSVBK], a
2015-11-19 15:07:20 -08:00
ret
2018-06-24 07:09:41 -07:00
.InitRAMAddrs:
2015-11-19 15:07:20 -08:00
xor a
ldh [hVBlank], a
2015-11-19 15:07:20 -08:00
ld a, $1
ldh [hInMenu], a
2015-11-19 15:07:20 -08:00
xor a
ldh [hMapAnims], a
2015-11-19 15:07:20 -08:00
ld [wJumptableIndex], a
ret
2018-06-24 07:09:41 -07:00
IntroSceneJumper:
jumptable IntroScenes, wJumptableIndex
2015-11-19 15:07:20 -08:00
2018-06-24 07:09:41 -07:00
IntroScenes:
2015-11-19 15:07:20 -08:00
dw IntroScene1
dw IntroScene2
dw IntroScene3
dw IntroScene4
dw IntroScene5
dw IntroScene6
dw IntroScene7
dw IntroScene8
dw IntroScene9
dw IntroScene10
dw IntroScene11
dw IntroScene12
dw IntroScene13
dw IntroScene14
dw IntroScene15
dw IntroScene16
dw IntroScene17
dw IntroScene18
dw IntroScene19
dw IntroScene20
dw IntroScene21
dw IntroScene22
dw IntroScene23
dw IntroScene24
dw IntroScene25
dw IntroScene26
dw IntroScene27
dw IntroScene28
2018-06-24 07:09:41 -07:00
NextIntroScene:
2015-11-19 15:07:20 -08:00
ld hl, wJumptableIndex
inc [hl]
ret
2018-06-24 07:09:41 -07:00
IntroScene1:
2015-11-19 15:07:20 -08:00
; Setup the next scene.
2015-12-02 14:59:05 -08:00
call Intro_ClearBGPals
2015-11-19 15:07:20 -08:00
call ClearSprites
call ClearTilemap
2015-11-19 15:07:20 -08:00
xor a
ldh [hBGMapMode], a
2015-11-19 15:07:20 -08:00
ld a, $1
ldh [rVBK], a
2019-11-03 10:28:53 -08:00
ld hl, IntroUnownAAttrmap
2015-11-20 08:47:52 -08:00
debgcoord 0, 0
2015-12-02 14:59:05 -08:00
call Intro_DecompressRequest2bpp_64Tiles
2015-11-19 15:07:20 -08:00
ld a, $0
ldh [rVBK], a
2015-11-19 15:07:20 -08:00
ld hl, IntroUnownsGFX
2017-12-28 04:32:33 -08:00
ld de, vTiles2 tile $00
2015-12-02 14:59:05 -08:00
call Intro_DecompressRequest2bpp_128Tiles
2015-11-19 15:07:20 -08:00
ld hl, IntroPulseGFX
2017-12-28 04:32:33 -08:00
ld de, vTiles0 tile $00
2015-12-02 14:59:05 -08:00
call Intro_DecompressRequest2bpp_128Tiles
2019-11-03 10:28:53 -08:00
ld hl, IntroUnownATilemap
2015-11-20 08:47:52 -08:00
debgcoord 0, 0
2015-12-02 14:59:05 -08:00
call Intro_DecompressRequest2bpp_64Tiles
ldh a, [rSVBK]
2015-11-19 15:07:20 -08:00
push af
ld a, BANK(wBGPals1)
ldh [rSVBK], a
2019-11-03 10:28:53 -08:00
ld hl, IntroUnownsPalette
2018-01-01 06:08:21 -08:00
ld de, wBGPals1
2017-12-15 19:36:33 -08:00
ld bc, 16 palettes
2015-11-19 15:07:20 -08:00
call CopyBytes
2019-11-03 10:28:53 -08:00
ld hl, IntroUnownsPalette
2018-01-01 06:08:21 -08:00
ld de, wBGPals2
2017-12-15 19:36:33 -08:00
ld bc, 16 palettes
2015-11-19 15:07:20 -08:00
call CopyBytes
pop af
ldh [rSVBK], a
2015-11-19 15:07:20 -08:00
xor a
ldh [hSCX], a
ldh [hSCY], a
2022-04-05 12:02:37 -07:00
ld a, 7
ldh [hWX], a
2022-04-05 12:02:37 -07:00
ld a, SCREEN_HEIGHT_PX
ldh [hWY], a
2017-12-24 09:47:30 -08:00
farcall ClearSpriteAnims
2015-12-02 14:59:05 -08:00
call Intro_SetCGBPalUpdate
2015-11-19 15:07:20 -08:00
xor a
ld [wIntroSceneFrameCounter], a
2018-01-11 12:36:11 -08:00
ld [wIntroSceneTimer], a
2015-11-19 15:07:20 -08:00
call NextIntroScene
ret
2018-06-24 07:09:41 -07:00
IntroScene2:
2015-11-19 15:07:20 -08:00
; First Unown (A) fades in, pulses, then fades out.
ld hl, wIntroSceneFrameCounter
ld a, [hl]
inc [hl]
cp $80
jr nc, .endscene
cp $60
jr nz, .nosound
2015-11-19 15:07:20 -08:00
push af
2015-12-02 14:59:05 -08:00
depixel 11, 11
call CrystalIntro_InitUnownAnim
2015-11-19 15:07:20 -08:00
ld de, SFX_INTRO_UNOWN_1
call PlaySFX
pop af
.nosound
2018-01-11 12:36:11 -08:00
ld [wIntroSceneTimer], a
2015-11-19 15:07:20 -08:00
xor a
2015-12-02 14:59:05 -08:00
call CrystalIntro_UnownFade
2015-11-19 15:07:20 -08:00
ret
.endscene
call NextIntroScene
ret
2018-06-24 07:09:41 -07:00
IntroScene3:
2015-11-19 15:07:20 -08:00
; More setup. Transition to the outdoor scene.
2015-12-02 14:59:05 -08:00
call Intro_ClearBGPals
2015-11-19 15:07:20 -08:00
call ClearSprites
call ClearTilemap
2015-11-19 15:07:20 -08:00
xor a
ldh [hBGMapMode], a
2015-11-19 15:07:20 -08:00
ld a, $1
ldh [rVBK], a
2019-11-03 10:28:53 -08:00
ld hl, IntroBackgroundAttrmap
2015-11-20 08:47:52 -08:00
debgcoord 0, 0
2015-12-02 14:59:05 -08:00
call Intro_DecompressRequest2bpp_64Tiles
2015-11-19 15:07:20 -08:00
ld a, $0
ldh [rVBK], a
2015-11-19 15:07:20 -08:00
ld hl, IntroBackgroundGFX
2017-12-28 04:32:33 -08:00
ld de, vTiles2 tile $00
2015-12-02 14:59:05 -08:00
call Intro_DecompressRequest2bpp_128Tiles
2019-11-03 10:28:53 -08:00
ld hl, IntroBackgroundTilemap
2015-11-20 08:47:52 -08:00
debgcoord 0, 0
2015-12-02 14:59:05 -08:00
call Intro_DecompressRequest2bpp_64Tiles
ldh a, [rSVBK]
2015-11-19 15:07:20 -08:00
push af
ld a, BANK(wBGPals1)
ldh [rSVBK], a
2019-11-03 10:28:53 -08:00
ld hl, IntroBackgroundPalette
2018-01-01 06:08:21 -08:00
ld de, wBGPals1
2017-12-15 19:36:33 -08:00
ld bc, 16 palettes
2015-11-19 15:07:20 -08:00
call CopyBytes
2019-11-03 10:28:53 -08:00
ld hl, IntroBackgroundPalette
2018-01-01 06:08:21 -08:00
ld de, wBGPals2
2017-12-15 19:36:33 -08:00
ld bc, 16 palettes
2015-11-19 15:07:20 -08:00
call CopyBytes
pop af
ldh [rSVBK], a
2015-11-19 15:07:20 -08:00
xor a
ldh [hSCX], a
ldh [hSCY], a
2022-04-05 12:02:37 -07:00
ld a, 7
ldh [hWX], a
2022-04-05 12:02:37 -07:00
ld a, SCREEN_HEIGHT_PX
ldh [hWY], a
2015-12-02 14:59:05 -08:00
call Intro_ResetLYOverrides
call Intro_SetCGBPalUpdate
2015-11-19 15:07:20 -08:00
xor a
ld [wIntroSceneFrameCounter], a
call NextIntroScene
ret
2018-06-24 07:09:41 -07:00
IntroScene4:
2015-11-19 15:07:20 -08:00
; Scroll the outdoor panorama for a bit.
2015-12-02 14:59:05 -08:00
call Intro_PerspectiveScrollBG
2015-11-19 15:07:20 -08:00
ld hl, wIntroSceneFrameCounter
ld a, [hl]
cp $80
jr z, .endscene
inc [hl]
ret
2015-12-02 14:59:05 -08:00
2015-11-19 15:07:20 -08:00
.endscene
call NextIntroScene
ret
2018-06-24 07:09:41 -07:00
IntroScene5:
2015-11-19 15:07:20 -08:00
; Go back to the Unown.
2015-12-02 14:59:05 -08:00
call Intro_ClearBGPals
2015-11-19 15:07:20 -08:00
call ClearSprites
call ClearTilemap
2015-11-19 15:07:20 -08:00
xor a
ldh [hBGMapMode], a
ldh [hLCDCPointer], a
2015-11-19 15:07:20 -08:00
ld a, $1
ldh [rVBK], a
2019-11-03 10:28:53 -08:00
ld hl, IntroUnownHIAttrmap
2015-11-20 08:47:52 -08:00
debgcoord 0, 0
2015-12-02 14:59:05 -08:00
call Intro_DecompressRequest2bpp_64Tiles
2015-11-19 15:07:20 -08:00
ld a, $0
ldh [rVBK], a
2015-11-19 15:07:20 -08:00
ld hl, IntroUnownsGFX
2017-12-28 04:32:33 -08:00
ld de, vTiles2 tile $00
2015-12-02 14:59:05 -08:00
call Intro_DecompressRequest2bpp_128Tiles
2015-11-19 15:07:20 -08:00
ld hl, IntroPulseGFX
2017-12-28 04:32:33 -08:00
ld de, vTiles0 tile $00
2015-12-02 14:59:05 -08:00
call Intro_DecompressRequest2bpp_128Tiles
2019-11-03 10:28:53 -08:00
ld hl, IntroUnownHITilemap
2015-11-20 08:47:52 -08:00
debgcoord 0, 0
2015-12-02 14:59:05 -08:00
call Intro_DecompressRequest2bpp_64Tiles
ldh a, [rSVBK]
2015-11-19 15:07:20 -08:00
push af
ld a, BANK(wBGPals1)
ldh [rSVBK], a
2019-11-03 10:28:53 -08:00
ld hl, IntroUnownsPalette
2018-01-01 06:08:21 -08:00
ld de, wBGPals1
2017-12-15 19:36:33 -08:00
ld bc, 16 palettes
2015-11-19 15:07:20 -08:00
call CopyBytes
2019-11-03 10:28:53 -08:00
ld hl, IntroUnownsPalette
2018-01-01 06:08:21 -08:00
ld de, wBGPals2
2017-12-15 19:36:33 -08:00
ld bc, 16 palettes
2015-11-19 15:07:20 -08:00
call CopyBytes
pop af
ldh [rSVBK], a
2015-11-19 15:07:20 -08:00
xor a
ldh [hSCX], a
ldh [hSCY], a
2022-04-05 12:02:37 -07:00
ld a, 7
ldh [hWX], a
2022-04-05 12:02:37 -07:00
ld a, SCREEN_HEIGHT_PX
ldh [hWY], a
2017-12-24 09:47:30 -08:00
farcall ClearSpriteAnims
2015-12-02 14:59:05 -08:00
call Intro_SetCGBPalUpdate
2015-11-19 15:07:20 -08:00
xor a
2015-12-02 14:59:05 -08:00
ld [wIntroSceneFrameCounter], a
2018-01-11 12:36:11 -08:00
ld [wIntroSceneTimer], a
2015-11-19 15:07:20 -08:00
call NextIntroScene
ret
2018-06-24 07:09:41 -07:00
IntroScene6:
2015-11-19 15:07:20 -08:00
; Two more Unown (I, H) fade in.
2015-12-02 14:59:05 -08:00
ld hl, wIntroSceneFrameCounter
2015-11-19 15:07:20 -08:00
ld a, [hl]
inc [hl]
cp $80
jr nc, .endscene
cp $60
jr z, .SecondUnown
cp $40
jr nc, .StopUnown
cp $20
jr z, .FirstUnown
jr .NoUnown
2015-12-02 14:59:05 -08:00
.FirstUnown:
2015-11-19 15:07:20 -08:00
push af
2015-12-02 14:59:05 -08:00
depixel 7, 15
call CrystalIntro_InitUnownAnim
2015-11-19 15:07:20 -08:00
ld de, SFX_INTRO_UNOWN_2
call PlaySFX
pop af
.NoUnown:
2018-01-11 12:36:11 -08:00
ld [wIntroSceneTimer], a
2015-11-19 15:07:20 -08:00
xor a
2015-12-02 14:59:05 -08:00
call CrystalIntro_UnownFade
2015-11-19 15:07:20 -08:00
ret
2015-12-02 14:59:05 -08:00
.SecondUnown:
2015-11-19 15:07:20 -08:00
push af
2015-12-02 14:59:05 -08:00
depixel 14, 6
call CrystalIntro_InitUnownAnim
2015-11-19 15:07:20 -08:00
ld de, SFX_INTRO_UNOWN_1
call PlaySFX
pop af
.StopUnown:
2018-01-11 12:36:11 -08:00
ld [wIntroSceneTimer], a
2015-11-19 15:07:20 -08:00
ld a, $1
2015-12-02 14:59:05 -08:00
call CrystalIntro_UnownFade
2015-11-19 15:07:20 -08:00
ret
2015-12-02 14:59:05 -08:00
2015-11-19 15:07:20 -08:00
.endscene
call NextIntroScene
ret
2018-06-24 07:09:41 -07:00
IntroScene7:
2015-11-19 15:07:20 -08:00
; Back to the outdoor scene.
2015-12-02 14:59:05 -08:00
call Intro_ClearBGPals
2015-11-19 15:07:20 -08:00
call ClearSprites
call ClearTilemap
2015-11-19 15:07:20 -08:00
xor a
ldh [hBGMapMode], a
2015-12-02 14:59:05 -08:00
2015-11-19 15:07:20 -08:00
ld a, $1
ldh [rVBK], a
2019-11-03 10:28:53 -08:00
ld hl, IntroBackgroundAttrmap
2015-11-20 08:47:52 -08:00
debgcoord 0, 0
2015-12-02 14:59:05 -08:00
call Intro_DecompressRequest2bpp_64Tiles
2015-11-19 15:07:20 -08:00
ld hl, IntroPichuWooperGFX
2017-12-28 04:32:33 -08:00
ld de, vTiles0 tile $00
2015-12-02 14:59:05 -08:00
call Intro_DecompressRequest2bpp_128Tiles
2015-11-19 15:07:20 -08:00
ld a, $0
ldh [rVBK], a
2015-11-19 15:07:20 -08:00
ld hl, IntroSuicuneRunGFX
2017-12-28 04:32:33 -08:00
ld de, vTiles0 tile $00
2015-12-02 14:59:05 -08:00
call Intro_DecompressRequest2bpp_255Tiles
2015-11-19 15:07:20 -08:00
ld hl, IntroBackgroundGFX
2017-12-28 04:32:33 -08:00
ld de, vTiles2 tile $00
2015-12-02 14:59:05 -08:00
call Intro_DecompressRequest2bpp_128Tiles
2019-11-03 10:28:53 -08:00
ld hl, IntroBackgroundTilemap
2015-11-20 08:47:52 -08:00
debgcoord 0, 0
2015-12-02 14:59:05 -08:00
call Intro_DecompressRequest2bpp_64Tiles
ldh a, [rSVBK]
2015-11-19 15:07:20 -08:00
push af
ld a, BANK(wBGPals1)
ldh [rSVBK], a
2015-12-02 14:59:05 -08:00
2019-11-03 10:28:53 -08:00
ld hl, IntroBackgroundPalette
2018-01-01 06:08:21 -08:00
ld de, wBGPals1
2017-12-15 19:36:33 -08:00
ld bc, 16 palettes
2015-11-19 15:07:20 -08:00
call CopyBytes
2015-12-02 14:59:05 -08:00
2019-11-03 10:28:53 -08:00
ld hl, IntroBackgroundPalette
2018-01-01 06:08:21 -08:00
ld de, wBGPals2
2017-12-15 19:36:33 -08:00
ld bc, 16 palettes
2015-11-19 15:07:20 -08:00
call CopyBytes
2015-12-02 14:59:05 -08:00
2015-11-19 15:07:20 -08:00
pop af
ldh [rSVBK], a
2015-12-02 14:59:05 -08:00
2015-11-19 15:07:20 -08:00
xor a
ldh [hSCX], a
ldh [hSCY], a
2022-04-05 12:02:37 -07:00
ld a, 7
ldh [hWX], a
2022-04-05 12:02:37 -07:00
ld a, SCREEN_HEIGHT_PX
ldh [hWY], a
2015-12-02 14:59:05 -08:00
call Intro_ResetLYOverrides
2017-12-24 09:47:30 -08:00
farcall ClearSpriteAnims
2015-11-19 15:07:20 -08:00
depixel 13, 27, 4, 0
2023-09-24 06:06:19 -07:00
ld a, SPRITE_ANIM_OBJ_INTRO_SUICUNE
call InitSpriteAnimStruct
2015-11-19 15:07:20 -08:00
ld a, $f0
2015-12-02 14:59:05 -08:00
ld [wGlobalAnimXOffset], a
call Intro_SetCGBPalUpdate
2015-11-19 15:07:20 -08:00
xor a
ld [wIntroSceneFrameCounter], a
2018-01-11 12:36:11 -08:00
ld [wIntroSceneTimer], a
2015-11-19 15:07:20 -08:00
call NextIntroScene
ret
2018-06-24 07:09:41 -07:00
IntroScene8:
2015-11-19 15:07:20 -08:00
; Scroll the scene, then show Suicune running across the screen.
ld hl, wIntroSceneFrameCounter
ld a, [hl]
inc [hl]
cp $40
2015-12-02 14:59:05 -08:00
jr z, .suicune_sound
jr nc, .animate_suicune
call Intro_PerspectiveScrollBG
2015-11-19 15:07:20 -08:00
ret
2015-12-02 14:59:05 -08:00
.suicune_sound
2015-11-19 15:07:20 -08:00
ld de, SFX_INTRO_SUICUNE_3
call PlaySFX
2015-12-02 14:59:05 -08:00
.animate_suicune
ld a, [wGlobalAnimXOffset]
2015-11-19 15:07:20 -08:00
and a
2015-12-02 14:59:05 -08:00
jr z, .finish
2015-11-19 15:07:20 -08:00
sub $8
2015-12-02 14:59:05 -08:00
ld [wGlobalAnimXOffset], a
2015-11-19 15:07:20 -08:00
ret
2015-12-02 14:59:05 -08:00
.finish
2015-11-19 15:07:20 -08:00
ld de, SFX_INTRO_SUICUNE_2
call PlaySFX
2017-12-24 09:47:30 -08:00
farcall DeinitializeAllSprites
2015-11-19 15:07:20 -08:00
call NextIntroScene
ret
2018-06-24 07:09:41 -07:00
IntroScene9:
2015-11-19 15:07:20 -08:00
; Set up the next scene (same bg).
xor a
ldh [hLCDCPointer], a
2015-11-19 15:07:20 -08:00
call ClearSprites
hlcoord 0, 0, wAttrmap
2015-12-02 14:59:05 -08:00
; first 12 rows have palette 1
ld bc, 12 * SCREEN_WIDTH
2015-11-19 15:07:20 -08:00
ld a, $1
call ByteFill
2015-12-02 14:59:05 -08:00
; middle 3 rows have palette 2
ld bc, 3 * SCREEN_WIDTH
2015-11-19 15:07:20 -08:00
ld a, $2
call ByteFill
2015-12-02 14:59:05 -08:00
; last three rows have palette 3
ld bc, 3 * SCREEN_WIDTH
2015-11-19 15:07:20 -08:00
ld a, $3
call ByteFill
ld a, $2
ldh [hBGMapMode], a
2015-11-19 15:07:20 -08:00
call DelayFrame
call DelayFrame
call DelayFrame
ld a, LOW(vBGMap0 + $c) ; $c
ldh [hBGMapAddress], a
2015-11-19 15:07:20 -08:00
call DelayFrame
call DelayFrame
call DelayFrame
xor a
ldh [hBGMapMode], a
ldh [hBGMapAddress], a
2015-12-02 14:59:05 -08:00
ld [wGlobalAnimXOffset], a
2015-11-19 15:07:20 -08:00
xor a
2015-12-02 14:59:05 -08:00
ld [wIntroSceneFrameCounter], a
2015-11-19 15:07:20 -08:00
call NextIntroScene
ret
2018-06-24 07:09:41 -07:00
IntroScene10:
2015-11-19 15:07:20 -08:00
; Wooper and Pichu enter.
2015-12-02 14:59:05 -08:00
call Intro_RustleGrass
ld hl, wIntroSceneFrameCounter
2015-11-19 15:07:20 -08:00
ld a, [hl]
inc [hl]
cp $c0
jr z, .done
cp $20
jr z, .wooper
cp $40
jr z, .pichu
ret
.pichu
depixel 21, 16, 1, 0
2023-09-24 06:06:19 -07:00
ld a, SPRITE_ANIM_OBJ_INTRO_PICHU
call InitSpriteAnimStruct
2015-11-19 15:07:20 -08:00
ld de, SFX_INTRO_PICHU
call PlaySFX
ret
.wooper
depixel 22, 6
2023-09-24 06:06:19 -07:00
ld a, SPRITE_ANIM_OBJ_INTRO_WOOPER
call InitSpriteAnimStruct
2015-11-19 15:07:20 -08:00
ld de, SFX_INTRO_PICHU
call PlaySFX
ret
.done
call NextIntroScene
ret
2018-06-24 07:09:41 -07:00
IntroScene11:
2015-11-19 15:07:20 -08:00
; Back to Unown again.
2015-12-02 14:59:05 -08:00
call Intro_ClearBGPals
2015-11-19 15:07:20 -08:00
call ClearSprites
call ClearTilemap
2015-11-19 15:07:20 -08:00
xor a
ldh [hBGMapMode], a
ldh [hLCDCPointer], a
2015-11-19 15:07:20 -08:00
ld a, $1
ldh [rVBK], a
2019-11-03 10:28:53 -08:00
ld hl, IntroUnownsAttrmap
2015-11-20 08:47:52 -08:00
debgcoord 0, 0
2015-12-02 14:59:05 -08:00
call Intro_DecompressRequest2bpp_64Tiles
2015-11-19 15:07:20 -08:00
ld a, $0
ldh [rVBK], a
2015-11-19 15:07:20 -08:00
ld hl, IntroUnownsGFX
2017-12-28 04:32:33 -08:00
ld de, vTiles2 tile $00
2015-12-02 14:59:05 -08:00
call Intro_DecompressRequest2bpp_128Tiles
2019-11-03 10:28:53 -08:00
ld hl, IntroUnownsTilemap
2015-11-20 08:47:52 -08:00
debgcoord 0, 0
2015-12-02 14:59:05 -08:00
call Intro_DecompressRequest2bpp_64Tiles
ldh a, [rSVBK]
2015-11-19 15:07:20 -08:00
push af
ld a, BANK(wBGPals1)
ldh [rSVBK], a
2019-11-03 10:28:53 -08:00
ld hl, IntroUnownsPalette
2018-01-01 06:08:21 -08:00
ld de, wBGPals1
2017-12-15 19:36:33 -08:00
ld bc, 16 palettes
2015-11-19 15:07:20 -08:00
call CopyBytes
2019-11-03 10:28:53 -08:00
ld hl, IntroUnownsPalette
2018-01-01 06:08:21 -08:00
ld de, wBGPals2
2017-12-15 19:36:33 -08:00
ld bc, 16 palettes
2015-11-19 15:07:20 -08:00
call CopyBytes
pop af
ldh [rSVBK], a
2015-11-19 15:07:20 -08:00
xor a
ldh [hSCX], a
ldh [hSCY], a
2022-04-05 12:02:37 -07:00
ld a, 7
ldh [hWX], a
2022-04-05 12:02:37 -07:00
ld a, SCREEN_HEIGHT_PX
ldh [hWY], a
2017-12-24 09:47:30 -08:00
farcall ClearSpriteAnims
2015-12-02 14:59:05 -08:00
call Intro_SetCGBPalUpdate
2015-11-19 15:07:20 -08:00
xor a
ld [wIntroSceneFrameCounter], a
2018-01-11 12:36:11 -08:00
ld [wIntroSceneTimer], a
2015-11-19 15:07:20 -08:00
call NextIntroScene
ret
2018-06-24 07:09:41 -07:00
IntroScene12:
2015-11-19 15:07:20 -08:00
; Even more Unown.
2015-12-02 14:59:05 -08:00
call .PlayUnownSound
2015-11-19 15:07:20 -08:00
ld hl, wIntroSceneFrameCounter
ld a, [hl]
inc [hl]
cp $c0
2015-12-02 14:59:05 -08:00
jr nc, .done
2015-11-19 15:07:20 -08:00
cp $80
2015-12-02 14:59:05 -08:00
jr nc, .second_half
; first half
2015-11-19 15:07:20 -08:00
ld c, a
and $1f
sla a
2018-01-11 12:36:11 -08:00
ld [wIntroSceneTimer], a
2015-11-19 15:07:20 -08:00
ld a, c
and $e0
srl a
swap a
2015-12-02 14:59:05 -08:00
call CrystalIntro_UnownFade
2015-11-19 15:07:20 -08:00
ret
2015-12-02 14:59:05 -08:00
.second_half
; double speed
2015-11-19 15:07:20 -08:00
ld c, a
and $f
sla a
sla a
2018-01-11 12:36:11 -08:00
ld [wIntroSceneTimer], a
2015-11-19 15:07:20 -08:00
ld a, c
and $70
or $40
swap a
2015-12-02 14:59:05 -08:00
call CrystalIntro_UnownFade
2015-11-19 15:07:20 -08:00
ret
2015-12-02 14:59:05 -08:00
.done
2015-11-19 15:07:20 -08:00
call NextIntroScene
ret
2018-06-24 07:09:41 -07:00
.PlayUnownSound:
2015-11-19 15:07:20 -08:00
ld a, [wIntroSceneFrameCounter]
ld c, a
ld hl, .UnownSounds
.loop
ld a, [hli]
cp -1
ret z
cp c
jr z, .playsound
inc hl
inc hl
2015-11-19 15:07:20 -08:00
jr .loop
.playsound
ld a, [hli]
ld d, [hl]
ld e, a
push de
call SFXChannelsOff
pop de
call PlaySFX
ret
2018-06-24 07:09:41 -07:00
.UnownSounds:
2015-11-19 15:07:20 -08:00
dbw $00, SFX_INTRO_UNOWN_3
dbw $20, SFX_INTRO_UNOWN_2
dbw $40, SFX_INTRO_UNOWN_1
dbw $60, SFX_INTRO_UNOWN_2
dbw $80, SFX_INTRO_UNOWN_3
dbw $90, SFX_INTRO_UNOWN_2
dbw $a0, SFX_INTRO_UNOWN_1
dbw $b0, SFX_INTRO_UNOWN_2
2018-06-24 07:09:41 -07:00
db -1
2015-11-19 15:07:20 -08:00
2018-06-24 07:09:41 -07:00
IntroScene13:
2015-11-19 15:07:20 -08:00
; Switch scenes again.
2015-12-02 14:59:05 -08:00
call Intro_ClearBGPals
2015-11-19 15:07:20 -08:00
call ClearSprites
call ClearTilemap
2015-11-19 15:07:20 -08:00
xor a
ldh [hBGMapMode], a
2015-11-19 15:07:20 -08:00
ld a, $1
ldh [rVBK], a
2019-11-03 10:28:53 -08:00
ld hl, IntroBackgroundAttrmap
2015-11-20 08:47:52 -08:00
debgcoord 0, 0
2015-12-02 14:59:05 -08:00
call Intro_DecompressRequest2bpp_64Tiles
2015-11-19 15:07:20 -08:00
ld a, $0
ldh [rVBK], a
2015-11-19 15:07:20 -08:00
ld hl, IntroSuicuneRunGFX
2017-12-28 04:32:33 -08:00
ld de, vTiles0 tile $00
2015-12-02 14:59:05 -08:00
call Intro_DecompressRequest2bpp_255Tiles
2015-11-19 15:07:20 -08:00
ld hl, IntroBackgroundGFX
2017-12-28 04:32:33 -08:00
ld de, vTiles2 tile $00
2015-12-02 14:59:05 -08:00
call Intro_DecompressRequest2bpp_128Tiles
2019-11-03 10:28:53 -08:00
ld hl, IntroBackgroundTilemap
2015-11-20 08:47:52 -08:00
debgcoord 0, 0
2015-12-02 14:59:05 -08:00
call Intro_DecompressRequest2bpp_64Tiles
ldh a, [rSVBK]
2015-11-19 15:07:20 -08:00
push af
ld a, BANK(wBGPals1)
ldh [rSVBK], a
2019-11-03 10:28:53 -08:00
ld hl, IntroBackgroundPalette
2018-01-01 06:08:21 -08:00
ld de, wBGPals1
2017-12-15 19:36:33 -08:00
ld bc, 16 palettes
2015-11-19 15:07:20 -08:00
call CopyBytes
2019-11-03 10:28:53 -08:00
ld hl, IntroBackgroundPalette
2018-01-01 06:08:21 -08:00
ld de, wBGPals2
2017-12-15 19:36:33 -08:00
ld bc, 16 palettes
2015-11-19 15:07:20 -08:00
call CopyBytes
pop af
ldh [rSVBK], a
2015-11-19 15:07:20 -08:00
xor a
ldh [hSCX], a
ldh [hSCY], a
2022-04-05 12:02:37 -07:00
ld a, 7
ldh [hWX], a
2022-04-05 12:02:37 -07:00
ld a, SCREEN_HEIGHT_PX
ldh [hWY], a
2017-12-24 09:47:30 -08:00
farcall ClearSpriteAnims
2015-11-19 15:07:20 -08:00
depixel 13, 11, 4, 0
2023-09-24 06:06:19 -07:00
ld a, SPRITE_ANIM_OBJ_INTRO_SUICUNE
call InitSpriteAnimStruct
2015-11-19 15:07:20 -08:00
ld de, MUSIC_CRYSTAL_OPENING
call PlayMusic
xor a
2015-12-02 14:59:05 -08:00
ld [wGlobalAnimXOffset], a
call Intro_SetCGBPalUpdate
2015-11-19 15:07:20 -08:00
xor a
2015-12-02 14:59:05 -08:00
ld [wIntroSceneFrameCounter], a
2018-01-11 12:36:11 -08:00
ld [wIntroSceneTimer], a
2015-11-19 15:07:20 -08:00
call NextIntroScene
ret
2018-06-24 07:09:41 -07:00
IntroScene14:
2015-11-19 15:07:20 -08:00
; Suicune runs then jumps.
ldh a, [hSCX]
2015-11-19 15:07:20 -08:00
sub 10
ldh [hSCX], a
2015-12-02 14:59:05 -08:00
ld hl, wIntroSceneFrameCounter
2015-11-19 15:07:20 -08:00
ld a, [hl]
inc [hl]
cp $80
jr z, .done
cp $60
jr z, .jump
2021-02-05 09:44:21 -08:00
jr nc, .run_after_jump
2015-11-19 15:07:20 -08:00
cp $40
2021-02-05 09:44:21 -08:00
jr nc, .run
2015-11-19 15:07:20 -08:00
ret
.jump
ld de, SFX_INTRO_SUICUNE_4
call PlaySFX
2021-02-05 09:44:21 -08:00
.run_after_jump
2015-11-19 15:07:20 -08:00
ld a, $1
2018-01-11 12:36:11 -08:00
ld [wIntroSceneTimer], a
2015-12-02 14:59:05 -08:00
ld a, [wGlobalAnimXOffset]
2015-11-19 15:07:20 -08:00
cp $88
2021-02-05 09:44:21 -08:00
jr c, .disappear
2015-11-19 15:07:20 -08:00
sub $8
2015-12-02 14:59:05 -08:00
ld [wGlobalAnimXOffset], a
2015-11-19 15:07:20 -08:00
ret
2021-02-05 09:44:21 -08:00
.disappear
2017-12-24 09:47:30 -08:00
farcall DeinitializeAllSprites
2015-11-19 15:07:20 -08:00
ret
2021-02-05 09:44:21 -08:00
.run
2015-12-02 14:59:05 -08:00
ld a, [wGlobalAnimXOffset]
2015-11-19 15:07:20 -08:00
sub $2
2015-12-02 14:59:05 -08:00
ld [wGlobalAnimXOffset], a
2015-11-19 15:07:20 -08:00
ret
.done
call NextIntroScene
ret
2018-06-24 07:09:41 -07:00
IntroScene15:
2015-11-19 15:07:20 -08:00
; Transition to a new scene.
2015-12-02 14:59:05 -08:00
call Intro_ClearBGPals
2015-11-19 15:07:20 -08:00
call ClearSprites
call ClearTilemap
2015-11-19 15:07:20 -08:00
xor a
ldh [hBGMapMode], a
2015-11-19 15:07:20 -08:00
ld a, $1
ldh [rVBK], a
2019-11-03 10:28:53 -08:00
ld hl, IntroSuicuneJumpAttrmap
2015-11-20 08:47:52 -08:00
debgcoord 0, 0
2015-12-02 14:59:05 -08:00
call Intro_DecompressRequest2bpp_64Tiles
2015-11-19 15:07:20 -08:00
ld a, $0
ldh [rVBK], a
2015-11-19 15:07:20 -08:00
ld hl, IntroSuicuneJumpGFX
2017-12-28 04:32:33 -08:00
ld de, vTiles2 tile $00
2015-12-02 14:59:05 -08:00
call Intro_DecompressRequest2bpp_128Tiles
2015-11-19 15:07:20 -08:00
ld hl, IntroUnownBackGFX
2017-12-28 04:32:33 -08:00
ld de, vTiles0 tile $00
2015-12-02 14:59:05 -08:00
call Intro_DecompressRequest2bpp_128Tiles
ld de, IntroGrass4GFX
2017-12-28 04:32:33 -08:00
ld hl, vTiles1 tile $00
2015-12-02 14:59:05 -08:00
lb bc, BANK(IntroGrass4GFX), 1
2015-11-19 15:07:20 -08:00
call Request2bpp
2019-11-03 10:28:53 -08:00
ld hl, IntroSuicuneJumpTilemap
2015-11-20 08:47:52 -08:00
debgcoord 0, 0
2015-12-02 14:59:05 -08:00
call Intro_DecompressRequest2bpp_64Tiles
call Intro_LoadTilemap
ldh a, [rSVBK]
2015-11-19 15:07:20 -08:00
push af
ld a, BANK(wBGPals1)
ldh [rSVBK], a
2019-11-03 10:28:53 -08:00
ld hl, IntroSuicunePalette
2018-01-01 06:08:21 -08:00
ld de, wBGPals1
2017-12-15 19:36:33 -08:00
ld bc, 16 palettes
2015-11-19 15:07:20 -08:00
call CopyBytes
2019-11-03 10:28:53 -08:00
ld hl, IntroSuicunePalette
2018-01-01 06:08:21 -08:00
ld de, wBGPals2
2017-12-15 19:36:33 -08:00
ld bc, 16 palettes
2015-11-19 15:07:20 -08:00
call CopyBytes
pop af
ldh [rSVBK], a
2015-11-19 15:07:20 -08:00
xor a
ldh [hSCX], a
2022-04-05 12:02:37 -07:00
ld a, SCREEN_HEIGHT_PX
ldh [hSCY], a
2022-04-05 12:02:37 -07:00
ld a, 7
ldh [hWX], a
2022-04-05 12:02:37 -07:00
ld a, SCREEN_HEIGHT_PX
ldh [hWY], a
2017-12-24 09:47:30 -08:00
farcall ClearSpriteAnims
2015-12-02 14:59:05 -08:00
call Intro_SetCGBPalUpdate
2015-11-19 15:07:20 -08:00
depixel 8, 5
2023-09-24 06:06:19 -07:00
ld a, SPRITE_ANIM_OBJ_INTRO_UNOWN_F
call InitSpriteAnimStruct
2015-11-19 15:07:20 -08:00
depixel 12, 0
2023-09-24 06:06:19 -07:00
ld a, SPRITE_ANIM_OBJ_INTRO_SUICUNE_AWAY
call InitSpriteAnimStruct
2015-11-19 15:07:20 -08:00
xor a
2015-12-02 14:59:05 -08:00
ld [wIntroSceneFrameCounter], a
2018-01-11 12:36:11 -08:00
ld [wIntroSceneTimer], a
2015-11-19 15:07:20 -08:00
call NextIntroScene
ret
2018-06-24 07:09:41 -07:00
IntroScene16:
2015-11-19 15:07:20 -08:00
; Suicune shows its face. An Unown appears in front.
2015-12-02 14:59:05 -08:00
ld hl, wIntroSceneFrameCounter
2015-11-19 15:07:20 -08:00
ld a, [hl]
inc [hl]
cp $80
jr nc, .done
2015-12-02 14:59:05 -08:00
call Intro_Scene16_AnimateSuicune
ldh a, [hSCY]
2015-11-19 15:07:20 -08:00
and a
ret z
add 8
ldh [hSCY], a
2015-11-19 15:07:20 -08:00
ret
.done
call NextIntroScene
ret
2018-06-24 07:09:41 -07:00
IntroScene17:
2015-11-19 15:07:20 -08:00
; ...
2015-12-02 14:59:05 -08:00
call Intro_ClearBGPals
2015-11-19 15:07:20 -08:00
call ClearSprites
call ClearTilemap
2015-11-19 15:07:20 -08:00
xor a
ldh [hBGMapMode], a
2015-11-19 15:07:20 -08:00
ld a, $1
ldh [rVBK], a
2019-11-03 10:28:53 -08:00
ld hl, IntroSuicuneCloseAttrmap
2015-11-20 08:47:52 -08:00
debgcoord 0, 0
2015-12-02 14:59:05 -08:00
call Intro_DecompressRequest2bpp_64Tiles
2015-11-19 15:07:20 -08:00
ld a, $0
ldh [rVBK], a
2015-11-19 15:07:20 -08:00
ld hl, IntroSuicuneCloseGFX
2017-12-28 04:32:33 -08:00
ld de, vTiles1 tile $00
2015-12-02 14:59:05 -08:00
call Intro_DecompressRequest2bpp_255Tiles
2019-11-03 10:28:53 -08:00
ld hl, IntroSuicuneCloseTilemap
2015-11-20 08:47:52 -08:00
debgcoord 0, 0
2015-12-02 14:59:05 -08:00
call Intro_DecompressRequest2bpp_64Tiles
ldh a, [rSVBK]
2015-11-19 15:07:20 -08:00
push af
ld a, BANK(wBGPals1)
ldh [rSVBK], a
2019-11-03 10:28:53 -08:00
ld hl, IntroSuicuneClosePalette
2018-01-01 06:08:21 -08:00
ld de, wBGPals1
2017-12-15 19:36:33 -08:00
ld bc, 16 palettes
2015-11-19 15:07:20 -08:00
call CopyBytes
2019-11-03 10:28:53 -08:00
ld hl, IntroSuicuneClosePalette
2018-01-01 06:08:21 -08:00
ld de, wBGPals2
2017-12-15 19:36:33 -08:00
ld bc, 16 palettes
2015-11-19 15:07:20 -08:00
call CopyBytes
pop af
ldh [rSVBK], a
2015-11-19 15:07:20 -08:00
xor a
ldh [hSCX], a
ldh [hSCY], a
2022-04-05 12:02:37 -07:00
ld a, 7
ldh [hWX], a
2022-04-05 12:02:37 -07:00
ld a, SCREEN_HEIGHT_PX
ldh [hWY], a
2017-12-24 09:47:30 -08:00
farcall ClearSpriteAnims
2015-12-02 14:59:05 -08:00
call Intro_SetCGBPalUpdate
2015-11-19 15:07:20 -08:00
xor a
2015-12-02 14:59:05 -08:00
ld [wIntroSceneFrameCounter], a
2018-01-11 12:36:11 -08:00
ld [wIntroSceneTimer], a
2015-11-19 15:07:20 -08:00
call NextIntroScene
ret
2018-06-24 07:09:41 -07:00
IntroScene18:
2015-11-19 15:07:20 -08:00
; Suicune close up.
2015-12-02 14:59:05 -08:00
ld hl, wIntroSceneFrameCounter
2015-11-19 15:07:20 -08:00
ld a, [hl]
inc [hl]
cp $60
jr nc, .done
ldh a, [hSCX]
2015-11-19 15:07:20 -08:00
cp $60
ret z
add 8
ldh [hSCX], a
2015-11-19 15:07:20 -08:00
ret
.done
call NextIntroScene
ret
2018-06-24 07:09:41 -07:00
IntroScene19:
2015-11-19 15:07:20 -08:00
; More setup.
2015-12-02 14:59:05 -08:00
call Intro_ClearBGPals
2015-11-19 15:07:20 -08:00
call ClearSprites
call ClearTilemap
2015-11-19 15:07:20 -08:00
xor a
ldh [hBGMapMode], a
2015-11-19 15:07:20 -08:00
ld a, $1
ldh [rVBK], a
2019-11-03 10:28:53 -08:00
ld hl, IntroSuicuneBackAttrmap
2015-11-20 08:47:52 -08:00
debgcoord 0, 0
2015-12-02 14:59:05 -08:00
call Intro_DecompressRequest2bpp_64Tiles
2015-11-19 15:07:20 -08:00
ld a, $0
ldh [rVBK], a
2015-11-19 15:07:20 -08:00
ld hl, IntroSuicuneBackGFX
2017-12-28 04:32:33 -08:00
ld de, vTiles2 tile $00
2015-12-02 14:59:05 -08:00
call Intro_DecompressRequest2bpp_128Tiles
2015-11-19 15:07:20 -08:00
ld hl, IntroUnownsGFX
2017-12-28 04:32:33 -08:00
ld de, vTiles1 tile $00
2015-12-02 14:59:05 -08:00
call Intro_DecompressRequest2bpp_128Tiles
ld de, IntroGrass4GFX
2017-12-28 04:32:33 -08:00
ld hl, vTiles1 tile $7f
2015-12-02 14:59:05 -08:00
lb bc, BANK(IntroGrass4GFX), 1
2015-11-19 15:07:20 -08:00
call Request2bpp
2019-11-03 10:28:53 -08:00
ld hl, IntroSuicuneBackTilemap
2015-11-20 08:47:52 -08:00
debgcoord 0, 0
2015-12-02 14:59:05 -08:00
call Intro_DecompressRequest2bpp_64Tiles
call Intro_LoadTilemap
ldh a, [rSVBK]
2015-11-19 15:07:20 -08:00
push af
ld a, BANK(wBGPals1)
ldh [rSVBK], a
2019-11-03 10:28:53 -08:00
ld hl, IntroSuicunePalette
2018-01-01 06:08:21 -08:00
ld de, wBGPals1
2017-12-15 19:36:33 -08:00
ld bc, 16 palettes
2015-11-19 15:07:20 -08:00
call CopyBytes
2019-11-03 10:28:53 -08:00
ld hl, IntroSuicunePalette
2018-01-01 06:08:21 -08:00
ld de, wBGPals2
2017-12-15 19:36:33 -08:00
ld bc, 16 palettes
2015-11-19 15:07:20 -08:00
call CopyBytes
pop af
ldh [rSVBK], a
2015-11-19 15:07:20 -08:00
xor a
ldh [hSCX], a
ld a, -5 * TILE_WIDTH
ldh [hSCY], a
2022-04-05 12:02:37 -07:00
ld a, 7
ldh [hWX], a
2022-04-05 12:02:37 -07:00
ld a, SCREEN_HEIGHT_PX
ldh [hWY], a
2017-12-24 09:47:30 -08:00
farcall ClearSpriteAnims
2015-12-04 05:46:11 -08:00
ld hl, wSpriteAnimDict
2020-10-30 12:39:08 -07:00
xor a ; SPRITE_ANIM_DICT_DEFAULT
2015-11-19 15:07:20 -08:00
ld [hli], a
ld [hl], $7f
2015-12-02 14:59:05 -08:00
call Intro_SetCGBPalUpdate
2015-11-19 15:07:20 -08:00
depixel 12, 0
2023-09-24 06:06:19 -07:00
ld a, SPRITE_ANIM_OBJ_INTRO_SUICUNE_AWAY
call InitSpriteAnimStruct
2015-11-19 15:07:20 -08:00
xor a
2015-12-02 14:59:05 -08:00
ld [wIntroSceneFrameCounter], a
2018-01-11 12:36:11 -08:00
ld [wIntroSceneTimer], a
2015-11-19 15:07:20 -08:00
call NextIntroScene
ret
2018-06-24 07:09:41 -07:00
IntroScene20:
2015-11-19 15:07:20 -08:00
; Suicune running away. A bunch of Unown appear.
2015-12-02 14:59:05 -08:00
ld hl, wIntroSceneFrameCounter
2015-11-19 15:07:20 -08:00
ld a, [hl]
inc [hl]
cp $98
2015-12-02 14:59:05 -08:00
jr nc, .finished
2015-11-19 15:07:20 -08:00
cp $58
ret nc
cp $40
2015-12-02 14:59:05 -08:00
jr nc, .AppearUnown
2015-11-19 15:07:20 -08:00
cp $28
ret nc
ldh a, [hSCY]
2015-11-19 15:07:20 -08:00
inc a
ldh [hSCY], a
2015-11-19 15:07:20 -08:00
ret
.AppearUnown:
2015-11-19 15:07:20 -08:00
sub $18
ld c, a
and $3
cp $3
ret nz
ld a, c
and $1c
srl a
srl a
2018-01-11 12:36:11 -08:00
ld [wIntroSceneTimer], a
2015-11-19 15:07:20 -08:00
xor a
2015-12-02 14:59:05 -08:00
call Intro_Scene20_AppearUnown
2015-11-19 15:07:20 -08:00
ret
.AppearUnownPal2: ; unreferenced
2015-11-19 15:07:20 -08:00
ld a, c
and $1c
srl a
srl a
2018-01-11 12:36:11 -08:00
ld [wIntroSceneTimer], a
2015-11-19 15:07:20 -08:00
ld a, 1
2015-12-02 14:59:05 -08:00
call Intro_Scene20_AppearUnown
2015-11-19 15:07:20 -08:00
ret
.finished:
2015-11-19 15:07:20 -08:00
call NextIntroScene
ret
2018-06-24 07:09:41 -07:00
IntroScene21:
2015-11-19 15:07:20 -08:00
; Suicune gets more distant and turns black.
2015-12-02 14:59:05 -08:00
call Intro_ColoredSuicuneFrameSwap
2015-11-19 15:07:20 -08:00
ld c, 3
call DelayFrames
xor a
ldh [hBGMapMode], a
2015-12-02 14:59:05 -08:00
ld [wIntroSceneFrameCounter], a
2018-01-11 12:36:11 -08:00
ld [wIntroSceneTimer], a
2015-11-19 15:07:20 -08:00
call NextIntroScene
ret
2018-06-24 07:09:41 -07:00
IntroScene22:
2015-12-02 14:59:05 -08:00
ld hl, wIntroSceneFrameCounter
2015-11-19 15:07:20 -08:00
ld a, [hl]
inc [hl]
cp $8
jr nc, .done
ret
.done
2017-12-24 09:47:30 -08:00
farcall DeinitializeAllSprites
2015-11-19 15:07:20 -08:00
call NextIntroScene
ret
2018-06-24 07:09:41 -07:00
IntroScene23:
2015-11-19 15:07:20 -08:00
xor a
2015-12-02 14:59:05 -08:00
ld [wIntroSceneFrameCounter], a
2015-11-19 15:07:20 -08:00
call NextIntroScene
ret
2018-06-24 07:09:41 -07:00
IntroScene24:
2015-11-19 15:07:20 -08:00
; Fade to white.
2015-12-02 14:59:05 -08:00
ld hl, wIntroSceneFrameCounter
2015-11-19 15:07:20 -08:00
ld a, [hl]
inc [hl]
cp $20
jr nc, .done
ld c, a
and $3
ret nz
2015-12-02 14:59:05 -08:00
2015-11-19 15:07:20 -08:00
ld a, c
and $1c
sla a
2015-12-02 14:59:05 -08:00
call Intro_Scene24_ApplyPaletteFade
2015-11-19 15:07:20 -08:00
ret
.done
ld a, $40
2015-12-02 14:59:05 -08:00
ld [wIntroSceneFrameCounter], a
2015-11-19 15:07:20 -08:00
call NextIntroScene
ret
2018-06-24 07:09:41 -07:00
IntroScene25:
2015-11-19 15:07:20 -08:00
; Wait around a bit.
2015-12-02 14:59:05 -08:00
ld a, [wIntroSceneFrameCounter]
2015-11-19 15:07:20 -08:00
dec a
jr z, .done
2015-12-02 14:59:05 -08:00
ld [wIntroSceneFrameCounter], a
2015-11-19 15:07:20 -08:00
ret
2015-12-02 14:59:05 -08:00
2015-11-19 15:07:20 -08:00
.done
call NextIntroScene
ret
2018-06-24 07:09:41 -07:00
IntroScene26:
2015-11-19 15:07:20 -08:00
; Load the final scene.
call ClearBGPalettes
call ClearSprites
call ClearTilemap
2015-11-19 15:07:20 -08:00
xor a
ldh [hBGMapMode], a
2015-11-19 15:07:20 -08:00
ld a, $1
ldh [rVBK], a
2019-11-03 10:28:53 -08:00
ld hl, IntroCrystalUnownsAttrmap
2015-11-20 08:47:52 -08:00
debgcoord 0, 0
2015-12-02 14:59:05 -08:00
call Intro_DecompressRequest2bpp_64Tiles
2015-11-19 15:07:20 -08:00
ld a, $0
ldh [rVBK], a
2015-11-19 15:07:20 -08:00
ld hl, IntroCrystalUnownsGFX
2017-12-28 04:32:33 -08:00
ld de, vTiles2 tile $00
2015-12-02 14:59:05 -08:00
call Intro_DecompressRequest2bpp_128Tiles
2019-11-03 10:28:53 -08:00
ld hl, IntroCrystalUnownsTilemap
2015-11-20 08:47:52 -08:00
debgcoord 0, 0
2015-12-02 14:59:05 -08:00
call Intro_DecompressRequest2bpp_64Tiles
ldh a, [rSVBK]
2015-11-19 15:07:20 -08:00
push af
ld a, BANK(wBGPals1)
ldh [rSVBK], a
2019-11-03 10:28:53 -08:00
ld hl, IntroCrystalUnownsPalette
2018-01-01 06:08:21 -08:00
ld de, wBGPals1
2017-12-15 19:36:33 -08:00
ld bc, 16 palettes
2015-11-19 15:07:20 -08:00
call CopyBytes
2019-11-03 10:28:53 -08:00
ld hl, IntroCrystalUnownsPalette
2018-01-01 06:08:21 -08:00
ld de, wBGPals2
2017-12-15 19:36:33 -08:00
ld bc, 16 palettes
2015-11-19 15:07:20 -08:00
call CopyBytes
pop af
ldh [rSVBK], a
2015-11-19 15:07:20 -08:00
xor a
ldh [hSCX], a
ldh [hSCY], a
2022-04-05 12:02:37 -07:00
ld a, 7
ldh [hWX], a
2022-04-05 12:02:37 -07:00
ld a, SCREEN_HEIGHT_PX
ldh [hWY], a
2017-12-24 09:47:30 -08:00
farcall ClearSpriteAnims
2015-12-02 14:59:05 -08:00
call Intro_SetCGBPalUpdate
2015-11-19 15:07:20 -08:00
xor a
2015-12-02 14:59:05 -08:00
ld [wIntroSceneFrameCounter], a
2018-01-11 12:36:11 -08:00
ld [wIntroSceneTimer], a
2015-11-19 15:07:20 -08:00
call NextIntroScene
ret
2018-06-24 07:09:41 -07:00
IntroScene27:
2015-11-19 15:07:20 -08:00
; Spell out C R Y S T A L with Unown.
2018-01-11 12:36:11 -08:00
ld hl, wIntroSceneTimer
2015-11-19 15:07:20 -08:00
inc [hl]
2015-12-02 14:59:05 -08:00
ld hl, wIntroSceneFrameCounter
2015-11-19 15:07:20 -08:00
ld a, [hl]
inc [hl]
cp $80
jr nc, .done
ld c, a
and $f
2018-01-11 12:36:11 -08:00
ld [wIntroSceneTimer], a
2015-11-19 15:07:20 -08:00
ld a, c
and $70
swap a
2015-12-02 14:59:05 -08:00
call Intro_FadeUnownWordPals
2015-11-19 15:07:20 -08:00
ret
.done
call NextIntroScene
ld a, $80
2015-12-02 14:59:05 -08:00
ld [wIntroSceneFrameCounter], a
2015-11-19 15:07:20 -08:00
ret
2018-06-24 07:09:41 -07:00
IntroScene28:
2015-11-19 15:07:20 -08:00
; Cut out when the music ends, and lead into the title screen.
2015-12-02 14:59:05 -08:00
ld hl, wIntroSceneFrameCounter
2015-11-19 15:07:20 -08:00
ld a, [hl]
and a
jr z, .done
dec [hl]
cp $18
jr z, .clear
cp $8
ret nz
ld de, SFX_INTRO_WHOOSH
2015-11-19 15:07:20 -08:00
call PlaySFX
ret
.clear
call ClearBGPalettes
ret
.done
ld hl, wJumptableIndex
set 7, [hl]
ret
2018-06-24 07:09:41 -07:00
Intro_Scene24_ApplyPaletteFade:
2018-01-01 06:08:21 -08:00
; load the (a)th palette from .FadePals to all wBGPals2
2015-12-02 14:59:05 -08:00
ld hl, .FadePals
2015-11-19 15:07:20 -08:00
add l
ld l, a
ld a, $0
adc h
ld h, a
2015-12-02 14:59:05 -08:00
ldh a, [rSVBK]
2015-11-19 15:07:20 -08:00
push af
ld a, BANK(wBGPals2)
ldh [rSVBK], a
2018-01-01 06:08:21 -08:00
ld de, wBGPals2
2015-12-02 14:59:05 -08:00
ld b, 8 ; number of BG pals
.loop1
2015-11-19 15:07:20 -08:00
push hl
2018-01-01 05:47:16 -08:00
ld c, 1 palettes
2015-12-02 14:59:05 -08:00
.loop2
2015-11-19 15:07:20 -08:00
ld a, [hli]
ld [de], a
inc de
dec c
2015-12-02 14:59:05 -08:00
jr nz, .loop2
2015-11-19 15:07:20 -08:00
pop hl
dec b
2015-12-02 14:59:05 -08:00
jr nz, .loop1
2015-11-19 15:07:20 -08:00
pop af
ldh [rSVBK], a
2020-08-03 14:41:01 -07:00
ld a, TRUE
ldh [hCGBPalUpdate], a
2015-11-19 15:07:20 -08:00
ret
2018-06-24 07:09:41 -07:00
.FadePals:
INCLUDE "gfx/intro/fade.pal"
2015-11-19 15:07:20 -08:00
2018-06-24 07:09:41 -07:00
CrystalIntro_InitUnownAnim:
2015-11-19 15:07:20 -08:00
push de
2023-09-24 06:06:19 -07:00
ld a, SPRITE_ANIM_OBJ_INTRO_UNOWN
call InitSpriteAnimStruct
ld hl, SPRITEANIMSTRUCT_VAR1
2015-11-19 15:07:20 -08:00
add hl, bc
ld [hl], $8
ld a, SPRITE_ANIM_FRAMESET_INTRO_UNOWN_4
2015-12-05 12:38:25 -08:00
call ReinitSpriteAnimFrame
2015-11-19 15:07:20 -08:00
pop de
push de
2023-09-24 06:06:19 -07:00
ld a, SPRITE_ANIM_OBJ_INTRO_UNOWN
call InitSpriteAnimStruct
ld hl, SPRITEANIMSTRUCT_VAR1
2015-11-19 15:07:20 -08:00
add hl, bc
ld [hl], $18
ld a, SPRITE_ANIM_FRAMESET_INTRO_UNOWN_3
2015-12-05 12:38:25 -08:00
call ReinitSpriteAnimFrame
2015-11-19 15:07:20 -08:00
pop de
push de
2023-09-24 06:06:19 -07:00
ld a, SPRITE_ANIM_OBJ_INTRO_UNOWN
call InitSpriteAnimStruct
ld hl, SPRITEANIMSTRUCT_VAR1
2015-11-19 15:07:20 -08:00
add hl, bc
ld [hl], $28
ld a, SPRITE_ANIM_FRAMESET_INTRO_UNOWN_1
2015-12-05 12:38:25 -08:00
call ReinitSpriteAnimFrame
2015-11-19 15:07:20 -08:00
pop de
2023-09-24 06:06:19 -07:00
ld a, SPRITE_ANIM_OBJ_INTRO_UNOWN
call InitSpriteAnimStruct
ld hl, SPRITEANIMSTRUCT_VAR1
2015-11-19 15:07:20 -08:00
add hl, bc
ld [hl], $38
ld a, SPRITE_ANIM_FRAMESET_INTRO_UNOWN_2
2015-12-05 12:38:25 -08:00
call ReinitSpriteAnimFrame
2015-11-19 15:07:20 -08:00
ret
2018-06-24 07:09:41 -07:00
CrystalIntro_UnownFade:
2015-11-19 15:07:20 -08:00
add a
add a
add a
2015-11-19 15:07:20 -08:00
ld e, a
ld d, 0
2018-01-01 06:08:21 -08:00
ld hl, wBGPals2
2015-11-19 15:07:20 -08:00
add hl, de
inc hl
inc hl
2018-01-11 12:36:11 -08:00
ld a, [wIntroSceneTimer]
2018-01-11 09:00:01 -08:00
and %111111
cp %011111
2015-12-02 14:59:05 -08:00
jr z, .okay
jr c, .okay
2015-11-19 15:07:20 -08:00
ld c, a
2018-01-11 09:00:01 -08:00
ld a, %111111
2015-11-19 15:07:20 -08:00
sub c
2015-12-02 14:59:05 -08:00
.okay
2015-11-19 15:07:20 -08:00
ld c, a
ld b, 0
ldh a, [rSVBK]
2015-11-19 15:07:20 -08:00
push af
ld a, BANK(wBGPals2)
ldh [rSVBK], a
2015-12-02 14:59:05 -08:00
2015-11-19 15:07:20 -08:00
push hl
push bc
2018-01-01 06:08:21 -08:00
ld hl, wBGPals2
2017-12-15 19:36:33 -08:00
ld bc, 8 palettes
2015-11-19 15:07:20 -08:00
xor a
call ByteFill
pop bc
pop hl
2015-12-02 14:59:05 -08:00
2015-11-19 15:07:20 -08:00
push hl
2015-12-02 14:59:05 -08:00
ld hl, .BWFade
2015-11-19 15:07:20 -08:00
add hl, bc
add hl, bc
2015-11-19 15:07:20 -08:00
ld a, [hli]
ld d, [hl]
ld e, a
pop hl
ld a, e
ld [hli], a
ld a, d
ld [hli], a
2015-12-02 14:59:05 -08:00
2015-11-19 15:07:20 -08:00
push hl
2015-12-02 14:59:05 -08:00
ld hl, .BlackLBlueFade
2015-11-19 15:07:20 -08:00
add hl, bc
add hl, bc
2015-11-19 15:07:20 -08:00
ld a, [hli]
ld d, [hl]
ld e, a
pop hl
ld a, e
ld [hli], a
ld a, d
ld [hli], a
2015-12-02 14:59:05 -08:00
2015-11-19 15:07:20 -08:00
push hl
2015-12-02 14:59:05 -08:00
ld hl, .BlackBlueFade
2015-11-19 15:07:20 -08:00
add hl, bc
add hl, bc
2015-11-19 15:07:20 -08:00
ld a, [hli]
ld d, [hl]
ld e, a
pop hl
ld a, e
ld [hli], a
ld a, d
ld [hli], a
2015-12-02 14:59:05 -08:00
2015-11-19 15:07:20 -08:00
pop af
ldh [rSVBK], a
2020-08-03 14:41:01 -07:00
ld a, TRUE
ldh [hCGBPalUpdate], a
2015-11-19 15:07:20 -08:00
ret
2018-06-24 07:09:41 -07:00
.BWFade:
2015-11-19 15:07:20 -08:00
; Fade between black and white.
2021-04-19 13:31:37 -07:00
for hue, 32
2015-11-19 15:07:20 -08:00
RGB hue, hue, hue
endr
2018-06-24 07:09:41 -07:00
.BlackLBlueFade:
2015-11-19 15:07:20 -08:00
; Fade between black and light blue.
2021-04-19 13:31:37 -07:00
for hue, 32
2015-11-19 15:07:20 -08:00
RGB 0, hue / 2, hue
endr
2018-06-24 07:09:41 -07:00
.BlackBlueFade:
2015-11-19 15:07:20 -08:00
; Fade between black and blue.
2021-04-19 13:31:37 -07:00
for hue, 32
2015-11-19 15:07:20 -08:00
RGB 0, 0, hue
endr
2018-06-24 07:09:41 -07:00
Intro_Scene20_AppearUnown:
2015-12-02 14:59:05 -08:00
; Spawn the palette for the nth Unown
2015-11-19 15:07:20 -08:00
and a
2015-12-02 14:59:05 -08:00
jr nz, .load_pal_2
ld hl, .pal1
jr .got_pointer
.load_pal_2
ld hl, .pal2
.got_pointer
2018-01-11 12:36:11 -08:00
ld a, [wIntroSceneTimer]
2015-11-19 15:07:20 -08:00
and $7
add a
add a
add a
2015-11-19 15:07:20 -08:00
ld c, a
ldh a, [rSVBK]
2015-11-19 15:07:20 -08:00
push af
ld a, BANK(wBGPals2)
ldh [rSVBK], a
2015-12-02 14:59:05 -08:00
2015-11-19 15:07:20 -08:00
push bc
2018-01-01 06:08:21 -08:00
ld de, wBGPals2
2015-12-02 14:59:05 -08:00
2015-11-19 15:07:20 -08:00
ld a, c
add e
ld e, a
ld a, $0
adc d
ld d, a
2015-12-02 14:59:05 -08:00
2018-01-01 05:47:16 -08:00
ld bc, 1 palettes
2015-11-19 15:07:20 -08:00
call CopyBytes
pop bc
2015-12-02 14:59:05 -08:00
2018-01-01 06:08:21 -08:00
ld de, wBGPals1
2015-11-19 15:07:20 -08:00
ld a, c
add e
ld e, a
ld a, $0
adc d
ld d, a
2015-12-02 14:59:05 -08:00
2018-01-01 05:47:16 -08:00
ld bc, 1 palettes
2015-11-19 15:07:20 -08:00
call CopyBytes
2015-12-02 14:59:05 -08:00
2015-11-19 15:07:20 -08:00
pop af
ldh [rSVBK], a
2020-08-03 14:41:01 -07:00
ld a, TRUE
ldh [hCGBPalUpdate], a
2015-11-19 15:07:20 -08:00
ret
2020-10-30 13:12:25 -07:00
.pal1:
INCLUDE "gfx/intro/unown_1.pal"
.pal2:
INCLUDE "gfx/intro/unown_2.pal"
2015-12-02 14:59:05 -08:00
2018-06-24 07:09:41 -07:00
Intro_FadeUnownWordPals:
2015-11-19 15:07:20 -08:00
add a
add a
add a
2015-11-19 15:07:20 -08:00
ld e, a
ld d, 0
2018-01-01 06:08:21 -08:00
ld hl, wBGPals2
2015-11-19 15:07:20 -08:00
add hl, de
rept 4
inc hl
endr
2018-01-11 12:36:11 -08:00
ld a, [wIntroSceneTimer]
2015-11-19 15:07:20 -08:00
add a
ld c, a
ld b, 0
2015-12-02 14:59:05 -08:00
ldh a, [rSVBK]
2015-11-19 15:07:20 -08:00
push af
ld a, BANK(wBGPals2)
ldh [rSVBK], a
2015-12-02 14:59:05 -08:00
2015-11-19 15:07:20 -08:00
push hl
2015-12-02 14:59:05 -08:00
ld hl, .FastFadePalettes
2015-11-19 15:07:20 -08:00
add hl, bc
ld a, [hli]
ld d, [hl]
ld e, a
pop hl
ld a, e
ld [hli], a
ld a, d
ld [hli], a
2015-12-02 14:59:05 -08:00
2015-11-19 15:07:20 -08:00
push hl
2015-12-02 14:59:05 -08:00
ld hl, .SlowFadePalettes
2015-11-19 15:07:20 -08:00
add hl, bc
ld a, [hli]
ld d, [hl]
ld e, a
pop hl
ld a, e
ld [hli], a
ld a, d
ld [hli], a
2015-12-02 14:59:05 -08:00
2015-11-19 15:07:20 -08:00
pop af
ldh [rSVBK], a
2020-08-03 14:41:01 -07:00
ld a, TRUE
ldh [hCGBPalUpdate], a
2015-11-19 15:07:20 -08:00
ret
2018-06-24 07:09:41 -07:00
.FastFadePalettes:
DEF hue = 31
2015-11-19 15:07:20 -08:00
rept 8
RGB hue, hue, hue
DEF hue -= 1
2015-11-19 15:07:20 -08:00
RGB hue, hue, hue
DEF hue -= 2
2015-11-19 15:07:20 -08:00
endr
2018-06-24 07:09:41 -07:00
.SlowFadePalettes:
DEF hue = 31
2015-11-19 15:07:20 -08:00
rept 16
RGB hue, hue, hue
DEF hue -= 1
2015-11-19 15:07:20 -08:00
endr
2018-06-24 07:09:41 -07:00
Intro_LoadTilemap:
ldh a, [rSVBK]
2015-11-19 15:07:20 -08:00
push af
ld a, BANK(wDecompressScratch)
ldh [rSVBK], a
2015-12-02 14:59:05 -08:00
ld hl, wDecompressScratch
2015-11-19 15:07:20 -08:00
decoord 0, 0
ld b, SCREEN_HEIGHT
2015-12-02 14:59:05 -08:00
.row
2015-11-19 15:07:20 -08:00
ld c, SCREEN_WIDTH
2015-12-02 14:59:05 -08:00
.col
2015-11-19 15:07:20 -08:00
ld a, [hli]
ld [de], a
inc de
dec c
2015-12-02 14:59:05 -08:00
jr nz, .col
2018-01-22 16:29:22 -08:00
ld a, BG_MAP_WIDTH - SCREEN_WIDTH
2015-11-19 15:07:20 -08:00
add l
ld l, a
2018-01-22 16:29:22 -08:00
ld a, 0
2015-11-19 15:07:20 -08:00
adc h
ld h, a
dec b
2015-12-02 14:59:05 -08:00
jr nz, .row
2015-11-19 15:07:20 -08:00
pop af
ldh [rSVBK], a
2015-11-19 15:07:20 -08:00
ret
2018-06-24 07:09:41 -07:00
Intro_Scene16_AnimateSuicune:
2015-12-02 14:59:05 -08:00
ld a, [wIntroSceneFrameCounter]
2015-11-19 15:07:20 -08:00
and $3
2015-12-02 14:59:05 -08:00
jr z, Intro_ColoredSuicuneFrameSwap
2015-11-19 15:07:20 -08:00
cp $3
2015-12-02 14:59:05 -08:00
jr z, .PrepareForSuicuneSwap
2015-11-19 15:07:20 -08:00
ret
2015-12-02 14:59:05 -08:00
.PrepareForSuicuneSwap:
2015-11-19 15:07:20 -08:00
xor a
ldh [hBGMapMode], a
2015-11-19 15:07:20 -08:00
ret
2018-06-24 07:09:41 -07:00
Intro_ColoredSuicuneFrameSwap:
2015-11-19 15:07:20 -08:00
hlcoord 0, 0
ld bc, SCREEN_HEIGHT * SCREEN_WIDTH
2015-12-02 14:59:05 -08:00
.loop
2015-11-19 15:07:20 -08:00
ld a, [hl]
and a
2015-12-02 14:59:05 -08:00
jr z, .skip
2015-11-19 15:07:20 -08:00
cp $80
2015-12-02 14:59:05 -08:00
jr nc, .skip
2015-11-19 15:07:20 -08:00
xor $8
ld [hl], a
2015-12-02 14:59:05 -08:00
.skip
2015-11-19 15:07:20 -08:00
inc hl
dec bc
ld a, c
or b
2015-12-02 14:59:05 -08:00
jr nz, .loop
2015-11-19 15:07:20 -08:00
ld a, $1
ldh [hBGMapMode], a
2015-11-19 15:07:20 -08:00
ret
2018-06-24 07:09:41 -07:00
Intro_RustleGrass:
2015-12-02 14:59:05 -08:00
ld a, [wIntroSceneFrameCounter]
cp 36
2015-11-19 15:07:20 -08:00
ret nc
and $c
srl a
ld e, a
ld d, 0
2015-12-02 14:59:05 -08:00
ld hl, .RustlingGrassPointers
2015-11-19 15:07:20 -08:00
add hl, de
ld a, [hli]
2018-01-23 14:39:09 -08:00
ld [wRequested2bppSource], a
2015-11-19 15:07:20 -08:00
ld a, [hli]
2018-01-23 14:39:09 -08:00
ld [wRequested2bppSource + 1], a
2017-12-28 04:32:33 -08:00
ld a, LOW(vTiles2 tile $09)
2018-01-23 14:39:09 -08:00
ld [wRequested2bppDest], a
2017-12-28 04:32:33 -08:00
ld a, HIGH(vTiles2 tile $09)
2018-01-23 14:39:09 -08:00
ld [wRequested2bppDest + 1], a
2015-12-02 14:59:05 -08:00
ld a, 4
2018-01-23 14:39:09 -08:00
ld [wRequested2bppSize], a
2015-11-19 15:07:20 -08:00
ret
2018-06-24 07:09:41 -07:00
.RustlingGrassPointers:
2015-12-02 14:59:05 -08:00
dw IntroGrass1GFX
dw IntroGrass2GFX
dw IntroGrass3GFX
dw IntroGrass2GFX
2015-11-19 15:07:20 -08:00
2018-06-24 07:09:41 -07:00
Intro_SetCGBPalUpdate:
2020-08-03 14:41:01 -07:00
ld a, TRUE
ldh [hCGBPalUpdate], a
2015-11-19 15:07:20 -08:00
ret
2018-06-24 07:09:41 -07:00
Intro_ClearBGPals:
ldh a, [rSVBK]
2015-11-19 15:07:20 -08:00
push af
ld a, BANK(wBGPals2)
ldh [rSVBK], a
2015-12-02 14:59:05 -08:00
2018-01-01 06:08:21 -08:00
ld hl, wBGPals2
2018-01-01 05:47:16 -08:00
ld bc, 16 palettes
2015-11-19 15:07:20 -08:00
xor a
call ByteFill
2015-12-02 14:59:05 -08:00
2015-11-19 15:07:20 -08:00
pop af
ldh [rSVBK], a
2020-08-03 14:41:01 -07:00
ld a, TRUE
ldh [hCGBPalUpdate], a
2015-11-19 15:07:20 -08:00
call DelayFrame
call DelayFrame
ret
2018-06-24 07:09:41 -07:00
Intro_DecompressRequest2bpp_128Tiles:
ldh a, [rSVBK]
2015-11-19 15:07:20 -08:00
push af
ld a, BANK(wDecompressScratch)
ldh [rSVBK], a
2015-12-02 14:59:05 -08:00
2015-11-19 15:07:20 -08:00
push de
ld de, wDecompressScratch
2015-11-19 15:07:20 -08:00
call Decompress
pop hl
2015-12-02 14:59:05 -08:00
ld de, wDecompressScratch
2015-12-02 14:59:05 -08:00
lb bc, $01, $80
2015-11-19 15:07:20 -08:00
call Request2bpp
2015-12-02 14:59:05 -08:00
2015-11-19 15:07:20 -08:00
pop af
ldh [rSVBK], a
2015-11-19 15:07:20 -08:00
ret
2018-06-24 07:09:41 -07:00
Intro_DecompressRequest2bpp_255Tiles:
ldh a, [rSVBK]
2015-11-19 15:07:20 -08:00
push af
ld a, BANK(wDecompressScratch)
ldh [rSVBK], a
2015-12-02 14:59:05 -08:00
2015-11-19 15:07:20 -08:00
push de
ld de, wDecompressScratch
2015-11-19 15:07:20 -08:00
call Decompress
pop hl
2015-12-02 14:59:05 -08:00
ld de, wDecompressScratch
2015-12-02 14:59:05 -08:00
lb bc, $01, $ff
2015-11-19 15:07:20 -08:00
call Request2bpp
2015-12-02 14:59:05 -08:00
2015-11-19 15:07:20 -08:00
pop af
ldh [rSVBK], a
2015-11-19 15:07:20 -08:00
ret
2018-06-24 07:09:41 -07:00
Intro_DecompressRequest2bpp_64Tiles:
ldh a, [rSVBK]
2015-11-19 15:07:20 -08:00
push af
ld a, BANK(wDecompressScratch)
ldh [rSVBK], a
2015-12-02 14:59:05 -08:00
2015-11-19 15:07:20 -08:00
push de
ld de, wDecompressScratch
2015-11-19 15:07:20 -08:00
call Decompress
pop hl
2015-12-02 14:59:05 -08:00
ld de, wDecompressScratch
2015-12-02 14:59:05 -08:00
lb bc, $01, $40
2015-11-19 15:07:20 -08:00
call Request2bpp
2015-12-02 14:59:05 -08:00
2015-11-19 15:07:20 -08:00
pop af
ldh [rSVBK], a
2015-11-19 15:07:20 -08:00
ret
2018-06-24 07:09:41 -07:00
Intro_ResetLYOverrides:
ldh a, [rSVBK]
2015-11-19 15:07:20 -08:00
push af
2018-01-23 14:39:09 -08:00
ld a, BANK(wLYOverrides)
ldh [rSVBK], a
2015-12-02 14:59:05 -08:00
2018-01-23 14:39:09 -08:00
ld hl, wLYOverrides
ld bc, wLYOverridesEnd - wLYOverrides
2015-11-19 15:07:20 -08:00
xor a
call ByteFill
2015-12-02 14:59:05 -08:00
2015-11-19 15:07:20 -08:00
pop af
ldh [rSVBK], a
2018-08-25 11:34:25 -07:00
ld a, LOW(rSCX)
ldh [hLCDCPointer], a
2015-11-19 15:07:20 -08:00
ret
2018-06-24 07:09:41 -07:00
Intro_PerspectiveScrollBG:
ldh a, [rSVBK]
2015-11-19 15:07:20 -08:00
push af
2018-01-23 14:39:09 -08:00
ld a, BANK(wLYOverrides)
ldh [rSVBK], a
2015-12-02 14:59:05 -08:00
; Scroll the grass every frame.
; Scroll the trees every other frame and at half speed.
; This creates an illusion of perspective.
ld a, [wIntroSceneFrameCounter]
2015-11-19 15:07:20 -08:00
and $1
2015-12-02 14:59:05 -08:00
jr z, .skip
; trees in the back
2018-01-23 14:39:09 -08:00
ld hl, wLYOverrides
2015-11-19 15:07:20 -08:00
ld a, [hl]
inc a
ld bc, $5f
call ByteFill
2015-12-02 14:59:05 -08:00
.skip
; grass in the front
2018-01-23 14:39:09 -08:00
ld hl, wLYOverrides + $5f
2015-11-19 15:07:20 -08:00
ld a, [hl]
inc a
inc a
2015-11-19 15:07:20 -08:00
ld bc, $31
call ByteFill
2018-01-23 14:39:09 -08:00
ld a, [wLYOverrides + 0]
ldh [hSCX], a
2015-11-19 15:07:20 -08:00
pop af
ldh [rSVBK], a
2015-11-19 15:07:20 -08:00
ret
2018-06-24 07:09:41 -07:00
IntroSuicuneRunGFX:
2015-11-19 15:07:20 -08:00
INCBIN "gfx/intro/suicune_run.2bpp.lz"
2018-06-24 07:09:41 -07:00
IntroPichuWooperGFX:
2015-11-19 15:07:20 -08:00
INCBIN "gfx/intro/pichu_wooper.2bpp.lz"
2018-06-24 07:09:41 -07:00
IntroBackgroundGFX:
2015-11-19 15:07:20 -08:00
INCBIN "gfx/intro/background.2bpp.lz"
2019-11-03 10:28:53 -08:00
IntroBackgroundTilemap:
INCBIN "gfx/intro/background.tilemap.lz"
2015-11-19 15:07:20 -08:00
2019-11-03 10:28:53 -08:00
IntroBackgroundAttrmap:
INCBIN "gfx/intro/background.attrmap.lz"
2015-11-19 15:07:20 -08:00
2019-11-03 10:28:53 -08:00
IntroBackgroundPalette:
INCLUDE "gfx/intro/background.pal"
2015-11-19 15:07:20 -08:00
2018-06-24 07:09:41 -07:00
IntroUnownsGFX:
2015-11-19 15:07:20 -08:00
INCBIN "gfx/intro/unowns.2bpp.lz"
2018-06-24 07:09:41 -07:00
IntroPulseGFX:
2015-11-19 15:07:20 -08:00
INCBIN "gfx/intro/pulse.2bpp.lz"
2019-11-03 10:28:53 -08:00
IntroUnownATilemap:
INCBIN "gfx/intro/unown_a.tilemap.lz"
2015-11-19 15:07:20 -08:00
2019-11-03 10:28:53 -08:00
IntroUnownAAttrmap:
INCBIN "gfx/intro/unown_a.attrmap.lz"
2015-11-19 15:07:20 -08:00
2019-11-03 10:28:53 -08:00
IntroUnownHITilemap:
INCBIN "gfx/intro/unown_hi.tilemap.lz"
2015-11-19 15:07:20 -08:00
2019-11-03 10:28:53 -08:00
IntroUnownHIAttrmap:
INCBIN "gfx/intro/unown_hi.attrmap.lz"
2015-11-19 15:07:20 -08:00
2019-11-03 10:28:53 -08:00
IntroUnownsTilemap:
INCBIN "gfx/intro/unowns.tilemap.lz"
2015-11-19 15:07:20 -08:00
2019-11-03 10:28:53 -08:00
IntroUnownsAttrmap:
INCBIN "gfx/intro/unowns.attrmap.lz"
2015-11-19 15:07:20 -08:00
2019-11-03 10:28:53 -08:00
IntroUnownsPalette:
INCLUDE "gfx/intro/unowns.pal"
2015-11-19 15:07:20 -08:00
2018-06-24 07:09:41 -07:00
IntroCrystalUnownsGFX:
2015-11-19 15:07:20 -08:00
INCBIN "gfx/intro/crystal_unowns.2bpp.lz"
2019-11-03 10:28:53 -08:00
IntroCrystalUnownsTilemap:
INCBIN "gfx/intro/crystal_unowns.tilemap.lz"
2015-11-19 15:07:20 -08:00
2019-11-03 10:28:53 -08:00
IntroCrystalUnownsAttrmap:
INCBIN "gfx/intro/crystal_unowns.attrmap.lz"
2015-11-19 15:07:20 -08:00
2019-11-03 10:28:53 -08:00
IntroCrystalUnownsPalette:
INCLUDE "gfx/intro/crystal_unowns.pal"
2015-11-19 15:07:20 -08:00
2018-06-24 07:09:41 -07:00
IntroSuicuneCloseGFX:
2015-11-19 15:07:20 -08:00
INCBIN "gfx/intro/suicune_close.2bpp.lz"
2019-11-03 10:28:53 -08:00
IntroSuicuneCloseTilemap:
INCBIN "gfx/intro/suicune_close.tilemap.lz"
2015-11-19 15:07:20 -08:00
2019-11-03 10:28:53 -08:00
IntroSuicuneCloseAttrmap:
INCBIN "gfx/intro/suicune_close.attrmap.lz"
2015-11-19 15:07:20 -08:00
2019-11-03 10:28:53 -08:00
IntroSuicuneClosePalette:
INCLUDE "gfx/intro/suicune_close.pal"
2015-11-19 15:07:20 -08:00
2018-06-24 07:09:41 -07:00
IntroSuicuneJumpGFX:
2015-11-19 15:07:20 -08:00
INCBIN "gfx/intro/suicune_jump.2bpp.lz"
2018-06-24 07:09:41 -07:00
IntroSuicuneBackGFX:
2015-11-19 15:07:20 -08:00
INCBIN "gfx/intro/suicune_back.2bpp.lz"
2019-11-03 10:28:53 -08:00
IntroSuicuneJumpTilemap:
INCBIN "gfx/intro/suicune_jump.tilemap.lz"
2015-11-19 15:07:20 -08:00
2019-11-03 10:28:53 -08:00
IntroSuicuneJumpAttrmap:
INCBIN "gfx/intro/suicune_jump.attrmap.lz"
2015-11-19 15:07:20 -08:00
2019-11-03 10:28:53 -08:00
IntroSuicuneBackTilemap:
INCBIN "gfx/intro/suicune_back.tilemap.lz"
2015-11-19 15:07:20 -08:00
2019-11-03 10:28:53 -08:00
IntroSuicuneBackAttrmap:
INCBIN "gfx/intro/suicune_back.attrmap.lz"
2015-11-19 15:07:20 -08:00
2019-11-03 10:28:53 -08:00
IntroSuicunePalette:
INCLUDE "gfx/intro/suicune.pal"
2015-11-19 15:07:20 -08:00
2018-06-24 07:09:41 -07:00
IntroUnownBackGFX:
2015-11-19 15:07:20 -08:00
INCBIN "gfx/intro/unown_back.2bpp.lz"
2018-06-24 07:09:41 -07:00
IntroGrass1GFX:
2015-12-02 14:59:05 -08:00
INCBIN "gfx/intro/grass1.2bpp"
2018-06-24 07:09:41 -07:00
IntroGrass2GFX:
2015-12-02 14:59:05 -08:00
INCBIN "gfx/intro/grass2.2bpp"
2018-06-24 07:09:41 -07:00
IntroGrass3GFX:
2015-12-02 14:59:05 -08:00
INCBIN "gfx/intro/grass3.2bpp"
2018-06-24 07:09:41 -07:00
IntroGrass4GFX:
2015-12-02 14:59:05 -08:00
INCBIN "gfx/intro/grass4.2bpp"