12010-??-?? Dag Lem <resid@nimrod.no> 2 3 * Version 1.0 released. 4 5 * configure.ac: Updated to current autoconf/automake standards. 6 New option --enable-arch for gcc architecture specific 7 optimizations, including vectorization. New option 8 --enable-branch-hints for branch prediction optimizations. 9 10 * Makefile.am, samp2src.pl: Generate header files instead of 11 source files for waveform samples. Added dac.h, dac.cc. 12 13 * siddefs.h.in: Sampling method names now better reflect their 14 operation (SAMPLE_RESAMPLE_INTERPOLATE -> SAMPLE_RESAMPLE, 15 SAMPLE_RESAMPLE_FAST -> SAMPLE_RESAMPLE_FASTMEM). 16 New macros for branch prediction: likely / unlikely. 17 18 * dac.h: New file; accurate emulation of non-monotonic MOS 6581 19 D/A converters. 20 21 * dac.cc: New file; accurate emulation of non-monotonic MOS 6581 22 D/A converters. 23 24 * envelope.h (EnvelopeGenerator::clock): Emulation of one cycle 25 pipeline delay in the exponential frequency divider. 26 (EnvelopeGenerator::output): Emulation of non-ideal DAC output. 27 (EnvelopeGenerator::set_chip_model): New function; for emulation 28 of DAC imperfections. 29 (EnvelopeGenerator::set_exponential_counter): New function; 30 modularization of exponential counter update. 31 32 * envelope.cc (EnvelopeGenerator::EnvelopeGenerator): 33 Initialization of DAC lookup tables. 34 (EnvelopeGenerator::readENV): Return envelope_counter directly, in 35 order to allow EnvelopeGenerator::output to emulate DAC 36 imperfections. 37 (EnvelopeGenerator::reset): Initialization of new 38 variables. 39 (EnvelopeGenerator::set_chip_model): New function; for emulation 40 of DAC imperfections. 41 (EnvelopeGenerator::writeCONTROL_REG): Flush of exponential 42 frequency divider pipeline on attack. 43 44 * extfilt.h (ExternalFilter::clock): Cutoff frequency fixed point 45 accuracy is traded off for for vastly improved filter signal 46 fixed point accuracy. 47 (ExternalFilter::output): Output range reduced from 20 to 16 48 bits. 49 50 * extfilt.cc (ExternalFilter::ExternalFilter): Assumes audio 51 equipment impedance of 10kOhm, yielding a high-pass 3-dB frequency 52 of 1.6Hz (changed from 16Hz). Cutoff frequency fixed point accuracy 53 is traded off for for vastly improved filter signal fixed point 54 accuracy. 55 (ExternalFilter::set_chip_model): Removed. Remaining DC levels can 56 only be canceled by enabling the external filter (or by similar 57 post processing). 58 59 * filter.h: Major rewrite implementing an accurate model of the 60 actual filter and output stage topology, including models for 61 op-amps, input and feedback NMOS FET "resistors", and voltage 62 controlled resistors (VCRs). 63 (Filter::input): New interface to set external input level. 64 (Filter::output): Output range reduced from 20 to 16 bits. 65 (Filter::set_voice_mask): New function. Emulation of physical 66 connection of EXT IN, and voice muting for test purposes. 67 (Filter::solve_gain): New function; iterative solver using 68 Newton-Raphson and bisection to calculate gain for SID op-amp 69 gains and summers using NMOS FETs as input and feedback "resistors". 70 (Filter::solve_integrate): New function; one-step fixpoint solver 71 to calculate output from SID op-amp integrators using VCRs built 72 from four NMOS FETs as inputs. 73 74 * filter.cc: Major rewrite implementing an accurate model of the 75 actual filter and output stage topology, including models for 76 op-amps, input and feedback NMOS FET "resistors", and voltage 77 controlled resistors (VCRs). 78 (Filter::set_voice_mask): New function. Emulation of physical 79 connection of EXT IN, and voice muting for test purposes. 80 81 * sid.h: Resampling constants declared in enum. 82 (SID::State): Added voice_mask, shift_register_reset, 83 shift_pipeline, pulse_output, floating_output_ttl, 84 envelope_pipeline. 85 (SID::output): 16 bit output range only, n-bit interface 86 removed. 87 (SID::clock_resample): Renamed from 88 SID::clock_resample_interpolate. 89 (SID::clock_resample_fastmem): Renamed from 90 SID::clock_resample_fast. 91 92 * sid.cc (SID::clock): Emulation of one cycle pipeline write delay 93 for the MOS8580. 94 (SID::clock_resample): Renamed from SID::clock_resample_interpolate. 95 Corrected bug in FIR table wraparound, courtesy of Antti Lankila. 96 (SID::clock_resample_fastmem): Renamed from 97 SID::clock_resample_fast. 98 (SID::input): Hand off all processing of the external input to the 99 filter. 100 (SID::output): 16 bit output range only, n-bit output interface 101 removed. 102 (SID::read): Aging time for bus value increased from 0x2000 to 103 0x4000 cycles. 104 (SID::read_state, SID::write_state): Added voice_mask, 105 shift_register_reset, shift_pipeline, pulse_output, 106 floating_output_ttl, envelope_pipeline. 107 (SID::set_voice_mask): New function. Emulation of physical 108 connection of EXT IN, and voice muting for test purposes. 109 (SID::write): Emulation of one cycle pipeline write delay for the 110 MOS8580. 111 (SID::write_pipeline): New function. Emulation of one cycle 112 pipeline write delay for the MOS8580. 113 114 * spline.h (PointPlotter::operator()): Rounding to nearest 115 integer. 116 117 * voice.h (Voice::output): Handling of DC for waveform "zero" 118 level moved to Filter::clock. 119 120 * voice.cc (Voice::set_chip_model): Call set_chip_model for 121 envelope generator. Handling of DC for "zero" level moved to 122 Filter::set_chip_model. 123 124 * wave.h (WaveformGenerator::clock): Corrected shift register 125 model. Emulation of reset time for the shift register. Emulation 126 of two cycle pipeline delay for accumulator bit 19 to shift the 127 shift register. 128 (WaveformGenerator::clock_shift_register) 129 (WaveformGenerator::write_shift_register) 130 (WaveformGenerator::reset_shift_register) 131 (WaveformGenerator::set_noise_output): New functions. Emulation 132 of writes to the shift register by combined waveforms. 133 (WaveformGenerator::set_waveform_output): New function. Emulation 134 of floating DAC input with aging. Emulation of one cycle pipeline 135 delay for the pulse width comparator to change the pulse 136 level. Emulation of writes to the shift register by combined 137 waveforms. Highly optimized waveform calculation using nearly 138 branch-free table lookup for all waveforms; replaces 16 previous 139 waveform functions named WaveformGenerator::outputXXXX. 140 (WaveformGenerator::output): Emulation of non-ideal DAC output. 141 142 * wave.cc (WaveformGenerator::WaveformGenerator): Initialization 143 of lookup tables for basic waveforms and DACs. 144 (WaveformGenerator::readOSC): Return waveform_output directly, in 145 order to allow WaveformGenerator::output to emulate DAC 146 imperfections. 147 (WaveformGenerator::set_chip_model): Update pointer to current 148 waveform table. 149 (WaveformGenerator::writePW_LO, WaveformGenerator::writePW_HI): 150 Push next pulse level into pulse level pipeline. 151 (WaveformGenerator::writeCONTROL_REG): Emulation of the effects of 152 the test bit on the shift register (shifting, reset time). 153 Emulation of fading time for floating DAC input (waveform 0). 154 Update pointer to current waveform table. 155 (WaveformGenerator::reset): Initialization of new variables. 156 1572004-06-11 Dag Lem <resid@nimrod.no> 158 159 * Version 0.16 released. 160 161 * envelope.h (EnvelopeGenerator::clock): Corrected off-by-one 162 error in check for ADSR delay bug in delta_t cycle interface. 163 164 * filter.cc (Filter::set_chip_model): Initialize filter cutoff 165 mappings before call to set_chip_model. 166 167 * sid.cc (SID::set_sampling_parameters): Build shifted FIR tables 168 with samples according to the sampling frequency. 169 (SID::clock_resample_interpolate): New function; factorized linear 170 interpolation out from filter convolutions, and made convolutions 171 vectorizable. 172 (SID::clock_resample_fast): New function; single convolution, same 173 accuracy as with interpolation by using more filter tables. 174 (SID::State, SID::read_state, SID::write_state): Read and write 175 rate_counter_period and exponential_counter_period. Read sustain 176 value. 177 1782003-10-20 Dag Lem <resid@nimrod.no> 179 180 * Version 0.15 released. 181 182 * envelope.h (EnvelopeGenerator): Added public State enum. 183 (EnvelopeGenerator::clock): Rate counter is 15 bits, count 184 rate_period - 1 after wrapping from 0x8000 to 0 in ADSR delay bug. 185 186 * sid.cc, sid.h (SID::State): Added envelope_state. 187 (SID::State::write_state): Restore register 0x18. 188 (SID::set_sampling_parameters): Scale resampling filter to avoid 189 clipping. 190 (SID::clock_resample): Saturated arithmetics to avoid clipping. 191 1922002-12-31 Dag Lem <resid@nimrod.no> 193 194 * Version 0.14 released. 195 196 * envelope.h (EnvelopeGenerator::clock): Corrected one cycle error 197 in ADSR delay bug. Only load the exponential counter period at the 198 envelope counter values 255, 93, 54, 26, 14, 6, 0. 199 200 * filter.cc (Filter::set_chip_model): Call set_w0() and set_Q() to 201 update filter settings. 202 (Filter::set_w0): Limit cutoff frequency for both 1 cycle and 203 delta_t cycle filter. 204 205 * filter.h (Filter::clock): Mix in external audio input. 206 207 * sid.cc, sid.h (SID::input): New function; accepts external audio 208 input sample. 209 210 * spline.h (PointPlotter::operator ()): Clamp negative values to 211 zero. 212 213 * voice.cc, voice.h: Changed misleading name wave_DC to wave_zero. 214 215 * wave.h (WaveformGenerator::clock): Corrected bug in check for 216 accumulator bit 19 in noise register shift. 217 2182002-01-19 Dag Lem <resid@nimrod.no> 219 220 * Version 0.13 released. 221 222 * configure.in: Replaced AC_TRY_COMPILER with AC_TRY_COMPILE, 223 removed AC_PROG_RANLIB. 224 225 * envelope.h (EnvelopeGenerator::clock): Reset rate_step on state 226 change. 227 228 * extfilt.cc (ExternalFilter::set_chip_model): New calculation of 229 maximum mixer DC level. 230 231 * filter.cc (Filter::set_chip_model): Moved calculation of 232 voice_DC to voice.cc, corrected calculation of mixer_DC. 233 234 * filter.h (Filter::output): Mixer output is not inverted. 235 236 * sid.cc (SID::set_chip_model): Call voice.set_chip_model instead 237 of voice.wave.set_chip_model. 238 239 * voice.cc (Voice::Voice): Call set_chip_model. 240 (Voice::set_chip_model): New function; model both waveform D/A 241 converter and envelope multiplying D/A converter DC offsets. 242 243 * voice.h (Voice::output): Add both waveform D/A converter and 244 envelope multiplying D/A converter DC offsets. 245 246 * wave.h (WaveformGenerator::output____): Reverted to output 247 minimum wave level when no waveform is selected. The maximum and 248 minimum wave output levels are interchanged in C= Hacking Issue #20. 249 2502001-10-20 Dag Lem <resid@nimrod.no> 251 252 * Version 0.12 released. 253 254 * envelope.cc, envelope.h, filter.cc, filter.h, wave.cc, wave.h: 255 Removed bool usage. This avoids unnecessary conversion to 1/0. 256 257 * filter.cc (Filter::set_chip_model): New function; selects voice 258 and mixer DC offsets and mapping from the FC registers to filter 259 cutoff frequency. The voice and mixer DC offsets for the MOS6581 are 260 calculated from measurements made by H�rsfalvi, Levente in 261 C= Hacking Issue #20. 262 (Filter::Filter): Call set_chip_model. 263 (Filter::f0_6581, Filter::f0_8580): Separate FC mapping tables. 264 (Filter::f0_points_6581, Filter::f0_points_8580): Separate FC mapping 265 points. 266 267 * extfilt.cc, extfilt.h (ExternalFilter::set_chip_model): New 268 function supporting separate DC correction for MOS6581 and MOS8580. 269 270 * sid.cc, sid.h (SID::adjust_sampling_frequency): New function for 271 on-the-fly adjustment of sampling frequency. 272 (SID::clock_fast): Corrected sample calculation. 273 (SID::set_chip_model): Set filter chip model. 274 (SID::output): Added audio clipping. 275 (SID::clock, SID::clock_fast, SID::clock_interpolate, 276 SID::clock_resample): Added sample interleaving. 277 278 * spline.h (interpolate): Generalized to accept repeated points to 279 introduce points of non-differentiability and discontinuity. 280 281 * wave.h (WaveformGenerator::output____): No selected waveform 282 yields maximum wave output level. This was found by H�rsfalvi, 283 Levente in C= Hacking Issue #20. 284 (WaveformGenerator::clock): Optimized for speed (no division). 285 2862001-03-10 Dag Lem <resid@nimrod.no> 287 288 * Version 0.11 released. 289 290 * configure.in: Disable building of shared library by default. 291 Control inlining with RESID_INLINING (0 or 1) and RESID_INLINE 292 (blank or "inline"). 293 294 * envelope.h, extfilt.h, filter.h, voice.h, wave.h: inline keyword 295 in both function declarations and function definitions. 296 297 * samp2src.pl: Beautified Perl code. 298 299 * sid.h, sid.cc: Replaced voice variables with array. Removed 300 filter variables from SID::State. 301 (SID::clock): New audio sample generating interface. Three 302 clocking methods are available; clocking at output sample 303 frequency, clocking at cycle frequency with linear sample 304 interpolation, and clocking at cycle frequency with audio 305 resampling. 306 (SID::clock_fast, SID::clock_interpolate, SID::clock_resample): 307 New functions called by SID::clock. 308 (SID::set_sampling_parameters): New function to set up SID for 309 sample generation. The FIR table used in SID::clock_resample is 310 calculated here. 311 (SID::I0): 0th order modified Bessel function to calculate Kaiser 312 window. 313 314 * siddefs.h: Control inlining with RESID_INLINING (0 or 1) and 315 RESID_INLINE (blank or "inline"). Added enum sampling_method. 316 317 * voice.h, voice.cc (Voice::set_sync_source): Moved setting of 318 sync source from constructor. 319 320 * wave.h, wave.cc (WaveformGenerator::set_sync_source): Moved 321 setting of sync source from constructor. 322 3232000-11-22 Dag Lem <resid@nimrod.no> 324 325 * Version 0.10 released. 326 327 * configure.in, Makefile.am: Use libtool to build library. The 328 hack to "disable" install is removed. 329 330 * extfilt.h, filter.h: Moved filter stability code from sid.cc. 331 332 * sid.cc (SID::clock): Moved filter stability code to 333 extfilt.h/filter.h. Don't clock the rest of the chip more 334 frequently than necessary. 335 336 * wave.cc: Typecast for pedantic (and probably incorrect) 337 compilers. 338 3392000-05-18 Dag Lem <resid@nimrod.no> 340 341 * Version 0.9 released. 342 343 * filter.h (Filter::output): The sum of the filter outputs is no 344 longer weighted. 345 3461999-06-24 Dag Lem <resid@nimrod.no> 347 348 * Version 0.8 released. 349 350 * filter.h, filter.cc, wave.h, wave.cc: Typecasts for pedantic 351 compilers. 352 353 * filter.h (Filter::clock): Voice 3 is only silenced by voice3off 354 if it is not routed through the filter. 355 356 * sid.cc (SID::State): Added constructor for proper initalization. 357 358 * spline.h: Inlined template functions to avoid problems at link 359 time with certain compilers. 360 3611999-02-25 Dag Lem <resid@nimrod.no> 362 363 * Version 0.7 released. 364 365 * configure.in: Check whether compiler supports bool. 366 367 * extfilt.h, extfilt.cc: Implementation of C64 filter, external to 368 the SID chip. 369 370 * filter.h (Filter::clock): Optimized filter routing using a switch. 371 (Filter::output): Optimized filter mixing using a switch, avoiding 372 integer division. Corrected sign of filtered output, which is 373 inverted compared to unfiltered output. 374 375 * filter.cc (Filter::set_w0): Removed use of M_PI and math.h 376 functions. Use spline table to map fc to w0. 377 (Filter::fc_default): Return array of FC spline interpolation points. 378 (Filter::fc_plotter): Return FC spline plotter object. 379 380 * sid.h (SID::enable_external_filter): Enable/disable external 381 filter. 382 (SID::fc_default): Return array of FC spline interpolation points. 383 (SID::fc_plotter): Return FC spline plotter object. 384 (SID::State, SID::read_state, SID::write_state): Read and write 385 complete SID state. 386 387 * sid.cc (SID::clock): Age bus value. Clock external filter. 388 (SID::enable_external_filter): Enable/disable external filter. 389 390 * spline.h: Spline implementation. Used to specify mapping from 391 the FC register to filter cutoff frequency. 392 3931998-11-14 Dag Lem <resid@nimrod.no> 394 395 * Version 0.6 released. 396 397 * configure.in: Allow compilation in a separate directory. 398 399 * wave.h (WaveformGenerator::synchronize): Handle special case when a 400 sync source is synced itself on the same cycle as its MSB is set 401 high. 402 403 * sid.cc (SID::clock): Only clock on MSB on/off for hard sync. 404 4051998-09-06 Dag Lem <resid@nimrod.no> 406 407 * Version 0.5 released. 408 409 * version.cc (resid_version_string): Version string with C linkage. 410 411 * wave.cc (WaveformGenerator::set_chip_model): Emulation of MOS8580 412 combined waveforms. 413 4141998-08-28 Dag Lem <resid@nimrod.no> 415 416 * Version 0.4 released. 417 418 * envelope.h (EnvelopeGenerator::clock): Count up to rate_period twice 419 during ADSR delay bug, and add one extra rate counter step. 420 421 * filter.cc (Filter::bsd_copysign): Renamed copysign function for 422 compilation on platforms where copysign is implemented as a macro. 423 4241998-08-23 Dag Lem <resid@nimrod.no> 425 426 * Version 0.3 released. 427 428 * envelope.h (EnvelopeGenerator::clock): Handle ADSR boundary bug. 429 430 * envelope.cc (EnvelopeGenerator::rate_counter_period, 431 EnvelopeGenerator::exponential_counter_period): Corrected counter 432 periods. 433 434 * filter.h (Filter::clock): Optimized for speed (division by shifting). 435 436 * sid.h (SID::clock): New one-cycle optimized overload of the clock() 437 function. 438 439 * wave.h (WaveformGenerator::output_P_T): Combined waveform 440 pulse+triangle indexing corrected. 441 (WaveformGenerator::output_P__): Check for test bit to handle 442 pulse+test bit samples. 443 (WaveformGenerator::output): Optimized for speed (inlining). 444 4451998-07-28 Dag Lem <resid@nimrod.no> 446 447 * Version 0.2 released. 448 449 * envelope.h (EnvelopeGenerator::clock): Start decay cycle immediately 450 at envelope counter 0xff. New sustain value is zero if the sustain 451 level is raised above the current envelope counter value. 452 (EnvelopeGenerator::step_envelope): Handle ADSR delay bug. 453 454 * envelope.cc (EnvelopeGenerator::rate_counter_period, 455 EnvelopeGenerator::exponential_counter_period): Corrected counter 456 periods. 457 (EnvelopeGenerator::writeCONTROL_REG): Do not modify rate counter. 458 459 * filter.cc (Filter::set_Q): Constrain Q to keep filter stable. 460 461 * sid.h (SID::read, SID::write, SID::bypass_filter): Simplified API 462 routing register access through the SID class. 463 464 * sid.cc (SID::output): Corrected variable-bit audio output return. 465 (SID::read, SID::write): Allow read of write only registers. 466 4671998-06-09 Dag Lem <resid@nimrod.no> 468 469 * Version 0.1 released. 470