Skip to content

Commit

Permalink
Release 1.97
Browse files Browse the repository at this point in the history
  • Loading branch information
stuerp committed Jun 11, 2024
1 parent a6c485e commit f57b70e
Show file tree
Hide file tree
Showing 66 changed files with 487 additions and 574 deletions.
9 changes: 9 additions & 0 deletions 3rdParty/libsidplayfp/NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
2.8.0 2024-06-09
* Optimized event scheduler (#131)
* Stop pretendig we support pre-c++11 compilers (#130)
* Fixed thread unsafety for psid_driver (#132)
* residfp: do not cache resampling tables (#91)
* resid/residfp: tuned oscillator leakage



2.7.1 2024-05-19
* Sync resid with upstream
* Make strong CWs the default (#127)
Expand Down
2 changes: 1 addition & 1 deletion 3rdParty/libsidplayfp/README
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ enabled by default
enable branch hints in reSID engine so the compiler can produce more optimized code
enabled by default

--with-simd=<sse2/mmx/neon/none>
--with-simd=<sse4/neon/none>
enable SIMD code in reSIDfp that might increase resampling performance.
Be aware that this is processor specific and the compiler could actually produce
more optimized code with the appropriate flags. Use only if you know what you're doing.
Expand Down
15 changes: 7 additions & 8 deletions 3rdParty/libsidplayfp/configure.ac
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
m4_define([lib_major], [2])
m4_define([lib_minor], [7])
m4_define([lib_level], [1])
m4_define([lib_minor], [8])
m4_define([lib_level], [0])
m4_define([lib_version], [lib_major.lib_minor.lib_level])

AC_PREREQ([2.62])
Expand Down Expand Up @@ -41,7 +41,7 @@ AX_CXX_COMPILE_STDCXX_17([noext], [optional])
AS_IF([test $ax_cv_cxx_compile_cxx17__std_cpp17 != "yes"], [
AX_CXX_COMPILE_STDCXX_14([noext], [optional])
AS_IF([test $ax_cv_cxx_compile_cxx14__std_cpp14 != "yes"],
AX_CXX_COMPILE_STDCXX_11([noext], [optional])
[AX_CXX_COMPILE_STDCXX_11([noext], [mandatory])]
)
])

Expand Down Expand Up @@ -101,12 +101,12 @@ dnl libtool-style version-info number
# Increase the age value only if the changes made to the ABI are backward compatible.

LIBSIDPLAYCUR=10
LIBSIDPLAYREV=31
LIBSIDPLAYREV=32
LIBSIDPLAYAGE=4
LIBSIDPLAYVERSION=$LIBSIDPLAYCUR:$LIBSIDPLAYREV:$LIBSIDPLAYAGE

LIBSTILVIEWCUR=0
LIBSTILVIEWREV=4
LIBSTILVIEWREV=5
LIBSTILVIEWAGE=0
LIBSTILVIEWVERSION=$LIBSTILVIEWCUR:$LIBSTILVIEWREV:$LIBSTILVIEWAGE

Expand Down Expand Up @@ -142,7 +142,7 @@ AS_IF([test x"$enable_inline" != "xno"],

AC_ARG_WITH(
[simd],
[AS_HELP_STRING([--with-simd], [Build with SIMD optimizations [@<:@sse2/mmx/neon/none, default=none@:>@]])],
[AS_HELP_STRING([--with-simd], [Build with SIMD optimizations [@<:@sse4/neon/none, default=none@:>@]])],
[],
[with_simd=none]
)
Expand All @@ -157,8 +157,7 @@ AS_IF([test x"$with_simd" != xnone],
CPPFLAGS="$CPPFLAGS $CXXFLAGS"
AS_CASE([$with_simd],
[sse2], [AC_CHECK_HEADERS([emmintrin.h])],
[mmx], [AC_CHECK_HEADERS([mmintrin.h])],
[sse4], [AC_CHECK_HEADERS([smmintrin.h])],
[neon], [AC_CHECK_HEADERS([arm_neon.h])],
[AC_MSG_ERROR([Unrecognized SIMD specified])]
)
Expand Down
2 changes: 1 addition & 1 deletion 3rdParty/libsidplayfp/src/Event.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class Event
const char* name() const { return m_name; }

protected:
~Event() {}
~Event() = default;
};

}
Expand Down
16 changes: 16 additions & 0 deletions 3rdParty/libsidplayfp/src/EventCallback.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,22 @@ class EventCallback final : public Event
{}
};

template< class This, void(This::*Callback)() >
class FastEventCallback final : public Event
{
private:
This &m_this;

private:
void event() override { (m_this.*Callback)(); }

public:
FastEventCallback(const char* const name, This &object) :
Event(name),
m_this(object)
{}
};

}

#endif // EVENTCALLBACK_H
4 changes: 2 additions & 2 deletions 3rdParty/libsidplayfp/src/SidInfoImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ class SidInfoImpl final : public SidInfo

private:
// prevent copying
SidInfoImpl(const SidInfoImpl&);
SidInfoImpl& operator=(SidInfoImpl&);
SidInfoImpl(const SidInfoImpl&) = delete;
SidInfoImpl& operator=(SidInfoImpl&) = delete;

public:
SidInfoImpl() :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
* *
***************************************************************************/

#include <stdio.h>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <string>
#include <memory>
#include <sstream>
#include <algorithm>
#include <new>
#include <sstream>
#include <string>

#include "exsid.h"
#include "exsid-emu.h"
Expand Down Expand Up @@ -102,8 +102,8 @@ const char *exSIDBuilder::credits() const

void exSIDBuilder::flush()
{
for (emuset_t::iterator it=sidobjs.begin(); it != sidobjs.end(); ++it)
static_cast<libsidplayfp::exSID*>(*it)->flush();
for (auto sidobj : sidobjs)
static_cast<libsidplayfp::exSID*>(sidobj)->flush();
}

void exSIDBuilder::filter (bool enable)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@

#include "exsid-emu.h"

#include <cstdio>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <sstream>
#include <unistd.h>

#ifdef HAVE_EXSID
# include <exSID.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class exSID final : public sidemu

public:
exSID(sidbuilder *builder);
~exSID();
~exSID() override;

bool getStatus() const { return m_status; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class ReSID final : public sidemu

public:
ReSID(sidbuilder *builder);
~ReSID();
~ReSID() override;

bool getStatus() const { return m_status; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class ReSIDfp final : public sidemu

public:
ReSIDfp(sidbuilder *builder);
~ReSIDfp();
~ReSIDfp() override;

bool getStatus() const { return m_status; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@
namespace reSIDfp
{

constexpr double MOSFET_LEAKAGE_6581 = 0.0075;
constexpr double MOSFET_LEAKAGE_8580 = 0.0035;

Dac::Dac(unsigned int bits) :
leakage(0.0075),
dac(new double[bits]),
dacLength(bits)
{}
Expand Down Expand Up @@ -61,6 +63,8 @@ void Dac::kinkedDac(ChipModel chipModel)
// 6581 DACs are not terminated by a 2R resistor
const bool term = chipModel == MOS8580;

leakage = chipModel == MOS6581 ? MOSFET_LEAKAGE_6581 : MOSFET_LEAKAGE_8580;

double Vsum = 0.;

// Calculate voltage contribution by each individual bit in the R-2R ladder.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class Dac
*
* https://en.wikipedia.org/wiki/Subthreshold_conduction
*/
double const leakage;
double leakage;

/// analog values
double * const dac;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ void EnvelopeGenerator::reset()
exponential_counter_period = 1;
new_exponential_counter_period = 0;

state = RELEASE;
state = State::RELEASE;
counter_enabled = true;
rate = adsrtable[release];
}
Expand All @@ -98,7 +98,7 @@ void EnvelopeGenerator::writeCONTROL_REG(unsigned char control)
if (gate_next)
{
// Gate bit on: Start attack, decay, sustain.
next_state = ATTACK;
next_state = State::ATTACK;
state_pipeline = 2;

if (resetLfsr || (exponential_pipeline == 2))
Expand All @@ -113,7 +113,7 @@ void EnvelopeGenerator::writeCONTROL_REG(unsigned char control)
else
{
// Gate bit off: Start release.
next_state = RELEASE;
next_state = State::RELEASE;
state_pipeline = envelope_pipeline > 0 ? 3 : 2;
}
}
Expand All @@ -124,11 +124,11 @@ void EnvelopeGenerator::writeATTACK_DECAY(unsigned char attack_decay)
attack = (attack_decay >> 4) & 0x0f;
decay = attack_decay & 0x0f;

if (state == ATTACK)
if (state == State::ATTACK)
{
rate = adsrtable[attack];
}
else if (state == DECAY_SUSTAIN)
else if (state == State::DECAY_SUSTAIN)
{
rate = adsrtable[decay];
}
Expand All @@ -146,7 +146,7 @@ void EnvelopeGenerator::writeSUSTAIN_RELEASE(unsigned char sustain_release)

release = sustain_release & 0x0f;

if (state == RELEASE)
if (state == State::RELEASE)
{
rate = adsrtable[release];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class EnvelopeGenerator
* The envelope state machine's distinct states. In addition to this,
* envelope has a hold mode, which freezes envelope counter to zero.
*/
enum State
enum class State
{
ATTACK, DECAY_SUSTAIN, RELEASE
};
Expand Down Expand Up @@ -141,8 +141,8 @@ class EnvelopeGenerator
state_pipeline(0),
envelope_pipeline(0),
exponential_pipeline(0),
state(RELEASE),
next_state(RELEASE),
state(State::RELEASE),
next_state(State::RELEASE),
counter_enabled(true),
gate(false),
resetLfsr(false),
Expand Down Expand Up @@ -218,15 +218,15 @@ void EnvelopeGenerator::clock()
{
if (likely(counter_enabled))
{
if (state == ATTACK)
if (state == State::ATTACK)
{
if (++envelope_counter==0xff)
{
next_state = DECAY_SUSTAIN;
next_state = State::DECAY_SUSTAIN;
state_pipeline = 3;
}
}
else if ((state == DECAY_SUSTAIN) || (state == RELEASE))
else if ((state == State::DECAY_SUSTAIN) || (state == State::RELEASE))
{
if (--envelope_counter==0x00)
{
Expand All @@ -241,8 +241,8 @@ void EnvelopeGenerator::clock()
{
exponential_counter = 0;

if (((state == DECAY_SUSTAIN) && (envelope_counter != sustain))
|| (state == RELEASE))
if (((state == State::DECAY_SUSTAIN) && (envelope_counter != sustain))
|| (state == State::RELEASE))
{
// The envelope counter can flip from 0x00 to 0xff by changing state to
// attack, then to release. The envelope counter will then continue
Expand All @@ -257,7 +257,7 @@ void EnvelopeGenerator::clock()
lfsr = 0x7fff;
resetLfsr = false;

if (state == ATTACK)
if (state == State::ATTACK)
{
// The first envelope step in the attack state also resets the exponential
// counter. This has been verified by sampling ENV3.
Expand Down Expand Up @@ -344,32 +344,32 @@ void EnvelopeGenerator::state_change()

switch (next_state)
{
case ATTACK:
case State::ATTACK:
if (state_pipeline == 1)
{
// The decay rate is "accidentally" enabled during first cycle of attack phase
rate = adsrtable[decay];
}
else if (state_pipeline == 0)
{
state = ATTACK;
state = State::ATTACK;
// The attack rate is correctly enabled during second cycle of attack phase
rate = adsrtable[attack];
counter_enabled = true;
}
break;
case DECAY_SUSTAIN:
case State::DECAY_SUSTAIN:
if (state_pipeline == 0)
{
state = DECAY_SUSTAIN;
state = State::DECAY_SUSTAIN;
rate = adsrtable[decay];
}
break;
case RELEASE:
if (((state == ATTACK) && (state_pipeline == 0))
|| ((state == DECAY_SUSTAIN) && (state_pipeline == 1)))
case State::RELEASE:
if (((state == State::ATTACK) && (state_pipeline == 0))
|| ((state == State::DECAY_SUSTAIN) && (state_pipeline == 1)))
{
state = RELEASE;
state = State::RELEASE;
rate = adsrtable[release];
}
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ class Filter6581 final : public Filter
f0_dac(FilterModelConfig6581::getInstance()->getDAC(0.5))
{}

~Filter6581();
~Filter6581() override;

/**
* Set filter curve type based on single parameter.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace reSIDfp
*/
const double DAC_WL0 = 0.00615;

Filter8580::~Filter8580() {}
Filter8580::~Filter8580() = default;

void Filter8580::updateCenterFrequency()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ class Filter8580 final : public Filter
setFilterCurve(0.5);
}

~Filter8580();
~Filter8580() override;

/**
* Set filter curve type based on single parameter.
Expand Down
Loading

0 comments on commit f57b70e

Please sign in to comment.