0x0ade / XnaToFna

Relink games / tools using the XNA Framework 4.0 to use FNA instead
zlib License
53 stars 5 forks source link

Develop Steam-FNA (Codename Rhys) #19

Open flibitijibibo opened 5 years ago

flibitijibibo commented 5 years ago

As part of the Proton project, Steam now has a system set up for "compatibility tools", allowing games marked for one OS to run on another using an arbitrary program. The common case is Wine, but it is possible for other tools to run Windows-only depots, for example steam-dos:

https://github.com/dreamer/steam-dos

It should be possible to develop a compatibility tool that provides FNA (including FNA.NetStub and the ABI files) and XnaToFna. We can optionally provide the ability to convert WMA/WMV via a system FFmpeg installation.

The current WIP can be found here:

https://github.com/0x0ade/XnaToFna/tree/master/rhys

The checklist:

Note that this does NOT replace the Proton FNA work; many games will never be compatible with Steam-FNA due to C++/CLI binaries, really bad native interop in game engines, and so on.

Games of Interest (WMA/WMV/xWMA Included):

Blocked by Win32 Stuff:

Blocked by DInput:

Blocked by C++/CLI:

Blocked by Who Knows

flibitijibibo commented 4 years ago

Updating this... it seems like it'd be a lot less work if we just used the system's Mono runtime. Many distributions are reasonably up-to-date, and there are also official repos that always have the latest version:

https://www.mono-project.com/download/stable/

So now Rhys can just be a quick and dirty tool to add the FNA ABI files to an existing runtime's MONO_PATH, which is the only unique thing the tool would have been doing anyway.

flibitijibibo commented 4 years ago

Rhys folder now exists:

https://github.com/0x0ade/XnaToFna/tree/master/rhys

harry-cpp commented 4 years ago

Stardew Valley

It has a Mac/Linux version, why is it included?

flibitijibibo commented 4 years ago

It's popular enough to warrant trying to run it anyway. We happen to be fully compatible with the Windows version if you redirect the WinForms calls properly!

harry-cpp commented 4 years ago

Ah, makes sense.

flibitijibibo commented 4 years ago

It works now!

Screenshot from 2020-02-20 11-25-23

We're now pretty much dependent on #13 and #16, once those are done we can poke XnaToFna into the firsttime function and that should get the ball rolling for a good chunk of the games. The Steamworks.NET swap is a whole other feature but it shouldn't be too hard, I think...

flibitijibibo commented 4 years ago

Steamworks.NET integration is in:

https://github.com/0x0ade/XnaToFna/commit/24116872ebe5d8bfd4ebce2eba8386799deda33f

XnaToFna is the last item on the list.

rfht commented 4 years ago

FYI Amazing Princess Sarah runs on OpenBSD after updating Nuclex.Input. That makes me think it should be achievable to run it in Proton...

flibitijibibo commented 4 years ago

I've just been made aware of an extremely bad regression that was made by design in Mono 6.0 and newer: https://github.com/mono/mono/issues/15845

Short version: We can't use IOMAP and will have to implement case-sensitive filesystem support ourselves.

flibitijibibo commented 4 years ago

Update on this: Discussions to preserve IOMAP went horribly, because the .NET Foundation isn't interested in making existing programs work. So, we have our own patchset for Mono now:

https://github.com/flibitijibibo/MonoKickstart/tree/master/patches

This can be used to build a good version of Mono, so we're back to distributing our own CLR.