Menu

v2.05.27: a new tweak for DirectX redirection

gho
2019-09-11
2019-09-20
  • gho

    gho - 2019-09-11

    At last, in this new release I added a long waited functionality. But this is the end of a long story:

    Since quite some time I was annoyed by the MS poor support for legacy ddraw versions. DxWnd is designed to tweak DirectX functionalities on top of a working DirectX stack, but as a matter of fact many Window users don't find on their computers a working version for all components, like old DirectDraw version 1,2,3 and so on.
    In addition, the frequent updates of latest Win10 make it difficult to set the matter once and for all.

    Of course you can fix the problem by downloading and installing some MS patch for legacy support, but a valid help for such problems also comes from alternative packages, here are some just to name them:

    • dll files from WinXP platform
    • dgVoodoo
    • d3d8to9
    • Wine on Windows
    • DXGL
    • C&C DDraw

    But this raises a tiny problem: all these packages are based on the idea of pulling some replacement dlls on the game folder to make a persistent change of the game behavior.
    On the contrary, DxWnd philosophy is to leave everything pretty unaltered and dynamically fix the problems only while turned on.

    So now comes a happy marriage between DxWnd and the DirectX wrapper: DxWnd can make all these files stay in a folder of its own and redirect the calls dynamically whenever requested. It sounds awful, but in many cases it works.

    Here is a leaked beta that I'm not to propose as default download for a while, since it risks to introduce more problems than fixes, but someone could be interested and could help my testing. The package includes (but this time only) a set of Dege's dgVoodoo files (I hope he will forgive me for not telling him first) as a good example. The files must be in the alt.dll subfolder, and anyone is free to replace these files with anything that may do otherwise (see my list above). The dll redirection is triggered by the "hook:ReplaceDirectXDLLs" tweak and the dgVoodoo overlay banner will prove that it works (when it will work, of course ...).

    Well, enough for now, but I'm sure this thread will grow soon.

     

    Last edit: gho 2019-09-11
  • jds45782

    jds45782 - 2019-09-11

    OMG ! updated... all my profiles are gone !

    EDIT: yes, i tried, putting it back to 2.05.26 release. same, profles are all gone ! I added 1 profile, while its at 2.05.26, then updated back to 2.05.27 leak, profile is gone !

    Also, all settings get reset back to their defaults after updating, every time. I have to re-enable expert mode, etc.

    Is this the update doing this? or is it something my end doing it ?

     

    Last edit: jds45782 2019-09-11
    • gho

      gho - 2019-09-11

      Oops, I left an empty dxwnd.ini in the archive. All DxWnd configuration is written there, if you override that file all configuration is lost. Don't you have a backup somewhere? That file is the only one worth saving.

       

      Last edit: gho 2019-09-11
  • White

    White - 2019-09-11

    Seems to work. What I believe should be left while updating to a different version is the configuration file "dxwnd.ini", otherwise it's good to export some more specific profiles from time to time.

     
  • gho

    gho - 2019-09-11

    Sorry, I updated the archive without the dxwnd.ini file, but for jds4578 configuration is just too late.
    Anyway, who may want to test the new bundle would better place it side-by-side with the working release in another folder without overriding anything: this release is far from perfect.

     
  • jds45782

    jds45782 - 2019-09-11

    luckily, i have older dxwnd.ini files, from another dxwnd folder, which i could use and update with. i'll remember for the next major, or leaked release, to create a brand new folder.

     

    Last edit: jds45782 2019-09-11
  • gho

    gho - 2019-09-11

    Some report from first tests.

    1) dgVoodoo is a very good replacement, but it misses the early D3D interfaces (es. IID_IDirect3D3 needed in LEGO Racers) and some FourCC support (es. YUY2 needed in Dungeon Keeper 2 intro movie)
    2) I'm having big troubles when trying to redirect d3d8 and d3d9 in newer DxWnd versions currently under development.

     
  • gho

    gho - 2019-09-12

    News: the d3d8 / d3d9 alternate link starts working.
    I couldn't make many tests because most of my testbed includes ddraw / early d3d games, but the Rayman 3 demo shows that d3d8 redirection works very well.
    The screenshot is not amazing because on my portable dgVoodoo can't use its best renderers and I had to set the ugly SW mode, but on a decent computer this should not be an issue.
    The previous leaked beta was heavily bugged in several parts. The attached fix works much better.

     
  • Le Gluon du Net

    Le Gluon du Net - 2019-09-12

    Hello GHo, how to enable your DGVoodoo DLL? I didn't understand this line " The dll redirection is triggered by the "hook:ReplaceDirectXDLLs" tweak and the dgVoodoo overlay banner will prove that it works "

     
  • Le Gluon du Net

    Le Gluon du Net - 2019-09-12

    Ok I found the option in Tweaks tab. And after?

     
  • Kataah

    Kataah - 2019-09-12

    I didn´t tested that out yet. But does this still needs the dgVodoo files in the Game Folder?

     

    Last edit: Kataah 2019-09-12
  • gho

    gho - 2019-09-12

    Ok I found the option in Tweaks tab. And after?
    But does this still needs the dgVodoo files in the Game Folder?

    Once the "hook:ReplaceDirectXDLLs" tweak is activated (you should see it listed in the right part of the tweaks tab) DxWnd will use whatever file belonging to the DirectDraw family that it finds in the DxWnd alt.dll subfolder (see screenshot).
    So, the dgVoodoo dlls MUST NOT per copied into the game folder, they will be picked from the alt.dll folder whenever the tweak is set. In addition, once copied there, they will be used for whatever program that is flagged, so you need to have ONLY ONE copy of these files and when you will turn DxWnd off they won't be activated.

    One more thing: DxWnd (currently) will link each of these files if they are in the folder:

    • ddraw.dll
    • d3d8.dll
    • d3d9.dll

    This means that if, for instance, you copy in the folder a copy of the d3d8to9 library (of course, after renaming it to d3d8.dll) DxWnd will redirect Direct3D8 operations only, leaving all DirectDraw and Direct3D9 operations unaltered. The same holds for dgVoodoo files: id you copy there only some files the redirection will take place only for the relative operations.

    This is the current situation. In near future I wish to generalize the schema making it possible to redirect also other system libraries, like d3drm.dll, OpenGL32.dll, Glide.dll and so on, for all dlls that could have a possible replacement.

    If you try making experiments with dgVoodoo, be aware that the dgVoodoo configuration file dgVoodoo.conf should be copied in the alt.dll folder as well, or dgVoodoo will assume a default behavior.

     
  • Le Gluon du Net

    Le Gluon du Net - 2019-09-12

    I tried with Real Myst without sucess, no dgvoodoo 2 logo :(

     
    • gho

      gho - 2019-09-12

      This is a delicate matter. If the replament dll can't be loaded, whatever the reason is, DxWnd keeps going as nothing happened, so you easily get the program running with the default dlls.
      When the package has some overlay, like dgVoodoo, it is easy to see when things are working as supposed to be, but if the overlay doesn't show it could be difficult to understand why.
      One should run the game with logging enabled, then search for this type of messages:

      HookDirectDraw: alt.dll loaded path=D:\DxWnd.develop\v2_05_27_beta\Release\alt.dll\DDraw.dll
      

      I fyou find a load error, surely your program is not using the replacement dll:

      PinLibrary: LoadLibrary failed on DLL=D:\DxWnd.develop\v2_05_27_beta\Release\alt.dll\d3d9.dll err=0x7e
      

      When there's an error, you can check two things:
      1) the correctness of the dll path (the file must exist)
      2) the satisfaction of all dependencies

      There could be dependency problems: for instance, WineD3D (you can get it here https://fdossena.com/?p=wined3d/index.frag from Franco Dossena site) has dlls that depend on wined3d.dll, but since the game is running in another folder the dll (like ddraw.dll) don't find this library. Probably it would work adding the alt.dll path to the system $PATH environment variable, I will have to try.

       

      Last edit: gho 2019-09-12
  • gho

    gho - 2019-09-13

    Ok, listen, the WineD3D case is a little tricky but it can be managed. Here's how and why.
    I tried adding the alt.dll to the search directory path (using SetDllDirectory) but this makes a mess because this path takes precedence over the system folders so that DxWnd itself loads the replacement libraries also when it should load the original ones.
    So, there are two other ways to overcome the problem, une not too good, one better. I remind you that the problem is that Wine dll replacements should have wined3d.dll in their path, so
    1) (bad) copy wined3d.dll into the game folder. No need to copy there anything else
    2) (better) copy wined3d.dll into the dxwnd folder, once and for all.
    It works quite well for me, since WineD3D is based on OpenGL if you have HW accelerated OpenGL drivers the result is comparable with dgVoodoo, but with a wider support (legacy D3D interfaces, for instance!)

     
  • gho

    gho - 2019-09-13

    Another important finding about dgVoodoo replacement: Dege placed the legacy D3D logic in the D3DImm.dll (notice the 2 'm') to avoid overlapping with the system dll D3DIm.dll (notice the single 'm'). This means that this dll should be in the search library path to make everything work, and you will have to use the same tricks about wined3d.dll: copy the D3DImm.dll file in DxWnd folder.
    This seems to make legacy D3D games finally working.

     
  • Kataah

    Kataah - 2019-09-13

    Shadows of the Empire crashes also. But i´m not sure if i even have a legit Game Folder Copy of it without any "Hacks" to get it running on modern Windows. I have to redownload the GOG Version and see.

    Edit:
    Even with a Vanilla Installation from GOG it does nothing. :(

     

    Last edit: Kataah 2019-09-13
    • gho

      gho - 2019-09-13

      did you copy d3dimm.dll from dgVoodoo to DxWnd folder? Just one level above alt.dll

       
  • Kataah

    Kataah - 2019-09-13

    Yes, i did that.

     
    • gho

      gho - 2019-09-13

      so now it's time to see some logs. We can't expegt this trick to work always, but sometimes it takes just little to fix. Honestly, I'm impressed by the amount of cases that work this way.

       
  • Le Gluon du Net

    Le Gluon du Net - 2019-09-18

    I can not make this new feature works on Linux :(

     
    • gho

      gho - 2019-09-18

      Uhm, in theory there should be no reason why it should not work, the whole trick uses the same technicalities of other operations. I'll have a look ...

      update
      The logs don't show errors, they state that the operation was made and the game works.
      To be sure, I placed a copy of dgVoodoo DDRAW.DLL in the game folder. The result is identical, the game works but there's no dgVoodoo watermark.
      So, now I have a doubt: what happened?
      a) the redirection didn't work in both cases, maybe because of Wine stronger bounds
      b) the dgVoodoo watermark doesn't work on Linux

      To tell for sure I would need a different DDRAW.DLL that makes the difference more evident, for instance that doesn't work ...

      update
      I used ddraw.dll from apitrace: if hooked, that dll should drop a trace file on the file system. Unfortunately, that didn't happen in any case (placing ddraw.dll in the game folder or using DxWnd redirection), so it seems we're in case a) ...

       

      Last edit: gho 2019-09-18
  • gho

    gho - 2019-09-20

    Some general advices coming from more testing:

    1) hooking to alternate DirectX dlls may require the "Hook / Do hook update" flag to allow a switch between the previous invalid pointers to the new ones. Curiously, this is NOT always required, then generating a little confusion. If and when I'll understand better, maybe I will eliminate the need to manual intervention in the game configuration.

    2) dgVoodoo emulation doesn't seem able to provide Flip operation in window mode, like some video cards can do. In general, whenever you load a configuration with "DirectX / Flip emulation" unchecked, better check it.

    3) update dgVoodoo to latest 2.62, it is a wonder!

     
  • Le Gluon du Net

    Le Gluon du Net - 2019-09-20

    Gho, for your information, dgVoodoo 2 alone works very well on Linux/Wine but it needs
    - DXVK libraries to add better Directx11 compatibility to Wine
    - to override ddraw dll to "native, builtin" in Wine configuration libraries tab.

     

    Last edit: Le Gluon du Net 2019-09-20

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.