libsidplayfp  0.3.5
Public Member Functions | List of all members
reSIDfp::WaveformGenerator Class Reference

Public Member Functions

void setWaveformModels (array< short > *models)
void setChipModel (const ChipModel chipModel)
void clock ()
void synchronize (WaveformGenerator *syncDest, const WaveformGenerator *syncSource) const
 WaveformGenerator ()
void writeFREQ_LO (const unsigned char freq_lo)
void writeFREQ_HI (const unsigned char freq_hi)
void writePW_LO (const unsigned char pw_lo)
void writePW_HI (const unsigned char pw_hi)
void writeCONTROL_REG (const unsigned char control)
void reset ()
short output (const WaveformGenerator *ringModulator)
unsigned char readOSC ()
int readAccumulator () const
int readFreq () const
bool readTest () const
bool readSync () const

Constructor & Destructor Documentation

reSIDfp::WaveformGenerator::WaveformGenerator ( )
inline

Constructor.

Member Function Documentation

RESID_INLINE void reSIDfp::WaveformGenerator::clock ( void  )

SID clocking - 1 cycle.

RESID_INLINE short reSIDfp::WaveformGenerator::output ( const WaveformGenerator ringModulator)

12-bit waveform output.

Parameters
ringModulatorThe oscillator ring-modulating me.
Returns
output from waveformgenerator
int reSIDfp::WaveformGenerator::readAccumulator ( ) const
inline

Read accumulator value.

int reSIDfp::WaveformGenerator::readFreq ( ) const
inline

Read freq value.

unsigned char reSIDfp::WaveformGenerator::readOSC ( )
inline

Read OSC3 value (6581, not latched/delayed version)

Parameters
ring_modulatorThe ring modulating partner of this waveform
Returns
OSC3 value
bool reSIDfp::WaveformGenerator::readSync ( ) const
inline

Read sync value.

bool reSIDfp::WaveformGenerator::readTest ( ) const
inline

Read test value.

void reSIDfp::WaveformGenerator::reset ( void  )

SID reset.

void reSIDfp::WaveformGenerator::setChipModel ( const ChipModel  chipModel)

Set nonlinearity parameter for imperfect analog DAC emulation. 1.0 means perfect 8580-like linearity, values between 0.95 - 0.97 are probably realistic 6581 nonlinearity values.

Parameters
nonLinearity
void reSIDfp::WaveformGenerator::synchronize ( WaveformGenerator syncDest,
const WaveformGenerator syncSource 
) const

Synchronize oscillators. This must be done after all the oscillators have been clock()'ed, so that they are in the same state.

Parameters
syncDestThe oscillator I am syncing
syncSourceThe oscillator syncing me.
void reSIDfp::WaveformGenerator::writeCONTROL_REG ( const unsigned char  control)

Register functions.

Parameters
ring_modulatorring-modulator modulating me.
controlcontrol register value
void reSIDfp::WaveformGenerator::writeFREQ_HI ( const unsigned char  freq_hi)

Register functions.

Parameters
freq_hihigh 8 bits of frequency
void reSIDfp::WaveformGenerator::writeFREQ_LO ( const unsigned char  freq_lo)

Register functions.

Parameters
freq_lolow 8 bits of frequency
void reSIDfp::WaveformGenerator::writePW_HI ( const unsigned char  pw_hi)

Register functions.

Parameters
pw_hihigh 8 bits of pulse width
void reSIDfp::WaveformGenerator::writePW_LO ( const unsigned char  pw_lo)

Register functions.

The original form was (acc >> 12) >= pw, where truth value is not affected by the contents of the low 12 bits. Therefore the lowest bits must be zero in the new formulation acc >= (pw << 12).

Parameters
pw_lolow 8 bits of pulse width

The documentation for this class was generated from the following files: