Skip to content

About

Fully commented and documented disassembly of Battle City (NES, 1985) for ca65.

Resources

Stars

9 stars

Watchers

1 watching

Forks

Repository files navigation

Battle City (NES) - Complete Disassembly

A fully documented, commented, and buildable disassembly of the NES game Battle City (1985).

About This Project

This is a comprehensive disassembly of Battle City with the following improvements over other available disassemblies:

Key Features

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 .res directives
  • 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

Project Structure

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)

Legal Notice

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

Copyright

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.

Disclaimer

  • 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.

Requirements

Software

  • cc65 toolchain (ca65 assembler and ld65 linker)
  • Python 3.x (for build scripts)

Original ROM

You must provide your own legal copy of the Battle City ROM.

  1. Obtain a legal copy of Battle City (J).nes
  2. 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.

Building

Windows

build.bat

Graphics data is automatically extracted from the original ROM during assembly

Modifying the Game

Editing Levels

Level files are located in the levels/ directory in human-readable ASCII format. Simply edit the .txt files and rebuild.

Credits

Original Game

  • © 1985 Namco Ltd.
  • Developers: Ryouiti Ookubo, Takefumi Hyoudou, Junko Ozawa

Disassembly

  • Disassembled and documented by Griever
  • Conversion from IDA Pro to ca65 format
  • Sound engine analysis and documentation
  • Level data extraction and conversion tools

Tools Used

  • IDA Pro - Initial disassembly
  • cc65 - ca65 assembler and ld65 linker
  • Python - Build automation scripts

Version History

  • v1.0 (2025-12-14) - Initial release
    • Complete source with full comments
    • Sound engine documented
    • ASCII level format
    • Automated build system
    • Byte-perfect assembly

Contributing

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

Community

For discussions about NES development, 6502 assembly, or this disassembly:


This project is for educational and preservation purposes only.

About

Fully commented and documented disassembly of Battle City (NES, 1985) for ca65.

Resources

Stars

9 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages