Finding the size/chksum of a N64 ROM chip. Internal header?

Includes but not limited to: SNES, Genesis, Sega CD, PlayStation 1, Nintendo 64, Dreamcast, Game Gear and I guess the Virtual Boy.

Moderator:Moderators

Post Reply
Matthias_H
Posts:7
Joined:Wed Mar 24, 2010 2:32 pm
Finding the size/chksum of a N64 ROM chip. Internal header?

Post by Matthias_H » Thu Mar 25, 2010 2:16 am

Dear all,

I was wondering if there is a reliable way to find out the size of a N64 ROM from information that is contained on the cartridge. SNES and Genesis carts have this information embedded in the data somewhere, but so far I have failed to find the counterpart in the N64 ROM header.

When dealing with "old school" ROMs with separate address and data lines, any unused address bits simply lead to a wrapping of the address space. For N64 ones, it appears that the chip outputs either 0xFFFF words, or Hi-Z when reading outside the memory boundaries. However, I don't know if this holds for all game titles, or just the ones I tested.

Also, do N64 carts contain a checksum like SNES ones?

Any hints are greatly appreciated.

Thanks,
Matthias

User avatar
marshallh
Moderator
Posts:2986
Joined:Sat Sep 10, 2005 2:17 pm
360 GamerTag:marshallh
Location:here and there
Contact:

Re: Finding the size/chksum of a N64 ROM chip. Internal header?

Post by marshallh » Thu Mar 25, 2010 9:58 am

Read n64ops#h.txt here http://infrid.com/rcp64/docfiles/n64ops11.zip" onclick="window.open(this.href);return false;

All N64 games have the same header format. The CRC starts at 10bytes into the rom and is 8bytes long.
The CRC is check only against the first 1MB of rom (the first 1MB after the 4k boot header).

You will have to use a look-up table to find out what game is plugged in, and how big it is. Luckily this is pretty easy. Just make your PIC look at the cartridge ID.

For example
Super Smash Bros is AL
Starfox is FX
1080 Snowboarding is TE

These are also shown on the physical cartridge label (e.g. NUS-NALE-USA)
Image

Matthias_H
Posts:7
Joined:Wed Mar 24, 2010 2:32 pm

Re: Finding the size/chksum of a N64 ROM chip. Internal header?

Post by Matthias_H » Thu Mar 25, 2010 10:46 am

You will have to use a look-up table to find out what game is plugged in, and how big it is.
Too bad... I was hoping for a solution that would not involve a database. :( Do you know of any comprehensive listing of IDs and ROM sizes out there, or will I have to download sh*tloads of pirated ROMs and extract two bytes from each of them?
If N64 carts would only show a well-defined behaviour when reading outside the available address range, at least one could come up with some detection mechanism.

Thanks for pointing me to this document, though, which perfectly solves the checksum part of my problem.

Cheers,
Matthias

User avatar
marshallh
Moderator
Posts:2986
Joined:Sat Sep 10, 2005 2:17 pm
360 GamerTag:marshallh
Location:here and there
Contact:

Re: Finding the size/chksum of a N64 ROM chip. Internal header?

Post by marshallh » Thu Mar 25, 2010 11:04 am

Yeah, basically. This will get you started though.
http://tcsr2001.tripod.com/carts/index.html" onclick="window.open(this.href);return false;
Image

User avatar
marshallh
Moderator
Posts:2986
Joined:Sat Sep 10, 2005 2:17 pm
360 GamerTag:marshallh
Location:here and there
Contact:

Re: Finding the size/chksum of a N64 ROM chip. Internal header?

Post by marshallh » Tue Mar 30, 2010 5:59 pm

Another algorithm you could use is to check for several thousand bytes of FFFFs (you could drive the bus with this before reading to detect the cart tr-stating) at the common boundaries of 32Mbit.

Rom sizes I know of:
4mb
8mb
12mb
16mb
24mb
32mb
40mb
64mb

I would advise running this algorithm on a GoodN64 set and verifying it against the actual file size (make sure you have no overdumps, etc of course)
Image

spinout
Portablizer
Posts:107
Joined:Wed Jul 12, 2006 9:01 pm
Location:California
Contact:

Re: Finding the size/chksum of a N64 ROM chip. Internal header?

Post by spinout » Wed Mar 31, 2010 1:26 am

mupen64.ini
Header Code = CRC1 and CRC2.
n64crc.c

Matthias_H
Posts:7
Joined:Wed Mar 24, 2010 2:32 pm

Re: Finding the size/chksum of a N64 ROM chip. Internal header?

Post by Matthias_H » Fri Apr 02, 2010 2:28 am

spinout wrote:mupen64.ini
Header Code = CRC1 and CRC2.
n64crc.c
Wow, not too bad! Pity I've only got 14K of space left.

Post Reply