elishacloud / dxwrapper

Fixes compatibility issues with older games running on Windows 10/11 by wrapping DirectX dlls. Also allows loading custom libraries with the file extension .asi into game processes.
zlib License
1.27k stars 90 forks source link

Support for Need For Speed games #95

Open pm67190 opened 3 years ago

pm67190 commented 3 years ago

hello

did you have a new version

of dxwrapper ? for test ^^ with new features

thank you in advance for your work

elishacloud commented 3 years ago

Sure. Here is the latest build: dxwrapper.zip

I have not fully tested it so there could be some issues. I normally spend about a week testing with all games I know are working to ensure that there is no regression, which is why I don't release new builds very often.

Anyways, this mostly has updates for converting Direct3D1-7 to Direct3D9. However, it is not far enough for it work with any Direct3D game yet. Other features should pretty much work as good as they did before.

However, the following games are fixed when using Dd7to9 in this build:

Edit: this build has some issues.

elishacloud commented 3 years ago

The last update had a critical issue. Use this build instead: dxwrapper.zip

pm67190 commented 3 years ago

Ok thank you

Téléchargez Outlook pour Androidhttps://aka.ms/ghei36


From: Elisha Riedlinger notifications@github.com Sent: Monday, November 16, 2020 9:21:40 PM To: elishacloud/dxwrapper dxwrapper@noreply.github.com Cc: pm67190 user75000@outlook.fr; Author author@noreply.github.com Subject: Re: [elishacloud/dxwrapper] dxwrapper new release (#95)

The last update had a critical issue. Use this build instead: dxwrapper.ziphttps://github.com/elishacloud/dxwrapper/files/5549441/dxwrapper.zip

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/elishacloud/dxwrapper/issues/95#issuecomment-728302370, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQTHJMUG4MG7YOTQT6VDUEDSQGCVJANCNFSM4TT6LXRA.

MAXBURAOT commented 3 years ago

The last update had a critical issue. Use this build instead: dxwrapper.zip Lucky i saw this link, thanks for this update, i really wanted to test your latest release 💯 , I've tested for some Need For Speed Games -For Need For Speed Hot Pursuit 2, you fixed the graphics glitch on this version 👍 using D3D8.DLL, loading script also works

-Need For Speed V Porsche Unleashed, doesn't work -Need For Speed IV High Stakes, doesn't work, Black screen -Need For Speed III Hot Pursuit , doesn't work -Need For Speed II SE, doesn't work

*I only use vanilla version of the game i didn't use any Modern Patch

dxwrapper-nfs2sen.log dxwrapper-nfs3.log dxwrapper-nfshs.log dxwrapper-porsche.log dxwrapper-nfshp2.dinobytes.log

OLD Version 4 2

NEW Version 5 6

elishacloud commented 1 year ago

The logs indicate that Dd7to9 is enabled. All of these games use Direct3D, which is not yet supported by Dd7to9. Try enabling the EnableDdrawWrapper option instead.

Fallenleader commented 8 months ago

I can still confirm due to most recent builds NFS5 PU is still unable to launch. The log yields an interesting result, and PU throws an error. It should be noted that the PU version I used has the patched EXE provided by IPLounge group, which keeps the game alive for multiplayer. otherwise it functions vanilla, and even the DX7 DLL being used for testing is the original.

dxwrapper-porsche.log image

elishacloud commented 8 months ago

The logs show that it has not even started DX7 yet. Also, it shows that dxwrapper is already loaded. How many stubs or files are you using from dxwrapper? Make sure you only use three files from dxwrapper for this game, and delete all other dxwrapper files except these:

  1. dxwrapper.dll
  2. dxwrapper.ini
  3. ddraw.dll
Fallenleader commented 7 months ago

Those are the only 3 I have that I am aware of. The only change I knowingly made was renaming ddraw.dll to dx7z.dll.

PU out of the box uses DX7 3D ddraw.dll renamed to dx7z.dll by the original devs. PU checks a folder named drivers for dx7z.dll. This same error tends to occur with other wrappers/using newer versions of DX DLLs (so no trivial swapping like you could back in the day with NFS3/4).

Original EXE craps out because of old SecuROM protection. NoCD only removes this check. Renaming the ddraw.dll stub back to that name results in this error as the game can't find the DX7 DLL it expects: image

So I am at a loss. I even tried in long to swap the real DLL path from auto to directly point to the folder hosting the original to no avail.

I can provide samples/links on request if this will help. Game has long been abandonware at this point.

elishacloud commented 7 months ago

The only change I knowingly made was renaming ddraw.dll to dx7z.dll.

Ok, this won't work out of the box. You will need to add an ini file to tell the dx7z.dll stub file what dll it is trying to be. Add a dx7z.ini file and make sure to add WrapperMode = ddraw.dll to it.

The ini file should be like this:

;; Config file for Stub to dxwrapper
[General]
RealDllPath       = ddraw.dll
WrapperMode       = ddraw.dll
StubOnly          = 0
LoadFromMemory    = 0

For more details see here.

Fallenleader commented 7 months ago

Unfortunately this didn't work. Same error from the game as before, same log output. Does DXWrapper support DX7 thrash drivers by chance?

Further details can be found if one digs a bit, but this post from a thread pretty much explains it in more detail

After a lot of trials on my PC I came to the following conclusion:

  • NFS PU is written for DirectX7 and the game engine uses the trash driver dx7z.dll to call the DX7 API's which instruct the >GPU to render the 3D images.
  • Video cards with DX7 functionality, like the GF2 generation, handle these instructions correctly.
  • Although M$ state that new DX versions are backwards compatible with previous ones, some game engines show problems (also M$ Flight Simulator 2002...)
  • The present video cards, Radeon 8xxx/9xxx and GF3/ 4/ FX, have DX8 or higher functionality and cannot handle the DX calls >of the NFS PU game engine correctly => mipmapping failures => unsharp textures.
elishacloud commented 7 months ago

Does DXWrapper support DX7 thrash drivers by chance?

No. Maybe try a different stub. How about using winmm.dll or dsound.dll to hook in dxwrapper? Just put the normal dx7z.dll file back and use something else for loading dxwrapper.

elishacloud commented 7 months ago

the game engine uses the trash driver dx7z.dll to call the DX7 API's

dxwrapper just wraps the DX7 APIs, whoever calls these APIs don't matter. However, this does mean that the stub will never work as a dx7.dll file. Instead you need to load dxwrapper from another library.

Fallenleader commented 7 months ago

I did manage to make some progress. Seems I had DXWrapper files in the root that I missed. Log actually shows it loading, but still getting a thrash error from the game. I will also share a screenshot of all the dlls in the directory, because I see neither of those present. image dxwrapper-porsche.log

elishacloud commented 7 months ago

Unfortunately, I cannot see the log because GitHub attachments are broken right now. I will check on this later. Just keep in mind that all of the dxwrapper files (stub, ini and dll) need to be in the same folder for it work.

Fallenleader commented 7 months ago

Just in case they don't unfug this soon (just noticed it was broken), going to paste the log here. Even if we can wrap this to DX9, there is no guarantee that remix will even work on it, which is the whole purpose for this. The game can be played fine on PC with patches from IPL team, even supporting an active multiplayer community, Just not in DX mode on W11.

31280 00:09:01.362 Starting DxWrapper v1.1.6960.22 31280 00:09:01.362 Running from: F:\Program Files (x86)\Need For Speed Porsche Unleashed\drivers\dxwrapper.dll 31280 00:09:01.362 Reading config file: F:\Program Files (x86)\Need For Speed Porsche Unleashed\drivers\dxwrapper.ini 31280 00:09:01.362 Micro-Star International Co., Ltd MS-7C02 1.0 (Desktop) 31280 00:09:01.362 Micro-Star International Co., Ltd B450 TOMAHAWK MAX (MS-7C02) 1.0 (Desktop) 31280 00:09:01.362 NVIDIA GeForce RTX 3090 31280 00:09:01.364 Windows 10 Enterprise 64-bit (10.0.22621) 31280 00:09:01.364 Porsche.exe (PID:38084) 31280 00:09:01.370 Environment variable __COMPAT_LAYER = "DWM8And16BitMitigation" 31280 00:09:01.370 Disabling High DPI Scaling... 31280 00:09:01.370 Loaded library: user32.dll 31280 00:09:01.370 Loaded library: shcore.dll 31280 00:09:01.370 Loading 'ddraw.dll'... 31280 00:09:01.370 Loaded library: C:\WINDOWS\system32\ddraw.dll 31280 00:09:01.370 Hooking ddraw.dll APIs... 31280 00:09:01.371 Installing GDI & User32 hooks 31280 00:09:01.371 Loaded library: gdi32.dll 31280 00:09:01.371 Loaded library: kernel32.dll 31280 00:09:01.372 Loaded library: d3d9.dll 31280 00:09:01.372 Enabling ddraw wrapper 31280 00:09:01.372 Enabling d3d9 wrapper 31280 00:09:01.372 Loading 'd3d9.dll'... 31280 00:09:01.372 Loaded library: C:\WINDOWS\system32\d3d9.dll 31280 00:09:01.372 Loaded library: winmm.dll 31280 00:09:01.372 Installing memory management hooks 31280 00:09:01.382 Installing messaging hooks 31280 00:09:01.382 Installing display mode hooks 31280 00:09:01.382 Installing registry hooks 31280 00:09:01.382 Installing Win32 hooks 31280 00:09:01.382 DxWrapper loaded! 31280 00:09:06.644 Quiting DxWrapper 31280 00:09:06.644 Unloading libraries... 31280 00:09:06.644 DxWrapper terminated!

elishacloud commented 7 months ago

The log shows that the game still has not even started Direct3D yet. Looks like it is crashing/exiting before it ever even tries to call any DirectDraw/Direct3D calls.

There should be something in between these two lines:

31280 00:09:01.382 DxWrapper loaded!
31280 00:09:06.644 Quiting DxWrapper

Does it work without dxwrapper?

elishacloud commented 7 months ago

A couple ideas:

  1. Try enabling the option SingleProcAffinity in the ini file.
  2. Make sure to remove any Windows compatibility settings from the exe file.
Fallenleader commented 7 months ago

It works up to menu with original DX file. I just checked again to confirm. And I'm not surprised, it continues to throw this thrash driver error I showed a while back from the EXE, followed by this one if I tell it not to terminate execution. Otherwise if I say yes it just terminates. image image

1: Didn't work 2: There were no compat settings applied, so this was easy enough.

Neokom1978 commented 7 months ago

Hallo! For NFS PU you need only copy dxwrapper.dll и dsound.dll Without directsound - NOP! And in config:

WrapperMode = ddraw DDrawCompat = 1 EnableDsoundWrapper = 1 SingleProcAffinity = 1

;-)