-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for UWP and the Xbox platforms #11339
base: master
Are you sure you want to change the base?
Conversation
62f6822
to
e4c6b25
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove packages.config
when theres nothing inside?
Also, the project file noise seems "meh". Not sure if collapsing those auto-generated project configurations into more terse and localized versions is something you can (or want to) do though.
Cool stuff! Is there going to be CI hooked up for these build paths? If not, then I'm hesitant to merge this further down the line, since there's nothing preventing the build types from breaking in the future. |
Cool stuff, indeed! Thank you :) |
@SirMangler and @ReveriePass, how you "linked" SDL2 (uwp edition) to DolphinUWP "executable"? SDL-UWP configured to generate dll, not .lib, yea? On compiling via latest VS 2022 Preview, DolphinUWP tried to link .lib, but linker generates error LINK : sdl2-uwp.lib not found... |
Please take a look at the existing msbuild code and make your PR adapt what's already there instead. >90% of these changes (to msbuild files at least) are not needed. |
@@ -0,0 +1,347 @@ | |||
<?xml version="1.0" encoding="utf-8"?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please rewrite this file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cleaned out some of the VS-generated mess. I would appreciate some more direction if you think it's needed.
{D79392F7-06D6-4B4B-A39F-4D587C215D3A} = {D79392F7-06D6-4B4B-A39F-4D587C215D3A} | ||
EndProjectSection | ||
EndProject | ||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2-UWP", "..\Externals\SDL\SDL\VisualC-WinRT\SDL-UWP.vcxproj", "{89E9B32E-A86A-47C3-A948-D2B1622925CE}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should probably use our existing vcxproj (+related) and not this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean the use of the SDL-UWP project or something else? We do need the UWP specific project or we will run into runtime errors (as you might expect).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean that we should use Dolphin's existing vcxproj for SDL and just add some stuff to it as needed for UWP build (I imagine it's just setting some preprocessor macros or so?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took a look into this, unfortunately it's not as simple as just setting a macro and changing the project type to Windows Store/UWP. There's a bunch of WinRT specific files that need including, some of which conflict with existing non-WinRT files, likely part of why SDL made this seperate in the first place. It's a bit of a mess to sort out and do this cleanly.
Source/Core/Core/HW/GCPadEmu.cpp
Outdated
m_buttons->SetControlExpression(2, "`C`"); // X | ||
m_buttons->SetControlExpression(3, "`S`"); // Y | ||
m_buttons->SetControlExpression(4, "`D`"); // Z | ||
#if _UWP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to make this a runtime check? Maybe detect if the pad is xbox? (it seems useful even on non-xbox console / non-uwp). Or just detect if on xbox.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can check at runtime if this is an Xbox device, though this might not be needed. All UWP supported Xbox models see the controller as 'Xbox One Game Controller', regardless of if the app is running on a Series S/X or One (X).
Another functionality that should probably be cut out for Xbox build is Dolphin's Updater. |
UWP apps cannot autoupdate? Very interesting to know.. thank you |
They can, but the process is entirely handled by the Microsoft Store. No need for the app to implement an auto-updater of its own (like our Win32/macOS versions)... |
Wow... i forgot about MSStore-side deals ) Thank you very much for smart advice. Nice to know something new about this meshanism. |
4d1a66b
to
3d6b0f6
Compare
I'm working on some changes and will post it here once done. |
@SirMangler have you tried just packaging the app as msix and setting TargetDeviceFamily to See https://github.com/shuffle2/dolphin/commit/9df158c2d95f6edf2c446ea7407baa7e9480b4d7 Maybe it Just Works? I don't have an xbox to test. I'm still working on cleaning up this PR as-is... |
@SirMangler ok I made a commit on top of this PR here: [EDIT: see later comments] Currently it requires a patch libsdl-org/SDL#6866 to SDL to fix some warnings. In general, SDL is using C++/CX instead of C++/WinRT which is why it's so painful. I got it working as a static lib (well, at least it compiled). It takes care of all my concerns except for the signing stuff. I just haven't gotten to it yet (and I don't really have a way to test). |
btw, it is also possible to create a new for example, you can see how GDK adds Platforms (extract the The annoying thing from Dolphin's point of view is that this typically requires adding files to the VS install directory, something we don't want to require. However, it is possible to set This would be nicer than overloading |
I revised the PR here: https://github.com/shuffle2/dolphin/commit/2c3276ef27c081b6a6d5b91de9a57b98e27d038c Notably the UWP builds generate this warning:
...which I think would be resolved if you used something like the msix packaging I linked earlier. But it's not super important to solve at the moment (as long as it actually runs on xbox). edit: thinking about this again, it would be much better to just not add any project configurations for the uwp/xbox target, and instead modify the code to fully differentiate at runtime. The only thing that actually needs to specifically target xbox is the main app project. This also prevents needing to build the entire solution twice, even though 99% of the code+options are identical. All the current instances of |
For future reference: the enums returned by |
That only applies to apps being provided through the retail store. Microsoft will never permit this to be there (just like every other emulator ever made) and the only use that the Dophin Dev team would likely officially support is Developer mode. I think it'd be better to follow RA's example with the built-in core updater and use Dolphin's update system if possible. |
UWP packaged apps can't overwrite themselves, so the existing updater would need a refactor. This probably is outside the scope of this PR too, as the focus now is bringing initial UWP support... |
Sorry to sound like an idiot but ive come trying to download dolphin on my xbox but have absolutely no idea what anything in the past 3 places ive looked means😂. Where do I go to download dolphin on xbox cause in that youtube link, the dolphin app was already installed? |
|
Are there any plans to merge this? Thanks |
I'm incredibly excited to present this PR to introduce basic support for UWP. The current devices tested under UWP include:
Currently the UWP frontend is basic, including a file picker to select games and a 'protocol' for frontends to use to launch Dolphin, including Retropass. The 'Dolphin Emulator' settings folder is stored inside
LocalState
in the app folders.Changes to the overall solution include the addition of the new configurations
Release UWP
andDebug UWP
. These exist so that we may define our own macro for UWP, as the existing ones offered by Microsoft do not allow us to easily differentiate between Xbox and Win10, and larger changes to the project would be required to account for the specific device being used on a 'windows platform'.The differentiation is necessary to disable DInput, OpenGL and Vulkan, as well as to disable the use of Win32 handles (such as in the lib usb code).
Demonstration (Courtesy of @ReveriePass, who was an instrumental help to this project):
https://www.youtube.com/watch?v=80ko2clLz2M