From a14cca074678fbe319ccc1a704ca0635eed0a3e3 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Wed, 12 Sep 2018 11:50:44 -0400 Subject: [PATCH] fireworks: can toggle sound now --- fireworks/fireworks.s | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/fireworks/fireworks.s b/fireworks/fireworks.s index 54623bb6..a774d800 100644 --- a/fireworks/fireworks.s +++ b/fireworks/fireworks.s @@ -287,13 +287,25 @@ check_keyboard: lda KEYPRESS ; 4 bpl no_keypress ; 3 - jmp loop_forever + jmp restart no_keypress: jmp display_loop ; 3 -loop_forever: - jmp loop_forever + + ; Restart and toggle sound +restart: + ; self mofifying code, flip from bit C030 to bit 0030 + lda sound1+2 + eor #$C0 + sta sound1+2 + + + lda sound2+2 + eor #$C0 + sta sound2+2 + + jmp setup_background jump_table: