jmce - 1_02

jmce.sim.disk
Class MemoryDisk

java.lang.Object
  extended by jmce.sim.AbstractHardware
      extended by jmce.sim.AbstractPeripheral
          extended by jmce.sim.disk.AbstractDisk
              extended by jmce.sim.disk.MemoryDisk
All Implemented Interfaces:
Disk, Hardware, Peripheral
Direct Known Subclasses:
DirDiskCPM

public class MemoryDisk
extends AbstractDisk

Memory image disk.

Disk are stored in one array of byte.

Data are not initialized so the disk must be formatted.

Version:
1.00
Author:
Mario Viara

Field Summary
 
Fields inherited from class jmce.sim.disk.AbstractDisk
buffer, head, mounted, numHead, numSector, numTrack, readOnly, sector, sectorSize, track
 
Fields inherited from class jmce.sim.AbstractPeripheral
cpu
 
Fields inherited from interface jmce.sim.Disk
ERROR, ERROR_SEEK, ERROR_WRITE_PROTECT
 
Constructor Summary
MemoryDisk()
           
MemoryDisk(int track, int head, int sector, int ssize)
           
 
Method Summary
 boolean mount()
          Mount the disk.
protected  int read(int pos)
          Read one sector.
 java.lang.String toString()
           
protected  int write(int pos)
          Write one sector.
 
Methods inherited from class jmce.sim.disk.AbstractDisk
dismount, format, getBuffer, getDiskSize, getDiskSizeString, getHead, getNumHead, getNumSector, getNumTrack, getReadOnly, getSector, getSectorSize, getTrack, isMounted, read, read, setHead, setMounted, setNumHead, setNumSector, setNumTrack, setReadOnly, setSector, setSectorSize, setTrack, write, write
 
Methods inherited from class jmce.sim.AbstractPeripheral
idle, registerCPU, setIdle, setLive
 
Methods inherited from class jmce.sim.AbstractHardware
addHardware, createFrame, destroy, getHardware, getHardware, getHardware, getHardware, getHardware, getHardwareCount, getHardwareForName, getHardwareInstances, getHardwareTree, getName, getParent, init, initSwing, removeHardware, removeHardware, reset, setHardware, setHardware, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jmce.sim.Peripheral
idle, registerCPU
 
Methods inherited from interface jmce.sim.Hardware
addHardware, destroy, getHardware, getHardware, getHardware, getHardware, getHardwareCount, getHardwareInstances, getHardwareTree, getName, getParent, init, initSwing, removeHardware, removeHardware, reset, setHardware, setHardware, setName
 

Constructor Detail

MemoryDisk

public MemoryDisk()

MemoryDisk

public MemoryDisk(int track,
                  int head,
                  int sector,
                  int ssize)
Method Detail

mount

public boolean mount()
              throws SIMException
Description copied from interface: Disk
Mount the disk.

Specified by:
mount in interface Disk
Overrides:
mount in class AbstractDisk
Returns:
true if the disk is correctly mounted.
Throws:
SIMException

write

protected final int write(int pos)
                   throws SIMException
Description copied from class: AbstractDisk
Write one sector. Write one sector at specified position. Must be implemented by subclass.

Specified by:
write in class AbstractDisk
Returns:
the number of bytes written.
Throws:
SIMException

read

protected final int read(int pos)
                  throws SIMException
Description copied from class: AbstractDisk
Read one sector. Read one sector at specified position. Must be implemented by subclass.

Specified by:
read in class AbstractDisk
Returns:
the number of bytes readed.
Throws:
SIMException

toString

public java.lang.String toString()
Overrides:
toString in class AbstractHardware

jmce - 1_02