A detailed reverse-engineering effort has produced an annotated disassembly of the classic 1987 NES title *Contra* (US). The project, hosted on GitHub by user vermiceli, aims to provide more than just a static list of instructions; it offers a complete set of tools and documentation to understand how the game functions at its core. This includes providing the assembly code necessary to reconstruct the original Nintendo Entertainment System (NES) ROM file with bit-perfect accuracy.

The technical achievement involves converting the raw machine code back into human-readable 6502 assembly language while maintaining the integrity of the data structures. Because the original hardware used complex memory management—specifically a UxROM cartridge system where only two out of eight memory banks could be active simultaneously—the repository organizes files based on these specific bank locations. For example, 'bank7' contains the primary engine logic, such as input handling and score calculation, while other banks house specialized routines like enemy AI or compressed graphics data. By using the `cc65` compiler suite, developers can now use this repository's build scripts to reassemble the source code into a functional `.nes` ROM that matches the original MD5 hash (`7BDAD8B4A7A56A634C9649D20BD3011B`).

A repository overview for the Contra (US) and Probotector NES game disassembly project.
The GitHub repository provides the annotated disassembly and build scripts for the 1987 NES title.github.com

The project, hosted on GitHub by user vermiceli, aims to provide more than just a static list of instructions; it offers a complete set of tools and documentation to understand how the game functions at its core.

Beyond simple reconstruction, the project serves as an educational resource for retro gaming enthusiasts and software engineers alike. It features extensive supplemental documentation covering various aspects of the game’s architecture: detailed descriptions of every enemy type in the 'Enemy Glossary,' explanations of how enemies aim at players, and breakdowns of the audio engine. The author also notes that they were motivated by unresolved mysteries in the game's history, specifically investigating potential bugs related to level skips. While some technical hurdles remain, such as identifying whether certain behaviors are caused by actual code errors or hardware glitches, the repository provides a transparent roadmap of the game's internal mechanics through mermaid diagrams and debugging symbol support for emulators like Mesen.

One significant limitation noted in the current work is its focus on the US version; however, the tools provided can also be adapted to produce the *Probotector* ROM (the PAL-specific variation). Because these variations differ primarily in sprite assets rather than core logic, the same assembly framework remains applicable. Additionally, while the source material allows for perfect reproduction of 1987 technology, it does not inherently provide modern enhancements—such as high-resolution graphics or sample-based sound—without further modification beyond the scope of this specific disassembly project.

A screenshot from the Mesen debugger showing the game's internal state.
The project includes debugging symbol support for emulators like Mesen to help map internal mechanics.github.com

While some technical hurdles remain, such as identifying whether certain behaviors are caused by actual code errors or hardware glitches, the repository provides a transparent roadmap of the game's internal mechanics through mermaid diagrams and debugging symbol support for emulators like Mesen.