ValveSoftware / Proton

Compatibility tool for Steam Play based on Wine and additional components
Other
23.97k stars 1.05k forks source link

Touhou Fantastic Danmaku Festival Part II (1031480) #3657

Open williewillus opened 4 years ago

williewillus commented 4 years ago

Compatibility Report

System Information

I confirm:

steam-1031480.log

Symptoms

Pre-launch configure screen comes up successfully, but clicking through that leads to the game exiting -- the main window never comes up. Probably same reason as the prequel to this game (#2114)

Reproduction

Launch the game and hit start on the pre-launch configuration screen.

flibitijibibo commented 4 years ago

This one seems to be a GDI issue?

[00000039:] EXCEPTION handling: System.ArgumentException: The requested FontFamily could not be found [GDI+ status: FontFamilyNotFound]
[00000039:] EXCEPTION handling: System.ArgumentException: 'CP1252' is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.
Parameter name: name
madewokherd commented 4 years ago

Eh, winforms always does that.

But, I just noticed this: 124711.074:0038:0039:trace:mscoree:ReallyFixupVTable 006FD1E8,02080000,L"Z:\\data\\SteamLibrary\\steamapps\\common\\Touhou FDF Part II\\Microsoft.Xna.Framework.Graphics.dll"

That means we're using the real XNA instead of FNA, so no surprise it doesn't work. The override code must not work right when the dll's are in the application directory.

regrettable commented 3 years ago

But, I just noticed this: 124711.074:0038:0039:trace:mscoree:ReallyFixupVTable 006FD1E8,02080000,L"Z:\\data\\SteamLibrary\\steamapps\\common\\Touhou FDF Part II\\Microsoft.Xna.Framework.Graphics.dll"

That means we're using the real XNA instead of FNA, so no surprise it doesn't work. The override code must not work right when the dll's are in the application directory.

None of the instructions on winedb/protondb helped me before this. I guess it makes sense, if you want to play the game, just remove all the dlls. Thanks a lot though, I've reinstalled both games like 5 times, and only got to play a little bit before this.

williewillus commented 9 months ago

Hmm, recently I've been getting a different problem. The game starts and I can start a run successfully, but once I reach a boss I get a GDI related error:

[22:01:48]
System.ArgumentException: A null reference or invalid value was found [GDI+ status: InvalidParameter]
  at System.Drawing.GDIPlus.CheckStatus (System.Drawing.Status status) [0x00098] in <fc2ea6474c6d4315858618f13de6e72a>:0 
  at System.Drawing.Bitmap..ctor (System.Int32 width, System.Int32 height, System.Drawing.Imaging.PixelFormat format) [0x00016] in <fc2ea6474c6d4315858618f13de6e72a>:0 
  at (wrapper remoting-invoke-with-check) System.Drawing.Bitmap..ctor(int,int,System.Drawing.Imaging.PixelFormat)
  at Microsoft.Xna.Framework.SpriteFontX.addTex (System.Char chr) [0x0008f] in <03ed30b1955b4102b4cadc0c09055462>:0 
  at Microsoft.Xna.Framework.SpriteFontX.Draw (Microsoft.Xna.Framework.Graphics.SpriteBatch sb, System.String str, Microsoft.Xna.Framework.Vector2 position, Microsoft.Xna.Framework.Vector2 maxBound, Microsoft.Xna.Framework.Vector2 scale, Microsoft.Xna.Framework.Color color) [0x00082] in <03ed30b1955b4102b4cadc0c09055462>:0 
  at Microsoft.Xna.Framework.SpriteFontX.Draw (Microsoft.Xna.Framework.Graphics.SpriteBatch sb, System.String str, Microsoft.Xna.Framework.Vector2 position, Microsoft.Xna.Framework.Color color) [0x00018] in <03ed30b1955b4102b4cadc0c09055462>:0 
  at THMHJ.Dialog.Draw (Microsoft.Xna.Framework.Graphics.SpriteBatch s) [0x003cc] in <03ed30b1955b4102b4cadc0c09055462>:0 
  at THMHJ.Game.SDraw (THMHJ.NSpriteBatch s) [0x00385] in <03ed30b1955b4102b4cadc0c09055462>:0 
  at THMHJ.Main.Draw (Microsoft.Xna.Framework.GameTime gameTime) [0x00065] in <03ed30b1955b4102b4cadc0c09055462>:0 
  at Microsoft.Xna.Framework.Game.Tick () [0x0026c] in <ac49f792d1924f2ca9e12200b1e6ae07>:0 
  at Microsoft.Xna.Framework.Game.RunLoop () [0x0001f] in <ac49f792d1924f2ca9e12200b1e6ae07>:0 
  at Microsoft.Xna.Framework.Game.Run () [0x00035] in <ac49f792d1924f2ca9e12200b1e6ae07>:0 
  at THMHJ.Program.Main (System.String[] args) [0x0006b] in <03ed30b1955b4102b4cadc0c09055462>:0 

To reproduce, just press Z repeatedly at the menu to enter the game with the default shot (or pick easy mode when the choice comes up for easier repro). When you reach the end of stage 1, the game will crash when the boss enters. This happens with all the XNA dll's and stuff intact and untouched.

madewokherd commented 8 months ago

That means we're using the real XNA instead of FNA, so no surprise it doesn't work. The override code must not work right when the dll's are in the application directory.

FWIW, this comment is doubly no longer relevant. Load order was fixed so FNA is being used now, and Wine Mono has advanced to the point that the real XNA can sometimes work if configured to use it (by setting WINE_MONO_OVERRIDES=Microsoft.Xna.Framework.*,Gac=y). Since this appears to be an issue in a support library, I doubt it will make a difference which one is used though.

madewokherd commented 8 months ago

It's a gdiplus bug. The game calls GdipMeasureString with just the newline character "\n" which returns 0x0, then it tries to create a Bitmap with that size, which fails. I guess "\n" should have a non-zero size.

I confirmed that by hacking around it with this modification, but that's obviously not the correct solution:

diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index ea6a6ba3874..cbc473e59e2 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -5615,6 +5615,13 @@ GpStatus WINGDIPAPI GdipMeasureString(GpGraphics *graphics,
     if (temp_hdc)
         DeleteDC(temp_hdc);

+    TRACE("<- %s\n", debugstr_rectf(bounds));
+
+    if (bounds->Width == 0.0)
+        bounds->Width = 1;
+    if (bounds->Height == 0.0)
+        bounds->Height = 1;
+
     return Ok;
 }
madewokherd commented 8 months ago

I just pushed a hack, so this should work with Experimental on the bleeding-edge beta.