• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

CMakeModules/H30-Oct-2021-274245

Doc/H03-May-2022-

SpaceCadetPinball/H03-May-2022-68,94553,378

.gitattributesH A D30-Oct-20212.5 KiB6459

.gitignoreH A D30-Oct-20214.4 KiB279228

CMakeSettings.jsonH A D30-Oct-20211.9 KiB5959

CONTRIBUTING.mdH A D30-Oct-2021402 129

LICENSEH A D30-Oct-20211.1 KiB2217

README.mdH A D30-Oct-20214 KiB9261

mingwcc.cmakeH A D30-Oct-2021932 2720

README.md

1<!-- markdownlint-disable-file MD033 -->
2
3# SpaceCadetPinball
4
5## Summary
6
7Reverse engineering of `3D Pinball for Windows – Space Cadet`, a game bundled with Windows.
8
9## How to play
10
11Place compiled executable into a folder containing original game resources (not included).\
12Supports data files from Windows and Full Tilt versions of the game.
13
14## Known source ports
15
16| Platform           | Author          | URL                                                                                                        |
17| ------------------ | --------------- | ---------------------------------------------------------------------------------------------------------- |
18| PS Vita            | Axiom           | <https://github.com/suicvne/SpaceCadetPinball_Vita>                                                        |
19| Emscripten         | alula           | <https://github.com/alula/SpaceCadetPinball> <br> Play online: <https://alula.github.io/SpaceCadetPinball> |
20| Nintendo Switch    | averne          | <https://github.com/averne/SpaceCadetPinball-NX>                                                           |
21| webOS TV           | mariotaku       | <https://github.com/webosbrew/SpaceCadetPinball>                                                           |
22| Android (WIP)      | Iscle           | https://github.com/Iscle/SpaceCadetPinball                                                                 |
23| Nintendo Wii       | MaikelChan      | https://github.com/MaikelChan/SpaceCadetPinball                                                            |
24| Nintendo 3DS       | MaikelChan      | https://github.com/MaikelChan/SpaceCadetPinball/tree/3ds                                                   |
25| Nintendo Wii U     | IntriguingTiles | https://github.com/IntriguingTiles/SpaceCadetPinball-WiiU                                                  |
26
27Platforms covered by this project: desktop Windows, Linux and macOS.
28
29<br>
30<br>
31<br>
32<br>
33<br>
34<br>
35
36## Source
37
38* `pinball.exe` from `Windows XP` (SHA-1 `2A5B525E0F631BB6107639E2A69DF15986FB0D05`) and its public PDB
39* `CADET.EXE` 32bit version from `Full Tilt! Pinball` (SHA-1 `3F7B5699074B83FD713657CD94671F2156DBEDC4`)
40
41## Tools used
42
43`Ghidra`, `Ida`, `Visual Studio`
44
45## What was done
46
47* All structures were populated, globals and locals named.
48* All subs were decompiled, C pseudo code was converted to compilable C++. Loose (namespace?) subs were assigned to classes.
49
50## Compiling
51
52Project uses `C++11` and depends on `SDL2` libs.
53
54### On Windows
55
56Download and unpack devel packages for `SDL2` and `SDL2_mixer`.\
57Set paths to them in `CMakeLists.txt`, see suggested placement in `/Libs`.\
58Compile with Visual Studio; tested with 2019.
59
60### On Linux
61
62Install devel packages for `SDL2` and `SDL2_mixer`.\
63Compile with CMake; tested with GCC 10, Clang 11.\
64To cross-compile for Windows, install a 64-bit version of mingw and its `SDL2` and `SDL2_mixer` distributions, then use the `mingwcc.cmake` toolchain.
65
66### On macOS
67
68* **Homebrew**: Install the `SDL2`, `SDL2_mixer` homebrew packages.
69* **MacPorts**: Install the `libSDL2`, `libSDL2_mixer` macports packages.
70
71Compile with CMake. Ensure that `CMAKE_OSX_ARCHITECTURES` variable is set for either `x86_64` Apple Intel or `arm64` for Apple Silicon.
72
73Tested with: macOS Big Sur (Intel) with Xcode 13 & macOS Montery Beta (Apple Silicon) with Xcode 13.
74
75## Plans
76
77* ~~Decompile original game~~
78* ~~Resizable window, scaled graphics~~
79* ~~Loader for high-res sprites from CADET.DAT~~
80* Misc features of Full Tilt: 3 music tracks, multiball, centered textboxes, etc.
81* Cross-platform port
82  * Using SDL2, SDL2_mixer, ImGui
83  * Maybe: Android port
84* Maybe x2: support for other two tables
85  * Table specific BL (control interactions and missions) is hardcoded, othere parts might be also patched
86
87## On 64-bit bug that killed the game
88
89I did not find it, decompiled game worked in x64 mode on the first try.\
90It was either lost in decompilation or introduced in x64 port/not present in x86 build.\
91Based on public description of the bug (no ball collision), I guess that the bug was in `TEdgeManager::TestGridBox`
92