Author Topic: Touhou on Wine Status  (Read 20572 times)

Momiji

  • Cya
Touhou on Wine Status
« on: June 08, 2009, 10:07:44 PM »
For those of us that run Touhou games under Wine, in Linux, there are two major bugs keeping things from working correctly.  One, the in-game text isn't rendered properly, due to Wine's lack of a full implementation of Windows' Device Independent Bitmap engine.  Two, Wine doesn't fully implement a specific DirectX dll (d3dx9_36.dll) that many later Touhou games use.  Using a native Windows file will work to a certain extent, but it can cause other problems as well.

Well the first problem has been a longstanding Wine issue, and it looks like there's been some major work done on developing a working DIB engine.  Here you can see the difference;  DIB engine disabled on top, enabled on the bottom.

As for the second problem, one of Wine's Summer of Code students is working on implementing texture, mesh, and font handling in Direct3D.  Hopefully this will cover the texture loading routines that're missing.

Anyway, I hope that all of the longstanding Touhou on Wine bugs get solved this year, preferably soon.  I build Wine from their git repository, so I test how things work between different builds.  I'll post here with any updates.

Momiji

  • Cya
Re: Touhou on Wine Status
« Reply #1 on: June 12, 2009, 01:07:26 AM »
An update:  I managed to get a Wine+DIB engine installer working.  It's a Gentoo ebuild, so if you're using Gentoo you can use it.  I just need to find a way to upload it somehow.  If you use Ubuntu there's a .deb here.  Whether or not it works, I don't know.

Anyway, the results aren't exactly perfect.  In general, you'll see the biggest difference with chat text and the music menu.  While before it looks practically invisible (see pictures above), it now alphas correctly.  But for me, all of that text is now very dark blue.  Some of the games didn't have problems before (mainly Seirensen), but now they do.  So YMMV.

Here's Bunkachou:
Before

After


Doesn't look like much difference, the text is still impossible to read.  But it's definitely getting somewhere.

Outside of that, only 3 games don't work at this point (at least for me).  Suimusou and Hisouten still need a fully-functional d3dx9_36.dll, and Kaeizuka crashes when loading a character.

[Edit]  I've found a patch implementing the DirectX texture function needed by Suimusou and Hisouten, but it's a bit of a pain to use.  I'll work on getting my installer to merge it, and what kind've results I get with it plus the DIB engine patches.
« Last Edit: June 12, 2009, 02:38:40 AM by Momiji »

Starks

Re: Touhou on Wine Status
« Reply #2 on: June 29, 2009, 02:30:17 AM »
Where can I find the D3DXCreateTexture patch and is it better than the native dlls?

Edit: Is this it? http://bugs.winehq.org/attachment.cgi?id=21373
« Last Edit: June 29, 2009, 02:52:04 AM by Starks »

Momiji

  • Cya
Re: Touhou on Wine Status
« Reply #3 on: June 29, 2009, 05:41:00 AM »
That'd be it.  I tried to convert that into an actual patch file for use with my Gentoo ebuild, and managed to get it working, but it doesn't seem to have any affect on SWR and IaMP.  So I'm still messing around with it.

[Edit]  Looks like there's been some changes to d3dx9_36, I'm going to need to regenerate my patch.
« Last Edit: June 29, 2009, 07:46:25 AM by Momiji »

Starks

Re: Touhou on Wine Status
« Reply #4 on: June 29, 2009, 09:17:01 AM »
Without D3DXLoadSurfaceFromMemory from the new git commits, this old patch is worthless.

Momiji

  • Cya
Re: Touhou on Wine Status
« Reply #5 on: June 29, 2009, 06:09:44 PM »
Yeah, I'm going to regenerate my patch file so it doesn't remove anything new, I'll post it here once I'm done.

Starks

Re: Touhou on Wine Status
« Reply #6 on: June 30, 2009, 02:17:56 AM »
Is there a way to have git do that or is it more or less a manual, painstaking process?

Momiji

  • Cya
Re: Touhou on Wine Status
« Reply #7 on: June 30, 2009, 05:32:40 AM »
Git makes the patch, but it'll also remove the newer d3dx9 stuff.  So you have to do a little patch editing to keep it in there.

Starks

Re: Touhou on Wine Status
« Reply #8 on: June 30, 2009, 06:44:18 PM »
I had tried doing it manually myself and wine compiled fine, but I was getting black screens during some of my apps that used dx9.

Starks

Re: Touhou on Wine Status
« Reply #9 on: July 05, 2009, 01:26:21 AM »
Here's Wai Ling's new patch. I modified a few things so that it applies cleanly with the latest git.

http://bugs2.winehq.org/attachment.cgi?id=22189

While everything compiles fine, I can't get the new code working on my Intel card and Wine is giving nothing but a black screen and sounds when I run my games.

Apparently D3DXLoadSurfaceFromMemory is still needed.
« Last Edit: July 05, 2009, 06:17:21 PM by Starks »

Momiji

  • Cya
Re: Touhou on Wine Status
« Reply #10 on: July 06, 2009, 06:29:21 AM »
Yeah, they're still working on the rest of that stuff under the GSoC project.

I updated my Gentoo ebuild with the complete patchset, everything compiled just fine.  SWR crashes, but IaMP seems somewhat useable.

Anyway, here's the ebuild and patchset in a tarball.  For anyone out there using Gentoo, just create your own private overlay and extract this into it (/usr/local/portage/private/app-emulation/wine/ is what I use for the ebuild, /usr/local/portage/private being my private overlay).

Just a heads up, for anyone that uses this, I've added two USE flags that toggle support for the two patchsets;  "dibengine" for the DIB Engine patch, and "dx9patch" for the d3dx9_36 patch.  So you can enable one or the other, or both, to experiment with them.  Just a heads up, my Portage programming skills are terrible, but hopefully this doesn't do anything crazy to your computer.  Lemme know if there're any problems with it.

Thanks for persueing the patch, hopefully this'll get into mainline Wine. =]
« Last Edit: July 06, 2009, 06:52:20 AM by Momiji »

Starks

Re: Touhou on Wine Status
« Reply #11 on: July 07, 2009, 06:02:01 AM »
Here's Tony's work.

http://tonwas.freefronthost.com/gsoc.php
http://neobrain.wordpress.com/
http://tonwas.freefronthost.com/gsocwork.tar.gz (June 16th and before LoadSurface code landed)

I shot him an email about a more up-to-date tarball with his LoadSurface work and he said it should be ready in a few days.
« Last Edit: July 07, 2009, 09:20:21 AM by Starks »

Momiji

  • Cya
Re: Touhou on Wine Status
« Reply #12 on: July 08, 2009, 12:27:18 AM »
Awesome.  If the patch doesn't immediately make it into Git, I'll add it to the patchset.

Someone should make some Debian/Ubuntu and Redhat binaries for this. =o

Momiji

  • Cya
Re: Touhou on Wine Status
« Reply #13 on: July 09, 2009, 06:03:52 PM »
I tried adding his patchset to my ebuild, but they fail to patch.  =/  Hopefully he releases his updated stuff soon, preferably into Git.

On the DIB engine side, Massimo (DIB engine dev) seems to be real busy IRL, so it looks like we might not see updates from him for awhile.  =[

Momiji

  • Cya
Re: Touhou on Wine Status
« Reply #14 on: July 22, 2009, 06:00:24 PM »
Tony updated his blog, with new stuff and his own Git tree.  Looks like he's going to start merging his work into mainline Wine now.

Tengukami

  • Breaking news. Any season.
  • *
  • I said, with a posed look.
Re: Touhou on Wine Status
« Reply #15 on: July 23, 2009, 12:39:56 AM »
Ah, that's good to hear. I'm happy to see we're not forgotten.

"Human history and growth are both linked closely to strife. Without conflict, humanity would have no impetus for growth. When humans are satisfied with their present condition, they may as well give up on life."

Momiji

  • Cya
Re: Touhou on Wine Status
« Reply #16 on: August 18, 2009, 05:10:54 PM »
GSoC has ended, and it looks like Tony's (mostly) done with his work.  Now he's to (hopefully) merge his 8000-some lines of code into Wine.

Re: Touhou on Wine Status
« Reply #17 on: August 18, 2009, 06:55:18 PM »
GSoC has ended, and it looks like Tony's (mostly) done with his work.  Now he's to (hopefully) merge his 8000-some lines of code into Wine.

Sounds pretty awesome. Since he's using git, it shouldn't take too long to merge it.

BigBrain

Re: Touhou on Wine Status
« Reply #18 on: August 20, 2009, 09:18:01 AM »
Hi everyone,
Just registered to thank everyone here for your support :D

About my patches -  I already tried to integrate my D3DXLoadSurfaceFromMemory implementation into mainline once, but it got rejected (sometimes it can be somewhat hard to get patches in...) which was why I decided to focus on other work than integrating first.
The problem with D3DXLoadSurfaceFromMemory is that this functions handles conversion from and to all possible Direct3D pixel formats and also supports several different filters (linear, trilinear, box, etc), so getting the design right is quite a critical task. Thus it still might need some time to get that in, but I'm trying to get it in as fast as possible. The good point is, once I got D3DXLoadSurfaceFromMemory upstream, the remaining functions shouldn't be that much of a problem anymore.
Until then, everyone can still try out the implementation from my git repository at http://repo.or.cz/w/wine/d3dx9TW.git?a=shortlog;h=refs/heads/Merge by either downloading one of the snapshots (big download, at least 70 MB) or using these three commands on top of an already existing Wine tree (small download, this just fetches the necessary patches):
git remote add TextureRemote git://repo.or.cz/wine/d3dx9TW.git
git fetch TextureRemote
git checkout -b Merge TextureRemote/Merge


Best regards,
    Tony

Tengukami

  • Breaking news. Any season.
  • *
  • I said, with a posed look.
Re: Touhou on Wine Status
« Reply #19 on: August 20, 2009, 09:20:05 AM »
... so does this mean I can play SWR at last?

(Welcome to MoTK, by the by.)

"Human history and growth are both linked closely to strife. Without conflict, humanity would have no impetus for growth. When humans are satisfied with their present condition, they may as well give up on life."

BigBrain

Re: Touhou on Wine Status
« Reply #20 on: August 20, 2009, 09:42:12 AM »
A D3DX9 implementation within Wine won't help much more than using a native dll, sorry :/

Tengukami

  • Breaking news. Any season.
  • *
  • I said, with a posed look.
Re: Touhou on Wine Status
« Reply #21 on: August 20, 2009, 09:49:20 AM »
I suck at fighting games anyway. Your efforts are appreciated.

"Human history and growth are both linked closely to strife. Without conflict, humanity would have no impetus for growth. When humans are satisfied with their present condition, they may as well give up on life."

Momiji

  • Cya
Re: Touhou on Wine Status
« Reply #22 on: August 21, 2009, 06:44:34 PM »
Hi everyone,
Just registered to thank everyone here for your support :D
Awesome, and welcome. XD  I'll work on my Gentoo ebuild to see if I can get it to patch from your Git.  Anyway, thanks for all the work you're doing on Wine!  Hope to see your work merged in without problems.