@ThreadSafe public abstract class AbstractCPU extends Object implements CPU, Callable<CPU.RunState>
CPU.CPUListener, CPU.RunState| Constructor and Description |
|---|
AbstractCPU(Long pluginID)
Creates new instance of CPU.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addCPUListener(CPU.CPUListener listener)
Add new CPU listener to the list of stateObservers.
|
void |
destroy()
Destroys all plug-in resources.
|
protected abstract void |
destroyInternal()
Called by original destroy() method.
|
void |
execute()
Runs CPU emulation.
|
protected long |
getPluginID()
Get plug-in ID assigned by emuStudio.
|
String |
getTitle()
Get run-time title of this plug-in.
|
boolean |
isBreakpointSet(int memLocation)
Determine if a breakpoint is set at a memory location.
|
boolean |
isBreakpointSupported()
This class support breakpoints.
|
boolean |
isShowSettingsSupported()
This class does not support showing settings
|
void |
pause()
Pauses the CPU emulation.
|
boolean |
removeCPUListener(CPU.CPUListener listener)
Remove CPU listener object from the list of stateObservers.
|
void |
reset()
Perform a reset of this plugin.
|
void |
reset(int addr)
Perform reset of the CPU with specific starting address.
|
protected abstract void |
resetInternal(int startPos)
Performs specific CPU reset.
|
void |
setBreakpoint(int memLocation)
Set a breakpoint at a memory location.
|
void |
showSettings()
Does nothing.
|
void |
step()
Perform one step of CPU emulation.
|
protected abstract CPU.RunState |
stepInternal()
Perform one emulation step in synchronized context.
|
void |
stop()
Stops the CPU emulation.
|
void |
unsetBreakpoint(int memLocation)
Unset a breakpoint at a memory location.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDisassembler, getInstructionPosition, getStatusPanel, setInstructionPositiongetVersion, initializepublic AbstractCPU(Long pluginID)
pluginID - plug-in identification numberNullPointerException - if pluginID is nullprotected long getPluginID()
public String getTitle()
Pluginpublic void showSettings()
showSettings in interface Pluginpublic boolean isShowSettingsSupported()
isShowSettingsSupported in interface Pluginpublic boolean isBreakpointSupported()
isBreakpointSupported in interface CPUpublic void setBreakpoint(int memLocation)
CPUsetBreakpoint in interface CPUmemLocation - memory location where the breakpoint will be setCPU.isBreakpointSupported()public void unsetBreakpoint(int memLocation)
CPUunsetBreakpoint in interface CPUmemLocation - memory location from where the breakpoint will be unsetCPU.isBreakpointSupported()public boolean isBreakpointSet(int memLocation)
CPUisBreakpointSet in interface CPUmemLocation - memory location, from where the breakpoint will be determinedCPU.isBreakpointSupported()public boolean addCPUListener(CPU.CPUListener listener)
addCPUListener in interface CPUlistener - CPUListener objectpublic boolean removeCPUListener(CPU.CPUListener listener)
removeCPUListener in interface CPUlistener - CPUListener objectpublic void destroy()
Pluginprotected abstract void destroyInternal()
public void reset()
Pluginpublic void reset(int addr)
CPUPlugin.reset() methodpublic void execute()
CPUstep().
A good CPU should performs right timing for instructions here.
Debug window should not be updated after each instruction execution,
in order to the execution loop would be faster.public void pause()
CPUpublic void stop()
CPUstep(), pause(),
execute() until user resets the CPU. Debug window in main
module should be updated with saved CPU state.public void step()
CPUprotected abstract CPU.RunState stepInternal() throws Exception
Exception - The emulator is allowed to throw any exceptionprotected abstract void resetInternal(int startPos)
startPos - starting position (similar to calling reset(pos))Copyright © 2017. All rights reserved.