Added fully working deterministic save state support (non-portable.)
Rewind is now 100% deterministic, disk save states are still portable.
Added run-ahead support.
This commit is contained in:
byuu
2019-10-15 22:12:10 +09:00
parent a32b6fae74
commit 19f3cdfd5e
23 changed files with 174 additions and 35 deletions

View File

@@ -1,6 +1,7 @@
#pragma once
#include <nall/queue.hpp>
#include <nall/serializer.hpp>
#include <nall/dsp/dsp.hpp>
namespace nall::DSP::Resampler {
@@ -11,6 +12,7 @@ struct Cubic {
inline auto pending() const -> uint;
inline auto read() -> double;
inline auto write(double sample) -> void;
inline auto serialize(serializer&) -> void;
private:
double inputFrequency;
@@ -67,4 +69,13 @@ auto Cubic::write(double sample) -> void {
mu -= 1.0;
}
auto Cubic::serialize(serializer& s) -> void {
s.real(inputFrequency);
s.real(outputFrequency);
s.real(ratio);
s.real(fraction);
s.array(history);
samples.serialize(s);
}
}