logoalt Hacker News

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

23 points • by tevlon • today at 7:18 PM • 13 comments • view on HN

Based on vermiceli's annotated disassembly of Contra: https://github.com/vermiceli/nes-contra-us. Thanks for the great work.

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. Then the C code to WebAssembly so it runs in the browser.

The cherry on top: online multiplayer, so two players can play co-op over the internet.

Source: https://github.com/epoyraz/nes-contra-us


Comments

raldi • today at 9:07 PM

But the Japanese Contra was so much better! https://www.youtube.com/shorts/CiXzONyCDW0

Dwedit • today at 9:50 PM

All that work and then somehow transposing the A and B keys at the very end.

gwbas1c • today at 8:19 PM

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?

➕ show 4 replies
BSPtree • today at 7:49 PM

Cool, how did you build the multiplayer mode? And how much AI was used?

➕ show 3 replies
einpoklum • today at 8:32 PM

Most of the keys aren't working for me in Firefox though :-(

➕ show 1 reply