mirror of https://github.com/mgba-emu/mgba.git
Load BIOS from command line
This commit is contained in:
parent
23592af3cc
commit
54be75bb92
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue