Edit NES Games with AI
In this guide, you will learn how to mod a classic NES game using an AI coder. The idea is simple: take an NES ROM, disassemble it into readable 6502 assembly, ask your AI coder to change the game logic, then reassemble it back into a playable ROM. We’ll use Super Mario Bros as the example. No assembly experience required, the AI does the heavy lifting.
Links
Retrodisasm Tool: https://github.com/retroenv/retrodisasm/releases/
Helper Scripts: https://github.com/patricksheedy/ai-gamemods
Instructions
Download retrodisasm from the releases page above. Extract the executable and put it somewhere in your PATH so you can run it from any folder.
Clone the ai-gamemods repo:
git clone https://github.com/patricksheedy/ai-gamemodsCopy your Super Mario Bros ROM into the
ai-gamemodsfolder and name itsmb.nes.Disassemble the ROM:
disasm.cmd smb.nesThis creates
smb.asmwith the full game source.Open your AI coder in the
ai-gamemodsfolder and give it the prompt in the Prompt section below. Telling it not to test or compile keeps it focused on just editing the asm file, which is faster and avoids it getting stuck trying to run the game.After it finishes making the changes, reassemble the ROM:
asm smb.asmThis creates
smb-edit.nes. Load it into your emulator and try it out. Mario should start as fiery Mario, jump 3 times as high, and be able to jump again in mid-air by pressing A.
Prompt
smb.asm is a disassembly of Super Mario Bros on the NES. Make the following changes to the code.
Do not test or compile, just make the changes to the asm file.
* Mario will start the game as fiery Mario.
* Mario will jump 3 times as high as normal.
* If A is pressed while Mario is in the air he will jump again.
Tips
- To mod a different game, copy in that ROM instead and change the file names in the commands and the game name in the prompt to match.
- If the AI struggles with a large asm file, ask it to first find the relevant routine (player movement, jump physics, power-up state) and then make the change.
- If the ROM doesn’t boot or the game glitches, ask the AI to review its changes, then run
asmagain. Each reassembly overwritessmb-edit.nes. - Only use ROMs you legally own, such as a dump of your own cartridge.