Klasse SID
- Alle implementierten Schnittstellen:
SIDChip
- Autor:
- Ken Händel, Dag Lem, Antti Lankila
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungprivate byteLast written valueprivate intTime to live for the last written valueprivate intTime to live for the last written valueprivate final ExternalFilterExternal filter that provides high-pass and low-pass filtering to adjust sound tone slightly.private FilterCurrently active filterprivate final Filter6581Filter used, if model is set to 6581private final Filter8580Filter used, if model is set to 8580private static final intprivate ChipModelCurrently active chip model.private final boolean[]private intTime until synchronize() must be run.private static final intprivate static final intOutput scaler.private final PotentiometerPaddle X register supportprivate final PotentiometerPaddle Y register supportfinal Voice[]SID voicesprivate intTime to live for the last written valueVon Schnittstelle geerbte Felder libsidplay.common.SIDChip
DEF_BASE_ADDRESS, FC_MAX, REG_COUNT -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprivate voidageBusValue(int n) private intclock()SID clocking - 1 cycle.voidclock(int cycles, IntConsumer sample) Clock SID forward using chosen output sampling algorithm.protected ChipModelGet chip's 6581 filter.Get chip's 8580 filter.voidinput(int value) 16-bit input (EXT IN).(Package privat) static voidkinkedDac(double[] dac, double _2R_div_R, boolean term) Estimate DAC nonlinearity.voidmute(int channel, boolean mute) SID voice muting.byteread(int offset) Read registers.voidreset()SID reset.voidsetChipModel(ChipModel model) Set chip model.voidsetClockFrequency(double clockFrequency) Setting of clock frequency.voidsetDigiBoost(boolean digiBoost) private voidvoiceSync(boolean sync) Return the number of cycles according to current parameters that it takes to reach sync.voidwrite(int offset, byte value) Write registers.
-
Felddetails
-
INPUTDIGIBOOST
private static final int INPUTDIGIBOOST- Siehe auch:
-
NO_INPUTDIGIBOOST
private static final int NO_INPUTDIGIBOOST- Siehe auch:
-
OUTPUT_LEVEL
private static final int OUTPUT_LEVELOutput scaler.- Siehe auch:
-
voice
SID voices -
filter
Currently active filter -
filter6581
Filter used, if model is set to 6581 -
filter8580
Filter used, if model is set to 8580 -
externalFilter
External filter that provides high-pass and low-pass filtering to adjust sound tone slightly. -
potX
Paddle X register support -
potY
Paddle Y register support -
busValue
private byte busValueLast written value -
busValueTtl
private int busValueTtlTime to live for the last written value -
databus_ttl
private int databus_ttlTime to live for the last written value -
write_address
private int write_addressTime to live for the last written value -
model
Currently active chip model. -
nextVoiceSync
private int nextVoiceSyncTime until synchronize() must be run. -
muted
private final boolean[] muted
-
-
Konstruktordetails
-
SID
public SID()Constructor.
-
-
Methodendetails
-
kinkedDac
static void kinkedDac(double[] dac, double _2R_div_R, boolean term) Estimate DAC nonlinearity. The SID contains R-2R ladder, and some likely errors in the resistor lengths which result in errors depending on the bits chosen.This model was derived by Dag Lem, and is port of the upcoming reSID version. In average, it shows a value higher than the target by a value that depends on the _2R_div_R parameter. It differs from the version written by Antti Lankila chiefly in the emulation of the lacking termination of the 2R ladder, which destroys the output with respect to the low bits of the DAC.
Returns the analog value as modeled from the R-2R network.
- Parameter:
dac- digital value to convert to analog_2R_div_R- nonlinearity parameter, 1.0 for perfect linearity.term- is the dac terminated by a 2R resistor? (6581 DACs are not)
-
setChipModel
Set chip model.- Angegeben von:
setChipModelin SchnittstelleSIDChip- Parameter:
model- chip model to use
-
getChipModel
-
reset
public void reset()SID reset. -
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. -
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.
-
write
public void write(int offset, byte value) Write registers. -
mute
public void mute(int channel, boolean mute) SID voice muting. -
setClockFrequency
public void setClockFrequency(double clockFrequency) Setting of clock frequency.- Angegeben von:
setClockFrequencyin SchnittstelleSIDChip- Parameter:
clockFrequency- System clock frequency at Hz
-
ageBusValue
private void ageBusValue(int n) -
clock
Clock SID forward using chosen output sampling algorithm. -
clock
private int clock()SID clocking - 1 cycle. -
voiceSync
private void voiceSync(boolean sync) Return the number of cycles according to current parameters that it takes to reach sync. -
getFilter6581
Get chip's 6581 filter.- Gibt zurück:
- filter
-
getFilter8580
Get chip's 8580 filter.- Gibt zurück:
- filter
-
setDigiBoost
public void setDigiBoost(boolean digiBoost) - Angegeben von:
setDigiBoostin SchnittstelleSIDChip
-