Package drivers.win

Class SWinDriver

java.lang.Object
drivers.win.SWinDriver

public class SWinDriver extends Object
This is a mostly unused class for using the SMSQ/E win driver. My "normal" windriver is faster, so I'm keeping that.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates the object.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    checkWriteProtect(int drive, MC68000Cpu cpu)
    Checks whether the drive is read only.
    void
    closeRAFile(int driveNbr)
    CLoses the random access file, ignoring all close errors.
    void
    formatDrive(int drive, MC68000Cpu cpu)
    This routine "formats" a drive in the sense that it just creates the container fiole on the local filesystem.; ; d0 cr format type / error code ; d1 cr size wished in MB / good sectors ; d2 r total sectors ; a3 c p linkage block ; a4 c p drive definition D1 = size in MB
    int
    Gets the device ID for this device, eg.
    void
    getName(int driveNbr, MC68000Cpu cpu)
    Gets the name of the native directory used for a drive and puts it into a buffer within SMSQE.
    getNames(int deviceID)
    Gets the names of the native files used for each drive of the device.
    int
    getUsage(int deviceID)
    This gets the usage name of the device.
    void
    handleAction(int action, MC68000Cpu cpu)
    Handles the required actions by calling the corresponding action routines.The action routines set D0 to 0 (no error) or error number (negative), or 0x12345678 = special return.
    void
    readSector(int drive, MC68000Cpu cpu)
    Reads a sector.
    void
     
    void
    Sets the cpu used by the device driver.
    void
    setName(int driveNbr, MC68000Cpu cpu)
    Sets the name of a native directory, as passed in a datastructure pointed to by SMSQE.
    boolean
    setNames(String[] names)
    Sets the names of the native directories to be used for each drive of the device.
    boolean
    setUsage(int deviceID, int usage)
    This sets the usage name of the device, eg.
    void
    writeSector(int drive, MC68000Cpu cpu)
    Writes a sector.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SWinDriver

      public SWinDriver()
      Creates the object.
  • Method Details

    • handleAction

      public void handleAction(int action, MC68000Cpu cpu)
      Handles the required actions by calling the corresponding action routines.The action routines set D0 to 0 (no error) or error number (negative), or 0x12345678 = special return. This method then sets the CPU flags according to that error returen, except if it is the special return : don't touch cpu flags then, but clear D0. This method also checks that the drive for which the action is to be done (in D7) is a valid drive. If not, error returns are in D0 and CPY Z flag is cleared.
      Parameters:
      action - what is to be done.
      cpu -
    • checkWriteProtect

      public void checkWriteProtect(int drive, MC68000Cpu cpu)
      Checks whether the drive is read only.
    • readSector

      public void readSector(int drive, MC68000Cpu cpu)
      Reads a sector. d0 cr sector to read / error code 'IS On StACK d2 cp number of sectors to read d7 c p drive ID / number a1 c p address to read into a3 c p linkage block a4 c p drive definition status return 0 or ERR.MCHK the prblm is that if I lock the file hannel for a certain file
      Parameters:
      drive - what drive (0...7)
    • writeSector

      public void writeSector(int drive, MC68000Cpu cpu)
      Writes a sector. ; d0 cr sector to read / error code 'IS On StACK ; d2 cp number of sectors to read ; d7 c p drive ID / number ; a1 c p address to read into ; a3 c p linkage block ; a4 c p drive definition ; ; status return 0 or ERR.MCHK
      Parameters:
      drive - what drive (0...7)
    • formatDrive

      public void formatDrive(int drive, MC68000Cpu cpu)
      This routine "formats" a drive in the sense that it just creates the container fiole on the local filesystem.; ; d0 cr format type / error code ; d1 cr size wished in MB / good sectors ; d2 r total sectors ; a3 c p linkage block ; a4 c p drive definition D1 = size in MB
      Parameters:
      drive - what drive (0...7)
      cpu -
    • setNames

      public boolean setNames(String[] names)
      Sets the names of the native directories to be used for each drive of the device. Checks that a file is a valid QL floppy image file.

      In keeping with standard SMSQE practice, it is presumed throughout that each device may have 8 drives.

      Parameters:
      names - an 8 element String array with names for the drives.
      Returns:
      true if names were set, else false.
    • closeRAFile

      public void closeRAFile(int driveNbr)
      CLoses the random access file, ignoring all close errors.
      Parameters:
      driveNbr - drive for which the access file is to be closed (0...7, presumed to be correct)
    • getNames

      public String[] getNames(int deviceID)
      Gets the names of the native files used for each drive of the device.

      In keeping with standard SMSQE practice, it is presumed throughout that each device may have 8 drives.

      Parameters:
      deviceID - an int containing the name of the device for which the names are to be returned (eg 'NFA0', i.e. 0x0x4e464130).
      Returns:
      An 8 elements string array with the names, or null if the device ID wasn't mine. Individual elements may be null or empty if the corresponding drive isn't assigned.
    • setUsage

      public boolean setUsage(int deviceID, int usage)
      This sets the usage name of the device, eg. "FLP_USE MDV"
      Parameters:
      deviceID - the true name of the device as an int.
      usage - the usage name as an int
      Returns:
      true if set ok, else false;
    • getUsage

      public int getUsage(int deviceID)
      This gets the usage name of the device.
      Parameters:
      deviceID - the true name of the device as an int.
      Returns:
      the usage name as an int, or 0 if this wasn't for this device
    • getDeviceID

      public int getDeviceID()
      Gets the device ID for this device, eg. SFA0.
      Returns:
      the device ID as int.
    • setCpu

      public void setCpu(MC68000Cpu cpu)
      Sets the cpu used by the device driver.
      Parameters:
      cpu - the cpu to be set.
    • setName

      public void setName(int driveNbr, MC68000Cpu cpu)
      Sets the name of a native directory, as passed in a datastructure pointed to by SMSQE. That data is also saved in the inifile. The pointer to the name lies at 4(a1).
      Parameters:
      driveNbr - the drive (from 0..7 , presumed correct) for which the name is to be obtained
    • getName

      public void getName(int driveNbr, MC68000Cpu cpu)
      Gets the name of the native directory used for a drive and puts it into a buffer within SMSQE. The buffer is pointed to by 4(A1) and contains, in its first word, its length.
      Parameters:
      driveNbr - the drive (from 0..7 , presumed correct) for which the name is to be obtained
    • reset

      public void reset()