Skip to content

Commit cf64b86

Browse files
[Soft-Float] - Merges the softloat-ui branch from: https://github.com/TheLastRar/pcsx2/tree/softfoat-ui
I am sorry for the manual merging, hopefully credits are enough in the commit title.
1 parent 9ccca2b commit cf64b86

File tree

8 files changed

+196
-759
lines changed

8 files changed

+196
-759
lines changed

common/SettingsWrapper.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,26 @@ SettingsWrapper::SettingsWrapper(SettingsInterface& si)
2323
{
2424
}
2525

26+
int SettingsWrapper::EntryFlagsBitfield(const char* section, const char* var_prefix, int value, const std::pair<int, const char*>* entries, const int defvalue /*= 0.0*/)
27+
{
28+
std::string name;
29+
int outval = 0;
30+
31+
int i = 0;
32+
while (entries[i].second != nullptr)
33+
{
34+
name.assign(var_prefix);
35+
name.append(entries[i].second);
36+
const int bit = entries[i].first;
37+
const bool def = defvalue & bit;
38+
bool val = value & bit;
39+
Entry(section, name.c_str(), val, def);
40+
outval |= val ? bit : 0;
41+
i++;
42+
}
43+
return outval;
44+
}
45+
2646
SettingsLoadWrapper::SettingsLoadWrapper(SettingsInterface& si)
2747
: SettingsWrapper(si)
2848
{

common/SettingsWrapper.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "common/SmallString.h"
1010

1111
#include <optional>
12+
#include <utility>
1213

1314
// Helper class which loads or saves depending on the derived class.
1415
class SettingsWrapper
@@ -29,6 +30,7 @@ class SettingsWrapper
2930
// This special form of Entry is provided for bitfields, which cannot be passed by reference.
3031
virtual bool EntryBitBool(const char* section, const char* var, bool value, const bool defvalue = false) = 0;
3132
virtual int EntryBitfield(const char* section, const char* var, int value, const int defvalue = 0) = 0;
33+
int EntryFlagsBitfield(const char* section, const char* var_prefix, int value, const std::pair<int, const char*>* entries, const int defvalue = 0);
3234

3335
template <typename T>
3436
void EnumEntry(const char* section, const char* var, T& value, const char* const* enumArray = nullptr, const T defvalue = (T)0)

pcsx2-qt/Settings/AdvancedSettingsWidget.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ AdvancedSettingsWidget::AdvancedSettingsWidget(SettingsWindow* settings_dialog,
4747
connect(m_ui.vu1ClampMode, QOverload<int>::of(&QComboBox::currentIndexChanged), [this](int index) { setClampingMode(1, index); });
4848

4949
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.eeSoftAddSub, "EmuCore/CPU/Recompiler", "fpuSoftAddSub", false);
50-
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.eeSoftMulDiv, "EmuCore/CPU/Recompiler", "fpuSoftMulDiv", false);
51-
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.eeSoftSqrt, "EmuCore/CPU/Recompiler", "fpuSoftSqrt", false);
50+
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.eeSoftMul, "EmuCore/CPU/Recompiler", "fpuSoftMul", false);
51+
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.eeSoftDivSqrt, "EmuCore/CPU/Recompiler", "fpuSoftDivSqrt", false);
5252
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.vu0SoftAddSub, "EmuCore/CPU/Recompiler", "vu0SoftAddSub", false);
53-
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.vu0SoftMulDiv, "EmuCore/CPU/Recompiler", "vu0SoftMulDiv", false);
54-
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.vu0SoftSqrt, "EmuCore/CPU/Recompiler", "vu0SoftSqrt", false);
53+
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.vu0SoftMul, "EmuCore/CPU/Recompiler", "vu0SoftMul", false);
54+
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.vu0SoftDivSqrt, "EmuCore/CPU/Recompiler", "vu0SoftDivSqrt", false);
5555
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.vu1SoftAddSub, "EmuCore/CPU/Recompiler", "vu1SoftAddSub", false);
56-
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.vu1SoftMulDiv, "EmuCore/CPU/Recompiler", "vu1SoftMulDiv", false);
57-
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.vu1SoftSqrt, "EmuCore/CPU/Recompiler", "vu1SoftSqrt", false);
56+
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.vu1SoftMul, "EmuCore/CPU/Recompiler", "vu1SoftMul", false);
57+
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.vu1SoftDivSqrt, "EmuCore/CPU/Recompiler", "vu1SoftDivSqrt", false);
5858

5959
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.iopRecompiler, "EmuCore/CPU/Recompiler", "EnableIOP", true);
6060

0 commit comments

Comments
 (0)