Porting a 1989 Game & Watch Game to JavaScript with AI

I've been experimenting with AI-assisted videogame development, and I plan to share some of them over time.

I'm not a professional game developer, although I follow the industry since long and occasionally build small prototypes. What I've seen recently makes me think that some game development workflows are changing dramatically. The first experiment mentioned here isn't necessarily the best illustration of that change, but it's something I wouldn't have expected to work even a year ago.

In some areas of the game dev topic, it's already spectacular what you can do with AI. For sure, you can vibe-code games, and it is getting better because as a friend put it, "it is now a pay-to-win challenge": If you pay for a powerful model like Fable or Astra, they can build very nice prototypes. But the average user is not yet there, it will still take time, multiple iterations, and likely at least a $100/month Claude or Codex subscription. On the other hand, we've clearly passed the threshold of "LLMs can't make videogames", especially if you apply good practices and are deliberate on controlling the what and the how they create.

I think that AI will disrupt (and in some sense, it is already doing it) at least three workflows:

  • Building the software: AI assisted development, debugging, testing, and the myriad of AI-augmented or AI-based tools you can throw to it
  • Game/mechanics prototyping: "Show, don't tell". Faster initial prototypes, and iterating in parallel with a dozen variants and ideas
  • Throwaway asset generation: No more coloured boxes or placeholder textures for your early prototypes

There's also considerable public backlash against AI in games, although I think different uses of AI are frequently mixed. Generating a low-quality image for a commercial game is very different from using AI agents in your IDE or connecting debugging tools through MCPs 1.

As for the second, while some of my experiments are new ideas, many are more ports and adaptations of existing titles. I have already experienced the power of building a very decent prototype of an idea in less than a week, only by myself and with the AI agents working only a few hours each day.

The first Experiment

In any case, as I mentioned, I plan to show some things, so for today let's show the first and simplest experiment that I did: Porting an ancient videogame from an emulator and a ROM to web/JavaScript.

The Zelda Game & Watch game from 1989 was one of my first "game consoles", and I kept the device until around 2019, when I gifted it to a friend still in perfect condition. It probably also biased me towards loving all Nintendo Zelda games ❤️. Anyway, back to the point, this is a physical liquid crystal display from the late eighties, and yet people have been able to reverse-engineer it and make it run in the MAME emulator.

This video is running the emulator:

My Port

So, what did I do? Basically, a variant of what I've been doing for the last two years: Point an agent to the source, in this case MAME and the game ROM (the specific game files), and tell it to "disassemble it and generate a web version that I can play in a browser, using vanilla JavaScript only". I let it run for hours, and while it worked (nearing the end of the game and haven't found any further issues), this was quite wishful thinking, the first output was awful.

I did everything with Claude Sonnet 5.5.

This is the result, including some extras like being able to pause, use cheats (recover all hearts) and save the game 2:

Zelda Game & Watch - web port

To avoid legal issues with Nintendo, I'm not sharing the port.

What Went Well

The biggest achievement ("what went right") was successfully porting the game, period. First time since early 2025 that this attempt worked.

It's clear to me that models have improved significantly, both in code quality and their ability to handle long-horizon tasks. They also seem to have become pretty good at porting code between languages.

Lessons Learned

Way more "what went wrong" points, which is good:

  • The first "build" had no visible graphics. I could hear sound and inputs were working, but porting uneven sprites dumped from the LCD layer as an image (instead of typical 8×8 or greater sprites or tiles) was clearly a challenge for the agent. I had to iterate multiple times until I was sure all sprites and animations were correct.
  • The agent forgot to port some code paths. I had to test every mechanic to ensure full parity, as it would forget to port certain functions. While agents are much better, you still need some guardrails to force them to not leave things behind.
  • Input was at first "too modern" and direct. These old LCD consoles are glorified state machines regarding enemies and projectiles, so most of the "game" is about building reflexes to move quickly before the next "enemy X frame touches you" or before "projectile Y frame" reaches the floor. I also had to iterate significantly until the game felt exactly like the original.
  • No tests. Thus, no other way to confirm that things were working besides me testing and reporting back to the agent. It could read the browser window and take screenshots, but for a game this is not fast enough. And I didn't want to create a headless version of the game, nor expose the full game state.
  • Porting a videogame to web is not optimal. You need to start/reload an http server, and agents don't read quick game updates fast enough. While compiled languages don't automatically solve all the problems, at least you remove the "runtime friction", and can have a faster feedback loop with better tooling.

To Be Continued...

While the AI agent didn't produce a fully working game from a single prompt, with some guidance and iteration I could complete this project.

For my next experiment, I went with something more ambitious: porting a 1986 MS-DOS executable to Go. This time, I'm approaching testing and validation very differently.

I'm also experimenting with tooling specifically designed for AI agents from multiple angles, including ways to inspect, debug, and interact with games through MCPs. Lastly, as a friend put it, "then the tools demanded tools", so I am also building some tools to work better in agentic-first workflows.

More on all of that soon.


  1. There are some impressive MCPs nowadays to connect to many tools, both related to content generation (e.g. Blender) and to analysis and debugging (e.g. IDA or Ghidra). ↩

  2. By serializing into base64 the whole game state and placing it as a querystring fragment. I keep it in my pinned browser tabs, and continue anytime I want. ↩

Tags: AI & ML Development Emulation Game Dev Javascript Testing

The Porting a 1989 Game & Watch Game to JavaScript with AI article was written by Diego, originally published on