[WIP] np: Stub functionality for Simulated NP #16582
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With the network mode set to "Simulated" for a game, almost any attempt to actually use NP functions results in the emulator throwing an exception from the game thread since RPCN tries to be accessed. Since if a game thinks it's connected it's probably going to use NP features, the game should at the very least not crash and be fed dummy data.
Since a full implementation would be a larger undertaking and might need codebase changes, I'm sending in as a draft for opinions on how it should be implemented. Currently it's just checking if the current PSN status isn't RPCN and then returning a fake response in the np_handler functions.
PR status: sceNpBasicGetBlockListEntryCount, sceNpBasicGetFriendListEntryCount and sceNpManagerRequestTicket2 no longer crash the guest (required for BLES01222), other functions (creating lobbies etc) probably do.