|
jmce - 1_02 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjmce.sim.AbstractHardware
jmce.sim.AbstractPeripheral
jmce.zilog.z80.CTC
public class CTC
Z80 CTC
The Z80 CTC have 4 different channel that can operate as counter or timer.
Each channel have a control register :
BIT 7 1 Enable interrupt BIT 6 0 Timer mode / 1 Counter mode BIT 5 0 Prescaler 16 / 1 Prescaler 256 (Only in timer mode) BIT 4 0 Count failing edge / 1 Count rising edge BIT 3 0 Counter automatic trigger / 1 External trigger (ignored) BIT 2 1 Time constants follow BIT 1 1 Software reset. BIT 0 1 Control word / 0 Interrupt vector.
Properties :
base - Base address of the peripheral (default to 0)
Field Summary | |
---|---|
static int |
CTC_CHANNEL
|
static int |
CW_IE
Enable interrupt |
static int |
CW_RESET
Software reset |
static int |
CW_VECTOR
Interrupt vector |
Fields inherited from class jmce.sim.AbstractPeripheral |
---|
cpu |
Constructor Summary | |
---|---|
CTC()
Default constructor |
Method Summary | |
---|---|
void |
count(int i,
int n)
Called by external peripheral to count pulse. |
void |
cycle(int n)
Called at every instruction cycle to decrement the timer. |
int |
getBase()
Return the base address. |
int |
readMemory(Memory m,
int address,
int value)
Called when the memory is readed. |
void |
registerCPU(CPU cpu)
Register a parent CPU for future reference. |
void |
reset(CPU cpu)
|
void |
reset(int ch)
Reset a CTC channel. |
void |
setBase(int base)
Set the base addres of this CTC |
java.lang.String |
toString()
|
void |
writeMemory(Memory m,
int address,
int value,
int oldValue)
Called when a memory write event occours. |
Methods inherited from class jmce.sim.AbstractPeripheral |
---|
idle, setIdle, setLive |
Methods inherited from class jmce.sim.AbstractHardware |
---|
addHardware, createFrame, destroy, getHardware, getHardware, getHardware, getHardware, getHardware, getHardwareCount, getHardwareForName, getHardwareInstances, getHardwareTree, getName, getParent, init, initSwing, removeHardware, removeHardware, reset, setHardware, setHardware, setName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface jmce.sim.Hardware |
---|
addHardware, destroy, getHardware, getHardware, getHardware, getHardware, getHardwareCount, getHardwareInstances, getHardwareTree, getName, getParent, init, initSwing, removeHardware, removeHardware, reset, setHardware, setHardware, setName |
Field Detail |
---|
public static final int CTC_CHANNEL
public static final int CW_IE
public static final int CW_VECTOR
public static final int CW_RESET
Constructor Detail |
---|
public CTC()
Method Detail |
---|
public void registerCPU(CPU cpu) throws SIMException
Peripheral
registerCPU
in interface Peripheral
registerCPU
in class AbstractPeripheral
SIMException
public void reset(CPU cpu) throws SIMException
reset
in interface ResetListener
SIMException
public int readMemory(Memory m, int address, int value) throws SIMException
MemoryReadListener
This is method is called to notify a read at the specified memory loction.
readMemory
in interface MemoryReadListener
m
- - Memory readed.address
- - Address where the operation occours.value
- - Value readed from the phisical memory or
from previus installed listener.
SIMException
public void writeMemory(Memory m, int address, int value, int oldValue) throws SIMException
MemoryWriteListener
This method is called when a memory write operation occours in the specified memory.
writeMemory
in interface MemoryWriteListener
m
- - Memory involved in the write operation.address
- - Address written.value
- - Value written.oldValue
- - Old value of this memory location.
SIMException
public final void count(int i, int n) throws SIMException
SIMException
public final void cycle(int n) throws SIMException
cycle
in interface CycleListener
n
- - The number of microprocessor cycle elapsed from
the last call.
SIMException
CPU.addCycleListener(jmce.sim.CycleListener)
public void reset(int ch)
Called at CPU reset or when the software reset bit is set.
public void setBase(int base)
public int getBase()
public java.lang.String toString()
toString
in class AbstractHardware
|
jmce - 1_02 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |