Klasse SID

java.lang.Object
builder.resid.residfp.SID
Alle implementierten Schnittstellen:
SIDChip

public class SID extends Object implements SIDChip
  • Felddetails

    • INPUTDIGIBOOST

      private static final int INPUTDIGIBOOST
      Siehe auch:
    • OUTPUT_LEVEL

      private static final float OUTPUT_LEVEL
      Output scaler.
      Siehe auch:
    • voice

      public final Voice[] voice
      SID voices
    • filter

      private Filter filter
      Currently active filter
    • filter6581

      private final Filter6581 filter6581
      Filter used, if model is set to 6581
    • filter8580

      private final Filter8580 filter8580
      Filter used, if model is set to 8580
    • externalFilter

      private final ExternalFilter externalFilter
      External filter that provides high-pass and low-pass filtering to adjust sound tone slightly.
    • potX

      private final Potentiometer potX
      Paddle X register support
    • potY

      private final Potentiometer potY
      Paddle Y register support
    • busValue

      private byte busValue
      Last written value
    • busValueTtl

      private int busValueTtl
      Time to live for the last written value
    • databus_ttl

      private int databus_ttl
      Time to live for the last written value
    • model

      private ChipModel model
      Currently active chip model.
    • ext_in

      private float ext_in
      External audio input.
    • nonLinearity6581

      private float nonLinearity6581
      6581 nonlinearity term used for all DACs
    • samplesMuted

      private boolean samplesMuted
  • Konstruktordetails

    • SID

      public SID()
      Constructor.
  • Methodendetails

    • set6581VoiceNonlinearity

      public void set6581VoiceNonlinearity(float nonLinearity)
      Set DAC nonlinearity for 6581 emulation.
      Parameter:
      nonLinearity -
      Siehe auch:
    • kinkedDac

      static float kinkedDac(int input, float nonLinearity, int maxBit)
      Estimate DAC nonlinearity. The SID contains R-2R ladder, but the second resistor is not exactly double the first. The parameter nonLinearity models the deviation from the resistor lengths. There appears to be about 4 % error on the 6581, resulting in major kinks on the DAC. The value that the DAC yields tends to be larger than expected. The output of this method is normalized such that DAC errors occur both above and below the ideal value equally.
      Parameter:
      input - digital value to convert to analog
      nonLinearity - nonlinearity parameter, 1.0 for perfect linearity.
      maxBit - highest bit that may be set in input.
      Gibt zurück:
      the analog value as modeled from the R-2R network.
    • setChipModel

      public void setChipModel(ChipModel model)
      Set chip model.
      Angegeben von:
      setChipModel in Schnittstelle SIDChip
      Parameter:
      model - chip model to use
    • getChipModel

      protected ChipModel getChipModel()
    • reset

      public void reset()
      SID reset.
      Angegeben von:
      reset in Schnittstelle SIDChip
    • input

      public void input(int value)
      16-bit input (EXT IN). Write 16-bit sample to audio input. NB! The caller is responsible for keeping the value within 16 bits. Note that to mix in an external audio signal, the signal should be resampled to 1MHz first to avoid sampling noise.
      Angegeben von:
      input in Schnittstelle SIDChip
      Parameter:
      value - input level to set
    • read

      public byte read(int offset)
      Read registers.

      Reading a write only register returns the last byte written to any SID register. The individual bits in this value start to fade down towards zero after a few cycles. All bits reach zero within approximately $2000 - $4000 cycles. It has been claimed that this fading happens in an orderly fashion, however sampling of write only registers reveals that this is not the case. NB! This is not correctly modeled. The actual use of write only registers has largely been made in the belief that all SID registers are readable. To support this belief the read would have to be done immediately after a write to the same register (remember that an intermediate write to another register would yield that value instead). With this in mind we return the last value written to any SID register for $2000 cycles without modeling the bit fading.

      Angegeben von:
      read in Schnittstelle SIDChip
      Parameter:
      offset - SID register to read
      Gibt zurück:
      value read from chip
    • write

      public void write(int offset, byte value)
      Write registers.
      Angegeben von:
      write in Schnittstelle SIDChip
      Parameter:
      offset - chip register to write
      value - value to write
    • mute

      public void mute(int channel, boolean mute)
      SID voice muting.
      Angegeben von:
      mute in Schnittstelle SIDChip
      Parameter:
      channel - channel to modify
      mute - is muted?
    • setClockFrequency

      public void setClockFrequency(double clockFrequency)
      Setting of clock frequency.
      Angegeben von:
      setClockFrequency in Schnittstelle SIDChip
      Parameter:
      clockFrequency - System clock frequency at Hz
    • ageBusValue

      private void ageBusValue(int n)
    • clock

      public final void clock(int delta_t, IntConsumer sample)
      Clock SID forward using chosen output sampling algorithm.
      Angegeben von:
      clock in Schnittstelle SIDChip
      Parameter:
      delta_t - c64 clocks to clock
      sample - sample consumer
    • clock

      private float clock()
      SID clocking - 1 cycle.
    • getFilter6581

      public Filter6581 getFilter6581()
    • getFilter8580

      public Filter8580 getFilter8580()
    • setDigiBoost

      public void setDigiBoost(boolean digiBoost)
      Angegeben von:
      setDigiBoost in Schnittstelle SIDChip