1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
|
const_def -1
const MOVE_NIDORINO_RIGHT
const MOVE_GENGAR_RIGHT
const MOVE_GENGAR_LEFT
DEF ANIMATION_END EQU 80
PlayIntro:
; FASTBOOT: skip the intro entirely if a save file exists
farcall CheckForPlayerNameInSRAM
ret c
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, wShadowOAM
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_PRIO
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, TILEMAP_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, SHADE_BLACK, SHADE_DARK, SHADE_LIGHT, SHADE_WHITE
ldh [rBGP], a
call UpdateCGBPal_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 B_LCDC_WINDOW, [hl]
set B_LCDC_BG_MAP, [hl]
ld c, 64
call DelayFrames
farcall AnimateShootingStar
push af
; A `call LoadPresentsGraphic` here was removed in localization
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, TILEMAP_WIDTH * 4
call IntroPlaceBlackTiles
hlbgcoord 0, 14, vBGMap1
ld c, TILEMAP_WIDTH * 4
jp IntroPlaceBlackTiles
LoadPresentsGraphic: ; unreferenced
; This routine loaded the "PRESENTS" text graphic (tiles
; $67, $68, $69, $6A, $6B, and $6C from gamefreak_presents.2bpp)
; at coordinates (11, 7) in the Japanese versions.
; It was dummied out in the English localization.
ret
GameFreakIntro:
INCBIN "gfx/splash/gamefreak_presents.2bpp"
INCBIN "gfx/splash/gamefreak_logo.2bpp"
ds TILE_SIZE, $00 ; blank tile
GameFreakIntroEnd:
|