Skip to content

Commit 04a727a

Browse files
committed
Merge branch 'master' into codegen_updates
2 parents c840791 + b75abf3 commit 04a727a

File tree

10 files changed

+32
-26
lines changed

10 files changed

+32
-26
lines changed

GameConfig.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@
7575
<GameConfig Executable="SLUS_216.09;1" Title="Dance Dance Revolution: Disney Channel Edition">
7676
<IdleLoopBlock Address="0x001B48D8" />
7777
</GameConfig>
78+
<GameConfig Executable="SLUS_216.15;1" Title="Wild Arms 5">
79+
<IdleLoopBlock Address="0x001324D8" />
80+
</GameConfig>
7881
<GameConfig Executable="SLUS_216.91;1" Title="Swashbucklers: Blue vs. Grey">
7982
<IdleLoopBlock Address="0x0022FC70" />
8083
</GameConfig>

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Play! #
22
Play! is a PlayStation2 emulator for Windows, macOS, UNIX, Android, iOS & web browser platforms.
33

4+
Play! uses a built-in high-level emulation BIOS. Using an external BIOS file is not necessary or possible.
5+
46
Compatibility information is available on the official [Compatibility Tracker](https://github.com/jpd002/Play-Compatibility).
57
If a specific game doesn't work with the emulator, please create a new issue there.
68

Source/ui_qt/ControllerConfig/controllerconfigdialog.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,16 @@ void ControllerConfigDialog::bindingsViewDoubleClicked(const QModelIndex& index)
170170
uint32 padIndex = ui->tabWidget->currentIndex();
171171
assert(padIndex < CInputBindingManager::MAX_PADS);
172172
OpenBindConfigDialog(padIndex, index.row());
173+
auto& bindingsView = m_padUiElements[padIndex].bindingsView;
174+
static_cast<CInputBindingModel*>(bindingsView->model())->RefreshRow(index);
173175
}
174176

175177
void ControllerConfigDialog::bindingsViewDeleteItem()
176178
{
177179
uint32 padIndex = ui->tabWidget->currentIndex();
178180
assert(padIndex < CInputBindingManager::MAX_PADS);
179-
QItemSelectionModel* selModel = m_padUiElements[padIndex].bindingsView->selectionModel();
181+
auto& bindingsView = m_padUiElements[padIndex].bindingsView;
182+
QItemSelectionModel* selModel = bindingsView->selectionModel();
180183
auto selRows = selModel->selectedRows();
181184
if(selRows.empty())
182185
{
@@ -189,6 +192,7 @@ void ControllerConfigDialog::bindingsViewDeleteItem()
189192
for(const auto& selRow : selRows)
190193
{
191194
m_inputManager->ResetBinding(padIndex, static_cast<PS2::CControllerInfo::BUTTON>(selRow.row()));
195+
static_cast<CInputBindingModel*>(bindingsView->model())->RefreshRow(selRow);
192196
}
193197
}
194198
}

Source/ui_qt/ControllerConfig/inputbindingmodel.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,8 @@ void CInputBindingModel::Refresh()
7878
{
7979
QAbstractTableModel::layoutChanged();
8080
}
81+
82+
void CInputBindingModel::RefreshRow(const QModelIndex& modelIndex)
83+
{
84+
emit QAbstractTableModel::dataChanged(index(modelIndex.row(), 0), index(modelIndex.row(), columnCount()));
85+
}

Source/ui_qt/ControllerConfig/inputbindingmodel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ class CInputBindingModel : public QAbstractTableModel
1515
int rowCount(const QModelIndex& parent = QModelIndex()) const Q_DECL_OVERRIDE;
1616
int columnCount(const QModelIndex& parent = QModelIndex()) const Q_DECL_OVERRIDE;
1717
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
18-
void addData(const QStringList data) const;
1918
bool setHeaderData(int section, Qt::Orientation orientation, const QVariant& value, int role = Qt::EditRole) Q_DECL_OVERRIDE;
2019
void Refresh();
20+
void RefreshRow(const QModelIndex&);
2121

2222
protected:
2323
QVariant headerData(int section, Qt::Orientation orientation, int role) const Q_DECL_OVERRIDE;

Source/ui_qt/VfsDevice.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class CDevice
1414
virtual bool RequestModification(QWidget*) = 0;
1515
virtual void Save() = 0;
1616
};
17-
typedef std::map<unsigned int, CDevice*> DeviceList;
17+
typedef std::map<unsigned int, std::unique_ptr<CDevice>> DeviceList;
1818

1919
class CDirectoryDevice : public CDevice
2020
{
@@ -29,8 +29,8 @@ class CDirectoryDevice : public CDevice
2929
void Save() override;
3030

3131
private:
32-
const char* m_name;
33-
const char* m_preference;
32+
const char* m_name = nullptr;
33+
const char* m_preference = nullptr;
3434
fs::path m_value;
3535
};
3636

Source/ui_qt/vfsmodel.cpp

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,6 @@ VFSModel::VFSModel(QObject* parent)
88
SetupDevices();
99
}
1010

11-
VFSModel::~VFSModel()
12-
{
13-
for(int i = 0; i < m_devices.size(); i++)
14-
{
15-
delete m_devices.at(i);
16-
}
17-
}
18-
1911
int VFSModel::rowCount(const QModelIndex& /*parent*/) const
2012
{
2113
return m_devices.size();
@@ -30,7 +22,7 @@ QVariant VFSModel::data(const QModelIndex& index, int role) const
3022
{
3123
if(role == Qt::DisplayRole)
3224
{
33-
auto device = m_devices.at(index.row());
25+
const auto& device = m_devices.at(index.row());
3426
QString val;
3527
switch(index.column())
3628
{
@@ -51,11 +43,11 @@ QVariant VFSModel::data(const QModelIndex& index, int role) const
5143

5244
void VFSModel::SetupDevices()
5345
{
54-
m_devices[0] = new CDirectoryDevice("mc0", PREF_PS2_MC0_DIRECTORY);
55-
m_devices[1] = new CDirectoryDevice("mc1", PREF_PS2_MC1_DIRECTORY);
56-
m_devices[2] = new CDirectoryDevice("host", PREF_PS2_HOST_DIRECTORY);
57-
m_devices[3] = new CCdrom0Device();
58-
m_devices[4] = new CDirectoryDevice("rom0", PREF_PS2_ROM0_DIRECTORY);
46+
m_devices[0] = std::make_unique<CDirectoryDevice>("mc0", PREF_PS2_MC0_DIRECTORY);
47+
m_devices[1] = std::make_unique<CDirectoryDevice>("mc1", PREF_PS2_MC1_DIRECTORY);
48+
m_devices[2] = std::make_unique<CDirectoryDevice>("host", PREF_PS2_HOST_DIRECTORY);
49+
m_devices[3] = std::make_unique<CCdrom0Device>();
50+
m_devices[4] = std::make_unique<CDirectoryDevice>("rom0", PREF_PS2_ROM0_DIRECTORY);
5951
}
6052

6153
bool VFSModel::setHeaderData(int section, Qt::Orientation orientation, const QVariant& value, int role)
@@ -87,10 +79,11 @@ QVariant VFSModel::headerData(int section, Qt::Orientation orientation, int role
8779
return QAbstractTableModel::headerData(section, orientation, role);
8880
}
8981

90-
void VFSModel::DoubleClicked(const QModelIndex& index, QWidget* parent)
82+
void VFSModel::DoubleClicked(const QModelIndex& modelIndex, QWidget* parent)
9183
{
92-
CDevice* m_device = m_devices.at(index.row());
93-
m_device->RequestModification(parent);
84+
const auto& device = m_devices.at(modelIndex.row());
85+
device->RequestModification(parent);
86+
emit QAbstractTableModel::dataChanged(index(modelIndex.row(), 0), index(modelIndex.row(), columnCount()));
9487
}
9588

9689
void VFSModel::Save()

Source/ui_qt/vfsmodel.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@ class VFSModel : public QAbstractTableModel
88
Q_OBJECT
99
public:
1010
VFSModel(QObject* parent);
11-
~VFSModel();
11+
virtual ~VFSModel() = default;
1212

1313
int rowCount(const QModelIndex& parent = QModelIndex()) const Q_DECL_OVERRIDE;
1414
int columnCount(const QModelIndex& parent = QModelIndex()) const Q_DECL_OVERRIDE;
1515
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
16-
void addData(const QStringList data) const;
1716
bool setHeaderData(int section, Qt::Orientation orientation, const QVariant& value, int role = Qt::EditRole) Q_DECL_OVERRIDE;
1817
void DoubleClicked(const QModelIndex& index, QWidget* parent = nullptr);
1918
void Save();

build_cmake/generate_vs2022_64.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
@echo off
2-
cmake .. --preset windows-x86_64-vs -DCMAKE_PREFIX_PATH="C:\Qt\6.8.0\msvc2022_64"
2+
cmake .. --preset windows-x86_64-vs -DCMAKE_PREFIX_PATH="C:\Qt\6.10.2\msvc2022_64" --fresh
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
@echo off
2-
cmake .. --preset windows-debugger-x86_64-vs -DCMAKE_PREFIX_PATH="C:\Qt\6.8.0\msvc2022_64"
2+
cmake .. --preset windows-debugger-x86_64-vs -DCMAKE_PREFIX_PATH="C:\Qt\6.10.2\msvc2022_64" --fresh

0 commit comments

Comments
 (0)