mirror of https://github.com/mgba-emu/mgba.git
Load patch from command line
This commit is contained in:
parent
bfa5fb6173
commit
6041bf422a
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue