public class TrapDispatcher
extends java.lang.Object
The trap handlers must register with this object for it to know them.
The trap calls are implemented via illegal instructions for the MC68000. These then cause an object of this here class to be called in the CPU's execute() or executeContinuous() loops (possibly via the javacom instruction).
Traps handled so far are:
Constructor and Description |
---|
TrapDispatcher(SampledSound sam,
int throt,
MonitorGui mgui,
int beepVolume,
SoundDevice sound,
inifile.IniFile inifile,
IPHandler ipHandler)
Creates the object, which is bound to a cpu.
|
Modifier and Type | Method and Description |
---|---|
void |
closeAllFiles()
Closes all files on all device drives registered here, remove reference to the cpu.
|
void |
dispatchTrap(int trapType,
MC68000Cpu cpu)
The dispatcher's main method : Gets the correct trap handler and dispatches the trap to it.
|
java.lang.String[] |
getNamesForDrives(int deviceID)
Gets the names of the directories for the drives.
|
void |
register(DeviceDriver dd)
Registers a device driver with this handler.
|
void |
reset()
Reset the machine.
|
void |
resetCounter()
This resets the scheduler calls counter.
|
void |
resetDrives()
Resets all drives by removing them and then setting them again.
|
void |
setCpu(MC68000Cpu cpu)
Sets the cpu used by all device drivers.
|
void |
setFilenameChange(int deviceID,
int change)
Sets whether a filename's case should be changed.
|
void |
setFloppy(FloppyDriver floppy)
Sets the FloppyDriver object.
|
void |
setNamesForDrives(int deviceID,
java.lang.String[] names,
boolean forceRemove)
Sets the names for the dirs for the drives.
|
void |
setScreenCoordinates(int x,
int y)
Sets the new absolute screen coordinates of the screen object (normally called at startup and after every window move operation).
|
void |
setSoundVolume(int vol)
Sets the sound volume for the Beep and SampledSound objects.
|
void |
setThrottle(int throt)
Sets the throttle value.
|
void |
setThrottleStatus(boolean status)
Sets the status of the throttle
|
void |
setUsage(int deviceID,
int usage)
Sets the usage name for a device.
|
public TrapDispatcher(SampledSound sam, int throt, MonitorGui mgui, int beepVolume, SoundDevice sound, inifile.IniFile inifile, IPHandler ipHandler)
sam
- a SampledSound object to be used here.throt
- an int, giving (in milliseconds) the time the job will suspend itself when blinking the cursor.mgui
- the MonitorGui used here.beepVolume
- the volume of sound SMSQmulator produces (0...100).sound
- the soundDevice object.inifile
- the ".ini" file object.ipHandler
- handler for (TCP/)IP calls.public void dispatchTrap(int trapType, MC68000Cpu cpu)
trapType
- the type of trap we're dealing with (should be #2 to #8).cpu
- the cpu to be used.public void setScreenCoordinates(int x, int y)
x
- the new absolute x screen coordinates of the screen object.y
- the new absolute y screen coordinates of the screen object.public void setThrottleStatus(boolean status)
status
- a boolean : true = throttle is in effect, false = throttle must be disregarded.public void resetCounter()
public void setThrottle(int throt)
throt
- the value to be set.public void setFloppy(FloppyDriver floppy)
floppy
- the FloppyDriver object to be set.public void register(DeviceDriver dd)
An already registered device driver class will not be registered again.
dd
- the device driver to register.public void setNamesForDrives(int deviceID, java.lang.String[] names, boolean forceRemove)
deviceID
- the device driver ID.names
- must be an 8 element string array.forceRemove
- = true
if devices should be removed then remountedpublic void resetDrives()
public java.lang.String[] getNamesForDrives(int deviceID)
deviceID
- the device driver ID.public void setFilenameChange(int deviceID, int change)
deviceID
- the device driver ID.change
- 0 = unchanged, 1=all upper case, 2=all lower case.public void closeAllFiles()
public void setCpu(MC68000Cpu cpu)
cpu
- the cpu to be used.public void setUsage(int deviceID, int usage)
deviceID
- the device to set the usage name for, an int containing a three letter word+'0', eg. 'QXL0'..usage
- the usage name, an int containing a three letter word+'0', eg. 'QXL0'.public void setSoundVolume(int vol)
vol
- volume from 0 (no sound) to 100 (loudest).public void reset()