|# cp DefEd/bin/EoCApp.exe DefEd/bin/EoCApp.exe.bak|
|# r2 -w DefEd/bin/EoCApp.exe -i dos2defed.r2 -q|
|# sha1sum DefEd/bin/EoCApp.*|
|# 04c29114a7ca50d414abab399033ac88ca6dd362 DefEd/bin/EoCApp.exe|
|# e3baf89f0d0d1885eb7d4d718e76da99f304726b DefEd/bin/EoCApp.exe.bak|
|wa jmp 0x1410083f9|
|wa jmp 0x14118588b|
|wa jmp 0x1411b3bfa|
|wa jmp 0x1411b3db5|
|wa jmp 0x14125eea0|
This patch should help people like me who got stuck with a black screen on game startup.
The reason has nothing to do with DXVK btw, it is related to thread affinity. The game calls SetThreadAffinityMask, which returns 0 for whatever reason which indicates an error, and the game threads don't start.
This patch will overwrite the jump opcodes after the calls to SetThreadAffinityMask to completely ignore the returned result.
I can't test this patch, as the game was updated a few days ago.
However, I took a closer look at Wine's SetThreadAffinityMask implementation. I patched it to print all return results. It never returns a zero value. At least not in my case.
Are you sure, it's related to that?
Possibly game tries to set mask for wrong CPU which should fail https://github.com/ValveSoftware/wine/blob/proton_3.7/dlls/kernel32/tests/thread.c#L878
I investigated a little bit more to see whether this was a wine issue or not, and from the SetThreadAffinityMask documentation, I believe it might be a game bug that has nothing to with wine.
The game first checks whether there is more or less than 6 cpus. If less, it initializes an affinity mask to 0xfffffffe that is then used for the creation of the game threads, and passed as an argument to SetThreadAffinityMask. From the Windows API documentation, I understand that passing a mask that is larger than the process affinity mask (which in turn cannot be larger than the cpu count) is incorrect, and should be treated as an error.
I don't know though if this is also the actual behavior of the Windows implementation, but it looks to me that Wine is implementing the API specification correctly.
I don't know if someone will read this message but i have a problem with wine-staging 3.16 and the game.