Skip to content

Commit

Permalink
instructions: add ping sound
Browse files Browse the repository at this point in the history
  • Loading branch information
pinobatch committed Dec 29, 2023
1 parent 9f56cf9 commit cebe915
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 14 deletions.
18 changes: 11 additions & 7 deletions src/audio.z80
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ def Channel_envpitch equ 3

section "wavebank", ROM0, ALIGN[4]
wavebank:
db $FF,$EE,$DD,$CC,$BB,$AA,$99,$88,$77,$66,$55,$44,$33,$22,$11,$00
; db $FF,$EE,$DD,$CC,$BB,$AA,$99,$88,$77,$66,$55,$44,$33,$22,$11,$00
.ping:
db $00,$14,$8c,$ff,$fd,$96,$43,$35,$78,$99,$87,$78,$9b,$dd,$da,$73

; Each entry in sfx_table is 4 bytes
; - First byte is the channel to use for the effect
Expand Down Expand Up @@ -81,9 +83,8 @@ sfx_table:
dw fx_combostop
db 3, 0
dw fx_lowcombo_bonk

; db 2, 0
; dw fx_wavetest
db 2, 0
dw fx_ping

sgb_sfx_table:
; To be filled in later
Expand Down Expand Up @@ -212,9 +213,12 @@ fx_lowcombo_bonk:
db ENVF_DPAR|ENVF_PITCH|2, $43, $5D
db ENVF_PITCH|2, $4D
db $FF

fx_wavetest:
db ENVF_DPAR|ENVF_PITCH|$0F, $00, 24
fx_ping:
db ENVF_DPAR|ENVF_PITCH|$40, (wavebank.ping-wavebank)/16, 31
db $01, $41, $80
db ENVF_PITCH|$40, 36
db $01, $41, $81
db $C1
db $FF


Expand Down
13 changes: 10 additions & 3 deletions src/instructions.z80
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,13 @@ attract_update::
add 8
cp $C0
jr c,.clear_have_tile_id
; beep if combo loss particle not visible
; (that is, if combo loss sound isn't playing)
ld a, [prevcombo_timeleft]
or a
ld a, 12
call z, audio_play_fx

ld a,8
ld [attract_vwf_x],a
swap a ; ld a,$80
Expand Down Expand Up @@ -676,9 +683,9 @@ attract_script:

; dead ends:
db FF
db "Tiles with no exits",LF
db "contain a trap door that",LF
db "leads to the entrance,",LF
db "Tiles with no path home",LF
db "contain a trap door",LF
db "leading to the entrance,",LF
db "so she doesn't get stuck."
; b4+ d4+ [c1] a1+ a2 c2 c4+ d4 [c1]
db AM_R, AM_RR
Expand Down
3 changes: 1 addition & 2 deletions src/intro.z80
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ intro_kick_check:
inc [hl]
ld a, 2
jp audio_play_fx
ret
.already_kicked:
inc [hl]
ret
Expand Down Expand Up @@ -241,7 +240,7 @@ show_intro::
add 3
ld [cursor_x], a

; Play a rolling sound effect every 3 frames
; Play a rolling sound effect every 32 frames
ld hl, cursor_y
ld a, [hl]
inc [hl]
Expand Down
2 changes: 1 addition & 1 deletion src/prevcombo.z80
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def PREVCOMBO_START_DY equ -20
def PREVCOMBO_FRAMES equ 80

section "prevcomboram", WRAM0
prevcombo_timeleft: ds 1
prevcombo_timeleft:: ds 1
prevcombo_dy: ds 1
prevcombo_y: ds 1
prevcombo_digits: ds 1
Expand Down
2 changes: 1 addition & 1 deletion tools/pb16.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
"""
PB16 encoder
Copyright 2018 Damian Yerrick
Expand Down

0 comments on commit cebe915

Please sign in to comment.