* Removed old unused files * Added gltf support * Reverted dkr_assets_tool_settings.json to previous * Added animated model example * document audio_vehicle.c (#588) * wip * wip * wip * wip * document audio_vehicle.c * update score once again * unify function prefix * small tweaks * match func_80060910 and func_80060AC8 (#589) * match func_80060AC8 * reworked func_80060C58 * match func_80060910 * non equivalent func_8006017C * format * match calc_env_mapping_for_object * Homogenate batch flags and render flags and begin the painful task of documenting waves. (#590) * part one of wave pain * 2 * littel bit more * m * h * l * aagghh * yeah * :) * bruh * b * m * faith * z * b * rename batch flags * Update waves.c * fix conflicts * match func_8000B38C (#592) * match func_8000B38C * format code * update score * match calc_dynamic_lighting_for_object_1 (#594) * match calc_dynamic_lighting_for_object_1 * format and score * update score * update score again * Document some Boost data (#593) * Run formatter * Document some boost info * decompile and document math_util.c (#595) * Match func_8002F440 (#596) * Add a WIP attempt of func_8004447C, and add some scratch links * match func_8002F440 and run formatter * Cleanup some comments * Update score, fix warnings, and run formatter again * Remove some bad comments * match: func_8007FFEC (#599) * feat: allow score script to generate treemap file for decomp progress (#598) * Various touchups here and there, some renames in camera.c (#597) * the beginning of the void * update asset tool * void :) * there * cam * model * more * fix warns * ok * whoops missed a rename * Add a few NON_EQUIVALENT functions from scratches to keep them up to date (#602) * WIP func_800101AC * WIP func_800452A0 * cleanup * Formatter and func_8004CC20 near match * func_8004CC20 better score and documentation * func_80049794 WIP and compilable * Major cleanup of func_80049794 * Formatter * Update scratch * Add func_80019808 from scratch * Cleanup func_80019808 * func_80019808 score improvment * Improve func_80049794 score (Thanks Dominik!) * func_8001C6C4 WIP * func_8001E93C WIP * small documenting * Eliminate a lot of Obj64 casts. * fix: do not pass default to treemap arg (#604) * Quick fix for score script (#606) * WIP func_80060EA8 * Quick fix for score script * name and document lights, CC modes and textures (#607) * improve match for func_800BDC80 & match func_80060EA8, func_8002F2AC (#609) * improve match for func_800BDC80 & match func_80060EA8 * match: func_8002F2AC * match: func_800452A0 & func_80042D20 (#611) * partial match: func_800452A0, improve from non equiv to non matching * match: func_800452A0 & func_80042D20 * document: remaining funcs, add decomp.me links (#612) * match func_8004447C (#615) * Document camera and sprites (#614) * Cleanup, and use constants where possible (#617) * Update func_80060EA8 WIP * formatter * More func_80060EA8 * More func_80060EA8 * WIP func_80060EA8 * Minor cleanups and documenting * minot cleanup * Define some constant flags properly * Misc documenting and cleanup * formatter * Fix the scratch link for vsprintf (It was DP's) * Add the WIP version of vsprintf that's 95.82% matching. * Fix score script (#619) * Added gltf support * Allow either commas or vertical pipes for splitting render flags --------- Co-authored-by: Unnunu <serge_zorkin@mail.ru> Co-authored-by: Fazana <52551480+FazanaJ@users.noreply.github.com> Co-authored-by: Ryan Myers <ryan.p.myers@gmail.com> Co-authored-by: Dominik Peters <github@d-peters.com>
Diddy Kong Racing
This repo contains a work-in-progress decompilation of Diddy Kong Racing for the N64. You will need to have a original copy of the ROM to extract the game's assets.
All versions are supported, and the US 1.0 version (SHA1 = 0cb115d8716dbbc2922fda38e533b9fe63bb9670) of the game is the default if not specified.
As of June 11, 2025, this is our current score:
Decomp progress: 90.87%
Documentation progress: 59.40%
Dependencies
gcc, Version 8.0 or highermake, Version 4.2 or higherpython3libpcre2-devandlibpcre2-8-0(Not technically required, but will speedup extracting/building some assets.)gcc-mips-linux-gnuis optionally used if compiling NON_MATCHING with COMPILER=gcc
sudo apt install build-essential pkg-config git python3 python3-pip binutils-mips-linux-gnu python3-venv libpcre2-dev libpcre2-8-0
Setup / Building
- Install the dependencies
- Place the ROM file within the
baseromsdirectory.
a. The name of the ROM file does not matter. It will be detected automatically from an sha1 checksum. - Grab tools:
git submodule update --init --recursive - Run
make setupto install the IDO compiler, python venv, and packages required. - Run
make extractto run splat to extract all required files from the baserom. - Run
makein the main directory.
a. Use the-jNargument to useNnumber of threads to speed up building. For example, if you have a system with 4 cores / 4 threads, you should domake -j4.
Building on macOS
- Use homebrew to install dependencies:
brew install make - Place the ROM file within the
baseromsdirectory. See Setup above for more info. - Run
gmakefrom the main directory. Note that macOS built-inmakewill not work since it does not meet the version requirements.
Building other versions
To build other versions of the ROM, just specifcy the region and version in the make command. All examples are below:
| Baserom | REGION | VERSION | Command |
|---|---|---|---|
| US 1.0 | US | v77 | make REGION=US VERSION=v77 |
| PAL 1.0 | PAL | v77 | make REGION=PAL VERSION=v77 |
| JPN 1.0 | JPN | v79 | make REGION=JPN VERSION=v79 |
| US 1.1 | US | v80 | make REGION=US VERSION=v80 |
| PAL 1.1 | PAL | v80 | make REGION=PAL VERSION=v80 |
Modding
If you are modifying the code in the repo, then you should add NON_MATCHING=1 to the make command.
Example: make NON_MATCHING=1 -j4
The NON_MATCHING define will include the functions that don't exactly match one-to-one, but should be no different functionality-wise. If you do notice any bugs that occur in a NON_MATCHING build that are not in the vanilla game, then please file an issue describing the bug. It would be helpful if you can track down which function is causing the bug, but that is not required.
Style Guide
The style guide for the project can be found here: https://docs.google.com/document/d/1euQf8nwynGcCZL1MfoMaLs-XRvx3ejjj8fIfykUZ-NQ
If you see variables/functions/structs/etc. that doesn't follow these rules, then file an issue and we'll try to fix them.
Scripts
There are some useful scripts that should be kept in mind when working on this repo.
./extract.sh <version>
This script will extract all the assets from a DKR ROM and place them into /assets/ folder according to the config file within the /extract-ver/ folder. The version parameter should either be us_1.0, us_1.1, eu_1.0, eu_1.1, or jp.
Example: ./extract.sh us_1.0
./diff.sh <function_name>
Compares the assembly output of a function from a built ROM to the base ROM. Useful for decompiling.
Example: ./diff.sh menu_init
./rename.sh <old_name> <new_name>
This script will rename an existing symbol, file name, and/or folder name within the repo with a new one.
Example: ./rename.sh D_A4001000 SP_IMEM
./score.sh
Prints out the current completion percentage of the decomp. You do need to have an OK build for this to work properly.
The scoring is split into 2 sections:
- Assembly to C Decompilation (Adventure One)
- Cleanup and Documentation (Adventure Two)
Show scores for Adventure One & Adventure Two: ./score.sh
Show score for Adventure One only: ./score.sh -a 1
Show score for Adventure Two only: ./score.sh -a 2
Show top 10 files remaining: ./score.sh -t 10
To make progress in Adventure 2, a function must be properly named (must not start with func_) and also include a doxygen comment above it.
For example:
/**
* Returns 1 if Drumstick is avaliable to use, or 0 if not.
*/
s32 is_drumstick_unlocked(void) {
return gActiveMagicCodes & 2;
}
As of June 11, 2025, this is our current score:
====================================================================
ADVENTURE ONE (ASM -> C Decompilation)
-------------- 90.87% Complete (91.65% NON_MATCHING) ---------------
# Decompiled functions: 1913
# GLOBAL_ASM remaining: 37
# NON_MATCHING functions: 4
# NON_EQUIVALENT WIP functions: 30
--------------------------- Game Status ----------------------------
Balloons: 42/47, Keys: 4/4, Trophies: 4/5
T.T. Amulets: 4/4, Wizpig Amulets: 4/4
--------------------------------------------------------------------
We are racing in Star City. (Lap 3/3)
====================================================================
ADVENTURE TWO (Cleanup & Documentation)
------------------------- 59.40% Complete --------------------------
# Documented functions: 1208
# Undocumented remaining: 445
--------------------------- Game Status ----------------------------
Balloons: 29/47, Keys: 3/4, Trophies: 2/5
T.T. Amulets: 3/4, Wizpig Amulets: 2/4
--------------------------------------------------------------------
We are collecting silver coins in Treasure Caves. (1/8 silver coins)
====================================================================