Load BIOS from command line

This commit is contained in:
Jeffrey Pfau 2014-10-18 17:15:39 -07:00
parent 23592af3cc
commit 54be75bb92
3 changed files with 18 additions and 6 deletions

View File

@ -139,9 +139,17 @@ void GameController::loadGame(const QString& path, bool dirmode) {
#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() {
if (!m_gameOpen) {
return;

View File

@ -53,6 +53,7 @@ signals:
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 @@ private:
int m_activeKeys;
bool m_gameOpen;
QFile* m_bios;
QString m_bios;
QThread* m_audioThread;
AudioProcessor* m_audioProcessor;

View File

@ -104,16 +104,19 @@ GBAKey Window::mapKey(int qtKey) {
}
void Window::optionsPassed(StartupOptions* opts) {
if (opts->fname) {
m_controller->loadGame(opts->fname, opts->dirmode);
}
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);
}
// TODO:
// - bios
// - patch
// - frameskip;
// - rewindBufferCapacity