|
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.mos.VIA6522
public class VIA6522
MOS VIA6522 - Versatile Interface Adapter.
The VIA6522 support two 8 bit bidirectional port (port A and port B) and 2 different timers.
All address are relative to the base address. The base address can be set using a method setBase().
Field Summary | |
---|---|
static int |
ACR
Auxiliary control register |
static int |
IER
Interrupt enable register |
static int |
IER_CA1
|
static int |
IER_CA2
|
static int |
IER_CB1
|
static int |
IER_CB2
|
static int |
IER_CONTROL
|
static int |
IER_SHIFT
|
static int |
IER_TIMER1
|
static int |
IER_TIMER2
|
static int |
IFR
Interrupt flag register |
static int |
PAD
Port A Direction Register |
static int |
PAR
Port A register |
static int |
PARA
Port a no handshake |
static int |
PBD
Port B direction register |
static int |
PBR
Port B register |
static int |
PCR
Peripheral control register |
static int |
T1CH
Timer 1 high byte counter register |
static int |
T1CL
Timer 1 low byte counter register |
static int |
T1LH
Yimer 1 high byte latch register |
static int |
T1LL
Timer 1 low byte latch register |
static int |
T2H
Timer2 hi byte |
static int |
T2L
Timer2 low byte |
Fields inherited from class jmce.sim.AbstractPeripheral |
---|
cpu |
Constructor Summary | |
---|---|
VIA6522()
Default constructor |
|
VIA6522(java.lang.String name,
int base)
Constructor with name and base address |
Method Summary | |
---|---|
void |
addCA2MemoryWriteListener(MemoryWriteListener l)
|
void |
addPortAWriteListener(MemoryWriteListener l)
Add a new memory write listener to Port A register. |
void |
addPortBWriteListener(MemoryWriteListener l)
Add a new memory write listener to Port B register. |
void |
cycle(int n)
Cycle listener. |
int |
getBase()
Return the base for this VIA |
int |
getTimer2Counter()
|
boolean |
readCA1()
|
boolean |
readCA2()
|
boolean |
readCB1()
|
boolean |
readCB2()
|
int |
readMemory(Memory memory,
int address,
int value)
Called when the memory is readed. |
int |
readPortA()
Return the value for the Port A |
int |
readPortB()
|
void |
registerCPU(CPU cpu)
Register a parent CPU for future reference. |
void |
reset()
Reset the the device to the initial state. |
void |
setBase(int base)
Set the base address of this VIA |
java.lang.String |
toString()
|
void |
writeCA1(boolean mode)
|
void |
writeCA2(boolean mode)
|
void |
writeCB1(boolean mode)
|
void |
writeCB2(boolean mode)
|
void |
writeMemory(Memory memory,
int address,
int value,
int oldValue)
Called when a memory write event occours. |
void |
writePortA(int a)
Set the value for port A input called from other peripheral. |
void |
writePortB(int b)
Set the value of the input for port B |
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, 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, setHardware, setHardware, setName |
Field Detail |
---|
public static final int PBR
public static final int PAR
public static final int PBD
public static final int PAD
public static final int IFR
public static final int IER
public static final int IER_CONTROL
public static final int IER_TIMER1
public static final int IER_TIMER2
public static final int IER_CB1
public static final int IER_CB2
public static final int IER_SHIFT
public static final int IER_CA1
public static final int IER_CA2
public static final int ACR
public static final int PCR
public static final int T1CL
public static final int T1CH
public static final int T1LL
public static final int T1LH
public static final int T2L
public static final int T2H
public static final int PARA
Constructor Detail |
---|
public VIA6522() throws SIMException
SIMException
public VIA6522(java.lang.String name, int base) throws SIMException
SIMException
Method Detail |
---|
public int getBase()
public void setBase(int base)
public void reset() throws SIMException
Hardware
reset
in interface Hardware
reset
in class AbstractHardware
SIMException
public void registerCPU(CPU cpu) throws SIMException
Peripheral
registerCPU
in interface Peripheral
registerCPU
in class AbstractPeripheral
SIMException
public void cycle(int n) throws SIMException
CycleListener
cycle
in interface CycleListener
n
- - The number of microprocessor cycle elapsed from
the last call.
SIMException
CPU.addCycleListener(jmce.sim.CycleListener)
public void writeMemory(Memory memory, 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
memory
- - Memory involved in the write operation.address
- - Address written.value
- - Value written.oldValue
- - Old value of this memory location.
SIMException
public int readMemory(Memory memory, 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
memory
- - Memory readed.address
- - Address where the operation occours.value
- - Value readed from the phisical memory or
from previus installed listener.
SIMException
public void writePortA(int a) throws SIMException
SIMException
public int readPortA() throws SIMException
SIMException
public void writePortB(int b) throws SIMException
SIMException
public int readPortB() throws SIMException
SIMException
public void addPortAWriteListener(MemoryWriteListener l)
public void addPortBWriteListener(MemoryWriteListener l)
public boolean readCB2()
public void writeCB2(boolean mode) throws SIMException
SIMException
public boolean readCA1()
public void writeCA1(boolean mode) throws SIMException
SIMException
public void addCA2MemoryWriteListener(MemoryWriteListener l)
public boolean readCA2()
public void writeCA2(boolean mode) throws SIMException
SIMException
public boolean readCB1()
public void writeCB1(boolean mode) throws SIMException
SIMException
public int getTimer2Counter()
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 |