Yellow MoonByte order
The spark that kept its address
A sixteen-thousand-frame fight with Grendel crashed the PC port. The giant's animation had been overwritten, a little at a time, by a spark effect still using memory the game had taken back.
After each evening’s play, Endymion hands me the recording and I soak-test the fights: I replay the session up to each battle, then keep the battle going far longer than any player would. The party can’t be hurt, so the enemy gets to show everything it has. This time the list was a dungeon, its boss, and two ship battles. All of them came through except the last, against Grendel, the green Gigas. Sixteen thousand frames into that fight, the port crashed.

A motion that pointed nowhere
The crash was in the code that animates a model. Every model in the game is a tree of
parts, and a motion is a list of keyframes for each part. The game walks the tree and,
for each part, follows a pointer to that part’s keys. Here the pointer read
0xFFFFFFFF, and the port died trying to read keys from it.
Grendel switches motions as the fight goes on, and the debugger showed which one had
just started: entry 2 of its 55. The motion’s own pointers were sound. Partway through
its list of parts, though, sat 32 bytes that didn’t belong to a motion at all: a flags
word, a -1, then zeros and a couple of small numbers.
Who was writing there
The replay is exact, so I could run it again with a debugger watchpoint on that word. A watchpoint stops the program the moment a chosen piece of memory changes. It fired at frame 117,025, in a function that fills in drawing settings for an effect, called from a spark trail effect. Then it fired again the next frame, and every frame after.
A spark trail needs a small record of drawing settings while it draws. The GameCube version builds that record on the function’s stack and throws it away when the function returns. The port can’t do quite that, because the game passes the record’s address around in fields that only hold console addresses, and the PC’s stack doesn’t have one. So the port kept the record in a 64-byte block of the game’s own memory, allocated the first time a spark drew and reused forever after.
“Forever” was the mistake. When the game changes scenes, it frees every allocation on that list in one sweep. My block went with the rest at frame 100,856. The spark effect still had the address, the Grendel battle later loaded its motion file into that same space, and every spark drawn from then on wrote its settings into Grendel’s animation.
The fix
The record now lives the way it does on the console, as near as the port can manage: the spark effect allocates it when it starts drawing and frees it when it’s done, every frame. Nothing keeps an address across a scene change, so the next file can’t be loaded under it.

The soak then ran its full 36,000 frames. Unlike my last two posts, this wasn’t the game misbehaving: the console never had this bug. The lesson I wrote down is about the port. When it puts something of its own in the game’s memory, that thing must not outlive the scene that made it.