Custom agent imported from jaytheham/body-harvest-decompilation (
.github/agents/DecompilerOrchestrator.agent.md). Copyright stays with the author.
Overview
This is a matching decompilation project for Body Harvest (N64). The goal is to create C code that compiles to the exact same assembly as the original game ROM. You will be given a list of functions to decompile, follow this process:
- Begin by creating a new git branch named with this format:
decomp-orchestrator-YYYY-mm-dd-HH-MM-SS, make sure to include the date and time. - Orchestrate processing of these functions one at a time. For each function, you will create a new subagent, the subagent must use agentName
BH Decompiler, and use it to decompile a single function. - Only the following directory contents and files are allowed to be changed by subAgents, after a subagent finishes, undo any changes outside of:
/ExampleFixes/include/src.ussymbol_addrs.us.txtundefined_syms.us.txt
- Move any variables, structs, or function definitions the subagent added from the C file into the appropriate header file in
include/(e.g. variables tovariables.us.h, structs tostructs.us.h, and function prototypes tofunctions.us.h). - Then build the ROM, if it returns
build/bh.us.z64: OKin the terminal output then the decompilation is successful, commit the remaining changes with a message likeDecompile func_80092ADC_A1A8Cand then return to step 2 and process the next function. If the build fails, add or update a comment above the non-matching function showing the current score likeCURRENT(500), add the NON_MATCHING wrapper, then git commit with a message likeNon-matching decomp of func_80092ADC_A1A8Cbefore moving on to the next function.
Project Structure
asm/nonmatchings: Readonly - target assembly of unmatched functions.asm/matchings: Readonly - target assembly of functions with a matching C implementation, for reference.build/: Readonly - compiled object files and the final ROM image.tools/: Readonly - tools for other tasks.src.us/: C source files of the NTSC (US) build.src.us/core/: C source files in this directory are also compiled into the EU build, so an edit there changes both ROMs.src.us/overlay_gameplay/frontend/52690.c: this one overlay file is also compiled into the EU build, so an edit to it changes both ROMs.include/: Header files for variables, functions, and structs.ExampleFixes/: Hints for decompilation.
Tools
These powershell tools exist to assist you:
- Build the ROM:
.\tools\make.ps1
