|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.util.Observable
|
+--com.monkeycoder.monkeynes.hardware.NesMainMemory
This is a main memory bank for the NES. It has only 64k and part of that is
actually from the ROM. This class is observable and will send all varieties
of access messages to all its observers. There is also a full second set of
access functions that do not send out messages. These are intended for use
by speed intensive pieces of code where messages aren't needed. Please note
that each byte of memory is actual a 32-bit integer and will be automatically
limited to 8-bits internally.
Originally part of the MonkeyNES project.
| Constructor Summary | |
NesMainMemory()
Creates a new NesMainMemory initialized to all 0's. |
|
NesMainMemory(MemoryFilter inFilter)
Creates a new NesMainMemory with the specified MemoryFilter. |
|
| Method Summary | |
void |
clear()
Reinitializes the memory bank to all zeros. |
int |
read(int addr)
Reads the memory at the requested address. |
int[] |
read(int startAddr,
int stopAddr)
Reads the memory at the requested address range. |
int |
readNoMessage(int addr)
Reads the memory at the requested address. |
int[] |
readNoMessage(int startAddr,
int stopAddr)
Reads the memory at the requested address range. |
int |
readWord(int addr)
Reads 2-bytes of memory starting at the requested address. |
int |
readWordNoMessage(int addr)
Reads 2-bytes of memory starting at the requested address. |
void |
setDmaManager(DmaManager inDmaManager)
Sets the DMA Manager that will be used by this bank of main memory. |
void |
setMemoryFilter(MemoryFilter inFilter)
Sets the MemoryFilter that will be used by this bank of main memory. |
void |
setMemoryMapper(MemoryMapper inMapper)
Sets the Memory Mapper that will be used by this bank of main memory. |
void |
write(int addr,
int val)
Updates the memory at the specified address with a new value. |
void |
write(int startAddr,
int[] data)
Updates the memory starting at the specified address with a new values. |
void |
write(int startAddr,
int[] data,
int len)
Updates the memory starting at the specified address with a new values. |
void |
writeIgnoreMapper(int addr,
int val)
Updates the memory at the specified address with a new value. |
void |
writeIgnoreMapper(int startAddr,
int[] data)
Updates the memory at the specified address with a new value. |
void |
writeIgnoreMapperNoMessage(int addr,
int val)
Updates the memory at the specified address with a new value. |
void |
writeNoMessage(int addr,
int val)
Updates the memory at the specified address with a new value. |
void |
writeNoMessage(int startAddr,
int[] data)
Updates the memory starting at the specified address with a new values. |
void |
writeNoMessage(int startAddr,
int[] data,
int len)
Updates the memory starting at the specified address with a new values. |
| Methods inherited from class java.util.Observable |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public NesMainMemory()
MemoryFilter,
DefaultMemoryFilter,
setDmaManager(DmaManager),
setMemoryMapper(MemoryMapper)public NesMainMemory(MemoryFilter inFilter)
inFilter - The MemoryFilter to use instead of a DefaultMemoryFilter.MemoryFilter,
setDmaManager(DmaManager),
setMemoryMapper(MemoryMapper)| Method Detail |
public void setDmaManager(DmaManager inDmaManager)
inDmaManager - The DmaManager that this bank of memory will use.public void setMemoryMapper(MemoryMapper inMapper)
inMapper - The MemoryMapper that this bank of memory will use.public void setMemoryFilter(MemoryFilter inFilter)
inFilter - The MemoryFilter to use instead of a DefaultMemoryFilter.public void clear()
public int read(int addr)
addr - The address to read.
readNoMessage(int)public int readNoMessage(int addr)
addr - The address to read.
read(int)public int readWord(int addr)
addr - The address of the start of the word to read.
readWordNoMessage(int)public int readWordNoMessage(int addr)
addr - The address of the start of the word to read.
readWord(int)
public int[] read(int startAddr,
int stopAddr)
startAddr - The address at which the read will start.stopAddr - The address at which the read will stop.
readNoMessage(int,int)
public int[] readNoMessage(int startAddr,
int stopAddr)
startAddr - The address at which the read will start.stopAddr - The address at which the read will stop.
read(int,int)
public void write(int addr,
int val)
addr - The address to write.val - The value to write.writeNoMessage(int,int)
public void writeIgnoreMapper(int addr,
int val)
addr - The address to write.val - The value to write.writeNoMessage(int,int)
public void writeIgnoreMapperNoMessage(int addr,
int val)
addr - The address to write.val - The value to write.writeNoMessage(int,int)
public void writeNoMessage(int addr,
int val)
addr - The address to write.val - The value to write.write(int,int)
public void write(int startAddr,
int[] data)
startAddr - The address at which to start writing.data - The incoming data block to write.writeNoMessage(int,int[])
public void writeIgnoreMapper(int startAddr,
int[] data)
writeNoMessage(int,int)
public void writeNoMessage(int startAddr,
int[] data)
startAddr - The address at which to start writing.data - The incoming data block to write.write(int,int[])
public void write(int startAddr,
int[] data,
int len)
startAddr - The address at which to start writing.data - The incoming data block to write.len - The number of bytes to write.writeNoMessage(int,int[],int)
public void writeNoMessage(int startAddr,
int[] data,
int len)
startAddr - The address at which to start writing.data - The incoming data block to write.len - The number of bytes to write.write(int,int[],int)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||