Disable the softfloat checkbox when no FPU is selected

This commit is contained in:
Alexander Babikov
2023-09-05 20:55:54 +05:00
parent b3dbfcfc9a
commit 178f1ce599
4 changed files with 39 additions and 8 deletions

View File

@@ -688,6 +688,18 @@ win_settings_save(void)
pc_reset_hard_init();
}
static void
win_settings_machine_recalc_softfloat(HWND hdlg)
{
if (temp_fpu == FPU_NONE) {
settings_set_check(hdlg, IDC_CHECK_SOFTFLOAT, FALSE);
settings_enable_window(hdlg, IDC_CHECK_SOFTFLOAT, FALSE);
} else {
settings_set_check(hdlg, IDC_CHECK_SOFTFLOAT, (machine_has_flags(temp_machine, MACHINE_SOFTFLOAT_ONLY) ? TRUE : temp_fpu_softfloat));
settings_enable_window(hdlg, IDC_CHECK_SOFTFLOAT, (machine_has_flags(temp_machine, MACHINE_SOFTFLOAT_ONLY) ? FALSE : TRUE));
}
}
static void
win_settings_machine_recalc_fpu(HWND hdlg)
{
@@ -714,12 +726,11 @@ win_settings_machine_recalc_fpu(HWND hdlg)
c++;
}
settings_set_check(hdlg, IDC_CHECK_SOFTFLOAT, (machine_has_flags(temp_machine, MACHINE_SOFTFLOAT_ONLY) ? TRUE : temp_fpu_softfloat));
settings_enable_window(hdlg, IDC_CHECK_SOFTFLOAT, (machine_has_flags(temp_machine, MACHINE_SOFTFLOAT_ONLY) ? FALSE : TRUE));
settings_enable_window(hdlg, IDC_COMBO_FPU, c > 1);
temp_fpu = fpu_get_type_from_index(temp_cpu_f, temp_cpu, settings_get_cur_sel(hdlg, IDC_COMBO_FPU));
win_settings_machine_recalc_softfloat(hdlg);
}
static void
@@ -1046,6 +1057,7 @@ win_settings_machine_proc(HWND hdlg, UINT message, WPARAM wParam, UNUSED(LPARAM
temp_fpu = fpu_get_type_from_index(temp_cpu_f, temp_cpu,
settings_get_cur_sel(hdlg, IDC_COMBO_FPU));
}
win_settings_machine_recalc_softfloat(hdlg);
break;
case IDC_CONFIGURE_MACHINE:
temp_machine = listtomachine[settings_get_cur_sel(hdlg, IDC_COMBO_MACHINE)];