https://bugs.winehq.org/show_bug.cgi?id=53775
Bug ID: 53775 Summary: Resident Evil 3 / Biohazard 3 (Sourcenext): Graphical Issues with TeamX HD Mod Product: Wine Version: 7.18 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: mskau@protonmail.com Distribution: ArchLinux
The HD assets seemingly do not load at all with the HD mod. Instead the game expects the HD assets but the original assets are loaded instead, causing graphical issues.
The game has both the TeamX HD mod and Classic Rebirth installed. Both WineD3D and DXVK exhibit this behavior. The modded game works without issues under Windows 10.
Screenshots: https://cdn.discordapp.com/attachments/819766636583845901/102918890026828601... https://cdn.discordapp.com/attachments/819766636583845901/102918890286876684...
https://bugs.winehq.org/show_bug.cgi?id=53775
ShadowOne333 shadow_one666@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |shadow_one666@hotmail.com
--- Comment #1 from ShadowOne333 shadow_one666@hotmail.com --- I've been trying to get RE3 working on Linux/Steam Deck with the HD/Seamless HD Project (SHDP) mod for over two months now, but no matter what I try, I always end up with the same result, which is the actual backgrounds/textures looking really small on the upper-left corner of the screen, as seen in these images:
(Please refer to this full issue report on DXVK for the full logs and images:) https://github.com/doitsujin/dxvk/issues/4431
To get the game running on Linux, be it any distribution or Steam Deck, I use the following DLL overrides:
`WINEDLLOVERRIDES="d3d9,d3dcompiler_47,ddraw,dinput8,dsound,libwebp,xaudio2_9"=n,b`
Those same overrides are the ones I use for RE2 and it works perfectly with Classic Rebirth alongside the Seamless HD Project mod. RE1 CR+SHDP does work too, although that one required some dgVoodoo2 intervention). While RE3 does work with Classic Rebirth on its own, it's the HD mod causes that graphical issue on any Linux machine I tried, Steam Deck included.
I tried screwing around with the DLLs, and found that dinpu8 is the one that seems to load the HD textures. According to some tests by several other people from both the Proton GE Discord and the Seamless HD Project Discord, it seems like the issue could be related to the implementation of DirectX made by Wine/Proton, be it WineD3D or DXVK.
(Check the Proton and Wine logs for debugging reference at the bottom of the post)
I also attempted running `DXVK_HUD=full` as suggested by a community member to test with DXVK running, and this was the result: 
### Software information Resident Evil 3: Nemesis (1999) from GOG: https://www.gog.com/en/game/resident_evil_3 - It's important to note that the version of RE3 needed for the mods to work is the Japanese version.
To run the game with the exact same conditions to reproduce the HD textures/backgrounds glitch, the following is required: - Official SourceNext 1.1.0 patch: https://classicrebirth.com/index.php/download/biohazard-3-sourcenext-1-1-0-p... - Classic Rebirth mod for RE3: https://classicrebirth.com/index.php/download/resident-evil-3-classic-rebirt... - Resident Evil 3 HD mod by TeamX: https://www.moddb.com/mods/resident-evil-3-hd-mod
Once the game is properly installed with the Japanese language, all that's needed is: - Replace the original EXE with the one from the Official 1.1.0 SourceNext patch - Replace the `ddraw.dll` from the original game with the one from the Classic Rebirth mod - Copy all contents from the RE3 HD mod into the same place as the EXE. Warning: If the HD mod has a `ddraw.dll` file, do NOT replace the one from the Classic Rebirth mod! - To make the game run under Linux/Steam Deck, the following DLL overrides are required: `WINEDLLOVERRIDES="ddraw,dinput8"=n,b` Those are the bare minimum of DLL needed to get the HD mod running. Afterwards, running the Wine DLL Override command alongside `wine "BIOHAZARD(R) 3 PC.exe"` should make the game run with the following window opening, and then the game window with the graphical glitch:  
### System information Steam Deck specs: - GPU: 8 RDNA 2 CUs, 1.6GHz (1.6 TFlops FP32) - Driver: Mesa 24.2.5 - Wine version: 9.2, Proton 7.0-6, 8.0-5, 9.0-3, Experimental, Proton GE 9.16. - DXVK version: 2.4.1
The same results have been reproduced and been tested on Ubuntu (Lenovo Ideapad 3) and Gentoo (Dell Latitude E5510) with Wine 9.0 as well.
### Log files - Proton logs: steam-0.log - https://github.com/user-attachments/files/17654770/steam-0.log steam-1266089300.log - https://github.com/user-attachments/files/17654771/steam-1266089300.log - Wine's game.log: https://github.com/user-attachments/files/17653868/game.log)
https://bugs.winehq.org/show_bug.cgi?id=53775
Dario dario86@tutamail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dario86@tutamail.com
--- Comment #4 from Dario dario86@tutamail.com --- This is a duplicate of issue #57395.
https://bugs.winehq.org/show_bug.cgi?id=53775
--- Comment #5 from ShadowOne333 shadow_one666@hotmail.com --- Upon further investigation, it seems that the most plausible culprit for this specific issue is related to a polygon offset scaling with WineD3D: 0024:err:d3d:wined3d_adapter_find_polyoffset_scale PolygonOffset scale factor detection failed, using fallback value 2^23.
That is the exact output I get from the log, and it seems to be the only repeating error when running the game with the HD texture pack. Everything else is just warnings that don't affect gameplay.
Here's the game's log when running it through Wine 9.0 (applies for the recent Wine 10 as well): game.log: https://github.com/user-attachments/files/17653868/game.log
https://bugs.winehq.org/show_bug.cgi?id=53775
Zeb Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |z.figura12@gmail.com
--- Comment #6 from Zeb Figura z.figura12@gmail.com --- (In reply to ShadowOne333 from comment #5)
Upon further investigation, it seems that the most plausible culprit for this specific issue is related to a polygon offset scaling with WineD3D: 0024:err:d3d:wined3d_adapter_find_polyoffset_scale PolygonOffset scale factor detection failed, using fallback value 2^23.
That is the exact output I get from the log, and it seems to be the only repeating error when running the game with the HD texture pack. Everything else is just warnings that don't affect gameplay.
Probably not, I'm afraid. That message is going to be printed for all applications, but at best it's likely only to cause Z-fighting problems, I believe.
https://bugs.winehq.org/show_bug.cgi?id=53775
--- Comment #7 from Dario dario86@tutamail.com --- Subroutine at 0x10004430 in bio3hd.asi is successfully injected in ddraw.ddl and executed. This brief subroutine stores a couple of words in memory representing the intended resolution of 1280x960. This behavior is consistent between Windows and Wine. An issue however is apparent when the next injected subroutine at 0x10004460 in bio3hd.asi is called. On Windows this subroutine takes a resolution of 1280x960 and few other values as input parameters. While on Windows these parameters are correctly passed, on Wine the vertical resolution of 960 is not passed to the subroutine, leading to an unexpected condition. This is the earliest occurrence of misbehavior on the part of Wine that I managed to come across. I don't know whether the problem lies in between the two calls or earlier in the execution of the program.
This is what ESP register looks like when entering subroutine 0x10004460 in bio3hd.asi under Windows: [esp+4] 0x0A761040 [esp+8] 0x00000500 <- 1280 [esp+C] 0x000003C0 <- 960 [esp+10] 0x00000140 <- 320 [esp+14] 0x0A88D040
This is what it looks like in Wine: [esp+4] 0x00000000 [esp+8] 0x028ADAC0 [esp+C] 0x00000500 <- 1280 [esp+10] 0x00000140 <- 320 [esp+14] 0x055BD000
Under Wine, the value representing the vertical resolution is missing from the stack.
https://bugs.winehq.org/show_bug.cgi?id=53775
--- Comment #8 from ShadowOne333 shadow_one666@hotmail.com --- That's really valuable information, Dario. So it seems like Wine somehow omits the opcode that properly sets the vertical resolution, then?
If possible, do you happen to know what part of the ASI itself can I modify via Hex editing to force the 960 vertical resolution in place of the 320? I want to check if I can force the 960 resolution with a Hex edit to test if that would have any effect when running on Linux.
https://bugs.winehq.org/show_bug.cgi?id=53775
--- Comment #9 from Dario dario86@tutamail.com --- @ShadowOne333, I am afraid it is not so easy. I had already tried forcing the proper resolution with a similar approach, but the game just crashed.
I stumbled upon your various posts and bug reports around the Net while looking for a solution a few months ago. I was determined to trace back the root of the issue and this is the furthest I have gotten so far.
I kept this activity on hold for a few months now. I will try again in the next days and I will keep you updated if I manage to come up with more.
https://bugs.winehq.org/show_bug.cgi?id=53775
--- Comment #10 from ShadowOne333 shadow_one666@hotmail.com --- Thank you for the response, @Dario. I have also been trying for months at this point to try to get this game and the HD mod to run on Linux to no avail. Seems to be the only one of the trilogy with this issue.
I appreciate it, I'll look forward to any further developments and updates towards this issue if you find any. I'll also post if I find anything new as well.
https://bugs.winehq.org/show_bug.cgi?id=53775
--- Comment #11 from Dario dario86@tutamail.com --- Created attachment 78219 --> https://bugs.winehq.org/attachment.cgi?id=78219 Configuration file for Bottles
https://bugs.winehq.org/show_bug.cgi?id=53775
--- Comment #12 from Dario dario86@tutamail.com --- At the moment I have no clean solution, but I devised a workaround. I hope I will be able to submit a proper fix in the near future. I am not a Wine developer nor am I affiliated to the authors of Seamless HD Project. I am just a random guy who spent months looking for a solution. If a developer wants to step in to help me out with this, I would be eager to detail my findings.
Note that DXVK is not strictly needed to run this game, but this is a very crude hack tied to a specific version of DXVK I happened to be using while working on this.
DXVK 2.5.3 IS NEEDED TO MAKE THIS WORK. IT WILL NOT WORK WITH A DIFFERENT VERSION.
These instructions are specific for Bottles and Gamescope from Flathub. Feel free to adapt to your setup.
- Install Bottles and Gamescope from Flathub: $ flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo $ flatpak --user install com.usebottles.bottles org.freedesktop.Platform.VulkanLayer.gamescope - Download the attached configuration file "Resident-Evil-3---Seamless-HD.yml". - Launch Bottles and import the configuration file. - In Bottles install "dxvk-2.5.3". In the bottle that was just created for the game disable and enable again "dxvk-2.5.3" to make sure it is properly configured. - Do all the stuff you would do on Windows to set up Resident Evil 3 - Seamless HD in the game prefix. - From the main directory of the game create a backup copy of bio3hd.asi and patch it to make it work with DXVK 2.5.3: $ cp bio3hd.asi bio3hd.asi.bak $ printf '\x28\xFF\x70\x24\xFF\xB0\x6C' | dd of=bio3hd.asi bs=1 seek=14446 conv=notrunc $ printf '\x28\xFF\x70\x24\xFF\xB0\x6C' | dd of=bio3hd.asi bs=1 seek=14491 conv=notrunc $ printf '\x28\xFF\x70\x24\xFF\xB0\x6C' | dd of=bio3hd.asi bs=1 seek=14584 conv=notrunc $ printf '\x28\xFF\x71\x24\xFF\xB1\x6C' | dd of=bio3hd.asi bs=1 seek=14702 conv=notrunc - Launch "BIOHAZARD(R) 3 PC.exe" to start the game. Press button "Best", uncheck "Force 240p backgrounds" and select "Direct Input" from "Controller input" drop-down menu. - Press OK to launch the game and hit F9 to quit. - As of writing this, Gamescope process will silently hang upon exit. I think this is a known issue. Kill the process with the following command: $ pkill -9 winedevice.exe