Mercurial > hg > xmms-sid
comparison src/xs_sidplayfp.cpp @ 838:ae1f6418d093
libSIDPlay2-FP backend interface is now in a separate module. Configuration
related things still pending.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 08 Nov 2012 21:24:38 +0200 |
parents | d508c7c4bc69 |
children | 5b93bd8c7814 |
comparison
equal
deleted
inserted
replaced
837:5b3e2116408f | 838:ae1f6418d093 |
---|---|
1 /* | 1 /* |
2 XMMS-SID - SIDPlay input plugin for X MultiMedia System (XMMS) | 2 XMMS-SID - SIDPlay input plugin for X MultiMedia System (XMMS) |
3 | 3 |
4 libSIDPlay v2-FP support | 4 libSIDPlay2-FP support |
5 | 5 |
6 Programmed and designed by Matti 'ccr' Hamalainen <ccr@tnsp.org> | 6 Programmed and designed by Matti 'ccr' Hamalainen <ccr@tnsp.org> |
7 (C) Copyright 1999-2012 Tecnic Software productions (TNSP) | 7 (C) Copyright 1999-2012 Tecnic Software productions (TNSP) |
8 | 8 |
9 This program is free software; you can redistribute it and/or modify | 9 This program is free software; you can redistribute it and/or modify |
20 with this program; if not, write to the Free Software Foundation, Inc., | 20 with this program; if not, write to the Free Software Foundation, Inc., |
21 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | 21 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
22 */ | 22 */ |
23 #include "xmms-sid.h" | 23 #include "xmms-sid.h" |
24 | 24 |
25 #ifdef HAVE_SIDPLAY2_FP | 25 #ifdef HAVE_SIDPLAYFP |
26 | 26 |
27 #include <stdio.h> | 27 #include "xs_sidplayfp.h" |
28 #include "xs_sidplay2.h" | 28 #include "xs_slsup.h" |
29 #include "xs_config.h" | 29 #include "xs_config.h" |
30 | 30 |
31 | 31 |
32 #ifdef HAVE_SIDPLAY2_FP_V1 | 32 #ifdef HAVE_SIDPLAYFP_V1 |
33 # include <sidplayfp/SidTune.h> | 33 # include <sidplayfp/SidTune.h> |
34 # include <sidplayfp/sidplayfp.h> | 34 # include <sidplayfp/sidplayfp.h> |
35 # include <sidplayfp/event.h> | 35 # include <sidplayfp/event.h> |
36 # include <sidplayfp/SidConfig.h> | 36 # include <sidplayfp/SidConfig.h> |
37 # include <sidplayfp/SidTuneInfo.h> | 37 # include <sidplayfp/SidTuneInfo.h> |
42 #endif | 42 #endif |
43 | 43 |
44 | 44 |
45 class XSSIDPlayFP { | 45 class XSSIDPlayFP { |
46 public: | 46 public: |
47 #ifdef HAVE_SIDPLAY2_FP_V1 | 47 #ifdef HAVE_SIDPLAYFP_V1 |
48 sidplayfp emu; | 48 sidplayfp emu; |
49 SidConfig config; | 49 SidConfig config; |
50 #else | 50 #else |
51 sidplay2 emu; | 51 sidplay2 emu; |
52 sid2_config_t config; | 52 sid2_config_t config; |
53 #endif | 53 #endif |
54 SidTune tune; | 54 SidTuneMod tune; |
55 | 55 |
56 XSSIDPlayFP(void); | 56 XSSIDPlayFP(void); |
57 virtual ~XSSIDPlayFP(void); | 57 virtual ~XSSIDPlayFP(void); |
58 }; | 58 }; |
59 | 59 |
60 | 60 |
61 #ifdef HAVE_RESID_BUILDER | 61 #ifdef HAVE_RESID_FP_BUILDER |
62 # include <sidplayfp/builders/residfp.h> | 62 # include <sidplayfp/builders/residfp.h> |
63 #endif | |
64 | |
65 #ifdef HAVE_RESID_FP_BUILDER | |
63 # include <sidplayfp/builders/resid.h> | 66 # include <sidplayfp/builders/resid.h> |
64 #endif | 67 #endif |
65 | 68 |
66 #ifdef HAVE_HARDSID_BUILDER | 69 #ifdef HAVE_HARDSID_BUILDER |
67 # include <sidplayfp/builders/hardsid.h> | 70 # include <sidplayfp/builders/hardsid.h> |
89 #define TFUNCTION2 xs_sidplayfp_updateinfo | 92 #define TFUNCTION2 xs_sidplayfp_updateinfo |
90 #define TENGINE XSSIDPlayFP | 93 #define TENGINE XSSIDPlayFP |
91 #define TTUNEINFO SidTuneInfo | 94 #define TTUNEINFO SidTuneInfo |
92 #define TTUNE SidTune | 95 #define TTUNE SidTune |
93 | 96 |
94 #ifdef HAVE_SIDPLAY2_FP_V1 | 97 #ifdef HAVE_SIDPLAYFP_V1 |
95 #define sid2_mono SidConfig::MONO | 98 #define sid2_mono SidConfig::MONO |
96 #define sid2_stereo SidConfig::STEREO | 99 #define sid2_stereo SidConfig::STEREO |
97 #define SID2_MOS8580 SidConfig::MOS8580 | 100 #define SID2_MOS8580 SidConfig::MOS8580 |
98 #define SID2_MOS6581 SidConfig::MOS6581 | 101 #define SID2_MOS6581 SidConfig::MOS6581 |
99 #define SID2_CLOCK_PAL SidConfig::CLOCK_PAL | 102 #define SID2_CLOCK_PAL SidConfig::CLOCK_PAL |
158 { | 161 { |
159 #ifdef HAVE_RESID_BUILDER | 162 #ifdef HAVE_RESID_BUILDER |
160 case XS_BLD_RESID: | 163 case XS_BLD_RESID: |
161 { | 164 { |
162 ReSIDBuilder *rs = new ReSIDBuilder("ReSID builder"); | 165 ReSIDBuilder *rs = new ReSIDBuilder("ReSID builder"); |
163 #ifdef HAVE_SIDPLAY2_FP_V1 | 166 #ifdef HAVE_SIDPLAYFP_V1 |
164 if (rs && rs->getStatus()) | 167 if (rs && rs->getStatus()) |
165 { | 168 { |
166 } | 169 } |
167 #else | 170 #else |
168 if (rs) | 171 if (rs) |
171 if (!*rs) return FALSE; | 174 if (!*rs) return FALSE; |
172 rs->create((engine->emu.info()).maxsids); | 175 rs->create((engine->emu.info()).maxsids); |
173 if (!*rs) return FALSE; | 176 if (!*rs) return FALSE; |
174 rs->bias(0.0f); | 177 rs->bias(0.0f); |
175 } | 178 } |
176 #endif // HAVE_SIDPLAY2_FP_V1 | 179 #endif // HAVE_SIDPLAYFP_V1 |
177 } | 180 } |
178 break; | 181 break; |
179 #endif // HAVE_RESID_BUILDER | 182 #endif // HAVE_RESID_BUILDER |
180 | 183 |
181 | 184 |
253 | 256 |
254 /* Configure rest of the emulation */ | 257 /* Configure rest of the emulation */ |
255 engine->config.sidDefault = xs_cfg.mos8580 ? SID2_MOS8580 : SID2_MOS6581; | 258 engine->config.sidDefault = xs_cfg.mos8580 ? SID2_MOS8580 : SID2_MOS6581; |
256 engine->config.clockForced = xs_cfg.forceSpeed; | 259 engine->config.clockForced = xs_cfg.forceSpeed; |
257 | 260 |
258 #ifndef HAVE_SIDPLAY2_FP_V1 | 261 #ifndef HAVE_SIDPLAYFP_V1 |
259 engine->config.sidSamples = TRUE; | 262 engine->config.sidSamples = TRUE; |
260 engine->config.sidModel = xs_cfg.forceModel ? engine->config.sidDefault : SID2_MODEL_CORRECT; | 263 engine->config.sidModel = xs_cfg.forceModel ? engine->config.sidDefault : SID2_MODEL_CORRECT; |
261 engine->config.clockSpeed = xs_cfg.forceSpeed ? engine->config.clockDefault : SID2_CLOCK_CORRECT; | 264 engine->config.clockSpeed = xs_cfg.forceSpeed ? engine->config.clockDefault : SID2_CLOCK_CORRECT; |
262 #endif | 265 #endif |
263 | 266 |
357 | 360 |
358 /* Delete INTERNAL information | 361 /* Delete INTERNAL information |
359 */ | 362 */ |
360 void xs_sidplayfp_delete(XSEngineState * state) | 363 void xs_sidplayfp_delete(XSEngineState * state) |
361 { | 364 { |
362 XSSIDPlayFP *engine = (XSSIDPlayFP *) state->internal; | 365 (void) state; |
366 // XSSIDPlayFP *engine = (XSSIDPlayFP *) state->internal; | |
363 } | 367 } |
364 | 368 |
365 | 369 |
366 /* Hardware backend flushing | 370 /* Hardware backend flushing |
367 */ | 371 */ |
377 #endif | 381 #endif |
378 } | 382 } |
379 | 383 |
380 | 384 |
381 } /* extern "C" */ | 385 } /* extern "C" */ |
382 #endif /* HAVE_SIDPLAY2_FP */ | 386 #endif /* HAVE_SIDPLAYFP */ |