OpenSWE1R / openswe1r

An Open-Source port of the 1999 Game "Star Wars Episode 1: Racer"
https://openswe1r.github.io/
GNU General Public License v2.0
312 stars 26 forks source link

Game starts to run and then exits #157

Closed jordan4302 closed 5 years ago

jordan4302 commented 6 years ago

OpenSWE1R starts and it opens a black game window, but then then it exits before it gets any further. I have attached a txt file with the console output. I'm using Ubuntu 18.04 LTS on a VMware Fusion virtual machine. I did follow the instructions to get the game files from the original game disc. I apologize in advance if this turns out to just be me doing something wrong.

console output.txt

JayFoxRox commented 6 years ago

Thanks for the report!

Can you please state which version of the repository you are using? Can be checked with git rev-parse HEAD. Also, which folder did you install the game to? And please provide the md5sum for the game binary: md5sum swep1rcr.exe

From the look of it, this looks like an incompatibility of OpenSWE1R with the CD check in the game version you are using ("Game version: Retail, English"). I'll try to reproduce the issue locally later.

There doesn't seem to be any issues with filepaths / file copying.

jordan4302 commented 6 years ago

git version is ef8ca30b831a4cc967b3fd927a1aaf559c490c38 the md5sum of swep1rcr.exe is 22c2781b3cf606b7a093ec5a39ac2af5

I copied the files from the install disc to the build folder per the instructions on the wiki and am attempting to run the game from there by launching it from the terminal

JayFoxRox commented 6 years ago

~~There have been changes to the CD check since then. Please try with the latest revision (89d1820236ed77c5475996c5f218c7f340fd93d9 at the time of writing). If the issue persists, I'll look into it.~~

I've tested this locally and get the same issue. I'll investigate.


With the new version there are even more problems (which probably make it work under most circumstances, due to 2 bugs accidentally giving the correct result):

hKey 0x0
lpValueName 0x4B7EC0 ('CD Path')
lpReserved 0x0
lpType 0xC07FFA64
lpData 0xE9F2C0
lpcbData 0xC07FFA60
Stack at 0xC07FFA34; returning EAX: 0x00000000
   1120 Emulation at 49D311 ('RegQueryValueExA') from 49D311

hKey 0x0
Stack at 0xC07FFA48; returning EAX: 0x00000000
   1121 Emulation at 49D31C ('RegCloseKey') from 49D31C

lpSubKey 0xE9F2C0 ('D:')
Stack at 0xC07FFA74; returning EAX: 0x00000005
   1122 Emulation at 425619 ('GetDriveTypeA') from 425619

lpFileName 0xC07FFB18 ('D:\Gnome\.\data\config\default\wheel.map')
dwDesiredAccess 0x40000000
dwShareMode 0x3
lpSecurityAttributes 0xC07FFA14
dwCreationDisposition 0x2
dwFlagsAndAttributes 0x80
hTemplateFile 0x0
Failed to open file ('D:\Gnome\.\data\config\default\wheel.map' as 'd:/gnome/./data/config/default/wheel.map')
Stack at 0xC07FF9DC; returning EAX: 0xFFFFFFFF
   1123 Emulation at 4A074D ('CreateFileA') from 4A074D

lpRootPathName 0xE9F2C0 (D:)
lpVolumeNameBuffer 0xC07FFB98
nVolumeNameSize 128
lpVolumeSerialNumber 0x0
lpMaximumComponentLength 0x0
lpFileSystemFlags 0x0
lpFileSystemNameBuffer 0x0
nFileSystemNameSize 0
Stack at 0xC07FFA58; returning EAX: 0x00000001
   1131 Emulation at 4256F1 ('GetVolumeInformationA') from 4256F1

lpFileName 0xC07FFC18 ('D:\Gnome\Data\Anims\PlanetG.znm')
dwDesiredAccess 0x80000000
dwShareMode 0x3
lpSecurityAttributes 0xC07FFA50
dwCreationDisposition 0x3
dwFlagsAndAttributes 0x80
hTemplateFile 0x0
Failed to open file ('D:\Gnome\Data\Anims\PlanetG.znm' as './data/anims/planetg.znm')
Stack at 0xC07FFA18; returning EAX: 0xFFFFFFFF
   1132 Emulation at 4A074D ('CreateFileA') from 4A074D

hWnd 0x14D
lpText 0xC07FFD18 ('Error:  Please insert CD-ROM 'racer100_0' into drive.

Press OK to continue or CANCEL to exit to desktop.')
lpCaption 0x4B7DA4 ('CD ERROR')
uType 0x31
Stack at 0xC07FFA68; returning EAX: 0x00000002
   1140 Emulation at 4257CD ('MessageBoxA') from 4257CD

Note that I did not have the anims installed in this test case. I assume it would work if the animations existed on disk.

While this Failed to open file ('D:\Gnome\.\data\config\default\wheel.map' as 'd:/gnome/./data/config/default/wheel.map') returns the correct result from CreateFileA (= no write access to CD), it does so for the wrong reason.

A proposed patch should therefore: