10528 Commits

Author SHA1 Message Date
MajorPainTheCactus
9151326b73
Added support for HDR shaders - if we detect a shader that uses SLANG_FORMAT_A2B10G10R10_UNORM_PACK32 or SLANG_FORMAT_R16G16B16A16_SFLOAT as the format for the last render target in the shader chain AND hdr is switched on then this disables the internal HDR shader and allows the shader chain to define an inverse tonemapper and hdr10 shader. The first use of this is for my hdr shader crt\crt-sony-pvm-4k-hdr.slangp - submitted seperately (#13390) 2021-12-22 02:17:17 +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
Tony
8cc423e036
Logging cleanups (#13370) 2021-12-17 18:04:24 +01:00
Tony
6ee92d8583
Stop logging fps statistics twice on quit (#13369) 2021-12-17 16:06:15 +01:00
Tony
2c7d2bcc18
Log font rendering backend only once (#13371) 2021-12-17 16:05:32 +01:00
Tony
71836c1055
Add option for showing notifications only in menu (#13326) 2021-12-16 14:38:43 +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
vaguerant
34892555ec
Fix rotation on 3DS and Wii U (#13353)
* Fix rotation on 3DS
* Fix rotation on Wii U
2021-12-14 13:43:48 +01:00
Tony
09880e92d2
Logging cleanups (#13320) 2021-12-04 14:21:12 +01:00
Tony
41838ef544
Refresh rate switch addition on startup (#13316) 2021-12-03 17:52:46 +01:00
Hans-Kristian Arntzen
ce8a3db4dc
Avoid hard crash when capturing screenshot in emulating mailbox. (#13315)
The emulating mailbox infrastructure is very hacky and needs a rethink
to be able to properly support screenshots. emulating mailbox is pretty
nasty to begin with and should be considered a hack.
2021-12-03 16:19:49 +01:00
Tony
121ca3a482
'Automatic Frame Delay' improvements: (#13297)
- swap interval handling
- d3dx handling
2021-12-02 02:32:39 +01:00
twinaphex
b4137915e8 Move code to proper locations 2021-11-23 16:58:36 +01:00
twinaphex
0a40e1f771 (gl_core/gl3) Rename gl_core internally to gl3 2021-11-23 08:45:54 +01:00
twinaphex
ed437fdd8e (video_crt_switch) Cleanups and potential build fix 2021-11-21 12:08:31 +01:00
Autechre
9e40966dce
Merge pull request #13249 from ToKe79/lakka2upstream
Upstream patches from Lakka
2021-11-20 22:07:47 +01:00
twinaphex
d04dee7ee0 (GL1) Update code so that GL Hard Sync will work with menu
enabled [Hard sync doesn't seem implemented for GL1 anyway]
2021-11-20 03:40:48 +01:00
twinaphex
282c8ddc5f (GL3) Allow Hard GPU Sync in menu 2021-11-20 03:26:54 +01:00
twinaphex
e7e6b9977f (GL2) Backport 75a66be87b - Allow Hard GPU sync in menu 2021-11-20 02:20:53 +01:00
Tomáš Kelemen (vudiq)
fd5c718b48
buildfix: undefined srm.x_scale, srm.y_scale
srm.x_scale and srm.y_scale are undefined in this context/scope.

Upstream of patch used by Lakka at build time
1943ad296e/packages/libretro/retroarch/patches/retroarch-07-gpicase_buildfix.patch
2021-11-18 00:36:11 +01:00
Jamiras
2adf52a493 move achievement activation to background thread 2021-11-16 11:33:37 -07:00
Jamiras
a3b508f136 show widget for loaded game 2021-11-16 08:26:42 -07:00
jdgleaver
196cc8b33d SDL1 buildfix 2021-11-12 12:35:31 +01:00
twinaphex
0b768d0460 Split up recording code 2021-11-10 02:34:04 +01:00
twinaphex
619398bbe4 Backport parts of 73c0760236 2021-11-09 23:12:57 +01:00
MrHuu
8171e513aa [3DS] Fix achievement widget 2021-11-09 19:47:45 +01:00
twinaphex
2a5751ca0e Get rid of some getters 2021-11-09 07:06:04 +01:00
twinaphex
fc898d016b (GX2) wiiu_gfx_load_texture - make it safer - get rid of unused
wiiu pointer; do early return when image is NULL
2021-11-08 17:07:17 +01:00
twinaphex
a93a2e3366 (MSVC2019 UWP) Buildfix 2021-11-07 05:54:23 +01:00
twinaphex
88c771fc66 Cleanups 2021-11-07 01:44:45 +01:00
Tony
3137f8470b
Add 'Automatic Frame Delay' option (#13190) 2021-11-05 23:42:23 +01:00
twinaphex
fe0c0d73ff Move aspectratio_lut to video_driver.c 2021-11-05 03:47:04 +01:00
twinaphex
f50df1acfb Buildfix 2021-11-05 03:15:17 +01:00
twinaphex
c17bcb8d91 Move code from retroarch.c to video_driver.c 2021-11-05 02:53:58 +01:00
twinaphex
e4ccc2508e Move code over from retroarch.c to video_driver.c 2021-11-05 02:33:22 +01:00
twinaphex
c5b20dff41 (3DS/CTR) Cleanup 2021-11-03 22:01:01 +01:00
twinaphex
f59b420fde * Move more code to command.c
* Buildfix for CTR/3DS
2021-11-03 21:59:58 +01:00
twinaphex
69e8416e45 (CTR) C89 conformity cleanups 2021-11-03 21:42:11 +01:00
twinaphex
bf8cae10a3 Move retroarch_get_shader_preset to video_shader_parse.c 2021-10-29 16:35:50 +02:00
Autechre
e42f8228de
Move cli_shader to video_state (#13168)
* Move cli_shader to video_state

* Formatting fixes
2021-10-29 15:35:43 +02:00
twinaphex
ec7b7821fa Move code out of retroarch.c 2021-10-29 14:13:16 +02:00
twinaphex
80e7e1adde Move state over 2021-10-28 06:03:54 +02:00
alphanu1
f5d8d07cf1
Fixes for fractal scaling (#13149)
* CRT Fractal scalling fix for SR2

Added comment to remind me to add video core to SR2

fixed typo

* Addedd only x fractal scaling for super resolutions

* Properly handle fractional scale factors and fix some typos.

Co-authored-by: Antonio Giner <calamity15khz@gmail.com>
2021-10-26 01:43:22 +02:00
twinaphex
758eafa686 (SDL) Potential buildfix 2021-10-20 15:57:34 +02:00
twinaphex
9b4636ff62 Fixes --disable-menu 2021-10-15 14:32:07 +02:00
twinaphex
a291323467 Move some code to gfx/video_driver.c 2021-10-15 02:25:12 +02:00
twinaphex
7f2cc93cf5 Silence warning 2021-10-13 21:44:40 +02:00
twinaphex
aa6d3542d2 Prevent warning 2021-10-13 18:44:27 +02:00
Autechre
78b861a8e8
Merge pull request #13114 from libretro/move-widgetstate
Better compartmentalize state - better distinction between runloop and retroarch files
2021-10-13 18:43:23 +02:00
twinaphex
70606eab1e Buildfix for WiiU 2021-10-13 18:40:41 +02:00