mirror of https://github.com/mgba-emu/mgba.git
Core: Remove disabling rewind affecting savedata
This commit is contained in:
parent
0d25e80791
commit
91eb813e56
|
@ -22,7 +22,6 @@ struct mCoreRewindContext {
|
||||||
struct mCoreRewindPatches patchMemory;
|
struct mCoreRewindPatches patchMemory;
|
||||||
size_t current;
|
size_t current;
|
||||||
size_t size;
|
size_t size;
|
||||||
int stateFlags;
|
|
||||||
struct VFile* previousState;
|
struct VFile* previousState;
|
||||||
struct VFile* currentState;
|
struct VFile* currentState;
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,6 @@ void mCoreRewindContextInit(struct mCoreRewindContext* context, size_t entries,
|
||||||
context->previousState = VFileMemChunk(0, 0);
|
context->previousState = VFileMemChunk(0, 0);
|
||||||
context->currentState = VFileMemChunk(0, 0);
|
context->currentState = VFileMemChunk(0, 0);
|
||||||
context->size = 0;
|
context->size = 0;
|
||||||
context->stateFlags = SAVESTATE_SAVEDATA;
|
|
||||||
#ifndef DISABLE_THREADING
|
#ifndef DISABLE_THREADING
|
||||||
context->onThread = onThread;
|
context->onThread = onThread;
|
||||||
context->ready = false;
|
context->ready = false;
|
||||||
|
@ -77,7 +76,7 @@ void mCoreRewindAppend(struct mCoreRewindContext* context, struct mCore* core) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
struct VFile* nextState = context->previousState;
|
struct VFile* nextState = context->previousState;
|
||||||
mCoreSaveStateNamed(core, nextState, context->stateFlags);
|
mCoreSaveStateNamed(core, nextState, SAVESTATE_SAVEDATA | SAVESTATE_RTC);
|
||||||
context->previousState = context->currentState;
|
context->previousState = context->currentState;
|
||||||
context->currentState = nextState;
|
context->currentState = nextState;
|
||||||
#ifndef DISABLE_THREADING
|
#ifndef DISABLE_THREADING
|
||||||
|
@ -131,7 +130,7 @@ bool mCoreRewindRestore(struct mCoreRewindContext* context, struct mCore* core)
|
||||||
}
|
}
|
||||||
--context->size;
|
--context->size;
|
||||||
|
|
||||||
mCoreLoadStateNamed(core, context->previousState, context->stateFlags);
|
mCoreLoadStateNamed(core, context->previousState, SAVESTATE_SAVEDATA | SAVESTATE_RTC);
|
||||||
if (context->current == 0) {
|
if (context->current == 0) {
|
||||||
context->current = mCoreRewindPatchesSize(&context->patchMemory);
|
context->current = mCoreRewindPatchesSize(&context->patchMemory);
|
||||||
}
|
}
|
||||||
|
|
|
@ -594,7 +594,6 @@ void mCoreThreadRewindParamsChanged(struct mCoreThread* threadContext) {
|
||||||
struct mCore* core = threadContext->core;
|
struct mCore* core = threadContext->core;
|
||||||
if (core->opts.rewindEnable && core->opts.rewindBufferCapacity > 0) {
|
if (core->opts.rewindEnable && core->opts.rewindBufferCapacity > 0) {
|
||||||
mCoreRewindContextInit(&threadContext->impl->rewind, core->opts.rewindBufferCapacity, true);
|
mCoreRewindContextInit(&threadContext->impl->rewind, core->opts.rewindBufferCapacity, true);
|
||||||
threadContext->impl->rewind.stateFlags = core->opts.rewindSave ? SAVESTATE_SAVEDATA : 0;
|
|
||||||
} else {
|
} else {
|
||||||
mCoreRewindContextDeinit(&threadContext->impl->rewind);
|
mCoreRewindContextDeinit(&threadContext->impl->rewind);
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,7 +107,6 @@ ConfigController::ConfigController(QObject* parent)
|
||||||
m_opts.logLevel = mLOG_WARN | mLOG_ERROR | mLOG_FATAL;
|
m_opts.logLevel = mLOG_WARN | mLOG_ERROR | mLOG_FATAL;
|
||||||
m_opts.rewindEnable = false;
|
m_opts.rewindEnable = false;
|
||||||
m_opts.rewindBufferCapacity = 300;
|
m_opts.rewindBufferCapacity = 300;
|
||||||
m_opts.rewindSave = true;
|
|
||||||
m_opts.useBios = true;
|
m_opts.useBios = true;
|
||||||
m_opts.suspendScreensaver = true;
|
m_opts.suspendScreensaver = true;
|
||||||
m_opts.lockAspectRatio = true;
|
m_opts.lockAspectRatio = true;
|
||||||
|
|
|
@ -341,7 +341,6 @@ void SettingsView::updateConfig() {
|
||||||
saveSetting("mute", m_ui.mute);
|
saveSetting("mute", m_ui.mute);
|
||||||
saveSetting("rewindEnable", m_ui.rewind);
|
saveSetting("rewindEnable", m_ui.rewind);
|
||||||
saveSetting("rewindBufferCapacity", m_ui.rewindCapacity);
|
saveSetting("rewindBufferCapacity", m_ui.rewindCapacity);
|
||||||
saveSetting("rewindSave", m_ui.rewindSave);
|
|
||||||
saveSetting("resampleVideo", m_ui.resampleVideo);
|
saveSetting("resampleVideo", m_ui.resampleVideo);
|
||||||
saveSetting("allowOpposingDirections", m_ui.allowOpposingDirections);
|
saveSetting("allowOpposingDirections", m_ui.allowOpposingDirections);
|
||||||
saveSetting("suspendScreensaver", m_ui.suspendScreensaver);
|
saveSetting("suspendScreensaver", m_ui.suspendScreensaver);
|
||||||
|
@ -465,7 +464,6 @@ void SettingsView::reloadConfig() {
|
||||||
loadSetting("mute", m_ui.mute);
|
loadSetting("mute", m_ui.mute);
|
||||||
loadSetting("rewindEnable", m_ui.rewind);
|
loadSetting("rewindEnable", m_ui.rewind);
|
||||||
loadSetting("rewindBufferCapacity", m_ui.rewindCapacity);
|
loadSetting("rewindBufferCapacity", m_ui.rewindCapacity);
|
||||||
loadSetting("rewindSave", m_ui.rewindSave);
|
|
||||||
loadSetting("resampleVideo", m_ui.resampleVideo);
|
loadSetting("resampleVideo", m_ui.resampleVideo);
|
||||||
loadSetting("allowOpposingDirections", m_ui.allowOpposingDirections);
|
loadSetting("allowOpposingDirections", m_ui.allowOpposingDirections);
|
||||||
loadSetting("suspendScreensaver", m_ui.suspendScreensaver);
|
loadSetting("suspendScreensaver", m_ui.suspendScreensaver);
|
||||||
|
|
|
@ -612,6 +612,23 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</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">
|
<item row="2" column="0" colspan="2">
|
||||||
<widget class="Line" name="line">
|
<widget class="Line" name="line">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
@ -651,21 +668,21 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="0" colspan="2">
|
<item row="5" column="0" colspan="2">
|
||||||
<widget class="Line" name="line_3">
|
<widget class="Line" name="line_3">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="0">
|
<item row="6" column="0">
|
||||||
<widget class="QLabel" name="label_15">
|
<widget class="QLabel" name="label_15">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Idle loops:</string>
|
<string>Idle loops:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="1">
|
<item row="6" column="1">
|
||||||
<widget class="QComboBox" name="idleOptimization">
|
<widget class="QComboBox" name="idleOptimization">
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -684,21 +701,28 @@
|
||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</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">
|
<widget class="Line" name="line_2">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="10" column="0">
|
<item row="9" column="0">
|
||||||
<widget class="QLabel" name="label_24">
|
<widget class="QLabel" name="label_24">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Savestate extra data:</string>
|
<string>Savestate extra data:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="10" column="1">
|
<item row="9" column="1">
|
||||||
<widget class="QCheckBox" name="saveStateScreenshot">
|
<widget class="QCheckBox" name="saveStateScreenshot">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Screenshot</string>
|
<string>Screenshot</string>
|
||||||
|
@ -708,7 +732,7 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="11" column="1">
|
<item row="10" column="1">
|
||||||
<widget class="QCheckBox" name="saveStateSave">
|
<widget class="QCheckBox" name="saveStateSave">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Save data</string>
|
<string>Save data</string>
|
||||||
|
@ -718,7 +742,7 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="12" column="1">
|
<item row="11" column="1">
|
||||||
<widget class="QCheckBox" name="saveStateCheats">
|
<widget class="QCheckBox" name="saveStateCheats">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Cheat codes</string>
|
<string>Cheat codes</string>
|
||||||
|
@ -728,14 +752,21 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</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">
|
<widget class="QLabel" name="label_25">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Load extra data:</string>
|
<string>Load extra data:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="14" column="1">
|
<item row="13" column="1">
|
||||||
<widget class="QCheckBox" name="loadStateScreenshot">
|
<widget class="QCheckBox" name="loadStateScreenshot">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Screenshot</string>
|
<string>Screenshot</string>
|
||||||
|
@ -745,61 +776,20 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="15" column="1">
|
<item row="14" column="1">
|
||||||
<widget class="QCheckBox" name="loadStateSave">
|
<widget class="QCheckBox" name="loadStateSave">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Save data</string>
|
<string>Save data</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="16" column="1">
|
<item row="15" column="1">
|
||||||
<widget class="QCheckBox" name="loadStateCheats">
|
<widget class="QCheckBox" name="loadStateCheats">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Cheat codes</string>
|
<string>Cheat codes</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</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>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="bios">
|
<widget class="QWidget" name="bios">
|
||||||
|
|
|
@ -1620,11 +1620,6 @@ void Window::setupMenu(QMenuBar* menubar) {
|
||||||
reloadConfig();
|
reloadConfig();
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
ConfigOption* rewindSave = m_config->addOption("rewindSave");
|
|
||||||
rewindBufferCapacity->connect([this](const QVariant& value) {
|
|
||||||
reloadConfig();
|
|
||||||
}, this);
|
|
||||||
|
|
||||||
ConfigOption* allowOpposingDirections = m_config->addOption("allowOpposingDirections");
|
ConfigOption* allowOpposingDirections = m_config->addOption("allowOpposingDirections");
|
||||||
allowOpposingDirections->connect([this](const QVariant& value) {
|
allowOpposingDirections->connect([this](const QVariant& value) {
|
||||||
reloadConfig();
|
reloadConfig();
|
||||||
|
|
Loading…
Reference in New Issue