2 ; Copyright (C) 2009 Kent Hansen.
4 ; This program is free software; you can redistribute it and/or modify
5 ; it under the terms of the GNU General Public License as published by
6 ; the Free Software Foundation; either version 3 of the License, or
7 ; (at your option) any later version.
9 ; This program is distributed in the hope that it will be useful,
10 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ; GNU General Public License for more details.
14 ; You should have received a copy of the GNU General Public License
15 ; along with this program. If not, see <http://www.gnu.org/licenses/>.
18 .
include "common/fade.h"
19 .
include "common/joypad.h"
20 .
include "common/ldc.h"
21 .
include "common/palette.h"
22 .
include "common/ppu.h"
23 .
include "common/ppubuffer.h"
24 .
include "common/sprite.h"
25 .
include "common/timer.h"
26 .
include "sound/sfx.h"
27 .
include "sound/sound.h"
28 .
include "sound/mixer.h"
47 .extrn
go_to_game_type_select:proc
48 .extrn
main_cycle:byte
49 .extrn
volume_table:byte
50 .extrn
frame_count:byte
55 ora #PPU_CTRL0_SPRITE_SIZE_8x16
56 ora #
1 ; initially display the 2nd nametable
61 lda #
0 : sta chr_banks
[0]
62 lda #
30 : sta chr_banks
[1] ; for font
63 lda #
4 : sta chr_banks
[2]
64 lda #
5 : sta chr_banks
[3]
65 lda #
6 : sta chr_banks
[4]
66 lda #
7 : sta chr_banks
[5]
70 ldcay
@@title_data : jsr write_ppu_data_at
76 lda #
5: ldy #
5 : jsr start_timer
77 ldcay
@@fade_in_logo : jsr set_timer_callback
79 lda #
0 : sta main_cycle
86 lda #
1 : jsr start_song
87 lda #
0 : ldy #
31 : jsr set_fade_range
88 lda #
7 : jsr set_fade_delay
89 jsr start_fade_from_black
91 lda #
20 : ldy #
7 : jsr start_timer
93 jmp set_timer_callback
96 jsr start_fade_to_black
97 lda #
12 : ldy #
7 : jsr start_timer
98 ldcay
@@logo_faded_out
99 jmp set_timer_callback
104 jsr write_ppu_data_at
106 jsr start_fade_from_black
107 lda #
20 : ldy #
7 : jsr start_timer
109 jmp set_timer_callback
112 jsr start_fade_to_black
113 lda #
12 : ldy #
7 : jsr start_timer
114 ldcay
@@slogan_faded_out
115 jmp set_timer_callback
119 and #~
1 ; switch to the title screen nametable
121 lda #
2 : sta chr_banks
[1]
122 jsr start_fade_from_black
123 lda #
4 : ldy #
6 : jsr start_timer
125 jmp set_timer_callback
128 lda #
2 : sta main_cycle
132 .
db $0f,$16,$27,$10 ; main logo
133 .
db $0f,$16,$27,$10 ; II
134 .
db $0f,$20,$20,$20 ; text
136 .
db $0f,$20,$20,$20,$0f,$20,$20,$20,$0f,$20,$20,$20,$0f,$20,$20,$20
139 .incbin
"graphics/titlelogo.dat"
141 .
db $22,$EB,$0A,$F9,$FA,$FB,$FD,$00,$FB,$FC,$FE,$FF,$FC
166 ldx #
(3*sizeof tonal_state
)
167 lda mixer.envelopes.master
,x
169 ora mixer.envelopes.vol.
int,x
181 ldy #
$3F : lda #
$05 : ldx #
3
201 ++ jsr put_ppu_string_byte
207 .
db $D0,$E0,$F0,$00,$00,$10,$10,$20
215 ldy
@@frame_offset_table,x
216 - lda
@@sprite_data,y
221 jsr next_sprite_index
236 @@frame_offset_table:
237 .
db @@nullframe-@@sprite_data
238 .
db @@nullframe-@@sprite_data
239 .
db @@nullframe-@@sprite_data
240 .
db @@nullframe-@@sprite_data
241 .
db @@frame0-@@sprite_data
242 .
db @@frame1-@@sprite_data
243 .
db @@frame2-@@sprite_data
244 .
db @@frame3-@@sprite_data
245 .
db @@frame4-@@sprite_data
246 .
db @@frame5-@@sprite_data
247 .
db @@frame6-@@sprite_data
248 .
db @@frame7-@@sprite_data
249 .
db @@frame8-@@sprite_data
250 .
db @@frame9-@@sprite_data
251 .
db @@frame10-@@sprite_data
252 .
db @@frame11-@@sprite_data
253 .
db @@frame11-@@sprite_data
254 .
db @@frame10-@@sprite_data
255 .
db @@frame9-@@sprite_data
256 .
db @@frame8-@@sprite_data
257 .
db @@frame7-@@sprite_data
258 .
db @@frame6-@@sprite_data
259 .
db @@frame5-@@sprite_data
260 .
db @@frame4-@@sprite_data
261 .
db @@frame3-@@sprite_data
262 .
db @@frame2-@@sprite_data
263 .
db @@frame1-@@sprite_data
264 .
db @@frame0-@@sprite_data
265 .
db @@nullframe-@@sprite_data
266 .
db @@nullframe-@@sprite_data
267 .
db @@nullframe-@@sprite_data
268 .
db @@nullframe-@@sprite_data
330 and #JOYPAD_BUTTON_START
335 .ifndef NO_TRANSITIONS
339 lda #
0 : sta main_cycle
341 ; start "flash PUSH START" effect
346 jsr mixer_get_master_vol
351 + jsr mixer_set_master_vol
354 ldy #
$3F : lda #
$09 : ldx #
$01
362 jsr put_ppu_string_byte
365 bne
@@start_flash_timer
368 jsr start_song
; mute
374 jsr set_timer_callback
375 jmp start_fade_to_black
382 jmp set_timer_callback
386 jmp go_to_game_type_select