k4zmu2a/SpaceCadetPinball

GitHub: k4zmu2a/SpaceCadetPinball

将 Windows 经典三维弹球游戏完整反编译为可编译的 C++ 源码,并基于 SDL2 实现跨平台原生运行。

Stars: 4513 | Forks: 295

# SpaceCadetPinball ## 概述 对 `3D Pinball for Windows - Space Cadet`(一款 Windows 内置游戏)的逆向工程。 ## 如何游戏 将编译好的可执行文件放入包含原始游戏资源的文件夹中(不包含资源文件)。\ 支持来自 Windows 版和 Full Tilt 版游戏的数据文件。 ## 已知源移植 | 平台 | 作者 | URL | | ------------------ | --------------- | ---------------------------------------------------------------------------------------------------------- | | PS Vita | Axiom | | | Emscripten | alula |
在线游玩: | | Nintendo Switch | averne | | | webOS TV | mariotaku | | | Android (WIP) | Iscle | https://github.com/Iscle/SpaceCadetPinball | | Nintendo Wii | MaikelChan | https://github.com/MaikelChan/SpaceCadetPinball | | Nintendo 3DS | MaikelChan | https://github.com/MaikelChan/SpaceCadetPinball/tree/3ds | | Nintendo DS | Headshotnoby | https://github.com/headshot2017/3dpinball-nds | | Nintendo Wii U | IntriguingTiles | https://github.com/IntriguingTiles/SpaceCadetPinball-WiiU | | PlayStation 2 | Headshotnoby | https://github.com/headshot2017/3dpinball-ps2 | | Sega Dreamcast | Headshotnoby | https://github.com/headshot2017/3dpinball-dc | | MorphOS | BeWorld | https://www.morphos-storage.net/?id=1688897 | | AmigaOS 4 | rjd324 | http://aminet.net/package/game/actio/spacecadetpinball-aos4 | | Android (WIP) | fexed | https://github.com/fexed/Pinball-on-Android | 本项目覆盖的平台:桌面 Windows、Linux 和 macOS。





## 源文件 * `Windows XP` 的 `pinball.exe` (SHA-1 `2A5B525E0F631BB6107639E2A69DF15986FB0D05`) 及其公开的 PDB * `Full Tilt! Pinball` 32位版本的 `CADET.EXE` (SHA-1 `3F7B5699074B83FD713657CD94671F2156DBEDC4`) ## 使用的工具 `Ghidra`、`Ida`、`Visual Studio` ## 已完成的工作 * 填充了所有结构体,对全局和局部变量进行了命名。 * 反编译了所有子程序,将 C 伪代码转换为可编译的 C++。将松散的(命名空间?)子程序分配到了类中。 ## 编译 项目使用 `C++11`,并依赖于 `SDL2` 库。 ### 在 Windows 上 下载并解压 `SDL2` 和 `SDL2_mixer` 的 devel 包。\ 在 `CMakeLists.txt` 中设置它们的路径,请参阅 `/Libs` 中建议的放置位置。\ 使用 Visual Studio 进行编译;已使用 2019 版本进行过测试。 ### 在 Linux 上 安装 `SDL2` 和 `SDL2_mixer` 的 devel 包。\ 使用 CMake 进行编译;已使用 GCC 10 和 Clang 11 进行过测试。\ 要交叉编译 Windows 版本,请安装 64 位版本的 mingw 及其 `SDL2` 和 `SDL2_mixer` 发行版,然后使用 `mingwcc.cmake` 工具链。 [![打包状态](https://repology.org/badge/tiny-repos/spacecadetpinball.svg)](https://repology.org/project/spacecadetpinball/versions) 某些 Linux 发行版在其仓库中提供了该软件包。您可以使用这些包来更轻松地进行依赖管理和更新。 本项目可作为 Flatpak 在 [Flathub](https://flathub.org/apps/details/com.github.k4zmu2a.spacecadetpinball) 上获取。 ### 在 macOS 上 安装 XCode(或至少通过 `xcode-select --install` 安装 Xcode Command Line Tools)和 CMake。 **HomeBrew** 你可以使用 `brew` 轻松安装构建产物。 ``` brew tap draftbrew/tap brew install --no-quarantine space-cadet-pinball ``` 请注意,`--no-quarantime` 标志将在安装过程中禁用 macOS 的 Gatekeeper。 **手动编译:** * **Homebrew**:安装 `SDL2` 和 `SDL2_mixer` homebrew 包。 * **MacPorts**:安装 `libSDL2` 和 `libSDL2_mixer` macports 包。 使用 CMake 进行编译。请确保为 Apple Intel 架构设置 `x86_64` 或为 Apple Silicon 架构设置 `arm64` 的 `CMAKE_OSX_ARCHITECTURES` 变量。 测试环境:带有 Xcode 13 的 macOS Big Sur (Intel) 与 带有 Xcode 13 的 macOS Montery Beta (Apple Silicon)。 **自动编译:** 从仓库的根目录运行 `build-mac-app.sh` 脚本。应用程序将打包在名为 `SpaceCadetPinball--mac.dmg` 的 DMG 文件中。 测试环境:带有 Xcode Command Line Tools 14 的 macOS Ventura (Apple Silicon) 与 在 GitHub Runner (Intel) 上带有 Xcode 13 的 macOS Big Sur。 ## 计划 * ~~反编译原始游戏~~ * ~~可调整大小的窗口,缩放图形~~ * ~~来自 CADET.DAT 的高分辨率精灵加载器~~ * ~~使用 SDL2、SDL2_mixer、ImGui 的跨平台移植~~ * Full Tilt Cadet 功能 * 本地化支持 * 可能:支持其他两张桌子 - Dragon 和 Pirate * 可能:游戏数据编辑器 ## 关于导致游戏被移除的 64 位 Bug 我并没有找到这个 bug,反编译后的游戏在首次尝试时就能在 x64 模式下运行。\ 它要么在反编译过程中丢失了,要么是在 x64 移植中引入的/在 x86 构建中并不存在。\ 根据对该 bug 的公开描述(没有球体碰撞),我猜测该 bug 位于 `TEdgeManager::TestGridBox` 中
标签:Android, Bash脚本, C++, DSL, Emscripten, Nintendo Switch, PS Vita, URL提取, 三维弹球, 云资产清单, 反编译, 复刻, 太空军校生, 太空学员, 开源, 怀旧游戏, 数据擦除, 游戏, 源码移植, 经典游戏, 逆向工程