rmv interleaving output

master
Frank Bösing 8 years ago
parent 6b5d9e4609
commit 7d05958338
  1. 16
      reSID/sid.cc
  2. 10
      reSID/sid.h

@ -676,14 +676,14 @@ void SID::clock(cycle_count delta_t)
// } // }
// //
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
int SID::clock(cycle_count& delta_t, short* buf, int n, int interleave) int SID::clock(cycle_count& delta_t, short* buf, int n)
{ {
switch (sampling) { switch (sampling) {
default: default:
case SAMPLE_FAST: case SAMPLE_FAST:
return clock_fast(delta_t, buf, n, interleave); return clock_fast(delta_t, buf, n);
case SAMPLE_INTERPOLATE: case SAMPLE_INTERPOLATE:
return clock_interpolate(delta_t, buf, n, interleave); return clock_interpolate(delta_t, buf, n);
} }
} }
@ -691,8 +691,7 @@ int SID::clock(cycle_count& delta_t, short* buf, int n, int interleave)
// SID clocking with audio sampling - delta clocking picking nearest sample. // SID clocking with audio sampling - delta clocking picking nearest sample.
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
RESID_INLINE RESID_INLINE
int SID::clock_fast(cycle_count& delta_t, short* buf, int n, int SID::clock_fast(cycle_count& delta_t, short* buf, int n)
int interleave)
{ {
int s = 0; int s = 0;
@ -708,7 +707,7 @@ int SID::clock_fast(cycle_count& delta_t, short* buf, int n,
clock(delta_t_sample); clock(delta_t_sample);
delta_t -= delta_t_sample; delta_t -= delta_t_sample;
sample_offset = (next_sample_offset & FIXP_MASK) - (1 << (FIXP_SHIFT - 1)); sample_offset = (next_sample_offset & FIXP_MASK) - (1 << (FIXP_SHIFT - 1));
buf[s++*interleave] = output(); buf[s++] = output();
} }
clock(delta_t); clock(delta_t);
@ -728,8 +727,7 @@ int SID::clock_fast(cycle_count& delta_t, short* buf, int n,
// sampling noise. // sampling noise.
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
RESID_INLINE RESID_INLINE
int SID::clock_interpolate(cycle_count& delta_t, short* buf, int n, int SID::clock_interpolate(cycle_count& delta_t, short* buf, int n)
int interleave)
{ {
int s = 0; int s = 0;
int i; int i;
@ -755,7 +753,7 @@ int SID::clock_interpolate(cycle_count& delta_t, short* buf, int n,
sample_offset = next_sample_offset & FIXP_MASK; sample_offset = next_sample_offset & FIXP_MASK;
short sample_now = output(); short sample_now = output();
buf[s++*interleave] = buf[s++] =
sample_prev + (sample_offset*(sample_now - sample_prev) >> FIXP_SHIFT); sample_prev + (sample_offset*(sample_now - sample_prev) >> FIXP_SHIFT);
sample_prev = sample_now; sample_prev = sample_now;
} }

@ -47,7 +47,7 @@ public:
void clock(); void clock();
void clock(cycle_count delta_t); void clock(cycle_count delta_t);
int clock(cycle_count& delta_t, short* buf, int n, int interleave = 1); int clock(cycle_count& delta_t, short* buf, int n);
void reset(); void reset();
// Read/write registers. // Read/write registers.
@ -90,12 +90,10 @@ public:
protected: protected:
RESID_INLINE int clock_fast(cycle_count& delta_t, short* buf, int n, RESID_INLINE int clock_fast(cycle_count& delta_t, short* buf, int n);
int interleave); RESID_INLINE int clock_interpolate(cycle_count& delta_t, short* buf, int n);
RESID_INLINE int clock_interpolate(cycle_count& delta_t, short* buf, int n,
int interleave);
Voice voice[3]; Voice voice[3];
Filter filter; Filter filter;
ExternalFilter extfilt; ExternalFilter extfilt;
Potentiometer potx; Potentiometer potx;

Loading…
Cancel
Save