jmce - 1_02

jmce.sim.disk
Class ImageDisk

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

public class ImageDisk
extends AbstractDisk

Disk implementation using a file image.

One copy of the disk is stored in one file and the disk read and write this file.

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
ImageDisk()
           
ImageDisk(int t, int h, int s, int ss, java.lang.String filename)
           
ImageDisk(java.lang.String name)
           
 
Method Summary
 void dismount()
          Dismount the disk.
 java.lang.String getImageName()
          Return the name of the disk image.
 boolean mount()
          Mount the disk.
 int read(int pos)
          Read one sector.
 void setImageName(java.lang.String name)
          Set the filename of the disk image
 java.lang.String toString()
           
 int write(int pos)
          Write one sector.
 
Methods inherited from class jmce.sim.disk.AbstractDisk
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

ImageDisk

public ImageDisk(java.lang.String name)

ImageDisk

public ImageDisk()

ImageDisk

public ImageDisk(int t,
                 int h,
                 int s,
                 int ss,
                 java.lang.String filename)
Method Detail

setImageName

public void setImageName(java.lang.String name)
Set the filename of the disk image

Parameters:
name -

getImageName

public java.lang.String getImageName()
Return the name of the disk image.


dismount

public void dismount()
              throws SIMException
Dismount the disk.

Specified by:
dismount in interface Disk
Overrides:
dismount in class AbstractDisk
Throws:
SIMException

mount

public boolean mount()
              throws SIMException
Mount the disk.

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

read

public 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

write

public 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

toString

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

jmce - 1_02