jmce - 1_02

jmce.z80pack
Class Network

java.lang.Object
  extended by jmce.sim.AbstractHardware
      extended by jmce.sim.AbstractPeripheral
          extended by jmce.sim.Device<java.lang.Integer>
              extended by jmce.sim.Serial
                  extended by jmce.z80pack.Network
All Implemented Interfaces:
Console, Hardware, MemoryReadListener, MemoryWriteListener, Peripheral

public class Network
extends Serial
implements MemoryReadListener, MemoryWriteListener

Network interface.

Each network interface use a pair of consecutive register the first one indicate a status and the second one as data. Bit 0 of status indicate data ready for read and bit 1 indicate that it is possible write.

Version:
1.01
Author:
Mario Viara
See Also:
setBase(int)

Field Summary
 
Fields inherited from class jmce.sim.AbstractPeripheral
cpu
 
Constructor Summary
Network()
           
Network(java.lang.String name, int base)
           
 
Method Summary
 int getBase()
          Retrun 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 setBase(int base)
          Set the base address.
 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.Serial
print, println, println, putchar
 
Methods inherited from class jmce.sim.Device
addInputConsumer, addInputProducer, addOutputConsumer, addOutputProducer, getConnected, read, readOutput, readyRead, readyReadOutput, readyWrite, removeInputConsumer, removeOutputConsumer, setConnected, write, writeInput
 
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
 

Constructor Detail

Network

public Network()

Network

public Network(java.lang.String name,
               int base)
Method Detail

setBase

public void setBase(int base)
Set the base address.

Specify the base addres of this network interface. The 2 user register will be base+0 for the status and base+1 for the data.

Parameters:
base -

getBase

public int getBase()
Retrun the base address.


registerCPU

public void registerCPU(CPU cpu)
                 throws SIMException
Description copied from interface: Peripheral
Register a parent CPU for future reference.

Specified by:
registerCPU in interface Peripheral
Overrides:
registerCPU in class AbstractPeripheral
Throws:
SIMException

readMemory

public int readMemory(Memory m,
                      int address,
                      int value)
               throws SIMException
Description copied from interface: MemoryReadListener
Called when the memory is readed.

This is method is called to notify a read at the specified memory loction.

Specified by:
readMemory in interface MemoryReadListener
Parameters:
m - - Memory readed.
address - - Address where the operation occours.
value - - Value readed from the phisical memory or from previus installed listener.
Returns:
Value readed from the memory.
Throws:
SIMException

writeMemory

public void writeMemory(Memory m,
                        int address,
                        int value,
                        int oldValue)
                 throws SIMException
Description copied from interface: MemoryWriteListener
Called when a memory write event occours.

This method is called when a memory write operation occours in the specified memory.

Specified by:
writeMemory in interface MemoryWriteListener
Parameters:
m - - Memory involved in the write operation.
address - - Address written.
value - - Value written.
oldValue - - Old value of this memory location.
Throws:
SIMException

toString

public java.lang.String toString()
Overrides:
toString in class AbstractHardware

jmce - 1_02