From 8e80d2f8a43e34a82931e25143b279e5fbcfaedc Mon Sep 17 00:00:00 2001 From: byuu <2107894+byuu@users.noreply.github.com> Date: Tue, 3 Mar 2020 19:56:48 +0900 Subject: [PATCH] v115 --- CREDITS.md | 2 +- bsnes/emulator/emulator.hpp | 4 ++-- bsnes/target-bsnes/input/hotkeys.cpp | 7 +++---- bsnes/target-bsnes/program/rewind.cpp | 24 ++++++++++++------------ 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/CREDITS.md b/CREDITS.md index f64c48e8b..fd658f9af 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -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 diff --git a/bsnes/emulator/emulator.hpp b/bsnes/emulator/emulator.hpp index 69d4d72dd..cb1729697 100644 --- a/bsnes/emulator/emulator.hpp +++ b/bsnes/emulator/emulator.hpp @@ -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 { diff --git a/bsnes/target-bsnes/input/hotkeys.cpp b/bsnes/target-bsnes/input/hotkeys.cpp index 707749108..3d8856b9e 100644 --- a/bsnes/target-bsnes/input/hotkeys.cpp +++ b/bsnes/target-bsnes/input/hotkeys.cpp @@ -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; diff --git a/bsnes/target-bsnes/program/rewind.cpp b/bsnes/target-bsnes/program/rewind.cpp index 827fd74aa..54760a561 100644 --- a/bsnes/target-bsnes/program/rewind.cpp +++ b/bsnes/target-bsnes/program/rewind.cpp @@ -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; - } }