From 95c11cf483a0ab4a244d36d7b86c410e05391e8b Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Mon, 27 Jul 2020 12:25:06 -0300 Subject: [PATCH] Fix internal sound card behavior when switching machines in the settings window --- src/sound/sound.c | 3 --- src/win/win_settings.c | 6 ++++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/sound/sound.c b/src/sound/sound.c index f6ade1f98..479314699 100644 --- a/src/sound/sound.c +++ b/src/sound/sound.c @@ -128,9 +128,6 @@ sound_log(const char *fmt, ...) int sound_card_available(int card) { - if ((card == SOUND_INTERNAL) && !(machines[machine].flags & MACHINE_SOUND)) - return 0; - if (sound_cards[card].device) return device_available(sound_cards[card].device); diff --git a/src/win/win_settings.c b/src/win/win_settings.c index 32ebc3aee..961f2b255 100644 --- a/src/win/win_settings.c +++ b/src/win/win_settings.c @@ -1280,6 +1280,12 @@ win_settings_sound_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) h = GetDlgItem(hdlg, IDC_COMBO_SOUND); c = d = 0; while (1) { + /* Skip "internal" if machine doesn't have it. */ + if ((c == 1) && !(machines[temp_machine].flags & MACHINE_SOUND)) { + c++; + continue; + } + s = sound_card_getname(c); if (!s[0])