HN
Today

Show HN: NES Contra (1987) port (ASM –> C and then C –> WebAssembly)

This project resurrects the classic NES Contra, painstakingly porting its 6502 assembly to C and then to WebAssembly for browser play with online multiplayer. It quickly captivated HN with its impressive technical feat, but also sparked intense debate over the creator's prominent use of AI in the process. The discussion dives deep into emulation, control schemes, and the ever-evolving role of AI in software development.

83
Score
56
Comments
#6
Highest Rank
13h
on Front Page
First Seen
Oct 31, 8:00 PM
Last Seen
Nov 1, 8:00 AM
Rank Over Time
68711141213101315172024

The Lowdown

A dedicated developer has brought the iconic NES game Contra to modern web browsers, demonstrating an impressive feat of reverse engineering and transcompilation. The project meticulously translates the original game's 6502 assembly code into C, verifying each frame against the Mesen emulator, before compiling it to WebAssembly. This allows the game to run directly in the browser, requiring users to supply their own ROM.

  • The port follows a two-step process: 6502 assembly logic translated routine-by-routine into C, then compiled to WebAssembly.
  • Verification is done frame-by-frame against the original game in the Mesen emulator to ensure fidelity.
  • A standout feature is the online multiplayer co-op, implemented using deterministic lockstep, WebRTC, and PeerJS for matchmaking and NAT traversal.
  • The creator explicitly states that a significant portion of the work, particularly verification, was assisted by AI models like Claude/Codex.

This project is a remarkable showcase of how classic games can be preserved and reimagined for new platforms, pushing the boundaries of web technology and prompting discussions on the future of development with AI assistance.

The Gossip

AI's Ascendancy and Arguments

The author's candid admission of using AI (Claude/Codex) for a substantial part of the porting process ignited a spirited debate. Some users expressed skepticism or outright disapproval, questioning the 'coolness' or novelty of AI-generated work, and pointing to reports of AI providers restricting such reverse-engineering activities. Others defended AI as a powerful tool, highlighting its efficiency in complex tasks like verifying assembly translations, and suggesting it will foster self-hosted AI solutions. The discussion touched on the ethics, originality, and future implications of AI-assisted development.

Sound Scarcity and Visual Ventures

Many commenters quickly noticed the absence of audio in the browser port, expressing a desire to hear *Contra*'s legendary soundtrack. This led to a technical discussion about the challenges of emulating NES audio, specifically its unique PCM capabilities, and the difficulty of integrating modern sample-based sound. The conversation also branched into possibilities for visual enhancements, with users pondering if higher-resolution assets or advanced rendering techniques (like those seen in 3dSen) could 'freshen up' classic games without a full port.

Control Conundrums and Keypad Quandaries

A surprising amount of discussion revolved around the game's keyboard controls. Several users critiqued the reliance on arrow keys without offering WASD support or controller compatibility, with one commenter provocatively claiming it indicated a 'non-gamer' developer. This sparked a lively counter-argument from long-time gamers who pointed out that arrow keys were the historical standard for 2D PC games and emulators, contrasting them with WASD's origins in FPS games. The debate highlighted differing expectations for modern browser-based retro gaming experiences.