Show HN: NES Contra (1987) port (ASM –> C and then C –> WebAssembly)
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
Discussion Highlights (15 comments)
BSPtree
Cool, how did you build the multiplayer mode? And how much AI was used?
gwbas1c
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?
einpoklum
Most of the keys aren't working for me in Firefox though :-(
raldi
But the Japanese Contra was so much better! https://www.youtube.com/shorts/CiXzONyCDW0
Dwedit
All that work and then somehow transposing the A and B keys at the very end.
shinryudbz
Is the audio not supposed to work? I was hoping to hear the legendary tracks!
gosen
thanks for bringing back my childhood memories!
egonschiele
Contra is my favorite game of all time so this is a real treat, and the co-op idea is fantastic. Not to be greedy, but how hard would it be to add music? :)
pxx
No controller support?
msephton
A couple months ago I wrote about this kind of transcompilation hop-skip-jump: https://news.ycombinator.com/item?id=49643284 I used it to get games written in Lua running on SNES and in my own language/engine running on Dreamcast, Wii, Web and more.
jasonlotito
Whenever I see a game that uses the arrow keys and doesn't offer WASD as well, I can't help but see a game written by a non-gamer. I consider these fundamentals, and a shibboleth of whether I should care.
pmarreck
Where's the sound? You can likely ask AI to emulate the sound hardware with WASM!
erictheguy
Nostalgic!! Took me a few tries to beat the first level haha
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.
sfblah
No sound and the a and b buttons should be the other direction (a is to the right of b) on the keyboard.