ThirteenAG / Ultimate-ASI-Loader

ASI Loader is the tool that loads custom libraries with the file extension .asi into any game process.
MIT License
1.21k stars 104 forks source link

Issues trying to use nemesis2000's Hitman 2 widescreen fix with ASI Loader and combining it with dgvoodoo 2 (+ RTSS) #73

Closed eddmanx closed 1 year ago

eddmanx commented 1 year ago

I renamed Hitman 2 widescreen fix's .dll to .asi, put it and the .ini into a scripts folder and copied it over to the game's directory.

I tried ASI Loader version 5.6 down to 5.0. They work with the loader named as d3d8.dll, but that can't be used in conjunction with dgvoodoo's d3d8.dll. Other names don't work.

(Note: I know I can use dgvoodoo's d3d9.dll, but I'm trying to wrap d3d8 to 11 directly.)

Version 4.68 does work when named as d3d8.dll or winmm.dll. This is somewhat ok, at least now it can be combined with dgvoodoo, BUT, there are two issues:

  1. Having RTSS in the background breaks it and the game loads without the fix applied. RTSS' both Global and Hitman2.exe detection are set to None.
  2. (Side issue) The built-in D3D8to9 doesn't work with the winmm.dll name, even without RTSS; the command has no effect.

RTSS doesn't have an issue when the file is named d3d8.dll, but now dgvoodoo can't be used directly.

I'm wondering if it's the fix itself that's causing all these issues.

eddmanx commented 1 year ago

Is there a function to load another dll file through ASI Loader?

For example, rename dgvoodoo's d3d8.dll to something else, say dg3d8.dll, and then point ASI Loader to load that file?

ThirteenAG commented 1 year ago

Only renaming to asi.

eddmanx commented 1 year ago

It doesn't load.

I renamed dgvoodoo's d3d8.dll to .asi and tried it in both the main game folder (next to ASI Loader's d3d8.dll), and also inside the scripts folder.

ThirteenAG commented 1 year ago

I checked, dinput8 seems to work as well.

Also,

(Side issue) The built-in D3D8to9 doesn't work with the winmm.dll name, even without RTSS; the command has no effect.

d3d8to9 can only be loaded from d3d8.dll.

RTSS doesn't have an issue when the file is named d3d8.dll, but now dgvoodoo can't be used directly.

Probably because it uses d3d9.

eddmanx commented 1 year ago

I checked, dinput8 seems to work as well.

dinput8 doesn't work for me, neither with 5.6, nor 4.68.

Probably because it uses d3d9.

What I meant is that if I name ASI Loader's dll file as "d3d8.dll" to make it work, then I can't copy over dgvoodoo's d3d8.dll into the main folder.

ThirteenAG commented 1 year ago

Tbh I don't know what else to suggest. Maybe indeed just use d3d8 dll with d3d8to9 and dgvoodoo as d3d9?

ThirteenAG commented 1 year ago

I have one idea that I can try and send you to test, if you want.

eddmanx commented 1 year ago

Sure, I can test it.

The fix just doesn't like any other name besides d3d8.dll. Is it the game itself, or the asi fix? For example, the asi is compatible with only a specific exe size, although I'm using that exe.

ThirteenAG commented 1 year ago

d3d8.zip

Try renaming the other d3d8 to d3d8Hooked.dll and see if it will load that way.

eddmanx commented 1 year ago

It works. Everything seems to be fine. Nice work.

In the meantime, I was testing dxwrapper. It does work, since it has an option to load a dll from a different path, but it's a different program, so not expecting it with ASI Loader.

However, one odd thing I've noticed is that dxwrapper can launch the game even when using the wrong sized exe. ASI Loader can't.

How does that work? I haven't enabled any extra options in dxwrapper, aside from LoadPlugins and LoadFromScriptsOnly.

EDIT: I just remembered what you said about DllMain and tried it with DontLoadFromDllMain=0, and it now launches.

eddmanx commented 1 year ago

Can it be made to hook ddraw.dll and d3d9.dll?

ThirteenAG commented 1 year ago

Yes, but why? I can expose loading *Hooked named dlls for these as well I guess, don't see any downsides to it.

eddmanx commented 1 year ago

Yes, but why?

For cases where ASI Loader needs to be named ddraw.dll or d3d9.dll, so that dgvoodoo can be used too.

ThirteenAG commented 1 year ago

I have enabled this for all supported names, please test. dinput8.zip

eddmanx commented 1 year ago

Works great. This new hooking feature is really helpful.