← All games

Donkey Kong

Coleco · Atari 2600 · 1982

Garry Kitchen's two-screen Donkey Kong for the Atari 2600. The cartridge's own program, translated into JavaScript one instruction at a time with every cycle counted, so each barrel, jump and ladder plays exactly as it did on the console.

Donkey Kong's barrel screen before a game: Donkey Kong and Pauline at the top, six purple girders joined by ladders, the hammer on the left, Mario at the bottom left, and the score 000000 in blue.
Press Play, wait for the music, then press fire to start
←→ walk · ↑↓ climb · Space jump · Enter Game Reset

How to play

Get Mario to the top. On the barrel screen that means climbing to Pauline; on the rivet screen it means pulling all eight rivets by walking over them. Touch a barrel or a firefox and Mario is gone. The clock is running too: the number at the top is your bonus, and when it reaches zero you lose a life.

At the controls

  • Walk←→ or AD
  • Climb↑↓ or WS
  • JumpSpace / Z
  • Game ResetEnter
  • Pause · MuteP · M

On a gamepad

  • The joystickstick or D-pad
  • JumpA · B · X · Y
  • Game ResetStart
  • PauseBack

After Game Reset the cartridge plays its tune; press the button once it ends. Sound starts after your first click or key press, which is the browser's rule, not the cartridge's.

Bonus and lives

Each screen starts with a bonus of 5000 that drops by 100 about every two seconds. Whatever is left is added to your score when you finish the screen.

You have three Marios: the one playing and the squares at the top right.

The barrel screen in play: barrels rolling down the sloped girders while the bonus counts down at the top.
The barrel screen. Barrels roll down the sloped girders and drop down the ladders.
The rivet screen: level blue girders with gaps where rivets have been pulled, and firefoxes on the girders.
The rivet screen. Pull a rivet and it leaves a gap; stand in one without jumping and you lose a life.

Who's who

Mario

Mario

Walks one pixel every three frames. A jump lifts him 7 lines and holds him there for 31 frames, then drops him back: no arc, and he keeps going whichever way you pushed when he took off.

Barrel

Barrel 100

Jump one for 100 points. Up to four barrels or firefoxes are on the screen at once.

Firefox

Firefox 100

The rivet screen's enemy. Each one starts at a random spot, heading a random way.

Hammer

Hammer 800

Jump into it to grab it. While you hold it, anything it hits is smashed for 800 points, but you cannot climb until it wears off.

Donkey Kong

Donkey Kong

Drawn with the player graphics stretched to double width, on the top line of every screen.

Pauline

Pauline

Colored line by line from her own table, which is how one sprite gets blonde hair and a blue dress.

Built from the ROM

This is not an emulator, and not a remake. A translator read the cartridge's 6502 code, using Dennis Debro's disassembly for labels and comments, and wrote out each instruction as a line of JavaScript with its cycle count. The translated game runs on a model of the 2600's TIA and RIOT chips, and a 6502 core runs the real ROM beside it to prove the two match.

0differences from the cartridge in 100,000 compared frames: registers, cycles, RAM, chip writes and pixels
1,276instructions translated, each with its cycle count
262scanlines in every frame, the NTSC standard
4,096bytes in the whole cartridge, code and graphics
Read in the ROM. The code holds a few things the manual never mentions:
  • The number at the top is the bonus while you play. Your score only shows, in blue, between screens and after the game.
  • The score is kept in hundreds: the last two zeros are never stored.
  • Mario dies by hardware: the TIA's collision latch between his sprite and the obstacles is the only test.
  • You pick up the hammer the same way, through the collision latch for the hammer's sprite, and only while jumping.
  • Leave the game alone and the colors start cycling, to keep a still picture from burning into the TV.
The port keeps all of it, because that is the game.
Developer pages