com.monkeycoder.monkeynes.hardware
Interface MemoryFilter

All Known Implementing Classes:
DefaultMemoryFilter, GameGenie

public interface MemoryFilter

This interface defines how classes that are used for manipulating memory on the fly must behave. 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

Method Summary
 int getFilteredReadValue(int inAddress, int inValue)
          This function will be called when memory at the requested address is read.
 int getFilteredWriteValue(int inAddress, int inValue)
          This function will be called when memory at the requested address is written.
 

Method Detail

getFilteredReadValue

public int getFilteredReadValue(int inAddress,
                                int inValue)
This function will be called when memory at the requested address is read. The value returned is implementation specific and may be the value as found at the requested address or any other value.

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 will be called when memory at the requested address is written. The value returned is implementation specific and may be the value supplied to be written or any other value.

Parameters:
inAddress - The address of the requested value.
inValue - The value that was going to be written.
Returns:
The filtered value to write at the indicated address.