About this port

River Raid
Petro Raid

Carol Shaw's endless river, rebuilt for the browser from the cartridge's own tables and the labelled 6502 disassembly. No emulator, no external assets — and a second, high-resolution presentation, Petro Raid, that turns the same raid into a desert oil corridor.

Two graphics modes

Same raid, two battlefields

Petro Raid is the default. It keeps the cartridge's zero-page state, block generator, collision masks, scoring, fuel and timing, but renders the world as a high-resolution desert waterway. The Petro Raid / River Raid switch on the main page swaps the presentation instantly; the simulation does not change.

Petro Raid: an F-16 over a desert river with oil tankers, a battleship and a helicopter.
Petro Raid — high-resolution desert mode (default)
River Raid: the original 160 x 199 pixel river between green banks.
River Raid — the original 160 × 199 pixel display
TankerBattleship
HelicopterMil Mi-24
Jet fighterHESA Kowsar
Fuel depotVertical oil tanker
BridgeWater minefield
HouseOil tank farm
Player jetF-16
MissileSidewinder

The banks become desert sand with wet shorelines, foam and rocks. Collision geometry still comes from the original 160 × 199 playfield and sprite masks, so the new artwork never changes what the game counts as a hit.

The barrel price

Petro Raid's score readout is the price of a barrel of crude oil, starting at $200.00. The price is tracked in whole cents, so every few hits visibly removes pennies. The curve is anchored to the player-distribution figures:

ScorePlayers reaching itBarrel price
0100%$200.00
5,00098%$196.00
15,00039%$78.00
35,00018%$36.00
50,00014%$28.00

Between anchors the price interpolates in cents. Above 50,000 points the last $28.00 drains over another 50,000 points and clamps at $0.00, so it can never go negative. The underlying point score is still tracked and shown in small type on the HUD.

At the controls

Steer←→ or AD
Speed up↑ or W
Slow down↓ or S
FireSpace or Z
Game resetEnter
Pause / muteP / M

A gamepad works too: stick or D-pad to fly, any face button to fire, Start for reset, Back to pause.

The river

The river is never stored. Each 32-line block is built just before it scrolls in by the cartridge's 16-bit LFSR, which starts from $A814 every game.

A section is 16 blocks and ends at a road with a bridge. Odd sections run straight; even sections wind and split around islands. Higher levels bring more enemies and fewer fuel depots.

In Petro Raid the water is a desert channel, but the generated width, islands, object positions and section timing are the cartridge's.

What scores

  • Battleship (tanker)30
  • Mi-24 (helicopter)60
  • Kowsar (jet fighter)100
  • Oil tanker (fuel depot)80
  • Minefield (bridge)500
  • Oil tanks (house)0

You start with three jets and earn another every 10,000 points, up to nine.

Under the hood

A port, not an emulator

The game state is the cartridge's zero page: a 256-byte array where every variable stays at its original address, from blockLst at $8E to sound0Id at $F8. The block generator, object spawner, enemy patrolling, collisions, scoring, fuel and sound routines are ported from the disassembly instruction by instruction. Both graphics modes read that same state.

01

Extracted graphics

The playfield pages at $FC00/$FD00, the object shapes at $FE00, colour tables at $FF00 and the digit glyphs at $FB00 are read straight from the 4,096-byte ROM by tools/extract_rom.py.

02

Two renderers

River Raid draws the original kernel line schedule. Petro Raid reads the same 160 × 199 masks and paints a 1280 × 796 desert scene, placing each new vehicle from the cartridge's original sprite bounds.

03

Hardware collisions

Collisions are evaluated at the same two points inside each block where the ROM reads the TIA latches, using per-line pixel masks. That keeps the original block-based collision quirks, including the seventh-block edge case, in both modes.

04

TIA sound

The ROM's AUDC/AUDF/AUDV writes drive a software TIA: two channels, polynomial noise, pure tones and a DC blocker, at the 31.4 kHz audio clock. Petro Raid uses the same sound registers.

20,000frames compared byte-for-byte with a reference port of the same ROM
2,000original River Raid frames compared pixel-for-pixel
4,096bytes in the original cartridge
1zero-page simulation shared by both graphics modes