From f664d0b5b3fa3b40573fc58ebac1755d8deabcf9 Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 17 Nov 2020 20:06:55 +0100 Subject: [PATCH] First Settings dialog fixes - the dynamic recompiler checkbox is now correctly checked if the recompiler is reenabled. --- src/win/win_settings.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/win/win_settings.c b/src/win/win_settings.c index 491ae7970..89cdc504b 100644 --- a/src/win/win_settings.c +++ b/src/win/win_settings.c @@ -660,7 +660,6 @@ win_settings_machine_recalc_fpu(HWND hdlg) static void win_settings_machine_recalc_cpu(HWND hdlg) { - HWND h; int cpu_type; #ifdef USE_DYNAREC int cpu_flags; @@ -670,7 +669,6 @@ win_settings_machine_recalc_cpu(HWND hdlg) settings_enable_window(hdlg, IDC_COMBO_WS, (cpu_type >= CPU_286) && (cpu_type <= CPU_386DX)); #ifdef USE_DYNAREC - h = GetDlgItem(hdlg, IDC_CHECK_DYNAREC); cpu_flags = machines[temp_machine].cpu[temp_cpu_m].cpus[temp_cpu].cpu_flags; if (!(cpu_flags & CPU_SUPPORTS_DYNAREC) && (cpu_flags & CPU_REQUIRES_DYNAREC)) fatal("Attempting to select a CPU that requires the recompiler and does not support it at the same time\n"); @@ -679,10 +677,12 @@ win_settings_machine_recalc_cpu(HWND hdlg) temp_dynarec = 0; if (cpu_flags & CPU_REQUIRES_DYNAREC) temp_dynarec = 1; - SendMessage(h, BM_SETCHECK, temp_dynarec, 0); - EnableWindow(h, FALSE); - } else - EnableWindow(h, TRUE); + settings_set_check(hdlg, IDC_CHECK_DYNAREC, temp_dynarec); + settings_enable_window(hdlg, IDC_CHECK_DYNAREC, FALSE); + } else { + settings_set_check(hdlg, IDC_CHECK_DYNAREC, temp_dynarec); + settings_enable_window(hdlg, IDC_CHECK_DYNAREC, TRUE); + } #endif win_settings_machine_recalc_fpu(hdlg); @@ -3245,6 +3245,7 @@ win_settings_floppy_drives_recalc_list(HWND hdlg) lvI.iSubItem = 1; lvI.pszText = plat_get_string(temp_fdd_turbo[i] ? IDS_2060 : IDS_2061); + lvI.iItem = i; lvI.iImage = 0; if (ListView_SetItem(hwndList, &lvI) == -1) @@ -3252,6 +3253,8 @@ win_settings_floppy_drives_recalc_list(HWND hdlg) lvI.iSubItem = 2; lvI.pszText = plat_get_string(temp_fdd_check_bpb[i] ? IDS_2060 : IDS_2061); + lvI.iItem = i; + lvI.iImage = 0; if (ListView_SetItem(hwndList, &lvI) == -1) return FALSE;