Klasse SFXSoundExpander

java.lang.Object
libsidplay.components.cart.Cartridge
libsidplay.components.cart.supported.SFXSoundExpander
Alle implementierten Schnittstellen:
MusicCartridge, AudioProcessor

public class SFXSoundExpander extends Cartridge implements MusicCartridge
Autor:
ken
  • Felddetails

    • type

      private final int type
    • context

      private final EventScheduler context
    • fmOpl

      private FMOPL_072.FM_OPL fmOpl
    • lastTime

      private long lastTime
    • sampleRate

      private int sampleRate
    • cpuRate

      private int cpuRate
    • sampleAccumulator

      private long sampleAccumulator
    • mixer

      private Mixer mixer
    • fastForwardSamples

      private int fastForwardSamples
    • sampleSum

      private int sampleSum
    • RANDOM

      private final Random RANDOM
      Random source for triangular dithering
    • oldRandomValue

      private int oldRandomValue
      State of HP-TPDF.
    • cartAudioBuffer

      private IntBuffer cartAudioBuffer
    • io2Bank

      private final Bank io2Bank
  • Konstruktordetails

    • SFXSoundExpander

      public SFXSoundExpander(DataInputStream dis, PLA pla, int sizeKB)
      sizeKB is misused as type here: 0=OPL1 (YM3526), 1=OPL2 (YM3812)
  • Methodendetails

    • getIO2

      public Bank getIO2()
      Beschreibung aus Klasse kopiert: Cartridge
      Acquire the IO2 bank.
      Setzt außer Kraft:
      getIO2 in Klasse Cartridge
      Gibt zurück:
      The bank responding to IO2 line.
    • reset

      public void reset()
      Beschreibung aus Klasse kopiert: Cartridge
      Bring the cart to power-on state. If overridden, remember to call the superclass method.
      Setzt außer Kraft:
      reset in Klasse Cartridge
    • prepare

      public void prepare(Mixer mixer, IAudioSection audioSection, IntBuffer audioBufferL, IntBuffer audioBufferR)
      Prepare a music cartridge for playback.

      Since we do not create samples of 1MHz for performance reasons, instead we use the target sample rate for audio playback and sound data will be added in the method AudioProcessor.process(). As an advantage, it gets 22 times faster approximately and must no-more being clocked at such a high rate. Note: original audio buffer parameters are being ignored, here!

      Angegeben von:
      prepare in Schnittstelle MusicCartridge
      Parameter:
      mixer - mixer for mixing the SID samples into the audio buffer
      audioSection - audio comfiguration
      audioBufferL - audio buffer for the left channel of the SIDs samples at 1MHz rate
      audioBufferR - audio buffer for the right channel of the SIDs samples at 1MHz rate
    • process

      public void process(ByteBuffer buffer)
      We mix cartridge audio samples into the audio buffer here.
      Angegeben von:
      process in Schnittstelle AudioProcessor
      Parameter:
      buffer - stereo audio buffer of samples at the target frequency rate.
    • start

      public void start()
      Beschreibung aus Schnittstelle kopiert: MusicCartridge
      Mixer starts mixing
      Angegeben von:
      start in Schnittstelle MusicCartridge
    • clock

      public void clock()
      Beschreibung aus Klasse kopiert: Cartridge
      Clock cartridge chips
      Setzt außer Kraft:
      clock in Klasse Cartridge
    • triangularDithering

      private int triangularDithering()
      Triangularly shaped noise source for audio applications. Output of this PRNG is between ]-1, 1[.
      Gibt zurück:
      triangular noise sample
    • clocksSinceLastAccess

      private int clocksSinceLastAccess()
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Cartridge