Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package sidplayfp for openSUSE:Factory checked in at 2025-05-12 16:52:07 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/sidplayfp (Old) and /work/SRC/openSUSE:Factory/.sidplayfp.new.30101 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "sidplayfp" Mon May 12 16:52:07 2025 rev:14 rq:1276798 version:2.14.0 Changes: -------- --- /work/SRC/openSUSE:Factory/sidplayfp/sidplayfp.changes 2025-04-15 20:07:30.141663205 +0200 +++ /work/SRC/openSUSE:Factory/.sidplayfp.new.30101/sidplayfp.changes 2025-05-12 16:55:49.250130784 +0200 @@ -1,0 +2,8 @@ +Sun May 11 18:58:00 UTC 2025 - Martin Hauke <mar...@gmx.de> + +- Update to version 2.14.0 + * Ported to new play API. + * Removed support for old library version. + * Minor fixes and optimizations. + +------------------------------------------------------------------- Old: ---- sidplayfp-2.13.0.tar.gz New: ---- sidplayfp-2.14.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ sidplayfp.spec ++++++ --- /var/tmp/diff_new_pack.7TnJGB/_old 2025-05-12 16:55:49.978161325 +0200 +++ /var/tmp/diff_new_pack.7TnJGB/_new 2025-05-12 16:55:49.978161325 +0200 @@ -18,14 +18,14 @@ Name: sidplayfp -Version: 2.13.0 +Version: 2.14.0 Release: 0 Summary: SID chip music module player License: GPL-2.0-or-later Group: Productivity/Multimedia/Sound/Players #Git-Clone: https://github.com/libsidplayfp/sidplayfp.git URL: https://sourceforge.net/projects/sidplay-residfp/ -Source0: https://sourceforge.net/projects/sidplay-residfp/files/sidplayfp/2.13/sidplayfp-%{version}.tar.gz +Source0: https://sourceforge.net/projects/sidplay-residfp/files/sidplayfp/2.14/sidplayfp-%{version}.tar.gz BuildRequires: gcc-c++ BuildRequires: pkgconfig BuildRequires: pkgconfig(alsa) ++++++ sidplayfp-2.13.0.tar.gz -> sidplayfp-2.14.0.tar.gz ++++++ ++++ 2542 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sidplayfp-2.13.0/Makefile.am new/sidplayfp-2.14.0/Makefile.am --- old/sidplayfp-2.13.0/Makefile.am 2025-04-13 13:20:38.000000000 +0200 +++ new/sidplayfp-2.14.0/Makefile.am 2025-05-11 10:41:13.000000000 +0200 @@ -45,6 +45,8 @@ src/keyboard.h \ src/main.cpp \ src/menu.cpp \ +src/mixer.cpp \ +src/mixer.h \ src/player.cpp \ src/player.h \ src/setting.h \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sidplayfp-2.13.0/configure.ac new/sidplayfp-2.14.0/configure.ac --- old/sidplayfp-2.13.0/configure.ac 2025-04-13 13:20:38.000000000 +0200 +++ new/sidplayfp-2.14.0/configure.ac 2025-05-11 10:41:13.000000000 +0200 @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([sidplayfp], [2.13.0], [], [], [https://github.com/libsidplayfp/sidplayfp/]) +AC_INIT([sidplayfp], [2.14.0], [], [], [https://github.com/libsidplayfp/sidplayfp/]) AC_CONFIG_SRCDIR([src/main.cpp]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([m4]) @@ -28,12 +28,15 @@ dnl Use C++ for tests. AC_LANG([C++]) -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], [mandatory])] - ) +AX_CXX_COMPILE_STDCXX([20], [noext], [optional]) +AS_IF([test $ax_cv_cxx_compile_cxx20__std_cpp20 != "yes"], [ + 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], [mandatory])] + ) + ]) ]) dnl Checks for typedefs, structures, and compiler characteristics. @@ -79,7 +82,7 @@ AC_SUBST(AUDIO_LDFLAGS) -PKG_CHECK_MODULES(SIDPLAYFP, [libsidplayfp >= 1.0]) +PKG_CHECK_MODULES(SIDPLAYFP, [libsidplayfp >= 2.0]) PKG_CHECK_MODULES(STILVIEW, [libstilview >= 1.0]) USE_LIBOUT123=no diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sidplayfp-2.13.0/doc/en/sidplayfp.1 new/sidplayfp-2.14.0/doc/en/sidplayfp.1 --- old/sidplayfp-2.13.0/doc/en/sidplayfp.1 2025-04-13 13:20:43.000000000 +0200 +++ new/sidplayfp-2.14.0/doc/en/sidplayfp.1 2025-05-11 10:41:23.000000000 +0200 @@ -55,7 +55,7 @@ .\" ======================================================================== .\" .IX Title "SIDPLAYFP 1" -.TH SIDPLAYFP 1 2025-04-13 "perl v5.38.2" "User Programs" +.TH SIDPLAYFP 1 2025-05-11 "perl v5.38.2" "User Programs" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sidplayfp-2.13.0/doc/en/sidplayfp.ini.5 new/sidplayfp-2.14.0/doc/en/sidplayfp.ini.5 --- old/sidplayfp-2.13.0/doc/en/sidplayfp.ini.5 2025-04-13 13:20:43.000000000 +0200 +++ new/sidplayfp-2.14.0/doc/en/sidplayfp.ini.5 2025-05-11 10:41:23.000000000 +0200 @@ -55,7 +55,7 @@ .\" ======================================================================== .\" .IX Title "SIDPLAYFP.INI 5" -.TH SIDPLAYFP.INI 5 2025-04-13 "perl v5.38.2" "File formats" +.TH SIDPLAYFP.INI 5 2025-05-11 "perl v5.38.2" "File formats" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sidplayfp-2.13.0/doc/en/stilview.1 new/sidplayfp-2.14.0/doc/en/stilview.1 --- old/sidplayfp-2.13.0/doc/en/stilview.1 2025-04-13 13:20:43.000000000 +0200 +++ new/sidplayfp-2.14.0/doc/en/stilview.1 2025-05-11 10:41:23.000000000 +0200 @@ -55,7 +55,7 @@ .\" ======================================================================== .\" .IX Title "STILVIEW 1" -.TH STILVIEW 1 2025-04-13 "perl v5.38.2" "User Programs" +.TH STILVIEW 1 2025-05-11 "perl v5.38.2" "User Programs" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sidplayfp-2.13.0/m4/ax_cxx_compile_stdcxx.m4 new/sidplayfp-2.14.0/m4/ax_cxx_compile_stdcxx.m4 --- old/sidplayfp-2.13.0/m4/ax_cxx_compile_stdcxx.m4 2025-04-13 13:20:38.000000000 +0200 +++ new/sidplayfp-2.14.0/m4/ax_cxx_compile_stdcxx.m4 2025-05-11 10:41:13.000000000 +0200 @@ -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', '14', '17', or '20' for -# the respective C++ standard version. +# CXXCPP to enable support. VERSION may be '11', '14', '17', '20', or +# '23' 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. @@ -36,14 +36,15 @@ # Copyright (c) 2016, 2018 Krzesimir Nowak <qdl...@gmail.com> # Copyright (c) 2019 Enji Cooper <yaneurab...@gmail.com> # Copyright (c) 2020 Jason Merrill <ja...@redhat.com> -# Copyright (c) 2021 Jörn Heusipp <osm...@problemloesungsmaschine.de> +# Copyright (c) 2021, 2024 Jörn Heusipp <osm...@problemloesungsmaschine.de> +# Copyright (c) 2015, 2022, 2023, 2024 Olly Betts # # 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 18 +#serial 25 dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro dnl (serial version number 13). @@ -53,6 +54,7 @@ [$1], [14], [ax_cxx_compile_alternatives="14 1y"], [$1], [17], [ax_cxx_compile_alternatives="17 1z"], [$1], [20], [ax_cxx_compile_alternatives="20"], + [$1], [23], [ax_cxx_compile_alternatives="23"], [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl m4_if([$2], [], [], [$2], [ext], [], @@ -67,7 +69,7 @@ m4_if([$2], [], [dnl AC_CACHE_CHECK(whether $CXX supports C++$1 features by default, - ax_cv_cxx_compile_cxx$1, + ax_cv_cxx_compile_cxx$1, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], [ax_cv_cxx_compile_cxx$1=yes], [ax_cv_cxx_compile_cxx$1=no])]) @@ -159,31 +161,41 @@ dnl Test body for checking C++11 support m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11], - _AX_CXX_COMPILE_STDCXX_testbody_new_in_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 + [_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 + [_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 + [_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 Test body for checking C++23 support + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_23], + [_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 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_23] ) @@ -201,7 +213,17 @@ // 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/ +// +// The value __cplusplus ought to have is available in _MSVC_LANG since +// Visual Studio 2015 Update 3: +// +// https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros +// +// This was also the first MSVC version to support C++14 so we can't use the +// value of either __cplusplus or _MSVC_LANG to quickly rule out MSVC having +// C++11 or C++14 support, but we can check _MSVC_LANG for C++17 and later. #elif __cplusplus < 201103L && !defined _MSC_VER #error "This is not a C++11 compiler" @@ -617,7 +639,7 @@ #error "This is not a C++ compiler" -#elif __cplusplus < 201703L && !defined _MSC_VER +#elif (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 201703L #error "This is not a C++17 compiler" @@ -983,7 +1005,7 @@ } // namespace cxx17 -#endif // __cplusplus < 201703L && !defined _MSC_VER +#endif // (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 201703L ]]) @@ -996,7 +1018,7 @@ #error "This is not a C++ compiler" -#elif __cplusplus < 202002L && !defined _MSC_VER +#elif (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202002L #error "This is not a C++20 compiler" @@ -1013,6 +1035,36 @@ } // namespace cxx20 -#endif // __cplusplus < 202002L && !defined _MSC_VER +#endif // (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202002L + +]]) + + +dnl Tests for new features in C++23 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_23], [[ + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202302L + +#error "This is not a C++23 compiler" + +#else + +#include <version> + +namespace cxx23 +{ + +// As C++23 supports feature test macros in the standard, there is no +// immediate need to actually test for feature availability on the +// Autoconf side. + +} // namespace cxx23 + +#endif // (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202302L ]]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sidplayfp-2.13.0/src/IniConfig.cpp new/sidplayfp-2.14.0/src/IniConfig.cpp --- old/sidplayfp-2.13.0/src/IniConfig.cpp 2025-04-13 13:20:38.000000000 +0200 +++ new/sidplayfp-2.14.0/src/IniConfig.cpp 2025-05-11 10:41:13.000000000 +0200 @@ -112,9 +112,7 @@ emulation_s.modelForced = false; emulation_s.sidModel = SidConfig::MOS6581; emulation_s.forceModel = false; -#ifdef FEAT_CONFIG_CIAMODEL emulation_s.ciaModel = SidConfig::MOS6526; -#endif emulation_s.filter = true; emulation_s.engine.clear(); @@ -406,7 +404,6 @@ readBool(ini, TEXT("ForceC64Model"), emulation_s.modelForced); readBool(ini, TEXT("DigiBoost"), emulation_s.digiboost); -#ifdef FEAT_CONFIG_CIAMODEL { SID_STRING str = readString(ini, TEXT("CiaModel")); if (!str.empty()) @@ -417,7 +414,6 @@ emulation_s.ciaModel = SidConfig::MOS8521; } } -#endif { SID_STRING str = readString(ini, TEXT("SidModel")); if (!str.empty()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sidplayfp-2.13.0/src/IniConfig.h new/sidplayfp-2.14.0/src/IniConfig.h --- old/sidplayfp-2.13.0/src/IniConfig.h 2025-04-13 13:20:38.000000000 +0200 +++ new/sidplayfp-2.14.0/src/IniConfig.h 2025-05-11 10:41:13.000000000 +0200 @@ -77,9 +77,7 @@ bool modelForced; SidConfig::sid_model_t sidModel; bool forceModel; -#ifdef FEAT_CONFIG_CIAMODEL SidConfig::cia_model_t ciaModel; -#endif bool digiboost; bool filter; double bias; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sidplayfp-2.13.0/src/args.cpp new/sidplayfp-2.14.0/src/args.cpp --- old/sidplayfp-2.13.0/src/args.cpp 2025-04-13 13:20:38.000000000 +0200 +++ new/sidplayfp-2.14.0/src/args.cpp 2025-05-11 10:41:13.000000000 +0200 @@ -201,13 +201,11 @@ if (!parseAddress (&argv[i][3], m_engCfg.secondSidAddress)) err = true; } -#ifdef FEAT_THIRD_SID else if (strncmp (&argv[i][1], "ts", 2) == 0) { // Override sidTune and enable the third sid if (!parseAddress (&argv[i][3], m_engCfg.thirdSidAddress)) err = true; } -#endif else if (argv[i][1] == 'f') { if (argv[i][2] == '\0') @@ -350,12 +348,11 @@ m_channels = 1; } -#ifdef FEAT_DIGIBOOST else if (std::strcmp (&argv[i][1], "-digiboost") == 0) { m_engCfg.digiBoost = true; } -#endif + // Video/Verbose Options else if (std::strcmp (&argv[i][1], "vnf") == 0) { @@ -670,9 +667,7 @@ << " -f<num> set frequency in Hz (default: " << SidConfig::DEFAULT_SAMPLING_FREQ << ")" << endl << " -ds<addr> set second sid address (e.g. -ds0xd420)" << endl -#ifdef FEAT_THIRD_SID << " -ts<addr> set third sid address (e.g. -ts0xd440)" << endl -#endif << " -u<num> mute voice <num> (e.g. -u1 -u2)" << endl #ifdef FEAT_SAMPLE_MUTE @@ -697,9 +692,7 @@ << " -m<o|n>[f] set SID new/old chip model (default: old)" << endl << " Use 'f' to force the model" << endl -#ifdef FEAT_DIGIBOOST << " --digiboost Enable digiboost for 8580 model" << endl -#endif << " -r[i|r][f] set resampling method (default: resample interpolate)" << endl << " Use 'f' to enable fast resampling (only for reSID)" << endl << " --fcurve=<num>|auto Controls the filter curve in the ReSIDfp emulation (0.0 to 1.0, default: 0.5)" << endl diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sidplayfp-2.13.0/src/audio/oss/audiodrv.cpp new/sidplayfp-2.14.0/src/audio/oss/audiodrv.cpp --- old/sidplayfp-2.13.0/src/audio/oss/audiodrv.cpp 2025-04-13 13:20:38.000000000 +0200 +++ new/sidplayfp-2.14.0/src/audio/oss/audiodrv.cpp 2025-05-11 10:41:13.000000000 +0200 @@ -52,12 +52,12 @@ { // Reset everything. clearError(); - _audiofd = -1; + m_audiofd = -1; } bool Audio_OSS::open (AudioConfig &cfg) { - if (_audiofd != -1) + if (m_audiofd != -1) { setError("Device already in use"); return false; @@ -70,19 +70,19 @@ throw error("Could not locate an audio device."); } - if ((_audiofd = ::open (AUDIODEVICE, O_WRONLY, 0)) == (-1)) + if ((m_audiofd = ::open (AUDIODEVICE, O_WRONLY, 0)) == (-1)) { throw error("Could not open audio device."); } int format = AFMT_S16_LE; - if (ioctl (_audiofd, SNDCTL_DSP_SETFMT, &format) == (-1)) + if (ioctl (m_audiofd, SNDCTL_DSP_SETFMT, &format) == (-1)) { throw error("Could not set sample format."); } // Set mono/stereo. - if (ioctl (_audiofd, SNDCTL_DSP_CHANNELS, &cfg.channels) == (-1)) + if (ioctl (m_audiofd, SNDCTL_DSP_CHANNELS, &cfg.channels) == (-1)) { throw error("Could not set mono/stereo."); } @@ -99,13 +99,13 @@ } // Set frequency. - if (ioctl (_audiofd, SNDCTL_DSP_SPEED, &cfg.frequency) == (-1)) + if (ioctl (m_audiofd, SNDCTL_DSP_SPEED, &cfg.frequency) == (-1)) { throw error("Could not set frequency."); } int temp = 0; - ioctl (_audiofd, SNDCTL_DSP_GETBLKSIZE, &temp); + ioctl (m_audiofd, SNDCTL_DSP_GETBLKSIZE, &temp); cfg.bufSize = (uint_least32_t) temp; try @@ -128,10 +128,10 @@ { setError(e.message()); - if (_audiofd != -1) + if (m_audiofd != -1) { close (); - _audiofd = -1; + m_audiofd = -1; } return false; @@ -142,9 +142,9 @@ // reset any variables that reflect the current state. void Audio_OSS::close () { - if (_audiofd != -1) + if (m_audiofd != -1) { - ::close (_audiofd); + ::close (m_audiofd); delete [] _sampleBuffer; outOfOrder (); } @@ -152,22 +152,22 @@ void Audio_OSS::reset () { - if (_audiofd != -1) + if (m_audiofd != -1) { - ioctl (_audiofd, SNDCTL_DSP_RESET, 0); + ioctl (m_audiofd, SNDCTL_DSP_RESET, 0); } } bool Audio_OSS::write (uint_least32_t frames) { - if (_audiofd == -1) + if (m_audiofd == -1) { setError("Device not open."); return false; } size_t const bytes = static_cast<size_t>(frames) * m_frameSize; - ssize_t res = ::write (_audiofd, _sampleBuffer, bytes); + ssize_t res = ::write (m_audiofd, _sampleBuffer, bytes); if (res < 0) { setError(strerror(errno)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sidplayfp-2.13.0/src/audio/oss/audiodrv.h new/sidplayfp-2.14.0/src/audio/oss/audiodrv.h --- old/sidplayfp-2.13.0/src/audio/oss/audiodrv.h 2025-04-13 13:20:38.000000000 +0200 +++ new/sidplayfp-2.14.0/src/audio/oss/audiodrv.h 2025-05-11 10:41:13.000000000 +0200 @@ -57,7 +57,7 @@ { private: // ------------------------------------------------------- private static const char AUDIODEVICE[]; - volatile int _audiofd; + int m_audiofd; int m_frameSize; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sidplayfp-2.13.0/src/codeConvert.h new/sidplayfp-2.14.0/src/codeConvert.h --- old/sidplayfp-2.13.0/src/codeConvert.h 2025-04-13 13:20:38.000000000 +0200 +++ new/sidplayfp-2.14.0/src/codeConvert.h 2025-05-11 10:41:13.000000000 +0200 @@ -27,6 +27,11 @@ #ifdef HAVE_ICONV # include <clocale> +# ifdef __FreeBSD__ + // workaround a FreeBSD issue + // https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=275969 +# define LIBICONV_PLUG +# endif # include <iconv.h> #ifndef _WIN32 # include <langinfo.h> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sidplayfp-2.13.0/src/config.h.in new/sidplayfp-2.14.0/src/config.h.in --- old/sidplayfp-2.13.0/src/config.h.in 2025-04-13 13:20:40.000000000 +0200 +++ new/sidplayfp-2.14.0/src/config.h.in 2025-05-11 10:41:15.000000000 +0200 @@ -15,6 +15,9 @@ /* define if the compiler supports basic C++17 syntax */ #undef HAVE_CXX17 +/* define if the compiler supports basic C++20 syntax */ +#undef HAVE_CXX20 + /* Define to 1 if you have the <dsound.h> header file. */ #undef HAVE_DSOUND_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sidplayfp-2.13.0/src/keyboard.cpp new/sidplayfp-2.14.0/src/keyboard.cpp --- old/sidplayfp-2.13.0/src/keyboard.cpp 2025-04-13 13:20:38.000000000 +0200 +++ new/sidplayfp-2.14.0/src/keyboard.cpp 2025-05-11 10:41:13.000000000 +0200 @@ -37,8 +37,8 @@ int _getch (void); #endif -#define MAX_CMDLEN 10 -#define ESC '\033' +constexpr int MAX_CMDLEN = 10; +constexpr char ESC = '\033'; // Special Extended Key Definitions enum diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sidplayfp-2.13.0/src/menu.cpp new/sidplayfp-2.14.0/src/menu.cpp --- old/sidplayfp-2.13.0/src/menu.cpp 2025-04-13 13:20:38.000000000 +0200 +++ new/sidplayfp-2.14.0/src/menu.cpp 2025-05-11 10:41:13.000000000 +0200 @@ -294,9 +294,7 @@ const uint_least32_t seconds = m_timer.stop / 1000; cerr << setw(2) << setfill('0') << ((seconds / 60) % 100) << ':' << setw(2) << setfill('0') << (seconds % 60); -#ifdef FEAT_NEW_SONLEGTH_DB cerr << '.' << setw(3) << m_timer.stop % 1000; -#endif } else if (m_timer.valid) cerr << "FOREVER"; @@ -353,31 +351,17 @@ cerr << " SID Details : "; consoleColour (color_t::white, false); cerr << "Model = "; -#ifdef FEAT_NEW_TUNEINFO_API cerr << getModel(tuneInfo->sidModel(0)); -#else - cerr << getModel(tuneInfo->sidModel1()); -#endif cerr << endl; -#ifdef FEAT_NEW_TUNEINFO_API if (tuneInfo->sidChips() > 1) -#else - if (tuneInfo->isStereo()) -#endif { consoleTable (table_t::middle); consoleColour (color_t::yellow, true); cerr << " : "; consoleColour (color_t::white, false); -#ifdef FEAT_NEW_TUNEINFO_API cerr << "2nd SID = $" << hex << tuneInfo->sidChipBase(1) << dec; cerr << ", Model = " << getModel(tuneInfo->sidModel(1)); -#else - cerr << "2nd SID = $" << hex << tuneInfo->sidChipBase2() << dec; - cerr << ", Model = " << getModel(tuneInfo->sidModel2()); -#endif cerr << endl; -#ifdef FEAT_NEW_TUNEINFO_API if (tuneInfo->sidChips() > 2) { consoleTable (table_t::middle); @@ -388,7 +372,6 @@ cerr << ", Model = " << getModel(tuneInfo->sidModel(2)); cerr << endl; } -#endif } consoleTable (table_t::separator); @@ -410,13 +393,13 @@ cerr << " SID Filter : "; consoleColour (color_t::white, false); cerr << (m_filter.enabled ? "Yes" : "No") << endl; -#ifdef FEAT_DIGIBOOST + consoleTable (table_t::middle); consoleColour (color_t::yellow, true); cerr << " DigiBoost : "; consoleColour (color_t::white, false); cerr << (m_engCfg.digiBoost ? "Yes" : "No") << endl; -#endif + consoleTable (table_t::middle); consoleColour (color_t::yellow, true); cerr << " SID Model : "; @@ -496,7 +479,11 @@ consoleTable (table_t::separator); consoleTable (table_t::middle); cerr << " NOTE PW CONTROL WAVEFORMS" << endl; +#ifdef FEAT_NEW_PLAY_API + for (unsigned int i=0; i < m_engine.installedSIDs() * 3; i++) +#else for (int i=0; i < tuneInfo->sidChips() * 3; i++) +#endif { consoleTable (table_t::middle); cerr << endl; // reserve space for the Voice 3 status } @@ -522,11 +509,15 @@ #ifdef FEAT_REGS_DUMP_SID if (m_verboseLevel > 1) { - const SidTuneInfo *tuneInfo = m_tune.getInfo(); - - cerr << "\x1b[" << tuneInfo->sidChips() * 3 + 1 << "A\r"; // Moves cursor X lines up + unsigned int chips = +#ifdef FEAT_NEW_PLAY_API + m_engine.installedSIDs(); +#else + m_tune.getInfo()->sidChips(); +#endif + cerr << "\x1b[" << chips * 3 + 1 << "A\r"; // Moves cursor X lines up - for (int j=0; j < tuneInfo->sidChips(); j++) + for (unsigned int j=0; j < chips; j++) { uint8_t* registers = m_registers[j]; uint8_t oldCtl[3]; @@ -685,7 +676,7 @@ void ConsolePlayer::consoleRestore () { if ((m_iniCfg.console ()).ansi) { - cerr << '\x1b' << "[?25h"; + cerr << '\x1b' << "[?25h"; cerr << '\x1b' << "[0m"; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sidplayfp-2.13.0/src/mixer.cpp new/sidplayfp-2.14.0/src/mixer.cpp --- old/sidplayfp-2.13.0/src/mixer.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/sidplayfp-2.14.0/src/mixer.cpp 2025-05-11 10:41:13.000000000 +0200 @@ -0,0 +1,127 @@ +/* + * This file is part of sidplayfp, a SID player engine. + * + * Copyright 2011-2025 Leandro Nini <drfiem...@users.sourceforge.net> + * Copyright 2007-2010 Antti Lankila + * Copyright (C) 2000 Simon White + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "mixer.h" + +#include <cassert> +#include <cstring> + +void Mixer::initialize(unsigned int chips, bool stereo) +{ + assert((chips >= 1) && (chips <= 3)); + m_channels = stereo ? 2 : 1; + m_mix.resize(m_channels); + m_chips = chips; + m_iSamples.resize(chips); + switch (chips) + { + case 1: + m_mix[0] = stereo ? &Mixer::stereo_OneChip : &Mixer::template mono<1>; + if (stereo) m_mix[1] = &Mixer::stereo_OneChip; + break; + case 2: + m_mix[0] = stereo ? &Mixer::stereo_ch1_TwoChips : &Mixer::template mono<2>; + if (stereo) m_mix[1] = &Mixer::stereo_ch2_TwoChips; + break; + case 3: + m_mix[0] = stereo ? &Mixer::stereo_ch1_ThreeChips : &Mixer::template mono<3>; + if (stereo) m_mix[1] = &Mixer::stereo_ch2_ThreeChips; + break; + } +} + +void Mixer::begin(short *buffer, uint_least32_t length) +{ + m_dest = buffer; + m_dest_size = length; + + m_pos = m_buffer.size(); + if (m_pos) LIKELY + std::memcpy(m_dest, m_buffer.data(), m_pos*sizeof(short)); +} + +uint_least32_t Mixer::mix(short** buffers, uint_least32_t start, uint_least32_t length, short* dest) +{ + uint_least32_t j = 0; + for (uint_least32_t i=0; i<length;) + { + if (m_fastForwardFactor == 1) LIKELY + { + for (unsigned int c=0; c<m_chips; c++) + { + m_iSamples[c] = buffers[c][start+i]; + } + + i++; + } + else + { + for (unsigned int c=0; c<m_chips; c++) + { + // Apply boxcar filter + int_least32_t sample = 0; + const short *buffer = &buffers[c][start+i]; + for (unsigned int k = 0; k < m_fastForwardFactor; k++) + { + sample += buffer[k]; + } + + m_iSamples[c] = sample / m_fastForwardFactor; + } + + // increment i to mark we ate some samples. + i += m_fastForwardFactor; + } + + for (unsigned int c=0; c<m_channels; c++) + { + const int_least32_t tmp = (this->*(m_mix[c]))(); + assert(tmp >= -32768 && tmp <= 32767); + dest[j++] = static_cast<short>(tmp); + } + } + return j; +} + +void Mixer::doMix(short** buffers, uint_least32_t samples) +{ + uint_least32_t const cnt = std::min(samples, (m_dest_size-m_pos)/m_channels); + uint_least32_t const res = mix(buffers, 0, cnt, m_dest+m_pos); + m_pos += res; + + // save remaining samples, if any + uint_least32_t const rem = samples - cnt; + if (rem) + { + m_buffer.resize(static_cast<std::size_t>(rem)*m_channels); + mix(buffers, cnt, rem, m_buffer.data()); + } +} + +bool Mixer::setFastForward(unsigned int ff) +{ + if (ff < 1 || ff > 32) + return false; + + m_fastForwardFactor = ff; + return true; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sidplayfp-2.13.0/src/mixer.h new/sidplayfp-2.14.0/src/mixer.h --- old/sidplayfp-2.13.0/src/mixer.h 1970-01-01 01:00:00.000000000 +0100 +++ new/sidplayfp-2.14.0/src/mixer.h 2025-05-11 10:41:13.000000000 +0200 @@ -0,0 +1,147 @@ +/* + * This file is part of sidplayfp, a SID player engine. + * + * Copyright 2011-2025 Leandro Nini <drfiem...@users.sourceforge.net> + * Copyright 2007-2010 Antti Lankila + * Copyright (C) 2000 Simon White + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + + +#ifndef MIXER_H +#define MIXER_H + +#include <stdint.h> + +#include <vector> + +#include "sidcxx11.h" + +#if defined(HAVE_CXX20) && defined(__cpp_lib_math_constants) +# include <numbers> +#endif + +/** + * This class implements the mixer. + */ +class Mixer +{ +private: + static constexpr int_least32_t SCALE_FACTOR = 1 << 16; + +#if defined(HAVE_CXX20) && defined(__cpp_lib_math_constants) + static constexpr double SQRT_2 = std::numbers::sqrt2; + static constexpr double SQRT_3 = std::numbers::sqrt3; +#else + static constexpr double SQRT_2 = 1.41421356237; + static constexpr double SQRT_3 = 1.73205080757; +#endif + + static constexpr int_least32_t SCALE[3] = { + SCALE_FACTOR, // 1 chip, no scale + static_cast<int_least32_t>((1.0 / SQRT_2) * SCALE_FACTOR), // 2 chips, scale by sqrt(2) + static_cast<int_least32_t>((1.0 / SQRT_3) * SCALE_FACTOR) // 3 chips, scale by sqrt(3) + }; + +private: + using mixer_func_t = int_least32_t (Mixer::*)() const; + +private: + uint_least32_t m_pos = 0; + uint_least32_t m_dest_size = 0; + + short* m_dest = nullptr; + + unsigned int m_channels = 1; + unsigned int m_chips; + unsigned int m_fastForwardFactor = 1; + + std::vector<int_least32_t> m_iSamples; + std::vector<short> m_buffer; + std::vector<mixer_func_t> m_mix; + +private: + /* + * Channel matrix + * + * C1 + * L 1.0 + * R 1.0 + * + * C1 C2 + * L 1.0 0.5 + * R 0.5 1.0 + * + * C1 C2 C3 + * L 1.0 1.0 0.5 + * R 0.5 1.0 1.0 + */ + + // Mono mixing + template <unsigned int Chips> + int_least32_t mono() const + { + static_assert((Chips >= 1) && (Chips <= 3), "Unsupported number of chips"); + int_least32_t res = 0; + for (unsigned int i = 0; i < Chips; i++) + res += m_iSamples[i]; + return res * SCALE[Chips-1] / SCALE_FACTOR; + } + + // Stereo mixing + int_least32_t stereo_OneChip() const { return m_iSamples[0]; } + + int_least32_t stereo_ch1_TwoChips() const + { + return (m_iSamples[0] + 0.5*m_iSamples[1]) * SCALE[1] / SCALE_FACTOR; + } + int_least32_t stereo_ch2_TwoChips() const + { + return (0.5*m_iSamples[0] + m_iSamples[1]) * SCALE[1] / SCALE_FACTOR; + } + + int_least32_t stereo_ch1_ThreeChips() const + { + return (m_iSamples[0] + m_iSamples[1] + 0.5*m_iSamples[2]) * SCALE[2] / SCALE_FACTOR; + } + int_least32_t stereo_ch2_ThreeChips() const + { + return (0.5*m_iSamples[0] + m_iSamples[1] + m_iSamples[2]) * SCALE[2] / SCALE_FACTOR; + } + + inline uint_least32_t mix(short** buffers, uint_least32_t start, uint_least32_t length, short* dest); + +public: + void initialize(unsigned int chips, bool stereo); + + void begin(short *buffer, uint_least32_t length); + + void doMix(short** buffers, uint_least32_t samples); + + bool isFull() const { return m_pos >= m_dest_size; } + + void clear() { m_buffer.resize(0); } + + /** + * Set the fast forward ratio. + * + * @param ff the fast forward ratio, from 1 to 32 + * @return true if parameter is valid, false otherwise + */ + bool setFastForward(unsigned int ff); +}; + +#endif // MIXER_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sidplayfp-2.13.0/src/player.cpp new/sidplayfp-2.14.0/src/player.cpp --- old/sidplayfp-2.13.0/src/player.cpp 2025-04-13 13:20:38.000000000 +0200 +++ new/sidplayfp-2.14.0/src/player.cpp 2025-05-11 10:41:13.000000000 +0200 @@ -366,9 +366,7 @@ m_engCfg.defaultC64Model = emulation.modelDefault; m_engCfg.defaultSidModel = emulation.sidModel; m_engCfg.forceSidModel = emulation.forceModel; -#ifdef FEAT_CONFIG_CIAMODEL m_engCfg.ciaModel = emulation.ciaModel; -#endif m_engCfg.frequency = audio.frequency; m_engCfg.samplingMethod = emulation.samplingMethod; m_engCfg.fastSampling = emulation.fastSampling; @@ -810,9 +808,10 @@ } #ifdef FEAT_FILTER_DISABLE - m_engine.filter(0, m_filter.enabled); - m_engine.filter(1, m_filter.enabled); - m_engine.filter(2, m_filter.enabled); + for (int chip=0; chip<3; chip++) + { + m_engine.filter(chip, m_filter.enabled); + } #endif #ifdef FEAT_REGS_DUMP_SID if ( @@ -826,36 +825,38 @@ else m_freqTable = freqTablePal; #endif +#ifdef FEAT_NEW_PLAY_API + m_mixer.initialize(m_engine.installedSIDs(), m_engCfg.playback == SidConfig::STEREO); +#endif + // Start the player. Do this by fast // forwarding to the start position m_driver.selected = &m_driver.null; m_speed.current = m_speed.max; - m_engine.fastForward (100 * m_speed.current); +#ifdef FEAT_NEW_PLAY_API + m_mixer.setFastForward(m_speed.current); +#else + m_engine.fastForward(100 * m_speed.current); +#endif - m_engine.mute(0, 0, m_mute_channel[0]); - m_engine.mute(0, 1, m_mute_channel[1]); - m_engine.mute(0, 2, m_mute_channel[2]); - m_engine.mute(1, 0, m_mute_channel[3]); - m_engine.mute(1, 1, m_mute_channel[4]); - m_engine.mute(1, 2, m_mute_channel[5]); - m_engine.mute(2, 0, m_mute_channel[6]); - m_engine.mute(2, 1, m_mute_channel[7]); - m_engine.mute(2, 2, m_mute_channel[8]); + for (int chip=0; chip<3; chip++) + { + for (int channel=0; channel<3; channel++) + { + m_engine.mute(chip, channel, m_mute_channel[chip*3 + channel]); + } #ifdef FEAT_SAMPLE_MUTE - m_engine.mute(0, 3, m_mute_samples[0]); - m_engine.mute(1, 3, m_mute_samples[1]); - m_engine.mute(2, 3, m_mute_samples[2]); + m_engine.mute(chip, 3, m_mute_samples[chip]); #endif + } // As yet we don't have a required songlength // so try the songlength database or keep the default if (!m_timer.valid) { -#ifdef FEAT_NEW_SONLEGTH_DB - const int_least32_t length = songlengthDB == sldb_t::MD5 ? m_database.lengthMs(m_tune) : (m_database.length(m_tune) * 1000); -#else - const int_least32_t length = m_database.length(m_tune) * 1000; -#endif + const int_least32_t length = songlengthDB == sldb_t::MD5 + ? m_database.lengthMs(m_tune) + : (m_database.length(m_tune) * 1000); if (length > 0) m_timer.length = length; } @@ -938,12 +939,11 @@ } } - // Out play loop to be externally called bool ConsolePlayer::play() { uint_least32_t frames = 0; - if (m_state == playerRunning) + if (m_state == playerRunning) LIKELY { updateDisplay(); @@ -952,8 +952,32 @@ // multiply by number of channels to get the count of 16bit samples const uint_least32_t length = getBufSize() * m_driver.cfg.channels; short *buffer = m_driver.selected->buffer(); +#ifdef FEAT_NEW_PLAY_API + m_mixer.begin(buffer, length); + short* buffers[3]; + m_engine.buffers(buffers); + + do + { + int samples = m_engine.play(2000); + if (samples < 0) UNLIKELY + { + cerr << m_engine.error(); + m_state = playerError; + return false; + } + if (samples > 0) + m_mixer.doMix(buffers, samples); + else break; + } + while (!m_mixer.isFull()); + + // m_engine.play returns the number of 16bit samples + // divide by number of channels to get the count of frames + frames = length / m_driver.cfg.channels; +#else uint_least32_t samples = m_engine.play(buffer, length); - if ((samples < length) || !m_engine.isPlaying()) + if ((samples < length) || !m_engine.isPlaying()) UNLIKELY { cerr << m_engine.error(); m_state = playerError; @@ -962,6 +986,7 @@ // m_engine.play returns the number of 16bit samples // divide by number of channels to get the count of frames frames = samples / m_driver.cfg.channels; +#endif } #ifdef HAVE_UNISTD_H else @@ -970,8 +995,8 @@ switch (m_state) { - case playerRunning: - if (!m_driver.selected->write(frames)) + LIKELY case playerRunning: + if (!m_driver.selected->write(frames)) UNLIKELY { cerr << m_driver.selected->getErrorString(); m_state = playerError; @@ -1025,17 +1050,22 @@ uint_least32_t ConsolePlayer::getBufSize() { - if (m_timer.starting && (m_timer.current >= m_timer.start)) + if (m_timer.starting && (m_timer.current >= m_timer.start)) UNLIKELY { // Switch audio drivers. m_timer.starting = false; m_driver.selected = m_driver.device; m_driver.selected->clearBuffer(); - m_speed.current = 1; +#ifdef FEAT_NEW_PLAY_API + m_mixer.clear(); + m_mixer.setFastForward(1); +#else m_engine.fastForward(100); +#endif + m_speed.current = 1; if (m_cpudebug) m_engine.debug (true, nullptr); } - else if ((m_timer.stop != 0) && (m_timer.current >= m_timer.stop)) + else if ((m_timer.stop != 0) && (m_timer.current >= m_timer.stop)) UNLIKELY { m_state = playerExit; if (m_track.loop) @@ -1070,13 +1100,8 @@ // External Timer Event void ConsolePlayer::updateDisplay() { -#ifdef FEAT_NEW_SONLEGTH_DB const uint_least32_t milliseconds = m_engine.timeMs(); const uint_least32_t seconds = milliseconds / 1000; -#else - const uint_least32_t seconds = m_engine.time(); - const uint_least32_t milliseconds = seconds * 1000; -#endif refreshRegDump(); @@ -1122,11 +1147,7 @@ if (!m_track.single) { // Only select previous song if less than timeout // else restart current song -#ifdef FEAT_NEW_SONLEGTH_DB - const uint_least32_t milliseconds = m_engine.timeMs(); -#else - const uint_least32_t milliseconds = m_engine.time() * 1000; -#endif + const uint_least32_t milliseconds = m_engine.timeMs(); if (milliseconds < SID2_PREV_SONG_TIMEOUT) { m_track.selected--; @@ -1136,17 +1157,25 @@ } break; - case A_UP_ARROW: + case A_UP_ARROW: m_speed.current *= 2; if (m_speed.current > m_speed.max) m_speed.current = m_speed.max; - - m_engine.fastForward (100 * m_speed.current); + +#ifdef FEAT_NEW_PLAY_API + m_mixer.setFastForward(m_speed.current); +#else + m_engine.fastForward(100 * m_speed.current); +#endif break; case A_DOWN_ARROW: m_speed.current = 1; - m_engine.fastForward (100); +#ifdef FEAT_NEW_PLAY_API + m_mixer.setFastForward(1); +#else + m_engine.fastForward(100); +#endif break; case A_HOME: @@ -1237,9 +1266,10 @@ case A_TOGGLE_FILTER: m_filter.enabled = !m_filter.enabled; #ifdef FEAT_FILTER_DISABLE - m_engine.filter(0, m_filter.enabled); - m_engine.filter(1, m_filter.enabled); - m_engine.filter(2, m_filter.enabled); + for (int chip=0; chip<3; chip++) + { + m_engine.filter(chip, m_filter.enabled); + } #else m_engCfg.sidEmulation->filter(m_filter.enabled); #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sidplayfp-2.13.0/src/player.h new/sidplayfp-2.14.0/src/player.h --- old/sidplayfp-2.13.0/src/player.h 2025-04-13 13:20:38.000000000 +0200 +++ new/sidplayfp-2.14.0/src/player.h 2025-05-11 10:41:13.000000000 +0200 @@ -38,6 +38,11 @@ #include "IniConfig.h" #include "setting.h" + +#ifdef FEAT_NEW_PLAY_API +# include <mixer.h> +#endif + #include "sidlib_features.h" #include <string> @@ -186,7 +191,9 @@ int m_channels; int m_precision; int m_buffer_size; - +#ifdef FEAT_NEW_PLAY_API + Mixer m_mixer; +#endif struct m_filter_t { // Filter parameter for reSID diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sidplayfp-2.13.0/src/sidcxx11.h new/sidplayfp-2.14.0/src/sidcxx11.h --- old/sidplayfp-2.13.0/src/sidcxx11.h 2025-04-13 13:20:38.000000000 +0200 +++ new/sidplayfp-2.14.0/src/sidcxx11.h 2025-05-11 10:41:13.000000000 +0200 @@ -1,7 +1,7 @@ /* * This file is part of libsidplayfp, a SID player engine. * - * Copyright 2014-2015 Leandro Nini + * Copyright 2014-2025 Leandro Nini * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,6 +25,15 @@ # include "config.h" #endif +#ifdef HAVE_CXX20 +# define HAVE_CXX17 +# define LIKELY [[ likely ]] +# define UNLIKELY [[ unlikely ]] +#else +# define LIKELY +# define UNLIKELY +#endif + #ifdef HAVE_CXX17 # define HAVE_CXX14 # define MAYBE_UNUSED [[ maybe_unused ]] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sidplayfp-2.13.0/src/sidlib_features.h new/sidplayfp-2.14.0/src/sidlib_features.h --- old/sidplayfp-2.13.0/src/sidlib_features.h 2025-04-13 13:20:38.000000000 +0200 +++ new/sidplayfp-2.14.0/src/sidlib_features.h 2025-05-11 10:41:13.000000000 +0200 @@ -1,7 +1,7 @@ /* * This file is part of sidplayfp, a console SID player. * - * Copyright 2021-2024 Leandro Nini + * Copyright 2021-2025 Leandro Nini * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,17 +23,6 @@ #include <sidplayfp/sidplayfp.h> -#if LIBSIDPLAYFP_VERSION_MAJ > 1 -# define FEAT_CONFIG_CIAMODEL -# define FEAT_NEW_SONLEGTH_DB -# define FEAT_DIGIBOOST -#endif - -#if LIBSIDPLAYFP_VERSION_MAJ > 1 || (LIBSIDPLAYFP_VERSION_MAJ == 1 && LIBSIDPLAYFP_VERSION_MIN >= 8) -# define FEAT_THIRD_SID -# define FEAT_NEW_TUNEINFO_API -#endif - #if LIBSIDPLAYFP_VERSION_MAJ > 2 || (LIBSIDPLAYFP_VERSION_MAJ == 2 && LIBSIDPLAYFP_VERSION_MIN >= 2) # define FEAT_REGS_DUMP_SID # define FEAT_DB_WCHAR_OPEN @@ -49,4 +38,8 @@ # define FEAT_FILTER_DISABLE #endif +#if LIBSIDPLAYFP_VERSION_MAJ > 2 || (LIBSIDPLAYFP_VERSION_MAJ == 2 && LIBSIDPLAYFP_VERSION_MIN >= 14) +# define FEAT_NEW_PLAY_API +#endif + #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sidplayfp-2.13.0/src/stilview.cpp new/sidplayfp-2.14.0/src/stilview.cpp --- old/sidplayfp-2.13.0/src/stilview.cpp 2025-04-13 13:20:38.000000000 +0200 +++ new/sidplayfp-2.14.0/src/stilview.cpp 2025-05-11 10:41:13.000000000 +0200 @@ -1,7 +1,7 @@ /* * This file is part of sidplayfp, a console SID player. * - * Copyright 2012-2024 Leandro Nini + * Copyright 2012-2025 Leandro Nini * Copyright 1998, 2002 LaLa <l...@c64.org> * * This program is free software; you can redistribute it and/or modify @@ -263,7 +263,7 @@ hvscLoc = new char[STIL_MAX_PATH_SIZE]; cout << "Enter HVSC base directory: "; cin.width(STIL_MAX_PATH_SIZE); - cin >> hvscLoc; + cin >> *hvscLoc; } else {