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

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