Commit 8e80d2f8 authored by byuu's avatar byuu
Browse files

v115

parent bd1759eb
......@@ -28,8 +28,8 @@ This software would not be where it is today without the help and support of the
- Lioncash
- Lord Nightmare
- lowkey
- Max833
- Matthew Callis
- Max833
- MerryMage
- mightymo
- Nach
......
......@@ -29,13 +29,13 @@ using namespace nall;
namespace Emulator {
static const string Name = "bsnes";
static const string Version = "114.6";
static const string Version = "115";
static const string Copyright = "byuu";
static const string License = "GPLv3";
static const string Website = "https://byuu.org";
//incremented only when serialization format changes
static const string SerializerVersion = "114.2";
static const string SerializerVersion = "115";
namespace Constants {
namespace Colorburst {
......
......@@ -31,12 +31,11 @@ auto InputManager::bindHotkeys() -> void {
hotkeys.append(InputHotkey("Rewind").onPress([&] {
if(!emulator->loaded() || program.fastForwarding) return;
program.rewinding = true;
if(program.rewind.frequency == 0) {
program.showMessage("Please enable rewind support in Settings->Emulator first");
} else {
program.rewindMode(Program::Rewind::Mode::Rewinding);
return program.showMessage("Please enable rewind support in Settings->Emulator first");
}
program.rewinding = true;
program.rewindMode(Program::Rewind::Mode::Rewinding);
volume = Emulator::audio.volume();
if(settings.rewind.mute) {
program.mute |= Program::Mute::Rewind;
......
......@@ -13,6 +13,18 @@ auto Program::rewindReset() -> void {
auto Program::rewindRun() -> void {
if(rewind.frequency == 0) return; //rewind disabled?
if(rewind.mode == Rewind::Mode::Playing) {
if(++rewind.counter < rewind.frequency) return;
rewind.counter = 0;
if(rewind.history.size() >= rewind.length) {
rewind.history.takeFirst();
}
auto s = emulator->serialize(0);
rewind.history.append(s);
return;
}
if(rewind.mode == Rewind::Mode::Rewinding) {
if(rewind.history.size() == 0) return rewindMode(Rewind::Mode::Playing); //nothing left to rewind?
if(++rewind.counter < rewind.frequency / 4) return;
......@@ -27,16 +39,4 @@ auto Program::rewindRun() -> void {
emulator->unserialize(s);
return;
}
if(rewind.mode == Rewind::Mode::Playing) {
if(++rewind.counter < rewind.frequency) return;
rewind.counter = 0;
if(rewind.history.size() >= rewind.length) {
rewind.history.takeFirst();
}
auto s = emulator->serialize(0);
rewind.history.append(s);
return;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment