
I was reviewing some of the animations pulled out by sotn-assets. Speicfically, I found that in `src/st/no3/sprite_banks.h` (a file created by sotn-assets locally, which does not exist directly in this repo), we have: ``` extern s16* sprites_no3_0; extern s16* sprites_no3_1; extern s16* sprites_no3_2; extern s16* sprites_no3_3; extern s16* sprites_no3_4; extern s16* sprites_no3_5; extern s16* sprites_no3_6; extern s16* sprites_no3_7; extern s16* sprites_no3_8; static s16* spriteBanks[] = { 0, &sprites_no3_0, &sprites_no3_3, &sprites_no3_1, &sprites_no3_2, &sprites_no3_4, &sprites_no3_5, &sprites_no3_6, &sprites_no3_7, &sprites_no3_8, ``` However, those are not the right pointer types. `sprites_no3_#` should have a type of `s16* []`, so I reworked the sotn-assets tool to use the right pointers for each of these things. Now the sprite_banks.h file looks like: ``` extern s16* sprites_no3_0[]; extern s16* sprites_no3_1[]; extern s16* sprites_no3_2[]; extern s16* sprites_no3_3[]; extern s16* sprites_no3_4[]; extern s16* sprites_no3_5[]; extern s16* sprites_no3_6[]; extern s16* sprites_no3_7[]; extern s16* sprites_no3_8[]; static s16** spriteBanks[] = { 0, sprites_no3_0, sprites_no3_3, sprites_no3_1, sprites_no3_2, sprites_no3_4, sprites_no3_5, sprites_no3_6, sprites_no3_7, sprites_no3_8, ``` Which more accurately represents the data within. Naturally, since this PR mostly just changes the tool, the real changes are in the tool's output, so feel free to clone this branch and investigate the sprite_banks.h file if you want to see anything further about it. DRA's equivalent of the SpriteBanks array is `D_800A3B70`, and is currently in the repo as extracted data, without using `sotn-assets`; this PR makes it so the types in the overlays (which do use `sotn-assets`) will match the types in DRA.
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.