Skip to content
EZ ROM Patcher

N64 byte order: z64, v64 and n64

Short answer

Nintendo 64 ROMs exist in three byte orders: .z64 is big-endian and the standard for patching, .v64 is byte-swapped, and .n64 is little-endian. A patch built for one produces garbage on another, usually with no error. Check the first four bytes to identify which you have.

The three byte orders

The same N64 game can be stored with its bytes arranged three different ways, depending on the dumping hardware. The data is identical; only the ordering differs. Patches care very much about ordering.

ExtensionOrderFirst four bytesUse for patching
.z64Big-endian, native80 37 12 40Yes, this is the standard
.v64Byte-swapped37 80 40 12Convert first
.n64Little-endian40 12 37 80Convert first

You can identify a ROM with any hex editor by looking at those first four bytes. The extension is not trustworthy, since files get renamed.

Why the wrong order fails silently

This is the dangerous part. xdelta and IPS patches applied to the wrong byte order do not always error. They write bytes at the offsets they were told to, producing a file of the right size that is thoroughly corrupt. You find out when the game fails to boot.

Converting to z64

Tools such as Tool64, ucon64 and the N64 ROM conversion features built into some emulators will swap byte order. Convert to .z64, verify the first bytes read 80 37 12 40, then patch.

After converting, check the CRC32 with the checksum tool against the value the hack author published. That confirms both the byte order and the correct release in one step.

What N64 APS patches check

The N64 flavour of APS reads the cartridge ID at offset 0x3C and the internal ROM checksum at 0x10. A byte-swapped ROM produces nonsense in both, so APS patches at least tell you something is wrong rather than corrupting the file.

Frequently asked questions

What is the difference between z64, v64 and n64 files?

They hold the same game with bytes arranged differently. .z64 is big-endian and native to the console, .v64 is byte-swapped as produced by Doctor V64 hardware, and .n64 is little-endian. Patches target .z64 almost universally.

How do I check which byte order my N64 ROM uses?

Open it in a hex editor and read the first four bytes. 80 37 12 40 is .z64, 37 80 40 12 is .v64, and 40 12 37 80 is .n64. The filename extension can be wrong; the header bytes cannot.

Why did my N64 patch apply without an error but the game will not boot?

Byte order is the usual answer. Formats without validation write to the offsets they were given regardless of whether the underlying data is arranged correctly, so you get a corrupt ROM and no warning.

Keep reading

Last reviewed