Skip to content

Commit

Permalink
sid: Fix deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
radioactiveman committed Nov 2, 2024
1 parent ac48256 commit d8dd26f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/sid/xs_sidplay2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@
#include <libaudcore/runtime.h>
#include <libaudcore/vfs.h>

#if (LIBSIDPLAYFP_VERSION_MAJ > 2) || \
(LIBSIDPLAYFP_VERSION_MAJ == 2 && LIBSIDPLAYFP_VERSION_MIN >= 10)
#define HAVE_SIDPLAYFP_2_10
#endif

struct SidState {
sidplayfp *currEng;
sidbuilder *currBuilder;
Expand Down Expand Up @@ -99,11 +104,13 @@ bool xs_sidplayfp_init()
return false;
}

#ifndef HAVE_SIDPLAYFP_2_10
state.currBuilder->filter(xs_cfg.emulateFilters);
if (!state.currBuilder->getStatus()) {
AUDERR("reSID->filter(%d) failed.\n", xs_cfg.emulateFilters);
return false;
}
#endif

config.sidEmulation = state.currBuilder;

Expand Down Expand Up @@ -139,6 +146,13 @@ bool xs_sidplayfp_init()
return false;
}

#ifdef HAVE_SIDPLAYFP_2_10
/* Call filter() after config() to have an effect */
state.currEng->filter(0, xs_cfg.emulateFilters);
state.currEng->filter(1, xs_cfg.emulateFilters);
state.currEng->filter(2, xs_cfg.emulateFilters);
#endif

/* Load ROMs */
VFSFile kernal_file("file://" SIDDATADIR "/sidplayfp/kernal", "r");
VFSFile basic_file("file://" SIDDATADIR "/sidplayfp/basic", "r");
Expand Down

0 comments on commit d8dd26f

Please sign in to comment.