conv.

All stories
TechQuiet 11d · day 11

Developer ports NES Contra to WebAssembly with AI-assisted C rewrite

A Show HN project retranslates Contra's 6502 assembly into C and then WebAssembly, adding browser-based online co-op.

What to know

  • tevlon's port chains two translation steps — 6502 assembly to C, then C to WebAssembly — and adds browser-based online co-op not present in the original cartridge.
  • The underlying work rests on vermiceli's pre-LLM, hand-annotated disassembly of Contra (commits from 2023), over 10,000 lines of commented assembly.
  • tevlon used an AI coding agent (Claude Opus 5.5) during the C translation, verifying its output against telemetry captured by playing the game in the Mesen emulator.
  • Commenters raised minor technical gaps (no sound, button-mapping mismatch) and one voiced concern that AI-provider usage restrictions could reduce future hobby ports of this kind.

The dispute Whether this kind of AI-assisted hobby project will remain viable is contested by at least one commenter, who worries that AI providers restricting usage could make such ports rarer, against the thread's broader focus on the human disassembly work. · positions read across 10 posts and comments

most voices

The disassembly and port represent an impressive, labor-intensive engineering feat.

  • “The whole thing (all banks) is more than 10,000 lines of assembly code... I cannot imagine writing and managing 10,000 lines!”

    throwaway2037 · Hacker News ↗
some voices

The playable build has minor technical gaps that need fixing.

  • “No sound and the a and b buttons should be the other direction (a is to the right of b) on the keyboard.”

    sfblah · Hacker News ↗

tevlon Developer who built the WebAssembly Contra portvermiceli Original author of the annotated Contra disassembly

How it unfolded 5 developments, newest first · click a bar or a number to jump articlespostscomments

Peak 5 pieces in 3h at Oct 31, 3 PM; 13 pieces over 11 days (1 article · 2 posts · 10 comments) Oct 31, 3 PM — 5 pieces · 1 article · 2 posts · 2 comments — Hacker News 3, Mastodon 1, Newswires 1Oct 31, 6 PM — 1 piece · 1 comment — Hacker News 1Oct 31, 9 PM — 2 pieces · 2 comments — Hacker News 2Nov 1, 12 AM — quietNov 1, 2 AM — 4 pieces · 4 comments — Hacker News 4Nov 1, 5 AM — quietNov 1, 8 AM — quietNov 1, 11 AM — 1 piece · 1 comment — Hacker News 1Nov 1, 2 PM — quietNov 1, 5 PM — quietNov 1, 8 PM — quietNov 1, 11 PM — quietNov 2, 2 AM — quietNov 2, 5 AM — quietNov 2, 8 AM — quietNov 2, 11 AM — quietNov 2, 2 PM — quietNov 2, 5 PM — quietNov 2, 8 PM — quietNov 2, 11 PM — quietNov 3, 2 AM — quietNov 3, 5 AM — quietNov 3, 8 AM — quietNov 3, 11 AM — quietNov 3, 2 PM — quietNov 3, 5 PM — quietNov 3, 8 PM — quietNov 3, 11 PM — quietNov 4, 2 AM — quietNov 4, 5 AM — quietNov 4, 8 AM — quietNov 4, 11 AM — quietNov 4, 2 PM — quietNov 4, 5 PM — quietNov 4, 8 PM — quietNov 4, 11 PM — quietNov 5, 2 AM — quietNov 5, 5 AM — quietNov 5, 8 AM — quietNov 5, 11 AM — quietNov 5, 2 PM — quietNov 5, 5 PM — quietNov 5, 8 PM — quietNov 5, 11 PM — quietNov 6, 2 AM — quietNov 6, 5 AM — quietNov 6, 8 AM — quietNov 6, 11 AM — quietNov 6, 2 PM — quietNov 6, 5 PM — quietNov 6, 8 PM — quietNov 6, 11 PM — quietNov 7, 2 AM — quietNov 7, 5 AM — quietNov 7, 8 AM — quietNov 7, 11 AM — quietNov 7, 2 PM — quietNov 7, 5 PM — quietNov 7, 8 PM — quietNov 7, 11 PM — quietNov 8, 2 AM — quietNov 8, 5 AM — quietNov 8, 8 AM — quietNov 8, 11 AM — quietNov 8, 2 PM — quietNov 8, 5 PM — quietNov 8, 8 PM — quietNov 8, 11 PM — quietNov 9, 2 AM — quietNov 9, 5 AM — quietNov 9, 8 AM — quietNov 9, 11 AM — quietNov 9, 2 PM — quietNov 9, 5 PM — quietNov 9, 8 PM — quietNov 9, 11 PM — quietNov 10, 2 AM — quietNov 10, 5 AM — quietNov 10, 8 AM — quietNov 10, 11 AM — quietNov 10, 2 PM — quietNov 10, 5 PM — quietNov 10, 8 PM — quietNov 10, 11 PM — quietYesterday, 2 AM — quietYesterday, 5 AM — quietYesterday, 8 AM — quietYesterday, 11 AM — quietYesterday, 2 PM — quietYesterday, 5 PM — quietYesterday, 8 PM — quietYesterday, 11 PM — quiet 1–45
Nov 1Nov 2Nov 3Nov 4Nov 5Nov 6Nov 7Nov 8Nov 9Nov 10now · 12:12 AM ET
  1. 5

    tevlon clarifies the AI-assisted build process and timeline

    Responding to questions, tevlon explains the original disassembly predates usable LLMs (earliest commits from 2023) and that the C-port verification relied on a Mesen telemetry harness checked against Claude Opus 5.5, while crediting vermiceli for the base disassembly work.

    “Then, i spent some time in building a harness and collect telemetry data in Mesen. Once, i had that: i just played the game in the emulator and asked Claude Opus 5.5 to use this as verification.”
    — tevlon
    • Nice! Can you speak to your process? How much structure did you give the agent? Did you have to "discover" the right way to do the port? Perhaps you just asked Claude, and then iterated? How do you feel about the final architecture/layout of the code, and would you approach a similar project in a new way given what you've learned?You said in…

      incr_meHacker News10d agoview on Hacker News ↗
    2 more of the top 3 · 5 posts in this stretch
    • Wow, the source 6502 assembly with comments is incredible: https://github.com/vermiceli/nes-contra-us/blob/main/src/ban...The whole thing (all banks) is more than 10,000 lines of assembly code. When I wrote assembly code for a university computer science course, it was hard to manage even 200 lines. I cannot imagine writing and managing 10,000…

      throwaway2037Hacker News10d agoview on Hacker News ↗
    • As much as I wouldn't want to write that much assembly, you make it less daunting the same way that you would with any other programming language. There are simple idioms for loops that you can macro-ize; similarly for function setup and teardown; more importantly, the concept of a function still exists at that level.

      zahlmanHacker News10d agoview on Hacker News ↗
    all of them →
  2. 4

    Commenter warns AI restrictions could curb such hobby ports

    A commenter expresses concern that moves by Anthropic (and potentially other AI providers) to restrict certain usage could make labor-of-love hacker projects like this port less common going forward.

    “I'm a bit concerned that cool labor of love hacker projects like this will become much less common now that Anthropic (and possibly soon others) is moving to restrict this kind of usage.”
    — davesque
    • Unfortunately, I'm a bit concerned that cool labor of love hacker projects like this will become much less common now that Anthropic (and possibly soon others) is moving to restrict this kind of usage. Oh well, so much for cool fun stuff.

      davesqueHacker News11d agoview on Hacker News ↗
    1 more of the top 2 · 2 posts in this stretch
    • No sound and the a and b buttons should be the other direction (a is to the right of b) on the keyboard.

      sfblahHacker News11d agoview on Hacker News ↗
    all of them →
  3. 3

    Commenter situates the port within a broader transcompilation trend

    msephton links to prior writing on similar assembly-to-modern-platform transcompilation hops, describing use of the same approach to run Lua-based games on SNES and a custom engine on Dreamcast, Wii and web.

    • A couple months ago I wrote about this kind of transcompilation hop-skip-jump: https://news.ycombinator.com/item?id=49643284I used it to get games written in Lua running on SNES and in my own language/engine running on Dreamcast, Wii, Web and more.

      msephtonHacker News11d agoview on Hacker News ↗
  4. 2

    Commenters marvel at the scale of the original disassembly

    Readers react to the underlying hand-commented 6502 assembly source, noting it spans more than 10,000 lines, and praise the difficulty of managing code at that scale.

    “The whole thing (all banks) is more than 10,000 lines of assembly code... I cannot imagine writing and managing 10,000 lines!”
    — throwaway2037
    • One of the things that I'm curious about: How easy / hard is it to use the same NES game with higher resolution / color graphics, and sample-based sound?Are there any emulators out there that let you swap in higher resolution assets so a game can be freshened without a complete port?

      gwbas1cHacker News11d agoview on Hacker News ↗
    2 posts in this stretch →
  5. 1

    tevlon publishes Contra WebAssembly port on Show HN

    tevlon posts a browser-playable NES Contra port built by translating vermiceli's annotated 6502 disassembly into C, checked frame-by-frame against the original in the Mesen emulator, then compiled to WebAssembly with added online co-op multiplayer.

    “I ported it in two steps. First to C: the game logic is translated routine by routine from the 6502 assembly, and checked frame by frame against the original in the Mesen emulator.”
    — tevlon
    1. 1 outlet first by HN Frontpage, 11d ago · read ↗

What people are saying 2 voices from 1 site · best of 10 · verbatim

Still unanswered
  • How much structure did you give the agent? Did you have to "discover" the right way to do the port, or just ask Claude and iterate?
  • How do you feel about the final architecture/layout of the code, and would you approach a similar project in a new way given what you've learned?