Klasse C1541

java.lang.Object
libsidplay.components.c1541.C1541

public final class C1541 extends Object
C1541 instance which manages the Floppy CPU and the two VIAs.

A good German documentation on the 1541 floppy can be found at
http://www.trikaliotis.net/download/DieFloppy1541-v4.pdf
or
http://www.softwolves.pp.se/idoc/alternative/vc1541_de
Good English ROM listings can be found at
http://www.ffd2.com/fridge/docs/1541dis.html
or
http://www.the-dreams.de/aay1541.txt
TODO Half-tracks are not supported, yet maybe the code looks like it does, but this is not the case.
Autor:
Jörg Jahnke (joergjahnke@users.sourceforge.net), Ken Händel
  • Felddetails

    • ROM_SIZE

      private static final int ROM_SIZE
      Size of the floppy ROM.
      Siehe auch:
    • C1541

      private final byte[] C1541
    • C1541_II

      private final byte[] C1541_II
    • RAM_SIZE

      private static final int RAM_SIZE
      Size of the floppy RAM.
      Siehe auch:
    • RAM_EXP_SIZE

      private static final int RAM_EXP_SIZE
      Size of the floppy RAM expansion.
      Siehe auch:
    • EXP_RAM_BANKS

      private static final int EXP_RAM_BANKS
      Maximum number of activated 8KB Ram expansions.
      Siehe auch:
    • powerOn

      private boolean powerOn
      The disk drive is turned on?
    • id

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

      private FloppyType floppyType
      C1541 or C1541-II?
    • context

      private final EventScheduler context
      Event context.
    • cpu

      private final MOS6510 cpu
      CPU of this device.
    • viaBc

      private final VIA6522BC viaBc
      VIA Bus controller.
    • viaDc

      private final VIA6522DC viaDc
      VIA Disk Controller.
    • ram

      private final byte[] ram
      RAM.
    • rom

      private final byte[] rom
      Simplified, joined ROM image.
    • customC1541Rom

      private byte[] customC1541Rom
      Custom Kernal ROM to be used.
    • ramExpand

      private final byte[][] ramExpand
      Array of 8KB RAM expansions (0x2000-0x3FFF, 0x4000-0x5FFF, 0x6000-0x7FFF, 0x8000-0x9FFF and 0xA000-0xBFFF).
    • ramExpEnabled

      private final boolean[] ramExpEnabled
      Which RAM expansion is enabled?
    • irqCount

      private int irqCount
      Number of VIA chips asserting IRQ.
    • diskName

      private String diskName
  • Konstruktordetails

    • C1541

      public C1541(IECBus iecBus, int deviceID, FloppyType type, byte[] c1541Bin, byte[] c1541IIBin)
      Create a new C1541 instance.
      Parameter:
      iecBus - IEC bus
      deviceID - floppy device number (8-11)
      type - C1541 or C1541-II?
  • Methodendetails

    • getEventScheduler

      public EventScheduler getEventScheduler()
      Get event scheduler.
      Gibt zurück:
      event scheduler
    • getCPU

      public MOS6510 getCPU()
      Get CPU of the floppy.
      Gibt zurück:
      CPU of this floppy
    • getBusController

      public VIA6522BC getBusController()
      Get Bus controller of this floppy.
      Gibt zurück:
      bus controller of this floppy
    • getDiskController

      public VIA6522DC getDiskController()
      Get disk controller of the floppy.
      Gibt zurück:
      disk controller of this floppy
    • getRAM

      public byte[] getRAM()
      Get RAM of this floppy.
      Gibt zurück:
      RAM of this floppy
    • getROM

      public byte[] getROM()
      Get ROM of this floppy.
      Gibt zurück:
      ROM of this floppy
    • getRAMExpEnabled

      public boolean[] getRAMExpEnabled()
      Is RAM expand enabled of this floppy.
      Gibt zurück:
      RAM expand enabled of this floppy
    • getRAMExpand

      public byte[][] getRAMExpand()
      Is RAM expansion of this floppy.
      Gibt zurück:
      RAM expansion of this floppy
    • getID

      public int getID()
      Return the drive ID.
      Gibt zurück:
      floppy device number (8-11)
    • setPowerOn

      public void setPowerOn(boolean on)
      The floppy has been turned on/off.
      Parameter:
      on - power on?
    • isPowerOn

      public boolean isPowerOn()
    • setFloppyType

      public void setFloppyType(FloppyType type)
      Set the actual type of floppy to be used (change ROM).
      Parameter:
      type - the type of the floppy
    • setRamExpansion

      public void setRamExpansion(int select, boolean expand)
      Enable 8K Ram expansion.
      Parameter:
      select - which 8KB RAM bank to expand (0-5), starting at 0x2000 increasing in 8KB steps up to 0xA000.
      expand - enable 8K Ram expansion
    • signalIRQ

      protected void signalIRQ(boolean state)
      Set/clear CPU IRQ state.
      Parameter:
      state - CPU IRQ state
    • reset

      public void reset()
      Reset normally.
    • setRom

      private void setRom()
      Set ROM according to the floppy type.
    • setCustomKernalRom

      public void setCustomKernalRom(byte[] c1541Rom)
      Set a custom Kernal ROM to be used.
      Parameter:
      c1541Rom - kernal Rom (null means default Kernal)
    • getStatus

      public C1541.FloppyStatus getStatus()
      Get a status icon to display the floppies activity.
      Gibt zurück:
      icon to show
    • getFloppyType

      public FloppyType getFloppyType()
    • getDiskName

      public String getDiskName()
    • setDiskName

      public void setDiskName(String diskName)