-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
2,898 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
;* key code for keyboard input reading | ||
|
||
.def KEY_A = 63 | ||
.def KEY_S = 62 | ||
.def KEY_G = 61 | ||
.def KEY_Cap = 60 | ||
.def KEY_D = 58 | ||
.def KEY_H = 57 | ||
.def KEY_F = 56 | ||
.def KEY_Great = 55 | ||
.def KEY_Less = 54 | ||
.def KEY_8 = 53 | ||
.def KEY_BSp = 52 | ||
.def KEY_7 = 51 | ||
.def KEY_0 = 50 | ||
.def KEY_9 = 48 | ||
.def KEY_Q = 47 | ||
.def KEY_W = 46 | ||
.def KEY_T = 45 | ||
.def KEY_Tab = 44 | ||
.def KEY_Y = 43 | ||
.def KEY_E = 42 | ||
.def KEY_R = 40 | ||
.def KEY_Inv = 39 | ||
.def KEY_Slash = 38 | ||
.def KEY_M = 37 | ||
.def KEY_N = 35 | ||
.def KEY_Dot = 34 | ||
.def KEY_Spa = 33 | ||
.def KEY_Comma = 32 | ||
.def KEY_1 = 31 | ||
.def KEY_2 = 30 | ||
.def KEY_5 = 29 | ||
.def KEY_Esc = 28 | ||
.def KEY_6 = 27 | ||
.def KEY_3 = 26 | ||
.def KEY_4 = 24 | ||
.def KEY_Z = 23 | ||
.def KEY_X = 22 | ||
.def KEY_B = 21 | ||
.def KEY_F4 = 20 | ||
.def KEY_F3 = 19 | ||
.def KEY_C = 18 | ||
.def KEY_Hlp = 17 | ||
.def KEY_V = 16 | ||
.def KEY_Equal = 15 ; down | ||
.def KEY_Minus = 14 ; up | ||
.def KEY_I = 13 | ||
.def KEY_Ret = 12 | ||
.def KEY_U = 11 | ||
.def KEY_P = 10 | ||
.def KEY_O = 8 | ||
.def KEY_Aster = 7 ; right | ||
.def KEY_plus = 6 ; left | ||
.def KEY_K = 5 | ||
.def KEY_F2 = 4 | ||
.def KEY_F1 = 3 | ||
.def KEY_Semi = 2 | ||
.def KEY_J = 1 | ||
.def KEY_L = 0 | ||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
;* Songs index always begin with the "intro" section, followed by the "loop" section, when applicable | ||
;* Index list must end with the dummy tune address to mark the end of each list properly | ||
;* Make sure to define the total number of tunes that could be indexed in code using it to avoid garbage data being loaded | ||
|
||
SongsIndexStart | ||
; dta a(S_0) | ||
; dta a(S_1) | ||
; dta a(S_2) | ||
; dta a(S_3) | ||
; dta a(S_4) | ||
; dta a(S_5) | ||
; dta a(S_6) | ||
dta a(S_DUMMY) | ||
SongsIndexEnd | ||
|
||
;----------------- | ||
;//--------------------------------------------------------------------------------------------- | ||
|
||
LoopsIndexStart | ||
; dta a(L_0) | ||
; dta a(L_1) | ||
; dta a(L_2) | ||
; dta a(L_3) | ||
; dta a(L_4) | ||
; dta a(L_5) | ||
; dta a(L_6) | ||
dta a(L_DUMMY) | ||
LoopsIndexEnd | ||
|
||
;----------------- | ||
|
||
;//--------------------------------------------------------------------------------------------- | ||
|
||
;* Intro subtunes index, this is the part of a tune that will play before a loop point | ||
;* If the intro and loop are identical, or close enough to sound seamless, the intro could be replaced by a dummy to save space | ||
;* IMPORTANT: due to technical reasons, every indexes MUST end with a dummy subtune! Otherwise the entire thing will break apart! | ||
|
||
;----------------- | ||
|
||
;//--------------------------------------------------------------------------------------------- | ||
|
||
S_0 | ||
; ins '/RANDOM3/IO INTRO.lzss' | ||
S_1 | ||
; ins '/RANDOM3/01 - SKETCH_71_TUNE_1.lzss' | ||
S_2 | ||
; dummy | ||
S_3 | ||
; dummy | ||
S_4 | ||
; ins '/RANDOM3/04 - SKETCH_73.lzss' | ||
S_5 | ||
; ins '/RANDOM3/SKETCH 76 INTRO.lzss' | ||
S_6 | ||
; dummy | ||
S_DUMMY | ||
|
||
;----------------- | ||
;//--------------------------------------------------------------------------------------------- | ||
|
||
;* Looped subtunes index, if a dummy is inserted, the tune has a definite end and won't loop and/or fadeout! | ||
|
||
L_0 | ||
; ins '/RANDOM3/IO LOOP.lzss' | ||
L_1 | ||
; ins '/RANDOM3/01 - SKETCH_71_TUNE_1_LOOP.lzss' | ||
L_2 | ||
; ins '/RANDOM3/02 - SKETCH_71_TUNE_2_LOOP.lzss' | ||
L_3 | ||
; ins '/RANDOM3/03 - SKETCH_72_LOOP.lzss' | ||
L_4 | ||
; ins '/RANDOM3/04 - SKETCH_73_LOOP.lzss' | ||
L_5 | ||
; ins '/RANDOM3/SKETCH 76 LOOP.lzss' | ||
L_6 | ||
; ins '/RANDOM3/SKETCH 78 LOOP.lzss' | ||
L_DUMMY | ||
|
||
;----------------- | ||
;//--------------------------------------------------------------------------------------------- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,201 @@ | ||
;----------------- | ||
|
||
;* Process the collision detection between the ball and one of the players | ||
;* The collisions detection code is really mangled! A cleanup is needed! | ||
|
||
check_ball_collision | ||
lda BALL_FLAG ; has the ball been in a collision yet? | ||
bmi check_ball_collision_done ; #$FF is the pocketed state of the ball, process further! | ||
beq check_ball_collision_a ; ball is active, update its position based on the velocity values | ||
check_for_ball_owned | ||
cmp #1 ; ball reset and owned by p1? | ||
bne check_for_ball_owned_a ; neither players own the ball, flag unknown, ignore the other values | ||
lda MIS_P2_X ; copy the P2 coordinates, so the ball follows the paddle until it is released | ||
add #4 | ||
sta MIS_BALL_X | ||
lda MIS_P2_Y | ||
sta MIS_BALL_Y | ||
rts | ||
check_for_ball_owned_a | ||
cmp #2 ; ball reset and owned by p2? | ||
bne check_ball_collision_done ; player 1 does not own the ball, check the player 2 | ||
lda MIS_P1_X ; copy the P1 coordinates, so the ball follows the paddle until it is released | ||
sub #2 | ||
sta MIS_BALL_X | ||
lda MIS_P1_Y | ||
sta MIS_BALL_Y | ||
check_ball_collision_done | ||
rts | ||
;----------------- | ||
|
||
check_ball_collision_a | ||
ldy MIS_BALL_X ; needed for the relative ball coordinate to process collisions | ||
ldx MIS_BALL_Y ; to calculate the velocity effects | ||
;----------------- | ||
check_ball_collision_b | ||
lda M0PL ;* Player 2 collision with the ball | ||
beq check_ball_collision_c ; no collision | ||
inc BALL_HITCOUNT ; increment the ball hitcount by 1 | ||
cpy #$3C | ||
bcs check_p2_racket_front | ||
check_p2_racket_back | ||
cpy #$3A | ||
bcc check_p2_racket_front | ||
lda BALL_H_VELOCITY | ||
bpl apply_ball_velocity ; no direction change, ignore the collision and process like normal | ||
bmi ball_collided_invert_h_velocity_p2 | ||
check_p2_racket_front | ||
cpy #$3E | ||
bcs check_p2_racket_back | ||
lda BALL_H_VELOCITY | ||
bmi apply_ball_velocity ; no direction change, ignore the collision and process like normal | ||
bpl ball_collided_invert_h_velocity_p2 | ||
|
||
;----------------- | ||
|
||
check_ball_collision_c | ||
lda M1PL ;* Player 1 collision with the ball | ||
beq apply_ball_velocity ; no collision | ||
inc BALL_HITCOUNT ; increment the ball hitcount by 1 | ||
cpy #$C2 | ||
bcs check_p1_racket_back | ||
check_p1_racket_front | ||
cpy #$C0 | ||
bcc check_p1_racket_back | ||
lda BALL_H_VELOCITY | ||
bpl apply_ball_velocity ; no direction change, ignore the collision and process like normal | ||
bmi ball_collided_invert_h_velocity_p1 | ||
check_p1_racket_back | ||
cpy #$C4 | ||
bcs check_p1_racket_front | ||
lda BALL_H_VELOCITY | ||
bmi apply_ball_velocity ; no direction change, ignore the collision and process like normal | ||
bpl ball_collided_invert_h_velocity_p1 | ||
|
||
;----------------- | ||
ball_collided_invert_h_velocity_p2 | ||
txa | ||
add #12 | ||
cmp MIS_P2_Y | ||
beq bonus_p2_add_velocity ; hell yes!!! | ||
lda #1 | ||
sta TMP0 | ||
bne ball_collided_invert_h_velocity | ||
bonus_p2_add_velocity | ||
lda #$FF | ||
sta TMP0 | ||
bne ball_collided_invert_h_velocity ; replace with a JMP maybe??? | ||
|
||
;----------------- | ||
|
||
ball_collided_invert_h_velocity_p1 | ||
txa | ||
add #12 | ||
cmp MIS_P1_Y | ||
beq bonus_p1_add_velocity ; hell yes!!! | ||
lda #1 | ||
sta TMP0 | ||
bne ball_collided_invert_h_velocity | ||
bonus_p1_add_velocity | ||
lda #$FF | ||
sta TMP0 | ||
|
||
;----------------- | ||
|
||
ball_collided_invert_h_velocity | ||
lda BALL_H_VELOCITY | ||
; bmi sub_bonus_velocity ; I dont't even remember what this was trying to achieve... | ||
add_bonus_velocity | ||
add TMP0 | ||
bne invert_h_velocity_now | ||
sub_bonus_velocity | ||
sub TMP0 | ||
invert_h_velocity_now | ||
eor #$FF | ||
bne velocity_inverted | ||
lda BALL_V_VELOCITY | ||
|
||
velocity_inverted | ||
sta BALL_H_VELOCITY | ||
lda #7 ; play sfx: game move_bunny | ||
jsr set_sfx_to_play_immediate | ||
apply_ball_velocity | ||
lda MIS_BALL_Y ; compare to the old value in memory | ||
add BALL_V_VELOCITY ; apply the vertical velocity for movements | ||
cmp #$10 | ||
bcc ball_y_min ; out of bounds -> too high above | ||
cmp #$6F | ||
bcc ball_y_good | ||
ball_y_max | ||
lda #$6E | ||
bne ball_y_invert_v_velocity | ||
ball_y_min | ||
lda #$10 | ||
ball_y_invert_v_velocity | ||
tay | ||
lda BALL_V_VELOCITY | ||
eor #$FF | ||
sta BALL_V_VELOCITY | ||
lda #2 ; play sfx: menu keyclick | ||
jsr set_sfx_to_play_immediate | ||
tya | ||
ball_y_good | ||
sta MIS_BALL_Y ; FIXME: The only time the Y Ball coordinate is updated?? | ||
apply_ball_velocity_a | ||
lda MIS_BALL_X | ||
add BALL_H_VELOCITY ; apply the horizontal velocity for movements | ||
tax | ||
ldy MIS_BALL_Y | ||
cpy #$24 | ||
bcc ball_x_rebound ; hit the wall behind the player, not pocketed | ||
cpy #$5C | ||
bcs ball_x_rebound ; hit the wall behind the player, not pocketed | ||
ball_x_may_be_pocketed | ||
cmp #$33 | ||
bcc ball_x_was_pocketed | ||
cmp #$CC | ||
bcc ball_x_good | ||
ball_x_was_pocketed | ||
dec BALL_FLAG ; #0 -> #$FF | ||
jmp ball_x_good ; ball is pocketed by player 1 or player 2 | ||
ball_x_rebound | ||
cmp #$34 | ||
bcc ball_x_min ; out of bounds -> too far left | ||
cmp #$CB | ||
bcc ball_x_good | ||
ball_x_max | ||
lda #$CA | ||
bne ball_x_invert_h_velocity | ||
ball_x_min | ||
lda #$34 | ||
ball_x_invert_h_velocity | ||
tay | ||
lda BALL_H_VELOCITY | ||
eor #$FF | ||
sta BALL_H_VELOCITY | ||
lda #2 ; play sfx: menu keyclick | ||
jsr set_sfx_to_play_immediate | ||
tya | ||
ball_x_good | ||
sta MIS_BALL_X ; FIXME: The only time the X Ball coordinate is updated?? | ||
rts | ||
|
||
;----------------- | ||
|
Oops, something went wrong.