all repos — mgba @ 54be75bb923c89bcad1947037552a6084b238d9f

mGBA Game Boy Advance Emulator

Load BIOS from command line
Jeffrey Pfau jeffrey@endrift.com
Sat, 18 Oct 2014 17:15:39 -0700
commit

54be75bb923c89bcad1947037552a6084b238d9f

parent

23592af3cc861229ff96d5fb7e2cdbdf0aa91da7

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

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

@@ -139,7 +139,15 @@ m_threadContext.gameDir = VDirOpenZip(m_threadContext.fname, 0);

#endif } + if (!m_bios.isNull()) { + m_threadContext.bios = VFileOpen(m_bios.toLocal8Bit().constData(), O_RDONLY); + } + GBAThreadStart(&m_threadContext); +} + +void GameController::loadBIOS(const QString& path) { + m_bios = path; } void GameController::closeGame() {
M src/platform/qt/GameController.hsrc/platform/qt/GameController.h

@@ -53,6 +53,7 @@ void postLog(int level, const QString& log);

public slots: void loadGame(const QString& path, bool dirmode = false); + void loadBIOS(const QString& path); void closeGame(); void setPaused(bool paused); void reset();

@@ -82,7 +83,7 @@ GBAVideoSoftwareRenderer* m_renderer;

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

@@ -104,16 +104,19 @@ }

} void Window::optionsPassed(StartupOptions* opts) { + if (opts->logLevel) { + m_logView->setLevels(opts->logLevel); + } + + if (opts->bios) { + m_controller->loadBIOS(opts->bios); + } + if (opts->fname) { m_controller->loadGame(opts->fname, opts->dirmode); } - if (opts->logLevel) { - m_logView->setLevels(opts->logLevel); - } - // TODO: - // - bios // - patch // - frameskip; // - rewindBufferCapacity