|
||||||||||
| 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.NesSpriteMemory
This is a sprite memory bank for the NES. It has only 256 bytes and is accessible
via DMA registers. 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 | |
NesSpriteMemory()
Creates a new NesSpriteMemory initialized to all 0's. |
|
| 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 |
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 |
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 NesSpriteMemory()
| Method Detail |
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 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 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 | |||||||||