second: update how music is paused

This commit is contained in:
Vince Weaver 2023-11-02 21:52:50 -04:00
parent 1fb453807b
commit bf628eaa71
4 changed files with 43 additions and 4 deletions

View File

@ -236,6 +236,8 @@ music.inc: generate_common MUSIC
./generate_common -a 0xd000 -s pt3_set_pattern music.lst >> music.inc
./generate_common -a 0xd000 -s copy_main_aux music.lst >> music.inc
./generate_common -a 0xd000 -s copy_aux_main music.lst >> music.inc
./generate_common -a 0xd000 -s mute_ay_both music.lst >> music.inc
./generate_common -a 0xd000 -s unmute_ay_both music.lst >> music.inc
music2.inc: generate_common MUSIC2
./generate_common -a 0xd000 -s pt3_init_song music2.lst > music2.inc
@ -249,6 +251,8 @@ music2.inc: generate_common MUSIC2
./generate_common -a 0xd000 -s current_pattern_smc music2.lst >> music2.inc
./generate_common -a 0xd000 -s copy_main_aux music2.lst >> music2.inc
./generate_common -a 0xd000 -s copy_aux_main music2.lst >> music2.inc
./generate_common -a 0xd000 -s mute_ay_both music2.lst >> music2.inc
./generate_common -a 0xd000 -s unmute_ay_both music2.lst >> music2.inc
####

View File

@ -78,10 +78,12 @@ spheres_start:
sta BTC_H
sei ; stop music
jsr mute_ay_both
ldx #11
jsr play_audio
jsr unmute_ay_both
cli

View File

@ -162,6 +162,38 @@ clear_ay_left_loop:
; -1
rts ; 6
;=======================================
; mute AY -- just turn off all 3 channels
; should silence the card
;
;=======================================
mute_ay_both:
ldx #7 ;
lda #$FF ;
sta MB_VALUE ;
mute_ay_left_loop:
jsr write_ay_both ;
rts ;
;=======================================
; unmute AY
; restore to value we had before muting
;=======================================
unmute_ay_both:
ldx #7 ;
lda ENABLE ;
sta MB_VALUE ;
unmute_ay_left_loop:
jsr write_ay_both ;
rts ;
clear_ay_end:
;.assert >clear_ay_both = >clear_ay_end, error, "clear_ay_both crosses page"

View File

@ -137,7 +137,7 @@ load_program_loop:
;=======================
;=======================
cli
cli ; start music
jsr $6000
@ -149,7 +149,7 @@ load_program_loop:
;=======================
sei ; stop music interrupts
jsr mute_ay_both
jsr clear_ay_both ; stop from making noise
; load music
@ -202,7 +202,7 @@ load_program_loop:
jsr pt3_init_song
cli ; start interrupts
cli ; start interrupts (music)
;=======================
;=======================
@ -347,7 +347,7 @@ load_program_loop:
sei
jsr clear_ay_both ; stop from making noise
jsr mute_ay_both ; stop from making noise
;=============================
; want to load 10..12
@ -393,6 +393,7 @@ load_program_loop2:
; restart music
jsr unmute_ay_both ; restart
cli
;=======================