ThirteenAG / WidescreenFixesPack

Plugins to make or improve widescreen resolutions support in games, add more features and fix bugs.
https://thirteenag.github.io/wfp
MIT License
2.3k stars 221 forks source link

New injector/wrapper for Max Payne 1 and 2 #155

Closed donizettilorenzo closed 8 years ago

donizettilorenzo commented 8 years ago

Hello, can you use this new d3d8->9 wrapper for MP1&2 injection?

Binaries: http://reshade.me/d3d8to9 Source: https://github.com/crosire/d3d8to9 (more recent/updated than provided binaries)

So we can hook reshade simply toggling "UseD3D8to9=1" in your the global.ini: now that switch is not working for MP2, it's working only for MP1.

Thanks!

ThirteenAG commented 8 years ago

Yeah, I guess so. I'll update asi loader later.

ThirteenAG commented 8 years ago

https://dl.dropboxusercontent.com/s/b696ol1k7tgb9to/d3d8.dll Please test this one, recompiled with latest d3d8to9.

donizettilorenzo commented 8 years ago

Max Payne 1 seems working right and d3d9 translation too: https://s18.postimg.org/cishtutcp/Max_Payne_2016_10_18_23_37_03_942.png

Max Payne 2: *renaming the dll in "d3d9.dll" (NINE) as in the past loads the widescreen mod but there's no d3d9 translation and the game still runs in d3d8: https://s10.postimg.org/dtxkbg161/Max_Payne2_2016_10_18_23_41_23_952.png

with "d3d8.dll" (EIGHT) the game starts in d3d9 (!!!!!) so the wrapping actually happens - MSI Afterburner overlay shows me that - but suddenly crashes pressing a key during intro videos :(

donizettilorenzo commented 8 years ago

Using only the wrapper (without your ASI loader) MP2 runs fine in d3d9:

https://s9.postimg.org/5cq66tbov/Max_Payne2_2016_10_18_23_57_17_110.png

But obviously no widescreen fix.....

ThirteenAG commented 8 years ago

Well, if it crashes then you have to use d3d8to9 separately. If d3d8/d3d9 doesn't work, rename asi loader to msacm32.dll.

donizettilorenzo commented 8 years ago

Already tested :-D msacm32.dll somehow blocks the wrapping.

ThirteenAG commented 8 years ago

Strange, I don't see any reason why would it do that. Try to rename it to other dlls from that list: https://github.com/ThirteenAG/Ultimate-ASI-Loader#description Like, to winmmbase.dll or something. But make sure you're actually using d3d8to9 separately, ini option won't work if asi loader is not named d3d8.dll.

donizettilorenzo commented 8 years ago

winmmbase.dll msacm32.dll

load correctly your mod/scripts but somehow block d3d9 wrapping. Other names do not load your scripts.

ThirteenAG commented 8 years ago

Honestly, no idea why.

donizettilorenzo commented 8 years ago

Your d3d8+ASI loader can correctly initialize by itself the game in d3d-8 AND d3d-9, but in d3d9 gives me this error (through the MSVC 2015 debugger):

https://postimg.org/image/6v1mkm8ul/

And the mouse vanishes until I stop the debug procedure.

ThirteenAG commented 8 years ago

Your d3d8+ASI loader can correctly initialize by itself the game in d3d-8 AND d3d-9,

I don't quite understand what do you mean by that, asi loader shouldn't prevent d3d8to9 from working. I don't know what else I can do.

donizettilorenzo commented 8 years ago

I mean your DLL ( https://dl.dropboxusercontent.com/s/b696ol1k7tgb9to/d3d8.dll ) has this behaviour:

Setting "UseD3D8to9=0" loads correctly the game in D3D8 and after that your scripts Setting "UseD3D8to9=1" loads correctly the game in D3D9 but when it's time to load the menu and your scripts the game crashes and it gives me: https://postimg.org/image/6v1mkm8ul/

So the problem is after the initialization, I can see the intro videos with no problem in d3d8 AND d3d9.

ThirteenAG commented 8 years ago

So the problem is after the initialization, I can see the intro videos with no problem in d3d8 AND d3d9.

Yes, but studio clearly says the crash happens in e2_d3d8_driver_mfc.dll, so you can't use UseD3D8to9=1 in MP2.

donizettilorenzo commented 8 years ago

But the wrapper alone (compiled from Crosire source by myself OR the original binary provided on reshade site) is working.....

ThirteenAG commented 8 years ago

I know, I checked, but I don't know why it's not working as a part of asi loader. Other games work fine.

donizettilorenzo commented 8 years ago

Ultimate ASI Loader v2.1 works!!!!

msacm32 ( Ultimate ASI Loader v2.1 ) +d3d8 for the wrapper :-)

donizettilorenzo commented 8 years ago

Proof :-)

https://postimg.org/image/69ldwmbmf/

EDIT: correct image :-D