diff --git a/src/IniConfig.cpp b/src/IniConfig.cpp index acb9ffa..8045bf2 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-2020 Leandro Nini + * Copyright 2011-2021 Leandro Nini * Copyright 2000-2001 Simon White * * This program is free software; you can redistribute it and/or modify @@ -110,7 +110,9 @@ void IniConfig::clear() emulation_s.modelForced = false; emulation_s.sidModel = SidConfig::MOS6581; emulation_s.forceModel = false; +#if LIBSIDPLAYFP_VERSION_MAJ > 1 emulation_s.ciaModel = SidConfig::MOS6526; +#endif emulation_s.filter = true; emulation_s.engine.clear(); @@ -380,7 +382,7 @@ void IniConfig::readEmulation(iniHandler &ini) readBool(ini, TEXT("ForceC64Model"), emulation_s.modelForced); readBool(ini, TEXT("DigiBoost"), emulation_s.digiboost); - +#if LIBSIDPLAYFP_VERSION_MAJ > 1 { SID_STRING str = readString(ini, TEXT("CiaModel")); if (!str.empty()) @@ -391,7 +393,7 @@ void IniConfig::readEmulation(iniHandler &ini) emulation_s.ciaModel = SidConfig::MOS8521; } } - +#endif { SID_STRING str = readString(ini, TEXT("SidModel")); if (!str.empty()) diff --git a/src/IniConfig.h b/src/IniConfig.h index bcf9760..3643c90 100644 --- a/src/IniConfig.h +++ b/src/IniConfig.h @@ -1,7 +1,7 @@ /* * This file is part of sidplayfp, a console SID player. * - * Copyright 2011-2019 Leandro Nini + * Copyright 2011-2021 Leandro Nini * Copyright 2000 Simon White * * This program is free software; you can redistribute it and/or modify @@ -71,7 +71,9 @@ class IniConfig bool modelForced; SidConfig::sid_model_t sidModel; bool forceModel; +#if LIBSIDPLAYFP_VERSION_MAJ > 1 SidConfig::cia_model_t ciaModel; +#endif bool digiboost; bool filter; double bias; diff --git a/src/args.cpp b/src/args.cpp index 6e09adc..6b98f0a 100644 --- a/src/args.cpp +++ b/src/args.cpp @@ -1,7 +1,7 @@ /* * This file is part of sidplayfp, a console SID player. * - * Copyright 2011-2020 Leandro Nini + * Copyright 2011-2021 Leandro Nini * Copyright 2000-2001 Simon White * * This program is free software; you can redistribute it and/or modify @@ -312,11 +312,12 @@ int ConsolePlayer::args(int argc, const char *argv[]) { m_engCfg.defaultSidModel = SidConfig::MOS8580; } +#if LIBSIDPLAYFP_VERSION_MAJ > 1 else if (strcmp (&argv[i][1], "-digiboost") == 0) { m_engCfg.digiBoost = true; } - +#endif // Video/Verbose Options else if (strcmp (&argv[i][1], "vnf") == 0) { @@ -612,8 +613,9 @@ void ConsolePlayer::displayArgs (const char *arg) << " -m[f] set SID new/old chip model (default: old)" << endl << " Use 'f' to force the model" << endl +#if LIBSIDPLAYFP_VERSION_MAJ > 1 << " --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 diff --git a/src/menu.cpp b/src/menu.cpp index 459f77d..c2de8ad 100644 --- a/src/menu.cpp +++ b/src/menu.cpp @@ -1,7 +1,7 @@ /* * This file is part of sidplayfp, a console SID player. * - * Copyright 2011-2019 Leandro Nini + * Copyright 2011-2021 Leandro Nini * Copyright 2000-2001 Simon White * * This program is free software; you can redistribute it and/or modify @@ -351,13 +351,13 @@ void ConsolePlayer::menu () cerr << " SID Filter : "; consoleColour (white, false); cerr << (m_filter.enabled ? "Yes" : "No") << endl; - +#if LIBSIDPLAYFP_VERSION_MAJ > 1 consoleTable (tableMiddle); consoleColour (yellow, true); cerr << " DigiBoost : "; consoleColour (white, false); cerr << (m_engCfg.digiBoost ? "Yes" : "No") << endl; - +#endif consoleTable (tableMiddle); consoleColour (yellow, true); cerr << " SID Model : "; diff --git a/src/player.cpp b/src/player.cpp index 20f40ec..cb55269 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -561,7 +561,11 @@ bool ConsolePlayer::open (void) // so try the songlength database or keep the default if (!m_timer.valid) { +#if LIBSIDPLAYFP_VERSION_MAJ > 1 const int_least32_t length = newSonglengthDB ? m_database.lengthMs(m_tune) : (m_database.length(m_tune) * 1000); +#else + const int_least32_t length = m_database.length(m_tune) * 1000; +#endif if (length > 0) m_timer.length = length; } @@ -717,9 +721,13 @@ void ConsolePlayer::stop () // External Timer Event void ConsolePlayer::updateDisplay() { +#if LIBSIDPLAYFP_VERSION_MAJ > 1 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 if (!m_quietLevel && (seconds != (m_timer.current / 1000))) { cerr << "\b\b\b\b\b" << std::setw(2) << std::setfill('0') @@ -791,7 +799,12 @@ void ConsolePlayer::decodeKeys () if (!m_track.single) { // Only select previous song if less than timeout // else restart current song - if ((m_engine.timeMs()) < SID2_PREV_SONG_TIMEOUT) +#if LIBSIDPLAYFP_VERSION_MAJ > 1 + const uint_least32_t milliseconds = m_engine.timeMs(); +#else + const uint_least32_t milliseconds = m_engine.time() * 1000; +#endif + if (milliseconds < SID2_PREV_SONG_TIMEOUT) { m_track.selected--; if (m_track.selected < 1)