static void sound_exit(running_machine *machine) { int sndnum; /* close any open WAV file */ if (wavfile != NULL) wav_close(wavfile); #ifdef MAME_DEBUG { int spknum; /* log the maximum sample values for all speakers */ for (spknum = 0; spknum < totalspeakers; spknum++) if (speaker[spknum].max_sample > 0) { speaker_info *spk = &speaker[spknum]; mame_printf_debug("Speaker \"%s\" - max = %d (gain *= %f) - %d%% samples clipped\n", spk->speaker->tag, spk->max_sample, 32767.0 / (spk->max_sample ? spk->max_sample : 1), (int)((double)spk->clipped_samples * 100.0 / spk->total_samples)); } } #endif /* MAME_DEBUG */ /* stop all the sound chips */ for (sndnum = 0; sndnum < MAX_SOUND; sndnum++) if (Machine->drv->sound[sndnum].type != SOUND_DUMMY) sndintrf_exit_sound(sndnum); /* reset variables */ totalspeakers = 0; totalsnd = 0; memset(&speaker, 0, sizeof(speaker)); memset(&sound, 0, sizeof(sound)); }
static void sound_exit(running_machine *machine) { int sndnum; /* close any open WAV file */ if (wavfile != NULL) wav_close(wavfile); /* stop all the sound chips */ for (sndnum = 0; sndnum < MAX_SOUND; sndnum++) if (machine->config->sound[sndnum].type != SOUND_DUMMY) sndintrf_exit_sound(sndnum); /* reset variables */ totalsnd = 0; memset(&sound, 0, sizeof(sound)); }