尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
Pitfall! (Activision, Atari 2600, 1982) translated into JavaScript instruction for instruction from the cartridge, verified against the real ROM frame by frame
翻譯準備中
正在載入完整 README。
檢視完整 README ↗David Crane's Pitfall! (Activision, 1982), translated into JavaScript instruction for instruction from the original cartridge and checked against the real ROM frame by frame.
The translated program runs on a model of the 2600's TIA (picture, collisions, sound registers) and RIOT (RAM, timer, joystick and console switches):
src/pitfallRecomp.mjs: the cartridge's code, one case per instruction at its ROM address, with the disassembly's labels and comments and each instruction's cycle count. Generated by tools/recompile.mjs.src/pitfallRomData.mjs: the cartridge's tables and graphics, i.e. the bytes no instruction occupies. The cartridge image itself is not included.src/vcsBus.mjs, src/tia.mjs, src/cpu6502.mjs: RAM, RIOT timer and switches, the TIA, and the 6502 registers and arithmetic. The game and the dev oracle share them.src/pitfallMachine.mjs: the translated code on the bus, one frame per runFrame().src/pitfallPlayer.mjs: canvas, keyboard, gamepad, touch buttons, Game Reset, the TV type switch and the TIA sound worklet (src/tiaSound.worklet.js).index.html: the site, with the game embedded. game.html: the game on its own.img/: the poster, scene pictures and icons, rendered from the game by tools/gen-images.mjs.The engine is the one built for the Donkey Kong, Adventure and Berzerk ports.
python -m http.server 5184 --bind 127.0.0.1
Then open http://127.0.0.1:5184/. ES modules need a server; opening the file directly will not work.
Controls: arrows or WASD run and climb, Space or Z jumps (and grabs a vine; down lets go), Enter is Game Reset, P pauses, M mutes. The clock starts with Harry's first step. The page also has a button for the color/B&W switch. Gamepads work too (Start = Game Reset, Back = pause), and phones get touch buttons.
Needs the cartridge at rom/pitfall.a26 (MD5 3e90cf23106f2e08b2781e41299de556, git-ignored, never committed) and, for rebuilding, DASM 2.20.17 with vcs.h in tools/dasm/.
powershell -File tools/build-rom.ps1 # assemble pitfall.asm; must match the cartridge's MD5
node tools/recompile.mjs # regenerate src/pitfallRecomp.mjs and src/pitfallRomData.mjs
node tools/verify-recomp.mjs 20000 1 cover # translation vs the real ROM, frame by frame
node tools/verify-tia.mjs 3000 1 # fast TIA model vs the per-pixel reference
pitfall.asm is Thomas Jentzsch's annotated disassembly. It reads the TIA as CXP0FB-$30 and so on, written for a vcs.h whose read registers sat at $30; with TIA_BASE_READ_ADDRESS=$30 it assembles byte for byte into the cartridge.
verify-recomp runs the real cartridge on a 6502 interpreter (tools/atari/) next to the translation with identical inputs, and requires identical CPU registers, cycle counts, RAM, TIA write logs and pictures after every frame. With cover, identical RAM pokes in both machines set a random scene number now and then and top up the lives. 100,000 frames over five seeds show no differences.
The previous port (its own JavaScript 6502 core checked against Stella traces, a hand-built source-raster renderer, and a frozen Intellivision experiment) is kept locally in archive_old_port/ and not published: its disassemblies, generated tables, traces and memory dumps carry the cartridges' bytes, and it loaded the ROM file at runtime.
Pitfall! is © 1982 Activision, designed and programmed by David Crane. This is an unofficial preservation project, not affiliated with Activision. pitfall.asm is Thomas Jentzsch's annotated disassembly. Colors are from Stella's NTSC palette; the sound worklet follows Ron Fries' TIASound.