2009-03-13  Antti S. Lankila  <alankila@bel.fi>

        Sync against V34. Functional changes below.

        * filter.h: finalize n-well layer state variable mixup.

        * wave.cc: new combined waveforms according to updated optimizer.

        Optimizing changes below. These appear to give ~15 % speed boost.

        * configure.in: Turn on -ffast-math.

        * wave.h: optimize accumulator to drop high bits into bit bucket and
          save an AND. Streamline output functions.

        * envelope.h: implement muting here instead of at voice.h, at vanishing
          CPU cost.

        * filter.h: Fold easily foldable constants at setup code, speeding up
          hot path.

2009-02-22  Antti S. Lankila  <alankila@bel.fi>

        Sync against V32.

        * filter.h: tune clipping distortion against newest changes.

        * wave.h, wave.cc: remove unnecessary methods. Fit combined waveforms
          against samplings using external program. Fix noise waveform offset.
          Make waveforms 5, 6 and 7 quieter when pulse is off.

        * envelope.cc: use perfect envelope DAC.

2009-02-17  Antti S. Lankila  <alankila@bel.fi>

        Sync against V31 beta.

        * filter.h: tune 6581 clipping distortion.

        * filer.cc: fix 6581/8580 use of uninitialized values at start.

        * sid.cc, voice.h, voice.cc, wave.h, wave.cc: Derive combined
          waveforms from measurements provided one year ago by kevtris.
          The combined waveforms are currently not tunable. The chosen chips
          produce somewhat untypical 6581R3 sound. 8580 may be correct enough,
          though.

        * wave6581*, wave8580*, samp2src.pl: Deleted.

2009-01-18  Antti S. Lankila  <alankila@bel.fi>

        Sync against V30 patch version. Filter updates described below.

        * filter.h: Add direct mixing between lp-hp. Reduce mixing factor
          to half to compensate.

        * filter.h, filter.cc: Repurpose tunable distortion_rate. It now sets
          the highpass level in relation to unfiltered output. -6 dB or 0.5 is
          approximately correct.

        * resid-fp/filter.h: Reduce the level difference between the lp, bp and hp.

        * filter.cc: Slightly more resonance for 8580 (Q in [0.7, 2.3]).

        * ../sid/sid.cc: Tweak distortion parameters.

        Features from V30-devel:

        * filter.h: add bit of lowpass inverted into bandpass in proportion to
          enabled resonance level. This seems to happen, but no idea why...

2008-12-05  Antti S. Lankila  <alankila@bel.fi>

	Sync against V27 patch version. Filter updates described below.

	* Reduce Q maximum to 2.2 or so. This may still be slightly too much,
	  but it's hard to say exactly...

	* Arrange for about 3 dB boost of lowpass output that is independent
	  of state variable mixing or other feedback. This seems to produce
	  the right kind of sounds for songs like AMJ's Blasphemy.

	* Assume that bp is slightly louder than bp (= more distorted).
	  This seems to help against very large number of songs which sport
	  lead sounds and effects distorted in a smooth, bassy way.

	* Parameter tuneup.

2008-10-31  Antti S. Lankila  <alankila@bel.fi>

	Sync against V25 patch version. Filter updates described below.

	* Tweak filter algorithm to do some state variable mixing in the
	  6581 code path. This corresponds with assumed output impedance of
	  the SID "amplifiers", and is separate effect to the output strip
	  backmixing.
	
	* Retire the V24 attempt of dynamically adjusting BP distortion
	  threshold. It doesn't really seem to work.

	* Increase Q value maximum to 2.5. This may be too much, but it sounds
	  fine to me.

	* JT's Star Ball was very distorted when played by V24.  This related
	  to the hardclipping I had assumed to occur in the filter output amp,
	  but maybe that theory is incorrect. I now only add distortion to the
	  unfiltered voice path, but I'm not happy about it.

2008-08-29  Antti S. Lankila  <alankila@bel.fi>

	* Optimized resampling to be about 2x faster through using aliasing
	  to increase passband width and hence reduce FIR length.
	  
	* Fixed some valgrind warnings.
	
	* Added nuke_denormals() method to periodically flush these to zero, as
	  this can only be done for SSE registers by the FPU and we can't use
	  any in order to support CPUs older than P3.

	* Marco, Hannu and me developed a runtime switching system
	  that detects SSE from cpuinfo and calls some SSE routines when they
	  are compiled in and the CPU can support them. We lost only very
	  little performance, but gained compatibility to very, very old
	  hardware.
	  
	* The old code for ST_lockup proved unnecessary, so it is now removed. 

2008-08-21  Antti S. Lankila  <alankila@bel.fi>

	* Fixed a bug where nonlinearity setting appeared to get lost, and
	  kenchis discovered further bugs in it. Oh well.

	* I removed a lot of code associated with the lower quality modes of
	  ReSID, and only left the 1 MHz clock routines. Analysis shows that the
	  filter code is a major culprit, but the digital side emulation is not
	  completely cheap, either. I already added some small hacks to optimize
	  it, and I now think about reinjecting pieces of those clocking modes
	  that run the analog parts with reduced accuracy.

	* I defined type4 filters based on equation of straight line. These are
	  characterized by parameters k and b, and the equation is
	  freq = k * fc. Strictly speaking, straight line is not 100 %
	  accurate, and a 2nd degree component would help, but based on
	  measurements against two of Trurl's 8580s, the maximum error
	  introduced using linear approximation is mere 3 %.

2008-08-10  Antti S. Lankila  <alankila@bel.fi>

	* I ripped off Type1 definitions from the filter, and the spline.h
	  and PointPlotter were unnecessary and so removed.

	* I also added a bit of hardclipping in the output that seems to be
	  required to get Fred Gray's Break Thru. This might not occur so
	  strongly on all chips, so it should probably be added as a proper
	  tunable. For now, I just settled for a slight effect to collect
	  feedback. 

2008-07-15  Antti S. Lankila  <alankila@bel.fi>

	* This release is a bit slower than usual. The culprit is the changes in
	  voice.h where a new kinked-dac style calculation is used to simulate
	  the nonlinear shape of the waveform outputs. The cost of the new
	  calculation varies by song as I was lazy and only cached the result of
	  previous calculation, so speed depends on the pitch of the waveforms
	  and the precise waveform chosen.

	* exp() is back, but this time it is implemented as an integer
	  calculation according to Schraudolph's paper "A Fast, Compact
	  Approximation of the Exponential Function". Using near-proper exp()
	  simplified the distortion algorithm. I think it all sounds much better
	  now.

	* A new effect where I mix bp-hp and lp-bp together by their difference
	  to simulate a small resistor between them appears to improve SidRiders
	  and several other songs, largerly eliminating some types of hard
	  distortion sounds that do not occur on the chip. It also helped
	  Mechanicus. I am trying to understand where this term comes from... 

2008-07-09  Antti S. Lankila  <alankila@bel.fi>

	* I now have somewhat less arbitrary values for the distortion
	  tunables. They are now related to the relative signal levels in the
	  simulation. I'm still sorting out the particulars of the values I
	  ended up with ("why 128 instead of 256").

2008-03-02  Antti S. Lankila  <alankila@bel.fi>

	* Exposed the filter at sid.cc to callers through get_filter()
	  method, and fixed a few types. 

2008-02-19  Antti S. Lankila  <alankila@bel.fi>

	* For some reason ReSID code adjusted the external filter frequency
	  based on calculated passband, while in the real C64 the filter is
	  fixed to about 16 kHz.

2008-02-06  Antti S. Lankila  <alankila@bel.fi>

	* I got interested to improve ReSID after chatting with Kevtris. He is
	  aiming to replicate the filter using analog hardware. He has the EE
	  experience that I have sorely lacked and made an infinitely valuable
	  contribution by telling me exactly how the distortion works.

2004-06-11  Dag Lem  <resid@nimrod.no>

	* Version 0.16 released. (From this point forwards, read
	  ../resid/ChangeLog.)
