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