all repos — mgba @ d8c773bbf74c0a5b54c113105b0bf7b82065bb48

mGBA Game Boy Advance Emulator

Qt: Restore reconfiguring rewind
Jeffrey Pfau jeffrey@endrift.com
Sun, 11 Sep 2016 00:51:50 -0700
commit

d8c773bbf74c0a5b54c113105b0bf7b82065bb48

parent

f34f45257a6c52ea2e96e8ba75e8f7bfe8d5e245

1 files changed, 10 insertions(+), 3 deletions(-)

jump to
M src/platform/qt/GameController.cppsrc/platform/qt/GameController.cpp

@@ -659,10 +659,14 @@

void GameController::setRewind(bool enable, int capacity) { if (m_gameOpen) { threadInterrupt(); - // TODO: Put back rewind + if (m_threadContext.core->opts.rewindEnable) { + mCoreRewindContextDeinit(&m_threadContext.rewind); + } + m_threadContext.core->opts.rewindEnable = enable; + if (enable) { + mCoreRewindContextInit(&m_threadContext.rewind, capacity); + } threadContinue(); - } else { - // TODO: Put back rewind } }

@@ -683,6 +687,9 @@ }

void GameController::startRewinding() { if (!isLoaded()) { + return; + } + if (!m_threadContext.core->opts.rewindEnable) { return; } if (m_multiplayer && m_multiplayer->attached() > 1) {