dioscuri.module.fdc
Class Drive

java.lang.Object
  extended by dioscuri.module.fdc.Drive

public class Drive
extends java.lang.Object

Author:
Bram Lohman, Bart Kiers

Field Summary
protected  int cylinder
           
protected  int cylinders
           
protected  byte dir
           
protected  int eot
           
protected  int floppyType
           
protected  int hds
           
protected  int heads
           
protected  boolean multiTrack
           
protected  int sector
           
protected  int sectors
           
protected  int sectorsPerTrack
           
protected  int tracks
           
protected  boolean writeProtected
           
 
Constructor Summary
Drive()
          Drive
 
Method Summary
protected  boolean containsFloppy()
          Checks the existence of a floppy disk in drive
protected  void ejectFloppy()
          Ejects a floppy from the drive
protected  int getDriveType()
          Get type of drive
protected  int getFloppySize()
          Get size in bytes of floppy Returns -1 if drive is empty.
protected  int getFloppyType()
          Get type of floppy inserted
protected  void incrementSector()
          Increment current sector Note: also takes care of multitrack disks and cylinder position
protected  void insertFloppy(byte floppyType, java.io.File imageFile, boolean writeProtected)
          Inserts a floppy into the drive
protected  boolean isMotorRunning()
          Returns the state of the drive motor
protected  void readData(int offset, int totalBytes, byte[] floppyBuffer)
          Read data from floppy into buffer
protected  boolean reset()
          Reset drive All geometry parameters for sector selection are reset.
protected  void resetChangeline()
          Reset change line Updates DIR on bit 7
protected  void setDriveType(byte type)
          Set type of drive
protected  void setMotor(boolean state)
          Set motor status
 java.lang.String toString()
          Get String representation of this class
protected  void writeData(int offset, int totalBytes, byte[] floppyBuffer)
          Write data to floppy from buffer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

eot

protected int eot

hds

protected int hds

cylinder

protected int cylinder

sector

protected int sector

floppyType

protected int floppyType

tracks

protected int tracks

heads

protected int heads

cylinders

protected int cylinders

sectorsPerTrack

protected int sectorsPerTrack

sectors

protected int sectors

writeProtected

protected boolean writeProtected

multiTrack

protected boolean multiTrack

dir

protected byte dir
Constructor Detail

Drive

public Drive()
Drive

Method Detail

reset

protected boolean reset()
Reset drive All geometry parameters for sector selection are reset.

Returns:
-

containsFloppy

protected boolean containsFloppy()
Checks the existence of a floppy disk in drive

Returns:
boolean true if drive contains a floppy, false otherwise

getDriveType

protected int getDriveType()
Get type of drive

Returns:
int drive type

setDriveType

protected void setDriveType(byte type)
Set type of drive

Parameters:
type -

setMotor

protected void setMotor(boolean state)
Set motor status

Parameters:
state -

isMotorRunning

protected boolean isMotorRunning()
Returns the state of the drive motor

Returns:
boolean true if motor is running, false otherwise

getFloppyType

protected int getFloppyType()
Get type of floppy inserted

Returns:
int type of floppy

getFloppySize

protected int getFloppySize()
Get size in bytes of floppy Returns -1 if drive is empty.

Returns:
int size of floppy, or -1 if no floppy available

insertFloppy

protected void insertFloppy(byte floppyType,
                            java.io.File imageFile,
                            boolean writeProtected)
                     throws StorageDeviceException
Inserts a floppy into the drive

Parameters:
floppyType -
imageFile -
writeProtected -
Throws:
StorageDeviceException

ejectFloppy

protected void ejectFloppy()
                    throws StorageDeviceException
Ejects a floppy from the drive

Throws:
StorageDeviceException

readData

protected void readData(int offset,
                        int totalBytes,
                        byte[] floppyBuffer)
                 throws StorageDeviceException
Read data from floppy into buffer

Parameters:
offset -
totalBytes -
floppyBuffer -
Throws:
StorageDeviceException

writeData

protected void writeData(int offset,
                         int totalBytes,
                         byte[] floppyBuffer)
                  throws StorageDeviceException
Write data to floppy from buffer

Parameters:
offset -
totalBytes -
floppyBuffer -
Throws:
StorageDeviceException

incrementSector

protected void incrementSector()
Increment current sector Note: also takes care of multitrack disks and cylinder position


resetChangeline

protected void resetChangeline()
Reset change line Updates DIR on bit 7


toString

public java.lang.String toString()
Get String representation of this class

Overrides:
toString in class java.lang.Object