com.monkeycoder.monkeynes.hardware
Class InesRomHeader

java.lang.Object
  |
  +--com.monkeycoder.monkeynes.hardware.InesRomHeader

public class InesRomHeader
extends Object

This class represents the INES format ROM header. It provides access to all the data available in the header.

Originally part of the MonkeyNES project.

Author:
David Stephens

Field Summary
static int CHR_PAGE_SIZE
           
static int PRG_PAGE_SIZE
           
 
Constructor Summary
InesRomHeader(byte[] inRomHeader)
          Creates an INES Header using the bytes passed in.
 
Method Summary
 int getChrRomPageCount()
          Gets the number of 8k pages of CHR-ROM data that are available.
 int getChrRomSize()
          Gets the total size of the available CHR-ROM.
 int getMapperNumber()
          Gets the number of the mapper in use by this cartrige.
 int getPrgRomPageCount()
          Gets the number of 16k pages of PRG-ROM data that are available.
 int getPrgRomSize()
          Gets the total size of the available PRG-ROM.
 boolean isFourScreenVram()
          Gets whether or not there is 4-Screen VRam.
 boolean isHorzMirror()
          Gets whether or not there is a Horizontal Mirror.
 boolean isSramEnabled()
          Gets whether or not SRam is enabled.
 boolean isTrainerPresent()
          Gets whether or not there is a trainer present.
 boolean isVertMirror()
          Gets whether or not there is a Vertical Mirror.
 void setRomHeader(byte[] inRomHeader)
          Sets the raw data of an INES Header using the bytes passed in.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PRG_PAGE_SIZE

public static final int PRG_PAGE_SIZE
See Also:
Constant Field Values

CHR_PAGE_SIZE

public static final int CHR_PAGE_SIZE
See Also:
Constant Field Values
Constructor Detail

InesRomHeader

public InesRomHeader(byte[] inRomHeader)
Creates an INES Header using the bytes passed in. These bytes are probably loaded from a file, but can be loaded from anywhere.

Parameters:
inRomHeader - The raw INES header data.
Method Detail

setRomHeader

public void setRomHeader(byte[] inRomHeader)
Sets the raw data of an INES Header using the bytes passed in. These bytes are probably loaded from a file, but can be loaded from anywhere.

Parameters:
inRomHeader - The raw INES header data.

getPrgRomPageCount

public int getPrgRomPageCount()
Gets the number of 16k pages of PRG-ROM data that are available.

Returns:
The number of PRG-ROM pages available.

getPrgRomSize

public int getPrgRomSize()
Gets the total size of the available PRG-ROM.

Returns:
The size in bytes of the PRG-ROM.

getChrRomPageCount

public int getChrRomPageCount()
Gets the number of 8k pages of CHR-ROM data that are available.

Returns:
The number of CHR-ROM pages available.

getChrRomSize

public int getChrRomSize()
Gets the total size of the available CHR-ROM.

Returns:
The size in bytes of the CHR-ROM.

getMapperNumber

public int getMapperNumber()
Gets the number of the mapper in use by this cartrige.

Returns:
The mapper number.

isFourScreenVram

public boolean isFourScreenVram()
Gets whether or not there is 4-Screen VRam.

Returns:
Whether or not there is 4-Screen VRam.

isTrainerPresent

public boolean isTrainerPresent()
Gets whether or not there is a trainer present.

Returns:
Whether or not there is a trainer present.

isSramEnabled

public boolean isSramEnabled()
Gets whether or not SRam is enabled.

Returns:
Whether or not SRam is enabled.

isVertMirror

public boolean isVertMirror()
Gets whether or not there is a Vertical Mirror.

Returns:
Whether or not there is a Vertical Mirror.

isHorzMirror

public boolean isHorzMirror()
Gets whether or not there is a Horizontal Mirror.

Returns:
Whether or not there is a Horizontal Mirror.