|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.monkeycoder.monkeynes.hardware.NesRom
The NesRom class represents a physical NES game cartrige. It contains all of the
program and graphics data, information about the structure of the data and about
the presence or abscence of hardware used to manipulate the data. At the moment
the only supported file format that can be used to create a NesRom is the INES
format. This is due to the completeness of the format as well as for the fact
that virtually no other formats even exist in circulation anymore.
Originally part of the MonkeyNES project.
| Field Summary | |
static int |
ROM_FORMAT_INES
|
static int |
ROM_FORMAT_UNKNOWN
|
| Constructor Summary | |
NesRom()
Creates an empty NesRom. |
|
| Method Summary | |
int[] |
getChrRomPage(int pageNum)
Returns the data from the ROM representing the requested page of CHR-ROM. |
byte[] |
getHeaderData()
Returns the raw header data as it was passed in. |
InesRomHeader |
getInesRomHeader()
Returns the InesRomHeader generated when the raw header data
was passed in. |
int[] |
getPrgRomPage(int pageNum)
Returns the data from the ROM representing the requested page of PRG-ROM. |
int[] |
getRomData()
Returns the raw game data as it was passed in. |
String |
getRomFileName()
Returns the file filename from which the data for this ROM was loaded. |
int |
getRomFormat()
Returns the file format identifier. |
int |
getRomFormatHeaderSize(int inRomFormat)
Returns the size of the header data in bytes. |
int |
read(int addr)
Reads any single byte of data from the ROM data. |
int[] |
read(int startAddr,
int stopAddr)
Reads a range of bytes from the ROM data. |
void |
setHeaderData(byte[] inHeaderData)
Sets the ROM header data. |
void |
setRomData(int[] inRomData)
Sets the ROM data. |
void |
setRomFileName(String inRomFileName)
Sets the filename from which the data for this ROM was loaded. |
void |
setRomFormat(int inRomFormat)
Sets the ROM format. |
String |
toString()
Creates a text readout detailing all known data for this ROM. |
void |
write(int addr,
int val)
Updates the ROM data at the specified address with a new value. |
void |
write(int startAddr,
int[] data)
Updates the ROM data starting at the specified address with a new values. |
void |
write(int startAddr,
int[] data,
int len)
Updates the ROM data starting at the specified address with a new values. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int ROM_FORMAT_UNKNOWN
public static final int ROM_FORMAT_INES
| Constructor Detail |
public NesRom()
| Method Detail |
public void setRomFileName(String inRomFileName)
inRomFileName - The filename.public void setRomFormat(int inRomFormat)
inRomFormat - The format identifier.public void setHeaderData(byte[] inHeaderData)
InesRomHeader.
inHeaderData - An array of bytes from the ROM file representing the header.InesRomHeaderpublic void setRomData(int[] inRomData)
inRomData - An array of bytes from the ROM file representing the game data.public String getRomFileName()
public int getRomFormat()
public InesRomHeader getInesRomHeader()
InesRomHeader generated when the raw header data
was passed in.
InesRomHeaderpublic byte[] getHeaderData()
public int[] getRomData()
public int getRomFormatHeaderSize(int inRomFormat)
public int[] getPrgRomPage(int pageNum)
pageNum - The requested page of PRG-ROM.
public int[] getChrRomPage(int pageNum)
pageNum - The requested page of CHR-ROM.
public int read(int addr)
addr - The address of the requested data.
public int[] read(int startAddr,
int stopAddr)
startAddr - The starting address of the requested data.stopAddr - The ending address of the requested data.
public void write(int addr,
int val)
addr - The address to write.val - The value to write.
public void write(int startAddr,
int[] data)
startAddr - The address at which to start writing.data - The incoming data block to write.
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.NesVideoMemory.writeNoMessage(int,int[],int)public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||