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"
39 ; Bitmask of players who have confirmed their readiness
50 .extrn
is_clip_play:proc
51 .extrn
main_cycle:byte
52 .extrn
frame_count:byte
60 lda #
28 : sta chr_banks
[0]
61 lda #
30 : sta chr_banks
[1]
62 lda #
20 : sta chr_banks
[2]
63 lda #
21 : sta chr_banks
[3]
64 lda #
22 : sta chr_banks
[4]
65 lda #
23 : sta chr_banks
[5]
80 jsr start_fade_from_black
98 .
db $0f,$06,$18,$38 ; button
99 .
db $0f,$02,$22,$30 ; target - blue
100 .
db $0f,$06,$16,$30 ; target - red
101 .
db $0f,$08,$28,$30 ; target - yellow
102 .
db $0f,$0A,$2A,$20 ; target - green
106 .
db $20,$8A,10 : .char
"PLAYER 1 ="
107 .
db $20,$EA,10 : .char
"PLAYER 2 ="
108 .
db $21,$49,11 : .char
"AUTO-SWAP ="
110 .
db $22,$68,17 : .char
"IN `YOUR` LANE(S)"
112 .
db $23,$2B,4 : .char
"PUSH"
114 .
db $23,$10,2,$AA,$AB
115 .
db $23,$30,2,$BA,$BB
116 .
db $23,$12,2,$AE,$AF
117 .
db $23,$32,2,$BE,$BF
118 .
db $23,$14,2,$AC,$AD
119 .
db $23,$34,2,$BC,$BD
126 ; Y = 0 ==> player 1, 1 ==> player 2, 2 ==> switch
128 ; calculate orb frame (0..7)
141 jsr next_sprite_index
154 jsr next_sprite_index
173 jsr draw_orb
; player 1
175 jsr draw_orb
; player 2
177 jmp draw_orb
; switch
183 - jsr next_sprite_index
201 .
db $5D,$5F,$7D,$7F,$9D,$9F
207 .
proc draw_special_items
211 ; items not available in versus mode
215 ; items not available in clip play mode
218 - jsr next_sprite_index
242 jsr palette_fade_in_progress
249 + ldy #
$3F : lda #
$0D : ldx #
1
256 jsr put_ppu_string_byte
259 .
db $06,$16,$26,$20,$26,$16,$06,$06
266 jsr draw_special_items
269 jmp check_if_all_ready
273 jsr palette_fade_in_progress
281 and #
(JOYPAD_BUTTON_B | JOYPAD_BUTTON_A
)
282 cmp #
(JOYPAD_BUTTON_B | JOYPAD_BUTTON_A
)
288 ldcay
@@player_1_ready_data
289 jsr copy_string_to_ppu_buffer
297 and #
(JOYPAD_BUTTON_B | JOYPAD_BUTTON_A
)
298 cmp #
(JOYPAD_BUTTON_B | JOYPAD_BUTTON_A
)
304 ldcay
@@player_2_ready_data
305 jsr copy_string_to_ppu_buffer
311 @@player_1_ready_data:
312 .
db $20,$98,3 : .char
"OK!"
314 @@player_2_ready_data:
315 .
db $20,$F8,3 : .char
"OK!"
319 .
proc check_if_all_ready
325 .if
1;ndef NO_TRANSITIONS
332 jmp set_timer_callback
338 jsr set_timer_callback
339 jmp start_fade_to_black