18 points tevlon 2 hours ago 11 comments

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

BSPtree 1 hour ago | parent

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

gwbas1c 1 hour ago | parent

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?

kekebo 50 minutes ago | parent

Idk about swapping assets but zsnes used to have a range of video filters that could improve the experience on a modern screen quite a bit.

Edit: For SNES, not NES, my bad.

unleaded 38 minutes ago | parent

Mesen has texture packs. Don't know about sound, you'd have to reverse each game's sound driver first. https://vgmpf.com/Wiki/index.php?title=Famicom/NES_Sound_Dri...

BSPtree 38 minutes ago | parent

I would not think so, at least not in a meaningful way. That would require to edit the cartridge data thus the ROM, as all sprite data was contained within the cartridge. Sample based sound is impossible natively, as NES and older game consoles don't work with digital data but synthesizers. You could perhaps synthesize the music to WAV files and then enchance it. But then again, NES and thus its emulators have no way of playing digitized audio!

cowlevel 34 minutes ago | parent

The NES in particular is probably not too difficult to upscale, because the graphics data is stored on its own ROM chip (sometimes RAM) in a well structured layout. SMB1 just uses a ROM chip containing many tile graphics which the CPU code addresses by tile index. It would be really easy for an emulator to use the same tile indices to address any arbitrary set of tiles loaded from a PNG. Some games use RAM, which makes it harder as you'd have to index the PNG by hash or something.

pantelisk 29 minutes ago | parent

Compute motion vectors, faux depth, and add DLLS5 to it maybe? Could be pretty cool, or pretty horrific. Only one way to find out :)

vunderba 21 minutes ago | parent

You might like 3dSen, which came out several years ago. It does some pretty crazy stuff, converting NES games into essentially 3D voxel environments.

https://store.steampowered.com/app/1147940/3dSen_PC

einpoklum 47 minutes ago | parent

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

tevlon 26 minutes ago | parent

i only testing in chrome. Will look into it!

raldi 12 minutes ago | parent

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