Skip to content

thebardockgames/evangelion

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

132 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Neon Genesis Evangelion 64 Decompilation

Build Status Matching Status License

A work-in-progress decompilation of Neon Genesis Evangelion (1999) for the Nintendo 64. This is the only officially licensed anime game released for the N64 platform.

๐ŸŽฏ Goal: Produce a matching, byte-for-byte identical ROM using modern tooling and readable C code.


๐Ÿ“‹ Overview

Attribute Details
Game Neon Genesis Evangelion (ๆ–ฐไธ–็ด€ใ‚จใƒดใ‚กใƒณใ‚ฒใƒชใ‚ชใƒณ)
Platform Nintendo 64
Release Date June 25, 1999 (Japan)
Developer BEC Co., Ltd.
Publisher Bandai
ROM Size 32 MB
Original SHA1 a9ba0a4afeed48080f54aa237850f3676b3d9980

๐Ÿ—๏ธ Project Status

Current State: Functional Build - SHA1 Matching โœ…
โ”œโ”€โ”€ Setup:           โœ… Complete
โ”œโ”€โ”€ Extraction:      โœ… Complete (splat)
โ”œโ”€โ”€ Build System:    โœ… Complete (GCC 2.7.2 + modern binutils)
โ”œโ”€โ”€ Matching:        โœ… Complete (100% SHA1 match)
โ””โ”€โ”€ Decompilation:   ๐Ÿ”„ In Progress (C code compilation working)

What's Working

  • โœ… Full ROM extraction and analysis
  • โœ… Build system with authentic GCC 2.7.2 toolchain
  • โœ… Compilation to working ROM (matching SHA1)
  • โœ… Asset extraction (textures, models, audio)
  • โœ… Asset conversion tools (N64 textures โ†” PNG)
  • โœ… Symbol identification

What's In Progress

  • ๐Ÿ”„ Matching the original ROM byte-for-byte
  • ๐Ÿ”„ Decompiling functions from assembly to C
  • ๐Ÿ”„ Documenting game structures and systems

Known Issues

  • Delay Slot Optimization: GCC 2.7.2 reorders certain branch delay slots differently than the original compiler
  • Data Alignment: Minor differences in global data section alignment (offset 0x3E738)

๐Ÿ› ๏ธ Building

Requirements

  • Linux or WSL (Windows Subsystem for Linux)
  • Python 3.8+ with pip
  • build-essential and binutils-mips-linux-gnu
  • Your own legally obtained copy of the game ROM

Quick Start

# 1. Clone the repository
git clone https://github.com/YOUR_USERNAME/evangelion.git
cd evangelion

# 2. Place your ROM in the project root
cp /path/to/your/evangelion.z64 ./evangelion.z64

# 3. Setup (extracts assets and builds tools)
make setup

# 4. Build the project
make

# 5. Verify matching (optional)
sha1sum -c evangelion.sha1

Build Output

A successful build will produce:

  • build/eva.elf - Linked ELF file
  • build/eva.z64 - Final ROM (should match original when complete)
  • build/eva.map - Linker map for debugging

๐ŸŽจ Asset Tools

The project includes tools for working with the game's image assets:

Viewing Textures

Convert N64 textures (CI4/CI8/YAY0) to PNG format:

# Convert single image
python tools/n64image_viewer.py assets/Images/D09S9A00.pal_554.320x240.ci8.yay0.bin

# Convert all images (creates assets/Images_preview/)
python tools/convert_all_images.py

Over 2,300 textures have been converted and are viewable in assets/Images_preview/.

Modifying Textures

To replace a game texture:

  1. Edit the PNG in assets/Images_preview/
  2. Convert back to N64 format:
    python tools/png_to_n64.py your_image.png output_name
  3. Ensure file size matches or is smaller than the original (compressed YAY0 files must maintain their size)
  4. Rebuild the ROM: make clean && make

โš ๏ธ Important: The build system uses original compressed assets. Modified images must match the original file size or the ROM layout will break.


๐Ÿ“ Project Structure

eva64/
โ”œโ”€โ”€ asm/                    # Assembly code extracted from ROM
โ”‚   โ”œโ”€โ”€ nonmatchings/      # Functions not yet decompiled
โ”‚   โ””โ”€โ”€ ...
โ”œโ”€โ”€ assets/                # Extracted game assets (gitignored)
โ”‚   โ”œโ”€โ”€ Images/           # Texture files (.ci4, .ci8, .yay0)
โ”‚   โ”œโ”€โ”€ Images_preview/   # Converted PNG previews
โ”‚   โ”œโ”€โ”€ Palettes/         # Color palettes (.pal)
โ”‚   โ”œโ”€โ”€ Font/             # Font textures
โ”‚   โ””โ”€โ”€ ...
โ”œโ”€โ”€ include/               # Header files
โ”‚   โ”œโ”€โ”€ PR/               # Nintendo SDK headers
โ”‚   โ”œโ”€โ”€ libc/             # C standard library
โ”‚   โ””โ”€โ”€ *.h               # Project headers
โ”œโ”€โ”€ src/                   # C source code
โ”‚   โ”œโ”€โ”€ main/             # Main game code
โ”‚   โ”œโ”€โ”€ os/               # LibUltra OS wrappers
โ”‚   โ”œโ”€โ”€ ovl1-8/           # Overlay code
โ”‚   โ””โ”€โ”€ *.c               # Individual translation units
โ”œโ”€โ”€ tools/                 # Build tools
โ”‚   โ”œโ”€โ”€ splat_ext/        # splat extensions
โ”‚   โ”œโ”€โ”€ n64image_viewer.py    # Convert N64 textures to PNG
โ”‚   โ”œโ”€โ”€ convert_all_images.py # Batch convert all textures
โ”‚   โ”œโ”€โ”€ yay0_compress.py      # YAY0 compression tool
โ”‚   โ””โ”€โ”€ ...
โ”œโ”€โ”€ build/                 # Build artifacts (gitignored)
โ”œโ”€โ”€ evangelion.yaml        # ROM segmentation config (splat)
โ”œโ”€โ”€ Makefile              # Build configuration
โ””โ”€โ”€ *.md                  # Documentation

๐ŸŽฎ Technical Details

Architecture

  • CPU: MIPS R4300i (VR4300)
  • Graphics: RCP (Reality Co-Processor) with F3DEX2 microcode
  • Audio: MusyX sound system
  • Memory: 8MB RAM (with Expansion Pak)

Compiler Toolchain

  • Compiler: GCC 2.7.2 (KMC wrapper)
  • Assembler: GNU binutils 2.35+ (modern, with compatibility macros)
  • Linker: mips-n64-ld
  • Disassembler: spimdisasm 1.39.0

Overlay System

The game uses 8 dynamically loaded overlays:

Overlay ROM Range Description
ovl1 0x69EE0 - 0x74BB0 Main gameplay logic
ovl2 0x74BB0 - 0xCF110 Additional systems
ovl3 0xCF110 - 0x113B10 Japanese text & subtitles
ovl4 0x113B10 - 0x117A00 -
ovl5 0x117A00 - 0x14F960 -
ovl6 0x14F960 - 0x175640 -
ovl7 0x175640 - 0x1A1880 Mission text & dialogues
ovl8 0x1A1880 - 0x1BB280 -

๐Ÿ“ Documentation


๐Ÿค Contributing

This is a personal research project, but feedback and suggestions are welcome!

If you're interested in N64 decompilation:

  1. Check out the N64 Decomp Discord
  2. Visit decomp.me for collaborative decompilation
  3. See n64decomp.github.io for resources

๐Ÿ™ Acknowledgements

  • splat - N64 ROM splitting tool by ethteck
  • spimdisasm - MIPS disassembler by angheloalf
  • decomp.me - Collaborative decompilation platform
  • KMC GCC - Preserved compiler toolchain
  • IlDucci, Zoinkity, Dark_Kudoh - Original text and file table research

โš ๏ธ Legal Notice

This project is for educational and preservation purposes only.

  • You must provide your own legally obtained ROM to build this project
  • The original game and its assets are ยฉ 1999 Bandai / BEC / Khara
  • This repository does not contain any copyrighted game assets or code

๐Ÿ“Š Matching Status

+ Header:        100% (corrected by n64crc)
+ Code:          100% (matching)
+ Assets:        100% (extracted directly)
+ Data Section:  100% (matching)

Current SHA1: a9ba0a4afeed48080f54aa237850f3676b3d9980 โœ…

Target SHA1: a9ba0a4afeed48080f54aa237850f3676b3d9980


This project is not affiliated with or endorsed by Bandai, BEC, Khara, or Nintendo.

About

WIP Decompilation of the only anime game on N64

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Assembly 68.8%
  • SWIG 14.7%
  • C 12.5%
  • Linker Script 2.5%
  • Python 0.8%
  • C++ 0.7%