all repos — mgba @ 6041bf422aa7c952b53e73f64202510b5c6bbf48

mGBA Game Boy Advance Emulator

Load patch from command line
Jeffrey Pfau jeffrey@endrift.com
Fri, 24 Oct 2014 01:25:06 -0700
commit

6041bf422aa7c952b53e73f64202510b5c6bbf48

parent

bfa5fb6173ac8790168f05a527594fc8ff082bed

3 files changed, 15 insertions(+), 6 deletions(-)

jump to
M src/platform/qt/GameController.cppsrc/platform/qt/GameController.cpp

@@ -147,11 +147,19 @@ if (!m_bios.isNull()) {

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); } void GameController::loadBIOS(const QString& path) { m_bios = path; +} + +void GameController::loadPatch(const QString& path) { + m_patch = path; } void GameController::closeGame() {
M src/platform/qt/GameController.hsrc/platform/qt/GameController.h

@@ -57,6 +57,7 @@

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 @@ int m_activeKeys;

bool m_gameOpen; QString m_bios; + QString m_patch; QThread* m_audioThread; AudioProcessor* m_audioProcessor;
M src/platform/qt/Window.cppsrc/platform/qt/Window.cpp

@@ -112,17 +112,16 @@ if (opts->bios) {

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() {