NES 2.0: Add preliminary support for iNES 2.0 format

Currently reads and sets the following:
- mapper number up to 4095, prg rom size, chr rom size
- chr ram (volatile + non-volatile), region (ntsc, pal, dendy or multi-region)

todo: submapper handling, w-ram and prg nvram at least...
This commit is contained in:
retro-wertz
2019-07-05 22:46:22 +08:00
parent bb8aef82c1
commit 51199e59d7
5 changed files with 176 additions and 90 deletions

View File

@@ -10,6 +10,7 @@ typedef struct {
uint32 SaveGameLen[4]; /* How much memory to save/load. */
/* Set by iNES/UNIF loading code. */
int iNES2; /* iNES version */
int mapper; /* mapper used */
int submapper; /* submapper used */ /* TODO: */
int mirror; /* As set in the header or chunk.
@@ -19,7 +20,12 @@ typedef struct {
* set to mapper 4.
*/
int battery; /* Presence of an actual battery. */
int vram_size;
int prgRam; /* prg ram size (volatile) */
int chrRam; /* chr ram size (volatile) */
int prgRam_battery; /* prg ram size (non-volatile or battery backed) */
int chrRam_battery; /* chr ram size (non-volatile or battery backed) */
int region; /* video system timing (ntsc, pal, dendy */
uint8 MD5[16];
uint32 CRC32; /* Should be set by the iNES/UNIF loading
* code, used by mapper/board code, maybe