all repos — mgba @ 91eb813e564f9ddd1b60dfc371b2a6c793e46e14

mGBA Game Boy Advance Emulator

Core: Remove disabling rewind affecting savedata
Vicki Pfau vi@endrift.com
Mon, 17 Sep 2018 12:48:56 -0700
commit

91eb813e564f9ddd1b60dfc371b2a6c793e46e14

parent

0d25e8079172aee82958ce4babf3e0ef470200fb

M include/mgba/core/rewind.hinclude/mgba/core/rewind.h

@@ -22,7 +22,6 @@ struct mCoreRewindContext {

struct mCoreRewindPatches patchMemory; size_t current; size_t size; - int stateFlags; struct VFile* previousState; struct VFile* currentState;
M src/core/rewind.csrc/core/rewind.c

@@ -30,7 +30,6 @@ }

context->previousState = VFileMemChunk(0, 0); context->currentState = VFileMemChunk(0, 0); context->size = 0; - context->stateFlags = SAVESTATE_SAVEDATA; #ifndef DISABLE_THREADING context->onThread = onThread; context->ready = false;

@@ -77,7 +76,7 @@ MutexLock(&context->mutex);

} #endif struct VFile* nextState = context->previousState; - mCoreSaveStateNamed(core, nextState, context->stateFlags); + mCoreSaveStateNamed(core, nextState, SAVESTATE_SAVEDATA | SAVESTATE_RTC); context->previousState = context->currentState; context->currentState = nextState; #ifndef DISABLE_THREADING

@@ -131,7 +130,7 @@ return false;

} --context->size; - mCoreLoadStateNamed(core, context->previousState, context->stateFlags); + mCoreLoadStateNamed(core, context->previousState, SAVESTATE_SAVEDATA | SAVESTATE_RTC); if (context->current == 0) { context->current = mCoreRewindPatchesSize(&context->patchMemory); }
M src/core/thread.csrc/core/thread.c

@@ -594,7 +594,6 @@ void mCoreThreadRewindParamsChanged(struct mCoreThread* threadContext) {

struct mCore* core = threadContext->core; if (core->opts.rewindEnable && core->opts.rewindBufferCapacity > 0) { mCoreRewindContextInit(&threadContext->impl->rewind, core->opts.rewindBufferCapacity, true); - threadContext->impl->rewind.stateFlags = core->opts.rewindSave ? SAVESTATE_SAVEDATA : 0; } else { mCoreRewindContextDeinit(&threadContext->impl->rewind); }
M src/platform/qt/ConfigController.cppsrc/platform/qt/ConfigController.cpp

@@ -107,7 +107,6 @@ m_opts.volume = 0x100;

m_opts.logLevel = mLOG_WARN | mLOG_ERROR | mLOG_FATAL; m_opts.rewindEnable = false; m_opts.rewindBufferCapacity = 300; - m_opts.rewindSave = true; m_opts.useBios = true; m_opts.suspendScreensaver = true; m_opts.lockAspectRatio = true;
M src/platform/qt/SettingsView.cppsrc/platform/qt/SettingsView.cpp

@@ -341,7 +341,6 @@ saveSetting("volume", m_ui.volume);

saveSetting("mute", m_ui.mute); saveSetting("rewindEnable", m_ui.rewind); saveSetting("rewindBufferCapacity", m_ui.rewindCapacity); - saveSetting("rewindSave", m_ui.rewindSave); saveSetting("resampleVideo", m_ui.resampleVideo); saveSetting("allowOpposingDirections", m_ui.allowOpposingDirections); saveSetting("suspendScreensaver", m_ui.suspendScreensaver);

@@ -465,7 +464,6 @@ loadSetting("volume", m_ui.volume);

loadSetting("mute", m_ui.mute); loadSetting("rewindEnable", m_ui.rewind); loadSetting("rewindBufferCapacity", m_ui.rewindCapacity); - loadSetting("rewindSave", m_ui.rewindSave); loadSetting("resampleVideo", m_ui.resampleVideo); loadSetting("allowOpposingDirections", m_ui.allowOpposingDirections); loadSetting("suspendScreensaver", m_ui.suspendScreensaver);
M src/platform/qt/SettingsView.uisrc/platform/qt/SettingsView.ui

@@ -612,6 +612,23 @@ </widget>

</item> </layout> </item> + <item row="1" column="0"> + <widget class="QLabel" name="label_31"> + <property name="text"> + <string>Autofire interval:</string> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QSpinBox" name="autofireThreshold"> + <property name="minimum"> + <number>1</number> + </property> + <property name="maximum"> + <number>60</number> + </property> + </widget> + </item> <item row="2" column="0" colspan="2"> <widget class="Line" name="line"> <property name="orientation">

@@ -651,21 +668,21 @@ </widget>

</item> </layout> </item> - <item row="6" column="0" colspan="2"> + <item row="5" column="0" colspan="2"> <widget class="Line" name="line_3"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> </widget> </item> - <item row="7" column="0"> + <item row="6" column="0"> <widget class="QLabel" name="label_15"> <property name="text"> <string>Idle loops:</string> </property> </widget> </item> - <item row="7" column="1"> + <item row="6" column="1"> <widget class="QComboBox" name="idleOptimization"> <item> <property name="text">

@@ -684,21 +701,28 @@ </property>

</item> </widget> </item> - <item row="9" column="0" colspan="2"> + <item row="7" column="1"> + <widget class="QCheckBox" name="preload"> + <property name="text"> + <string>Preload entire ROM into memory</string> + </property> + </widget> + </item> + <item row="8" column="0" colspan="2"> <widget class="Line" name="line_2"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> </widget> </item> - <item row="10" column="0"> + <item row="9" column="0"> <widget class="QLabel" name="label_24"> <property name="text"> <string>Savestate extra data:</string> </property> </widget> </item> - <item row="10" column="1"> + <item row="9" column="1"> <widget class="QCheckBox" name="saveStateScreenshot"> <property name="text"> <string>Screenshot</string>

@@ -708,7 +732,7 @@ <bool>true</bool>

</property> </widget> </item> - <item row="11" column="1"> + <item row="10" column="1"> <widget class="QCheckBox" name="saveStateSave"> <property name="text"> <string>Save data</string>

@@ -718,7 +742,7 @@ <bool>true</bool>

</property> </widget> </item> - <item row="12" column="1"> + <item row="11" column="1"> <widget class="QCheckBox" name="saveStateCheats"> <property name="text"> <string>Cheat codes</string>

@@ -728,14 +752,21 @@ <bool>true</bool>

</property> </widget> </item> - <item row="14" column="0"> + <item row="12" column="0" colspan="2"> + <widget class="Line" name="line_9"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + </widget> + </item> + <item row="13" column="0"> <widget class="QLabel" name="label_25"> <property name="text"> <string>Load extra data:</string> </property> </widget> </item> - <item row="14" column="1"> + <item row="13" column="1"> <widget class="QCheckBox" name="loadStateScreenshot"> <property name="text"> <string>Screenshot</string>

@@ -745,58 +776,17 @@ <bool>true</bool>

</property> </widget> </item> - <item row="15" column="1"> + <item row="14" column="1"> <widget class="QCheckBox" name="loadStateSave"> <property name="text"> <string>Save data</string> </property> </widget> </item> - <item row="16" column="1"> + <item row="15" column="1"> <widget class="QCheckBox" name="loadStateCheats"> <property name="text"> <string>Cheat codes</string> - </property> - </widget> - </item> - <item row="13" column="0" colspan="2"> - <widget class="Line" name="line_9"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item row="5" column="1"> - <widget class="QCheckBox" name="rewindSave"> - <property name="text"> - <string>Rewind affects save data</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - </widget> - </item> - <item row="8" column="1"> - <widget class="QCheckBox" name="preload"> - <property name="text"> - <string>Preload entire ROM into memory</string> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="label_31"> - <property name="text"> - <string>Autofire interval:</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QSpinBox" name="autofireThreshold"> - <property name="minimum"> - <number>1</number> - </property> - <property name="maximum"> - <number>60</number> </property> </widget> </item>
M src/platform/qt/Window.cppsrc/platform/qt/Window.cpp

@@ -1620,11 +1620,6 @@ rewindBufferCapacity->connect([this](const QVariant& value) {

reloadConfig(); }, this); - ConfigOption* rewindSave = m_config->addOption("rewindSave"); - rewindBufferCapacity->connect([this](const QVariant& value) { - reloadConfig(); - }, this); - ConfigOption* allowOpposingDirections = m_config->addOption("allowOpposingDirections"); allowOpposingDirections->connect([this](const QVariant& value) { reloadConfig();