k4zmu2a / SpaceCadetPinball

Decompilation of 3D Pinball for Windows – Space Cadet
MIT License
3.5k stars 214 forks source link

The bug was never in X64, btw... #55

Open davepl opened 3 years ago

davepl commented 3 years ago

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

k4zmu2a commented 3 years ago

Hello, fancy seeing you here)

I wrote that bug section based on previous public misinformation. I am planning to amend it with new revelations, still working on the wording.

Something like this: Update: X64 bug is a lie. There were some problems with 64-bit platforms, like IA-64, but nothing unsolvable. Vista did not receive the game based on other criteria, like fixed low resolution.

davepl commented 3 years ago

Everything is solvable given time, it’s only software! But it was one guy and he had to solve the whole shell, so…

Super-impressed with this project by the way. I have a YouTube channel with quite a few viewers (Dave’s Garage) and would like to feature it again as a followup, if you don’t mind the exposure. The part I don’t get though is how did you do the API translation? Like in my original code, there’s a sound engine and there’s no way it works on Linux natively, so decompiling and recompiling doesn’t buy you much without fixing up API calls and so on.

Did you really fix up by hand each and every API call, or is done automated somehow? If you can help me understand how you moved the decompiled code from being linked to a bunch of Windows import DLLs like gdi/user/etc I’d love to know so I can explain it to others!

BTW, if you want to be precise, I think the problems were primarily on the Alpha platform. Did Vista even support AXP? I don’t recall!

On Oct 19, 2021, at 9:56 PM, Muzychenko Andrey @.***> wrote:

Hello, fancy seeing you here)

I wrote that bug section based on previous public misinformation. I am planning to amend it with new revelations, still working on the wording.

Something like this: Update: X64 bug is a lie. There were some problems with 64-bit platforms, like IA-64, but nothing unsolvable. Vista did not receive the game based on other criteria, like fixed low resolution.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/k4zmu2a/SpaceCadetPinball/issues/55#issuecomment-947328308, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA4HCFZU5RK7O57NXAA7VI3UHZDYFANCNFSM5GJNM6IQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Gymnasiast commented 3 years ago

Update: X64 bug is a lie.

@k4zmu2a It was a mistake, not a lie. A lie would mean that the guy who said it did it to deliberately mislead people, and I’m sure that was not the case.

(Btw, nice project :+1:)

k4zmu2a commented 3 years ago

But it was one guy and he had to solve the whole shell, so…

I don’t think anyone blames you for that, I certainly don’t.

...if you don’t mind the exposure

Sure, expose the project however you like. I made it for the world to enjoy. If it gets shutdown due to over exposure then so be it, all interested parties should have it by now.

how did you do the API translation

As a first step, I made a working Windows version, with original dependencies. Then I branched it into WindowsClassic, turning master into cross-platform port. API translation was done by hand (much like the rest of the work). SDL_mixer already has sound mixer, so WaveMix gets thrown out. SDL_mixer API matches almost 1:1 with PB API like sound/midi init/shutdown, load/free, play/stop. So, midi/sound classes become thin SDL_mixer shims.

Did you really fix up by hand each and every API call, or is done automated somehow?

All done manually, hard work is good for you) I did use text tools, like VS rename and regex replace.

If you can help me understand how you moved...

For me, the key was not in the tools/automation, but rather the strategy. The strategy was to have a working build at all time. At decompilation phase, I didn’t dump everything at once, I did it function by function, starting with partman. At porting phase, I added and removed things one at a time, starting with SDL window. Once hybrid SLD/Windows build compiled and worked, I started removing Windows headers and code. And then came the day when I could remove windows.h.

Did Vista even support AXP?

It did not, neither did XP. I believe that when people think about pinball loss in Vista, they usually associate it with something that happened in XP->Vista transition. It is hard to include DEC Alpha into the equation: Trouble with Alpha in (NT 4, 2000?) -> Windows XP without Alpha -> no pinball on Vista without Alpha; how does this even work. But we do have a report of WinXP IA-64 problems by NCommander, however manually induced that might be.

ZaDarkSide commented 3 years ago

For more information about the issue this is pretty much summed up here: https://www.youtube.com/watch?v=3EPTfOTC4Jw

dobragab commented 2 years ago

Sorry to ruin your days, but I just had to open #125.

@davepl can you please take a look at it if you ever observed it or heard about similar repros?