Skip to content

Commit

Permalink
Merge pull request #47 from boingoing/add_sfx
Browse files Browse the repository at this point in the history
Add sfx famitracker project and integrate asm output into build
  • Loading branch information
boingoing authored May 15, 2023
2 parents 83300f0 + 7444fd5 commit b18ff4e
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
Binary file modified music/sfx.ftm
Binary file not shown.
2 changes: 1 addition & 1 deletion src/crt0.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

FT_BASE_ADR = $0100 ;page in RAM, should be $xx00
FT_DPCM_OFF = $f000 ;$c000..$ffc0, 64-byte steps
FT_SFX_STREAMS = 1 ;number of sound effects played at once, 1..4
FT_SFX_STREAMS = 2 ;number of sound effects played at once, 1..4

FT_THREAD = 1 ;undefine if you call sound effects in the same thread as sound update
FT_PAL_SUPPORT = 1 ;undefine to exclude PAL support
Expand Down
4 changes: 4 additions & 0 deletions src/jeznes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1103,6 +1103,8 @@ void start_line(unsigned char player_index) {

set_line_orientation_flag(player_index, get_line_orientation());
set_line_is_started_flag(player_index);

sfx_play(SFX_LINE_START, 1);
}
}

Expand Down Expand Up @@ -1274,6 +1276,8 @@ void flip_player_orientation(unsigned char player_index) {

set_temp_ptr(&players[temp_byte_1]);
update_nearest_tile();

sfx_play(SFX_PLAYER_ROTATE, 1);
}
}

Expand Down
24 changes: 24 additions & 0 deletions src/music/sfx.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,36 @@ sounds:
.word @pal
@ntsc:
.word @sfx_ntsc_0
.word @sfx_ntsc_1
.word @sfx_ntsc_2
@pal:
.word @sfx_pal_0
.word @sfx_pal_1
.word @sfx_pal_2

@sfx_ntsc_0:
.byte $89,$37,$8a,$0f,$01,$8a,$06,$01,$8a,$0a,$01,$89,$31,$8a,$0f,$01
.byte $89,$37,$8a,$04,$01,$8a,$08,$01,$89,$33,$02,$89,$31,$01,$00
@sfx_pal_0:
.byte $89,$37,$8a,$0f,$01,$8a,$06,$01,$8a,$0a,$01,$89,$31,$8a,$0f,$01
.byte $89,$37,$8a,$04,$01,$8a,$08,$01,$89,$33,$02,$89,$31,$01,$00
@sfx_ntsc_1:
.byte $86,$ff,$87,$43,$88,$09,$01,$87,$34,$01,$87,$25,$01,$87,$16,$01
.byte $87,$07,$01,$87,$f8,$88,$08,$01,$87,$b1,$01,$87,$81,$01,$87,$51
.byte $01,$87,$21,$01,$87,$00,$02,$87,$12,$88,$09,$01,$87,$d2,$88,$08
.byte $01,$87,$92,$01,$87,$52,$01,$87,$12,$01,$87,$00,$13,$00
@sfx_pal_1:
.byte $86,$ff,$87,$2b,$88,$09,$01,$87,$1c,$01,$87,$0d,$01,$87,$fe,$88
.byte $08,$01,$87,$ef,$01,$87,$a1,$01,$87,$71,$01,$87,$41,$01,$87,$11
.byte $01,$87,$00,$01,$87,$fa,$01,$87,$ba,$01,$87,$7a,$01,$87,$3a,$01
.byte $87,$00,$10,$00
@sfx_ntsc_2:
.byte $89,$37,$8a,$09,$06,$8a,$06,$01,$8a,$08,$01,$8a,$0a,$01,$8a,$0c
.byte $01,$8a,$0e,$01,$8a,$00,$01,$8a,$02,$01,$8a,$04,$01,$8a,$06,$01
.byte $8a,$08,$01,$8a,$0a,$01,$8a,$0c,$08,$8a,$0d,$01,$8a,$0e,$01,$8a
.byte $0f,$01,$8a,$00,$01,$8a,$01,$01,$8a,$03,$06,$00
@sfx_pal_2:
.byte $89,$37,$8a,$09,$05,$8a,$06,$01,$8a,$08,$01,$8a,$0a,$01,$8a,$0c
.byte $01,$8a,$0e,$01,$8a,$00,$01,$8a,$02,$01,$8a,$04,$01,$8a,$06,$01
.byte $8a,$08,$06,$8a,$0c,$01,$8a,$0d,$01,$8a,$0e,$01,$8a,$0f,$01,$8a
.byte $00,$01,$8a,$03,$05,$00

0 comments on commit b18ff4e

Please sign in to comment.