From 6041bf422aa7c952b53e73f64202510b5c6bbf48 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Fri, 24 Oct 2014 01:25:06 -0700 Subject: [PATCH] Load patch from command line --- src/platform/qt/GameController.cpp | 8 ++++++++ src/platform/qt/GameController.h | 2 ++ src/platform/qt/Window.cpp | 11 +++++------ 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/platform/qt/GameController.cpp b/src/platform/qt/GameController.cpp index 84d016d2c..ce31faabd 100644 --- a/src/platform/qt/GameController.cpp +++ b/src/platform/qt/GameController.cpp @@ -147,6 +147,10 @@ void GameController::loadGame(const QString& path, bool dirmode) { m_threadContext.bios = VFileOpen(m_bios.toLocal8Bit().constData(), O_RDONLY); } + if (!m_patch.isNull()) { + m_threadContext.patch = VFileOpen(m_patch.toLocal8Bit().constData(), O_RDONLY); + } + GBAThreadStart(&m_threadContext); } @@ -154,6 +158,10 @@ void GameController::loadBIOS(const QString& path) { m_bios = path; } +void GameController::loadPatch(const QString& path) { + m_patch = path; +} + void GameController::closeGame() { if (!m_gameOpen) { return; diff --git a/src/platform/qt/GameController.h b/src/platform/qt/GameController.h index fd29a21df..8a7e41d99 100644 --- a/src/platform/qt/GameController.h +++ b/src/platform/qt/GameController.h @@ -57,6 +57,7 @@ signals: public slots: void loadGame(const QString& path, bool dirmode = false); void loadBIOS(const QString& path); + void loadPatch(const QString& path); void closeGame(); void setPaused(bool paused); void reset(); @@ -90,6 +91,7 @@ private: bool m_gameOpen; QString m_bios; + QString m_patch; QThread* m_audioThread; AudioProcessor* m_audioProcessor; diff --git a/src/platform/qt/Window.cpp b/src/platform/qt/Window.cpp index 0624c7fcc..4d2c4c896 100644 --- a/src/platform/qt/Window.cpp +++ b/src/platform/qt/Window.cpp @@ -112,17 +112,16 @@ void Window::optionsPassed(StartupOptions* opts) { m_controller->loadBIOS(opts->bios); } + if (opts->patch) { + m_controller->loadPatch(opts->patch); + } + if (opts->fname) { m_controller->loadGame(opts->fname, opts->dirmode); } // TODO: - // - patch - // - frameskip; - // - rewindBufferCapacity - // - rewindBufferInterval - // - DebuggerType debuggerType - // - debugAtStart + // - frameskip } void Window::selectROM() {