com.monkeycoder.monkeynes.hardware
Class DefaultMemoryFilter

java.lang.Object
  |
  +--com.monkeycoder.monkeynes.hardware.DefaultMemoryFilter
All Implemented Interfaces:
MemoryFilter

public class DefaultMemoryFilter
extends Object
implements MemoryFilter

This class fulfills the MemoryFilter interface and does no translation of values. Please note that MemoryFilters apply ONLY to single byte reads and writes or byte range reads and writes. No filtering is done for "word" reads or writes.

Originally part of the MonkeyNES project.

Author:
David Stephens

Constructor Summary
DefaultMemoryFilter()
          Creates a new DefaultMemoryFilter.
 
Method Summary
 int getFilteredReadValue(int inAddress, int inValue)
          This function simply returns the value in memory at the requested address.
 int getFilteredWriteValue(int inAddress, int inValue)
          This function simply returns back the value passed in as the value to write.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultMemoryFilter

public DefaultMemoryFilter()
Creates a new DefaultMemoryFilter.

Method Detail

getFilteredReadValue

public int getFilteredReadValue(int inAddress,
                                int inValue)
This function simply returns the value in memory at the requested address.

Specified by:
getFilteredReadValue in interface MemoryFilter
Parameters:
inAddress - The address from which the value was read.
inValue - A value already read from memory.
Returns:
The filtered value at that address.

getFilteredWriteValue

public int getFilteredWriteValue(int inAddress,
                                 int inValue)
This function simply returns back the value passed in as the value to write.

Specified by:
getFilteredWriteValue in interface MemoryFilter
Parameters:
inAddress - The address of the requested value.
inValue - The value that was going to be written.
Returns:
The value to write at the indicated address.