Skip to content

Commit 736f5de

Browse files
committed
Another attempt at supporting usb2snesv8. Also allow to reconnect by pressing the button
1 parent df0800f commit 736f5de

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

usb2snesstatut.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,12 @@ void USB2SnesStatut::onRomStarted()
113113
sDebug() << "Rom started";
114114
QString text = usb2snes->infos().at(2);
115115
ui->romNameLabel->setText(text);
116+
if (usb2snes->firmwareVersion().majorVersion() == 8)
117+
{
118+
ui->romPatchedLabel->setText(tr("Running USB2Snes V8, can't know if patched ROM"));
119+
ui->patchROMpushButton->setEnabled(true);
120+
return;
121+
}
116122
if (!isPatchedRom())
117123
{
118124
ui->romPatchedLabel->setText(tr("ROM is not patched for savestate"));
@@ -185,6 +191,12 @@ bool USB2SnesStatut::validVersion()
185191
bool USB2SnesStatut::isPatchedRom()
186192
{
187193
sDebug() << "Checking for patched rom";
194+
/*if (usb2snes->firmwareVersion() > QVersionNumber(7))
195+
{
196+
QByteArray data = usb2snes->getAddress(0xFC2000, 15, USB2snes::SNES);
197+
QByteArray cmpv8 = QByteArray::fromHex("0101102020200000000000000000");
198+
return data == cmpv8;
199+
}*/
188200
QByteArray data = usb2snes->getAddress(0x2A90, 1, USB2snes::CMD);
189201
if (data[0] != (char) 0x60)
190202
return true;
@@ -270,5 +282,9 @@ void USB2SnesStatut::on_pushButton_clicked()
270282

271283
void USB2SnesStatut::on_statusPushButton_clicked()
272284
{
285+
if (usb2snes->state() == USB2snes::None)
286+
{
287+
usb2snes->connect();
288+
}
273289
QToolTip::showText(ui->statusPushButton->mapToGlobal(QPoint(0,0)), ui->statusPushButton->toolTip(), ui->statusPushButton, QRect(), 5000);
274290
}

0 commit comments

Comments
 (0)