2627 Commits

Author SHA1 Message Date
Dentomologist 6de526c684 Merge pull request #14716 from tom-pratt/chat-message-colours
Android: Coloured netplay chat messages
2026-07-09 12:25:06 -07:00
Dentomologist 2e07d3b4a8 Merge pull request #14702 from JosJuice/android-vibration-usage
Android: Set USAGE_MEDIA for rumble
2026-07-08 17:25:54 -07:00
JosJuice 424269ed4b Android: Silence deprecation warnings in ControllerInterface
We have to use the deprecated APIs when running on old devices.
2026-07-08 23:13:07 +02:00
Tom Pratt 11cf49de06 Android: Coloured netplay chat messages 2026-07-07 23:26:06 +02:00
Dentomologist 774200dcf4 Merge pull request #14689 from JosJuice/android-internal-resolution-display
VideoCommon: Use XFB for internal resolution stats
2026-07-05 13:28:31 -07:00
JosJuice 2dfb23267c Merge pull request #14619 from JosJuice/no-si-change-device
Core: Remove SerialInterfaceManager::ChangeDevice
2026-07-05 17:33:02 +02:00
JosJuice d27d96a7ce Merge pull request #14623 from Simonx22/android/convert-eglhelper-to-kotlin
Android: Convert EGLHelper to Kotlin
2026-07-05 17:32:27 +02:00
JosJuice 0baa4ae6b1 Merge pull request #14624 from Simonx22/android/convert-filebrowserhelper-to-kotlin
Android: Convert FileBrowserHelper to Kotlin
2026-07-05 17:32:17 +02:00
JosJuice f5d225691e Android: Set USAGE_MEDIA for rumble
This lets rumble work even if the user has turned off the Android
setting Sound and vibration > Vibration and haptics > Interactive
haptics > Touch feedback. Rumble can still be disabled through Dolphin's
controller bindings and through in-game settings (GameCube) or SYSCONF
(Wii).
2026-07-05 10:23:12 +02:00
JosJuice be1df92153 Rename "Show Internal Resolution" to "Show XFB Resolution"
To make it extra clear that this is measuring the XFB, not the EFB.
2026-07-05 10:20:15 +02:00
JosJuice db77b117d9 Android: Add missing graphics debug settings
These are available in DolphinQt, so let's make them available in the
Android GUI too.
2026-07-05 09:50:13 +02:00
JosJuice b1d81af9cb Android: Fix release build
We don't need to see Compose previews when making a release build, but
androidx.compose.ui.tooling.preview.Preview is referenced in the source
code nonetheless, so the build system needs to know what it is.
2026-06-29 18:47:10 +02:00
JMC47 e2ab15aa23 Merge pull request #14647 from tom-pratt/netplay
Android netplay
2026-06-28 12:38:55 -04:00
JosJuice 200e26c98a Core: Remove SerialInterfaceManager::ChangeDevice
Now SerialInterfaceManager::UpdateDevices reads the configured SI
devices directly from Config instead.

The main reason why I wanted to do this is so that Android can change SI
devices while emulation is running. (Android didn't have the code for
calling ChangeDevice.) But when implementing the change, I noticed that
NetPlay and Movie were using ChangeDevice as a way of overriding the SI
devices configured by the user. Replacing this ended up making the change
larger than I first anticipated.

For Wii Remotes, there was no equivalent to ChangeDevice, so NetPlay and
Movie were using Config::SetCurrent to override the Wii Remote source
configured by the user. If we can use the config system to override Wii
Remote sources, why not do the same for SI devices? This commit makes
NetPlay and Movie set SI devices and Wii Remote sources in the NetPlay
and Movie config layers, as that is the conceptually appropriate place
to do it.

As far as I can tell, the old Movie code for overriding SI devices and
Wii Remote sources didn't actually work. This new code does. I didn't
investigate exactly why it didn't work, but maybe it's because loading
a movie happens before emulation actually starts.
2026-06-28 10:43:31 +02:00
Dentomologist 9b4534328f Merge pull request #14631 from Simonx22/android/convert-directoryinitialization-to-kotlin
Android: Convert DirectoryInitialization to Kotlin
2026-05-25 12:39:14 -07:00
Admiral H. Curtiss d3217f65c3 Merge pull request #14506 from adamscott/crop-that-screen
Add screen crop feature
2026-05-23 20:53:31 +02:00
Tom Pratt 1d1c9696ae lint formatting 2026-05-19 12:03:02 +02:00
Tom Pratt 5b49060a9d Fix NetplayScreen edge to edge
NetplayScreen was not drawing under the bottom nav bar like other screens. In landscape mode half of the screen scrolls and half is fixed, to make this look natural with edge to edge, provide a fade on the bottom of the scrolling side so things look natural when the screens loads and is resting at 0 scroll offset.
2026-05-19 12:03:02 +02:00
Tom Pratt fde035dc0c Replace hardcoded save progress string 2026-05-19 12:03:02 +02:00
Tom Pratt 8d565e0331 Use the dual pane netplay screen layout only if the width is sufficient
To avoid using dual pane layout on very small devices, ensure that the current width available for display is at least medium (600dp).

It also has to be landscape, the dual pane mode looks weird on a tablet in portrait mode since there's not that much content.
2026-05-19 12:03:02 +02:00
Tom Pratt 4d1e749977 WithSession helper function
Handles the repeated boiler plate of using a weak reference to NetplaySession from NetplayUICallbacks
2026-05-19 12:03:02 +02:00
Tom Pratt 06cc09cf09 Pass immutable games list to NetplayUICallbacks
Remove corresponding jni config.

Rename Netplay to NetplaySession in jni config to match new kotlin name.
2026-05-19 12:03:02 +02:00
Tom Pratt f63b81dd39 Use unique_ptr when creating netplay client / server 2026-05-19 12:03:01 +02:00
Tom Pratt 22863b3703 Add @Keep annotation to Player constructor
Since it's only instantiated from c++.
2026-05-19 12:03:01 +02:00
Tom Pratt 1bc64a0e6e Fix netplay license headers 2026-05-19 12:03:01 +02:00
Tom Pratt df5e7a9767 Update compose dependencies
Was using 2025 instead of 2026! Fixed some buggy bottom sheet behaviour.

Minor tidying of the chat UI in the bottom sheet
2026-05-19 12:03:01 +02:00
Tom Pratt 4c0bf2944b Implement DoAllPlayersHaveGame() check 2026-05-19 12:03:01 +02:00
Tom Pratt 76ae445694 Add network mode picker for host 2026-05-19 12:03:00 +02:00
Tom Pratt 1c2806dfe9 Add host buffer settings for fair input delay mode
Also rename max buffer to client buffer for better consistency with settings and c++
2026-05-19 12:03:00 +02:00
Tom Pratt 86de5ef4b0 Handle traversal state changes and errors
Traversal connections show in the joining info UI.
Non fatal errors show the retry button.
Fatal errors end the netplay session.
2026-05-19 12:03:00 +02:00
Tom Pratt 86a0f22887 Show joining info for local and external IP addresses
Doesn't support traversal yet
2026-05-19 12:03:00 +02:00
Tom Pratt 6655672ee3 Add ability to choose game when hosting
Also fix bottom sheets so they survive rotation
2026-05-19 12:02:59 +02:00
Tom Pratt 68e9fd6cde Send own messages to chat
A player's own messages don't come back via the server.
2026-05-19 12:02:59 +02:00
Tom Pratt 77f08364db Create NetPlayServer and start game 2026-05-19 12:02:59 +02:00
Tom Pratt b63ccacdfa Hosting UI 2026-05-19 12:02:59 +02:00
Tom Pratt f9baecd5ed Implement OnMsgPowerButton 2026-05-19 12:02:59 +02:00
Tom Pratt acbf9e155f Game digest progress dialog
We just about get away with using a StateFlow in NetplaySession since the host sends AbortGameDigest when closing their own dialog. Without that it would be harder for the UI to distinguish between subsequent dialogs. If that wasn't the case then NetplaySession might need to expose the individual progress and result updates and have the view model assemble it into the overall GameDigestProgress.
2026-05-19 12:02:58 +02:00
Tom Pratt 117d1d71ac Handle desync messages
Show them in the chat window and also in a toast during game play.
2026-05-19 12:02:58 +02:00
Tom Pratt abd324e98d Make NetplaySession not a singleton
Create a new NetplaySession each time we try to join a netplay game. Hold onto it in NetplayManager so its available to the different activities that need to access it. Close the session when backing out of the netplay UI. Some guardrails in case things go out of sync: creating a session closes the old one if it is still around for some reason, finalizer in NetplaySession to release native resources if not closed explicitly for some reason. Profiling done to ensure all kotlin and native objects are successfully cleared / garbage collected.
2026-05-19 12:02:58 +02:00
Tom Pratt 183d6d778c Use existing settings API instead of custom jni calls 2026-05-19 12:02:58 +02:00
Tom Pratt 8141a74671 Show save transfer progress
When transferring saves from the host. Equivalent of ChunkedProgressDialog in QT.
2026-05-19 12:02:57 +02:00
Tom Pratt 480968f05e Dont try to load temporary save states when launching netplay
An orientation change can trigger this code path immediately when a game starts. e.g. dolphin is portrait when launching the game but settings force gameplay to landscape. We want to avoid this and continue to the netplay launch code below.

If the user backgrounds dolphin during netplay and then resumes after the process has died it will actually resume from the save state in single player mode, not sure if thats good or bad but fine for now.

Netplay doesnt handle rotation very well, seems to go more and more out of sync the more rotations.
2026-05-19 12:02:57 +02:00
Tom Pratt b52ffa3e8b Release boot session data during Netplay cleanup
Boot session data is already handled when the game is booted so this is just fallback in case the game launch fails in some weird way.

Add missing @Keep annotations to functions called from C++
2026-05-19 12:02:57 +02:00
Tom Pratt b1b133b036 Implement OnConnectionLost, show a dialog on the main netplay screen forcing the user to exit 2026-05-19 12:02:56 +02:00
Tom Pratt 38b5c7370c Implement StopGame callback and use it to finish the emulation activity 2026-05-19 12:02:56 +02:00
Tom Pratt 86956b21be Settings refactor
Remove the big saveSetup function and set individual settings immediately after being changed in the UI. Group them all under Netplay.Settings
2026-05-19 12:02:56 +02:00
Tom Pratt 65e4c60158 Max buffer 2026-05-19 12:02:56 +02:00
Tom Pratt e49451b28e Put players table in an OutlinedBox, makes the UI look more consistent. 2026-05-19 12:02:56 +02:00
Tom Pratt c32732714e Implement more NetPlayUICallbacks
Includes chat, game changes, pad buffer changes and host input authority. Merges them all into the chat window.
2026-05-19 12:02:55 +02:00
Tom Pratt dfa3384281 Netplay chat UI 2026-05-19 12:02:55 +02:00