aboutsummaryrefslogtreecommitdiffstats
path: root/engine/movie/intro.asm
diff options
context:
space:
mode:
authordannye <33dannye@gmail.com>2020-11-04 00:06:44 -0600
committerdannye <33dannye@gmail.com>2020-11-04 00:06:44 -0600
commit5647ca687b92954dcf37a6ea6bfbc9a341c32de4 (patch)
treedde1937a1bfdb3a835f4155e1c2eb8f1aaf86f63 /engine/movie/intro.asm
parentMerge pull request #55 from Deokishisu/patch-1 (diff)
downloadpokeyellow-5647ca687b92954dcf37a6ea6bfbc9a341c32de4.tar.gz
pokeyellow-5647ca687b92954dcf37a6ea6bfbc9a341c32de4.tar.xz
pokeyellow-5647ca687b92954dcf37a6ea6bfbc9a341c32de4.zip
Sync with pokered
Diffstat (limited to 'engine/movie/intro.asm')
-rwxr-xr-xengine/movie/intro.asm157
1 files changed, 157 insertions, 0 deletions
diff --git a/engine/movie/intro.asm b/engine/movie/intro.asm
new file mode 100755
index 00000000..9165113f
--- /dev/null
+++ b/engine/movie/intro.asm
@@ -0,0 +1,157 @@
+ const_def -1
+ const MOVE_NIDORINO_RIGHT
+ const MOVE_GENGAR_RIGHT
+ const MOVE_GENGAR_LEFT
+
+ANIMATION_END EQU 80
+
+PlayIntro:
+ xor a
+ ldh [hJoyHeld], a
+ inc a
+ ldh [hAutoBGTransferEnabled], a
+ call PlayShootingStar
+ callfar PlayIntroScene
+ xor a
+ ldh [hSCX], a
+ ldh [hAutoBGTransferEnabled], a
+ call ClearSprites
+ call DelayFrame
+ ret
+
+InitIntroNidorinoOAM:
+ ld hl, wOAMBuffer
+ ld d, 0
+.loop
+ push bc
+ ld a, [wBaseCoordY]
+ ld e, a
+.innerLoop
+ ld a, e
+ add 8
+ ld e, a
+ ld [hli], a ; Y
+ ld a, [wBaseCoordX]
+ ld [hli], a ; X
+ ld a, d
+ ld [hli], a ; tile
+ ld a, OAM_BEHIND_BG
+ ld [hli], a ; attributes
+ inc d
+ dec c
+ jr nz, .innerLoop
+ ld a, [wBaseCoordX]
+ add 8
+ ld [wBaseCoordX], a
+ pop bc
+ dec b
+ jr nz, .loop
+ ret
+
+IntroClearScreen:
+ ld hl, vBGMap1
+ ld bc, BG_MAP_WIDTH * SCREEN_HEIGHT
+ jr IntroClearCommon
+
+IntroClearMiddleOfScreen:
+; clear the area of the tile map between the black bars on the top and bottom
+ hlcoord 0, 4
+ ld bc, SCREEN_WIDTH * 10
+
+IntroClearCommon:
+ ld [hl], 0
+ inc hl
+ dec bc
+ ld a, b
+ or c
+ jr nz, IntroClearCommon
+ ret
+
+IntroPlaceBlackTiles:
+ ld a, 1
+.loop
+ ld [hli], a
+ dec c
+ jr nz, .loop
+ ret
+
+CopyTileIDsFromList_ZeroBaseTileID:
+ ld c, 0
+ predef_jump CopyTileIDsFromList
+
+PlayShootingStar:
+ ld b, SET_PAL_GAME_FREAK_INTRO
+ call RunPaletteCommand
+ farcall LoadCopyrightAndTextBoxTiles
+ ldPal a, BLACK, DARK_GRAY, LIGHT_GRAY, WHITE
+ ldh [rBGP], a
+ call UpdateGBCPal_BGP
+ ld c, 180
+ call DelayFrames
+ call ClearScreen
+ call DisableLCD
+ xor a
+ ld [wCurOpponent], a
+ call IntroDrawBlackBars
+; write the black and white tiles
+ ld hl, vChars2
+ ld bc, $10
+ xor a
+ call FillMemory
+ ld hl, vChars2 + $10
+ ld bc, $10
+ ld a, $ff
+ call FillMemory
+; copy gamefreak logo and others
+ ld hl, GameFreakIntro
+ ld de, vChars2 + $600
+ ld bc, GameFreakIntroEnd - GameFreakIntro
+ ld a, BANK(GameFreakIntro)
+ call FarCopyData
+ ld hl, GameFreakIntro
+ ld de, vChars1
+ ld bc, GameFreakIntroEnd - GameFreakIntro
+ ld a, BANK(GameFreakIntro)
+ call FarCopyData
+
+ call EnableLCD
+ ld hl, rLCDC
+ res 5, [hl]
+ set 3, [hl]
+ ld c, 64
+ call DelayFrames
+ farcall AnimateShootingStar
+ push af
+ pop af
+ jr c, .next ; skip the delay if the user interrupted the animation
+ ld c, 40
+ call DelayFrames
+.next
+ call IntroClearMiddleOfScreen
+ call ClearSprites
+ jp Delay3
+
+IntroDrawBlackBars:
+; clear the screen and draw black bars on the top and bottom
+ call IntroClearScreen
+ hlcoord 0, 0
+ ld c, SCREEN_WIDTH * 4
+ call IntroPlaceBlackTiles
+ hlcoord 0, 14
+ ld c, SCREEN_WIDTH * 4
+ call IntroPlaceBlackTiles
+ ld hl, vBGMap1
+ ld c, BG_MAP_WIDTH * 4
+ call IntroPlaceBlackTiles
+ hlbgcoord 0, 14, vBGMap1
+ ld c, BG_MAP_WIDTH * 4
+ jp IntroPlaceBlackTiles
+
+EmptyFunc2:
+ ret
+
+GameFreakIntro:
+ INCBIN "gfx/splash/gamefreak_presents.2bpp"
+ INCBIN "gfx/splash/gamefreak_logo.2bpp"
+ ds 16, $00 ; blank tile
+GameFreakIntroEnd: