dioscuri
Class Emulator

java.lang.Object
  extended by dioscuri.Emulator
All Implemented Interfaces:
java.lang.Runnable

public class Emulator
extends java.lang.Object
implements java.lang.Runnable

Top class owning all classes of the emulator. Entry point


Field Summary
protected static int CMD_DEBUG
           
protected static int CMD_DEBUG_DUMP
           
protected static int CMD_DEBUG_ENTER
           
protected static int CMD_DEBUG_HELP
           
protected static int CMD_DEBUG_MEM_DUMP
           
protected static int CMD_DEBUG_SHOWREG
           
protected static int CMD_DEBUG_STEP
           
protected static int CMD_DEBUG_STOP
           
protected static int CMD_LOAD_DATA
           
protected static int CMD_LOAD_MODULES
           
protected static int CMD_LOGGING
           
protected static int CMD_LOGTOFILE
           
protected static int CMD_MISMATCH
           
protected static int CMD_OBSERVE
           
protected static int CMD_RESET
           
protected static int CMD_START
           
protected static int CMD_STOP
           
protected  dioscuri.config.Emulator emuConfig
           
static int MODULE_ATA_HD1_TRANSFER_START
           
static int MODULE_ATA_HD1_TRANSFER_STOP
           
static int MODULE_ATA_HD2_TRANSFER_START
           
static int MODULE_ATA_HD2_TRANSFER_STOP
           
static int MODULE_FDC_TRANSFER_START
           
static int MODULE_FDC_TRANSFER_STOP
           
static int MODULE_KEYBOARD_CAPSLOCK_OFF
           
static int MODULE_KEYBOARD_CAPSLOCK_ON
           
static int MODULE_KEYBOARD_NUMLOCK_OFF
           
static int MODULE_KEYBOARD_NUMLOCK_ON
           
static int MODULE_KEYBOARD_SCROLLLOCK_OFF
           
static int MODULE_KEYBOARD_SCROLLLOCK_ON
           
protected  dioscuri.config.Emulator.Architecture.Modules moduleConfig
           
 
Constructor Summary
Emulator(GUI owner)
          Class constructor
 
Method Summary
 boolean connectModules()
          Connect the modules together.
 boolean createModules()
           
protected  void debug(int command)
           
protected  boolean ejectFloppy(java.lang.String driveLetter)
           
 boolean getColdStart()
          Get cold start.
 GUI getGui()
          Get the gui.
 java.util.ArrayList<HardwareComponent> getHWcomponents()
          Get the hardware components.
 IO getIo()
          Get the io.
protected  Module getModule(Module.Type type)
          Return reference to module from given type
 Modules getModules()
          Get the modules.
 java.awt.image.BufferedImage getScreenImage()
           
 java.lang.String getScreenText()
           
 boolean initScreenOutputDevice()
          Init Screen Output Device.
protected  boolean insertFloppy(java.lang.String driveLetter, byte carrierType, java.io.File imageFile, boolean writeProtected)
           
 boolean isCpu32bit()
           
 boolean loadBIOS()
          Load the BIOS into memory
protected  void notifyKeyboard(java.awt.event.KeyEvent keyEvent, int keyEventType)
           
protected  void notifyMouse(java.awt.event.MouseEvent mouseEvent)
           
protected  void reset()
           
 boolean resetModules()
          Reset all modules.
 void run()
           
protected  void setActive(boolean state)
           
 boolean setBootParams()
          Read from config and set the boot params.
 void setColdStart(boolean coldStart)
          Set cold start.
 boolean setDebugMode()
          Set the debug mode.
 boolean setFloppyParams()
          Get and set floppy parameters
 boolean setHardDriveParams()
          Read and set the hard drive parameters
 boolean setMemoryParams()
          Read from config and set memory parameters
 void setModules(Modules modules)
          Set the modules.
 boolean setMouseParams()
          Read from config and set mouse parameters
 boolean setTimingParams(Module module)
          Set the timing parameters
 boolean setupEmu()
           
 void statusChanged(int status)
           
protected  void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

emuConfig

protected dioscuri.config.Emulator emuConfig

moduleConfig

protected dioscuri.config.Emulator.Architecture.Modules moduleConfig

CMD_START

protected static final int CMD_START
See Also:
Constant Field Values

CMD_STOP

protected static final int CMD_STOP
See Also:
Constant Field Values

CMD_RESET

protected static final int CMD_RESET
See Also:
Constant Field Values

CMD_DEBUG

protected static final int CMD_DEBUG
See Also:
Constant Field Values

CMD_LOGGING

protected static final int CMD_LOGGING
See Also:
Constant Field Values

CMD_OBSERVE

protected static final int CMD_OBSERVE
See Also:
Constant Field Values

CMD_LOAD_MODULES

protected static final int CMD_LOAD_MODULES
See Also:
Constant Field Values

CMD_LOAD_DATA

protected static final int CMD_LOAD_DATA
See Also:
Constant Field Values

CMD_LOGTOFILE

protected static final int CMD_LOGTOFILE
See Also:
Constant Field Values

CMD_DEBUG_HELP

protected static final int CMD_DEBUG_HELP
See Also:
Constant Field Values

CMD_DEBUG_STEP

protected static final int CMD_DEBUG_STEP
See Also:
Constant Field Values

CMD_DEBUG_DUMP

protected static final int CMD_DEBUG_DUMP
See Also:
Constant Field Values

CMD_DEBUG_ENTER

protected static final int CMD_DEBUG_ENTER
See Also:
Constant Field Values

CMD_DEBUG_STOP

protected static final int CMD_DEBUG_STOP
See Also:
Constant Field Values

CMD_DEBUG_SHOWREG

protected static final int CMD_DEBUG_SHOWREG
See Also:
Constant Field Values

CMD_DEBUG_MEM_DUMP

protected static final int CMD_DEBUG_MEM_DUMP
See Also:
Constant Field Values

CMD_MISMATCH

protected static final int CMD_MISMATCH
See Also:
Constant Field Values

MODULE_FDC_TRANSFER_START

public static final int MODULE_FDC_TRANSFER_START
See Also:
Constant Field Values

MODULE_FDC_TRANSFER_STOP

public static final int MODULE_FDC_TRANSFER_STOP
See Also:
Constant Field Values

MODULE_ATA_HD1_TRANSFER_START

public static final int MODULE_ATA_HD1_TRANSFER_START
See Also:
Constant Field Values

MODULE_ATA_HD1_TRANSFER_STOP

public static final int MODULE_ATA_HD1_TRANSFER_STOP
See Also:
Constant Field Values

MODULE_KEYBOARD_NUMLOCK_ON

public static final int MODULE_KEYBOARD_NUMLOCK_ON
See Also:
Constant Field Values

MODULE_KEYBOARD_NUMLOCK_OFF

public static final int MODULE_KEYBOARD_NUMLOCK_OFF
See Also:
Constant Field Values

MODULE_KEYBOARD_CAPSLOCK_ON

public static final int MODULE_KEYBOARD_CAPSLOCK_ON
See Also:
Constant Field Values

MODULE_KEYBOARD_CAPSLOCK_OFF

public static final int MODULE_KEYBOARD_CAPSLOCK_OFF
See Also:
Constant Field Values

MODULE_KEYBOARD_SCROLLLOCK_ON

public static final int MODULE_KEYBOARD_SCROLLLOCK_ON
See Also:
Constant Field Values

MODULE_KEYBOARD_SCROLLLOCK_OFF

public static final int MODULE_KEYBOARD_SCROLLLOCK_OFF
See Also:
Constant Field Values

MODULE_ATA_HD2_TRANSFER_START

public static final int MODULE_ATA_HD2_TRANSFER_START
See Also:
Constant Field Values

MODULE_ATA_HD2_TRANSFER_STOP

public static final int MODULE_ATA_HD2_TRANSFER_STOP
See Also:
Constant Field Values
Constructor Detail

Emulator

public Emulator(GUI owner)
Class constructor

Parameters:
owner - graphical user interface (owner of emulation process)
Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable

stop

protected void stop()

reset

protected void reset()

debug

protected void debug(int command)
Parameters:
command -

setActive

protected void setActive(boolean state)
Parameters:
state -

getModules

public Modules getModules()
Get the modules.

Returns:
modules

getHWcomponents

public java.util.ArrayList<HardwareComponent> getHWcomponents()
Get the hardware components.

Returns:
modules

setModules

public void setModules(Modules modules)
Set the modules.

Parameters:
modules -

getGui

public GUI getGui()
Get the gui.

Returns:
gui

getIo

public IO getIo()
Get the io.

Returns:
io

getColdStart

public boolean getColdStart()
Get cold start.

Returns:
coldStart

setColdStart

public void setColdStart(boolean coldStart)
Set cold start.

Parameters:
coldStart -

getModule

protected Module getModule(Module.Type type)
Return reference to module from given type

Parameters:
type - stating the type of the requested module
Returns:
Module requested module, or null if module does not exist

notifyKeyboard

protected void notifyKeyboard(java.awt.event.KeyEvent keyEvent,
                              int keyEventType)
Parameters:
keyEvent -
keyEventType -

notifyMouse

protected void notifyMouse(java.awt.event.MouseEvent mouseEvent)
Parameters:
mouseEvent -

insertFloppy

protected boolean insertFloppy(java.lang.String driveLetter,
                               byte carrierType,
                               java.io.File imageFile,
                               boolean writeProtected)
Parameters:
driveLetter -
carrierType -
imageFile -
writeProtected -
Returns:
-

ejectFloppy

protected boolean ejectFloppy(java.lang.String driveLetter)
Parameters:
driveLetter -
Returns:
-

statusChanged

public void statusChanged(int status)
Parameters:
status -

getScreenText

public java.lang.String getScreenText()
Returns:
-

getScreenImage

public java.awt.image.BufferedImage getScreenImage()
Returns:
-

isCpu32bit

public boolean isCpu32bit()
Returns:
-

setupEmu

public boolean setupEmu()
Returns:
-

createModules

public boolean createModules()
Returns:
-

connectModules

public boolean connectModules()
Connect the modules together.

Returns:
-

setTimingParams

public boolean setTimingParams(Module module)
Set the timing parameters

Parameters:
module -
Returns:
-

resetModules

public boolean resetModules()
Reset all modules.

Returns:
-

initScreenOutputDevice

public boolean initScreenOutputDevice()
Init Screen Output Device.

Returns:
-

setMouseParams

public boolean setMouseParams()
Read from config and set mouse parameters

Returns:
-

setMemoryParams

public boolean setMemoryParams()
Read from config and set memory parameters

Returns:
-

loadBIOS

public boolean loadBIOS()
Load the BIOS into memory

Returns:
-

setFloppyParams

public boolean setFloppyParams()
Get and set floppy parameters

Returns:
-

setHardDriveParams

public boolean setHardDriveParams()
Read and set the hard drive parameters

Returns:
-

setBootParams

public boolean setBootParams()
Read from config and set the boot params.

Returns:
-

setDebugMode

public boolean setDebugMode()
Set the debug mode.

Returns:
-