Yellow MoonByte order
The texture that outlived its file
Leaving a jungle area crashed the PC port. The crash site was innocent: a scrolling texture had been pointing at freed memory for five thousand frames.
Endymion was working through the jungle, climbing between the treehouses, and walked out the far end. The PC port crashed on the way out. They’d been playing with the session recorder on, as always, so I had their exact button presses from the moment they loaded their save.

The crash that wasn’t the crash
Replaying the recording crashed at the same frame, 79,533, as the area was being torn down. The crash report pointed at a small function that looks a key up in the scene’s loaded data files, and the address it died reading was 4. In other words, it took the start of a list of records from a file’s header, found zero there, and read from just past zero.
The file it was reading was a route file, the data a scene’s scripted events run on, and its whole header was zeros. That’s not a file with no records. That’s a file something had written over.
My first guess was a stale entry: a file freed but still listed, so the lookup read whatever had moved into its memory. I had the debugger log every file the game registered and every free, all the way through the session. Every route file was taken off the list before it was freed. So that wasn’t it.
My second move was a wrong turn. I made the lookup skip a file with no records and ran the replay again. It crashed a moment later, inside the memory allocator, on a heap record smashed into garbage. Something was writing where it shouldn’t, and the lookup had only been the first thing to trip over it.
A watchpoint on the header
The question became who writes zeros over that header. A debugger watchpoint answers exactly that: it stops the program the moment a chosen piece of memory changes. I set one on the header of each route file as the game loaded it. It fired during the teardown, in the function that resets scrolling textures.
You’ve seen these: the flowing water, the shimmering surfaces. The game animates a model by sliding its texture coordinates every frame, and it keeps a “scroll slot” for each one. When an area ends, it writes the original coordinates back into the model’s data before letting the slot go.
This slot’s model wasn’t in the route file being overwritten. The strips it pointed at lay in memory that another route file had held until frame 74,049, when the game freed that file. The slot stayed alive, still pointing at the old address.
At frame 75,094, the port’s allocator put a new route file right on top of that space. Then, at the teardown, the reset read the new file’s bytes as if they were the old model’s strips. They made no sense as strips: a count of 9,999 blocks, and an opcode the game doesn’t know, which it steps over two bytes at a time. So it marched along writing texture values every two bytes, across the new file’s header and on into the heap’s own records.
Why the GameCube never noticed
On the console, a freed block isn’t cleared. If nothing new lands there, the old model’s strips are still sitting in it, and the reset rewrites them with the values they already hold. Nothing breaks. That part is inference: I didn’t watch it happen on a console or in Dolphin, because the teardown draws nothing to compare.
I’d met this bug before. Early in the port, a scroll slot outlived a model file that a cutscene script unloaded, and the fix taught that unload path to drop the slots pointing into its file first. Route files get freed by a different path, and nobody had told that one. Now it detaches the slots too, using the same code, which now lives in one place for both.

The lesson I wrote down for myself is the general one. When a fix guards one way of freeing something, find every other way the game frees the same kind of thing.