public final class WaveformGenerator extends Object
Modifier and Type | Field and Description |
---|---|
protected int |
accumulator
Current and previous accumulator value.
|
protected int |
accumulator_prev
Current and previous accumulator value.
|
protected int |
freq |
protected boolean |
sync |
protected boolean |
test
The control register bits.
|
Modifier | Constructor and Description |
---|---|
protected |
WaveformGenerator()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
clock()
SID clocking - 1 cycle.
|
short |
output(WaveformGenerator ringModulator)
12-bit waveform output.
|
byte |
readOSC(ChipModel model) |
byte |
readOSC(int ringAccumulator,
int myAccumulator)
Read OSC3 value (6581, not latched/delayed version)
|
protected byte |
readOSC6581(WaveformGenerator ring_modulator)
Read OSC3 value (6581, not latched/delayed version)
|
protected byte |
readOSC8580(WaveformGenerator ring_modulator)
Read OSC3 value (8580, 1-clock latched version).
|
protected void |
reset()
SID reset.
|
protected void |
setChipModel(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.
|
protected void |
setWaveformModels(short[][] models) |
protected void |
synchronize(WaveformGenerator syncDest,
WaveformGenerator syncSource)
Synchronize oscillators.
|
protected void |
writeCONTROL_REG(byte control)
Register functions.
|
protected void |
writeFREQ_HI(byte freq_hi)
Register functions.
|
protected void |
writeFREQ_LO(byte freq_lo)
Register functions.
|
protected void |
writePW_HI(byte pw_hi)
Register functions.
|
protected void |
writePW_LO(byte pw_lo)
Register functions.
|
protected int accumulator
protected int accumulator_prev
protected int freq
protected boolean test
protected boolean sync
protected void setWaveformModels(short[][] models)
protected void setChipModel(ChipModel chipModel)
chipModel
- The ChipModel
to use.protected void clock()
protected final void synchronize(WaveformGenerator syncDest, WaveformGenerator syncSource)
syncDest
- The oscillator I am syncingsyncSource
- The oscillator syncing me.public short output(WaveformGenerator ringModulator)
ringModulator
- The oscillator ring-modulating me.public byte readOSC(int ringAccumulator, int myAccumulator)
protected byte readOSC6581(WaveformGenerator ring_modulator)
ring_modulator
- The ring modulating partner of this waveformprotected byte readOSC8580(WaveformGenerator ring_modulator)
ring_modulator
- The ring modulating partner of this waveformpublic byte readOSC(ChipModel model)
protected void writeFREQ_LO(byte freq_lo)
freq_lo
- low 8 bits of frequencyprotected void writeFREQ_HI(byte freq_hi)
freq_hi
- high 8 bits of frequencyprotected void writePW_LO(byte pw_lo)
pw_lo
- low 8 bits of pulse widthprotected void writePW_HI(byte pw_hi)
pw_hi
- high 8 bits of pulse widthprotected void writeCONTROL_REG(byte control)
control
- control register valueprotected void reset()
Copyright © 2018 Ken Händel. All rights reserved.