Mercurial > hg > xmms-sid
comparison src/xs_sidplay2.cc @ 710:a6283cf95c99
Updated to work with latest distortion patched libSIDPlay2+reSID from Antti
Lankila.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 09 Feb 2009 11:12:17 +0200 |
parents | b5b6b13a6d85 |
children | 5923dfff1fac |
comparison
equal
deleted
inserted
replaced
709:5ed24c6b6ac4 | 710:a6283cf95c99 |
---|---|
237 | 237 |
238 } | 238 } |
239 break; | 239 break; |
240 } | 240 } |
241 | 241 |
242 #ifdef HAVE_SIDPLAY2_DISTORTION | |
243 XSDEBUG("filter setting NOT supported for distortion patched libSIDPlay2.\n"); | |
244 #else | |
242 /* Convert filter */ | 245 /* Convert filter */ |
243 f = &(xs_cfg.sid2Filter); | 246 f = &(xs_cfg.sid2Filter); |
244 XSDEBUG("using filter '%s', %d points\n", f->name, f->npoints); | 247 XSDEBUG("using filter '%s', %d points\n", f->name, f->npoints); |
245 if (f->npoints > XS_SIDPLAY2_NFPOINTS) { | 248 if (f->npoints > XS_SIDPLAY2_NFPOINTS) { |
246 xs_error("[SIDPlay2] Invalid number of filter curve points (%d > %d)\n", | 249 xs_error("[SIDPlay2] Invalid number of filter curve points (%d > %d)\n", |
251 tmpFilter.points = f->npoints; | 254 tmpFilter.points = f->npoints; |
252 for (i = 0; i < f->npoints; i++) { | 255 for (i = 0; i < f->npoints; i++) { |
253 tmpFilter.cutoff[i][0] = f->points[i].x; | 256 tmpFilter.cutoff[i][0] = f->points[i].x; |
254 tmpFilter.cutoff[i][1] = f->points[i].y; | 257 tmpFilter.cutoff[i][1] = f->points[i].y; |
255 } | 258 } |
259 #endif | |
256 | 260 |
257 /* Initialize builder object */ | 261 /* Initialize builder object */ |
258 XSDEBUG("init builder #%i, maxsids=%i\n", xs_cfg.sid2Builder, (myEngine->currEng->info()).maxsids); | 262 XSDEBUG("init builder #%i, maxsids=%i\n", xs_cfg.sid2Builder, (myEngine->currEng->info()).maxsids); |
259 #ifdef HAVE_RESID_BUILDER | 263 #ifdef HAVE_RESID_BUILDER |
260 if (xs_cfg.sid2Builder == XS_BLD_RESID) { | 264 if (xs_cfg.sid2Builder == XS_BLD_RESID) { |
287 rs->sampling(tmpFreq); | 291 rs->sampling(tmpFreq); |
288 if (!*rs) { | 292 if (!*rs) { |
289 xs_error("reSID->sampling(%d) failed.\n", tmpFreq); | 293 xs_error("reSID->sampling(%d) failed.\n", tmpFreq); |
290 return FALSE; | 294 return FALSE; |
291 } | 295 } |
292 #endif | |
293 | |
294 if (tmpFilter.points > 0) | 296 if (tmpFilter.points > 0) |
295 rs->filter((sid_filter_t *) &tmpFilter); | 297 rs->filter((sid_filter_t *) &tmpFilter); |
296 else | 298 else |
299 #endif | |
297 rs->filter((sid_filter_t *) NULL); | 300 rs->filter((sid_filter_t *) NULL); |
298 | 301 |
299 if (!*rs) { | 302 if (!*rs) { |
300 xs_error("reSID->filter(NULL) failed.\n"); | 303 xs_error("reSID->filter(NULL) failed.\n"); |
301 return FALSE; | 304 return FALSE; |
357 break; | 360 break; |
358 } | 361 } |
359 | 362 |
360 | 363 |
361 /* Configure rest of the emulation */ | 364 /* Configure rest of the emulation */ |
362 | |
363 if (xs_cfg.forceSpeed) { | 365 if (xs_cfg.forceSpeed) { |
364 myEngine->currConfig.clockForced = true; | 366 myEngine->currConfig.clockForced = true; |
365 myEngine->currConfig.clockSpeed = myEngine->currConfig.clockDefault; | 367 myEngine->currConfig.clockSpeed = myEngine->currConfig.clockDefault; |
366 } else { | 368 } else { |
367 myEngine->currConfig.clockForced = false; | 369 myEngine->currConfig.clockForced = false; |
368 myEngine->currConfig.clockSpeed = SID2_CLOCK_CORRECT; | 370 myEngine->currConfig.clockSpeed = SID2_CLOCK_CORRECT; |
369 } | 371 } |
370 | 372 |
373 | |
374 #ifndef HAVE_SIDPLAY2_DISTORTION | |
371 if ((xs_cfg.sid2OptLevel >= 0) && (xs_cfg.sid2OptLevel <= SID2_MAX_OPTIMISATION)) | 375 if ((xs_cfg.sid2OptLevel >= 0) && (xs_cfg.sid2OptLevel <= SID2_MAX_OPTIMISATION)) |
372 myEngine->currConfig.optimisation = xs_cfg.sid2OptLevel; | 376 myEngine->currConfig.optimisation = xs_cfg.sid2OptLevel; |
373 else { | 377 else { |
374 xs_error("Invalid sid2OptLevel=%d, falling back to %d.\n", | 378 xs_error("Invalid sid2OptLevel=%d, falling back to %d.\n", |
375 xs_cfg.sid2OptLevel, SID2_DEFAULT_OPTIMISATION); | 379 xs_cfg.sid2OptLevel, SID2_DEFAULT_OPTIMISATION); |
376 | 380 |
377 xs_cfg.sid2OptLevel = | 381 xs_cfg.sid2OptLevel = |
378 myEngine->currConfig.optimisation = SID2_DEFAULT_OPTIMISATION; | 382 myEngine->currConfig.optimisation = SID2_DEFAULT_OPTIMISATION; |
379 } | 383 } |
384 #endif | |
380 | 385 |
381 if (xs_cfg.mos8580) | 386 if (xs_cfg.mos8580) |
382 myEngine->currConfig.sidDefault = SID2_MOS8580; | 387 myEngine->currConfig.sidDefault = SID2_MOS8580; |
383 else | 388 else |
384 myEngine->currConfig.sidDefault = SID2_MOS6581; | 389 myEngine->currConfig.sidDefault = SID2_MOS6581; |