-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
HLE: Refactoring of ApplicationLoader #4480
Conversation
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.
Took a quick look, I will likely submit another review after testing it a bit and checking out the changes locally.
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.
Just found a few typos
Ryujinx.HLE/Loaders/Processes/Extensions/PartitionFileSystemExtensions.cs
Outdated
Show resolved
Hide resolved
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.
lgtm, I tested it a bit here, but did not test it extensively, so it might benefit from more testing in different scenarios.
I'm not able to start homebrew applications with this PR. The crash below was produced using the hello-world example from switchbrew/switch-examples. crash snippet:
|
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.
Lgtm!
I'll ask for some community tests, before we merge this.
I tested cheats and homebrew applications, but haven't tested a lot of other stuff.
Tested Splatoon 3 with the Inkopolis DLC on Update 3.0.1. Everything seems good |
Tested Splatoon 3 with the Flexlion mod and DLCs, Hollow Knight, Resident Evil 4, and Dead Cells + DLC; all using the latest updates. No regressions found. |
With the amount of commits I'm adding, another review will be required.
I found a few more issues:
|
This avoids logging "Could not find Main NCA" followed by "Loading main..." when trying to start hbl.
Rebased, ready for another review! |
Ryujinx.HLE/Loaders/Processes/Extensions/FileSystemExtensions.cs
Outdated
Show resolved
Hide resolved
Ryujinx.HLE/Loaders/Processes/Extensions/PartitionFileSystemExtensions.cs
Outdated
Show resolved
Hide resolved
|
||
(bool success, ProcessResult processResult) = partitionFileSystem.TryLoad(_device, path, out string errorMessage); | ||
|
||
if (processResult.ProcessId == 0) |
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.
This seems a bit odd, is it using ProcessId == 0
as an indication that the load failed? Why does it not just check if success
is false
?
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.
Most of the other methods are doing this too (since they don't have a success
return value). So maybe it's better to keep it like this for the sake of consistency. Also I didn't check the case where it returns success
, so it's possible that it wouldn't even work here, but that would be a bit misleading (you would assume that if success
is true, everything loaded correctly).
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.
Yeah, it will only return true if loading succeeded here.
I agree it's a bit confusing, but wasn't sure to change the check here if we are doing it this way for every other load method like this.
This PR attempt to refactor
ApplicationLoader
in a better way for avoid duplicated code and helping in a potential multi-processes support in the future.In that way, some things are a bit "wrong" but should works as expected since we can only run one Application at a time.
I've done some loading testing but it could be nice to test different loading too, like Homebrew, NSP Homebrew, games using
jit
services, and more...