A fork of CSE2 providing support and optimization for running on a Sun Ultra 1.
Find a file
Gabriel Ravier e2c7ea8996
Left long lines long instead of making them take several lines
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2019-09-23 20:22:49 +02:00
assets Fix the resource file in MinGW-w64 2019-09-09 23:43:48 +01:00
devilution Move the MSVC2003 stuff to the main folder 2019-09-05 13:42:33 +01:00
src Left long lines long instead of making them take several lines 2019-09-23 20:22:49 +02:00
vs2003 Move Visual Studio 2003 files to their own folder 2019-09-10 00:41:32 +01:00
vs2017 Enable optimisations in the VS2017 project 2019-09-15 15:41:56 +01:00
.gitattributes Added .gitattributes for normalisation and normalized a few sources files to LF (from CRLF) 2019-05-03 12:27:11 +02:00
.gitignore Fix uncommented comment in .gitignore 2019-09-10 12:33:07 +00:00
Makefile Add .exe file extensions to the Makefile 2019-09-04 14:01:51 +00:00
README.md Add a list of branches to the readme 2019-09-10 13:27:32 +00:00
screenshot.png New screenshot 2019-09-01 19:00:42 +01:00

Table of Contents

This repo has multiple branches:

Branch Description
accurate The main decompilation branch. The code intended to be as close to the original as possible, down to all the bugs and platform-dependencies.
portable This branch ports the engine to SDL2, and addresses numerous portability issues, allowing it to run on other platforms.
enhanced Based on the portable branch, this adds several enhancements to the engine, and makes it more accessible to modders.
emscripten Modifies the engine to build with Emscripten, allowing it to run in web browsers.
wii Ports the engine to the Nintendo Wii.

Cave Story Engine 2

Cave Story Engine 2 is a decompilation of Cave Story.

Screenshot

Background

In 2007, a Linux port of Cave Story was made by Peter Mackay and Simon Parzer. Details about it can be found in Peter's old blog. This port received an update in 2011, including two shiny new executables. What Peter and Simon didn't realise was that they left huge amounts of debugging information in these executables, including the names of every C++ source file, and the variables and functions they contained.

This was a goldmine of information about not just the game's inner-workings, but its source code. With this, a decompilation seemed like a real option. But this wasn't all the help we'd get...

When Pixel made Cave Story, he compiled the original Windows EXE with no optimisations. This left the generated assembly code extremely verbose and easy to read. It also made the code very decompiler-friendly. Additionally, the EXE's Rich Header told us exactly what compiler was used: Visual C++ .NET 2003.

A combination of easy-to-decompile code and a near-complete symbol list made much of the decompilation process a copy/paste job, but not all code would need to be decompiled...

Some of Cave Story's source code would actually see the light of day: in early 2018, the Organya music engine was released on GitHub by an old friend of Pixel's. On top of providing an insight into Pixel's coding style, this helped with figuring out one of the most complex parts of Cave Story's codebase.

It's because of these findings that a decompilation was possible: the Mario 64 decompilation project had a game that was built with no optimisations, the Devilution project was lucky enough to find a symbol list, so it's a miracle that we had both.

Many months of copypasting and experimenting later, this is the result.

Building

Visual Studio .NET 2003

Of course, project files for Visual Studio .NET 2003 are available, and can be found in the 'vs2003' folder.

Visual Studio .NET 2003 was used by Pixel to create the original Doukutsu.exe, so these project files allow us to check the accuracy of the decompilation by comparing the generated assembly code to that of the original executable. The tool for this can be found in the 'devilution' folder.

Visual Studio 2017 (and later)

Project files for Visual Studio 2017 can be found in the 'vs2017' folder.

Makefile (MinGW-w64)

Run 'make' in this folder, preferably with some of the following settings:

Name Function
RELEASE=1 Compile a release build (optimised, stripped, etc.)
STATIC=1 Produce a statically-linked executable (so you don't need to bundle DLL files)
JAPANESE=1 Enable the Japanese-language build (instead of the unofficial Aeon Genesis English translation)
FIX_BUGS=1 Fix various bugs in the game
DEBUG_SAVE=1 Re-enable the dummied-out 'Debug Save' option, and the ability to drag-and-drop save files onto the window

Licensing

Being a decompilation, the majority of the code in this project belongs to Daisuke "Pixel" Amaya - not us. We've yet to agree on a license for our own code.