Beispiel #1
0
        public void set_chip_model(SIDDefs.chip_model model)
        {
            if (model == SIDDefs.chip_model.MOS6581)
            {
                // The mixer has a small input DC offset. This is found as follows:
                //
                // The "zero" output level of the mixer measured on the SID audio
                // output pin is 5.50V at zero volume, and 5.44 at full
                // volume. This yields a DC offset of (5.44V - 5.50V) = -0.06V.
                //
                // The DC offset is thus -0.06V/1.05V ~ -1/18 of the dynamic range
                // of one voice. See Voice.java for measurement of the dynamic
                // range.

                mixer_DC = -0xfff * 0xff / 18 >> 7;

                f0        = f0_6581;
                f0_points = f0_points_6581;
                f0_count  = f0_points_6581.Length;
            }
            else
            {
                // No DC offsets in the MOS8580.
                mixer_DC = 0;

                f0        = f0_8580;
                f0_points = f0_points_8580;
                f0_count  = f0_points_8580.Length;
            }

            set_w0();
            set_Q();
        }
Beispiel #2
0
        public void set_chip_model(SIDDefs.chip_model model)
        {
            voice0.set_chip_model(model);
            voice1.set_chip_model(model);
            voice2.set_chip_model(model);

            filter.set_chip_model(model);
            extfilt.set_chip_model(model);
        }
Beispiel #3
0
 public void set_chip_model(SIDDefs.chip_model model)
 {
     if (model == SIDDefs.chip_model.MOS6581)
     {
         // Maximum mixer DC output level; to be removed if the external
         // filter is turned off: ((wave DC + voice DC) * voices + mixer DC) * volume
         // See Voice.cs and Filter.cs for an explanation of the values.
         mixer_DC = ((((0x800 - 0x380) + 0x800) * 0xff * 3 - 0xfff * 0xff / 18) >> 7) * 0x0f;
     }
     else
     {
         // No DC offsets in the MOS8580.
         mixer_DC = 0;
     }
 }
Beispiel #4
0
 public void set_chip_model(SIDDefs.chip_model model)
 {
     if (model == SIDDefs.chip_model.MOS6581)
     {
         wave__ST = memWave6581.wave6581__ST;
         wave_P_T = memWave6581.wave6581_P_T;
         wave_PS_ = memWave6581.wave6581_PS_;
         wave_PST = memWave6581.wave6581_PST;
     }
     else
     {
         wave__ST = memWave8580.wave8580__ST;
         wave_P_T = memWave8580.wave8580_P_T;
         wave_PS_ = memWave8580.wave8580_PS_;
         wave_PST = memWave8580.wave8580_PST;
     }
 }
Beispiel #5
0
        public void set_chip_model(SIDDefs.chip_model model)
        {
            wave.set_chip_model(model);

            if (model == SIDDefs.chip_model.MOS6581)
            {
                // The waveform D/A converter introduces a DC offset in the signal
                // to the envelope multiplying D/A converter. The "zero" level of
                // the waveform D/A converter can be found as follows:
                //
                // Measure the "zero" voltage of voice 3 on the SID audio output
                // pin, routing only voice 3 to the mixer ($d417 = $0b, $d418 =
                // $0f, all other registers zeroed).
                //
                // Then set the sustain level for voice 3 to maximum and search for
                // the waveform output value yielding the same voltage as found
                // above. This is done by trying out different waveform output
                // values until the correct value is found, e.g. with the following
                // program:
                //
                // lda #$08
                // sta $d412
                // lda #$0b
                // sta $d417
                // lda #$0f
                // sta $d418
                // lda #$f0
                // sta $d414
                // lda #$21
                // sta $d412
                // lda #$01
                // sta $d40e
                //
                // ldx #$00
                // lda #$38 ; Tweak this to find the "zero" level
                // l cmp $d41b
                // bne l
                // stx $d40e ; Stop frequency counter - freeze waveform output
                // brk
                //
                // The waveform output range is 0x000 to 0xfff, so the "zero"
                // level should ideally have been 0x800. In the measured chip, the
                // waveform output "zero" level was found to be 0x380 (i.e. $d41b
                // = 0x38) at 5.94V.

                wave_zero = 0x380;

                // The envelope multiplying D/A converter introduces another DC
                // offset. This is isolated by the following measurements:
                //
                // * The "zero" output level of the mixer at full volume is 5.44V.
                // * Routing one voice to the mixer at full volume yields
                // 6.75V at maximum voice output (wave = 0xfff, sustain = 0xf)
                // 5.94V at "zero" voice output (wave = any, sustain = 0x0)
                // 5.70V at minimum voice output (wave = 0x000, sustain = 0xf)
                // * The DC offset of one voice is (5.94V - 5.44V) = 0.50V
                // * The dynamic range of one voice is |6.75V - 5.70V| = 1.05V
                // * The DC offset is thus 0.50V/1.05V ~ 1/2 of the dynamic range.
                //
                // Note that by removing the DC offset, we get the following ranges
                // for
                // one voice:
                // y > 0: (6.75V - 5.44V) - 0.50V = 0.81V
                // y < 0: (5.70V - 5.44V) - 0.50V = -0.24V
                // The scaling of the voice amplitude is not symmetric about y = 0;
                // this follows from the DC level in the waveform output.

                voice_DC = 0x800 * 0xff;
            }
            else
            {
                // No DC offsets in the MOS8580.
                wave_zero = 0x800;
                voice_DC  = 0;
            }
        }