Skip to content
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 multi game XCIs (second try) #6515

Open
wants to merge 54 commits into
base: master
Choose a base branch
from

Conversation

TSRBerry
Copy link
Member

@TSRBerry TSRBerry commented Mar 16, 2024

I rebased this branch and fixed an issue that I saw. I mainly need more testing to make sure GTK and Ava are both working fine with these changes.

Note

I added a new command line argument (-i or --application-id) for Avalonia and GTK, which allows to launch a specific application from a multi game XCI.
This argument will be ignored if the specified application is not an XCI or if no application was specified on the command line.

What needs to be tested

For GTK and Avalonia I'd like to know if the following things work:

  • Can every game of a multi-game XCI/NSP be launched?
  • Can you extract sections (romfs/exefs) from multi-game XCIs/NSPs?
    • Even with some updates and/or DLCs enabled (including bundled ones)?
  • Does the bundled update of an XCI show up in the updater window?
    • Can the bundled update be disabled/enabled?
  • Can DLCs and updates be added to multi-game XCIs/NSPs?
  • Can DLCs and updates still be added to regular XCIs/NSPs?
  • If the bundled update/dlc is selected
    • will it be applied on launch from the GUI?
    • will it also be applied if you load the game from file (File > Load Application from File)?
    • and the update/dlc window is opened again are there no duplicated entries?
    • and you switch to the other GUI (either GTK or Ava) does the updater/dlc window still open without duplicate entries or other errors?

Fixes #6158
Fixes #6740
Fixes #6761


Original PR description from #5638

Huge thank you to @piplup55 for his patience and the large amount of testing he did for me while I was trying to make this work!

This PR refactors a lot of the code used for application loading to use .cnmt.nca files.

Before we needed a lot more logic for checks that can now be reduced to simple reads of values in the cnmt files.

I wrapped Cnmt in a ContentCollection class which can also get the referenced NCAs, so that should be pretty simple now as well.


Eventually we should also replace all ProgramIndex logic with reads from NACP, but that's for another PR.


Fixes #3234
Closes #1852

@TSRBerry TSRBerry added horizon Related to Ryujinx.HLE gui Related to Ryujinx.Ui needs-feedback The needs feedbacks from the community labels Mar 16, 2024
@ryujinx-mako ryujinx-mako bot requested review from AcK77, emmauss, gdkchan and a team March 16, 2024 22:34
@piplup55
Copy link
Contributor

piplup55 commented Mar 17, 2024

Issues

No Known issues

Features that work as intended:tm:

Updates can be applied to multi-xci games/can be enabled or disabled
image

Updates and dlc can be applied to non multi-xci games
image
image

No duplicate entries in gtk for updates
image

@erictbar
Copy link

Loaded ROBOTICS_NOTES DaSH v0 (010039A0117C0000) + ROBOTICS_NOTES ELITE v0 (01002A900EE8A000).xci
ELITE is the main game and DaSH is the spin-off. In 1.1.1239 only DaSH shows up in game list and loads from file menu.

In 1.1.0+b1bc5b9, both games do show up on my game list, and both load from the list.

However, when loading from the file menu, ELITE loads but with Loading Unknown and a generic icon. Though, the game does start.
image

I do not belive this game has any DLC or updates.

@ryujinx-mako ryujinx-mako bot requested a review from a team March 17, 2024 13:18
@TSRBerry
Copy link
Member Author

Thank you @piplup55 and @erictbar I think I addressed all the issues with my latest push. Builds will be ready in about 20 minutes if you want to test again!

@erictbar
Copy link

Thank you @piplup55 and @erictbar I think I addressed all the issues with my latest push. Builds will be ready in about 20 minutes if you want to test again!

Icon & title fixed when loading from File menu, both games still load from game list.

@TSRBerry TSRBerry requested a review from gdkchan March 17, 2024 20:35
@frafes
Copy link

frafes commented Mar 23, 2024

XCI files with multiple games are loading fine.

However it seems there is an issue when the game is bundled with multiple DLCs.
Loaded NAMCOT COLLECTION [010039F010E14000][v0].xci, the game is bundled with 10 DLCs but only one is loaded. If right click the game > Manage DLC in the GUI, it shows only 1 DLC.

The regular Ryujinx loads fine all 10 DLCs, but the emulator crashes when right click> Manage DLC.

@TSRBerry
Copy link
Member Author

Thank you, it should hopefully detect all of them now!

@OddOttAllen
Copy link

OddOttAllen commented Mar 26, 2024

Everything seems to be working just fine for me! I only have one game to test this with though, and that's Pikmin 1+2. It's working fine. Both games load and play, and their updates apply as well.

Though, I'm having sound issues with 1, and 2's title screen doesn't show up. I cannot tell if this is a bug with this feature or bugs with the games themselves, as these are the only copies of the game I have to test.

Hoping for the reviews and merge soon :)

@RinMaru

This comment was marked as off-topic.

@OddOttAllen

This comment was marked as off-topic.

@piplup55

This comment was marked as resolved.

@RinMaru

This comment was marked as off-topic.

@wzsx150
Copy link

wzsx150 commented Apr 1, 2024

Can it parse complex XCI files similar to Yuzu, including game updates, DLC, MODs, and cheats within the XCI file? It seems the official release doesn't support this yet. Is there a compiled win64 version .exe file included in this PR? I'd like to test whether it can handle complex XCI files.

@legolas119

This comment was marked as off-topic.

@TSRBerry

This comment was marked as resolved.

@legolas119

This comment was marked as resolved.

@GamerzHell9137

This comment was marked as resolved.

@frafes
Copy link

frafes commented Apr 22, 2024

With the latest commit it should be possible to create specific game shortcuts as well.

Shortcuts are working fine now, Thank you!

I tested a few more games (over 40 games) including multi-games.xci, single-game.xci and game.nsp and they all loaded fine, except 4 of them. These four games are single-game.xci:

  • MONSTER HUNTER STORIES 2: WINGS OF RUIN v1.0.1 [0100E21011446000]
  • Puyo Puyo™ Tetris® v1.0.0 [010073C001D5E000]
  • Puyo Puyo™ Tetris® 2 v1.0.0 [010038E011940000]
  • Splatoon 2 v1.0.0 [01003BC0000A0000]

All of these games load normally in the latest official version of Ryujinx.

I also noticed that with this PR the title-IDs of these four games are detected incorrectly:

zzz

I don't know if this issue occurs with any other untested game.

Error log: Ryujinx_1.1.0+c1ce433_2024-04-21_21-20-05.log

@TSRBerry
Copy link
Member Author

TSRBerry commented Apr 28, 2024

@frafes I hope this is fixed with my latest commit.

The solution for this is not as pretty as I hoped, but it should work and shouldn't cause any problems.
It's just something that will need more refactoring in the future I guess.

Move SaveDataOwnerId check to the top, since it seems to be more reliable.
This commit reverts some parts of 61615b8.
Since the issue wasn't actually related to the application id in CMNTs, we can remove the wrong assumptions.
@frafes
Copy link

frafes commented Apr 30, 2024

I hope this is fixed with my latest commit.

Thank you! All those games are loading fine.

While testing some more games I found a new issue:

When adding a game directory path to Ryujinx, the first game listed in that folder (in alphabetical order) cannot be launched either via command line or shortcut.

  1. If there is only one game/file in that folder: it fails to launch via command line or shortcut.

  2. If there are multiple games/files in that folder: all games can be launched, with the exception of the first one (listed in alphabetical order), when using the command line or shortcut.

However, if I remove the game directory path from Ryujinx (either in the GUI or by editing the PRConfig.json file), all games launch successfully via the command line or shortcut.

Tested both GTK and Avalonia versions, this issue occurs just with the Avalonia version. The latest official Ryujinx Avalonia version doesn't have this issue.

Log file: Ryujinx_1.1.0+6eb3a42_2024-04-30_00-08-27.log

@piplup55
Copy link
Contributor

When adding a game directory path to Ryujinx, the first game listed in that folder (in alphabetical order) cannot be launched either via command line or shortcut.

the log file you provided says it's being used by another process

@TSRBerry
Copy link
Member Author

If there is only one game/file in that folder: it fails to launch via command line or shortcut.

Do you get an exception and a stacktrace? If so could you post it?

@frafes
Copy link

frafes commented May 2, 2024

Do you get an exception and a stacktrace? If so could you post it?

No, I don’t get an exception and a stacktrace, sorry. Is there a way I can get it?

@TSRBerry
Copy link
Member Author

TSRBerry commented May 2, 2024

Odd, are you able to reproduce this on the command line, so you get to see everything?

@frafes
Copy link

frafes commented May 2, 2024

Odd, are you able to reproduce this on the command line, so you get to see everything?

It is basically the same that log file.
cmd_ryujinx_print
Tested in two different Windows 11 PCs, same result.

@TSRBerry
Copy link
Member Author

TSRBerry commented May 2, 2024

Seems like you are running multiple instances at once, or something else is accessing the files.

Doesn't look like an issue I could address here.

@frafes
Copy link

frafes commented May 2, 2024

Doesn't look like an issue I could address here.

No problem. Thank you so much for all your hard work!

P.S.: I don't know if it's related, but when I try to sort the game list by "name" in the GUI, Ryujinx crashes. All other sort options work fine.

Log file: Ryujinx_1.1.0+6eb3a42_2024-05-02_15-34-20.log

@TSRBerry
Copy link
Member Author

TSRBerry commented May 2, 2024

Does that happen on master as well?

@frafes
Copy link

frafes commented May 2, 2024

Does that happen on master as well?

It doesn't happen on master.

@TSRBerry
Copy link
Member Author

TSRBerry commented May 2, 2024

Looks like I'll need to investigate then, thank you!

@TSRBerry
Copy link
Member Author

TSRBerry commented May 3, 2024

Finally, it should be fixed now!

Anything else that came up during testing? :D

@frafes
Copy link

frafes commented May 4, 2024

Finally, it should be fixed now!

Thank you :)

About that issue, it also happens on Linux. It's odd because that issue doesn't happen on master.

Log file: Ryujinx_1.1.0+38c2cf8_2024-05-03_21-55-31.log

@TSRBerry
Copy link
Member Author

TSRBerry commented May 4, 2024

As the exception says, the file is used by another process. Make sure there is nothing else accessing the file and try again.
Most of the time this happens, people open Ryujinx twice.

@frafes
Copy link

frafes commented May 4, 2024

Unfortunately I couldn't find what is causing this. Anyway, if I find something new, I'll let you know. Thank you!

Copy link
Member

@AcK77 AcK77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should double check if Title is replaced by Application. I know there are a bunch of TitleUpdate even in windows. Maybe that could be renamed later here because it's out of scope here.

src/Ryujinx.Gtk3/UI/MainWindow.cs Outdated Show resolved Hide resolved
src/Ryujinx.Gtk3/UI/Widgets/GameTableContextMenu.cs Outdated Show resolved Hide resolved
src/Ryujinx.Gtk3/UI/Windows/DlcWindow.cs Outdated Show resolved Hide resolved
src/Ryujinx.Gtk3/UI/Windows/TitleUpdateWindow.cs Outdated Show resolved Hide resolved
src/Ryujinx.HLE/Switch.cs Outdated Show resolved Hide resolved
src/Ryujinx.HLE/Switch.cs Outdated Show resolved Hide resolved
src/Ryujinx.UI.Common/App/ApplicationLibrary.cs Outdated Show resolved Hide resolved
src/Ryujinx/Assets/Locales/en_US.json Show resolved Hide resolved
@TSRBerry
Copy link
Member Author

Let's do that in a separate PR, since this one is already large enough and I would need to change more strings than currently affected by this PR.

@ryujinx-mako ryujinx-mako bot requested a review from a team May 20, 2024 11:57
@TSRBerry TSRBerry requested a review from AcK77 May 20, 2024 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gui Related to Ryujinx.Ui horizon Related to Ryujinx.HLE needs-feedback The needs feedbacks from the community
Projects
None yet