I realise this maybe isn't the best venue for this discussion, but I'm curious now.
- Official N64 games include the game name near the beginning. In 32-bit big-endian ("Z64") format, the game name is clearly readable while in other formats it's scrambled, so that suggest that *somebody* at Nintendo decided "big endian" was in some way official.
- CEN64 requires
Z64 format ROM data, so it can be directly mapped into memory and used by the emulated MIPS CPU.
- Mupen64 converts
V64 and N64 formats to Z64 at load-time. A comment says Z64 is "native to the Nintendo 64"
Given the above, I'm pretty confident that from the CPU's point of view, Nintendo 64 carts are big-endian. But maybe there's some translation layer between the cart ROMs and the CPU? According to the N64 devkit
, the only way to read from the cart is to set up a DMA to RAM, and the read address must be 2-byte aligned. That suggests a 16-bit bus, and sure enough, the cartridge pinout
includes pins AD0..AD15.
Since the bus transmits 16 bits in parallel, but most storage only handles 8 bits at a time, we have to decide whether we're going to store bits 0-7 followed by 8-15, or the other way around. In general it could easily go either way (and the existence of the V64 format proves it), but if we can choose, we might as well choose the option that gives simple, straight-forward Z64 images rather than weird middle-endian V64 images.
It's possible that there's another translation layer inside the cart itself, so that little-endian data is converted to big-endian 16-bit chunks when it's transferred through the cartridge connector, but I have no idea how to look up whether that's a thing. It seems unlikely, though: Nintendo would want to keep carts as simple as possible, since they made so many of them, and adding an extra translation layer is the opposite of that.
I would really like to know where the N64 format came from, then. Is it just because it makes it easier to emulate the N64 on little-endian CPUs like x86?
Thanks to CaptainJistuce in #higan, I found a photo of the Turok 2 cartridge board
. There's only 2 chips on it, one of them's the CIC, and the other one (by elimination, the ROM chip) clearly has traces from the pins directly to the cartridge connector, not via any kind of address remapper. The ROM chip's label is MX23L25602-35A, and searching for that finds this report
, which says "...found in the latest Nintendo game cartridges. The memory is organized as 16M x 16 bits."
So, from the perspective of the N64 cartridge, there's no difference between the Z64 and V64 formats (which makes sense, since both of them come from actual cart-dumping devices). If the cartridge ROM were truly little-endian ("N64" format), it would require the console to shuffle them back into place as they were read from the cart... it seems incredibly unlikely that Nintendo would do such a thing, and even more unlikely that the V64 and Z64 developers would do exactly the same thing (they didn't have to make sense of the ROM, just record it and spit it back on demand).
The Wikipedia page for the V64 mentions
(without citation) that V64 and Z64 users used the .v64 and .z64 extensions for their dumped ROMs, but the .n64 file extension "became more popular as N64 emulators began to appear". That sounds very much like the N64 format is a concession for emulators, and nothing to do with what's actually in the physical cart ROM.