From 2db93b5ca4de3b78a513dbd40d415d2578c8af69 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Fri, 17 Jul 2020 09:39:27 -0400 Subject: [PATCH] mist: consolidate sounds have in one central location, so we can toggle more easily --- mist/cabin_boiler_puzzle.s | 4 +++- mist/channel.s | 3 ++- mist/channel_switches.s | 4 ++-- mist/clock_bridge_puzzle.s | 2 +- mist/dentist.s | 3 ++- mist/generator.s | 3 +++ mist/generator_puzzle.s | 2 +- mist/marker_switch.s | 4 ++-- mist/meche.s | 3 +++ mist/meche_rotation.s | 2 +- mist/mist_puzzles.s | 4 ++-- mist/octagon.s | 3 +++ mist/octagon_bookshelf.s | 21 ++------------------- mist/simple_sounds.s | 12 ++++++++++-- 14 files changed, 37 insertions(+), 33 deletions(-) diff --git a/mist/cabin_boiler_puzzle.s b/mist/cabin_boiler_puzzle.s index 81191fd4..e970da1e 100644 --- a/mist/cabin_boiler_puzzle.s +++ b/mist/cabin_boiler_puzzle.s @@ -162,7 +162,7 @@ change_tree_level: jsr change_direction - jsr beep + jsr long_beep rts @@ -443,6 +443,8 @@ wrong_combination: rts safe_buttons: + jsr click_speaker + lda CURSOR_X cmp #13 ; not a button bcc no_button diff --git a/mist/channel.s b/mist/channel.s index c547659c..4ead86db 100644 --- a/mist/channel.s +++ b/mist/channel.s @@ -194,6 +194,8 @@ toggle_faucet: ; level graphics .include "graphics_channel/channel_graphics.inc" + ; sound + .include "simple_sounds.s" ; puzzles .include "channel_switches.s" @@ -203,5 +205,4 @@ toggle_faucet: ; linking books .include "link_book_mist.s" -; .include "link_book_channel.s" diff --git a/mist/channel_switches.s b/mist/channel_switches.s index 397ab54a..a98920b6 100644 --- a/mist/channel_switches.s +++ b/mist/channel_switches.s @@ -171,7 +171,7 @@ elev1_close_door: raise_bridge: - bit $C030 ; click speaker + jsr click_speaker ; click speaker ; only raise/lower if water is flowing @@ -207,7 +207,7 @@ no_raise_bridge: extend_pipe: - bit $C030 ; click speaker + jsr click_speaker ; click speaker ; toggle state diff --git a/mist/clock_bridge_puzzle.s b/mist/clock_bridge_puzzle.s index b7a0157f..6fc01643 100644 --- a/mist/clock_bridge_puzzle.s +++ b/mist/clock_bridge_puzzle.s @@ -403,7 +403,7 @@ bridge_down: bridge_adjust: sta CLOCK_BRIDGE - bit $C030 ; click speaker + jsr click_speaker ; click speaker jsr raise_bridge diff --git a/mist/dentist.s b/mist/dentist.s index 3d08ed04..64a2009a 100644 --- a/mist/dentist.s +++ b/mist/dentist.s @@ -326,4 +326,5 @@ lights_are_off: ; level data .include "leveldata_dentist.inc" - + ; sound + .include "simple_sounds.s" diff --git a/mist/generator.s b/mist/generator.s index c46988ae..1e40d906 100644 --- a/mist/generator.s +++ b/mist/generator.s @@ -136,3 +136,6 @@ really_exit: ; level data .include "leveldata_generator.inc" + + ; sound + .include "simple_sounds.s" diff --git a/mist/generator_puzzle.s b/mist/generator_puzzle.s index cc7943f5..98dfebe3 100644 --- a/mist/generator_puzzle.s +++ b/mist/generator_puzzle.s @@ -37,7 +37,7 @@ back_to_mist: circuit_breaker: - bit $C030 ; click speaker + jsr click_speaker ; click speaker lda LOCATION cmp #MIST_TOWER2_TOP diff --git a/mist/marker_switch.s b/mist/marker_switch.s index ee710df7..fcb83975 100644 --- a/mist/marker_switch.s +++ b/mist/marker_switch.s @@ -34,8 +34,8 @@ click_marker_switch: ; click - bit $C030 - bit $C030 + jsr click_speaker + jsr click_speaker eor MARKER_SWITCHES ; toggle switch sta MARKER_SWITCHES diff --git a/mist/meche.s b/mist/meche.s index 5bc4bb11..55f5e0d5 100644 --- a/mist/meche.s +++ b/mist/meche.s @@ -274,6 +274,9 @@ no_draw_page: .include "graphics_meche/meche_graphics.inc" + ; sound + .include "simple_sounds.s" + ; linking books .include "link_book_meche.s" diff --git a/mist/meche_rotation.s b/mist/meche_rotation.s index da31981b..1851164e 100644 --- a/mist/meche_rotation.s +++ b/mist/meche_rotation.s @@ -51,7 +51,7 @@ enter_red_secret: exit_puzzle_button_press: - bit $c030 ; click speaker + jsr click_speaker ; click speaker lda CURSOR_Y cmp #40 diff --git a/mist/mist_puzzles.s b/mist/mist_puzzles.s index 5fda4459..eb626ae9 100644 --- a/mist/mist_puzzles.s +++ b/mist/mist_puzzles.s @@ -274,7 +274,7 @@ move_the_ship: ; play noise - jsr beep + jsr long_beep ; adjust the backgrounds @@ -475,7 +475,7 @@ done_pillar: circuit_breaker: - bit $C030 ; click speaker + jsr click_speaker ; click speaker lda LOCATION cmp #MIST_TOWER2_TOP diff --git a/mist/octagon.s b/mist/octagon.s index 8ef143b1..c86967b1 100644 --- a/mist/octagon.s +++ b/mist/octagon.s @@ -477,6 +477,9 @@ done_fireplace_page: ; level graphics .include "graphics_octagon/octagon_graphics.inc" + ; sound + .include "simple_sounds.s" + ; puzzles .include "brother_books.s" .include "octagon_bookshelf.s" diff --git a/mist/octagon_bookshelf.s b/mist/octagon_bookshelf.s index 3bf92b91..b8cb4748 100644 --- a/mist/octagon_bookshelf.s +++ b/mist/octagon_bookshelf.s @@ -445,7 +445,7 @@ open_bookshelf: cmp #OCTAGON_BOOKSHELF_CLOSE beq actually_open_shelf - jsr cant_noise + jsr short_beep rts @@ -522,7 +522,7 @@ close_bookshelf: cmp #OCTAGON_BOOKSHELF_CLOSE bne actually_close_shelf - jsr cant_noise + jsr short_beep rts @@ -662,23 +662,6 @@ door_swirl: jmp advance_swirl -cant_noise: - ldx #$ff -cant_noise_loop: - bit $c030 - nop - nop - nop - bit $c030 - nop - nop - nop - dex - bne cant_noise_loop - rts - - - ;============================= ; animate_shelf_open ;============================= diff --git a/mist/simple_sounds.s b/mist/simple_sounds.s index 0c8f9b6b..e64572ae 100644 --- a/mist/simple_sounds.s +++ b/mist/simple_sounds.s @@ -11,14 +11,22 @@ click_speaker: done_click: rts + +long_beep: + ldy #235 + bne do_beep + +short_beep: + ldy #40 + bne do_beep + ;=========================== ; BEEP (inlined) ;=========================== -beep: +do_beep: lda SOUND_STATUS bmi done_beep - ldy #235 sty tone_smc+1 ; BEEP