NesRomFile

NesRomFile

Used to represent a NES rom. Contains a bunch of methods to analyze the static content in the rom.

Constructor

# new NesRomFile(romFile)

Creates a NesRomFile instance.

Parameters:
Name Type Description
romFile String

The path to the rom, relative to the current test file.

Members

# raw

Array containing the raw data from the rom, for your own inspection.

# symbols

If there is a .dbg file with the same name as the rom in the same folder, this will have a list of all recognized assembly and c symbols parsed from the debug file, mapped to memory addresses. If you have debugging in mesen working, this work with the same file.

It has two sub-objects: assembly and c. (The C one will only be populated if you created a game with C debugging symbols.) This is used within NesEmulator to test ram values at these locations.

Methods

# getIncludesBatteryBackedRam() → {Boolean}

Check if the rom includes battery-backed ram.

Returns:

True if the header indicates using battery backed ram, otherwise false.

Type
Boolean

# getIncludesFourScreenVram() → {Boolean}

Test if the rom includes 4 screen vram.

Returns:

True if the header indicates supporting 4 screen vram, false otherwise.

Type
Boolean

# getMapper() → {Number}

Get the mapper number

Returns:

The mapper number specified in the header.

Type
Number

# getMirroring() → {String}

Gets the mirroring value from the rom header.

Returns:

A string value of either "vertical" or "horizontal".

Type
String

# hasValidHeader() → {Boolean}

Test the rom's header, to make sure it is valid and makes sense for the rest of the rom contents.

Returns:

True if the rom has a valid header, and contents that match the header. Otherwise false.

Type
Boolean