Git Product home page Git Product logo

spacecadetpinball's Introduction

SpaceCadetPinball

Summary

Reverse engineering of 3D Pinball for Windows - Space Cadet, a game bundled with Windows.

How to play

Place compiled executable into a folder containing original game resources (not included).
Supports data files from Windows and Full Tilt versions of the game.

Known source ports

Platform Author URL
PS Vita Axiom https://github.com/suicvne/SpaceCadetPinball_Vita
Emscripten alula https://github.com/alula/SpaceCadetPinball
Play online: https://alula.github.io/SpaceCadetPinball
Nintendo Switch averne https://github.com/averne/SpaceCadetPinball-NX
webOS TV mariotaku https://github.com/webosbrew/SpaceCadetPinball
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 Wii U IntriguingTiles https://github.com/IntriguingTiles/SpaceCadetPinball-WiiU
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

Platforms covered by this project: desktop Windows, Linux and macOS.







Source

  • pinball.exe from Windows XP (SHA-1 2A5B525E0F631BB6107639E2A69DF15986FB0D05) and its public PDB
  • CADET.EXE 32bit version from Full Tilt! Pinball (SHA-1 3F7B5699074B83FD713657CD94671F2156DBEDC4)

Tools used

Ghidra, Ida, Visual Studio

What was done

  • All structures were populated, globals and locals named.
  • All subs were decompiled, C pseudo code was converted to compilable C++. Loose (namespace?) subs were assigned to classes.

Compiling

Project uses C++11 and depends on SDL2 libs.

On Windows

Download and unpack devel packages for SDL2 and SDL2_mixer.
Set paths to them in CMakeLists.txt, see suggested placement in /Libs.
Compile with Visual Studio; tested with 2019.

On Linux

Install devel packages for SDL2 and SDL2_mixer.
Compile with CMake; tested with GCC 10, Clang 11.
To cross-compile for Windows, install a 64-bit version of mingw and its SDL2 and SDL2_mixer distributions, then use the mingwcc.cmake toolchain.

Packaging status

Some distributions provide a package in their repository. You can use those for easier dependency management and updates.

This project is available as Flatpak on Flathub.

On macOS

Install XCode (or at least Xcode Command Line Tools with xcode-select --install) and CMake.

Manual compilation:

  • Homebrew: Install the SDL2, SDL2_mixer homebrew packages.
  • MacPorts: Install the libSDL2, libSDL2_mixer macports packages.

Compile with CMake. Ensure that CMAKE_OSX_ARCHITECTURES variable is set for either x86_64 Apple Intel or arm64 for Apple Silicon.

Tested with: macOS Big Sur (Intel) with Xcode 13 & macOS Montery Beta (Apple Silicon) with Xcode 13.

Automated compilation:

Run the build-mac-app.sh script from the root of the repository. The app will be available in a DMG file named SpaceCadetPinball-<version>-mac.dmg.

Tested with: macOS Ventura (Apple Silicon) with Xcode Command Line Tools 14 & macOS Big Sur on GitHub Runner (Intel) with XCode 13.

Plans

  • Decompile original game
  • Resizable window, scaled graphics
  • Loader for high-res sprites from CADET.DAT
  • Cross-platform port using SDL2, SDL2_mixer, ImGui
  • Full Tilt Cadet features
  • Localization support
  • Maybe: Support for the other two tables - Dragon and Pirate
  • Maybe: Game data editor

On 64-bit bug that killed the game

I did not find it, decompiled game worked in x64 mode on the first try.
It was either lost in decompilation or introduced in x64 port/not present in x86 build.
Based on public description of the bug (no ball collision), I guess that the bug was in TEdgeManager::TestGridBox

spacecadetpinball's People

Contributors

adambonneruk avatar alexjsteffen avatar amnatty avatar amurzeau avatar brlin-tw avatar desgging avatar eggplants avatar extrowerk avatar fexed avatar georgemcmullen avatar guijan avatar hargabt avatar intriguingtiles avatar iscle avatar k4zmu2a avatar kowalski7cc avatar low-power avatar lucylikesyourface avatar maikelchan avatar mariotaku avatar martinligabue avatar nicolasmaniotto avatar nixola avatar orazioedoardo avatar polluks avatar prototux avatar sasodoma avatar tomashubelbauer avatar toxieainc avatar waptaff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spacecadetpinball's Issues

Code just does not compile.

As the title suggests, the code does not compile in VS2019 Windows 10. I have exactly 2454 errors when I attempt to compile. I hope I can get some help soon as my mind is starting to explode. Thank you.
Edit#1: Most of the errors are in the imgui files.

scaling options?

Hi buddy! nice work here!!!
can I ask you if there is any way to implement scaling to 1080p (having proper aspect ratio?
you know, changing resolutions it's a bit annoying.

also, I noted you added other resolutions for the table but they are greyed, why is that?

BR, Salvador. Nice to see @GeorgeMcMullen involved here!! hahah

Trouble compliling.

Result of compilation

grzegorz@linux-ebz6:~/Publiczny/git/SpaceCadetPinball/build> make -j 8 [ 2%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/cmake_pch.hxx.gch [ 2%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/imgui_sdl.cpp.o [ 4%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/imgui_demo.cpp.o [ 5%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/imgui_tables.cpp.o [ 8%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/imgui_draw.cpp.o [ 8%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/imgui_impl_sdl.cpp.o [ 10%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/imgui.cpp.o [ 11%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/imgui_widgets.cpp.o [ 20%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/GroupData.cpp.o [ 20%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/control.cpp.o [ 20%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/loader.cpp.o [ 20%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/memory.cpp.o [ 20%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/fullscrn.cpp.o [ 22%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/gdrv.cpp.o [ 22%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/maths.cpp.o [ 22%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/high_score.cpp.o [ 24%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/midi.cpp.o [ 25%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/nudge.cpp.o [ 27%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/options.cpp.o [ 28%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/partman.cpp.o [ 30%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/pb.cpp.o [ 31%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/pinball.cpp.o [ 32%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/proj.cpp.o [ 34%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/render.cpp.o [ 35%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/score.cpp.o [ 37%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/Sound.cpp.o [ 38%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/SpaceCadetPinball.cpp.o [ 40%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/TBall.cpp.o [ 41%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/TBlocker.cpp.o [ 42%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/TBumper.cpp.o [ 44%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/TCircle.cpp.o [ 47%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/TComponentGroup.cpp.o [ 47%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/TCollisionComponent.cpp.o [ 48%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/TDemo.cpp.o [ 50%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/TDrain.cpp.o [ 51%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/TEdgeBox.cpp.o [ 52%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/TEdgeManager.cpp.o [ 54%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/TEdgeSegment.cpp.o [ 55%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/TFlagSpinner.cpp.o [ 58%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/TFlipperEdge.cpp.o [ 58%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/TFlipper.cpp.o [ 60%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/TGate.cpp.o [ 61%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/THole.cpp.o [ 62%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/timer.cpp.o [ 64%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/TKickback.cpp.o [ 65%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/TKickout.cpp.o [ 67%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/TLight.cpp.o [ 70%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/TLightBargraph.cpp.o [ 70%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/TLightGroup.cpp.o [ 71%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/TLightRollover.cpp.o [ 72%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/TLine.cpp.o [ 74%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/TOneway.cpp.o [ 75%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/TPinballComponent.cpp.o [ 77%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/TPinballTable.cpp.o [ 78%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/TPlunger.cpp.o [ 80%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/TPopupTarget.cpp.o [ 81%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/TRamp.cpp.o [ 82%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/TRollover.cpp.o [ 84%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/TSink.cpp.o [ 85%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/TSoloTarget.cpp.o [ 87%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/TSound.cpp.o [ 88%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/TTableLayer.cpp.o [ 90%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/TTextBox.cpp.o [ 91%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/TTextBoxMessage.cpp.o [ 92%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/TTimer.cpp.o [ 94%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/TTripwire.cpp.o [ 95%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/TWall.cpp.o [ 97%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/winmain.cpp.o [ 98%] Building CXX object CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/zdrv.cpp.o [100%] Linking CXX executable ../bin/SpaceCadetPinball /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: CMakeFiles/SpaceCadetPinball.dir/SpaceCadetPinball/options.cpp.o: in functionoptions::init()':
options.cpp:(.text+0x2c0): undefined reference to options::MinUps' /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: options.cpp:(.text+0x2cd): undefined reference to options::MaxFps'
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: options.cpp:(.text+0x2f8): undefined reference to options::MinUps' /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: options.cpp:(.text+0x305): undefined reference to options::MaxUps'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/SpaceCadetPinball.dir/build.make:1310: ../bin/SpaceCadetPinball] Błąd 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/SpaceCadetPinball.dir/all] Błąd 2
make: *** [Makefile:91: all] Błąd 2

`

No errors during cmake. System is openSUSE Tumbleweed. Development libraries fro SDL2 and SDL2_mixer are installed.
Help appreciated.

The .dat file is missing - Linux/X11

Hello I complied the game from the master branch but when I run the executable it gives me an error message with "The .dat file is missing." I assume I am missing a file somewhere?

Highscore insertion

When creating further highscores, unless you're landing in the "last" spot compared to the existing highscores, there seems to be no dummy entry on the pre-rendered list underneath.

That means that if my high score lands in spot 1, I can only see the previously existing 2nd, 3rd etc. places, with the current first spot seemingly overwritten.

Full Tilt! Shareware Demo DAT?

While looking for where the game puts its configuration settings on disk, I happened to stumble on an Internet Archive page for what looks like a shareware demo for Full Tilt! Pinball, with a unique DAT file.
The game seems to resemble both the Windows XP pack-in table with the red CINEMATRONICS and MAXIS text, as well as the retail game with the more detailed marquee.
image
The EXE appears as DEMO.EXE and it comes with a DEMO.DAT file with these checksums:

SHA256          38FC895A2EE6482DF54303CCDC881EE7B104E39F41277E314E9E4A442821EC4C       D:\Pinball\CADET\demo\fulltilt\fulltilt\demo.exe
SHA256          D38C882B0B32EBFE06EFD21DF3A507B03ED8AF197551DD25A3C2D65FDFF6D898       D:\Pinball\CADET\demo\fulltilt\fulltilt\demo.dat

I tried to run SpaceCadetPinball using this dat renamed to pinball.dat and this message was returned:
image

It can be found on the Internet Archive under the ID Fulltilt.

The bug was never in X64, btw...

Greetings, I'm Dave Plummer, the programmer that ported this game back in 1994 from the original Maxis over to Windows NT/XP/2K/etc, which meant getting it running on the MIPS/RISC/etc. That meant getting it running with DIBSections under NT and whatnot, but as always, all design and even the original code is credit due to the Maxis guys!

The 64-bit bug that haunted this game never manifested in X64, as far as I heard. I heard from the dev in question personally that it was on Alpha, not x64. But remember you can't ship it until it works on ALL platforms. Working on x64 isn't enough when you've also got Alpha, PowerPC, MIPS, HP64, and so on to support!

Cheers,
Dave

Windows XP with x86 binary

Trying to run the x86 on XP, it gives the typical "Not a valid Win32 application" error. I double checked the exe and it's showing as PE32.

Is the x86 supposed to run on XP or is it slightly too new to work?

.dat file missing

Hello,

When trying to start the game I get an error : ".dat file is missing.

Cross compiling with mingw complains about windres

When I try to cross compile on Xubuntu 20.04 it fails with an error about not being able to find windres, I was able to fix it by adding the line:

set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)

to the mingwcc.cmake toolchain file below the assembler line.

Splash screen background not working

SpaceCadetPinball only shows the tiny bitmap image in the center. pinball.exe goes into a quasi full-screen mode until it is finished loading.

(Linux) Where to put Full Tilt exe and dat files?

So I have the files for Full Tilts Cadet table, is there a specific folder I put these in or is it one of those where I have to use that before building it? Linux has local/share/SpaceCadetPinball but putting these files there didn't do much.

Suggestion: Option to enable Full Tilt! gameplay rules instead of 3D Pinball's

There are only a few minor differences between the gameplay of the two versions. The completion of a mission in the Maxis version results in a replay—actually a ball save, rather than a special—being awarded. In addition, hitting a wormhole that has the same color light locks the ball, which if done repeatedly activates the multi-ball round. This is not the case in 3D Pinball: Completing a mission merely awards bonus points and hitting a wormhole in the above circumstances awards a replay. Also, the three yellow lights above the bumpers (both in the launch ramp and in the upper table zone) act differently: In 3D Pinball these are turned off if the ball passes on them while they are on. This is not the case in the original game, where they just remain activated.

Source: https://en.wikipedia.org/wiki/Full_Tilt!_Pinball#3D_Pinball_for_Windows_%E2%80%93_Space_Cadet

I prefer the Full Tilt! gameplay rules, feeling that it's more fun using them instead of 3D Pinball's.

Custom Texture Packs?

Could there be a way to use the extracted files from pinball.dat/cadet.dat and replace the BMPs with custom images, such as hi-res BMPs or even support PNG?

Fuel level indicator is either full or empty

The fuel level indicator appears to only be able to either be completely full or completely empty, as opposed to lighting up some of the lights to approximately tell the fuel level. I was able to reproduce the issue on three different builds on three different systems (Linux build on an Arch desktop, cross-compiled Windows build on a Windows desktop built on the aforementioned Arch, Visual Studio build on a Windows laptop).

EDIT: here's a video showcasing what's happening: https://nixo.la/img/1633538661.mp4
Here's what is supposed to happen: https://nixo.la/img/1633539480.mp4

Music cannot be turned off

Sound can be turned off by selecting the related menu point under Options. But for Music, it keeps playing. I use Chrome version 94.0.4606.81 (Official Build) (64-bit).

Add social banner.

I had created a article of "Top 10 trending github repos of the week🐮."

Here https://dev.to/ksengine/top-10-trending-github-repos-of-the-week-1mk8

I can't see your social banner there.
Please add a social banner to this project

According to github docs

Customizing your repository's social media preview
You can customize the image displayed on social media platforms when someone links to your repository.

Until you add an image, repository links expand to show basic information about the repository and the owner's avatar. Adding an image to your repository can help identify your project across various social platforms.

See https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/customizing-your-repositorys-social-media-preview

Thanks 😊

5 second loading screen?

I'm using the latest version of Windows 10 with SSD and the load time for this game seems extremely long.

I don't think this is MIT license

Taking out the legality question, the license is very probably wrong.

I am not a lawyer, but you cannot slap MIT on decompiled copyrighted code.

Legality Question

Hi! Thanks for this wonderful effort! I wonder how legal is this vis-a-vis proprietary rights of Microsoft? Was this clean room reversed engineered?

Just asking coz i want to make a c# version of this :) and i dont want to start on a wrong footing...

Only one Sound playing at a time

The original Pinball was able to play more than one sound at a time, while this version interrupts the running sound with a new one.

Update info on 64 bit bug in readme

A few days ago I saw this video: https://www.youtube.com/watch?v=3EPTfOTC4Jw

Apparently the "64bit bug" can't be reproduced nowadays. The first generation of Intel's Itanium processors had their floating point unit rounding differently from what we're used to on x86 or x64. Interestingly the second generation had an instruction to switch floating point mode to the x64-like behaviour, so Space Cadet would possibly also run on them.

Microsoft seems to have made some effort to port it, but ultimately decided to kill it.

As far as I knows the 32 bit version runs fine on a 64 bit system (and had only x64 existed, I would have assumed that MS would just have shipped the unmodified 32 bit version of SpaceCadet - but for Itanium they needed to try to port it.) I can't verify, however, since I currently don't run Windows on my Laptop.

[Suggestion] ARM/ARM64 binaries?

I have Visual Studio 2019 so I was able to take the WindowsClassic branch and build binaries, and 'they just work'! It's great to have something native for us Windows on ARM (WoR?) Users. Anyways perhaps you could add binaries?
pinball arm64

I guess I could upload my builds, but for safety's sake maybe it's best if you upload your own?

Just a suggestion!

SpaceCadetPinball ARM(32-64).zip

Maxis variant not supported even by renaming the DAT file

Hello

Here the tree for the Maxis variant:
image

It comes from this release:
image

For example, if I rename just the DAT file like this:
image

The result is:

$ ./SpaceCadetPinball 
terminate called after throwing an instance of 'std::bad_array_new_length'
  what():  std::bad_array_new_length
Abandon

Ball "jittering out of sight" when moving upwards

Whenever the ball moves too fast upwards, it becomes close to untracable with the human eye. It seems to have something to do with the FPS and building each frame from top to bottom, but I'm not 100% sure.

Successfully built on Windows using MSYS2

I was able to build on Windows 10/21H1 using the MSYS2 build environment/MinGW-w64 compiler and the SDL2/SDL2_mixer libraries available from libsdl.org:

# install prerequisites
pacman -S base-devel git mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-SDL2 mingw-w64-x86_64-SDL2_mixer
wget https://www.libsdl.org/release/SDL2-devel-2.0.16-mingw.tar.gz
tar -xzvf SDL2-devel-2.0.16-mingw.tar.gz
wget https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-devel-2.0.4-mingw.tar.gz
tar -xzvf SDL2_mixer-devel-2.0.4-mingw.tar.gz
git clone https://github.com/k4zmu2a/SpaceCadetPinball.git
cd SpaceCadetPinball
mkdir build && cd $_
cmake .. -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-mwindows" \
    -DSDL2_LIBRARY=$(realpath ../../SDL2-2.0.16/x86_64-w64-mingw32/lib/libSDL2.dll.a) \
    -DSDL2_INCLUDE_DIR=$(realpath ../../SDL2-2.0.16/x86_64-w64-mingw32/include/SDL2) \
    -DSDL2_MIXER_LIBRARY=$(realpath ../../SDL2_mixer-2.0.4/x86_64-w64-mingw32/lib/libSDL2_mixer.dll.a) \
    -DSDL2_MIXER_INCLUDE_DIR=$(realpath ../../SDL2_mixer-2.0.4/x86_64-w64-mingw32/include/SDL2)
cmake --build .

The SDL2/SDL2_mixer libraries included in the MSYS2 packages are linked against libFLAC/libogg/libvorbis/etc, and will cause the exe to fail to link because of the line:

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static")

in CMakeLists.txt, so the workaround is to use the packages from libsdl.org which are not directly linked against extra libraries.

The resulting exe is fairly large at 12.9MB for some reason, and comes out much smaller (around 1.8MB) if you comment out the line about static linking, but then you have to copy the files:

/mingw64/bin/libwinpthread-1.dll
/mingw64/bin/libstdc++-6.dll
/mingw64/bin/libgcc_s_seh-1.dll

to the game data directory as well as the SDL2/SDL2_mixer libraries and compiled exe.

Hopefully this is useful as an alternative to compiling with Visual Studio.

Hardware accelerated rendering?

Hi there!

Firstly, thanks for releasing this publicly.
I've been working on a somewhat updated version of the game myself (coincidentally also on top of SDL2), and it's been a great resource to compare notes.

I'm nowhere near ready to release anything yet, but I've put in some research and came to the conclusion that it should be possible to get rid of the CPU-based graphics blitting and invalidation logic by using OpenGL (and likely other 3D graphics APIs) -- it should be more than possible to just fully render all sprites on every frame in hardware.
This wouldn't necessarily benefit the base game much, but it should allow for easy use of variable and/or very high input sprite resolution (with some file loading changes to accommodate a higher fidelity format), and also could potentially provide a path for a determined individual or group to start replacing the graphics with true 3D models (2D component: apply bitmap as texture to flat quad, 3D component: apply texture to supplied geometry).

I assume this might be of interest to you based upon your recent changes that extend upon the original game?

One possible implementation with OpenGL would be to use gl_FragDepth so that a fragment shader can override the 3D geometry's depth with values taken from a second texture (the Zmap). Then you can use regular depth testing to remove occluded pixels.
gl_FragDepth should be supported since OpenGL 2.0 (all current desktop platforms) and OpenGL ES 3.0 (>90% of Android devices in use as per Google's dashboard), which seems to be an adequate level of support. It also seems to be available in WebGL 2, should a web port ever be attempted.

Support for translated versions

Localized editions of Windows XP include translated versions of Space Cadet, I have attached a screenshot of the Polish version:

SpaceCadetPolish

Could support for them be added? What would have to be done?

Also, where are the translated strings and font placed? Inside PINBALL.DAT or PINBALL.EXE? Running the compiled binary inside the Polish version's directory makes the game run in English, so I think it's the former.

Help with big endian port

Hi. I got most of the work done offline, but I cannot get one thing right.
obraz
This is from amd64 port. We can see a_bump1 is looking good. Now take a look at ppc64:
obraz

The secondary texture is messed up. What's even this secondary texture? What is its name?

So far I have written non-optimized code that uses compiler (GCC) intrinsics in all the places necessary for the game to even start. Sound is still not there, but I'll get it done.

Thanks! -- not an issue, just a thanks!

This built right through on MacOS Monterey using the sdl2 libraries from homebrew in a minute or two, and with the resources from my old Windows Pinball installation, works just great!

Well done -- I had no idea you could decompile an older game like this and remake it in SDL2.

now I'm in for some serious wasted time!

Map Exit Button on Controller

I played this with a controller, and the default configuration works great (the shoulder buttons for the paddles and "start" to pause are very intuitive). However, as far as I can tell, there's no way to exit the game with the controller only. Would it be possible to map a key on the controller to exit? Perhaps the "select" button by default?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.