A fully documented, commented, and buildable disassembly of the NES game Battle City (1985).
This is a comprehensive disassembly of Battle City with the following improvements over other available disassemblies:
Fully Commented Source Code
- Every function meaningfully labeled and documented
- Detailed explanations of game mechanics and data formats
- Clear documentation of RAM variables, registers, and data structures
Complete Sound Engine Documentation
- Full commentary on the APU sound system
- Explanation of all sound effects and music routines
- Previously undocumented in my other disassemblies
Proper ca65 Assembly Structure
- Uses ca65/ld65 from the cc65 toolchain (not asm6)
- Correct memory segment organization
- Properly declared RAM variables with
.resdirectives - Clean separation of code modules (main game, sound engine, etc.)
Human-Readable Level Data
- Levels stored as separate ASCII text files
- Easy to view, edit, and modify
- Automatically converted to game format during build process
Automated Build System
- Graphics (CHR) data extracted from original ROM at build time
- Level data compiled from ASCII files
- Single command to build complete ROM
Verified Accuracy
- Assembled ROM is byte-identical to the original
- Target ROM: Battle City (J).nes
- CRC32: F599A07E
battle-city/
├── Battle City (J).asm # Main game code
├── nes.cfg # Linker configuration
├── levels/ # Level data files (ASCII format)
│ ├── 1_level.txt
│ ├── 2_level.txt
│ └── ...
├── build.bat # Build script (Windows)
├── battle_city_level_converter.py # Level converter used in build script
├── convert_all_levels.bat
└── Battle City (J).nes # Original ROM (not included - see below)
Battle City © 1985 Namco Ltd. All rights reserved.
This disassembly is provided for:
- Educational study of NES/6502 programming techniques
- Game preservation and historical documentation
- Research and learning purposes only
Battle City is copyrighted by Namco (now Bandai Namco Entertainment Inc.). All original game code, graphics, music, and other assets remain the property of the copyright holder.
- This project is not affiliated with, endorsed by, or connected to Namco or Bandai Namco Entertainment
- This repository does NOT include the original ROM file or any copyrighted game assets
- Users must own a legal copy of Battle City to use this disassembly
- This disassembly is intended for educational and preservation purposes only
- All trademarks and copyrights belong to their respective owners
If you are a copyright holder and wish this repository to be taken down, please contact me and I will promptly comply.
- cc65 toolchain (ca65 assembler and ld65 linker)
- Download from: https://cc65.github.io/
- Python 3.x (for build scripts)
You must provide your own legal copy of the Battle City ROM.
- Obtain a legal copy of Battle City (J).nes
- Place it in the root directory of this project
The ROM is required because graphics (CHR) data is extracted during the build process
This repository does NOT include the ROM file.
build.batGraphics data is automatically extracted from the original ROM during assembly
Level files are located in the levels/ directory in human-readable ASCII format. Simply edit the .txt files and rebuild.
- © 1985 Namco Ltd.
- Developers: Ryouiti Ookubo, Takefumi Hyoudou, Junko Ozawa
- Disassembled and documented by Griever
- Conversion from IDA Pro to ca65 format
- Sound engine analysis and documentation
- Level data extraction and conversion tools
- IDA Pro - Initial disassembly
- cc65 - ca65 assembler and ld65 linker
- Python - Build automation scripts
- v1.0 (2025-12-14) - Initial release
- Complete source with full comments
- Sound engine documented
- ASCII level format
- Automated build system
- Byte-perfect assembly
While this is primarily a documentation and preservation project, contributions are welcome for:
- Improving code comments and documentation
- Fixing assembly errors or inconsistencies
- Enhancing build scripts
- Adding technical analysis
For discussions about NES development, 6502 assembly, or this disassembly:
- NESDev Forums: https://forums.nesdev.org/
- NESDev Wiki: https://www.nesdev.org/wiki/
This project is for educational and preservation purposes only.