0x0ade / XnaToFna

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

Add "Platform" modes, isolate tools based on target #13

Open flibitijibibo opened 5 years ago

flibitijibibo commented 5 years ago

A big problem I'm having with XnaToFna's out-of-the-box experience at the moment is that it's doing a LOT of work that it doesn't necessarily need to; this commit gets what I've found so far...

https://github.com/0x0ade/XnaToFna/commit/678f847ee5055f3240e21ffa438013dcb550efc8

... but now that we have Proton on the table, it may be worth reconsidering the UX to act in three modes:

All other options should be disabled and only enabled upon request when doing research-y things (stuff like force-anycpu, for example).

The idea is that we can potentially make it so Proton XNA games can just pull in an XnaToFna-Proton zip that includes XnaToFna, FNA 18.10, and fnalibs Windows x86, run in Windows Mode, then the game can execute under wine-mono without having to worry about the C++/CLI compat issues.

0x0ade commented 5 years ago

In my opinion, "Windows mode" should be the default, containing a set of "sensible" defaults (f.e. fixing Forms). And to some extent, it already is, but I need to minimize the set of options enabled by default (f.e. fixing P/Invoke, BinaryFormatter, reflection).

"Linux mode" wouldn't enable case-sensitivity fixes, but rather options such as the P/Invoke fixes.

Path case-sensitivity is entirely opt-in on a per-method basis, as it's only required when MONO_IOMAP isn't enough (i.e. when passing a path to a native library).

"X360 Mode" is an entirely beast altogether. It currently contains more GamerServices-, Net- and XDK-related stubs than I can count on my hand.

I'll get to working on slimming down the default enabled options.

0x0ade commented 5 years ago

Switched to using Mono.Options to parse the command line arguments. XnaToFna now accepts a --profile parameter:

https://github.com/0x0ade/XnaToFna/blob/1b83dc70be31d1a1ca00893205626ed7645e6d5e/src/Program.cs#L29-L61

"Windows", "Linux" and "360" should map to forms, forms and minimal.
default enables a few defaults which I personally deem "sane" to be enabled out of the box for quick hackports, f.e. fixing BinaryFormatter and reflection.

All other features can be enabled or disabled manually. For a completely barebones experience, you could use --profile=minimal --relinkonly=true FNA.dll Game.exe

Is this good enough?

flibitijibibo commented 5 years ago

I'll try this out on Monday or Tuesday - my main concern is just making it easy enough to use for Proton, which usually means "no extras, no parameters, no nothing" as a really hard rule. If it works for our known catalog, this should be good.