Skip to content

Commit

Permalink
Upgraded to libsidplayfp 2.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
stuerp committed Jun 2, 2023
1 parent 5373007 commit f9cdae1
Show file tree
Hide file tree
Showing 53 changed files with 938 additions and 577 deletions.
2 changes: 2 additions & 0 deletions 3rdParty/libsidplayfp/.github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ jobs:
run: |
export HOMEBREW_NO_INSTALL_CLEANUP=1
brew update
brew upgrade || true
brew install \
autoconf \
automake \
pkg-config \
coreutils \
gnu-sed \
libgcrypt \
Expand Down
3 changes: 2 additions & 1 deletion 3rdParty/libsidplayfp/.github/workflows/doxygen.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: Doxygen

on:
workflow_dispatch:
release:
types: [released]

jobs:
build:
Expand Down
4 changes: 2 additions & 2 deletions 3rdParty/libsidplayfp/.github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Release

on:
release:
types: [published]
types: [published]

jobs:
build:
Expand All @@ -25,7 +25,7 @@ jobs:
run: |
make dist
RELEASE_TARBALL=$(ls libsidplayfp-*.tar.gz)
echo ::set-output name=filename::${RELEASE_TARBALL}
echo "filename=${RELEASE_TARBALL}" >> $GITHUB_OUTPUT
- name: Upload to release
uses: JasonEtco/upload-to-release@master
with:
Expand Down
5 changes: 3 additions & 2 deletions 3rdParty/libsidplayfp/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ else
endif

if HAVE_VISIBILITY
AM_CXXFLAGS = -fvisibility=hidden -fvisibility-inlines-hidden
VISIBILITY_CXXFLAGS = -fvisibility=hidden -fvisibility-inlines-hidden
endif

AM_CPPFLAGS = -I $(top_builddir)/src/builders/residfp-builder \
Expand All @@ -36,6 +36,8 @@ $(PTHREAD_CFLAGS) \
$(FTDI_CFLAGS) \
@debug_flags@

AM_CXXFLAGS = $(VISIBILITY_CXXFLAGS) $(OPENMP_CXXFLAGS)

#=========================================================
EXTRA_DIST = \
docs/mainpage.dox \
Expand Down Expand Up @@ -111,7 +113,6 @@ src/poweron.bin \
src/reloc65.cpp \
src/reloc65.h \
src/sidcxx11.h \
src/sidcxx14.h \
src/sidmd5.h \
src/sidmemory.h \
src/SidInfoImpl.h \
Expand Down
13 changes: 13 additions & 0 deletions 3rdParty/libsidplayfp/NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
2.5.0 2023-06-02
* residfp: reworked the combined waveforms model by separating pulldown effect from waveform generation
* residfp: tweaked the 8580 filter parameters for increased volume and less distortion (#45)
* Updated to latest resid
* Use OpenMP to speedup LUTs initialization
* CIA: minor rework based on chip reverse engineering
* Use c++17 where available
* Added sanity check for buffer size
* Minor mixer optimizations
* Other minor changes



2.4.2 2023-01-29
* Fixed a memory leak
* Minor fixes
Expand Down
3 changes: 3 additions & 0 deletions 3rdParty/libsidplayfp/README
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ default check
--with-exsid
Build with exsid support. Requires either libexsid or one of libfdti1 or libftd2xx

--disable-openmp
do not use OpenMP


If doxygen is installed and detected by the configure script the documentation
can be built by invoking "make doc".
Expand Down
30 changes: 13 additions & 17 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], [4])
m4_define([lib_level], [2])
m4_define([lib_minor], [5])
m4_define([lib_level], [0])
m4_define([lib_version], [lib_major.lib_minor.lib_level])

AC_INIT([libsidplayfp],[lib_version],[],[],[https://github.com/libsidplayfp/libsidplayfp/])
Expand Down Expand Up @@ -36,10 +36,12 @@ AC_PROG_CXX
dnl Use C++ for tests.
AC_LANG([C++])

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]),
AC_DEFINE([HAVE_CXX11])
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])
)
)

dnl check for hidden visibility support
Expand All @@ -64,24 +66,18 @@ AS_IF([test "x${ac_cv_header_stdint_h}" != "xyes"],
[AC_MSG_ERROR([Required header stdint.h not found])]
)

AC_OPENMP

dnl Checks for non-standard functions.

AC_CHECK_DECL(
[strcasecmp],
[AC_CHECK_FUNCS([strcasecmp])],
[AC_CHECK_DECL(
[stricmp],
[AC_CHECK_FUNCS([stricmp])]
)]
[AC_CHECK_FUNCS([strcasecmp])]
)

AC_CHECK_DECL(
[strncasecmp],
[AC_CHECK_FUNCS([strncasecmp])],
[AC_CHECK_DECL(
[strnicmp],
[AC_CHECK_FUNCS([strnicmp])]
)]
[AC_CHECK_FUNCS([strncasecmp])]
)


Expand All @@ -96,7 +92,7 @@ dnl libtool-style version-info number
# Increase the age value only if the changes made to the ABI are backward compatible.

LIBSIDPLAYCUR=9
LIBSIDPLAYREV=26
LIBSIDPLAYREV=27
LIBSIDPLAYAGE=3
LIBSIDPLAYVERSION=$LIBSIDPLAYCUR:$LIBSIDPLAYREV:$LIBSIDPLAYAGE

Expand Down
2 changes: 1 addition & 1 deletion 3rdParty/libsidplayfp/docs/mainpage.dox
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ C64 system and the SID chips.<br/>

Copyright (c) 2000-2001 Simon White<br/>
Copyright (c) 2007-2010 Antti Lankila<br/>
Copyright (c) 2010-2022 Leandro Nini &lt;drfiemost@users.sourceforge.net&gt;<br/>
Copyright (c) 2010-2023 Leandro Nini &lt;drfiemost@users.sourceforge.net&gt;<br/>
<br/>

STILView (or more precisely, the STIL class written in C++) is intended to be
Expand Down
4 changes: 2 additions & 2 deletions 3rdParty/libsidplayfp/libsidplayfp.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ Name: libsidplayfp
Description: C64 cycle exact stereo sidplayer library.
Version: @PACKAGE_VERSION@
Libs.private: @LIBGCRYPT_LIBS@ @EXSID_LIBS@
Libs: -L${libdir} -lsidplayfp
Cflags: -I${includedir}
Libs: -L${libdir} -lsidplayfp @OPENMP_CXXFLAGS@
Cflags: -I${includedir} @OPENMP_CXXFLAGS@
63 changes: 55 additions & 8 deletions 3rdParty/libsidplayfp/m4/ax_cxx_compile_stdcxx.m4
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#
# Check for baseline language coverage in the compiler for the specified
# version of the C++ standard. If necessary, add switches to CXX and
# CXXCPP to enable support. VERSION may be '11' (for the C++11 standard)
# or '14' (for the C++14 standard).
# CXXCPP to enable support. VERSION may be '11', '14', '17', or '20' for
# the respective C++ standard version.
#
# The second argument, if specified, indicates whether you insist on an
# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g.
Expand All @@ -36,13 +36,14 @@
# Copyright (c) 2016, 2018 Krzesimir Nowak <qdlacz@gmail.com>
# Copyright (c) 2019 Enji Cooper <yaneurabeya@gmail.com>
# Copyright (c) 2020 Jason Merrill <jason@redhat.com>
# Copyright (c) 2021 Jörn Heusipp <osmanx@problemloesungsmaschine.de>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.

#serial 12
#serial 15

dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro
dnl (serial version number 13).
Expand All @@ -51,6 +52,7 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl
m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"],
[$1], [14], [ax_cxx_compile_alternatives="14 1y"],
[$1], [17], [ax_cxx_compile_alternatives="17 1z"],
[$1], [20], [ax_cxx_compile_alternatives="20"],
[m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl
m4_if([$2], [], [],
[$2], [ext], [],
Expand Down Expand Up @@ -151,20 +153,31 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11],
_AX_CXX_COMPILE_STDCXX_testbody_new_in_11
)


dnl Test body for checking C++14 support

m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14],
_AX_CXX_COMPILE_STDCXX_testbody_new_in_11
_AX_CXX_COMPILE_STDCXX_testbody_new_in_14
)

dnl Test body for checking C++17 support

m4_define([_AX_CXX_COMPILE_STDCXX_testbody_17],
_AX_CXX_COMPILE_STDCXX_testbody_new_in_11
_AX_CXX_COMPILE_STDCXX_testbody_new_in_14
_AX_CXX_COMPILE_STDCXX_testbody_new_in_17
)

dnl Test body for checking C++20 support

m4_define([_AX_CXX_COMPILE_STDCXX_testbody_20],
_AX_CXX_COMPILE_STDCXX_testbody_new_in_11
_AX_CXX_COMPILE_STDCXX_testbody_new_in_14
_AX_CXX_COMPILE_STDCXX_testbody_new_in_17
_AX_CXX_COMPILE_STDCXX_testbody_new_in_20
)


dnl Tests for new features in C++11

m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[
Expand All @@ -176,7 +189,11 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[
#error "This is not a C++ compiler"
#elif __cplusplus < 201103L
// MSVC always sets __cplusplus to 199711L in older versions; newer versions
// only set it correctly if /Zc:__cplusplus is specified as well as a
// /std:c++NN switch:
// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/
#elif __cplusplus < 201103L && !defined _MSC_VER
#error "This is not a C++11 compiler"
Expand Down Expand Up @@ -467,7 +484,7 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[
#error "This is not a C++ compiler"
#elif __cplusplus < 201402L
#elif __cplusplus < 201402L && !defined _MSC_VER
#error "This is not a C++14 compiler"
Expand Down Expand Up @@ -591,7 +608,7 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[
#error "This is not a C++ compiler"
#elif __cplusplus < 201703L
#elif __cplusplus < 201703L && !defined _MSC_VER
#error "This is not a C++17 compiler"
Expand Down Expand Up @@ -957,6 +974,36 @@ namespace cxx17
} // namespace cxx17
#endif // __cplusplus < 201703L
#endif // __cplusplus < 201703L && !defined _MSC_VER
]])


dnl Tests for new features in C++20

m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_20], [[
#ifndef __cplusplus
#error "This is not a C++ compiler"
#elif __cplusplus < 202002L && !defined _MSC_VER
#error "This is not a C++20 compiler"
#else
#include <version>
namespace cxx20
{
// As C++20 supports feature test macros in the standard, there is no
// immediate need to actually test for feature availability on the
// Autoconf side.
} // namespace cxx20
#endif // __cplusplus < 202002L && !defined _MSC_VER
]])
35 changes: 35 additions & 0 deletions 3rdParty/libsidplayfp/m4/ax_cxx_compile_stdcxx_17.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# =============================================================================
# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_17.html
# =============================================================================
#
# SYNOPSIS
#
# AX_CXX_COMPILE_STDCXX_17([ext|noext], [mandatory|optional])
#
# DESCRIPTION
#
# Check for baseline language coverage in the compiler for the C++17
# standard; if necessary, add switches to CXX and CXXCPP to enable
# support.
#
# This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX
# macro with the version set to C++17. The two optional arguments are
# forwarded literally as the second and third argument respectively.
# Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for
# more information. If you want to use this macro, you also need to
# download the ax_cxx_compile_stdcxx.m4 file.
#
# LICENSE
#
# Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu>
# Copyright (c) 2016 Krzesimir Nowak <qdlacz@gmail.com>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.

#serial 2

AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX])
AC_DEFUN([AX_CXX_COMPILE_STDCXX_17], [AX_CXX_COMPILE_STDCXX([17], [$1], [$2])])
9 changes: 7 additions & 2 deletions 3rdParty/libsidplayfp/src/Event.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ class Event

public:
/**
* Events are used for delayed execution. Name is
* not used by code, but is useful for debugging.
* Events are used for delayed execution.
*
* @param name Descriptive string of the event.
*/
Expand All @@ -66,6 +65,12 @@ class Event
*/
virtual void event() = 0;

/**
* Get the event name.
* Only for debugging purposes.
*/
const char* name() const { return m_name; }

protected:
~Event() {}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
# include "driver/exSID.h"
#endif

#include "sidcxx11.h"

namespace libsidplayfp
{

Expand Down Expand Up @@ -157,7 +159,7 @@ void exSID::voice(unsigned int num, bool mute)
muted[num] = mute;
}

void exSID::model(SidConfig::sid_model_t model, bool digiboost)
void exSID::model(SidConfig::sid_model_t model, MAYBE_UNUSED bool digiboost)
{
runmodel = model;
// currently no support for stereo mode: output the selected SID to both L and R channels
Expand All @@ -178,8 +180,8 @@ void exSID::unlock()
sidemu::unlock();
}

void exSID::sampling(float systemclock, float freq,
SidConfig::sampling_method_t method, bool)
void exSID::sampling(float systemclock, MAYBE_UNUSED float freq,
MAYBE_UNUSED SidConfig::sampling_method_t method, bool)
{
exSID_audio_op(exsid, XS_AU_MUTE);
if (systemclock < 1000000.0F)
Expand Down
Loading

0 comments on commit f9cdae1

Please sign in to comment.