diff --git a/src/platform/qt/GameController.cpp b/src/platform/qt/GameController.cpp index 332daea9b..981f351ba 100644 --- a/src/platform/qt/GameController.cpp +++ b/src/platform/qt/GameController.cpp @@ -289,6 +289,10 @@ void GameController::setAudioSync(bool set) { } } +void GameController::setFrameskip(int skip) { + m_threadContext.frameskip = skip; +} + void GameController::setTurbo(bool set, bool forced) { if (m_turboForced && !forced) { return; diff --git a/src/platform/qt/GameController.h b/src/platform/qt/GameController.h index 0f47a8fb1..45e2e07da 100644 --- a/src/platform/qt/GameController.h +++ b/src/platform/qt/GameController.h @@ -71,6 +71,7 @@ public slots: void saveState(int slot); void setVideoSync(bool); void setAudioSync(bool); + void setFrameskip(int); void setTurbo(bool, bool forced = true); #ifdef BUILD_SDL diff --git a/src/platform/qt/Window.cpp b/src/platform/qt/Window.cpp index 4d3985853..737a94086 100644 --- a/src/platform/qt/Window.cpp +++ b/src/platform/qt/Window.cpp @@ -101,6 +101,10 @@ void Window::optionsPassed(StartupOptions* opts) { m_logView->setLevels(opts->logLevel); } + if (opts->frameskip) { + m_controller->setFrameskip(opts->frameskip); + } + if (opts->bios) { m_controller->loadBIOS(opts->bios); } @@ -112,9 +116,6 @@ void Window::optionsPassed(StartupOptions* opts) { if (opts->fname) { m_controller->loadGame(opts->fname, opts->dirmode); } - - // TODO: - // - frameskip } void Window::selectROM() { @@ -385,7 +386,7 @@ void Window::setupMenu(QMenuBar* menubar) { emulationMenu->addAction(audioSync); QMenu* videoMenu = menubar->addMenu(tr("&Video")); - QMenu* frameMenu = videoMenu->addMenu(tr("Frame &size")); + QMenu* frameMenu = videoMenu->addMenu(tr("Frame size")); QAction* setSize = new QAction(tr("1x"), videoMenu); connect(setSize, &QAction::triggered, [this]() { showNormal(); @@ -412,6 +413,15 @@ void Window::setupMenu(QMenuBar* menubar) { frameMenu->addAction(setSize); frameMenu->addAction(tr("Fullscreen"), this, SLOT(toggleFullScreen()), QKeySequence("Ctrl+F")); + QMenu* skipMenu = videoMenu->addMenu(tr("Frame&skip")); + for (int i = 0; i <= 10; ++i) { + QAction* setSkip = new QAction(QString::number(i), skipMenu); + connect(setSkip, &QAction::triggered, [this, i]() { + m_controller->setFrameskip(i); + }); + skipMenu->addAction(setSkip); + } + QMenu* soundMenu = menubar->addMenu(tr("&Sound")); QMenu* buffersMenu = soundMenu->addMenu(tr("Buffer &size")); QAction* setBuffer = new QAction(tr("512"), buffersMenu);