We will be glad to answer any questions
for people who wish to contribute.
All pull requests and issues are welcome.
Be sure that all of your submitted code
follows the guidelines that are listed below.
When running ninja, it is REQUIRED that the output is 1:1 for a file to be marked MATCHING (otherwise the linking sequence will fail).
After the code matches, be sure to run objdiff
to check the functions to ensure that they are matching.
If it matches, it will automatically be marked as decompiled.
When each function you've matched has been marked as decompiled,
run ninja to see the current percentages.
If you have any questions or concerns,
please join our Discord server.
-
A Disassembler / IDA Pro / Ghidra
You can also use a decompiler, it can make some things easier
-
CodeWarrior
We specifically use version
3.0a3 -
Python
Version
3.7+ -
Any Code IDE (Visual Studio Code recommended) *If you are using Visual Studio Code,
dtkautomatically creates acompile_commands.jsonfile that will help withclangd.
-
C / C++
However C++ is recommended
-
PowerPC Assembly
-
PowerPC ➝ C / C++ reverse engineering instructions
Decompilers such as Hex-Rays (included in IDA Pro) are
useful as they can make the decompilation easier to write.
-
clang-formatwill do a lot of the work for you. Just be sure that it is enabled to run on save. -
Use
nullptrinstead of0when assigning / comparing a pointer in C++ code, useNULLin C.Only use
0when assigning or comparing a value.
-
Use
forward-declaredtypes when possible -
At the top of every header place:
#pragma once
-
Follow the proper syntax for documenting a class's functions and variables:
/* member-offset */ s32 varName; ///< Description of varName.
/// @brief Function does a thing. /// @param argumentName Is an argument to a function that does a thing. /// @return If the function did a thing. /// @note Might have not done a thing... bool func(s32 argumentName);
If there is a function that does not have this implemented (ie in headers before the new documentation revamp), please take the time to help reimplement them to document this repository better!
-
At the top of every header place:
#pragma once
-
For system library includes use:
#include <...>
-
For game header includes use:
#include "..."
These includes must be relative to the
includefolder.
-
Names for known symbols should match exactly,
even including typos in the symbol. -
Member variables must be prefixed with
m. -
Arguments for functions must be prefixed with:
-
pfor pointers -
rfor passed-by-reference
-
-
Static variables with:
-
No known symbol must be prefixed with
s -
Global scope must be prefixed with
g
-
-
Functions with no symbols must use camelCase.
Such as inlined functions.
-
When referencing a class member, do not use
this->, unless it is required for compilation. -
Functions for classes must be put in the following order:
-
Constructor
-
Destructor
-
Operators
-
Virtual Functions
-
Member Functions
If the virtual functions are not in the order that
they are in the vtable, then the rule above can be
ignored as these functions must be placed in order. -
If your code does NOT match, explain in a comment why it does not match.
Be sure to also include a decomp.me scratch in a comment as well.
If the function arguments in the symbol use int,
do NOT use s32, you have to use int, as they
do not mangle to the same symbol.