-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check compatibility with GOG.com re-release #142
Comments
Update: Bought the game and trying to load it on Linux. There are 2 standard tools for extracting GOG.com setups (which are actually InnoSetups). These would be uninno and innoextract. See my quick gog-release analysis in #61 (comment) . |
Wow. That is marvellous news about the very recent release. It seems like the GOG release schedule team personnel have been following this open-source version recently and probably decided to proceed with a quick official release in case this project may be able to link with that updated game's files in the foreseeable future and to revitalize fans' (like me) excitement for this game. |
@ObiKKa I don't think this has to do with OpenSWE1R. But it's still great because we finally have a new legal source for the game files. I just wish we would be further along so we could ride on the publicity wave for free advertisement. To use said current hype around SWE1R, I decided to look into how we can use the GOG.com release again: https://github.com/OpenSWE1R/openswe1r/wiki/Getting-Started#option-3-installing-from-gogcom . Note that the instructions are still broken and there's lots of small issues we'll have to fix. |
According to IDA Pro and diaphora, there are 4 functions different in the GOG.com release with the binary which was available on 1st May 2018. GOG.com 1.0, English (1st May 2018)File: Foreword: I've only looked at swep1rcr.exe (as this is enough for OpenSWE1R purposes). The GOG.com release ships with a handful of dlls. Each of which has the ability to make additional patches to SWE1R at runtime. So take this with a grain of salt and be careful. The following code additions are all over the place, using small code caves where there used to be 0x90 (nop) between functions. I'll only list the functions in which the detours start. 0x423330: StartAddressThis is the original audio streaming thread. 0x422AC0: sub_422AC0This is the original function which changes the streamed audio. 0x425500: sub_425500This is the CD check:
Most in this CD patch actually looks botched. I'm a bit surprised by the "poor" quality, considering the amount and quality of work with the CriticalSection above was higher (so I expected quality to stay this way). 0x488F50: sub_488F50This is the original resolution check. I'm not 100% sure if this analysis is complete. The big changes are the obvious ones: CD Check and Resolution check. However, I'm a bit surprised about the changes in the audio logic. Although the changes do make sense, I feel they are a bit overkill. I'd personally just have fixed the thread affinity. I'd also have done the resolution patches slightly differently (more like PeterLemon). Most importantly, I'd have done the CD-Check differently. I feel this is dirty. It makes me wonder if they used a pre-cracked binary to start out with. As the patch quality for this is worse than the rest. Also, they have wrappers and hooks anyway. So they could have done what we do in OpenSWE1R. Regarding safety of this release for speedrunning: While unlikely, the |
A few notes on installing the GOG version: (2) The innoextract directions in the Getting Started wiki page aren't quite complete--- I found that I had to apply the -g option (i.e. "innoextract -g -l setup_star_warstm_episode_i_-racertm_1.0_hotfix(20503).exe") to get most of the game data out, and then I still had to move the 'config' and 'player' subdirectories from '__support/save/data' into just 'data' and the 'app/save/data/config/current' subdirectory into 'data/config'. (3) Even after that, openswe1r still fails to run (opens a window but never displays anything, then exits after about two seconds). The log from stdout is attached; the lines indicating obvious errors are
(4) I did copy wheel.map from the app/save/data/config/default directory (unpacked by innoextract) into data/config/default, but the original file is zero bytes in length and it didn't do anything to dispel the error message. (5) My data/anim/planetg.znm (from GOG version 20503) has MD5 checksum e30ea3aeea4c106709caaa7527e50283. It decompresses with gunzip to a LucasArts Smush v2 animation file and appears to be intact (same header/trailer as the other .znm files and plays fine with MPlayer), so I don't know why that specific file fails to load (is it the first one touched as an intro movie?). (6) I don't have a racer.tab (or any other .tab) files anywhere. Sounds like perhaps a savegame file? (7) I am able to run the GOG installer (same version 20503) under WINE (version 3.7 from the Ubuntu repositories, no patches) without obvious errors, but openswe1r fails with similar messages (modulo some filename noise on a case-sensitive filesystem) on that unpacked installation. Of note, there's no racer.tab there either, and planetg.znm still fails to load. WINE will not run the actual game. (8) I don't have any other copies of the game so I'm uncertain to what extent the above are due to issues with openswe1r or just defects in the latest GOG release. Hopefully at least (2) is useful to someone else. |
Thanks for the in-depth information! Also consider joining our gitter - we'd love to have more people around.
Awesome! I'll have a look at this soon.
Yes, and my patch for the tool was only merged earlier today. So you were in luck that they worked at all.
Yes, because the original games CD check is hooked in OpenSWE1R (using hardcoded
I don't remember details about this file, but I believe a size of zero should be fine. The error is likely that the correct path can simply not be found - it will really look in your D: drive. The contents of the files does not even matter if I'm correct. Those are just files the game tries to open to see if it's the correct CD.
racer.tab is documented in depth. There's also a tool to generate your own (which is still untested).
As the CD check is not an issue with the installer, this is to be expected.
Probably all (minor) issues with OpenSWE1R. The GOG.com release is less than a week old and me and Olganix actually worked on a map/model-editor this past week (in our "limited" spare time). I've also documented a ton of other game functions. |
Regarding the CD-ROM error: https://www.gog.com/forum/star_wars_episode_i_racer/cd_check_error/post2 |
They updated the game today again. I'll just try to patch OpenSWE1R for the original GOG.com version later, and that should fix the others too. |
GOG.com 1.0 hotfix, English (4th May 2018)File:
As you might have noticed already: the game binary did not change at all in this version (unless I accidentally used the wrong files). |
After contacting GOG.com I did notice that some posts by users imply that the unpatched game was previously only showing 16bpp anyway (in which case this patch is ok-ish). This post has been modified to reflect that. This means the patch is not as bad as I initially thought it was. GOG.com 1.0 hotfix2, English (8th May 2018)File:
...or in other words: "only display 16bpp resolutions and possibly break support for 8bpp, 24bpp and 32bpp". This binary is based on the 1.0 hotfix binary, so all previous patches are also present. I'm not aware of any other changes, although there might be some. IDA wasn't too helpful this time as the decompilation looks very broken compared to the previous version. Diaphora was also unable to match the function for some odd reason. 0x488F50: sub_488F50This is the original resolution check. v16 = v4[7];
switch ( v16 )
{
case 8u:
eax = v4[4]; // Does nothing now, result unused (but mode is not being added anyway)
break;
case 16u:
// This is how the game normally handles the resolutions
// Note how the game normally writes the stride back to v4[5].
v4[5] = v4[4] / 2;
goto LABEL_37;
case 24u:
eax = (unsigned int)v4[4] / 3u; // Does nothing now, result unused (but mode is not being added anyway)
break;
case 32u:
eax = v4[4]; // Does nothing now, result unused (but mode is not being added anyway)
break;
default:
break;
}
return 1;
LABEL_37:
v20 = v4[2] * v4[1];
v21 = v20 * (v16 >> 3);
v4[3] = v21;
if ( dword_EC8D80 >= (unsigned int)(2 * (v21 + v20)) )
++dword_52D44C;
return 1; This is a rather cruel hack. But even if the game only supported 16bpp, it's still a shame about removing 24bpp and 32bpp, as the change implies that they are not working towards fully supporting those in the future either. At the moment, the patch does not even fully address the original issue. Although it is unlikely, I could imagine that some drivers / displays will also still expose more than 64 acceptable resolutions (for example: a ton of useless combinations, such as 640x240). A proper solution would be to relocate the resolution array to support more than 64 resolutions. At least support for 24bpp and 32bpp should be added back (and added to the menu if it isn't supported yet). What leads to my slight frustration with this patch, is that OpenSWE1R crashes with this binary. For OpenSWE1R, I'll add support for a 16bpp display mode. I've tested this locally and it seems to work fine. That's unfortunate because it feels like an unnecesary patch, as the GOG.com 1.0 hotfix2 is the only release of the game to require this change. I'm worried there'll be more patches in the GOG.com version like this in the future, which will require otherwise unnecessary changes in OpenSWE1R. |
GOG.com 1.0 hotfix3, English (16th May 2018)File:
Another update without changing the binary (which is the same as 1.0 hotfix2). I had expected this. They probably just improved emulation of the DX hook to properly support colorfill / clearing ( |
It was just brought to my attention that the game got re-released on GOG.com.
We should keep track of the GOG.com version and possibly make it compatible.
From the supported features, this actually sounds like it is an enhanced version as the original Windows release only supported IPX networking. There were also a handful of bugs on modern systems.They ship with ipxwrapper.
The text was updated successfully, but these errors were encountered: