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 lines!
show comments
incr_me
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 another comment:
> 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.
Can you comment on how this verification process worked?
You'll have to forgive me for not trying to answer these questions myself by investigating the code/git history, but... I hope you understand.
Actually, I am peeking around the code a bit and it's a bit disappointing, but it's what I should have expected having tried a project like this myself with a Game Boy game. I would like to see what an AI-produced semantic (?) rewrite of a retro game would look like. That is, what a port/rewrite that wasn't so faithful/wedded to the original ROM layout or platform architecture. For example, the agent (and you, presumably) was satisfied with writing a sort of RP2C02 emulator facade instead of doing the hard work of translating the bytes into platform-agnostic graphics rendering code. So now any customization/extensions you write to the game are fundamentally constrained to the abstractions of a specific chip from the 80s.
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.
show comments
shinryudbz
Is the audio not supposed to work? I was hoping to hear the legendary tracks!
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.
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?
show comments
sfblah
No sound and the a and b buttons should be the other direction (a is to the right of b) on the keyboard.
show comments
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? :)
show comments
BSPtree
Cool, how did you build the multiplayer mode? And how much AI was used?
show comments
pmarreck
Where's the sound? You can likely ask AI to emulate the sound hardware with WASM!
Dwedit
All that work and then somehow transposing the A and B keys at the very end.
show comments
erictheguy
Nostalgic!! Took me a few tries to beat the first level haha
pxx
No controller support?
gosen
thanks for bringing back my childhood memories!
einpoklum
Most of the keys aren't working for me in Firefox though :-(
show comments
smjy_studio
[flagged]
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.
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 lines!
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 another comment:
> 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.
Can you comment on how this verification process worked?
You'll have to forgive me for not trying to answer these questions myself by investigating the code/git history, but... I hope you understand.
Actually, I am peeking around the code a bit and it's a bit disappointing, but it's what I should have expected having tried a project like this myself with a Game Boy game. I would like to see what an AI-produced semantic (?) rewrite of a retro game would look like. That is, what a port/rewrite that wasn't so faithful/wedded to the original ROM layout or platform architecture. For example, the agent (and you, presumably) was satisfied with writing a sort of RP2C02 emulator facade instead of doing the hard work of translating the bytes into platform-agnostic graphics rendering code. So now any customization/extensions you write to the game are fundamentally constrained to the abstractions of a specific chip from the 80s.
But the Japanese Contra was so much better! https://www.youtube.com/shorts/CiXzONyCDW0
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.
Is the audio not supposed to work? I was hoping to hear the legendary tracks!
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.
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?
No sound and the a and b buttons should be the other direction (a is to the right of b) on the keyboard.
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? :)
Cool, how did you build the multiplayer mode? And how much AI was used?
Where's the sound? You can likely ask AI to emulate the sound hardware with WASM!
All that work and then somehow transposing the A and B keys at the very end.
Nostalgic!! Took me a few tries to beat the first level haha
No controller support?
thanks for bringing back my childhood memories!
Most of the keys aren't working for me in Firefox though :-(
[flagged]
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.