Hooked up the new FPU type selection to the UI.

This commit is contained in:
OBattler
2020-06-15 21:21:26 +02:00
parent 661d4df0f2
commit af06ba62c0
10 changed files with 76 additions and 47 deletions

View File

@@ -347,7 +347,7 @@ BEGIN
#endif
END
DLG_CFG_MACHINE DIALOG DISCARDABLE 97, 0, 267, 199
DLG_CFG_MACHINE DIALOG DISCARDABLE 97, 0, 286, 199
STYLE DS_CONTROL | WS_CHILD
FONT 9, "Segoe UI"
BEGIN
@@ -361,25 +361,28 @@ BEGIN
COMBOBOX IDC_COMBO_CPU,145,25,115,120,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "CPU:",IDT_1704,124,26,18,10
COMBOBOX IDC_COMBO_WS,71,44,189,120,CBS_DROPDOWNLIST | WS_VSCROLL |
COMBOBOX IDC_COMBO_FPU,71,44,189,120,CBS_DROPDOWNLIST | WS_VSCROLL |
WS_TABSTOP
LTEXT "Wait states:",IDT_1703,7,45,60,10
EDITTEXT IDC_MEMTEXT,70,63,45,12,ES_AUTOHSCROLL | ES_NUMBER
LTEXT "FPU:",IDT_1707,7,45,59,10
COMBOBOX IDC_COMBO_WS,71,63,189,120,CBS_DROPDOWNLIST | WS_VSCROLL |
WS_TABSTOP
LTEXT "Wait states:",IDT_1703,7,64,60,10
EDITTEXT IDC_MEMTEXT,70,82,45,12,ES_AUTOHSCROLL | ES_NUMBER
CONTROL "",IDC_MEMSPIN,"msctls_updown32",UDS_SETBUDDYINT |
UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_NOTHOUSANDS,113,63,
UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_NOTHOUSANDS,113,82,
12,12
LTEXT "MB",IDT_1705,123,64,10,10
LTEXT "Memory:",IDT_1706,7,64,30,10
GROUPBOX "Time synchronization",IDC_TIME_SYNC,7,96,100,56
LTEXT "MB",IDT_1705,123,83,10,10
LTEXT "Memory:",IDT_1706,7,83,30,10
GROUPBOX "Time synchronization",IDC_TIME_SYNC,7,115,100,56
CONTROL "Disabled",IDC_RADIO_TS_DISABLED,"Button",
BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,14,108,84,10
BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,14,127,84,10
CONTROL "Enabled (local time)", IDC_RADIO_TS_LOCAL,"Button",
BS_AUTORADIOBUTTON | WS_TABSTOP,14,122,84,10
BS_AUTORADIOBUTTON | WS_TABSTOP,14,141,84,10
CONTROL "Enabled (UTC)", IDC_RADIO_TS_UTC,"Button",
BS_AUTORADIOBUTTON | WS_TABSTOP,14,136,84,10
BS_AUTORADIOBUTTON | WS_TABSTOP,14,155,84,10
#ifdef USE_DYNAREC
CONTROL "Dynamic Recompiler",IDC_CHECK_DYNAREC,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,147,81,94,10
BS_AUTOCHECKBOX | WS_TABSTOP,7,100,94,10
#endif
END

View File

@@ -205,7 +205,7 @@ win_settings_init(void)
#ifdef USE_DYNAREC
temp_dynarec = cpu_use_dynarec;
#endif
temp_fpu = enable_external_fpu;
temp_fpu = fpu_type;
temp_sync = time_sync;
/* Video category */
@@ -318,7 +318,7 @@ win_settings_changed(void)
#ifdef USE_DYNAREC
i = i || (temp_dynarec != cpu_use_dynarec);
#endif
i = i || (temp_fpu != enable_external_fpu);
i = i || (temp_fpu != fpu_type);
i = i || (temp_sync != time_sync);
/* Video category */
@@ -422,7 +422,7 @@ win_settings_save(void)
#ifdef USE_DYNAREC
cpu_use_dynarec = temp_dynarec;
#endif
enable_external_fpu = temp_fpu;
fpu_type = temp_fpu;
time_sync = temp_sync;
/* Video category */
@@ -507,6 +507,40 @@ win_settings_save(void)
}
static void
win_settings_machine_recalc_fpu(HWND hdlg)
{
HWND h;
int c, type;
LPTSTR lptsTemp;
const char *stransi;
lptsTemp = (LPTSTR) malloc(512 * sizeof(WCHAR));
h = GetDlgItem(hdlg, IDC_COMBO_FPU);
SendMessage(h, CB_RESETCONTENT, 0, 0);
c = 0;
while (1) {
stransi = (char *) fpu_get_name_from_index(temp_machine, temp_cpu_m, temp_cpu, c);
type = fpu_get_type_from_index(temp_machine, temp_cpu_m, temp_cpu, c);
if (!stransi)
break;
mbstowcs(lptsTemp, stransi, strlen(stransi) + 1);
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)lptsTemp);
if (!c || (type == temp_fpu))
SendMessage(h, CB_SETCURSEL, c, 0);
c++;
}
if (c > 1)
EnableWindow(h, TRUE);
else
EnableWindow(h, FALSE);
}
static void
win_settings_machine_recalc_cpu(HWND hdlg)
{
@@ -539,15 +573,7 @@ win_settings_machine_recalc_cpu(HWND hdlg)
EnableWindow(h, TRUE);
#endif
h = GetDlgItem(hdlg, IDC_CHECK_FPU);
cpu_type = machines[temp_machine].cpu[temp_cpu_m].cpus[temp_cpu].cpu_type;
if (cpu_type < CPU_i486DX)
EnableWindow(h, TRUE);
else {
temp_fpu = 1;
EnableWindow(h, FALSE);
}
SendMessage(h, BM_SETCHECK, temp_fpu, 0);
win_settings_machine_recalc_fpu(hdlg);
}
@@ -738,6 +764,12 @@ win_settings_machine_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
win_settings_machine_recalc_cpu(hdlg);
}
break;
case IDC_COMBO_FPU:
if (HIWORD(wParam) == CBN_SELCHANGE) {
h = GetDlgItem(hdlg, IDC_COMBO_FPU);
temp_fpu = fpu_get_type_from_index(temp_machine, temp_cpu_m, temp_cpu, SendMessage(h, CB_GETCURSEL, 0, 0));
}
break;
case IDC_CONFIGURE_MACHINE:
h = GetDlgItem(hdlg, IDC_COMBO_MACHINE);
temp_machine = listtomachine[SendMessage(h, CB_GETCURSEL, 0, 0)];
@@ -769,9 +801,6 @@ win_settings_machine_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
if(SendMessage(h, BM_GETCHECK, 0, 0))
temp_sync = TIME_SYNC_ENABLED | TIME_SYNC_UTC;
h=GetDlgItem(hdlg, IDC_CHECK_FPU);
temp_fpu = SendMessage(h, BM_GETCHECK, 0, 0);
h = GetDlgItem(hdlg, IDC_COMBO_WS);
temp_wait_states = SendMessage(h, CB_GETCURSEL, 0, 0);