http://bugs.winehq.org/show_bug.cgi?id=30586
Bug #: 30586 Summary: Kings Quest 8 crashes on startup Product: Wine Version: 1.1.24 Platform: x86 OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: directx-d3d AssignedTo: wine-bugs@winehq.org ReportedBy: focht@gmx.net Classification: Unclassified
Hello,
this issue is split off from bug 2905
It was first mentioned in http://bugs.winehq.org/show_bug.cgi?id=2905#c16
Copied over my analysis from: http://bugs.winehq.org/show_bug.cgi?id=2905#c19
--- quote --- yep, there is an initial crash preventing the game to load which needs to be fixed first.
IDirect3D3::EnumDevices calls the app supplied callback two times.
It seems the game doesn't like IID_IDirect3DRGBDevice and resets some internal data structures - one of them is a pointer to an internal device string "D3D-display". When the enumeration callback is called a second time for IID_IDirect3DHALDevice, the app code tries to do some search/replace on that string - but the pointer member was reset by the first callback call (NULL).
--- snip dlls/ddraw/ddraw.c --- static HRESULT WINAPI d3d3_EnumDevices(IDirect3D3 *iface, LPD3DENUMDEVICESCALLBACK callback, void *context) { static CHAR wined3d_description[] = "Wine D3DDevice using WineD3D and OpenGL";
IDirectDrawImpl *This = impl_from_IDirect3D3(iface); D3DDEVICEDESC device_desc1, hal_desc, hel_desc; D3DDEVICEDESC7 device_desc7; HRESULT hr; ... if (This->d3dversion != 1) { static CHAR reference_description[] = "RGB Direct3D emulation";
TRACE("Enumerating WineD3D D3DDevice interface.\n"); hal_desc = device_desc1; hel_desc = device_desc1; /* The rgb device has the pow2 flag set in the hel caps, but not in the hal caps. */ hal_desc.dpcLineCaps.dwTextureCaps &= ~(D3DPTEXTURECAPS_POW2 | D3DPTEXTURECAPS_NONPOW2CONDITIONAL | D3DPTEXTURECAPS_PERSPECTIVE); hal_desc.dpcTriCaps.dwTextureCaps &= ~(D3DPTEXTURECAPS_POW2 | D3DPTEXTURECAPS_NONPOW2CONDITIONAL | D3DPTEXTURECAPS_PERSPECTIVE); hr = callback((GUID *)&IID_IDirect3DRGBDevice, reference_description, device_name, &hal_desc, &hel_desc, context); if (hr != D3DENUMRET_OK) { TRACE("Application cancelled the enumeration.\n"); LeaveCriticalSection(&ddraw_cs); return D3D_OK; } } ... TRACE("Enumerating HAL Direct3D device.\n"); hal_desc = device_desc1; hel_desc = device_desc1; /* The hal device does not have the pow2 flag set in hel, but in hal. */ hel_desc.dpcLineCaps.dwTextureCaps &= ~(D3DPTEXTURECAPS_POW2 | D3DPTEXTURECAPS_NONPOW2CONDITIONAL | D3DPTEXTURECAPS_PERSPECTIVE); hel_desc.dpcTriCaps.dwTextureCaps &= ~(D3DPTEXTURECAPS_POW2 | D3DPTEXTURECAPS_NONPOW2CONDITIONAL | D3DPTEXTURECAPS_PERSPECTIVE); hr = callback((GUID *)&IID_IDirect3DHALDevice, wined3d_description, device_name, &hal_desc, &hel_desc, context); if (hr != D3DENUMRET_OK) { TRACE("Application cancelled the enumeration.\n"); LeaveCriticalSection(&ddraw_cs); return D3D_OK; } TRACE("End of enumeration.\n");
LeaveCriticalSection(&ddraw_cs); return D3D_OK; } --- snip dlls/ddraw/ddraw.c ---
If you reverse the order of callback calls (IID_IDirect3DHALDevice first, IID_IDirect3DRGBDevice second), the game starts successfully and seems playable again. Though it crashes at exit (which seems to be another bug) and the load savegame bug of course.
--- quote ---
Regards
http://bugs.winehq.org/show_bug.cgi?id=30586
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download URL| |http://www.idg.pl/ftp/pobie | |rz/gry/69.html Blocks| |2905
--- Comment #1 from Anastasius Focht focht@gmx.net 2012-05-03 17:56:04 CDT --- Hello,
filling fields
Regards
http://bugs.winehq.org/show_bug.cgi?id=30586
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED URL|http://www.idg.pl/ftp/pobie |http://www.download.com/Kin |rz/gry/69.html |g-s-Quest-The-Mask-of-Etern | |ity/3000-7564_4-10025133.ht | |ml Blocks|2905 | Resolution| |DUPLICATE Summary|Kings Quest 8 crashes on |Kings Quest 8 "Mask of |startup |eternity" crashes on | |startup
--- Comment #2 from Anastasius Focht focht@gmx.net 2012-05-04 08:22:14 CDT --- Hello,
grmbl ... dupe of bug 9665 (from the initial bug reports it looks same issue).
Regards
*** This bug has been marked as a duplicate of bug 9665 ***
http://bugs.winehq.org/show_bug.cgi?id=30586
Jerome Leclanche adys.wh@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #3 from Jerome Leclanche adys.wh@gmail.com 2012-05-06 07:07:08 CDT --- Closing
https://bugs.winehq.org/show_bug.cgi?id=30586
Saulius K. saulius2@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |saulius2@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=30586
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- URL|http://www.download.com/Kin |https://web.archive.org/web |g-s-Quest-The-Mask-of-Etern |/20211121181757/https://dow |ity/3000-7564_4-10025133.ht |nload.fileplanet.com/ftp1/g |ml |amedemos/adventure/maskdemo | |.exe?st=bx1sJCLgAn5DgsPIMD7 | |FgA&e=1637529264
--- Comment #4 from Anastasius Focht focht@gmx.net --- Hello folks,
adding stable download link via Internet Archive for documentation.
Manual upload from archive.org:
Mask of Eternity Demo 1.00.000
https://archive.org/download/MASKDEMO/MASKDEMO.rar
$ sha1sum MASKDEMO.rar 3874cbf268ae84b50c39e69a8c9416dfea99b94d MASKDEMO.rar
$ du -sh MASKDEMO.rar 120M MASKDEMO.rar
===
https://www.fileplanet.com/archive/p-60025/King-s-Quest-Mask-of-Eternity-Dem...
https://web.archive.org/web/20211121181757/https://download.fileplanet.com/f...
https://www.virustotal.com/gui/file/275014694fffec10c32de4a43f9f1e8dbb4ff3e9...
$ sha1sum maskdemo.exe 832ec902e591cc7cee3f368aed1fa56f2a068b19 maskdemo.exe
$ du -sh maskdemo.exe 57M maskdemo.exe
Regards