A fork of CSE2 providing support and optimization for running on a Sun Ultra 1.
Find a file
2019-09-06 19:30:23 +00:00
assets Merge branch 'accurate' into portable 2019-09-05 14:18:42 +01:00
bin2h Revert "Remove the 'bin2h' folder" 2019-09-05 12:50:01 +00:00
DoConfig Revert "Removed the DoConfig folder" 2019-09-05 12:49:35 +00:00
external Revert "Remove the 'external' folder" 2019-09-05 12:50:21 +00:00
src Merge branch 'accurate' into portable 2019-09-06 19:30:23 +00: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 Clean-out .gitignore of MSVC2003 stuff 2019-09-05 13:56:24 +01:00
CMakeLists.txt Repair CMakeLists.txt 2019-09-06 19:27:32 +00:00
Makefile Add a replication of MSVC2003's rand() algorithm 2019-09-04 19:23:35 +00:00
README.md Merge branch 'accurate' into portable 2019-09-06 00:36:24 +00:00
screenshot.png New screenshot 2019-09-05 20:57:48 +00:00

Cave Story Engine 2 (portable)

Cave Story Engine 2 is a decompilation of Cave Story.

This branch migrates the engine from WinAPI to SDL2, and addresses numerous portability issues, allowing it to run on other platforms.

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.

Dependencies

  • SDL2
  • Freetype
  • FLTK
  • GLEW (if the OpenGL rendering backend is selected)

Building

Makefile

Note: this requires pkg-config

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 (good for Windows builds, 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
WINDOWS=1 Build for Windows
DEBUG_SAVE=1 Re-enable the ability to drag-and-drop save files onto the window
RENDERER=OpenGL3 Use the hardware-accelerated OpenGL 3.2 renderer
RENDERER=Texture Use the hardware-accelerated SDL2 Texture API renderer (default)
RENDERER=Surface Use the software-rendered SDL2 Surface API renderer
RENDERER=Software Use a hand-written software renderer

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.