|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jfrace.device.CPMDisk
Class which provides a file as a disk for the CP/M emulator.
Field Summary | |
static int |
READ
Type of action event for reading data. |
static int |
WRITE
Type of action event for writing data. |
Constructor Summary | |
CPMDisk(int size)
Create an empty disk. |
|
CPMDisk(java.lang.String diskName)
Create a disk from the data of the file diskName . |
|
CPMDisk(java.net.URL source)
Create a disk from the data of an URL source. |
Method Summary | |
void |
add(java.lang.String fileName)
Add a file of the real file system to this CP/M disk. |
void |
addActionListener(java.awt.event.ActionListener al)
Add an interested listener for reading/writing events. |
boolean |
calculateDiskParameters()
Calculate the disk parameters by analyzing the raw data of the disk. |
void |
finalize()
Save changed data to the file given in the constructor. |
byte |
getByte(int address)
Get a byte. |
int |
getNumberOfSectorsPerTrack()
Return the number of sectors per track. |
int |
getNumberOfSystemTracks()
Return the number of system tracks. |
int |
getNumberOfTracks()
Return the number of tracks. |
boolean |
isUnchanged()
Return true if nothing has been written to this
disk. |
boolean |
loadCCPBDOS(AddressSpace as)
Load CCP and BDOS from the system tracks. |
boolean |
readSector(int track,
int sector,
AddressSpace as,
int destination)
Read a logical sector from the disk. |
void |
removeActionListener(java.awt.event.ActionListener al)
Remove a listener for reading/writing events. |
void |
setDiskParameters(AddressSpace as,
int address)
Set disk parameters. |
int |
translateSector(int sector)
Translate a logical sector number into a corresponding logical sector number on the disk. |
boolean |
writeSector(int track,
int sector,
AddressSpace as,
int source)
Write a logical sector to the disk. |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int READ
public static final int WRITE
Constructor Detail |
public CPMDisk(java.lang.String diskName) throws java.io.IOException
diskName
.
The raw data of the disk will be read from the given file.
Changed data will be written back to the file in the
finalize
method.java.io.IOException
- in the case of a reading error.public CPMDisk(java.net.URL source) throws java.io.IOException
source
- URL source of the raw data.java.io.IOException
- in the case of a reading error.finalize
public CPMDisk(int size)
size
- Number of bytes of the disk.Method Detail |
public int getNumberOfSectorsPerTrack()
public int getNumberOfSystemTracks()
public int getNumberOfTracks()
public boolean calculateDiskParameters()
true
if successfulpublic void setDiskParameters(AddressSpace as, int address)
as
- Address space.address
- Start address in the address space.public int translateSector(int sector)
SECTRAN
.sector
- Sector number from [0,
numberOfSectorsPerTrack)
.[1,
numberOfSectorsPerTrack]
.public void finalize()
finalize
in class java.lang.Object
public void addActionListener(java.awt.event.ActionListener al)
public void removeActionListener(java.awt.event.ActionListener al)
public boolean isUnchanged()
true
if nothing has been written to this
disk.public void add(java.lang.String fileName)
write
method.fileName
- Name of the file to be added.public boolean loadCCPBDOS(AddressSpace as)
COPYRIGHT
text of the CCP.
From the jump address of the CCP it determines the destination.as
- Address space of the destination.true
if loading was successful.public byte getByte(int address)
address
- Absolute address of a byte of the disk.address
.public boolean readSector(int track, int sector, AddressSpace as, int destination)
track
- Track number.sector
- Sector number.as
- Address space.destination
- Address in the address space.true
in the case of successful reading.public boolean writeSector(int track, int sector, AddressSpace as, int source)
track
- Track number.sector
- Sector number.source
- Address in the address space.destination
- Address in the address space.true
in the case of successful writing.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |