2 ; Copyright (C) 2010 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/mixer.h"
27 .
include "sound/sound.h"
28 .
include "sound/sfx.h"
47 .extrn
is_clip_play:proc
48 .extrn
setup_clip_play:proc
49 .extrn
go_to_title_screen:proc
50 .extrn
brick_menu_bg_data:byte
52 .extrn
main_cycle:byte
53 .extrn
frame_count:byte
60 lda #
24 : sta chr_banks
[0]
61 lda #
26 : sta chr_banks
[1]
62 lda #
12 : sta chr_banks
[2]
63 lda #
13 : sta chr_banks
[3]
64 lda #
14 : sta chr_banks
[4]
65 lda #
15 : sta chr_banks
[5]
69 ldcay brick_menu_bg_data
: jsr write_ppu_data_at
73 ldcay
@@palette : jsr load_palette
79 jsr start_fade_from_black
81 lda #
0 : jsr start_song
83 lda #
0 : sta current_menu_item
92 .
db $0f,$06,$16,$37 ; bricks and frame
93 .
db $0f,$20,$20,$20 ; white text
94 .
db $0f,$00,$00,$00 ; gray text
105 ldcay
@@normal_data : jmp write_ppu_data_at
106 + ldcay
@@clip_data : jmp write_ppu_data_at
110 .
db $21,$AC,10 : .char
"PLAY AGAIN"
111 .
db $21,$EC,11 : .char
"CHANGE SONG"
112 .
db $22,$2C,4 : .char
"QUIT"
116 .
db $21,$AC,10 : .char
"PLAY AGAIN"
117 .
db $21,$EC,4 : .char
"QUIT"
129 jsr next_sprite_index
133 lda current_menu_item
134 asl
: asl
: asl
: asl
144 .
proc play_cursor_sfx
150 .
proc get_menu_item_count
163 .
proc previous_menu_item
164 dec current_menu_item
166 jsr get_menu_item_count
168 sta current_menu_item
169 + jmp play_cursor_sfx
173 inc current_menu_item
174 jsr get_menu_item_count
175 cmp current_menu_item
178 sta current_menu_item
179 + jmp play_cursor_sfx
182 .
proc select_menu_item
183 .ifndef NO_TRANSITIONS
192 ldcay
@@really_select
193 jsr set_timer_callback
194 jmp start_fade_to_black
199 bne
@@select_clip_menu_item
200 ; select normal menu item
201 lda current_menu_item
202 beq
@@play_again_normal_selected
204 beq
@@song_select_selected
206 jmp go_to_title_screen
207 @@play_again_normal_selected:
208 lda #
20 ; challenges init
212 lda #
26 ; skip straight to game info
215 @@song_select_selected:
220 @@select_clip_menu_item:
221 lda current_menu_item
223 ; play clip again selected
234 jsr palette_fade_in_progress
237 + lda joypad0_posedge
238 and #
(JOYPAD_BUTTON_START | JOYPAD_BUTTON_A
)
241 and #JOYPAD_BUTTON_UP
244 and #
(JOYPAD_BUTTON_DOWN | JOYPAD_BUTTON_SELECT
)
254 jmp previous_menu_item