all repos — mgba @ 41e00148bfa2e75ee72505030f4fd91fe5c13cfb

mGBA Game Boy Advance Emulator

Core: Change thread startCallback semantics to before reset
Vicki Pfau vi@endrift.com
Fri, 04 Aug 2017 08:17:35 -0700
commit

41e00148bfa2e75ee72505030f4fd91fe5c13cfb

parent

1a749240239d58eab801825eb5d43be19290b90d

2 files changed, 9 insertions(+), 8 deletions(-)

jump to
M src/core/thread.csrc/core/thread.c

@@ -158,7 +158,6 @@ .context = threadContext

}; 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 @@ mLogFilterLoad(threadContext->logger.d.filter, &core->config);

} mCoreThreadRewindParamsChanged(threadContext); + if (threadContext->startCallback) { + threadContext->startCallback(threadContext); + } + core->reset(core); _changeState(threadContext->impl, THREAD_RUNNING, true); - if (threadContext->startCallback) { - threadContext->startCallback(threadContext); - } if (threadContext->resetCallback) { threadContext->resetCallback(threadContext); }
M src/platform/qt/CoreController.cppsrc/platform/qt/CoreController.cpp

@@ -66,10 +66,6 @@ controller->m_override->identify(context->core);

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* controller = static_cast<CoreController*>(context->userData);

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();