Skip to main content

5 posts tagged with "faithful-port"

View All Tags

The Rounding Mode Nobody Restored — and Three More Things That Weren't Missing

· 25 min read
reverse-engineering → modernization

Deep in Tiberian Sun's executable there is a helper that converts a floating-point number to an integer. Every game does this thousands of times a second. This one begins by loading a specific x87 control word — the register that tells the floating-point unit how to round — and then it never puts the old one back.

That is not a bug you would ever notice. The control word it loads says round toward zero, and a function whose entire job is truncation wants exactly that. The helper works perfectly. It just leaves the machine in that state afterwards, forever, for every other calculation the game does.

We spent two sessions finding out how much that costs.

Compiled, But Never Called

· 40 min read
reverse-engineering → modernization

Somewhere in Tiberian Sun's executable there is a function that does exactly what you'd want it to do if you were trying to find out whether the Firestorm expansion is installed. It checks for one of Firestorm's files, and it hands back yes or no. It has the shape of an answer.

Nothing in an unmodified game ever calls it.

That turned out to be the shape of practically everything this week. A campaign's win screen quietly picks between three endings depending on the order two flags get checked, not the order you'd guess. A weather event's own settings ship almost entirely switched off in the retail data — present, but functionally dormant. Code built for one purpose gets recompiled, unrenamed, into a completely different one. A tracking script we wrote ourselves was quietly hiding more than half of our own finished work from the backlog it reported. That Firestorm-detection question really does have an answer — just not the one the perfectly-named function seemed to promise. A wall we'd already reverse-engineered down to a tidy, four-function port contract turned out to have a second, undocumented way of killing you. A tool we were about to build, to read the game's sealed data archives, had already been finished months ago and forgotten. And a burrowing-unit mechanic that everyone including us assumed was Tiberian Sun's alone is sitting fully alive in both sequels, which simply never shipped a unit that uses it.

One thread runs under all of it: the plausible-looking thing — a name, a flag, a summary, a task description, our own inventory of our own work — is not always the thing actually running, and the only way to tell is to read the raw instructions instead of the label.

What the Engine Already Knew

· 8 min read
reverse-engineering → modernization

A lot of what a twenty-five-year-old game "does" lives in community memory as much as in the executable — house rules, remembered quirks, features everyone is sure were mods. Spend a day reading the binary of that game and a pattern emerges: the engine already knew. The rule you half-remember is there, usually more precise and stranger than the memory of it. Today was seven passes over the selection, command, alliance, AI, spectator, and campaign-scripting layers, and the throughline was the same each time — the machinery was already present, and our job was to state exactly what it does rather than what we assumed.

Before the First Tank Moves

· 6 min read
reverse-engineering → modernization

A skirmish match seems to begin when the battlefield appears. The engine has a different answer. Long before the first tank accepts an order, it has already turned dialog controls into a match contract, raw map records into terrain, and terrain into connectivity rules that decide where every ground unit may go. This week we followed that preparation chain from both ends.

A Bridge Over Water

· 6 min read
reverse-engineering → modernization

March a column of tanks across a bridge in Red Alert 2 and they cross without a second thought. That "without a second thought" is doing a lot of work. Underneath the bridge is water — impassable to a tank — and yet the two banks behave as if they were one continuous stretch of land. This week we reversed the routine that makes that true, and then spent the back half of the session arguing with ourselves about whether we'd broken something along the way.