http://bugs.winehq.org/show_bug.cgi?id=19153
Summary: DX3 game does not recognize graphics capabilities Product: Wine Version: 1.1.24 Platform: PC URL: http://appdb.winehq.org/objectManager.php?sClass=versi on&iId=9396 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: directx-ddraw AssignedTo: [email protected] ReportedBy: [email protected]
Resident Evil 1 does not start giving the error "Failed to initialize the Graphics Hardware Device.(3)". It's a DirectX 3 game using immediate mode.
After some debugging I found that it relies on 3 (three) entries returned by EnumDevices whereas wine returns only the Direct3D HAL entry in this case (d3dversion == 1). Removing the if-clause in ddraw/direct3d.c and duplicating the HAL entry solves the problem and the game actually runs almost perfectly (Garbage -> Platinum).
I checked a Windows installation which returns "HAL", "RGB Emulation" and "Ramp Emulation" but the comments in the file suggest that not all games are happy about that. So how to fix this properly?
http://bugs.winehq.org/show_bug.cgi?id=19153
--- Comment #1 from Austin English [email protected] 2010-06-04 15:44:05 --- This is your friendly reminder that there has been no bug activity for 11 months. Is this still an issue in current (1.2-rc2 or newer) wine?
http://bugs.winehq.org/show_bug.cgi?id=19153
Cihan Altinay [email protected] changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|1.1.24 |1.1.42
--- Comment #2 from Cihan Altinay [email protected] 2010-06-04 18:37:19 --- Still an issue in wine 1.1.42 (latest prebuilt package as of today) and I can't see any relevant commits between that version and 1.2-rc2 which would solve it.
http://bugs.winehq.org/show_bug.cgi?id=19153
Juan Lang [email protected] changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|1.1.42 |1.1.24
--- Comment #3 from Juan Lang [email protected] 2010-06-04 19:42:42 --- Please don't change the originally reported version, a comment is enough.
http://bugs.winehq.org/show_bug.cgi?id=19153
Boris Bobrov [email protected] changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected]
--- Comment #4 from Boris Bobrov [email protected] 2010-11-28 04:14:47 CST --- Can confirm with wine 1.3.7
http://bugs.winehq.org/show_bug.cgi?id=19153
Boris Bobrov [email protected] changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1
--- Comment #5 from Boris Bobrov [email protected] 2010-11-29 07:12:55 CST --- *** This bug has been confirmed by popular vote. ***
http://bugs.winehq.org/show_bug.cgi?id=19153
joaopa [email protected] changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected]
--- Comment #6 from joaopa [email protected] 2011-09-03 18:15:06 CDT --- still an issue in current wine?
http://bugs.winehq.org/show_bug.cgi?id=19153
--- Comment #7 from Cihan Altinay [email protected] 2011-09-16 05:28:29 CDT --- Same behavior with current vanilla wine 1.3.28.
http://bugs.winehq.org/show_bug.cgi?id=19153
Austin English [email protected] changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|directx-ddraw |directx-d3d
http://bugs.winehq.org/show_bug.cgi?id=19153
hickop [email protected] changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected]
--- Comment #8 from hickop [email protected] 2012-06-11 15:02:01 CDT --- got the same with wine 1.5.6
http://bugs.winehq.org/show_bug.cgi?id=19153
WineBuG [email protected] changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected]
http://bugs.winehq.org/show_bug.cgi?id=19153
--- Comment #9 from WineBuG [email protected] 2013-10-13 17:33:47 CDT --- I don't know if it's the same problem, but if in Resident Evil 2 Demo one chooses Unknown card (it's named the same on Windows Vista, but I'm not sure this is correct) as a display driver instead of Software Mode the message appears 'It failed in the initialization of DIRECTX', and the game doesn't run. I've attatched the log.
Link to the demo: http://www.fileplanet.com/11008/download/Resident-Evil-2-Demo
This bug might be connected with these issues:
Bug 32581 - Invalid dwFlags of reference rasterizer's HAL D3DDEVICEDESC
Bug 19177 - Gorky-17 does not start
Bug 34630 - Some games don't detect the correct number of display drivers (graphic cards) and their names
Bug 22268 - SWKOTOR: Fails to detect installed graphic drivers
Tested with Wine 1.7.4 on: Ubuntu 13.04, GeForce 9600M GS (NVIDIA driver 313) Mac OS X 10.7.5, ATI HD 2600 Pro, Mac Driver/X11
http://bugs.winehq.org/show_bug.cgi?id=19153
--- Comment #10 from WineBuG [email protected] 2013-10-13 17:36:39 CDT --- Created attachment 46291 --> http://bugs.winehq.org/attachment.cgi?id=46291 RE2 Log +relay,+seh,+tid
http://bugs.winehq.org/show_bug.cgi?id=19153
WineBuG [email protected] changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected]
http://bugs.winehq.org/show_bug.cgi?id=19153
--- Comment #11 from WineBuG [email protected] --- A similar problem affects the Carmageddon 2 Demo launcher (https://archive.org/download/Carmageddon2CarpocalypseNowDemo/Carmageddon2Dem...).
Maybe the name of the bug report should be changed? I think that not only DX3 games are affected.
https://bugs.winehq.org/show_bug.cgi?id=19153
Andrew D'Addesio [email protected] changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected]
--- Comment #12 from Andrew D'Addesio [email protected] --- Hello,
I can confirm that this bug (still present in 1.7.49-git) is one factor preventing The Sims Online from starting in WineD3D on Windows.
Using a debugger, I determined that the game calls IDirect3D3::EnumDevices and searches by name (not by GUID) for the IDirect3DRGBDevice: that is, for each device returned by EnumDevices, it does a string comparison of the device's name against the string "RGB Emulation".
The problem is that Wine calls this device "Direct3D HEL". The game does not handle this condition and crashes. (The DDPIXELFORMAT struct it creates for this device remains uninitialized, causing a later call to CreateSurface to fail with DDERR_INVALIDPIXELFORMAT; the game passes the returned null surface pointer to AddAttachedSurface, causing Wine to crash.)
In Windows 7's ddraw.dll, IDirect3D3::EnumDevices returns these devices: * "RGB Emulation": {a4665c60-2673-11cf-a31a-00aa00b93356} * "Direct3D HAL": {84e63de0-46aa-11cf-816f-0000c020156e}
whereas Wine's ddraw.dll returns these devices: * "Direct3D HEL": {a4665c60-2673-11cf-a31a-00aa00b93356} * "Direct3D HAL": {84e63de0-46aa-11cf-816f-0000c020156e}
The names "Direct3D HEL" and "Direct3D HAL" were chosen in a patch made in 2008:
https://www.winehq.org/pipermail/wine-patches/2008-April/053647.html
Jens Albretsen jens at albretsen.dk Sun Apr 20 13:32:11 CDT 2008
Fixed EnumDevices, device name is now compatible with games checking the device name i.e "Donald duck going quackers", the correct device name is "Direct3D HAL" or "Direct3D HEL" not "direct3d".
I created a test which calls EnumDevices for all the IDirect3D* interfaces and prints all of the returned devices, and in Windows 7 (using Windows 7's ddraw.dll) I was unable to get EnumDevices to return a device named "Direct3D HEL". Is this the correct name? I'm attaching the test and results for reference.
In short, on my system, the devices are:
IDirect3D: * "Ramp Emulation": {f2086b20-259f-11cf-a31a-00aa00b93356} * "RGB Emulation": {a4665c60-2673-11cf-a31a-00aa00b93356} * "Direct3D HAL": {84e63de0-46aa-11cf-816f-0000c020156e}
IDirect3D2: * "Ramp Emulation": {f2086b20-259f-11cf-a31a-00aa00b93356} * "RGB Emulation": {a4665c60-2673-11cf-a31a-00aa00b93356} * "Direct3D HAL": {84e63de0-46aa-11cf-816f-0000c020156e} * "MMX Emulation": {881949a1-d6f3-11d0-89ab-00a0c9054129}
IDirect3D3: * "RGB Emulation": {a4665c60-2673-11cf-a31a-00aa00b93356} * "Direct3D HAL": {84e63de0-46aa-11cf-816f-0000c020156e}
IDirect3D7: * "RGB Emulation" * "Direct3D HAL" * "Direct3D T&L HAL"
This my first time posting to the Wine bugtracker / mailing lists and this is my first time entering the Wine community, and I'm not sure what your policy is towards online games which are no longer ("officially") playable. I can see why it might be undesirable to rename devices to appear as if they were Microsoft's, just to provide compatibility to a few titles.
https://bugs.winehq.org/show_bug.cgi?id=19153
--- Comment #13 from Andrew D'Addesio [email protected] --- Created attachment 52118 --> https://bugs.winehq.org/attachment.cgi?id=52118 enumdevices-test.c
https://bugs.winehq.org/show_bug.cgi?id=19153
--- Comment #14 from Andrew D'Addesio [email protected] --- Created attachment 52119 --> https://bugs.winehq.org/attachment.cgi?id=52119 enumdevices_testresults_win7_64.txt
https://bugs.winehq.org/show_bug.cgi?id=19153
--- Comment #15 from Andrew D'Addesio [email protected] --- Created attachment 52120 --> https://bugs.winehq.org/attachment.cgi?id=52120 enumdevices_testresults_wine.txt
https://bugs.winehq.org/show_bug.cgi?id=19153
Andrew D'Addesio [email protected] changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected]
https://bugs.winehq.org/show_bug.cgi?id=19153
Michael Müller [email protected] changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected]
--- Comment #16 from Michael Müller [email protected] --- (In reply to Andrew D'Addesio from comment #12)
This my first time posting to the Wine bugtracker / mailing lists and this is my first time entering the Wine community, and I'm not sure what your policy is towards online games which are no longer ("officially") playable. I can see why it might be undesirable to rename devices to appear as if they were Microsoft's, just to provide compatibility to a few titles.
If the application works on Windows but fails to run in Wine than this is a bug and it should be fixed. I am not sure if there is a strict policy for patched game clients, but there is at least another open bug report for a different game. Nevertheless, fixing this bug might also fix other games and you can also show the problem using a wine test. The actual game is therefore not so important.
The first step would be to integrate your test program into the existing ddraw wine tests: http://source.winehq.org/git/wine.git/tree/HEAD:/dlls/ddraw/tests (or ddrawex if it only happens when using DirectDrawCreateEx)
Using the "RGB Emulation" string for the device is also no problem. The device is already enumerated depending on the ddraw version: http://source.winehq.org/git/wine.git/blob/HEAD:/dlls/ddraw/ddraw.c#l3616
There is a lengthy comment about the consequences of (not) enumerating the reference renderer (i.e. the RGB emulation device) and it seems hard to find a solution which suits all games. The DirectDraw / IDirect3DDevice3 API is quite old and it is possible that the behavior changed between windows versions. It might therefore be necessary to add a registry to enable / disable the RGB emulation device as it is the case on (at least older versions of) Windows. If you find a solution which works with all mentioned games without adding more registry keys, this would be better.
https://bugs.winehq.org/show_bug.cgi?id=19153
--- Comment #17 from Erich E. Hoover [email protected] --- (In reply to Michael Müller from comment #16)
... Using the "RGB Emulation" string for the device is also no problem. The device is already enumerated depending on the ddraw version: http://source.winehq.org/git/wine.git/blob/HEAD:/dlls/ddraw/ddraw.c#l3616 ...
Are we sure that old windows versions don't call it something else? Reason I ask: https://www.winehq.org/pipermail/wine-patches/2008-April/054141.html
https://bugs.winehq.org/show_bug.cgi?id=19153
--- Comment #18 from Michael Müller [email protected] --- (In reply to Erich E. Hoover from comment #17)
Are we sure that old windows versions don't call it something else? Reason I ask: https://www.winehq.org/pipermail/wine-patches/2008-April/054141.html
I don't think that the question is whether we should rename "Direct3D HEL" to "RGB Emulation" but whether we should also enumerate the reference renderer. I just run the attached program on Windows 98 and I also got the "RGB Emulation" device. Due to the lack of any hardware accelerated drivers, this is the only device I got for Direct3D3.
It might also be possible that some games manually set the HKLM\Software\Microsoft\Direct3D\Drivers\EnumReference key during the installation. So we may need to add support for it.
https://bugs.winehq.org/show_bug.cgi?id=19153
--- Comment #19 from Andrew D'Addesio [email protected] --- Created attachment 52231 --> https://bugs.winehq.org/attachment.cgi?id=52231 Physical machine w/ Radeon Xpress 200, Catalyst 6.2, stock DirectX (6.1?).
https://bugs.winehq.org/show_bug.cgi?id=19153
--- Comment #20 from Andrew D'Addesio [email protected] --- Created attachment 52233 --> https://bugs.winehq.org/attachment.cgi?id=52233 win98se_with_dx8.txt
https://bugs.winehq.org/show_bug.cgi?id=19153
Andrew D'Addesio [email protected] changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #52231|0 |1 is obsolete| |
--- Comment #21 from Andrew D'Addesio [email protected] --- Created attachment 52234 --> https://bugs.winehq.org/attachment.cgi?id=52234 win98se_without_dx8.txt
https://bugs.winehq.org/show_bug.cgi?id=19153
Andrew D'Addesio [email protected] changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #52119|0 |1 is obsolete| | Attachment #52120|0 |1 is obsolete| | Attachment #52233|0 |1 is obsolete| | Attachment #52234|0 |1 is obsolete| |
--- Comment #22 from Andrew D'Addesio [email protected] --- Created attachment 52494 --> https://bugs.winehq.org/attachment.cgi?id=52494 enumdevices-results.tar.gz
https://bugs.winehq.org/show_bug.cgi?id=19153
--- Comment #23 from Andrew D'Addesio [email protected] --- I installed Windows 98SE on my spare PC (with a Radeon Xpress 200 chipset) and ran the tool for three versions of DirectX: * The stock DirectX: 6.1a, 4.06.03.0518, 1999-04-23 * DirectX 7.0, 4.07.00.0716, 1999-09-09 * DirectX 8.1, 4.08.01.0881, 2001-10-30
For each version of DirectX, I ran the tool with and without the "EnumReference" and "EnumNullDevice" registry settings.
The results are: * (IDirect3D 1&2 only) "Ramp Emulation" * (All interfaces) "RGB Emulation" * (All interfaces) "Direct3D HAL" (requires driver support) * (IDirect3D 2 only) "MMX Emulation" * (All interfaces) "Reference Rasterizer" (DX 6-8 only and requires "EnumReference" with nonzero value, briefly mentioned in KB249579) * (All interfaces) "Null device" (DX 6-8 only and requires "EnumNullDevice" with nonzero value, mentioned in DX 6&7 SDKs) * (IDirect3D 7 only) "Direct3D T&L HAL" (DX 7+ and requires driver support)
It appears that DirectX 9 and onwards no longer recognize the "EnumReference" and "EnumNullDevice" settings as I wasn't able to get these devices to show up in Windows XP SP3 (32-bit) on the same machine.
So we would like to add support for these games: * Resident Evil * Carmageddon 2 demo * The Sims Online
without breaking these games: * Moto Racer 2 * Aliens versus Predator * GTA 2 * Rollcage * Donald Duck: Goin' Quackers
The current comments in d3d3_EnumDevices present these issues: a. Motoracer 2 depends on the device names being in writable memory. b. AvP / Motoracer 2 (both Direct3D1 games) break if the reference rasterizer is enumerated. c. GTA 2 (presumably Direct3D3) depends on the HEL device being the first enumerated device and the HAL device being the second enumerated device. d. Rollcage (Direct3D2) tells which is the HAL device and which is the HEL device solely by looking at hal_desc and hel_desc. When it receives a device, it knows that it's looking at the correct device description (hal_desc on the HAL device or hel_desc on the HEL device) if and only if the "Power-of-2 textures only" limitation is set. Once it's looking at the correct description, it discards all devices which have the "perspective correction" flag (presumably) set. e. Donald Duck: Goin' Quackers identifies the devices by the names "Direct3D HAL" and (presumably) "Direct3D HEL".
So, I downloaded the Moto Racer 2 Demo: http://download.cnet.com/Moto-Racer-2-updated-demo/3000-2115_4-10025083.html
I verified that the game installs and runs in Wine 1.7.51-git on Linux (Fedora 22).
### Issue a
I have personally verified issue a: If you replace the instances of "device_name" with string literals, the game demo segfaults immediately upon start (eip=00424875). I undid my change and the game resumed working.
### Issue b
I then replaced "if (ddraw->d3dversion != 1)" with "if (1)" in order to enumerate the HEL device and changed all of the TRACE messages to FIXMEs so that they would appear in the terminal. Even with this change, the game still works for me; here is the output:
fixme:ddraw:d3d1_EnumDevices iface 0x133da4, callback 0x424814, context (nil). fixme:ddraw:d3d3_EnumDevices iface 0x133d9c, callback 0x424814, context (nil). fixme:ddraw:d3d3_EnumDevices Enumerating WineD3D D3DDevice interface. fixme:ddraw:d3d3_EnumDevices Enumerating HAL Direct3D device. fixme:ddraw:d3d3_EnumDevices End of enumeration.
Changing "Direct3D HEL" to "RGB Emulation" has no effect; in fact, renaming both devices to "foo"/"bar" has no effect. So, I thought, "maybe it breaks on one of the other HEL IIDs."
Currently, ddraw.c says this:
/* Do I have to enumerate the reference id? Note from old d3d7: * "It seems that enumerating the reference IID on Direct3D 1 games * (AvP / Motoracer2) breaks them". So do not enumerate this iid in V1
It turns out that the mentioned comment was created way back in May 2003:
https://www.winehq.org/pipermail/wine-patches/2003-May/006228.html http://cvs.winehq.org/cvsweb/wine/dlls/ddraw/d3ddevice/Attic/mesa.c?rev=1.96...
- if (version > 1) {
/* It seems that enumerating the reference IID on Direct3D 1 games (AvP / Motoracer2) breaks them */
TRACE(" enumerating OpenGL D3DDevice interface using reference IID (IID %s).\n", debugstr_guid(&IID_IDirect3DRefDevice));
d1 = dref;
d2 = dref;
ret_value = cb((LPIID) &IID_IDirect3DRefDevice, "WINE Reference Direct3DX using OpenGL", device_name, &d1, &d2, context);
if (ret_value != D3DENUMRET_OK)
return ret_value;
- }
If the D3D version is not 1, then enumerate IID_IDirect3DRefDevice.
Yet, the present code does this:
/* Do I have to enumerate the reference id? Note from old d3d7: * "It seems that enumerating the reference IID on Direct3D 1 games * (AvP / Motoracer2) breaks them". So do not enumerate this iid in V1 * ... */ if (ddraw->d3dversion != 1) { /* ... */ hr = callback((GUID *)&IID_IDirect3DRGBDevice, reference_description, device_name, &hal_desc, &hel_desc, context);
If the D3D version is not 1, then enumerate IID_IDirect3DRGBDevice.
So I replaced IID_IDirect3DRGBDevice with IID_IDirect3DRefDevice, but oddly the game still works. Really, I can't get this game to *not* work.
I haven't tested Aliens versus Predator; it may or may not break on IID_IDirect3DRefDevice; but (at least until I test) I have no reason to suspect it would break on IID_IDirect3DRGBDevice.
### Issue c
I don't have GTA 2 but it's possible that it uses Direct3D3, so that the first device is the RGB device and the second device is the HAL device. In that case, issue c is consistent with the Windows behavior.
### Issue d
I installed Rollcage (first unpatched from the CD and, later, the 1.0b patch). This was the most interesting game to test.
The following comment is no longer accurate:
* Other games (Rollcage) tell emulation and hal device apart by certain * flags. Rollcage expects D3DPTEXTURECAPS_POW2 to be set (yeah, it is a * limitation flag), and it refuses all devices that have the perspective * flag set. This way it refuses the emulation device, and HAL devices * never have POW2 unset in d3d7 on windows. */
There is a mistake in the comment: it refuses all devices that have the perspective flag unset* (not set). When I ORed the flag into hal_desc and hel_desc:
hal_desc.dpcLineCaps.dwTextureCaps |= D3DPTEXTURECAPS_PERSPECTIVE; hal_desc.dpcTriCaps.dwTextureCaps |= D3DPTEXTURECAPS_PERSPECTIVE; hel_desc.dpcLineCaps.dwTextureCaps |= D3DPTEXTURECAPS_PERSPECTIVE; hel_desc.dpcTriCaps.dwTextureCaps |= D3DPTEXTURECAPS_PERSPECTIVE;
the game still worked; when I masked it out instead:
hal_desc.dpcLineCaps.dwTextureCaps &= ~D3DPTEXTURECAPS_PERSPECTIVE; hal_desc.dpcTriCaps.dwTextureCaps &= ~D3DPTEXTURECAPS_PERSPECTIVE; hel_desc.dpcLineCaps.dwTextureCaps &= ~D3DPTEXTURECAPS_PERSPECTIVE; hel_desc.dpcTriCaps.dwTextureCaps &= ~D3DPTEXTURECAPS_PERSPECTIVE;
the game stopped working (it immediately exits after the intro movie). In fact, the original patch to fix EnumDevices mentions this:
http://marc.info/?l=wine-patches&m=117870468623214&w=2
The other flag is D3DPTEXTURECAPS_PERSPECTIVE which is not set on rgb emulation(!= refrast). Rollcage uses this flag to tell rgb emulation from hal.
Thus, it refuses all devices which have D3DPTEXTURECAPS_PERSPECTIVE unset.
Additionally, this comment is no longer accurate:
HAL devices never have POW2 unset in d3d7 on windows.
On my Windows 7 install, the HAL device's hal_desc (D3D1-3) or desc (D3D7) always has D3DPTEXTURECAPS_POW2 and D3DPTEXTURECAPS_NONPOW2CONDITIONAL both unset (which means that "unconditional support is provided for 2D textures with dimensions that are not powers of two" according to MSDN's D3DCAPS9 article).
But it looks like that doesn't matter; I masked out these flags in hal_desc and hel_desc and the game still worked. (The game also works if you OR in one of the flags and mask out the other, or OR in both flags.)
Using a debugger, I found that the game does the following in its callback function (0041D280 in the unpatched version, 0041d250 in version 1.0b) for IDirect3D3::EnumDevices:
- Let ptr = hal_desc.
- If ptr->dcmColorModel == 0, then change ptr to hel_desc.
- If ptr->dwDeviceRenderBitDepth does not contain DDBD(selected_bit_depth), return DDENUMRET_OK (request the next device).
- If ptr->dcmColorModel is odd (this corresponds to D3DCOLOR_MONO) and ptr->dpcTriCaps.dwShadeCaps does not contain D3DPSHADECAPS_COLORGOURAUDMONO, return DDENUMRET_OK.
- If ptr->dcmColorModel is even (this corresponds to D3DCOLOR_RGB) and ptr->dpcTriCaps.dwShadeCaps does not contain D3DPSHADECAPS_COLORGOURAUDRGB, return DDENUMRET_OK.
- If ptr->dpcTriCaps.dwTextureCaps does not contain D3DPTEXTURECAPS_PERSPECTIVE, return DDENUMRET_OK.
- If we have made it to this point, this is a good device.
Upon this quick examination there is no reference to the POW2 flags that I can see, and for me the game still works if the flags are masked out, so I believe we can stop adding the POW2 flags in EnumDevices.
### Issue e
I was unable to get a device named "Direct3D HEL" in DirectX 6.1a, 7.0, 8.1, or later versions, thus I believe we should change "Direct3D HEL" to "RGB Emulation".
---
In short, we want: * d3d1: ramp rgb (hal )? (ref )? (null )? * d3d2: ramp rgb (hal )? mmx (ref )? (null )? * d3d3: rgb (hal )? (ref )? (null )? * d3d7: rgb (hal )? (ref )? (null )? (tnlhal )?
with the correct names ("Ramp Emulation", "RGB Emulation", and so on), and we want the non-matching description of each device (hel_desc on the HAL device or hal_desc on the other devices) to be empty (or almost empty for the HAL device's hel_desc).
I have submitted a patchset so that Wine conforms to this behavior: https://www.winehq.org/pipermail/wine-patches/2015-October/142721.html
The patchset fixes Resident Evil 1 and at least knocks off one of the bugs in The Sims Online trial. Carmageddon 2 demo is actually affected by an issue in FindDevice (FindDevice should accept dwSizes 0xac, 0xcc, and 0xfc in D3DDEVICEDESC); this is also fixed in the patchset.
https://bugs.winehq.org/show_bug.cgi?id=19153
Adam Bolte [email protected] changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected]
https://bugs.winehq.org/show_bug.cgi?id=19153
Anastasius Focht [email protected] changed:
What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.winehq.org/sho | |w_bug.cgi?id=1201
https://bugs.winehq.org/show_bug.cgi?id=19153
--- Comment #24 from WineBuG [email protected] --- Would it be possible to incorporate Andrew D'Addesio's patchset into Wine Staging? Or does it still need some work?
https://bugs.winehq.org/show_bug.cgi?id=19153
--- Comment #25 from Andrew D'Addesio [email protected] --- Definitely needs some work, but not much. Most of the issues were style-related; I also need to migrate some tests from tests/d3d.c over to tests/ddraw(1|2|3|7).c; and I'd love to add some more useful comments to my code. I'm a bit busy now with a winter mini-mester class but I'll be able to hopefully fix up the patch in 2 weeks. Thanks for reminding me. :)
Andrew
https://bugs.winehq.org/show_bug.cgi?id=19153
--- Comment #26 from WineBuG [email protected] --- (In reply to Andrew D'Addesio from comment #25)
[...] Thanks for reminding me. :)
Andrew
You're welcome. :) You may also want to check these bugs related to GPU adapters and GPU capabilities detection:
Bug 1201
Bug 6946 (does not seem to affect the demo)
Bug 12941
Bug 22268
Bug 27243
Bug 37019
AFAIK these games don't work in hardware mode either:
Metal Gear Solid 1 demo (http://web.archive.org/web/20161225005355/http://download.fileplanet.com/ftp...)
Resident Evil 2 demo (https://web.archive.org/web/20161225013011/http://download.fileplanet.com/ft...)
Gorky 17 (aka Odium) demo (http://archive.org/download/Odi-umakaGorky17Demo/ODIUM.EXE)
https://bugs.winehq.org/show_bug.cgi?id=19153
--- Comment #27 from WineBuG [email protected] --- @Andrew D'Addesio Any updates?
https://bugs.winehq.org/show_bug.cgi?id=19153
WineBuG [email protected] changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected]
https://bugs.winehq.org/show_bug.cgi?id=19153
Vincent Grande [email protected] changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected]
--- Comment #28 from Vincent Grande [email protected] --- Please fix this bug. I really want to play Resident Evil 1 and 2.
This was the first game I installed and tried to play with Wine. What a shame.
https://bugs.winehq.org/show_bug.cgi?id=19153
Fabian Maurer [email protected] changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected]
--- Comment #29 from Fabian Maurer [email protected] --- Is there a demo for this program available?
https://bugs.winehq.org/show_bug.cgi?id=19153
--- Comment #30 from Vincent Grande [email protected] --- Here's a demo for Resident Evil 2, which has the exact same issue.
https://www.fileplanet.com/11008/10000/fileinfo/Resident-Evil-2-Demo
https://bugs.winehq.org/show_bug.cgi?id=19153
--- Comment #31 from Fabian Maurer [email protected] --- Thanks, can reproduce the issue, and initial bug reporter workaround still fixes it.
Did I miss something or don't we have test-cases for this yet? We'd probably want them so we don't break any of the mentioned games when fixing this issue.
https://bugs.winehq.org/show_bug.cgi?id=19153
--- Comment #32 from Vincent Grande [email protected] --- Thank you good sir for giving this issue attention. I've been wanting to play Resident Evil with much anticipation
https://bugs.winehq.org/show_bug.cgi?id=19153
--- Comment #33 from joaopa [email protected] --- Unfortunately, this pretty well documented bug is still present with wine-4.0-rc6.
https://bugs.winehq.org/show_bug.cgi?id=19153
--- Comment #34 from joaopa [email protected] --- Created attachment 63503 --> https://bugs.winehq.org/attachment.cgi?id=63503 rebased patches
Bug is still there with wine-4.1. I updated Alesio's patch.
https://bugs.winehq.org/show_bug.cgi?id=19153
Alistair Leslie-Hughes [email protected] changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch
https://bugs.winehq.org/show_bug.cgi?id=19153
Alistair Leslie-Hughes [email protected] changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |STAGED CC| |[email protected] Staged patchset| |https://github.com/wine-sta | |ging/wine-staging/tree/mast | |er/patches/ddraw-version-ch | |eck
https://bugs.winehq.org/show_bug.cgi?id=19153
--- Comment #35 from joaopa [email protected] --- Created attachment 65435 --> https://bugs.winehq.org/attachment.cgi?id=65435 Test for enumdevices
I ported enumdevices tests to the different ddraw.c files and extended them. I discovered that Andrew's last patch is not totally correct. Hope to provide a correct (and maybe commitable in wine) patch soon.
https://bugs.winehq.org/show_bug.cgi?id=19153
--- Comment #36 from joaopa [email protected] --- Comment on attachment 65435 --> https://bugs.winehq.org/attachment.cgi?id=65435 Test for enumdevices
From 4b3480a405db9f7be4cddbfffad86b2538b84574 Mon Sep 17 00:00:00 2001 From: David Adam [email protected] Date: Fri, 11 Oct 2019 21:03:26 -1000 Subject:ddraw: Port Enumdevices tests to ddraw*.c and extent them
dlls/ddraw/tests/ddraw1.c | 143 +++++++++++++++++++++++++++++++++++++ dlls/ddraw/tests/ddraw2.c | 145 ++++++++++++++++++++++++++++++++++++++ dlls/ddraw/tests/ddraw4.c | 145 ++++++++++++++++++++++++++++++++++++++ dlls/ddraw/tests/ddraw7.c | 116 ++++++++++++++++++++++++++++++ 4 files changed, 549 insertions(+)
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c old mode 100644 new mode 100755 index a23e76e1f7..8b9773d5a3 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -49,6 +49,11 @@ struct create_window_thread_param HANDLE thread; };
+typedef struct {
- HRESULT desired_ret;
- int total;
+} D3D1ECancelTest;
static BOOL compare_color(D3DCOLOR c1, D3DCOLOR c2, BYTE max_diff) { if (abs((c1 & 0xff) - (c2 & 0xff)) > max_diff) return FALSE; @@ -13065,6 +13070,143 @@ static void test_d32_support(void) DestroyWindow(window); }
+static HRESULT WINAPI enumDevicesCallback(GUID *Guid, char *DeviceDescription,
char *DeviceName, D3DDEVICEDESC *hal, D3DDEVICEDESC *hel, void *ctx)
+{
- UINT i;
- UINT *number_devices = (UINT *)ctx;
- char name[][20] =
{"Ramp Emulation", "RGB Emulation", "Direct3D HAL", "MMX Emulation", "Reference Rasterizer", "Null device", "Direct3D T&L HAL"};
- struct
- {
GUID guid;
DWORD hal_line_pow2;
DWORD hal_tri_pow2;
DWORD hal_line_nonpow2cond;
DWORD hal_tri_nonpow2cond;
D3DCOLORMODEL hal_colormodel;
BOOL hal_dwFlags;
DWORD size;
- } test_device_hal[]=
- {
{IID_IDirect3DRampDevice, 0, 0, 0, 0, 0, 0, 0xac},
{IID_IDirect3DRGBDevice, 0, 0, 0, 0, 0, 0, 0xac},
{IID_IDirect3DHALDevice, 0, 0, 0, 0, D3DCOLOR_RGB, 1, 0xac},
{IID_IDirect3DRefDevice, 0, 0, 0, 0, D3DCOLOR_RGB, 1, 0xac},
{IID_IDirect3DNullDevice, 0, 0, 0, 0, D3DCOLOR_RGB, 1, 0xac},
{IID_IDirect3DTnLHalDevice, 0, 0, 0, 0, D3DCOLOR_RGB, 1, 0xac}
- };
- struct
- {
DWORD hel_line_pow2;
DWORD hel_tri_pow2;
DWORD hel_line_nonpow2cond;
DWORD hel_tri_nonpow2cond;
D3DCOLORMODEL hel_colormodel;
BOOL hel_dwFlags;
DWORD size;
- } test_device_hel[]=
- {
{0x2, 0x2, 0, 0, D3DCOLOR_MONO, 1, 0xac},
{0x2, 0x2, 0, 0, D3DCOLOR_RGB, 1, 0xac},
{0, 0, 0, 0, 0, 1, 0xac},
{0, 0, 0xff, 0xff, D3DCOLOR_RGB, 1, 0xac},
{0, 0, 0xff, 0xff, 0, 1, 0xac},
{0, 0, 0xff, 0xff, 1, D3DCOLOR_RGB, 0xac}
- };
- i = 0;
- while((!IsEqualGUID(&test_device_hal[i].guid, Guid)) && (i < ARRAY_SIZE(name)))
i++;
- ok(!strcmp(DeviceName, name[i]), "Test %d, wrong device name\n", i);
- number_devices[i]++;
- ok((hal->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2) == test_device_hal[i].hal_line_pow2,
"Test %d, hal line caps has a wrong D3DPTEXTURECAPS_POW2 flag\n", i);
- ok((hal->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2) == test_device_hal[i].hal_tri_pow2,
"Test %d, hal tri caps has a wrong D3DPTEXTURECAPS_POW2 flag\n", i);
- ok((hal->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL) == test_device_hal[i].hal_line_nonpow2cond,
"Test %d, hal line caps has a wrong D3DPTEXTURECAPS_NONPOW2CONDITIONAL flag\n", i);
- ok((hal->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL) == test_device_hal[i].hal_tri_nonpow2cond,
"Test %d, hal tri caps has a wrong D3DPTEXTURECAPS_NONPOW2CONDITIONAL flag\n", i);
- ok(!!hal->dwFlags == test_device_hal[i].hal_dwFlags, "Test %d, hal device hal caps has a wrong hardware flag %x\n", i, hal->dwFlags);
- ok(hal->dcmColorModel == test_device_hal[i].hal_colormodel, "Test %d, hal caps has a wrong colormodel %u\n", i, hal->dcmColorModel);
- ok(hal->dwSize == test_device_hal[i].size, "Test %d, hal has a wrong size %u instead of %u\n", i, hal->dwSize, test_device_hal[i].size);
- ok((hel->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2) == test_device_hel[i].hel_line_pow2,
"Test %d, hel line caps has a wrong D3DPTEXTURECAPS_POW2 flag\n", i);
- ok((hel->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2) == test_device_hel[i].hel_tri_pow2,
"Test %d, hel tri caps has a wrong D3DPTEXTURECAPS_POW2 flag\n", i);
- ok((hel->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL) == test_device_hel[i].hel_line_nonpow2cond,
"Test %d, hel line caps has a wrong D3DPTEXTURECAPS_NONPOW2CONDITIONAL flag\n", i);
- ok((hel->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL) == test_device_hel[i].hel_tri_nonpow2cond,
"Test %d, hel tri caps has a wrong D3DPTEXTURECAPS_NONPOW2CONDITIONAL flag\n", i);
- ok(!!hel->dwFlags == test_device_hel[i].hel_dwFlags, "Test %d, hel device hel caps has a wrong hardware flag %x\n", i, hel->dwFlags);
- ok(hel->dcmColorModel == test_device_hel[i].hel_colormodel, "Test %d, hel caps has a wrong colormodel %u\n", i, hel->dcmColorModel);
- ok(hel->dwSize == test_device_hel[i].size, "Test %d, hel has a wrong size %u instead of %u\n", i, hel->dwSize, test_device_hel[i].size);
- return DDENUMRET_OK;
+}
+static HRESULT WINAPI enumDevicesCancelTest(GUID *Guid, char *DeviceDescription,
char *DeviceName, D3DDEVICEDESC *hal, D3DDEVICEDESC *hel, void *ctx)
+{
- D3D1ECancelTest *d3d1et = ctx;
- d3d1et->total++;
- return d3d1et->desired_ret;
+}
+void test_enum_device(void) +{
- BOOL enumerated[] = {1, 1, 1, 0, 0, 1, 0};
- D3D1ECancelTest d3d1_cancel_test;
- IDirectDraw *ddraw;
- IDirect3D *d3d;
- HRESULT hr;
- UINT nb_devices[] = {0, 0, 0, 0, 0, 0, 0};
- UINT i;
- ddraw = create_ddraw();
- ok(!!ddraw, "Failed to create a ddraw object.\n");
- hr = IDirectDraw_QueryInterface(ddraw, &IID_IDirect3D, (void **)&d3d);
- ok(hr == DD_OK, "Failed to get d3d interface, hr %#x.\n", hr);
- hr = IDirect3D_EnumDevices(d3d, NULL, NULL);
- ok(hr == DDERR_INVALIDPARAMS, "IDirect3D3_EnumDevices returned 0x%08x\n", hr);
- hr = IDirect3D_EnumDevices(d3d, enumDevicesCallback, &nb_devices);
- ok(hr == DD_OK, "IDirect3D3_EnumDevices returned 0x%08x\n", hr);
- for(i = 0; i < ARRAY_SIZE(enumerated); i++)
ok(nb_devices[i] == !enumerated[i], "device %d should not be enumerated in ddraw 1\n", i);
- /* RGB device should always be enumerated */
- ok(nb_devices[1], "No RGB Device enumerated.\n");
- d3d1_cancel_test.desired_ret = DDENUMRET_CANCEL;
- d3d1_cancel_test.total = 0;
- hr = IDirect3D_EnumDevices(d3d, enumDevicesCancelTest, &d3d1_cancel_test);
- ok(hr == D3D_OK, "IDirect3D_EnumDevices returned 0x%08x\n", hr);
- ok(d3d1_cancel_test.total == 1, "Enumerated a total of %u devices\n",
d3d1_cancel_test.total);
- /* An enumeration callback can return any value besides DDENUMRET_OK to stop enumeration. */
- d3d1_cancel_test.desired_ret = E_INVALIDARG;
- d3d1_cancel_test.total = 0;
- hr = IDirect3D_EnumDevices(d3d, enumDevicesCancelTest, &d3d1_cancel_test);
- ok(hr == D3D_OK, "IDirect3D_EnumDevices returned 0x%08x\n", hr);
- ok(d3d1_cancel_test.total == 1, "Enumerated a total of %u devices\n",
d3d1_cancel_test.total);
- IDirect3D_Release(d3d);
- IDirectDraw_Release(ddraw);
- return;
+}
START_TEST(ddraw1) { DDDEVICEIDENTIFIER identifier; @@ -13177,4 +13319,5 @@ START_TEST(ddraw1) test_clipper_refcount(); test_caps(); test_d32_support();
- test_enum_device();
} diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c old mode 100644 new mode 100755 index 2156bd5849..8d171ce7fa --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -50,6 +50,11 @@ struct create_window_thread_param HANDLE thread; };
+typedef struct {
- HRESULT desired_ret;
- int total;
+} D3D2ECancelTest;
static BOOL compare_color(D3DCOLOR c1, D3DCOLOR c2, BYTE max_diff) { if (abs((c1 & 0xff) - (c2 & 0xff)) > max_diff) return FALSE; @@ -13949,6 +13954,145 @@ static void test_d32_support(void) DestroyWindow(window); }
+static HRESULT WINAPI enumDevicesCallback(GUID *Guid, char *DeviceDescription,
char *DeviceName, D3DDEVICEDESC *hal, D3DDEVICEDESC *hel, void *ctx)
+{
- UINT i;
- UINT *number_devices = (UINT *)ctx;
- char name[][20] =
{"Ramp Emulation", "RGB Emulation", "Direct3D HAL", "MMX Emulation", "Reference Rasterizer", "Null device", "Direct3D T&L HAL"};
- struct
- {
GUID guid;
DWORD hal_line_pow2;
DWORD hal_tri_pow2;
DWORD hal_line_nonpow2cond;
DWORD hal_tri_nonpow2cond;
D3DCOLORMODEL hal_colormodel;
BOOL hal_dwFlags;
DWORD size;
- } test_device_hal[]=
- {
{IID_IDirect3DRampDevice, 0, 0, 0, 0, 0, 0, 0xcc},
{IID_IDirect3DRGBDevice, 0, 0, 0, 0, 0, 0, 0xcc},
{IID_IDirect3DHALDevice, 0, 0, 0, 0, D3DCOLOR_RGB, 1, 0xcc},
{IID_IDirect3DMMXDevice, 0, 0, 0, 0, 0, 0, 0xcc},
{IID_IDirect3DRefDevice, 0, 0, 0, 0, D3DCOLOR_RGB, 1, 0xcc},
{IID_IDirect3DNullDevice, 0, 0, 0, 0, D3DCOLOR_RGB, 1, 0xcc},
{IID_IDirect3DTnLHalDevice, 0, 0, 0, 0, D3DCOLOR_RGB, 1, 0xcc}
- };
- struct
- {
DWORD hel_line_pow2;
DWORD hel_tri_pow2;
DWORD hel_line_nonpow2cond;
DWORD hel_tri_nonpow2cond;
D3DCOLORMODEL hel_colormodel;
BOOL hel_dwFlags;
DWORD size;
- } test_device_hel[]=
- {
{0x2, 0x2, 0, 0, D3DCOLOR_MONO, 1, 0xcc},
{0x2, 0x2, 0, 0, D3DCOLOR_RGB, 1, 0xcc},
{0, 0, 0, 0, 0, 1, 0xcc},
{0x2, 0x2, 0, 0, D3DCOLOR_RGB, 1, 0xcc},
{0, 0, 0xff, 0xff, 0, 1, 0xcc},
{0, 0, 0xff, 0xff, 0, 1, 0xcc},
{0, 0, 0xff, 0xff, 1, D3DCOLOR_RGB, 0xcc}
- };
- i = 0;
- while((!IsEqualGUID(&test_device_hal[i].guid, Guid)) && (i < ARRAY_SIZE(name)))
i++;
- ok(!strcmp(DeviceName, name[i]), "Test %d, wrong device name\n", i);
- number_devices[i]++;
- ok((hal->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2) == test_device_hal[i].hal_line_pow2,
"Test %d, hal line caps has a wrong D3DPTEXTURECAPS_POW2 flag\n", i);
- ok((hal->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2) == test_device_hal[i].hal_tri_pow2,
"Test %d, hal tri caps has a wrong D3DPTEXTURECAPS_POW2 flag\n", i);
- ok((hal->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL) == test_device_hal[i].hal_line_nonpow2cond,
"Test %d, hal line caps has a wrong D3DPTEXTURECAPS_NONPOW2CONDITIONAL flag\n", i);
- ok((hal->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL) == test_device_hal[i].hal_tri_nonpow2cond,
"Test %d, hal tri caps has a wrong D3DPTEXTURECAPS_NONPOW2CONDITIONAL flag\n", i);
- ok(!!hal->dwFlags == test_device_hal[i].hal_dwFlags, "Test %d, hal device hal caps has a wrong hardware flag %x\n", i, hal->dwFlags);
- ok(hal->dcmColorModel == test_device_hal[i].hal_colormodel, "Test %d, hal caps has a wrong colormodel %u\n", i, hal->dcmColorModel);
- ok(hal->dwSize == test_device_hal[i].size, "Test %d, hal has a wrong size %u instead of %u\n", i, hal->dwSize, test_device_hal[i].size);
- ok((hel->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2) == test_device_hel[i].hel_line_pow2,
"Test %d, hel line caps has a wrong D3DPTEXTURECAPS_POW2 flag\n", i);
- ok((hel->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2) == test_device_hel[i].hel_tri_pow2,
"Test %d, hel tri caps has a wrong D3DPTEXTURECAPS_POW2 flag\n", i);
- ok((hel->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL) == test_device_hel[i].hel_line_nonpow2cond,
"Test %d, hel line caps has a wrong D3DPTEXTURECAPS_NONPOW2CONDITIONAL flag\n", i);
- ok((hel->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL) == test_device_hel[i].hel_tri_nonpow2cond,
"Test %d, hel tri caps has a wrong D3DPTEXTURECAPS_NONPOW2CONDITIONAL flag\n", i);
- ok(!!hel->dwFlags == test_device_hel[i].hel_dwFlags, "Test %d, hel device hel caps has a wrong hardware flag %x\n", i, hel->dwFlags);
- ok(hel->dcmColorModel == test_device_hel[i].hel_colormodel, "Test %d, hel caps has a wrong colormodel %u\n", i, hel->dcmColorModel);
- ok(hel->dwSize == test_device_hel[i].size, "Test %d, hel has a wrong size %u instead of %u\n", i, hel->dwSize, test_device_hel[i].size);
- return DDENUMRET_OK;
+}
+static HRESULT WINAPI enumDevicesCancelTest(GUID *Guid, char *DeviceDescription,
char *DeviceName, D3DDEVICEDESC *hal, D3DDEVICEDESC *hel, void *ctx)
+{
- D3D2ECancelTest *d3d2et = ctx;
- d3d2et->total++;
- return d3d2et->desired_ret;
+}
+static void test_enum_device(void) +{
- BOOL enumerated[] = {1, 1, 1, 1, 0, 1, 0};
- D3D2ECancelTest d3d2_cancel_test;
- IDirectDraw2 *ddraw;
- IDirect3D2 *d3d2;
- HRESULT hr;
- UINT nb_devices[] = {0, 0, 0, 0, 0, 0, 0};
- UINT i;
- ddraw = create_ddraw();
- ok(!!ddraw, "Failed to create a ddraw object.\n");
- hr = IDirectDraw2_QueryInterface(ddraw, &IID_IDirect3D2, (void **)&d3d2);
- ok(hr == DD_OK, "Failed to get d3d interface, hr %#x.\n", hr);
- hr = IDirect3D2_EnumDevices(d3d2, NULL, NULL);
- ok(hr == DDERR_INVALIDPARAMS, "IDirect3D2_EnumDevices returned 0x%08x\n", hr);
- hr = IDirect3D2_EnumDevices(d3d2, enumDevicesCallback, &nb_devices);
- ok(hr == DD_OK, "IDirect3D2_EnumDevices returned 0x%08x\n", hr);
- for(i = 0; i < ARRAY_SIZE(enumerated); i++)
ok(nb_devices[i] == !enumerated[i], "device %u should not be enumerated in ddraw 2\n", i);
- /* RGB device should always be enumerated */
- ok(nb_devices[1], "No RGB Device enumerated.\n");
- d3d2_cancel_test.desired_ret = DDENUMRET_CANCEL;
- d3d2_cancel_test.total = 0;
- hr = IDirect3D2_EnumDevices(d3d2, enumDevicesCancelTest, &d3d2_cancel_test);
- ok(hr == D3D_OK, "IDirect3D_EnumDevices returned 0x%08x\n", hr);
- ok(d3d2_cancel_test.total == 1, "Enumerated a total of %u devices\n",
d3d2_cancel_test.total);
- /* An enumeration callback can return any value besides DDENUMRET_OK to stop enumeration. */
- d3d2_cancel_test.desired_ret = E_INVALIDARG;
- d3d2_cancel_test.total = 0;
- hr = IDirect3D2_EnumDevices(d3d2, enumDevicesCancelTest, &d3d2_cancel_test);
- ok(hr == D3D_OK, "IDirect3D_EnumDevices returned 0x%08x\n", hr);
- ok(d3d2_cancel_test.total == 1, "Enumerated a total of %u devices\n",
d3d2_cancel_test.total);
- IDirect3D2_Release(d3d2);
- IDirectDraw2_Release(ddraw);
- return;
+}
START_TEST(ddraw2) { DDDEVICEIDENTIFIER identifier; @@ -14068,4 +14212,5 @@ START_TEST(ddraw2) test_clipper_refcount(); test_caps(); test_d32_support();
- test_enum_device();
} diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c old mode 100644 new mode 100755 index fdcf6dff87..ab0e19b739 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -56,6 +56,11 @@ struct create_window_thread_param HANDLE thread; };
+typedef struct {
- HRESULT desired_ret;
- int total;
+} D3D4ECancelTest;
static BOOL compare_float(float f, float g, unsigned int ulps) { int x = *(int *)&f; @@ -16504,6 +16509,145 @@ static void test_d32_support(void) DestroyWindow(window); }
+static HRESULT WINAPI enumDevicesCallback(GUID *Guid, char *DeviceDescription,
char *DeviceName, D3DDEVICEDESC *hal, D3DDEVICEDESC *hel, void *ctx)
+{
- UINT i;
- UINT *number_devices = (UINT *)ctx;
- char name[][20] =
{"Ramp Emulation", "RGB Emulation", "Direct3D HAL", "MMX Emulation", "Reference Rasterizer", "Null device", "Direct3D T&L HAL"};
- struct
- {
GUID guid;
DWORD hal_line_pow2;
DWORD hal_tri_pow2;
DWORD hal_line_nonpow2cond;
DWORD hal_tri_nonpow2cond;
D3DCOLORMODEL hal_colormodel;
BOOL hal_dwFlags;
DWORD size;
- } test_device_hal[]=
- {
{IID_IDirect3DRampDevice, 0, 0, 0, 0, 0, 0, 0xfc},
{IID_IDirect3DRGBDevice, 0, 0, 0, 0, 0, 0, 0xfc},
{IID_IDirect3DHALDevice, 0, 0, 0, 0, D3DCOLOR_RGB, 1, 0xfc},
{IID_IDirect3DMMXDevice, 0, 0, 0, 0, 0, 0, 0xfc},
{IID_IDirect3DRefDevice, 0, 0, 0, 0, D3DCOLOR_RGB, 1, 0xfc},
{IID_IDirect3DNullDevice, 0, 0, 0, 0, D3DCOLOR_RGB, 1, 0xfc},
{IID_IDirect3DTnLHalDevice, 0, 0, 0, 0, D3DCOLOR_RGB, 1, 0xfc}
- };
- struct
- {
DWORD hel_line_pow2;
DWORD hel_tri_pow2;
DWORD hel_line_nonpow2cond;
DWORD hel_tri_nonpow2cond;
D3DCOLORMODEL hel_colormodel;
BOOL hel_dwFlags;
DWORD size;
- } test_device_hel[]=
- {
{0x2, 0x2, 0, 0, D3DCOLOR_MONO, 1, 0xfc},
{0x2, 0x2, 0, 0, D3DCOLOR_RGB, 1, 0xfc},
{0, 0, 0, 0, 0, 1, 0xfc},
{0, 0, 0xff, 0xff, D3DCOLOR_RGB, 1, 0xfc},
{0, 0, 0xff, 0xff, 0, 1, 0xfc},
{0, 0, 0xff, 0xff, 0, 1, 0xfc},
{0, 0, 0xff, 0xff, 1, D3DCOLOR_RGB, 0xfc}
- };
- i = 0;
- while((!IsEqualGUID(&test_device_hal[i].guid, Guid)) && (i < ARRAY_SIZE(name)))
i++;
- ok(!strcmp(DeviceName, name[i]), "Test %d, wrong device name\n", i);
- number_devices[i]++;
- ok((hal->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2) == test_device_hal[i].hal_line_pow2,
"Test %d, hal line caps has a wrong D3DPTEXTURECAPS_POW2 flag\n", i);
- ok((hal->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2) == test_device_hal[i].hal_tri_pow2,
"Test %d, hal tri caps has a wrong D3DPTEXTURECAPS_POW2 flag\n", i);
- ok((hal->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL) == test_device_hal[i].hal_line_nonpow2cond,
"Test %d, hal line caps has a wrong D3DPTEXTURECAPS_NONPOW2CONDITIONAL flag\n", i);
- ok((hal->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL) == test_device_hal[i].hal_tri_nonpow2cond,
"Test %d, hal tri caps has a wrong D3DPTEXTURECAPS_NONPOW2CONDITIONAL flag\n", i);
- ok(!!hal->dwFlags == test_device_hal[i].hal_dwFlags, "Test %d, hal device hal caps has a wrong hardware flag %x\n", i, hal->dwFlags);
- ok(hal->dcmColorModel == test_device_hal[i].hal_colormodel, "Test %d, hal caps has a wrong colormodel %u\n", i, hal->dcmColorModel);
- ok(hal->dwSize == test_device_hal[i].size, "Test %d, hal has a wrong size %u instead of %u\n", i, hal->dwSize, test_device_hal[i].size);
- ok((hel->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2) == test_device_hel[i].hel_line_pow2,
"Test %d, hel line caps has a wrong D3DPTEXTURECAPS_POW2 flag\n", i);
- ok((hel->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2) == test_device_hel[i].hel_tri_pow2,
"Test %d, hel tri caps has a wrong D3DPTEXTURECAPS_POW2 flag\n", i);
- ok((hel->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL) == test_device_hel[i].hel_line_nonpow2cond,
"Test %d, hel line caps has a wrong D3DPTEXTURECAPS_NONPOW2CONDITIONAL flag\n", i);
- ok((hel->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL) == test_device_hel[i].hel_tri_nonpow2cond,
"Test %d, hel tri caps has a wrong D3DPTEXTURECAPS_NONPOW2CONDITIONAL flag\n", i);
- ok(!!hel->dwFlags == test_device_hel[i].hel_dwFlags, "Test %d, hel device hel caps has a wrong hardware flag %x\n", i, hel->dwFlags);
- ok(hel->dcmColorModel == test_device_hel[i].hel_colormodel, "Test %d, hel caps has a wrong colormodel %u\n", i, hel->dcmColorModel);
- ok(hel->dwSize == test_device_hel[i].size, "Test %d, hel has a wrong size %u instead of %u\n", i, hel->dwSize, test_device_hel[i].size);
- return DDENUMRET_OK;
+}
+static HRESULT WINAPI enumDevicesCancelTest(GUID *Guid, char *DeviceDescription,
char *DeviceName, D3DDEVICEDESC *hal, D3DDEVICEDESC *hel, void *ctx)
+{
- D3D4ECancelTest *d3d3et = ctx;
- d3d3et->total++;
- return d3d3et->desired_ret;
+}
+static void test_enum_device(void) +{
- BOOL enumerated[] = {0, 1, 1, 1, 0, 1, 0};
- D3D4ECancelTest d3d3_cancel_test;
- IDirectDraw4 *ddraw;
- IDirect3D3 *d3d3;
- HRESULT hr;
- UINT nb_devices[] = {0, 0, 0, 0, 0, 0, 0};
- UINT i;
- ddraw = create_ddraw();
- ok(!!ddraw, "Failed to create a ddraw object.\n");
- hr = IDirectDraw4_QueryInterface(ddraw, &IID_IDirect3D3, (void **)&d3d3);
- ok(hr == DD_OK, "Failed to get d3d interface, hr %#x.\n", hr);
- hr = IDirect3D3_EnumDevices(d3d3, NULL, NULL);
- ok(hr == DDERR_INVALIDPARAMS, "IDirect3D3_EnumDevices returned 0x%08x\n", hr);
- hr = IDirect3D3_EnumDevices(d3d3, enumDevicesCallback, &nb_devices);
- ok(hr == DD_OK, "IDirect3D3_EnumDevices returned 0x%08x\n", hr);
- for(i = 0; i < ARRAY_SIZE(enumerated); i++)
ok(nb_devices[i] == !enumerated[i], "device %u should not be enumerated in ddraw 4\n", i);
- /* RGB device should always be enumerated */
- ok(nb_devices[1], "No RGB Device enumerated.\n");
- d3d3_cancel_test.desired_ret = DDENUMRET_CANCEL;
- d3d3_cancel_test.total = 0;
- hr = IDirect3D3_EnumDevices(d3d3, enumDevicesCancelTest, &d3d3_cancel_test);
- ok(hr == D3D_OK, "IDirect3D_EnumDevices returned 0x%08x\n", hr);
- ok(d3d3_cancel_test.total == 1, "Enumerated a total of %u devices\n",
d3d3_cancel_test.total);
- /* An enumeration callback can return any value besides DDENUMRET_OK to stop enumeration. */
- d3d3_cancel_test.desired_ret = E_INVALIDARG;
- d3d3_cancel_test.total = 0;
- hr = IDirect3D3_EnumDevices(d3d3, enumDevicesCancelTest, &d3d3_cancel_test);
- ok(hr == D3D_OK, "IDirect3D_EnumDevices returned 0x%08x\n", hr);
- ok(d3d3_cancel_test.total == 1, "Enumerated a total of %u devices\n",
d3d3_cancel_test.total);
- IDirect3D3_Release(d3d3);
- IDirectDraw4_Release(ddraw);
- return;
+}
START_TEST(ddraw4) { DDDEVICEIDENTIFIER identifier; @@ -16638,4 +16782,5 @@ START_TEST(ddraw4) test_clipper_refcount(); test_caps(); test_d32_support();
- test_enum_device();
} diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c old mode 100644 new mode 100755 index 279263fe37..7e5fbf73bc --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -56,6 +56,11 @@ struct create_window_thread_param HANDLE thread; };
+typedef struct {
- HRESULT desired_ret;
- int total;
+} D3D7ECancelTest;
static BOOL compare_float(float f, float g, unsigned int ulps) { int x = *(int *)&f; @@ -16475,6 +16480,116 @@ static void test_d32_support(void) DestroyWindow(window); }
+static HRESULT WINAPI enumDevicesCallback(char *DeviceDescription, char *DeviceName,
D3DDEVICEDESC7 *dd7, void *ctx)
+{
- UINT i;
- UINT *number_devices = (UINT *)ctx;
- char name[][20] =
{"Ramp Emulation", "RGB Emulation", "Direct3D HAL", "MMX Emulation", "Reference Rasterizer", "Null device", "Direct3D T&L HAL"};
- struct
- {
GUID guid;
DWORD line_pow2;
DWORD tri_pow2;
DWORD line_nonpow2cond;
DWORD tri_nonpow2cond;
- } test_device[]=
- {
{IID_IDirect3DRampDevice, 0, 0, 0, 0},
{IID_IDirect3DRGBDevice, 2, 2, 0, 0},
{IID_IDirect3DHALDevice, 0, 0, 0, 0},
{IID_IDirect3DMMXDevice, 0, 0, 0, 0},
{IID_IDirect3DRefDevice, 0, 0, 0, 0},
{IID_IDirect3DNullDevice, 0, 0, 0, 0},
{IID_IDirect3DTnLHalDevice, 0, 0, 0, 0},
- };
- i = 0;
- while((!IsEqualGUID(&test_device[i].guid, &dd7->deviceGUID)) && (i < ARRAY_SIZE(name)))
i++;
- ok(!strcmp(DeviceName, name[i]), "Test %d, wrong device name\n", i);
- number_devices[i]++;
- number_devices[ARRAY_SIZE(name)]++;
ok((dd7->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2) == test_device[i].line_pow2,
"Test %d, device line caps has a wrong D3DPTEXTURECAPS_POW2 flag\n", i);
ok((dd7->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2) == test_device[i].tri_pow2,
"Test %d, device tri caps has a wrong D3DPTEXTURECAPS_POW2 flag\n", i);
ok((dd7->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL) == test_device[i].line_nonpow2cond,
"Test %d, device line caps has a wrong D3DPTEXTURECAPS_NONPOW2CONDITIONAL flag\n", i);
ok((dd7->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL) == test_device[i].tri_nonpow2cond,
"Test %d, device tri caps has a wrong D3DPTEXTURECAPS_NONPOW2CONDITIONAL flag\n", i);
- return DDENUMRET_OK;
+}
+static HRESULT WINAPI enumDevicesCancelTest(char *DeviceDescription, char *DeviceName,
D3DDEVICEDESC7 *dd7, void *ctx)
+{
- D3D7ECancelTest *d3d7et = ctx;
- d3d7et->total++;
- return d3d7et->desired_ret;
+}
+static void test_enum_device(void) +{
- BOOL enumerated[] = {0, 1, 1, 1, 0, 1, 1};
- D3D7ECancelTest d3d7_cancel_test;
- IDirectDraw7 *ddraw;
- IDirect3D7 *d3d7;
- HRESULT hr;
- UINT nb_devices[] = {0, 0, 0, 0, 0, 0, 0, 0};
- UINT i, size;
- ddraw = create_ddraw();
- ok(!!ddraw, "Failed to create a ddraw object.\n");
- hr = IDirectDraw7_QueryInterface(ddraw, &IID_IDirect3D7, (void **)&d3d7);
- ok(hr == DD_OK, "Failed to get d7d interface, hr %#x.\n", hr);
- hr = IDirect3D7_EnumDevices(d3d7, NULL, NULL);
- ok(hr == DDERR_INVALIDPARAMS, "IDirect3D7_EnumDevices returned 0x%08x\n", hr);
- hr = IDirect3D7_EnumDevices(d3d7, enumDevicesCallback, &nb_devices);
- ok(hr == DD_OK, "IDirect3D7_EnumDevices returned 0x%08x\n", hr);
- size = ARRAY_SIZE(enumerated);
- for(i = 0; i < size; i++)
ok(nb_devices[i] == !enumerated[i], "device %u should not be enumerated in ddraw 7\n", i);
- ok(nb_devices[size - 2] < nb_devices[size - 1], "TnLHal device enumerated as only device.\n");
- ok(nb_devices[1], "No RGB Device enumerated.\n");
- d3d7_cancel_test.desired_ret = DDENUMRET_CANCEL;
- d3d7_cancel_test.total = 0;
- hr = IDirect3D7_EnumDevices(d3d7, enumDevicesCancelTest, &d3d7_cancel_test);
- ok(hr == D3D_OK, "IDirect3D_EnumDevices returned 0x%08x\n", hr);
- for(i = 0; i < ARRAY_SIZE(enumerated); i++)
if (2== 2)
ok(enumerated[i] == !!nb_devices[i], "uncorrect enumeration of device %u\n", i);
else /*windows >=8 enumerates HAL device*/
ok(enumerated[i] == !!nb_devices[i] || broken(enumerated[i] != !!nb_devices[i]),
"uncorrect enumeration of device %u\n", i);
- ok(d3d7_cancel_test.total == 1, "Enumerated a total of %u devices\n",
d3d7_cancel_test.total);
- /* An enumeration callback can return any value besides DDENUMRET_OK to stop enumeration. */
- d3d7_cancel_test.desired_ret = E_INVALIDARG;
- d3d7_cancel_test.total = 0;
- hr = IDirect3D7_EnumDevices(d3d7, enumDevicesCancelTest, &d3d7_cancel_test);
- ok(hr == D3D_OK, "IDirect3D_EnumDevices returned 0x%08x\n", hr);
- ok(d3d7_cancel_test.total == 1, "Enumerated a total of %u devices\n",
d3d7_cancel_test.total);
- IDirect3D7_Release(d3d7);
- IDirectDraw7_Release(ddraw);
- return;
+}
START_TEST(ddraw7) { DDDEVICEIDENTIFIER2 identifier; @@ -16623,4 +16738,5 @@ START_TEST(ddraw7) test_begin_end_state_block(); test_caps(); test_d32_support();
- test_enum_device();
}
2.19.1
https://bugs.winehq.org/show_bug.cgi?id=19153
Zebediah Figura [email protected] changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|DX3 game does not recognize |Resident Evil 1 fails to |graphics capabilities |start (needs | |IDirect3D3::EnumDevices() | |to return a device named | |"RGB Emulation")
https://bugs.winehq.org/show_bug.cgi?id=19153
--- Comment #37 from joaopa [email protected] --- Bug still occurs with wine-6.21.
https://bugs.winehq.org/show_bug.cgi?id=19153
Maik Wagner [email protected] changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected]
--- Comment #38 from Maik Wagner [email protected] --- (In reply to WineBuG from comment #26)
AFAIK these games don't work in hardware mode either:
[……]
Resident Evil 2 demo (https://web.archive.org/web/20161225013011/http://download.fileplanet.com/ ftp1/gamedemos/action/re2demo.zip)
I have this build on my Slackware 15.0 box
bash-5.1$ wine --version wine-9.15-449-g164992ecbef (Staging)
downloaded the demo, unpacked it in a fresh prefix and everything seems to work fine. Or am I missing some detail for this bug?