https://bugs.winehq.org/show_bug.cgi?id=57212
Bug ID: 57212 Summary: Spider-Man: Shattered Dimensions - Unable to get display aspect ratio Product: Wine Version: 9.17 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: winex11.drv Assignee: wine-bugs@winehq.org Reporter: tinozzo123@gmail.com Distribution: ---
### About the game
Spider-Man: Shattered Dimensions is a weird D3D9 game: in its settings, not only there is the resolution option, but there is also the "AspectRatio" option.
This setting is saved in the registry: `HKEY_CURRENT_USER\SOFTWARE\Activision\Spider-Man (TM) SD\Settings\Display\AspectRatio` 1 for 4:3, 2 for 16:10, 3 for 16:9.
### What the game is supposed to do (first launch)
On Windows and on Wine Wayland, when launching the game for the first time (that is, when the registry key doesn't exist), that key is `NtSetValueKey`ed to 4 (a value that seems intentionally invalid), then it is `NtSetValueKey`ed to the appropriate value.
### What happens instead on Wine X11 (first launch)
On Wine X11 (or XWayland), `NtSetValueKey` for "AspectRatio" is only called once to set it to 4, and it stays as such. (Which makes the game 4:3.)
That probably means that whatever the game needs to do before the second `NtSetValueKey` fails.
#### Symptoms of the issue
You may wonder: "Since the Aspect Ratio option is exposed in the in-game settings, can't you adjust them there?".
However, due to the game being poorly coded, this issue may make the game stuck in an unsupported resolution, causing a chain reaction of issues that makes the game unable to change all graphics settings, and sometimes it even makes the game unable to render the title screen, crashing when starting a level.
Manually editing the "AspectRatio" key after the first launch doesn't solve all issues: it may still be impossible to change all graphics settings. This probably means that the game depends on "getting" the display's aspect ratio even if the registry key is set.
### Logs
I don't know what channels should the logs contain. Tell me, and I'll send them.