static void ReleaseVoice(opl_voice_t *voice) { opl_voice_t **rover; opl_voice_t *next; boolean double_voice; voice->channel = NULL; voice->note = 0; double_voice = voice->current_instr_voice != 0; next = voice->next; // Remove from alloced list. RemoveVoiceFromAllocedList(voice); // Search to the end of the freelist (This is how Doom behaves!) rover = &voice_free_list; while (*rover != NULL) { rover = &(*rover)->next; } *rover = voice; voice->next = NULL; if (next != NULL && double_voice && opl_drv_ver != opl_doom_1_9) { VoiceKeyOff(next); ReleaseVoice(next); } }
static void ReleaseVoice(opl_voice_t *voice) { opl_voice_t **rover; voice->channel = NULL; voice->note = 0; // Remove from alloced list. RemoveVoiceFromAllocedList(voice); // Search to the end of the freelist (This is how Doom behaves!) rover = &voice_free_list; while (*rover != NULL) { rover = &(*rover)->next; } *rover = voice; voice->next = NULL; }