Skip to content

Commit

Permalink
v115
Browse files Browse the repository at this point in the history
  • Loading branch information
byuu committed Mar 3, 2020
1 parent bd1759e commit 8e80d2f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 19 deletions.
2 changes: 1 addition & 1 deletion CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions bsnes/emulator/emulator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
7 changes: 3 additions & 4 deletions bsnes/target-bsnes/input/hotkeys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
24 changes: 12 additions & 12 deletions bsnes/target-bsnes/program/rewind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
}

0 comments on commit 8e80d2f

Please sign in to comment.