N64 byte order: z64, v64 and n64
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.
| Extension | Order | First four bytes | Use for patching |
|---|---|---|---|
| .z64 | Big-endian, native | 80 37 12 40 | Yes, this is the standard |
| .v64 | Byte-swapped | 37 80 40 12 | Convert first |
| .n64 | Little-endian | 40 12 37 80 | Convert 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
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 two-character cartridge ID and the country code at offset 0x3C, and the eight-byte check code at 0x10 that the console verifies at boot. A byte-swapped ROM produces nonsense in both, so an APS patch catches the mistake and this patcher refuses to apply it. An xdelta patch, which is the other common N64 choice, records nothing to check and will patch a byte-swapped ROM without a word.
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, and it means the patch was one of the formats with no validation. xdelta and BSDiff 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. An APS or BPS patch would have refused to apply at all.