Package libsidplay.components.c1530
Klasse Datasette
java.lang.Object
libsidplay.components.c1530.Datasette
Implementation of a C1530 Datasette.
- Autor:
- Ken Händel
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungstatic enumControls of the datasette.static enumprotected static final classReturn value of method fetchGap. -
Feldübersicht
FelderModifizierer und TypFeldBeschreibungprivate final EventSchedulerEvent scheduler.private intRemember the reset of tape-counter.protected TapAttached TAP tape image.private static final intAt least every DATASETTE_MAX_GAP cycle there should be an alarm.private static final doubleCounter is c=g*(sqrt(v*t/d*pi+r^2/d^2)-r/d).private static final doubleCounter is c=g*(sqrt(v*t/d*pi+r^2/d^2)-r/d).private static final doubleCounter is c=g*(sqrt(v*t/d*pi+r^2/d^2)-r/d).private static final doubleCounter is c=g*(sqrt(v*t/d*pi+r^2/d^2)-r/d).private static final doubleCounter is c=g*(sqrt(v*t/d*pi+r^2/d^2)-r/d).private static final doubleCounter is c=g*(sqrt(v*t/d*pi+r^2/d^2)-r/d).private static final doubleCounter is c=g*(sqrt(v*t/d*pi+r^2/d^2)-r/d).private static final doubleCounter is c=g*(sqrt(v*t/d*pi+r^2/d^2)-r/d).private final EventDatasette event.private intLow/high wave indicator for C16 TAPs.private longLow/high wave indicator for C16 TAPs.private final TapeImageTape image to attach/detach.private intLast datasette counter value.private intLast direction of the tape (0/+1/-1).protected longPointer and length of the tapBuffer.protected longLast time we have recorded a flux change.private longGAP handling.private longGAP handling.private static final intCounter is c=g*(sqrt(v*t/d*pi+r^2/d^2)-r/d).protected Datasette.ControlWhich mode is activated (RECORD/START/...)?protected booleanState of the datasette motor.private static final intHow many cycles it takes to start the datasette motor.private longMotor stop is delayed.protected longPointer and length of the tapBuffer.private final booleanShall the datasette reset when the CPU does?private static final intSize of the temp. tape buffer to read from.private final byte[]Buffer for the TAP.private final intHow long to wait, if a zero occurs in the tap? -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprivate voidbitWrite()Write bit.final voidcontrol(Datasette.Control command) Triggered by GUI: RECORD/START...final voidEject tape image.private booleanfetchGap(Datasette.GapDir gd, long readTap) Fetch GAP.protected voidforward()Fast forward on tape.intbooleangetMotor()floatGet a status icon to display the floppies activity.booleanRead state of button press.final voidinsertTape(File tapeFile) Insert a tape image into the datasette.protected voidInternal reset datasette.private booleanmoveBufferBack(int offset) reads buffer to fit the next gap-read at current_file_seek_position-1 tap_buffer[next_tap] ~ currentFileSeekPosition.private booleanmoveBufferForward(int offset) reads buffer to fit the next gap-read tap_buffer[next_tap] ~ currentFileSeekPosition.protected voidreadBit()Read bit.private longreadGap(int direction) Read GAP.private longRead GAP backward (Tape version 0).private longreadGapBackwardV1(long readTap) Read GAP backward (Tape version 1).private longRead GAP forward.final voidreset()Reset datasette.protected voidReset counter value.protected voidrewind()Rewind on tape.abstract voidsetFlag(boolean flag) Signal interrupt flag.final voidsetMotor(boolean flag) Triggered by c64pla_config_changed.final voidsetTapeImage(Tap image) Sets the TAP image to work with.protected voidStart datasette motor.final voidtoggleWriteBit(boolean writeBit) Triggered by CPU port update at PHI2.protected voidUpdate datasette counter value.
-
Felddetails
-
MAX_COUNTER
private static final int MAX_COUNTERCounter is c=g*(sqrt(v*t/d*pi+r^2/d^2)-r/d). Maximum counter value.- Siehe auch:
-
DS_D
private static final double DS_DCounter is c=g*(sqrt(v*t/d*pi+r^2/d^2)-r/d). Some constants for the Datasette-Counter.- Siehe auch:
-
DS_R
private static final double DS_RCounter is c=g*(sqrt(v*t/d*pi+r^2/d^2)-r/d). Some constants for the Datasette-Counter.- Siehe auch:
-
DS_V_PLAY
private static final double DS_V_PLAYCounter is c=g*(sqrt(v*t/d*pi+r^2/d^2)-r/d). Some constants for the Datasette-Counter.- Siehe auch:
-
DS_G
private static final double DS_GCounter is c=g*(sqrt(v*t/d*pi+r^2/d^2)-r/d). Some constants for the Datasette-Counter.- Siehe auch:
-
DS_RPS_FAST
private static final double DS_RPS_FASTCounter is c=g*(sqrt(v*t/d*pi+r^2/d^2)-r/d). At FF/REWIND, Datasette-counter makes ~4 rounds per second.- Siehe auch:
-
DS_C1
private static final double DS_C1Counter is c=g*(sqrt(v*t/d*pi+r^2/d^2)-r/d). Some constants for the Datasette-Counter.- Siehe auch:
-
DS_C2
private static final double DS_C2Counter is c=g*(sqrt(v*t/d*pi+r^2/d^2)-r/d). Some constants for the Datasette-Counter.- Siehe auch:
-
DS_C3
private static final double DS_C3Counter is c=g*(sqrt(v*t/d*pi+r^2/d^2)-r/d). Some constants for the Datasette-Counter.- Siehe auch:
-
img
Tape image to attach/detach. -
MOTOR_DELAY
private static final int MOTOR_DELAYHow many cycles it takes to start the datasette motor.- Siehe auch:
-
TAP_BUFFER_LENGTH
private static final int TAP_BUFFER_LENGTHSize of the temp. tape buffer to read from.- Siehe auch:
-
DATASETTE_MAX_GAP
private static final int DATASETTE_MAX_GAPAt least every DATASETTE_MAX_GAP cycle there should be an alarm.- Siehe auch:
-
mode
Which mode is activated (RECORD/START/...)? -
currentImage
Attached TAP tape image. -
tapBuffer
private final byte[] tapBufferBuffer for the TAP. -
nextTap
protected long nextTapPointer and length of the tapBuffer. -
lastTap
protected long lastTapPointer and length of the tapBuffer. -
resetDatasetteWithMainCPU
private final boolean resetDatasetteWithMainCPUShall the datasette reset when the CPU does? -
zeroGapDelay
private final int zeroGapDelayHow long to wait, if a zero occurs in the tap? -
fullwave
private int fullwaveLow/high wave indicator for C16 TAPs. -
fullwaveGap
private long fullwaveGapLow/high wave indicator for C16 TAPs. -
motor
protected boolean motorState of the datasette motor. -
lastWriteClk
protected long lastWriteClkLast time we have recorded a flux change. -
motorStopClk
private long motorStopClkMotor stop is delayed. -
context
Event scheduler. -
lastCounter
private int lastCounterLast datasette counter value. -
event
Datasette event. -
longGapPending
private long longGapPendingGAP handling. -
longGapElapsed
private long longGapElapsedGAP handling. -
lastDirection
private int lastDirectionLast direction of the tape (0/+1/-1). -
counterOffset
private int counterOffsetRemember the reset of tape-counter.
-
-
Konstruktordetails
-
Datasette
Constructor.- Parameter:
ctx- event context
-
-
Methodendetails
-
insertTape
Insert a tape image into the datasette. A previously attached tape is ejected first.- Parameter:
tapeFile- filename of the tape image- Löst aus:
IOException- cannot read tape
-
ejectTape
Eject tape image.- Löst aus:
IOException- cannot write tape image
-
updateCounter
protected void updateCounter()Update datasette counter value. -
resetCounter
protected void resetCounter()Reset counter value. -
moveBufferForward
private boolean moveBufferForward(int offset) reads buffer to fit the next gap-read tap_buffer[next_tap] ~ currentFileSeekPosition.- Parameter:
offset- offset to move- Gibt zurück:
- move succeeded
-
moveBufferBack
private boolean moveBufferBack(int offset) reads buffer to fit the next gap-read at current_file_seek_position-1 tap_buffer[next_tap] ~ currentFileSeekPosition.- Parameter:
offset- offset to move- Gibt zurück:
- move succeeded
-
fetchGap
Fetch GAP.- Parameter:
gd- IN/OUT parametersreadTap- ?- Gibt zurück:
- succeeded
-
readGapForward
private long readGapForward()Read GAP forward.- Gibt zurück:
- next GAP
-
readGapBackwardV0
private long readGapBackwardV0()Read GAP backward (Tape version 0).- Gibt zurück:
- previous GAP
-
readGapBackwardV1
Read GAP backward (Tape version 1). Examine, if previous gap was long by rewinding until 3 non-zero-values in a row found, then reading forward- Parameter:
readTap- current tape position- Gibt zurück:
- previous GAP
- Löst aus:
Exception- error moving buffer position
-
readGap
private long readGap(int direction) Read GAP.- Parameter:
direction- 1: forward, -1: rewind- Gibt zurück:
- GAP
-
readBit
protected void readBit()Read bit.- Löst aus:
IOException- tape image read error
-
setTapeImage
Sets the TAP image to work with.- Parameter:
image- TAP image- Löst aus:
IOException- tape image read error
-
forward
protected void forward()Fast forward on tape. -
rewind
protected void rewind()Rewind on tape. -
internalReset
protected void internalReset()Internal reset datasette.- Löst aus:
IOException- error reading TAP image
-
reset
public final void reset()Reset datasette. -
startMotor
protected void startMotor()Start datasette motor.- Löst aus:
IOException- tape image read error
-
control
Triggered by GUI: RECORD/START...- Parameter:
command- triggered datasette control
-
setMotor
public final void setMotor(boolean flag) Triggered by c64pla_config_changed.- Parameter:
flag- motor on/off
-
bitWrite
Write bit.- Löst aus:
IOException- tape image write error
-
toggleWriteBit
public final void toggleWriteBit(boolean writeBit) Triggered by CPU port update at PHI2.- Parameter:
writeBit- toggle state
-
getMotor
public boolean getMotor() -
getCounter
public int getCounter() -
getProgress
public float getProgress() -
getTapeSense
public boolean getTapeSense()Read state of button press.- Gibt zurück:
- The read state of a button press.
-
setFlag
public abstract void setFlag(boolean flag) Signal interrupt flag.- Parameter:
flag- interrupt flag
-
getStatus
Get a status icon to display the floppies activity.- Gibt zurück:
- icon to show
-
getTapeImage
-