Urgent.News

What's breaking now, across thousands of outlets.

Tech

Decompiling Fast Food Tycoon 2

The computer game Fast Food Tycoon 2, a business simulator released in 2001, was decompiled by the author over the course of a few days. The game allows players to build a pizza empire within a living, isometric city, managing restaurants, warehouses, staff, and supply chains. Players compete with rival companies through advertising, political influence, and organized crime.

To decompile the game, the author set up an agentic loop on their computer using GPT-6.1 Sol Medium. They utilized Ghidra to decompile the 4,046 functions of fastfood2.exe into approximately 9.5MB of C-like text. This raw code was then loaded into SQLite and integrated with a script to facilitate finding related functions without the need to sift through extensive text.

The author employed Windows' ReadProcessMemory API to inspect the running game, comparing memory values with what appeared on screen. This allowed them to identify memory addresses for cash, camera position, and selected buildings, among other elements. The Windows message handler was subsequently patched to enable sending commands to the game's UI thread, enabling control over the game without altering the executable on disk.

The author discovered additional unknown controls through a crawler that navigated the game's interface. The city in the game is painted with a few hundred sprites, with the background rendered into a buffer in memory. The renderer visits map cells diagonally (isometrically) and draws the scene over the background, keeping hidden elements visible by marking them with temporary pixel values.

The renderer combines each pixel's color with its lighting value and writes to the final 16-bit display buffer, applying a repeating dither pattern to draw intermediate shades. The efficiency of the renderer is highlighted by displaying pixels that changed within the last 0.6 seconds, such as cars, walkers, swaying tree tops, and blinking signs. Daylight follows a table of 25 hourly brightness values, with lamps responding to the light level to switch on and off at specific times throughout the night.

The game's pizzeria stages have their own light masks, stored in .spr files, which the renderer uses to compare color values and brightness levels to ensure that windows and signs remain bright even when the rest of the building darkens. Each pizzeria stage has its unique light mask, and the renderer draws window colors from a separate file before applying the light mask.

Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at healeycodes.com →

More in Tech

curiousBuddy: Stop Re-Reading. Start Explaining. 🎙️🧠

An AI-powered study companion that turns passive learning into focused sessions, real conversations, and active recall. This is my submission for the Hacktoberfest Open-Source AI Challenge — Week 3…

  • curiousBuddy transforms passive learning into active recall sessions.
  • Conversational AI Cube challenges users with questions and analogies.
  • Study notes and quizzes reinforce understanding and track progress.

Moving a stop to breakeven in MQL5 without rejected modifies or hidden losses

Moving the stop loss to breakeven once a trade is in profit is one of the most requested Expert Advisor features. It also produces a surprising number of bug reports: the stop never moves, the journal…

  • Stop loss moved to breakeven upon profitability.
  • Correct price used for profit calculation, bid for buy, ask for sell.
  • Breakeven set above entry for buy, below for sell to cover costs.

Facts about breastfeeding

We produce a numerical estimate of the value of unpaid breastfeeding relative to national income spanning five centuries and integrating historical and bioarchaeological data.

More from Sunday 25 October →