Package libsidplay.components.c1541
Klasse VIA6522DC
java.lang.Object
libsidplay.components.c1541.VIACore
libsidplay.components.c1541.VIA6522DC
Handling of the Disk Controller.
- Autor:
- Ken Händel
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibung(Package privat) static enumCurrent mode read or write. -
Feldübersicht
FelderModifizierer und TypFeldBeschreibungprivate longTick when the disk image was attached.private longTick when the disk image was attached, but an old image was just detached.private intActivates the byte ready line.private intCurrent half track on which the R/W head is positioned.private longTick when the disk image was detached.private static final intNumber of cycles before an attached disk becomes visible to the R/W head.private static final intNumber of cycles the after a disk can be inserted after a disk has been detached.private static final intNumber of cycles the write protection is activated on detach.private booleanDoes the current GCR data needs to be written to disk?private byteByte to read from r/w head.private byteGCR value being written to the disk.private final intFloppy device number (8-11).private DiskImageAttached disk image.private VIA6522DC.ModeAre we in read or write mode?private final RotationDisk rotation.Von Klasse geerbte Felder libsidplay.components.c1541.VIACore
ca2State, cb2State, enabled, ier, ifr, ila, ilb, oldpa, oldpb, pb7, pb7o, pb7sx, pb7x, pb7xx, tai, tal, tau, tbi, tbl, tbu, via, VIA_ACR, VIA_DDRA, VIA_DDRB, VIA_IER, VIA_IFR, VIA_IM_CA1, VIA_IM_CA2, VIA_IM_CB1, VIA_IM_CB2, VIA_IM_IRQ, VIA_IM_SR, VIA_IM_T1, VIA_IM_T2, VIA_PCR, VIA_PRA, VIA_PRA_NHS, VIA_PRB, VIA_SIG_CA1, VIA_SIG_CA2, VIA_SIG_CB1, VIA_SIG_CB2, VIA_SIG_FALL, VIA_SIG_RISE, VIA_SR, VIA_T1CH, VIA_T1CL, VIA_T1LH, VIA_T1LL, VIA_T2CH, VIA_T2CL, VIA_T2LL -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprivate voidbyteRead()Read GCR data by rotating the disk, if disk attachment/detachment is in progress just delay and read zero.abstract voiddiskAttachedDetached(String imageName, boolean attached) voidDetach Disk.
A previously inserted disk will be ejected.protected voidWrite back dirty GCR data to the attached disk image.longTicks when the disk image was attached.intGet current half track on which the R/W head is positioned.protected DiskImagegetImage()Get attached disk image (null if nothing attached).protected final byteGet recently written GCR byte.protected VIA6522DC.ModegetMode()insertDisk(File file) Insert Disk.
A previously inserted disk will be ejected first.protected final booleanIs byte ready to be processed?final booleanisLEDOn()Is LED on?final booleanIs disk motor on?protected voidmoveHead(boolean forward) protected final bytereadPra()protected final bytereadPrb()final voidreset()protected final voidRotate disk, if the motor is on.protected final voidsetCa2(int state) protected final voidsetCb2(int state) protected voidprotected voidsetHalfTrack(int num) Reposition the read/write head to the parameterized half-track accounting for potential change in speed zone (= track length).protected final voidsetLastGCRRead(byte lastReadData) Set recently read GCR byte.protected final voidstoreAcr(byte value) protected final voidstorePra(int addr, byte byt) protected final voidstorePrb(byte byt) protected final voidstoreSr(byte value) protected final voidstoreT2l(byte value) private byteImplements write protect sense, in respect to the disk currently being attached/detached.Von Klasse geerbte Methoden libsidplay.components.c1541.VIACore
alarmSet, alarmUnset, checkInterrupts, cpuClk, disable, read, setIRQ, signal, write
-
Felddetails
-
DRIVE_ATTACH_DELAY
private static final int DRIVE_ATTACH_DELAYNumber of cycles before an attached disk becomes visible to the R/W head. This is mostly to make routines that auto-detect disk changes happy.- Siehe auch:
-
DRIVE_DETACH_DELAY
private static final int DRIVE_DETACH_DELAYNumber of cycles the write protection is activated on detach.- Siehe auch:
-
DRIVE_ATTACH_DETACH_DELAY
private static final int DRIVE_ATTACH_DETACH_DELAYNumber of cycles the after a disk can be inserted after a disk has been detached.- Siehe auch:
-
attachClk
private long attachClkTick when the disk image was attached. -
detachClk
private long detachClkTick when the disk image was detached. -
attachDetachClk
private long attachDetachClkTick when the disk image was attached, but an old image was just detached. -
gcrRead
private byte gcrReadByte to read from r/w head. -
gcrWrite
private byte gcrWriteGCR value being written to the disk. -
readWriteMode
Are we in read or write mode? -
byteReadyActive
private int byteReadyActiveActivates the byte ready line. -
gcrDataDirty
private boolean gcrDataDirtyDoes the current GCR data needs to be written to disk? -
currentHalfTrack
private int currentHalfTrackCurrent half track on which the R/W head is positioned. -
rot
Disk rotation. -
image
Attached disk image. -
id
private final int idFloppy device number (8-11).
-
-
Konstruktordetails
-
VIA6522DC
Creates a new instance of VIA6522DC.- Parameter:
deviceID- the C1541 device IDcpu- drive CPU
-
-
Methodendetails
-
reset
public final void reset() -
getImage
Get attached disk image (null if nothing attached).- Gibt zurück:
- attached disk image
-
insertDisk
Insert Disk.
A previously inserted disk will be ejected first.- Parameter:
file- disk image file- Gibt zurück:
- attached disk image
- Löst aus:
IOException- cannot read disk image file
-
ejectDisk
Detach Disk.
A previously inserted disk will be ejected.- Löst aus:
IOException- cannot write disk file
-
getAttachClk
public long getAttachClk()Ticks when the disk image was attached.- Gibt zurück:
- when the disk was attached
-
setHalfTrack
protected void setHalfTrack(int num) Reposition the read/write head to the parameterized half-track accounting for potential change in speed zone (= track length).- Parameter:
num- half-track to set
-
getHalfTrack
public int getHalfTrack()Get current half track on which the R/W head is positioned.- Gibt zurück:
- current half-track
-
moveHead
protected void moveHead(boolean forward) -
gcrDataWriteback
protected void gcrDataWriteback()Write back dirty GCR data to the attached disk image. -
isLEDOn
public final boolean isLEDOn()Is LED on?- Gibt zurück:
- LED on
-
isMotorOn
public final boolean isMotorOn()Is disk motor on?- Gibt zurück:
- motor on
-
setCa2
protected final void setCa2(int state) -
setCb2
protected final void setCb2(int state) -
getMode
-
storePra
protected final void storePra(int addr, byte byt) -
getLastGCRWrite
protected final byte getLastGCRWrite()Get recently written GCR byte.- Gibt zurück:
- GCR byte
-
storePrb
protected final void storePrb(byte byt) -
storeAcr
protected final void storeAcr(byte value) -
storeSr
protected final void storeSr(byte value) -
storeT2l
protected final void storeT2l(byte value) -
readPra
protected final byte readPra() -
setLastGCRRead
protected final void setLastGCRRead(byte lastReadData) Set recently read GCR byte.- Parameter:
lastReadData- GCR byte
-
readPrb
protected final byte readPrb() -
isByteReadyActive
protected final boolean isByteReadyActive()Is byte ready to be processed?- Gibt zurück:
- byte ready active
-
rotateDisk
protected final void rotateDisk()Rotate disk, if the motor is on. -
setGCRDataDirty
protected void setGCRDataDirty() -
byteRead
private void byteRead()Read GCR data by rotating the disk, if disk attachment/detachment is in progress just delay and read zero. -
writeProtectSense
private byte writeProtectSense()Implements write protect sense, in respect to the disk currently being attached/detached.- Gibt zurück:
- 0x0 (write protected), 0x10 (read/write)
-
diskAttachedDetached
-