https://bugs.winehq.org/show_bug.cgi?id=40569
Bug ID: 40569 Summary: application crashes with exception in ddraw_allocate_handle (win98) Product: Wine Version: 1.9.9 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: directx-d3d Assignee: wine-bugs@winehq.org Reporter: o.dierick@piezo-forte.be Distribution: ---
Created attachment 54407 --> https://bugs.winehq.org/attachment.cgi?id=54407 Terminal output (wine 1.9.9)
I get a page fault in 32-bit code when starting a game in TOCA Touring Car Championship. This is an old game that requires windows version <= win98.
The demo also has the bug.
---begin quote--- ... wine: Unhandled page fault on read access to 0x00000110 at address 0x7e7fcf1d (thread 0028), starting debugger... Unhandled exception: page fault on read access to 0x00000110 in 32-bit code (0x7e7fcf1d). ... Backtrace: =>0 0x7e7fcf1d ddraw_allocate_handle+0x1d(t=0x10c, object=0x15f960, type=DDRAW_HANDLE_MATERIAL) [/home/olivier/Projets/wine-builds/1.9.9_x86/dlls/ddraw/../../../wine-git/dlls/ddraw/main.c:118] in ddraw (0x0033f478) ... ---end quote---
This is with git wine 1.9.9-35-gbd2999d and no patch.
https://bugs.winehq.org/show_bug.cgi?id=40569
Olivier F. R. Dierick o.dierick@piezo-forte.be changed:
What |Removed |Added ---------------------------------------------------------------------------- Hardware|x86 |x86-64
https://bugs.winehq.org/show_bug.cgi?id=40569
Jeff Zaroyko jeffz@jeffz.name changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|application crashes with |TOCA Touring Car |exception in |Championship crashes |ddraw_allocate_handle | |(win98) |
https://bugs.winehq.org/show_bug.cgi?id=40569
Michael Müller michael@fds-team.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |michael@fds-team.de
--- Comment #1 from Michael Müller michael@fds-team.de --- Created attachment 54476 --> https://bugs.winehq.org/attachment.cgi?id=54476 Hack to make game start (requires staging patch)
The backtrace is a bit misleading. The application fails to create a direct3d device and doesn't check for errors. The null pointer is then passed to d3d_material3_GetHandle resulting in the crash.
The creation of the device fails for two reasons. The application tries to create a render target in system memory which is only supported for the rgb emulation device / reference renderer on windows and not at all in Wine. Secondly the game tries to use a 8 bit surface as render target.
For the first problem (see bug 34906), Wine Staging contains a patch to work around this problem: https://github.com/wine-compholio/wine-staging/blob/master/patches/ddraw-Ren... The patch is not completely sufficient in this case as the game does not explicitly request a RGB device. I am not completely sure why this should work on windows, but there are different possible explanations (game expects a different ordering for ddraw devices, expects different d3d caps, ...). Anyway, I attached a hack which alters the patch to always allow creating render targets in system memory.
The second problem affects several older games as they expect that 8 bit surfaces can be used as render target. If I remember correctly, this is not possible with modern graphic cards and Wine therefore does not support it. You can easily add the necessary flags in the format array of Wine (see attached hack), but this will lead to some other issues as Wine does not properly handle color palettes for render targets. I have patches to fix some of them, but as long as Wine does not intend having support for P8 render targets at all, it does not make much sense to continue working on them.
The staging patch plus the attached hack are enough to make the game start and use the main menu.
https://bugs.winehq.org/show_bug.cgi?id=40569
tt_1 herrtimson@yahoo.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |herrtimson@yahoo.de
--- Comment #2 from tt_1 herrtimson@yahoo.de --- Medieval Total War suffers from a related error in the battle mode. While the 2d campaign mode works just fine, the battle mode has serious graphical glitches making it unplayable for the most.
I have tested the hack from #40488 which works for me up to this bigger patchset http://source.winehq.org/git/wine.git/?a=search&h=HEAD&st=commit&...
The staging patch plus the hack from this bug has not worked for me, I tried it with both wine-1.9.20 and 1.9.22 to no success at all. Got a ton of these errors (copied from the console)
fixme:d3d:surface_load_location Unimplemented copy from WINED3D_LOCATION_TEXTURE_RGB to WINED3D_LOCATION_SYSMEM for depth/stencil buffers. err:d3d:texture_resource_sub_resource_map Failed to prepare location.
https://bugs.winehq.org/show_bug.cgi?id=40569
Olivier F. R. Dierick o.dierick@piezo-forte.be changed:
What |Removed |Added ---------------------------------------------------------------------------- Depends on| |41903
https://bugs.winehq.org/show_bug.cgi?id=40569
winetest@luukku.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |winetest@luukku.com
--- Comment #3 from winetest@luukku.com ---
From bug 41903
@Henri V
That's not really a regression. The hack attached to bug 40569 adds WINED3DFMT_FLAG_TEXTURE to WINED3DFMT_P8_UINT, but texturing from indexed formats is not actually supported. Commit a6911a13b8e016e4d3ff0c6f7e1f49a6f1cf1bab correctly clears that flag. The hack should be updated to account for that.
So the hack should be updated now.
https://bugs.winehq.org/show_bug.cgi?id=40569
Józef Kucia joseph.kucia@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |joseph.kucia@gmail.com
--- Comment #4 from Józef Kucia joseph.kucia@gmail.com --- Created attachment 56404 --> https://bugs.winehq.org/attachment.cgi?id=56404 Updated hack
https://bugs.winehq.org/show_bug.cgi?id=40569 Bug 40569 depends on bug 41903, which changed state.
Bug 41903 Summary: TOCA Touring Car Championship crashes on startup https://bugs.winehq.org/show_bug.cgi?id=41903
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID
https://bugs.winehq.org/show_bug.cgi?id=40569
--- Comment #5 from Olivier F. R. Dierick o.dierick@piezo-forte.be --- (In reply to Józef Kucia from comment #4)
Created attachment 56404 [details] Updated hack
Thanks.
Updated hack works.
https://bugs.winehq.org/show_bug.cgi?id=40569
Olivier F. R. Dierick o.dierick@piezo-forte.be changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #54476|0 |1 is obsolete| | Attachment #56404|0 |1 is obsolete| |
--- Comment #6 from Olivier F. R. Dierick o.dierick@piezo-forte.be --- Created attachment 63672 --> https://bugs.winehq.org/attachment.cgi?id=63672 Updated hack wine-4.2
Patch applies cleanly on top of wine/wine-staging 4.2.
https://bugs.winehq.org/show_bug.cgi?id=40569
Olivier F. R. Dierick o.dierick@piezo-forte.be changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |evjeniy@mail.ru
--- Comment #7 from Olivier F. R. Dierick o.dierick@piezo-forte.be --- *** Bug 46705 has been marked as a duplicate of this bug. ***
https://bugs.winehq.org/show_bug.cgi?id=40569
Olivier F. R. Dierick o.dierick@piezo-forte.be changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|TOCA Touring Car |TOCA Touring Car |Championship crashes |Championship crashes | |(Revenant; No support for | |rendering into system | |memory)
https://bugs.winehq.org/show_bug.cgi?id=40569
Olivier F. R. Dierick o.dierick@piezo-forte.be changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|TOCA Touring Car |TOCA Touring Car |Championship crashes |Championship crashes |(Revenant; No support for |(rendering to 8-bit |rendering into system |surface) |memory) |
https://bugs.winehq.org/show_bug.cgi?id=40569
--- Comment #8 from Olivier F. R. Dierick o.dierick@piezo-forte.be --- (In reply to Olivier F. R. Dierick from comment #6)
Created attachment 63672 [details] Updated hack wine-4.2
Patch applies cleanly on top of wine/wine-staging 4.2.
Hello,
That is wrong: The patch depends on wine-staging.
Regards
https://bugs.winehq.org/show_bug.cgi?id=40569
joaopa jeremielapuree@yahoo.fr changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jeremielapuree@yahoo.fr
--- Comment #9 from joaopa jeremielapuree@yahoo.fr --- Bug still occurs with wine-6.5.
https://bugs.winehq.org/show_bug.cgi?id=40569
AdeC adec2011.ac@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |adec2011.ac@gmail.com
--- Comment #10 from AdeC adec2011.ac@gmail.com --- Bug still occurs in wine 8.1