Commit Graph

4054 Commits

Author SHA1 Message Date
Colin Kinloch
b2527b43e8
(Wayland) Show window early to get screen info (#13591)
* (Wayland) Show window early to get screen info

* Report current monitor size on initial get_video_size call

* Fullscreen to monitor selected in settings

* Fullscreen on current monitor when setting is set to automatic

* Fallback to shm_open when memfd_create is not supported
2022-02-18 19:59:41 +01:00
Autechre
b45a192416
Revert "(Wayland) Show window early to get screen info (#13582)" (#13590)
This reverts commit 4bb2c14293.
2022-02-01 12:47:53 +01:00
Colin Kinloch
4bb2c14293
(Wayland) Show window early to get screen info (#13582)
* Report current monitor size on initial get_video_size call

* Fullscreen to monitor selected in settings

* Fullscreen on current monitor when setting is set to automatic
2022-02-01 10:30:34 +01:00
Tony
6d5d2e722d
Logging cleanups (#13579) 2022-01-31 18:05:23 +01:00
Colin Kinloch
a431760829
(Wayland) Release keys and mouse buttons on lost focus (#13567) 2022-01-29 19:57:06 +01:00
twinaphex
60eaf14afc C89_BUILDFIX 2022-01-29 10:55:31 +01:00
Dystopian
0afdb2a0cf
Improve udev logging (#13549) 2022-01-29 10:57:38 +01:00
Francisco Javier Trujillo Mata
86b47b4859
[PSP] Update Retroarch to latest PSPDev status (#13544)
* Added newlib changes

* Add action to launch PPSSPP simulator

* Remove legacy config for the stack and heap

* Add pthread

* Simplify kernel_functions and improve references to HAVE_KERNEL_PRX

* Add some flags

* Improve audio init/deinit

* Improve exit by clicking home

* Add CI for PSP1

* Update PSP.yml
2022-01-25 03:50:18 +01:00
Ryan Kuba
6ae1270e5c
remove test for standard mapping in controller detection (#13528) 2022-01-24 16:31:03 +01:00
Keith Bowes
38e74ee3cf
Restores mouse-grab toggling in Wayland. (#13537)
* Fixes mouse-grab toggling in Wayland.

Fixes #13536

* Indicate that input_wl_grab_mouse is a necessary function.

It might prevent it from being removed again in future cleanups.
2022-01-24 16:22:21 +01:00
twinaphex
5241d3e5d6 Cleanups 2022-01-20 06:09:43 +01:00
twinaphex
cc756e4126 Silence some warnings 2022-01-19 19:08:22 +01:00
Dystopian
2095fc53f8
Fix webOS build and run (#13480) 2022-01-12 07:12:34 +01:00
Cthulhu-throwaway
9579810579
Build fix for --disable-menu (#13419) 2021-12-26 15:18:57 +01:00
Aleksey Samoilov
f17deb90c7
[Wayland] Fix toplevel close (#13415) 2021-12-25 11:19:27 +01:00
Colin Kinloch
0168fe0303
(Wayland) Ignore mouse clicks on window decoration (#13412) 2021-12-25 04:08:22 +01:00
Colin Kinloch
f0392474f2
(Wayland) Add libdecor for client side decoration (#13397) 2021-12-24 14:20:45 +01:00
twinaphex
393e42a497 (Wayland) Buildfix 2021-12-24 05:25:30 +01:00
Colin Kinloch
c48d533950
(Wayland) Add scroll wheel support (#13398) 2021-12-24 03:42:33 +01:00
Nikos Chantziaras
0357b6c922
Add on-screen statistics toggle hotkey (#13381)
* Add on-screen statistics toggle hotkey

* CHANGES.md: Add technical statistics hotkey
2021-12-21 00:03:35 +01:00
Cthulhu-throwaway
690c802921
Netplay Stuff (#13375)
* Netplay Stuff

## PROTOCOL FALLBACK
In order to support older clients a protocol fallback system was introduced.
The host will no longer send its header automatically after a TCP connection is established, instead, it awaits for the client to send his before determining which protocol this connection is going to operate on.
Netplay has now two protocols, a low protocol and a high protocol; the low protocol is the minimum protocol it supports, while the high protocol is the highest protocol it can operate on.
To fully support older clients, a hack was necessary: sending the high protocol in the unused client's header salt field, while keeping the protocol field to the low protocol. Without this hack we would only be able to support older clients if a newer client was the host.
Any future system can make use of this system by checking connection->netplay_protocol, which is available for both the client and host.

## NETPLAY CHAT
Starting with protocol 6, netplay chat is available through the new NETPLAY_CMD_PLAYER_CHAT command.
Limitations of the command code, which causes a disconnection on unknown commands, makes this system not possible on protocol 5.
Protocol 5 connections can neither send nor receive chat, but other netplay operations are unaffected.
Clients send chat as a string to the server, and it's the server's sole responsability to relay chat messages.
As of now, sending chat uses RetroArch's input menu, while the display of on-screen chat uses a widget overlay and RetroArch's notifications as a fallback.
If a new overlay and/or input system is desired, no backwards compatibility changes need to be made.
Only clients in playing mode (as opposed to spectating mode) can send and receive chat.

## SETTINGS SHARING
Some settings are better used when both host and clients share the same configuration.
As of protocol 6, the following settings will be shared from host to clients (without altering a client's configuration file): input latency frames and allow pausing.

## NETPLAY TUNNEL/MITM
With the current MITM system being defunct (at least as of 1.9.X), a new system was in order to solve most if not all of the problems with the current system.
This new system uses a tunneling approach, which is similar to most VPN and tunneling services around.

Tunnel commands:
RATS[unique id] (RetroArch Tunnel Session) - 16 bytes -> When this command is sent with a zeroed unique id, the tunnel server interprets this as a netplay host wanting to create a new session, in this case, the same command is returned to the host, but now with its unique session id. When a client needs to connect to a host, this command is sent with the unique session id of the host, causing the tunnel server to send a RATL command to the host.
RATL[unique id] (RetroArch Tunnel Link) - 16 bytes -> The tunnel server sends this command to the host when a client wants to connect to the host. Once the host receives this command, it establishes a new connection to the tunnel server, sending this command together with the client's unique id through this new connection, causing the tunnel server to link this connection to the connection of the client.
RATP (RetroArch Tunnel Ping) - 4 bytes -> The tunnel server sends this command to verify that the host, whom the session belongs to, is still around. The host replies with the same command. A session is closed if the tunnel server can not verify that the host is alive.

Operations:
Host -> Instead of listening and accepting connections, it connects to the tunnel server, requests a new session and then monitor this connection for new linking requests. Once a request is received, it establishes a new connection to the tunnel server for linking with a client. The tunnel server's address and port are obtained by querying the lobby server. The host will publish its session id together with the rest of its info to the lobby server.
Client -> It connects to the tunnel server and then sends the session id of the host it wants to connect to. A host's session id is obtained from the json data sent by the lobby server.

Improvements (from current MITM system):
No longer a risk of TCP port exhaustion; we only use one port now at the tunnel server.
Very little cpu usage. About 95% net I/O bound now.
Future backwards compatible with any and all changes to netplay as it no longer runs any netplay logic at MITM servers.
No longer operates the host in client mode, which was a source of many of the current problems.
Cleaner and more maintainable system and code.

Notable functions:
netplay_mitm_query -> Grabs the tunnel's address and port from the lobby server.
init_tcp_socket -> Handles the creation and operation mode of the TCP socket based on whether it's host, host+MITM or client.
handle_mitm_connection -> Creates and completes linking connections and replies to ping commands (only 1 of each per call to not affect performance).

## MISC
Ping Limiter: If a client's estimated latency to the server is higher than this value, connection will be dropped just before finishing the netplay handshake.
Ping Counter: A ping counter (similar to the FPS one) can be shown in the bottom right corner of the screen, if you are connected to a host.
LAN Discovery: Refactored and moved to its own "Refresh Netplay LAN List" button.

## FIXES
Many minor fixes to the current netplay implementation are also included.

* Remove NETPLAY_TEST_BUILD
2021-12-19 16:58:01 +01:00
arpruss
e5e6f343ac
convert abs mouse from screen to viewport coordinates; fix relative m… (#13258)
* convert abs mouse from screen to viewport coordinates; fix relative mouse code to work in screen mode

* C89 compatibility

* revert accidental include
2021-12-18 17:52:27 +01:00
Tony
8cc423e036
Logging cleanups (#13370) 2021-12-17 18:04:24 +01:00
Francisco Javier Trujillo Mata
1cd0938cc3
[PS2] Improve Compilation (#13359)
* Allow parallel compilation in PS2

* Allow to compile with griffin or common compilation in PS2

* Enable dummy core to be used in other platforms

* Use threads in YML config

* Add the compilation to PS2 in GitHub Actions
2021-12-15 19:01:56 +01:00
twinaphex
bfeffb2423 Fix local header path includes 2021-12-04 16:11:02 +01:00
gblues
bf9706395d
Fix gamepad disconnect on unrecognized HID device (#13321)
== DETAILS
So, the reason the gamepad was getting deregistered was
because adapter free code wasn't properly handling null-interface
adapters, causing the gamepad to match erroneously and get
deregistered.

This doesn't fix the weird "Generic SNES USB" detection issue,
but it should make it non-fatal.

Co-authored-by: Nathan Strong <nstrong@tripwire.com>
2021-12-04 12:43:58 +01:00
gblues
1dd15ac516
WIIU: Fix keyboard support (#13308)
== DETAILS
The problem was caused by changing the driver lookup point. The deferred
lookup resulted in the WIIU trying to treat the keyboard as a gamepad which ...
didn't work.

This change short-circuits at the connection event by ignoring mouse &
keyboard connection events.

Tested this with a dev build.

Co-authored-by: Nathan Strong <nstrong@tripwire.com>
2021-12-02 12:43:19 +01:00
Aaron Ramirez
97f3fca139
Fixes a bug where the Gyroscope and Accelerometer would not be re-enabled when the app regains focus or is resumed. (#13298) 2021-11-29 16:53:13 +01:00
twinaphex
b4137915e8 Move code to proper locations 2021-11-23 16:58:36 +01:00
twinaphex
c2c36177b8 Move two variables to input_driver.c 2021-11-22 15:26:54 +01:00
Autechre
2b87cd9313
Create runloop.c and split up runloop code to this new file; (#13269)
* Create runloop.c and split up runloop code to this new file;
retroarch.c now 207Kb and runloop.c 301Kb

* Define empty runloop_secondary_core_destroy
2021-11-22 03:27:23 +01:00
Tomáš Kelemen (vudiq)
0cf437e375
Lakka/Nintendo Switch: disable rumble gain
Rumble gain breaks controlls on Nintendo Switch port of Lakka, probably
due to issue in the driver).

Upstream of patch used by Lakka at build time
1943ad296e/packages/libretro/retroarch/patches/retroarch-06-switch_disable_rumble_gain.patch
2021-11-18 00:36:11 +01:00
Jean-André Santoni
6a99832a4d
Lakka: Patch to fix keyboard typing
Upstream of patch used by Lakka at build time
1943ad296e/packages/libretro/retroarch/patches/retroarch-01-xkb-fix.patch
2021-11-18 00:36:11 +01:00
twinaphex
efa16a8fca Revert "(Netplay) Cthulhu88 -"
This reverts commit cb4028fd3d.
2021-11-12 19:00:42 +01:00
twinaphex
86f899c844 Revert "Shorten character arrays that are passed to fill_pathname_base_noext"
This reverts commit 318108ac82.
2021-11-10 08:22:19 +01:00
twinaphex
cb4028fd3d (Netplay) Cthulhu88 -
* Netplay Chat menu
* Toggleable bind for chat (bound to ~ [tilde] by default)
2021-11-10 02:41:02 +01:00
twinaphex
318108ac82 Shorten character arrays that are passed to fill_pathname_base_noext 2021-11-10 00:09:33 +01:00
twinaphex
619398bbe4 Backport parts of 73c0760236 2021-11-09 23:12:57 +01:00
twinaphex
f4c5852cfa Move state from global_t to input_state_t 2021-11-09 06:27:43 +01:00
twinaphex
f671ce4f8c Move global->name to runloop_st 2021-11-09 06:03:00 +01:00
twinaphex
88c771fc66 Cleanups 2021-11-07 01:44:45 +01:00
twinaphex
c0585fed60 (winraw_input.c) Cleanups 2021-11-06 15:07:35 +01:00
twinaphex
61d30cdc31 Move input code from retroarch.c to input_driver.c 2021-11-06 04:34:54 +01:00
grant2258
1ae36ee9a7
udev fix dolphinbar and safeguard against not adding devices with no mouse or touch buttons detected (#13143)
* udev fixes

* updates

* small updates

* fix condition

Co-authored-by: grant2258 <you@example.com>
2021-11-05 23:59:17 +01:00
twinaphex
db9283b57c Silence some warnings 2021-11-05 04:49:26 +01:00
twinaphex
21beb6064a Silence some warnings 2021-11-05 03:58:26 +01:00
Jamiras
088aa7dcb9
add github action for c89 build (#13186)
* add retroarch.yml

* fix c89 errors

* attempt to add dependencies

* update comments
2021-11-05 00:05:13 +01:00
twinaphex
1a78d91348 MSVC buildfix 2021-11-03 16:50:41 +01:00
Autechre
80e0114ccf
Move collect_system_input to input_driver.c (#13183) 2021-11-03 16:48:57 +01:00
gblues
1ef78d3e3d
Any pad can control the menu (#13173)
* Any pad can control the menu

== DETAILS
I am not sure I've quite got it so that any pad can *open* the
menu, but I do have it so any pad can control it.

- split out the input processing into a separate method
- track down and squish some hairy bugs that boiled down to
  bad pointer math
- it looks like `menu_driver.c` has a mix of line endings, so I
  ran it through `dos2unix` so it has consistent line endings
  again.
- verified that this change did not impact actual cores

* optimize out cumulative_bits

* Incorporate PR feedback

Many thanks to @jdgleaver for providing these optimizations.

* apply one more optimization
2021-11-03 16:32:15 +01:00