Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/frontend/qt_sdl/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ LegacyEntry LegacyFile[] =
{"HKKey_GuitarGripRed", 0, "Keyboard.HK_GuitarGripRed", true},
{"HKKey_GuitarGripYellow", 0, "Keyboard.HK_GuitarGripYellow", true},
{"HKKey_GuitarGripBlue", 0, "Keyboard.HK_GuitarGripBlue", true},
{"HKKey_ReloadMostRecentROM", 0, "Keyboard.HK_ReloadMostRecentROM", true},

{"HKJoy_Lid", 0, "Joystick.HK_Lid", true},
{"HKJoy_Mic", 0, "Joystick.HK_Mic", true},
Expand All @@ -194,6 +195,7 @@ LegacyEntry LegacyFile[] =
{"HKJoy_GuitarGripRed", 0, "Joystick.HK_GuitarGripRed", true},
{"HKJoy_GuitarGripYellow", 0, "Joystick.HK_GuitarGripYellow", true},
{"HKJoy_GuitarGripBlue", 0, "Joystick.HK_GuitarGripBlue", true},
{"HKJoy_ReloadMostRecentROM", 0, "Joystick.HK_ReloadMostRecentROM", true},

{"JoystickID", 0, "JoystickID", true},

Expand Down
1 change: 1 addition & 0 deletions src/frontend/qt_sdl/EmuInstance.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ enum
HK_GuitarGripRed,
HK_GuitarGripYellow,
HK_GuitarGripBlue,
HK_ReloadMostRecentROM,
HK_MAX
};

Expand Down
3 changes: 2 additions & 1 deletion src/frontend/qt_sdl/EmuInstanceInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ const char* EmuInstance::hotkeyNames[HK_MAX] =
"HK_GuitarGripGreen",
"HK_GuitarGripRed",
"HK_GuitarGripYellow",
"HK_GuitarGripBlue"
"HK_GuitarGripBlue",
"HK_ReloadMostRecentROM"
};

std::shared_ptr<SDL_mutex> EmuInstance::joyMutexGlobal = nullptr;
Expand Down
3 changes: 3 additions & 0 deletions src/frontend/qt_sdl/EmuThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ void EmuThread::attachWindow(MainWindow* window)
connect(this, SIGNAL(autoScreenSizingChange(int)), window->panel, SLOT(onAutoScreenSizingChanged(int)));
connect(this, SIGNAL(windowFullscreenToggle()), window, SLOT(onFullscreenToggled()));
connect(this, SIGNAL(screenEmphasisToggle()), window, SLOT(onScreenEmphasisToggled()));
connect(this, SIGNAL(reloadMostRecentROM()), window, SLOT(onReloadMostRecentROM()));

if (window->winHasMenu())
{
Expand All @@ -96,6 +97,7 @@ void EmuThread::detachWindow(MainWindow* window)
disconnect(this, SIGNAL(autoScreenSizingChange(int)), window->panel, SLOT(onAutoScreenSizingChanged(int)));
disconnect(this, SIGNAL(windowFullscreenToggle()), window, SLOT(onFullscreenToggled()));
disconnect(this, SIGNAL(screenEmphasisToggle()), window, SLOT(onScreenEmphasisToggled()));
disconnect(this, SIGNAL(reloadMostRecentROM()), window, SLOT(onReloadMostRecentROM()));

if (window->winHasMenu())
{
Expand Down Expand Up @@ -162,6 +164,7 @@ void EmuThread::run()

if (emuInstance->hotkeyPressed(HK_Pause)) emuTogglePause();
if (emuInstance->hotkeyPressed(HK_Reset)) emuReset();
if (emuInstance->hotkeyPressed(HK_ReloadMostRecentROM)) emit reloadMostRecentROM();
if (emuInstance->hotkeyPressed(HK_FrameStep)) emuFrameStep();

if (emuInstance->hotkeyPressed(HK_FullscreenToggle)) emit windowFullscreenToggle();
Expand Down
3 changes: 2 additions & 1 deletion src/frontend/qt_sdl/EmuThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class EmuThread : public QThread

msg_ImportSavefile,

msg_EnableCheats,
msg_EnableCheats
};

struct Message
Expand Down Expand Up @@ -157,6 +157,7 @@ class EmuThread : public QThread
void autoScreenSizingChange(int sizing);

void windowFullscreenToggle();
void reloadMostRecentROM();

void swapScreensToggle();
void screenEmphasisToggle();
Expand Down
6 changes: 4 additions & 2 deletions src/frontend/qt_sdl/InputConfig/InputConfigDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ static constexpr std::initializer_list<int> hk_general =
HK_SwapScreenEmphasis,
HK_PowerButton,
HK_VolumeUp,
HK_VolumeDown
HK_VolumeDown,
HK_ReloadMostRecentROM
};

static constexpr std::initializer_list<const char*> hk_general_labels =
Expand All @@ -87,7 +88,8 @@ static constexpr std::initializer_list<const char*> hk_general_labels =
"Swap screen emphasis",
"DSi Power button",
"DSi Volume up",
"DSi Volume down"
"DSi Volume down",
"Reload most recent ROM"
};

static_assert(hk_general.size() == hk_general_labels.size());
Expand Down
25 changes: 25 additions & 0 deletions src/frontend/qt_sdl/Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1495,6 +1495,31 @@ void MainWindow::onClickRecentFile()
updateCartInserted(false);
}

void MainWindow::onReloadMostRecentROM()
{
QString filename = globalCfg.GetArray("RecentROM").GetQString(0);

if (!verifySetup())
return;

const QStringList file = splitArchivePath(filename, true);
if (file.isEmpty())
return;

QString errorstr;
if (!emuThread->bootROM(file, errorstr))
{
QMessageBox::critical(this, "melonDS", errorstr);
return;
}

recentFileList.removeAll(filename);
recentFileList.prepend(filename);
updateRecentFilesMenu();

updateCartInserted(false);
}

void MainWindow::onBootFirmware()
{
if (!verifySetup())
Expand Down
1 change: 1 addition & 0 deletions src/frontend/qt_sdl/Window.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ private slots:

void onPause(bool checked);
void onReset();
void onReloadMostRecentROM();
void onStop();
void onFrameStep();
void onOpenPowerManagement();
Expand Down