com.monkeycoder.monkeynes.base
Class MemoryAccessMessage

java.lang.Object
  |
  +--com.monkeycoder.monkeynes.base.MemoryAccessMessage

public class MemoryAccessMessage
extends Object

This is a data transport class used as a message. It describes exactly what memory was accessed and how.

Originally part of the MonkeyNES project.

Author:
David Stephens

Field Summary
static int MEM_MAIN
           
static int MEM_SPRITE
           
static int MEM_VIDEO
           
static int TYPE_CLEAR
           
static int TYPE_NONE
           
static int TYPE_READ
           
static int TYPE_READ_RANGE
           
static int TYPE_READ_WORD
           
static int TYPE_WRITE
           
static int TYPE_WRITE_RANGE
           
static int TYPE_WRITE_WORD
           
 
Constructor Summary
MemoryAccessMessage(int inMemBank, int inType)
          Creates a new MemoryAccessMessage for access messages with no specific address access.
MemoryAccessMessage(int inMemBank, int inType, int inAddr)
          Creates a new MemoryAccessMessage based on a single byte access.
MemoryAccessMessage(int inMemBank, int inType, int inAddrStart, int inAddrStop)
          Creates a new MemoryAccessMessage based on a multiple byte access.
 
Method Summary
 int getAddr()
          For single byte access, this method returns the address of the accessed byte.
 int getAddrStart()
          For multiple byte access, this method returns the start address of the accessed memory.
 int getAddrStop()
          For multiple byte access, this method returns the stop address of the accessed memory.
 int getMemoryBank()
          Returns which memory bank was accessed.
 int getType()
          Returns the type of memory access that was performed.
 String toString()
          Converts the data in this message to a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MEM_MAIN

public static final int MEM_MAIN
See Also:
Constant Field Values

MEM_VIDEO

public static final int MEM_VIDEO
See Also:
Constant Field Values

MEM_SPRITE

public static final int MEM_SPRITE
See Also:
Constant Field Values

TYPE_NONE

public static final int TYPE_NONE
See Also:
Constant Field Values

TYPE_CLEAR

public static final int TYPE_CLEAR
See Also:
Constant Field Values

TYPE_READ

public static final int TYPE_READ
See Also:
Constant Field Values

TYPE_WRITE

public static final int TYPE_WRITE
See Also:
Constant Field Values

TYPE_READ_WORD

public static final int TYPE_READ_WORD
See Also:
Constant Field Values

TYPE_WRITE_WORD

public static final int TYPE_WRITE_WORD
See Also:
Constant Field Values

TYPE_READ_RANGE

public static final int TYPE_READ_RANGE
See Also:
Constant Field Values

TYPE_WRITE_RANGE

public static final int TYPE_WRITE_RANGE
See Also:
Constant Field Values
Constructor Detail

MemoryAccessMessage

public MemoryAccessMessage(int inMemBank,
                           int inType)
Creates a new MemoryAccessMessage for access messages with no specific address access.

Parameters:
inMemBank - Which memory bank was accessed.
inType - Type of access that was performed.

MemoryAccessMessage

public MemoryAccessMessage(int inMemBank,
                           int inType,
                           int inAddr)
Creates a new MemoryAccessMessage based on a single byte access.

Parameters:
inMemBank - Which memory bank was accessed.
inType - Type of access that was performed.
inAddr - Address in memory that was accessed.

MemoryAccessMessage

public MemoryAccessMessage(int inMemBank,
                           int inType,
                           int inAddrStart,
                           int inAddrStop)
Creates a new MemoryAccessMessage based on a multiple byte access. The memory range identified is inclusive.

Parameters:
inMemBank - Which memory bank was accessed.
inType - Type of access that was performed.
inAddrStart - The address where access began.
inAddrStop - The address where access ended.
Method Detail

getMemoryBank

public int getMemoryBank()
Returns which memory bank was accessed.

Returns:
Which memory bank was accessed.

getType

public int getType()
Returns the type of memory access that was performed.

Returns:
The type of memory access that was performed.

getAddr

public int getAddr()
For single byte access, this method returns the address of the accessed byte.

Returns:
The address of the accessed byte.

getAddrStart

public int getAddrStart()
For multiple byte access, this method returns the start address of the accessed memory.

Returns:
The start address of the accessed memory.

getAddrStop

public int getAddrStop()
For multiple byte access, this method returns the stop address of the accessed memory.

Returns:
The stop address of the accessed memory.

toString

public String toString()
Converts the data in this message to a string.

Overrides:
toString in class Object
Returns:
A string representing this memory access.