mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-09-01 03:01:59 +02:00
Update to v106r50 release.
byuu says: Changelog: - emulator/video,audio: various cleanups - emulator/audio: removed reverb effect (it breaks very badly on high-frequency systems) - emulator/audio: the Nyquist anti-aliasing lowpass filter is now generated automatically instead of set per-core - at 44.1KHz output, it's set to 22KHz; at 48KHz, it's set to 22KHz; at 96KHz, it's set to 25KHz - this filter now takes the bsnes emulation speed setting into account - all system/video.cpp files removed; inlined in System::power() and Interface::set() instead - sfc/cpu: pre-compute `HTIME` as `HTIME+1<<2` for faster comparisons of HIRQs - sfc/cpu: re-add check to block IRQs on the last dot of each frame (minor speed hit) - hiro/gtk3: fixed headers for Linux compilation finally - hiro/gtk,qt: fixed settings.cpp logic so initial values are used when no settings.bml file exists - hiro/gtk: started a minor experiment to specify theming information in settings.bml files - nall/dsp: allow the precision type (double) to be overridden (to float) - nall: add some helpers for generating pre-compiled headers - it was a failure to try using them for higan, however ... - nall: add some helpers for reading fallback values from empty `Markup::Node[search]` statements Todo: - CRITICAL: a lot of my IRQ/NMI/HDMA timing tests are failing with the fast PPU ... need to figure out why - space between Emulator::video functions and Emulator::audio functions in gb/system/system.cpp - remove Audio/Reverb/Enable from settings.bml in target-bsnes
This commit is contained in:
@@ -1,26 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
#include <nall/queue.hpp>
|
||||
#include <nall/dsp/dsp.hpp>
|
||||
|
||||
namespace nall { namespace DSP { namespace Resampler {
|
||||
|
||||
struct Cubic {
|
||||
inline auto reset(double inputFrequency, double outputFrequency, uint queueSize = 0) -> void;
|
||||
inline auto reset(real inputFrequency, real outputFrequency, uint queueSize = 0) -> void;
|
||||
inline auto pending() const -> bool { return samples.pending(); }
|
||||
inline auto read() -> double { return samples.read(); }
|
||||
inline auto write(double sample) -> void;
|
||||
inline auto read() -> real { return samples.read(); }
|
||||
inline auto write(real sample) -> void;
|
||||
|
||||
private:
|
||||
double inputFrequency;
|
||||
double outputFrequency;
|
||||
real inputFrequency;
|
||||
real outputFrequency;
|
||||
|
||||
double ratio;
|
||||
double fraction;
|
||||
double history[4];
|
||||
queue<double> samples;
|
||||
real ratio;
|
||||
real fraction;
|
||||
real history[4];
|
||||
queue<real> samples;
|
||||
};
|
||||
|
||||
auto Cubic::reset(double inputFrequency, double outputFrequency, uint queueSize) -> void {
|
||||
auto Cubic::reset(real inputFrequency, real outputFrequency, uint queueSize) -> void {
|
||||
this->inputFrequency = inputFrequency;
|
||||
this->outputFrequency = outputFrequency;
|
||||
if(!queueSize) queueSize = outputFrequency * 0.02; //20ms
|
||||
@@ -31,7 +32,7 @@ auto Cubic::reset(double inputFrequency, double outputFrequency, uint queueSize)
|
||||
samples.resize(queueSize);
|
||||
}
|
||||
|
||||
auto Cubic::write(double sample) -> void {
|
||||
auto Cubic::write(real sample) -> void {
|
||||
auto& mu = fraction;
|
||||
auto& s = history;
|
||||
|
||||
@@ -41,10 +42,10 @@ auto Cubic::write(double sample) -> void {
|
||||
s[3] = sample;
|
||||
|
||||
while(mu <= 1.0) {
|
||||
double A = s[3] - s[2] - s[0] + s[1];
|
||||
double B = s[0] - s[1] - A;
|
||||
double C = s[2] - s[0];
|
||||
double D = s[1];
|
||||
real A = s[3] - s[2] - s[0] + s[1];
|
||||
real B = s[0] - s[1] - A;
|
||||
real C = s[2] - s[0];
|
||||
real D = s[1];
|
||||
|
||||
samples.write(A * mu * mu * mu + B * mu * mu + C * mu + D);
|
||||
mu += ratio;
|
||||
|
Reference in New Issue
Block a user