mirror of https://github.com/mgba-emu/mgba.git
Qt: Fix some config regressions
This commit is contained in:
parent
fae8ef7f42
commit
9ec62368bc
|
@ -106,7 +106,7 @@ GameController::GameController(QObject* parent)
|
|||
if (mCoreLoadState(context->core, 0, controller->m_loadStateFlags)) {
|
||||
mCoreDeleteState(context->core, 0);
|
||||
}
|
||||
QMetaObject::invokeMethod(controller, "gameStarted", Q_ARG(mCoreThread*, context));
|
||||
QMetaObject::invokeMethod(controller, "gameStarted", Q_ARG(mCoreThread*, context), Q_ARG(const QString&, controller->m_fname));
|
||||
};
|
||||
|
||||
m_threadContext.cleanCallback = [](mCoreThread* context) {
|
||||
|
@ -235,12 +235,12 @@ void GameController::setOverride(const GBACartridgeOverride& override) {
|
|||
}
|
||||
|
||||
void GameController::setConfig(const mCoreConfig* config) {
|
||||
if (!m_gameOpen) {
|
||||
return;
|
||||
m_config = config;
|
||||
if (isLoaded()) {
|
||||
threadInterrupt();
|
||||
mCoreLoadForeignConfig(m_threadContext.core, config);
|
||||
threadContinue();
|
||||
}
|
||||
threadInterrupt();
|
||||
mCoreLoadForeignConfig(m_threadContext.core, config);
|
||||
threadContinue();
|
||||
}
|
||||
|
||||
#ifdef USE_GDB_STUB
|
||||
|
@ -333,6 +333,10 @@ void GameController::openGame(bool biosOnly) {
|
|||
|
||||
m_threadContext.core->setAVStream(m_threadContext.core, m_stream);
|
||||
|
||||
if (m_config) {
|
||||
mCoreLoadForeignConfig(m_threadContext.core, m_config);
|
||||
}
|
||||
|
||||
if (!mCoreThreadStart(&m_threadContext)) {
|
||||
m_gameOpen = false;
|
||||
emit gameFailed();
|
||||
|
|
|
@ -82,7 +82,7 @@ public:
|
|||
|
||||
signals:
|
||||
void frameAvailable(const uint32_t*);
|
||||
void gameStarted(mCoreThread*);
|
||||
void gameStarted(mCoreThread*, const QString& fname);
|
||||
void gameStopped(mCoreThread*);
|
||||
void gamePaused(mCoreThread*);
|
||||
void gameUnpaused(mCoreThread*);
|
||||
|
@ -171,6 +171,7 @@ private:
|
|||
uint32_t* m_drawContext;
|
||||
uint32_t* m_frontBuffer;
|
||||
mCoreThread m_threadContext;
|
||||
const mCoreConfig* m_config;
|
||||
GBACheatDevice m_cheatDevice;
|
||||
int m_activeKeys;
|
||||
int m_activeButtons;
|
||||
|
|
|
@ -21,7 +21,7 @@ OverrideView::OverrideView(GameController* controller, ConfigController* config,
|
|||
{
|
||||
m_ui.setupUi(this);
|
||||
|
||||
connect(controller, SIGNAL(gameStarted(mCoreThread*)), this, SLOT(gameStarted(mCoreThread*)));
|
||||
connect(controller, SIGNAL(gameStarted(mCoreThread*, const QString&)), this, SLOT(gameStarted(mCoreThread*)));
|
||||
connect(controller, SIGNAL(gameStopped(mCoreThread*)), this, SLOT(gameStopped()));
|
||||
|
||||
connect(m_ui.hwAutodetect, &QAbstractButton::toggled, [this] (bool enabled) {
|
||||
|
|
|
@ -94,8 +94,8 @@ Window::Window(ConfigController* config, int playerId, QWidget* parent)
|
|||
m_screenWidget->setLockAspectRatio(m_logo.width(), m_logo.height());
|
||||
setCentralWidget(m_screenWidget);
|
||||
|
||||
connect(m_controller, SIGNAL(gameStarted(mCoreThread*)), this, SLOT(gameStarted(mCoreThread*)));
|
||||
connect(m_controller, SIGNAL(gameStarted(mCoreThread*)), &m_inputController, SLOT(suspendScreensaver()));
|
||||
connect(m_controller, SIGNAL(gameStarted(mCoreThread*, const QString&)), this, SLOT(gameStarted(mCoreThread*, const QString&)));
|
||||
connect(m_controller, SIGNAL(gameStarted(mCoreThread*, const QString&)), &m_inputController, SLOT(suspendScreensaver()));
|
||||
connect(m_controller, SIGNAL(gameStopped(mCoreThread*)), m_display, SLOT(stopDrawing()));
|
||||
connect(m_controller, SIGNAL(gameStopped(mCoreThread*)), this, SLOT(gameStopped()));
|
||||
connect(m_controller, SIGNAL(gameStopped(mCoreThread*)), &m_inputController, SLOT(resumeScreensaver()));
|
||||
|
@ -597,8 +597,7 @@ void Window::toggleFullScreen() {
|
|||
}
|
||||
}
|
||||
|
||||
void Window::gameStarted(mCoreThread* context) {
|
||||
char title[13] = { '\0' };
|
||||
void Window::gameStarted(mCoreThread* context, const QString& fname) {
|
||||
MutexLock(&context->stateMutex);
|
||||
if (context->state < THREAD_EXITING) {
|
||||
emit startDrawing(context);
|
||||
|
@ -611,10 +610,10 @@ void Window::gameStarted(mCoreThread* context) {
|
|||
action->setDisabled(false);
|
||||
}
|
||||
multiplayerChanged();
|
||||
/*if (context->fname) {
|
||||
setWindowFilePath(context->fname);
|
||||
appendMRU(context->fname);
|
||||
}*/
|
||||
if (!fname.isEmpty()) {
|
||||
setWindowFilePath(fname);
|
||||
appendMRU(fname);
|
||||
}
|
||||
updateTitle();
|
||||
attachWidget(m_display);
|
||||
|
||||
|
|
|
@ -111,7 +111,7 @@ protected:
|
|||
virtual void mouseDoubleClickEvent(QMouseEvent*) override;
|
||||
|
||||
private slots:
|
||||
void gameStarted(mCoreThread*);
|
||||
void gameStarted(mCoreThread*, const QString&);
|
||||
void gameStopped();
|
||||
void gameCrashed(const QString&);
|
||||
void gameFailed();
|
||||
|
|
Loading…
Reference in New Issue