Klasse VIA6522DC

java.lang.Object
libsidplay.components.c1541.VIACore
libsidplay.components.c1541.VIA6522DC

public abstract class VIA6522DC extends VIACore
Handling of the Disk Controller.
Autor:
Ken Händel
  • Felddetails

    • DRIVE_ATTACH_DELAY

      private static final int DRIVE_ATTACH_DELAY
      Number 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_DELAY
      Number of cycles the write protection is activated on detach.
      Siehe auch:
    • DRIVE_ATTACH_DETACH_DELAY

      private static final int DRIVE_ATTACH_DETACH_DELAY
      Number of cycles the after a disk can be inserted after a disk has been detached.
      Siehe auch:
    • attachClk

      private long attachClk
      Tick when the disk image was attached.
    • detachClk

      private long detachClk
      Tick when the disk image was detached.
    • attachDetachClk

      private long attachDetachClk
      Tick when the disk image was attached, but an old image was just detached.
    • gcrRead

      private byte gcrRead
      Byte to read from r/w head.
    • gcrWrite

      private byte gcrWrite
      GCR value being written to the disk.
    • readWriteMode

      private VIA6522DC.Mode readWriteMode
      Are we in read or write mode?
    • byteReadyActive

      private int byteReadyActive
      Activates the byte ready line.
    • gcrDataDirty

      private boolean gcrDataDirty
      Does the current GCR data needs to be written to disk?
    • currentHalfTrack

      private int currentHalfTrack
      Current half track on which the R/W head is positioned.
    • rot

      private final Rotation rot
      Disk rotation.
    • image

      private DiskImage image
      Attached disk image.
    • id

      private final int id
      Floppy device number (8-11).
  • Konstruktordetails

    • VIA6522DC

      public VIA6522DC(int deviceID, MOS6510 cpu)
      Creates a new instance of VIA6522DC.
      Parameter:
      deviceID - the C1541 device ID
      cpu - drive CPU
  • Methodendetails

    • reset

      public final void reset()
      Setzt außer Kraft:
      reset in Klasse VIACore
    • getImage

      protected DiskImage getImage()
      Get attached disk image (null if nothing attached).
      Gibt zurück:
      attached disk image
    • insertDisk

      public DiskImage insertDisk(File file) throws IOException
      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

      public void ejectDisk() throws IOException
      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)
      Angegeben von:
      setCa2 in Klasse VIACore
    • setCb2

      protected final void setCb2(int state)
      Angegeben von:
      setCb2 in Klasse VIACore
    • getMode

      protected VIA6522DC.Mode getMode()
    • storePra

      protected final void storePra(int addr, byte byt)
      Angegeben von:
      storePra in Klasse VIACore
    • getLastGCRWrite

      protected final byte getLastGCRWrite()
      Get recently written GCR byte.
      Gibt zurück:
      GCR byte
    • storePrb

      protected final void storePrb(byte byt)
      Angegeben von:
      storePrb in Klasse VIACore
    • storeAcr

      protected final void storeAcr(byte value)
      Angegeben von:
      storeAcr in Klasse VIACore
    • storeSr

      protected final void storeSr(byte value)
      Angegeben von:
      storeSr in Klasse VIACore
    • storeT2l

      protected final void storeT2l(byte value)
      Angegeben von:
      storeT2l in Klasse VIACore
    • readPra

      protected final byte readPra()
      Angegeben von:
      readPra in Klasse VIACore
    • setLastGCRRead

      protected final void setLastGCRRead(byte lastReadData)
      Set recently read GCR byte.
      Parameter:
      lastReadData - GCR byte
    • readPrb

      protected final byte readPrb()
      Angegeben von:
      readPrb in Klasse VIACore
    • 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

      public abstract void diskAttachedDetached(String imageName, boolean attached)