v6502
The MOS 6502 Virtual Machine and Toolchain Infrastructure
Data Structures | Enumerations | Functions
ines.h File Reference

iNES file transformer More...

#include <ld6502/object.h>

Go to the source code of this file.

Data Structures

struct  ines_properties
 All of the properties that get compiled into the four flag bytes in an iNES header. More...
 

Enumerations

enum  ines_videoMode { ines_videoMode_NTSC, ines_videoMode_PAL }
 An enum to denote possible NES video modes.
 

Functions

int fileIsINES (FILE *infile)
 Tests the first four bytes of a file to see if it is has iNES magic. This function will not rewind, just in case the caller wants to start at something other than the beginning, or if given a stream that cannot be rewound.
 
void writeToINES (FILE *outfile, ld6502_object_blob *prg_rom, ld6502_object_blob *chr_rom, ines_properties *props)
 Take fully linked single flat ld6502_object_blob of program code, a ld6502_object_blob of the CHR ROM, and a struct of iNES ROM-specific ines_properties, and create an iNES ROM using them.
 
void readFromINES (FILE *infile, ld6502_object_blob *prg_rom, ld6502_object_blob *chr_rom, ines_properties *props)
 Load an iNES ROM in, populate an ines_properties struct using the header data, and split the ROM into it's PRG and CHR ROMs. Pass NULL to any pointers whose results you don't care to recieve, and those steps will be skipped.
 
void ld6502_writeObjectToINES (ld6502_object *obj, FILE *file)
 Writes an ld6502_object directly to an iNES file.
 
void ld6502_readObjectFromINES (ld6502_object *obj, FILE *file)
 Read an ld6502_object from an iNES file. This expects an already allocated ld6502_object.
 

Detailed Description

iNES file transformer