Add a machine flag for machines requiring softfloat FPU and remove the existing restrictions on using dynarec and softfloat together

This commit is contained in:
Alexander Babikov
2023-06-29 03:52:59 +05:00
parent 71d95c7169
commit b5bf8e63a4
5 changed files with 24 additions and 35 deletions

View File

@@ -515,13 +515,8 @@ load_machine(void)
cpu_use_dynarec = !!ini_section_get_int(cat, "cpu_use_dynarec", 0); cpu_use_dynarec = !!ini_section_get_int(cat, "cpu_use_dynarec", 0);
fpu_softfloat = !!ini_section_get_int(cat, "fpu_softfloat", 0); fpu_softfloat = !!ini_section_get_int(cat, "fpu_softfloat", 0);
/*The IBM PS/2 model 70 type 4 BIOS does heavy tests to the FPU in 80-bit precision mode, requiring softfloat if (machine_has_flags(machine, MACHINE_SOFTFLOAT_ONLY))
otherwise it would always throw error 12903 on POST, so always disable dynarec and enable softfloat for this
machine only.*/
if (!strcmp(machines[machine].internal_name, "ibmps2_m70_type4")) {
cpu_use_dynarec = 0;
fpu_softfloat = 1; fpu_softfloat = 1;
}
p = ini_section_get_string(cat, "time_sync", NULL); p = ini_section_get_string(cat, "time_sync", NULL);
if (p != NULL) { if (p != NULL) {

View File

@@ -111,6 +111,7 @@
#define MACHINE_USB_PRI 0x04000000 /* sys has int pri USB */ #define MACHINE_USB_PRI 0x04000000 /* sys has int pri USB */
#define MACHINE_USB_SEC 0x08000000 /* sys has int sec USB */ #define MACHINE_USB_SEC 0x08000000 /* sys has int sec USB */
#define MACHINE_COREBOOT 0x10000000 /* sys has coreboot BIOS */ #define MACHINE_COREBOOT 0x10000000 /* sys has coreboot BIOS */
#define MACHINE_SOFTFLOAT_ONLY 0x20000000 /* sys requires softfloat FPU */
/* Combined flags. */ /* Combined flags. */
#define MACHINE_IDE (MACHINE_IDE_PRI) /* sys has int single IDE/ATAPI - mark as pri IDE/ATAPI */ #define MACHINE_IDE (MACHINE_IDE_PRI) /* sys has int single IDE/ATAPI - mark as pri IDE/ATAPI */
#define MACHINE_IDE_DUAL (MACHINE_IDE_PRI | MACHINE_IDE_SEC) /* sys has int dual IDE/ATAPI - mark as both pri and sec IDE/ATAPI */ #define MACHINE_IDE_DUAL (MACHINE_IDE_PRI | MACHINE_IDE_SEC) /* sys has int dual IDE/ATAPI - mark as both pri and sec IDE/ATAPI */

View File

@@ -5492,7 +5492,7 @@ const machine_t machines[] = {
.max_multi = 0 .max_multi = 0
}, },
.bus_flags = MACHINE_PS2_MCA, .bus_flags = MACHINE_PS2_MCA,
.flags = MACHINE_VIDEO, .flags = MACHINE_VIDEO | MACHINE_SOFTFLOAT_ONLY,
.ram = { .ram = {
.min = 2048, .min = 2048,
.max = 65536, .max = 65536,

View File

@@ -110,11 +110,7 @@ SettingsMachine::save()
cpu = ui->comboBoxSpeed->currentData().toInt(); cpu = ui->comboBoxSpeed->currentData().toInt();
fpu_type = ui->comboBoxFPU->currentData().toInt(); fpu_type = ui->comboBoxFPU->currentData().toInt();
cpu_use_dynarec = ui->checkBoxDynamicRecompiler->isChecked() ? 1 : 0; cpu_use_dynarec = ui->checkBoxDynamicRecompiler->isChecked() ? 1 : 0;
fpu_softfloat = (ui->checkBoxFPUSoftfloat->isChecked() && !cpu_use_dynarec) ? 1 : 0; fpu_softfloat = ui->checkBoxFPUSoftfloat->isChecked() ? 1 : 0;
if (!strcmp(machines[machine].internal_name, "ibmps2_m70_type4")) {
cpu_use_dynarec = 0;
fpu_softfloat = 1;
}
int64_t temp_mem_size; int64_t temp_mem_size;
if (machine_get_ram_granularity(machine) < 1024) { if (machine_get_ram_granularity(machine) < 1024) {
@@ -281,25 +277,17 @@ SettingsMachine::on_comboBoxSpeed_currentIndexChanged(int index)
if (!(flags & CPU_SUPPORTS_DYNAREC)) { if (!(flags & CPU_SUPPORTS_DYNAREC)) {
ui->checkBoxDynamicRecompiler->setChecked(false); ui->checkBoxDynamicRecompiler->setChecked(false);
ui->checkBoxDynamicRecompiler->setEnabled(false); ui->checkBoxDynamicRecompiler->setEnabled(false);
ui->checkBoxFPUSoftfloat->setChecked(fpu_softfloat);
ui->checkBoxFPUSoftfloat->setEnabled(cpu_use_dynarec ? false : true);
} else if (flags & CPU_REQUIRES_DYNAREC) { } else if (flags & CPU_REQUIRES_DYNAREC) {
ui->checkBoxDynamicRecompiler->setChecked(true); ui->checkBoxDynamicRecompiler->setChecked(true);
ui->checkBoxDynamicRecompiler->setEnabled(false); ui->checkBoxDynamicRecompiler->setEnabled(false);
ui->checkBoxFPUSoftfloat->setChecked(false);
ui->checkBoxFPUSoftfloat->setEnabled(false);
} else { } else {
ui->checkBoxDynamicRecompiler->setChecked(cpu_use_dynarec); ui->checkBoxDynamicRecompiler->setChecked(cpu_use_dynarec);
ui->checkBoxDynamicRecompiler->setEnabled(true); ui->checkBoxDynamicRecompiler->setEnabled(true);
ui->checkBoxFPUSoftfloat->setChecked(fpu_softfloat);
ui->checkBoxFPUSoftfloat->setEnabled(cpu_use_dynarec ? false : true);
} }
#else
ui->checkBoxFPUSoftfloat->setChecked(fpu_softfloat);
ui->checkBoxFPUSoftfloat->setEnabled(true);
#endif #endif
// win_settings_machine_recalc_fpu // win_settings_machine_recalc_fpu
int machineId = ui->comboBoxMachine->currentData().toInt();
auto *modelFpu = ui->comboBoxFPU->model(); auto *modelFpu = ui->comboBoxFPU->model();
int removeRows = modelFpu->rowCount(); int removeRows = modelFpu->rowCount();
@@ -317,6 +305,10 @@ SettingsMachine::on_comboBoxSpeed_currentIndexChanged(int index)
ui->comboBoxFPU->setEnabled(modelFpu->rowCount() > 1); ui->comboBoxFPU->setEnabled(modelFpu->rowCount() > 1);
ui->comboBoxFPU->setCurrentIndex(-1); ui->comboBoxFPU->setCurrentIndex(-1);
ui->comboBoxFPU->setCurrentIndex(selectedFpuRow); ui->comboBoxFPU->setCurrentIndex(selectedFpuRow);
ui->checkBoxFPUSoftfloat->setChecked(machine_has_flags(machineId, MACHINE_SOFTFLOAT_ONLY) ? true : fpu_softfloat);
ui->checkBoxFPUSoftfloat->setEnabled(machine_has_flags(machineId, MACHINE_SOFTFLOAT_ONLY) ? false : true);
} }
void void

View File

@@ -714,7 +714,8 @@ win_settings_machine_recalc_fpu(HWND hdlg)
c++; c++;
} }
settings_set_check(hdlg, IDC_CHECK_SOFTFLOAT, temp_fpu_softfloat); 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); settings_enable_window(hdlg, IDC_COMBO_FPU, c > 1);