diff --git a/doc/en/sidplayfp.ini.pod b/doc/en/sidplayfp.ini.pod index 7343540..896172c 100644 --- a/doc/en/sidplayfp.ini.pod +++ b/doc/en/sidplayfp.ini.pod @@ -228,6 +228,11 @@ Controls the filter curve for the 8580 model in the ReSIDfp emulation. Ranges from 0.0 (light) to 1.0 (dark), the default value is 0.5. +=item B=I<< >> + +Controls the combined waveforms strength in the ReSIDfp +emulation. The default value is AVERAGE. + =item B=I<< >> The c64 power on delay as number of cpu cycles. diff --git a/src/IniConfig.cpp b/src/IniConfig.cpp index d274f5e..645f6aa 100644 --- a/src/IniConfig.cpp +++ b/src/IniConfig.cpp @@ -1,7 +1,7 @@ /* * This file is part of sidplayfp, a console SID player. * - * Copyright 2011-2023 Leandro Nini + * Copyright 2011-2024 Leandro Nini * Copyright 2000-2001 Simon White * * This program is free software; you can redistribute it and/or modify @@ -123,6 +123,7 @@ void IniConfig::clear() emulation_s.filterRange6581 = 0.5; #endif emulation_s.filterCurve8580 = 0.5; + emulation_s.combinedWaveformsStrength = SidConfig::AVERAGE; emulation_s.powerOnDelay = -1; emulation_s.samplingMethod = SidConfig::RESAMPLE_INTERPOLATE; emulation_s.fastSampling = false; @@ -434,6 +435,19 @@ void IniConfig::readEmulation(iniHandler &ini) #endif readDouble(ini, TEXT("FilterCurve8580"), emulation_s.filterCurve8580); + { + SID_STRING str = readString(ini, TEXT("CombinedWaveforms")); + if (!str.empty()) + { + if (str.compare(TEXT("AVERAGE")) == 0) + emulation_s.combinedWaveformsStrength = SidConfig::AVERAGE; + else if (str.compare(TEXT("WEAK")) == 0) + emulation_s.combinedWaveformsStrength = SidConfig::WEAK; + else if (str.compare(TEXT("STRONG")) == 0) + emulation_s.combinedWaveformsStrength = SidConfig::STRONG; + } + } + readInt(ini, TEXT("PowerOnDelay"), emulation_s.powerOnDelay); { diff --git a/src/IniConfig.h b/src/IniConfig.h index e0a06ac..f1a2f03 100644 --- a/src/IniConfig.h +++ b/src/IniConfig.h @@ -86,6 +86,7 @@ class IniConfig double filterRange6581; #endif double filterCurve8580; + SidConfig::sid_cw_t combinedWaveformsStrength; int powerOnDelay; SidConfig::sampling_method_t samplingMethod; bool fastSampling; diff --git a/src/player.cpp b/src/player.cpp index d23816e..80e5a33 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -372,6 +372,7 @@ ConsolePlayer::ConsolePlayer (const char * const name) : m_filter.filterRange6581 = emulation.filterRange6581; #endif m_filter.filterCurve8580 = emulation.filterCurve8580; + m_combinedWaveformsStrength = emulation.combinedWaveformsStrength; if (emulation.powerOnDelay >= 0) m_engCfg.powerOnDelay = emulation.powerOnDelay; @@ -595,6 +596,8 @@ bool ConsolePlayer::createSidEmu (SIDEMUS emu, const SidTuneInfo *tuneInfo) rs->create ((m_engine.info ()).maxsids()); if (!rs->getStatus()) goto createSidEmu_error; + rs->combinedWaveformsStrength(m_combinedWaveformsStrength); + #ifdef FEAT_FILTER_RANGE double frange = -1.0; if (m_autofilter && (tuneInfo->numberOfInfoStrings() == 3)) diff --git a/src/player.h b/src/player.h index d1e6b44..d20aaab 100644 --- a/src/player.h +++ b/src/player.h @@ -128,6 +128,8 @@ class ConsolePlayer double m_fcurve; + SidConfig::sid_cw_t m_combinedWaveformsStrength; + uint8_t m_registers[3][32]; uint16_t* m_freqTable; diff --git a/src/sidlib_features.h b/src/sidlib_features.h index 62b89ef..bb8d9e5 100644 --- a/src/sidlib_features.h +++ b/src/sidlib_features.h @@ -1,7 +1,7 @@ /* * This file is part of sidplayfp, a console SID player. * - * Copyright 2024 Leandro Nini + * Copyright 2021-2024 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 @@ -41,6 +41,7 @@ #if LIBSIDPLAYFP_VERSION_MAJ > 2 || (LIBSIDPLAYFP_VERSION_MAJ == 2 && LIBSIDPLAYFP_VERSION_MIN >= 7) # define FEAT_FILTER_RANGE +# define FEAT_CW_STRENGTH #endif #endif