Updates to the netplay netpacket interface #15887
Merged
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.
Description
My last PR (#15797) on this feature fixed a bug where a connecting client could lose their local SRAM data due to it getting overwritten by the SRAM data of the host. This originally didn't occur to me because my main focus was on a core that doesn't use SRAM via the
retro_get_memory_data
libretro interface.I prepared this PR together with @davidgfnet who is in the process of implementing this interface in the gpSP GBA libretro core. We realized that even with the fix in that last PR, RetroArch 1.16 was released before the fix was made. The issue only affects cases where a core registers the interface via environment call 76 (
RETRO_ENVIRONMENT_SET_NETPACKET_INTERFACE
) which at this point still is not used by any released core. But if such a core were released, it could cause a player using RetroArch 1.16 to lose SRAM data.Therefore this PR deprecates environment call 76 and moves it to 78 (the same way 20 (
RETRO_ENVIRONMENT_SET_AUDIO_CALLBACK
) was moved to 22). This means only the next release of RetroArch will support this interface and the cores that make use of it.We took advantage of this switch to also improve the interface in a few ways to make it easier to use and clarify some points about it while adding some features as well:
RETRO_NETPACKET_BROADCAST
constant insteadRETRO_NETPACKET_FLUSH_HINT
andretro_netpacket_poll_receive_t
) to make lower latency communication easierRelated Issues
Related Pull Requests
Reviewers
@davidgfnet