Decompilation of Castlevania: Symphony of the Night (PSX+Saturn)
Go to file
bismurphy bdddb80978
Decompile DRA func_800FDE20 (#461)
This is a cool one! This runs every frame, and checks if you have enough
EXP to level up. If you do, then it increases your level and gives you
the stat bonuses for it. Therefore, I think `CheckAndDoLevelUp` might be
a good name? I've held off on renaming; if reviewers are okay with the
name then I'll update the PR with this.

I don't know what the 3 values being checked at the beginning are. I
might dig into those next.

D_800A2EC0 is a table which tells how much to increase max HP for each
level. Its values are 1, 3, 6, 10, 20, 30, 40, 50, 100, 200. So the
first 10 levelups you get, you'll gain one max HP, then the next 10 give
you 3 each, etc. I think this should be called LevelUpHPIncreaseTable,
but again, holding off on renaming. I'm not sure if there's a way to
include this as an array in the code rather than as an extern.

I've also included updating the repo to the latest maspsx as part of
this PR, let me know if that should be removed.
2023-08-10 10:05:56 -07:00
.github analyze_calls CI 2023-08-04 12:51:56 -07:00
.vscode Remove shared VSCode settings 2023-03-16 12:31:37 +00:00
asm/us/main/psxsdk Change assembly location from asm/ to asm/us/ 2023-02-21 19:12:52 +00:00
bin Update compiler to use little endian 2023-04-05 19:19:14 +01:00
config Decompile DRA func_800FDE20 (#461) 2023-08-10 10:05:56 -07:00
disks Change how game assets are managed 2023-02-21 23:25:31 +00:00
docs SEL + DRE + WRP functions + docs (#138) 2023-03-07 19:04:21 +00:00
include NP3 func_801B3704 (#452) 2023-08-08 20:39:01 -07:00
src Decompile DRA func_800FDE20 (#461) 2023-08-10 10:05:56 -07:00
tools Decompile DRA func_800FDE20 (#461) 2023-08-10 10:05:56 -07:00
.clang-format Disallow formatter to make some undesiderable changes 2023-07-05 22:50:18 +01:00
.gitignore Revert "Revert "Splat libsnd out of main (#423)"" (#428) 2023-08-01 20:46:21 -07:00
.gitmodules Switch ASPATCH to MASPSX (#254) 2023-06-16 19:51:16 +01:00
CNAME Create CNAME 2022-10-18 23:52:54 +01:00
diff_settings.py Make tools working with the env 'VERSION' 2023-07-02 23:13:37 +01:00
Dockerfile Add docker build container (#200) 2023-06-12 18:43:19 +01:00
go.work Purge ASPATCH 2023-06-17 12:30:42 +01:00
Makefile Rewrite lints, lint more FIX (#439) 2023-08-05 11:36:00 -07:00
README.md README typo 2023-07-02 19:19:35 +01:00

Castlevania: Symphony of the Night Decompilation

A work-in-progress decompilation of Castlevania Symphony of the Night for Sony PlayStation 1 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-00067
  • hd an unreleased PS1 Japanese build found in Castlevania: Dracula X Chronicles game data
  • saturn 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

File name Code coverage Decomp functions Description
SLUS_000.67 N/A N/A Shared libraries
DRA.BIN code coverage DRA.BIN decompiled functions Game engine
BIN/RIC.BIN code coverage RIC.BIN decompiled functions Playable Richter
ST/CEN/CEN.BIN code coverage CEN.BIN decompiled functions Center
ST/DRE/DRE.BIN code coverage DRE.BIN decompiled functions Nightmare
ST/MAD/MAD.BIN code coverage MAD.BIN decompiled functions Debug Room
ST/NO3/NO3.BIN code coverage NO3.BIN decompiled functions Entrance (first visit)
ST/NP3/NP3.BIN code coverage NP3.BIN decompiled functions Entrance
ST/NZ0/NZ0.BIN code coverage NZ0.BIN decompiled functions Alchemy Laboratory
ST/SEL/SEL.BIN code coverage SEL.BIN decompiled functions Title screen
ST/ST0/ST0.BIN code coverage ST0.BIN decompiled functions Final Stage: Bloodlines
ST/WRP/WRP.BIN code coverage WRP.BIN decompiled functions Warp Room
ST/RWRP/RWRP.BIN code coverage RWRP.BIN decompiled functions Warp Room (reverse)
SERVANT/TT_000.BIN code coverage TT_000.BIN decompiled functions Bat Familiar

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 succesfully decompiled.

Decompiling a game is a mastodontic task. If you have computer science knowledge, 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 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 fundamental 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.