Hi everyone,
I've been following Wine development for a while but now I think it's time to contribute something. I don't use Windows anymore (except for PowerPoint at work), but I decided it would be good to be able to play some games on Linux. So I grabbed Wine from CVS, compiled it up and tested some games, with the intention of finding where the problems were and hopefully fixing them. I have put my results on a web page at:
http://www.epcc.ed.ac.uk/~jamesp/wine-games.html
to avoid making this posting even longer. Note that I haven't looked in detail at most of these yet, I just tried them out once to see what would happen. I'm gradually working through the list, debugging them.
I've already submitted one patch (to solve a D3D blend mode problem that affected SonicR). I have traced a number of the other problems to specific aspects of Wine, but I'm not sure how to go about fixing them. Any advice on these points from experienced developers would be welcome:
1. MusicVR exits with this error:
X Error of failed request: GLXBadDrawable Major opcode of failed request: 145 (GLX) Minor opcode of failed request: 11 (X_GLXSwapBuffers) Serial number of failed request: 10522 Current serial number in output stream: 10523
I traced it to the line:
glXMakeCurrent(default_display, None, NULL)
in dlls/opengl32/wgl.c. My OpenGL (nVidia) doesn't seem to like the drawable being set to None, although according to the GLX docs, this should be OK. Simply commenting out the line makes the game work fine, but I don't think this is the right fix. Any ideas?
2. Settlers III crashes almost straight away, in the code of the PE-Crypt protection system. This is caused by the processor's direction flag (which controls whether pointers are incremented or decremented by string instructions) getting reset somewhere, probably in Wine code. Can anyone comment on treatment of this flag in Wine? Is it likely to be clobbered in lots of places? Basically, is there any hope of getting this working? I'm not sure where to start with this one.
3. South Park Rally creates its DirectInput object using the generic OLE functions, which doesn't work in Wine right now. I have some initial code to support this, but not sure if it does everything it needs to. I have:
- copied regsvr.c from the DirectSound DLL and edited it to register the DirectInput classes, and implement the DirectInput Dll[Un]RegisterServer methods
- removed the stubs of those functions from dinput_main.c
- added regsvr.c to the list of source files in dinput's Makefile.in, and added ole32 and advapi32 to the list of imports
It would also be good if the default registry created by winebuild contained the necessary entries to make this work (I had to add them by hand), but I couldn't find where the initial registry entries come from.
If this all sounds OK, I can submit it as a patch. Although even with this support, South Park Rally fails with another DirectX problem. One step at a time though...
4. The CD audio in Sonic 3D doesn't play in Wine yet. I found there were two separate problems causing this. First, it's trying to use CD device 2. No idea where this number comes from, as I have only one CD-ROM in the system, and the game doesn't seem to be specifying device 2 anywhere. Anyone know where mcicda gets the device ID from, save me spending ages looking for it?
Second, it's using TMSF (track,minutes,seconds,frames) format to specify locations on the CD. These appear as colon-separated values in the MCI commands (e.g. "02:00:00") but the argument parser chokes on them, expecting a single integer. I got around this by hacking MCI_GetDWord to recognise the colons and parse these arguments correctly, but maybe that's not the way to do it... any suggestions?
Sorry this post is so long. Finally, I'd just like to say great job everyone! I was impressed that things like DirectX, InstallShield and even SecuROM copy protection are working so well - they're flawless on some of the games I tried. It's really come on since I first tried it back in 2000.
Cheers, James