Skip to content

Under the hood

How it works

The Gold Box games were written for a particular late-1980s PC. Amber Folio recreates that machine in software and lets the original game run on it.

The machine

An emulator is a computer made of software. This one includes just the parts a Gold Box game uses: the processor, memory, a display, a timer, the PC speaker and the Tandy 1000’s sound chip, plus the small set of operating-system services the game relies on. The game cannot tell it is not running on real hardware.

The machine Amber Folio buildsA block diagram. Your own copy of the game is loaded into the emulator core. Inside it, an 8086 processor, one megabyte of memory and a BIOS and DOS service layer all meet at a bus; below the bus sit the EGA video adapter, the 8253 timer, the PC speaker and the Tandy 1000's sound chip, and beneath them a virtual clock counted in 1,193,182 ticks a second. The core hands frames and sound out to the host — this page in your browser — and takes key presses back in.Your own copy of the gamethe program and data files, unmodifiedloaded from the files you supplyAmber Folio core8086 CPUreal mode, interpreted1 MB of memory640 KB for the programBIOS and DOSINT 10h · 16h · 21hthe bus — every read and write is sorted hereEGA video320×200, 16 colours8253 timerthe tick and the tonePC speakerone square waveTandy sound chipthree tones and a noisevirtual clock — 1,193,182 ticks a second, and never the host'sframessoundkeysThe host — this page, in your browsercanvas · Web Audio · keyboard
The parts of the emulated machine. Only pictures, sound and key presses cross its edge.

Your copy of the game is loaded into the emulated machine unchanged. Inside, the processor, memory and system services are connected to the display, the timer, the speaker and the sound chip. Finished pictures and sound go out to the page in your browser; your key presses come back in. That is everything that crosses the edge.

The processor

An Intel 8086, the chip in the original IBM PC. The emulator runs each instruction of the game one at a time, and its accuracy is checked against test data recorded from a real chip. A speed setting lets you match the machines the games were designed for.

The screen

An EGA display in the mode the games use: 320×200 pixels in sixteen colours. The emulator draws each frame, and the page shows the newest one. If your browser falls behind for a moment it skips a frame rather than slowing the game down.

Time

The emulated machine keeps its own clock, ticking at the same rate as the original PC’s timer chip. It is told today’s date and time when it starts, and from then on counts for itself rather than reading your computer’s clock. That means a game plays out the same way on any computer — a laptop today, a phone tomorrow — however fast or slow it is.

Sound

Two sound devices: the PC speaker, the one-note-at-a-time beeper every PC had, and the Tandy 1000’s sound chip, with three tone voices and a noise voice. The game plays its footsteps and its fights through the Tandy chip when its settings say so, so the emulator always starts it that way, whatever your copy’s settings file says — and never changes that file. Both devices are mixed and played through your browser.

The services underneath

A game of this era asked the operating system to open files, read the keyboard and print text. The emulator provides those services over a virtual disk made from the folder you supply, so the game finds its files where it expects them.

Why emulate the machine rather than rewrite the game

  • It is your game, exactly. Every rule, table and quirk comes from the program on your disk, so nothing plays slightly differently from how you remember it.
  • One machine, every game. The Gold Box titles share an engine, so getting the machine right once brings the whole series within reach. Games shows how far each one has got.
  • Nothing from the games is needed. The emulator holds facts about the machine, never any part of a game.

Why a browser

  • Nothing to install. Open a page and hand it the folder you already own. The emulator download is about 250 KB. Reading a PDF journal fetches a larger text reader, and only when you use it.
  • The same emulator everywhere. The browser version is the same code as the desktop one, not a cut-down edition.
  • A web page cannot look through your computer. It sees only what you hand it, which is the strongest form of the promise below.
Where your files goA block diagram with two regions. Everything inside a dashed box marked 'your browser' happens on your own machine: the Amber Folio page, the emulator compiled to WebAssembly, and beside it the one filesystem adapter the emulator sees, which sits over two stores — your game files, kept read-mostly, and your saves and settings, written as you play. Below the dashed box, separate from it, sits amberfolio.org, with a single arrow pointing up into the browser: the page and the build it runs are downloaded once, and nothing travels back the other way.Your browserThe Amber Folio pagecanvas, sound, keyboard and touchThe emulatorWebAssembly, running in this tabAmber FolioThe filesystem it seesone adapter over two storesYour game fileskept as you dropped them, read-mostlySaves and settingswritten as you playboth stores stay inside this boxnothing goes back the other waydownloaded onceamberfolio.orgthe page, and the build it runs
How Amber Folio keeps your files: all of it on your own computer.

Your files stay here

Everything inside the dashed box happens on your own computer: the Amber Folio page, the emulator, and the two places your files live — your game files in one, your saves and settings in another. The site sends the page and the emulator to your browser; nothing travels back the other way.

Both are kept between visits, so you hand over your copy once. Keeping saves separate from game files is what will let saved games follow you between devices one day, without a game file ever leaving your machine; that part is not built yet. The guide explains what to supply.

Reading more

The emulator’s own documentation goes deeper. Each link points at the exact build this site runs (commit f222bd3).

The project itself is at github.com/amberfolio/amberfolio (opens in a new tab).

Amber Folio is an independent project and is not affiliated with, endorsed by, or sponsored by any publisher or rights holder of the games it is compatible with. “Pool of Radiance”, “Gold Box”, “Dungeons & Dragons”, “Forgotten Realms”, “Dragonlance”, “Spelljammer” and “Buck Rogers” are trademarks of their respective owners, used here only to describe compatibility. Amber Folio supplies no game files or manuals: you supply your own copy, and the player reads and keeps it in your browser without ever sending it to us.

Generative AI was used to build both this site, its artwork included, and the emulator. Without it, none of this would exist.

Visit amberfolio.org for more information. Made by fans. For adventurers everywhere.