The Line
Every kernel line with its cycles and the windows its writes must land in. The ordinary line at 63, the longest at 72, and what 74 does to the picture.
From an empty folder to a cartridge you can flash — C on the Melody's ARM and 6507 assembly on the line, for the Atari 2600, with every number in the text measured against a ROM that really ran.
// What this book is
The Atari 2600 has no frame buffer: the processor serves the beam, line by line, in 76 cycles each. The Melody cartridge puts an ARM beside it that computes in C. This book is about both halves at once — the game in the ARM, the line in the 6507 — and it tells how one game, an isometric port of Atic Atac, was made that way.
Every kernel line with its cycles and the windows its writes must land in. The ordinary line at 63, the longest at 72, and what 74 does to the picture.
46 ticks in the blank, 31 in the overscan. The book measures every room of the game against them and finds the floor that never needed redrawing.
Repositioning mid-screen, things sorted by row, a rotation so nothing starves. Zaxxon's way, measured to the colour clock.
The ARM draws a framebuffer and packs it into data streams; the 6507 reads them with one two-cycle instruction a line. Where the work goes, and why.
Every chapter from the first picture on ships a ROM built from its own folder, with a desktop simulator that tests the game's rules before Stella runs.
Three voices from the driver, a sprite HUD, text screens, a game you can lose, and the checklist for the Melody and a television.
// A few things the book measured
None of these are estimates. Each came out of a build, read from Stella's debugger by the book's own scripts.
// Read a sample
The draft as it prints: the cover, the table of contents, and then a complete chapter — Isometric rooms, where the room becomes data and the ARM's budget becomes a number. Turn the pages with the arrows, your keyboard, or by clicking the outer edge of a page.
Cover, contents and pages 76–81 of the draft, shown at reading size. The draft runs to 187 pages.
// The interactive edition
The book also reads in a browser — and there it runs. An Atari 2600 with a Melody cartridge, emulated in JavaScript, sits under each chapter's title with that chapter's ROM: press Run and the picture the chapter describes is on the screen, playable.
The sample below is the real thing: the book's own contents and chapter 16 — Isometric rooms — with its ROM beside the text. The button cycles the three rooms.
// What comes with it
The book edition of the game is the book's source: one folder per chapter, each with its kernel, its C, its simulator and a three-line Makefile, growing from the one before. The scripts that took every picture and every measurement in the text are in it too.
snap.sh takes pixel-exact pictures through Stella's debugger, ticks.sh reads the ARM's time from it, and make sim runs the game on the desktop in a second.Every chapter stands on its own, so you can start anywhere and have something that builds and runs:
cd book/ch16-isometric-rooms
make # -> ch16-isometric-rooms.bin
make run # Stella, joystick pinned
make sim # the rules, tested on the desktop
make ticks ROOM=3 # the ARM's time, read from the debugger
You need dasm, the arm-none-eabi GCC toolchain and Stella, all covered in chapter 04. Verified with Stella 7.0 and GCC 10.3.
// What is inside
// Get the book
The draft is complete — 38 chapters, 7 appendices, and the book edition of DUSK MANOR that grows across all of them. Follow the dev log for what comes next.