@daxtsu, or maybe @gamesquest1
At which hex address are you looking for these values in the ROM?
Code:case 0x40: return 4 * 1024 * 1024; // 4MB case 0x30: return 3 * 1024 * 1024; // 3MB case 0x20: return 2 * 1024 * 1024; // 2MB case 0x10: return 1 * 1024 * 1024; // 1MB case 0x0C: return 128 * 1024; // 128KB? Contra uses this weird value, but then, Contra doesn't seem to work as a base game anyway. case 0x08: return 512 * 1024; // 512KB case 0x06: return 384 * 1024; // 384KB case 0x04: return 256 * 1024; // 256KB case 0x02: return 128 * 1024; // 128KB case 0x01: return 64 * 1024; // 64KB case 0x00: return 32 * 1024; // 32KB default: return 0xDEADC0DE; // Give an absurd size if we get anything invalid
Contra is 128KB but I don't see 0C in the ROM header?
Super Mario Bros is 40KB but I don't even see that in the list lol, so I'm curious what value that should have.
Nintendo provides their own ROM size info before the ines header. First you find the magic "WUP-CNTR" (for Contra, it'll be different for other games), then you jump back 0xE (14) bytes and that's how you get the ROM's size (for SNES it's 0x16 bytes back, iirc, I'm just looking at the source for snesinject 0.3). I have no clue why they use 0xC for 128kB when it's also 0x02, but it is what it is.
Edit: As for Super Mario Bros, I would guess it would use 0x01 (64KB) since you can fit 40k in 64k.
Last edited by daxtsu,