mirror of https://github.com/mgba-emu/mgba.git
Core: Change thread startCallback semantics to before reset
This commit is contained in:
parent
1a74924023
commit
41e00148bf
|
@ -158,7 +158,6 @@ static THREAD_ENTRY _mCoreThreadRun(void* context) {
|
|||
};
|
||||
core->addCoreCallbacks(core, &callbacks);
|
||||
core->setSync(core, &threadContext->impl->sync);
|
||||
core->reset(core);
|
||||
|
||||
struct mLogFilter filter;
|
||||
if (!threadContext->logger.d.filter) {
|
||||
|
@ -168,12 +167,13 @@ static THREAD_ENTRY _mCoreThreadRun(void* context) {
|
|||
}
|
||||
|
||||
mCoreThreadRewindParamsChanged(threadContext);
|
||||
|
||||
_changeState(threadContext->impl, THREAD_RUNNING, true);
|
||||
|
||||
if (threadContext->startCallback) {
|
||||
threadContext->startCallback(threadContext);
|
||||
}
|
||||
|
||||
core->reset(core);
|
||||
_changeState(threadContext->impl, THREAD_RUNNING, true);
|
||||
|
||||
if (threadContext->resetCallback) {
|
||||
threadContext->resetCallback(threadContext);
|
||||
}
|
||||
|
|
|
@ -66,10 +66,6 @@ CoreController::CoreController(mCore* core, QObject* parent)
|
|||
controller->m_override->apply(context->core);
|
||||
}
|
||||
|
||||
if (mCoreLoadState(context->core, 0, controller->m_loadStateFlags)) {
|
||||
mCoreDeleteState(context->core, 0);
|
||||
}
|
||||
|
||||
if (controller->m_multiplayer) {
|
||||
controller->m_multiplayer->attachGame(controller);
|
||||
}
|
||||
|
@ -82,6 +78,11 @@ CoreController::CoreController(mCore* core, QObject* parent)
|
|||
for (auto action : controller->m_resetActions) {
|
||||
action();
|
||||
}
|
||||
|
||||
if (mCoreLoadState(context->core, 0, controller->m_loadStateFlags)) {
|
||||
mCoreDeleteState(context->core, 0);
|
||||
}
|
||||
|
||||
controller->m_resetActions.clear();
|
||||
|
||||
QSize size = controller->screenDimensions();
|
||||
|
|
Loading…
Reference in New Issue