|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.razvan.jzx.BaseComponent org.razvan.jzx.BaseSpectrum
public abstract class BaseSpectrum
Base class extended by all Spectrum models (48k, 128k).
This class provides basic, common spectrum functionality for the various spectrum models.
Field Summary | |
---|---|
static long |
FREQUENCY_MS
The 20ms frequency of the interrupt clock. |
static int |
ISSUE_2
48k Spectrum model 2 (issue 2) |
static int |
ISSUE_3
48k Spectrum model 3 (issue 3) |
protected Clock |
m_clock
The interrupt clock. |
protected java.awt.Container |
m_container
Component that decorates the screen object for display in a Frame, Applet, etc. |
protected Z80 |
m_cpu
Contained reference to the Z80 CPU. |
protected int |
m_cyclesLine
The number of CPU T-States per TV line. |
protected long |
m_frequency
|
protected BaseIO |
m_io
Contained reference to the I/O object. |
protected int |
m_issue
The model (issue) of this Spectrum. |
protected BaseKeyboard |
m_keyboard
Contained reference to the keyboard object. |
protected BaseMemory |
m_memory
Contained reference to the memory object. |
protected int |
m_scale
The current scale value for this Spectrum. |
protected BaseScreen |
m_screen
Contained reference to the screen object. |
protected java.awt.Label |
m_status
Label used to display various status messages. |
protected int |
m_tvLines
The number of lines per TV frame. |
protected int |
m_vline
The current vertical line being drawn. |
Fields inherited from class org.razvan.jzx.BaseComponent |
---|
m_logger, m_spectrum |
Constructor Summary | |
---|---|
BaseSpectrum()
|
Method Summary | |
---|---|
void |
emulate()
The main emulator loop. |
java.awt.Component |
getContainer()
Return a Container that decorates the Spectrum screen and adds other UI elements such as a status bar. |
Z80 |
getCPU()
Trivial accessor for this Spectrum's CPU. |
long |
getFrequency()
Get the frequency used by the m_clock . |
BaseIO |
getIO()
Trivial accessor for this Spectrum's I/O. |
int |
getIssue()
Trivial accessor for the issue (model) of this Spectrum. |
BaseKeyboard |
getKeyboard()
Trivial accessor for this Spectrum's keyboard. |
BaseMemory |
getMemory()
Trivial accessor for this Spectrum's memory. |
abstract java.lang.String |
getMode()
String that describes the type of Spectrum ("48", "128"). |
int |
getScale()
Trivial accessor for the scale parameter of this Spectrum. |
BaseScreen |
getScreen()
Trivial accessor for this Spectrum's screen. |
int |
getVline()
Trivial accessor for the current TV line being drawn. |
void |
init(BaseSpectrum spectrum,
ILogger logger)
Allocate the clock object, and initialize all contained references (CPU, memory, I/O, screen and keyboard.) |
void |
load(BaseLoader loader)
Load the Spectrum contents from the given loader, by calling the load() method of all contained components. |
void |
pause()
Pause the emulation (asynchronous). |
void |
reset()
Reset all contained references (CPU, memory, I/O, screen and keyboard.) |
void |
setFrequency(long frequency)
Set the frequency used by the m_clock . |
void |
setScale(int scale)
Trivial mutator for the scale parameter of this Spectrum. |
void |
stop()
Stop the emulation (asynchronous.) |
void |
terminate()
Terminate all contained references (CPU, memory, I/O, screen and keyboard) and subsequently set them to null. |
void |
unpause()
Unpause the emulation (asynchronous). |
void |
update()
|
Methods inherited from class org.razvan.jzx.BaseComponent |
---|
getSpectrum |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long FREQUENCY_MS
public static final int ISSUE_2
public static final int ISSUE_3
protected java.awt.Label m_status
protected Z80 m_cpu
protected BaseMemory m_memory
protected BaseIO m_io
protected BaseScreen m_screen
protected java.awt.Container m_container
protected BaseKeyboard m_keyboard
protected Clock m_clock
protected long m_frequency
protected int m_issue
protected int m_vline
protected int m_scale
This value is retrieved by the screen object during its init() phase.
protected int m_tvLines
This value is different for the different Spectrum models.
protected int m_cyclesLine
This value is different for the different Spectrum models.
Constructor Detail |
---|
public BaseSpectrum()
Method Detail |
---|
public void init(BaseSpectrum spectrum, ILogger logger)
init
in class BaseComponent
public void reset()
reset
in class BaseComponent
public void terminate()
terminate
in class BaseComponent
public int getIssue()
public int getScale()
This method is called by the screen object in its init() method.
public void setScale(int scale)
public int getVline()
public long getFrequency()
m_clock
.
public void setFrequency(long frequency)
m_clock
.
frequency
- The clock frequency, in millisecondspublic Z80 getCPU()
public BaseMemory getMemory()
public BaseIO getIO()
public BaseScreen getScreen()
public java.awt.Component getContainer()
public BaseKeyboard getKeyboard()
public abstract java.lang.String getMode()
public void emulate()
The steps performed are as follows:
public void update()
public void pause()
public void unpause()
public void stop()
public void load(BaseLoader loader)
load
in class BaseComponent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |