From f47de34e1618f75eeb34ab0fba6eca338b3e5d22 Mon Sep 17 00:00:00 2001 From: "Matthew D. Steele" Date: Tue, 17 Sep 2024 10:39:37 -0400 Subject: [PATCH] Exclude eMusic::Silence from NSF file --- nsf/nsf.asm | 7 +++++-- src/audio.asm | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/nsf/nsf.asm b/nsf/nsf.asm index efe45c7f..bb2280c7 100644 --- a/nsf/nsf.asm +++ b/nsf/nsf.asm @@ -29,7 +29,7 @@ ;;;=========================================================================;;; kVersion = 1 ; version number; 1 = NSF, 2 = NSF2 -kNumSongs = eMusic::NUM_VALUES +kNumSongs = eMusic::NUM_VALUES - 1 ; (exclude eMusic::Silence) kFirstSong = 1 kDataLoadAddr = $8000 kDataInitAddr = Func_NsfInit @@ -89,7 +89,10 @@ kSoundChip = 0 ; 0 = no extra sound chips pha ; song number jsr Func_AudioReset pla ; song number - sta Zp_Next_sAudioCtrl + sAudioCtrl::Music_eMusic + tay ; song number + .assert eMusic::Silence = 0, error + iny + sty Zp_Next_sAudioCtrl + sAudioCtrl::Music_eMusic lda #$ff sta Zp_Next_sAudioCtrl + sAudioCtrl::Enable_bool sta Zp_Next_sAudioCtrl + sAudioCtrl::MasterVolume_u8 diff --git a/src/audio.asm b/src/audio.asm index b01a422c..6ed82ad1 100644 --- a/src/audio.asm +++ b/src/audio.asm @@ -168,7 +168,8 @@ Ram_Sound_sChanSfx_arr: .res .sizeof(sChanSfx) * kNumApuChannels sta Zp_AudioEnabled_bool sta Zp_MusicFlag_bMusic _HaltMusic: - ldx #eMusic::Silence ; param: eMusic to play + .assert eMusic::Silence = 0, error + tax ; param: eMusic to play (A is zero, so this is eMusic::Silence) jsr Func_AudioRestartMusic _HaltSfx: lda #0