87c23d5cca
Some checks failed
Format code / format (push) Has been cancelled
Build C code / extract-assets (push) Has been cancelled
Build Saturn version / build-and-test-saturn (push) Has been cancelled
Build Saturn version / function-finder-saturn (push) Has been cancelled
Build Debug Module tool / build (push) Has been cancelled
Build PSX and PSP version / build-and-test (pspeu, hd) (push) Has been cancelled
Build PSX and PSP version / build-and-test (pspeu, pspeu) (push) Has been cancelled
Build PSX and PSP version / build-and-test (us, us) (push) Has been cancelled
Build C code / build-linux (push) Has been cancelled
Build C code / build-macos (push) Has been cancelled
Build C code / build-windows (push) Has been cancelled
Build C code / build-linux-lle (push) Has been cancelled
Build PSX and PSP version / generate-progress-report (pspeu, hd) (push) Has been cancelled
Build PSX and PSP version / generate-progress-report (pspeu, pspeu) (push) Has been cancelled
Build PSX and PSP version / generate-progress-report (us, us) (push) Has been cancelled
Build PSX and PSP version / generate-duplicates-report (us, us) (push) Has been cancelled
Build PSX and PSP version / generate-duplicates-report-psp (pspeu, pspeu) (push) Has been cancelled
Lots of cleanup here to make the code easier to read. 1. Adding CLUT index defines to avoid magic numbers 2. Adding InitializeMode enum and hooking that up 3. Updating function names for servant init 4. Cleaning up magic numbers used in tt_000 init function I wanted to add a enum for the EntityId, but both servants share 0xD1. Looking at the other EntityIDs definitions, there seems to be some crossover, but it also looks like they may be partly unique across the different binaries. Probably need more study to figure out how to unify them (or if it's even possible to unify). We also may want to look at splitting enum definitions and defining flags/fixed values into some sort of enum file structure. Having them all in game.h is making a large file. But we would obviously not want to fracture the codebase more. Either way, that's way beyond the scope of what I wanted to do here. |
||
---|---|---|
.github/workflows | ||
.vscode | ||
bin | ||
cmake | ||
config | ||
disks | ||
docs | ||
include | ||
src | ||
tools | ||
.clang-format | ||
.gitignore | ||
.gitmodules | ||
CMakeLists.txt | ||
CNAME | ||
CONTRIBUTING.md | ||
diff_settings.py | ||
Dockerfile | ||
go.work | ||
go.work.sum | ||
LICENSE | ||
Makefile | ||
Makefile.psp.mk | ||
Makefile.psx.mk | ||
Makefile.saturn.mk | ||
README.md | ||
weapon0.ld | ||
weapon1.ld |
Castlevania: Symphony of the Night Decompilation
A work-in-progress decompilation of Castlevania Symphony of the Night for Sony PlayStation 1, Sony PlayStation Portable and Sega Saturn. It aims to recreate the source code from the existing binaries using static and/or dynamic analysis. The code compiles byte-for-byte to the same binaries of the game, effectively being a matching decompilation.
It currently supports the following versions of the game:
us
the reference build with the serial number SLUS-00067hd
an unreleased PS1 Japanese build found in Castlevania: Dracula X Chronicles game datapspeu
European build from Castlevania: Dracula X Chroniclessaturn
the port created by an external development team
This repo does not include any assets or assembly code necessary for compiling the binaries. A prior copy of the game is required to extract the required assets.
Bins decomp progress
Code coverage means how many bytes of code have been successfully converted from assembly into C code, while decomp function is how many functions have been successfully decompiled.
Useful links
Decompiling a game is a mastodontic task. If you have some basic programming skills, please join us in this journey. Any contribution will be very appreciated!
Special thanks
This project is possible thanks to the hard work of tools provided by the Decompilation community:
- mips2c from @matt-kempster to decompile MIPS assembly into C. This has proven to be more accurate than Hexrays IDA and Ghidra.
- splat from @ethteck to disassemble code and extract data with a symbol map. This tool provides the fundamentals of the SOTN decomp.
- asm-differ from @simonlindholm to know how the decompiled code compares to the original binary.
- decomp-permuter from @simonlindholm to pick different versions of the same code that better matches the original binary.
- maspsx by @mkst to replicate the customized assembler used in the official PSX SDK.
- decomp.me by @ethteck, @nanaian and @mkst to provide a collaborative decompilation site to share and contribute to work-in-progress decompiled functions.
- frogress by @ethteck to store and retrieve progression data.
- esa-new by @mkst as an inspiration on how to set-up a PS1 decompilation project.
- oot as an inspiration of what it is possible to achieve with a complete decompiled video game.