jfrace.device
Class GI_AY_3_8910

java.lang.Object
  |
  +--jfrace.device.GI_AY_3_8910
All Implemented Interfaces:
Device, Hardware

public class GI_AY_3_8910
extends java.lang.Object
implements Device

This class emulates General Instrument's AY-3-8910 Programmble Sound Generator. Clock rate is assumed to be 4MHz. Note: Noise is not implemented. It uses the undocumented sun.audio package which is a part of any JDK.

Author:
Franz-Josef Elmer

Constructor Summary
GI_AY_3_8910()
          Creates a new instance.
 
Method Summary
 byte getByte(int address)
          Get the byte at the given address.
 int getNumberOfBits()
          Return 8.
 int getNumberOfUnits()
          Return 2.
 int getValue(int address)
          Get the value of the addressable unit at the given address.
 void reset()
          Reset the sound generator.
 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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GI_AY_3_8910

public GI_AY_3_8910()
Creates a new instance.
Method Detail

reset

public void reset()
Reset the sound generator. All voices are stopped.
Specified by:
reset in interface Hardware

getNumberOfBits

public int getNumberOfBits()
Return 8.
Specified by:
getNumberOfBits in interface Hardware

getNumberOfUnits

public int getNumberOfUnits()
Return 2.
Specified by:
getNumberOfUnits in interface Device

getValue

public int getValue(int address)
Description copied from interface: Device
Get the value of the addressable unit at the given address. If the addressable unit is a byte getByte should be supported.
Specified by:
getValue in interface Device
Following copied from interface: jfrace.Device
Parameters:
address - Memory address.
Returns:
the value.

setValue

public void setValue(int address,
                     int value)
Description copied from interface: Device
Set the value of the addressable unit at the given address. If the addressable unit is a byte setByte should be supported.
Specified by:
setValue in interface Device
Following copied from interface: jfrace.Device
Parameters:
address - Memory address.
value - the new value.

getByte

public byte getByte(int address)
Description copied from interface: Device
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.
Specified by:
getByte in interface Device
Following copied from interface: jfrace.Device
Parameters:
address - Memory address.
Returns:
the value of the byte at address.

setByte

public void setByte(int address,
                    byte value)
Description copied from interface: Device
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.
Specified by:
setByte in interface Device
Following copied from interface: jfrace.Device
Parameters:
address - Memory address.
value - new value of the byte at address.