Hmm... it's interesting. I should revise MP1&2 then.
I remembered that MP1 is DX8 but is of the initializing-from-DllMain type, while MP2 is DX9, so dgVoodoo is unusable for them.
Nope, pure DX8, just does who knows what with d3d9 before it fully launches, check the latter 2 screenshots: http://imgur.com/a/jMVZo
And here are the patches for both Max Payne games that make this possible: Max Payne 1 & 2 Startup Hang Patch
Well, in DX<=9, a device corresponds to a monitor. Even if you have 2 monitors attached to the same video card, they still appea […]
Well, in DX<=9, a device corresponds to a monitor. Even if you have 2 monitors attached to the same video card, they still appear as 2 separate devices in old DX. (XP DX9 had fullscreen-only support for dualhead videocards).
A device has a describing structure containing a 'name' and a 'description' string member. It's up to the application which one to display to the user.
Name is filled with the adapter name (the GPU's name in dgVoodoo) and description is filled with the monitor name (\\.\DISPLAY# strings) both coming from DXGI (from Windows internals).
Also, if you have multiple monitors, meaning multiple DX devices, some applications choose the last one from the enumeration, while others usually just use the first or the primary one. That's why you can select one adapter (+optionally a connected display) in the setup, to hide the others.
True. I've read with d3d8 you can use IDirect3D8::GetAdapterMonitor, then call GetMonitorInfo on returned handle to get the monitor number (\\.\DISPLAY#). Then I suppose you can present options in this style: GPU name @ monitor number.
Mafia, with regular d3d8.dll, while displaying adapters the same way Max Payne does, will actually start on second monitor if i choose so, while Max Payne presents 2 devices, but starts only on the primary one. What's more, config dialog always by default presents resolutions of my secondary, smaller monitor, so I have to click the other device to get right resolutions.
Good thing -nodialog parameter exists. I think the problem is that it internally operates with device description instead of its sequential number. You can see it stores it in registry with the rest of the settings. 3D Mark, however, with stock d3d8.dll, reports resolutions of my primary monitor only if I disable the secondary monitor.
Widescreen Fix works well, just use the lastest ASI Loader DLL (renamed "msacm32.dll") for Max Payne 1 and 2.1 version for Max Payne 2 (renamed "msacm32.dll").
There is a bug in latest ASI loader with Direct3D8DisableMaximizedWindowedModeShim option, located in scripts/global.ini. If you turn it off, it works. The purpose of this option is to make stock d3d8.dll work properly by disabling forced maximized windowed mode, because geniuses at Microsoft want you to force stop playing "legacy" games by introducing options that break old games in strange ways.
This mode is there supposedly in the name of compatibility, but all I've seen it does (in addition to preventing games from running in true fullscreen mode) is preventing users from adjusting gamma in games and in some cases making them crash when anti-aliasing is enabled. Before Windows 10, it was enforced only for certain games, but on 10, it's enforced for anything D3D8.
Anyway, this option calls LoadLibrary with absolute path to system d3d8.dll before game wants to load it instead of just LoadLibrary("d3d8.dll"), which would pick a dgVoodoo one and since dgVoodoo doesn't export Direct3D8EnableMaximizedWindowedModeShim function, things would work properly regardless of whether user uses stock d3d8.dll or dgVoodoo's d3d8.dll. Will report the bug on GitHub.