jfrace
Interface Device

All Superinterfaces:
Hardware
All Known Implementing Classes:
CPMEmulator, RAM, DummyDevice, LCDPanel, ThomsonGDP, LCDDigit, GI_AY_3_8910

public interface Device
extends Hardware

Interface for devices (e.g. RAM, graphic card, printer, etc). A device is a block of consecutive addressable units which will be attached to an AddressSpace. Other Hardware objects (mainly CPUs) can read from or write to the Device via the AddressSpace. The addresses of these calls will be translated by the AddressSpace to the relative address of the Device.

Author:
Franz-Josef Elmer

Method Summary
 byte getByte(int address)
          Get the byte at the given address.
 int getNumberOfUnits()
          Return the number of addressable units.
 int getValue(int address)
          Get the value of the addressable unit at the given address.
 void setByte(int address, byte value)
          Set the byte at the given address.
 void setValue(int address, int value)
          Set the value of the addressable unit at the given address.
 
Methods inherited from interface jfrace.Hardware
getNumberOfBits, reset
 

Method Detail

getNumberOfUnits

public int getNumberOfUnits()
Return the number of addressable units.

getValue

public int getValue(int address)
Get the value of the addressable unit at the given address. If the addressable unit is a byte getByte should be supported.
Parameters:
address - Memory address.
Returns:
the value.

setValue

public void setValue(int address,
                     int value)
Set the value of the addressable unit at the given address. If the addressable unit is a byte setByte should be supported.
Parameters:
address - Memory address.
value - the new value.

getByte

public byte getByte(int address)
Get the byte at the given address. This method is similar to getValue but has a better performance.
WARNING: This method should be used only when the addressable unit is a byte.
Parameters:
address - Memory address.
Returns:
the value of the byte at address.

setByte

public void setByte(int address,
                    byte value)
Set the byte at the given address. This method is similar to setValue but has a better performance.
WARNING: This method should be used only when the addressable unit is a byte.
Parameters:
address - Memory address.
value - new value of the byte at address.