APPLE //C · ONE 5¼″ DISK · 6502 ASSEMBLY

BLACK
OUT

Spain. The grid went down. It never came back. Eight dark regions. Bring the light back.

Opening scene: the power grid of Spain THE GRID WENT DOWN. IT NEVER CAME BACK. BLACKOUT Barcelona in the dark
The grid
18,432screens, every one in hi-res
8regions of Spain
2,048locations
16goods to trade
8status ranks

8 regions × 16 × 16 locations × 3 × 3 screens each. Grown from a seed — the disk keeps only what you changed.

A town screen: houses, trees, the hero on the road Outskirts with car wrecks and a raider
Quintamatera · town, level 6

Walk the land

Every location is 3 × 3 screens

Towns, villages, factory works, camps, power lines and burned‑out roads. Guards keep order, villagers keep their heads down, raiders take what they want.

Each place has its name, its owner and its mood — anarchy or order — and it remembers you.

  • ←→↑↓ walk
Market screen: goods, price, stock, what you carry Equipment list: knife, big pack, pistol, bicycle, motorbike
Market · prices change town to town

Trade like a starship captain

Buy cheap. Sell where it's needed.

Every settlement makes something and needs something. Bring what it lacks and it grows — bigger towns, better goods, better prices.

Gear up like a ship in Elite: knife, pistol, a bigger pack, a bicycle that crosses five locations, a motorbike that takes you to the next region.

  • Water
  • Canned food
  • Fresh food
  • Fuel
  • Butane
  • Medicine
  • Batteries
  • Candles
  • Seeds
  • Clothes
  • Tools
  • Spare parts
  • Solar panels
  • Wine + tobacco
  • Rope + ties
  • Stolen goods
  • SPACE trade / search
  • E gear
The raider is down Status window: health, cash, gear, reputation with guards, raiders and villagers
The raider is down

Fight — or don't

One punch. One roll of the dice.

Knock them out with your fists, tie them up, empty their pockets. Or go for the weapon — and live with it: killers don't get to trade in good towns.

Guards, raiders and villagers each remember what you did. Water and food run out on the road.

RaiderStrangerNeighbourHelperPillarMayorHeroLegend
  • A fists
  • W weapon
  • M medicine
  • I status
Region map: only the places you have been are shown Spain overview: eight regions, the ones you have seen
Region map · fog of war

The map

The map knows only where you've been

A 16 × 16 map for every region, black until you walk it. Your own footprints, the neighbours you can see, the star of the substation.

Open a region once — then ride back to it straight from the map.

  • RETURN map
  • T travel
  • R all of Spain
Substation: transformer, cable, relay, fuel — S, black start THE GRID IS ALIVE! CATALONIA HAS LIGHT
Substation · everything is in place

The job

Bring a dead substation back to life

Find a transformer, a cable and a relay. Haul ten cans of fuel. Earn the trust of the people around it. Then throw the switch.

One substation per region. Eight in all.

When all eight are lit

LEGEND: the hero in front of the lit-up grid of Spain. THE LIGHTS ARE BACK ON. SPAIN IS ALIVE.

THE LIGHTS ARE BACK ON

Save at any time — your hero and every region stay on the disk, right where you left them.

Inside the disk

Written in 6502 assembly. Line by line.

No C, no engine, no libraries. BLACKOUT was written in three days — 12 to 14 November 2026 — step by step, each one tested before the next. It runs on an Apple //c that is itself built from logic gates in our simulator, and on any real //c.

11,800lines of assembly
34source files
13 KBof code
8.5 KBof graphics & text
1 MHzone 65C02

01 · Memory

Everything has to fit in 64K

The //c sees 64 kilobytes at once. Two hi-res pages take 16K of it, DOS takes 9K, the machine itself another 4K. The game code lives between the second picture page and DOS — and it is full: 13,180 bytes out of 14,720.

The trick: the 16K of RAM hidden behind the ROM — the language card. Graphics, place names and every message of the game live there. The code switches it on for a few instructions, reads, and switches the ROM back.

; read a place-name syllable from the hidden RAM
        BIT LCRAM           ; switch the language card in
        LDA NM_START,X
        STA STR
        LDA NM_START+1,X
        STA STR+1
        BIT LCROM           ; and the ROM back

02 · The Elite trick

A whole country from 8 bytes

In 1984 Elite packed eight galaxies of 256 planets into a BBC Micro by never storing them. It kept three numbers — a seed — and computed every planet from it.

BLACKOUT does the same with Spain. Each region has a seed of four 16-bit words. One step adds them up and shifts them along. Four steps give the next location: its type, its order, its name, its roads, its prices. Nothing is stored — 2,048 locations come out of 64 bytes.

Catalonia's seed starts with Elite's own numbers: $5A4A $0248 $B753. Elite used three words; the //c has room for a fourth, so every place gets more independent properties.

WLD_STEP:                       ; T = S0 + S1 + S2 + S3, shift left, S3 ← T
        ; T = S0
        LDA SEED
        STA WTMP
        LDA SEED+1
        STA WTMP+1
        ; T = T + S1  (16 bits: low bytes first, then high with carry)
        CLC
        LDA WTMP
        ADC SEED+2
        STA WTMP
        LDA WTMP+1
        ADC SEED+3
        STA WTMP+1
        ; … the same for S2 and S3 …
        ; shift: S0 ← S1, S1 ← S2, S2 ← S3
        LDX #0
@loop:
        LDA SEED+2,X
        STA SEED,X
        INX
        CPX #6
        BNE @loop
        ; S3 ← T
        LDA WTMP
        STA SEED+6
        LDA WTMP+1
        STA SEED+7
        RTS
REG_SEEDS:                      ; one seed per region
        .word $5A4A, $0248, $B753, $1F2E   ; 0 CATALONIA
        .word $3C71, $9E05, $41D2, $7A6B   ; 1 ARAGON
        ; … six more …

03 · Names

VILLA · RE · JO

Elite named its planets from pairs of letters: LAVE, DISO, RIEDQUAT. BLACKOUT builds Spanish-sounding towns from syllables: a beginning, sometimes a middle, an ending — three tables of 32 pieces each.

Which piece? Five bits of the seed. Is there a middle? One more bit. So every one of the 2,048 places has a name, and the game stores none of them.

SANVALVILLAALCATORREMONCARBARPUEBLA…
NAM_PRINT:
        LDA SEED+3              ; beginning: bits 0–4 of S1
        AND #%00011111          ; n = 0–31
        JSR NAM_PART

        LDA SEED+3              ; is there a middle? bit 5 of S1
        AND #%00100000
        BEQ @noMid

        LDA SEED+5              ; middle: bits 0–4 of S2, piece 32 + n
        AND #%00011111
        ORA #%00100000
        JSR NAM_PART
@noMid:
        LDA SEED+7              ; ending: bits 0–4 of S3, piece 64 + n
        AND #%00011111
        ORA #%01000000
        JSR NAM_PART
        RTS

04 · Hi-res without flicker

Draw where nobody looks

The //c has two hi-res pages. The game draws the next frame on the hidden one — erases the hero, moves the people, draws them again — and only then flips the switch. You never see a half-drawn screen.

Apple hi-res packs 7 pixels into a byte, so moving a figure by one pixel means re-shifting every byte of it. At start-up the game builds seven 256-byte tables — one for each shift — and later just looks the answer up.

        JSR NPC_ERASE           ; … people who moved
        JSR NPC_REDRAW          ; 4) people
        JSR HERO_DRAW           ; 5) the hero
        LDX HPG
        LDA HX2
        STA OLDX,X
        LDA HY
        STA OLDY,X
        LDA DPAGE               ; 6) show it
        BEQ @one
        STA HISCR               ; page 2 on screen
        RTS
@one:
        STA LOWSCR              ; page 1 on screen
        RTS
; shift tables: one page per shift s = 0–6 (SHTAB + s × 256):
;   [v]       = (v << s) AND $7F   — what stays in this byte
;   [v + 128] = (v << s) >> 7      — what moves into the next byte

05 · The disk remembers

Only what you changed

The world itself is never saved — the seed rebuilds it. The disk keeps only your footprints: which places you searched, which settlements you helped grow, where you have been. 768 bytes per region, in files REG0 to REG7, plus 64 bytes for the hero.

The fog on the map is one bit per location — “been here”. Explorers are welcome to open the files and flip it.

MAP_BEEN:                       ; the hero is in location HERE: “been here”
        LDX HERE
        LDA LOC_SRCH,X
        ORA #SEEN               ; SEEN = %01000000
        STA LOC_SRCH,X
        RTS

TXT_BSAVE:  .asc "BSAVE REG#,A$4000,L$300"   ; # = region 0–7

06 · Where it came from

Borrowed from the best

Elite1984

The world from a seed. Trading between places, prices from type and order. Ranks — from Harmless to Elite; here, from Raider to Legend. Equipment bought like ship upgrades. Fuel that limits how far you go — and the hyperjump between regions.

Metal GearHideo Kojima

You don't have to kill. Knock them out, tie them up — and every kill makes the world a little more hostile.

Death Stranding2019

The point is to connect places that drifted apart.

Civilization1991

Settlements grow when you bring what they need.

The Last of Us2013

Years after the fall. Little of everything.

Fallout1997

Every place makes something and needs something.

Zelda1986

The whole world is open from the start. Only distance stops you.

Doom1993

Type IDKFA on the map. You'll see.

28 April 2025the real one

At 12:33 the whole Iberian peninsula went dark. Engineers brought the grid back with a black start — substation by substation. In BLACKOUT the lights never came back. Until you.

Video and screens

Play it now

Boot the disk. Bring the light back.

Computer
Apple //c or //e
Or
Apple ][+ with 64K
Drive
one 5¼″ drive
System
DOS 3.3, boots by itself
Display
colour hi-res

In your browser

An Apple //c built from logic gates, running in our simulator — with BLACKOUT already in the drive.

  1. Open cs.khanin.info
  2. Click Demo in the toolbar
  3. Choose Apple //c — BLACKOUT
  4. Click Power off to switch it on
  5. At the title, press N
▸ OPEN THE SIMULATOR

On any Apple II emulator

A standard DOS 3.3 disk image, 140K. AppleWin, MAME, Virtual ][ — or a real //c with a floppy emulator.

  1. Download blackout.dsk
  2. Insert it in drive 1
  3. Boot, then press N
⇩ DOWNLOAD THE DISK

Made on an Apple //c built from logic gates · 6502 assembly · 2026