Commit Graph

1300 Commits

Author SHA1 Message Date
Tony
7ca3c314f8
Move 'Black Frame Insertion' under 'Synchronization' (#13457) 2022-01-07 17:30:21 +01:00
Cthulhu-throwaway
c752f9b0de
Custom relay server support (#13395)
* Custom relay server support

Add support for custom user-ran relay servers.

* snprintf NULL fix
2021-12-23 13:54:52 +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
71836c1055
Add option for showing notifications only in menu (#13326) 2021-12-16 14:38:43 +01:00
Autechre
b6695d8921
Netplay changes proposed for 1.9.14 (#13314)
* Added setting to allow/disallow players other than the host from pausing the game.
* Added a sublabel for netplay max connections.
* Fixed port override macro from not being set immediately after the port setting.
* Fixed memory leaks.
2021-12-04 02:34:21 +01:00
twinaphex
2a5751ca0e Get rid of some getters 2021-11-09 07:06:04 +01:00
twinaphex
0b16a64d40 Remove unused variables 2021-11-05 22:42:09 +01:00
twinaphex
7f33a03423 Revert "Revert "Backport netplay changes from forum member""
This reverts commit 38a6b9f086.
2021-11-05 18:52:56 +01:00
twinaphex
38a6b9f086 Revert "Backport netplay changes from forum member"
This reverts commit 367ac6ce46.
2021-11-05 18:34:52 +01:00
twinaphex
367ac6ce46 Backport netplay changes from forum member 2021-11-05 17:17:10 +01:00
twinaphex
18412e34c1 Some CXX_BUILD buildfixes for Mac 2021-11-05 02:16:40 +01:00
twinaphex
cfb2ae7d2c need to use SetWindowText for LEGACY_WIN32 2021-10-12 12:41:05 +02:00
twinaphex
849ed7fc3d Buildfix for MSVC 2021-10-12 11:58:22 +02:00
Soar Qin
290bc214e3
win32: fix broken win9x builds caused by #13089 (#13106)
Co-authored-by: Soar Qin <soarchin@gmial.com>
2021-10-12 11:24:58 +02:00
Soar Qin
39fd4677d9
win32: fix non-ASCII text display in window title (#13089) 2021-10-09 06:28:17 +02:00
twinaphex
49fbed2423 Get rid of input_mouse_grabbed - move retroarch types to
retroarch_types.h
2021-09-30 23:22:50 +02:00
twinaphex
ddceb51f89 Get rid of some needless getters/setters 2021-09-30 21:10:12 +02:00
twinaphex
e886e908d5 Create consistent naming conventions - use retroarch_ instead
of rarch_ for some functions for all functions coming from retroarch.h
2021-09-28 12:56:10 +02:00
twinaphex
3dee62ce62 Cleanups and buildfix 2021-09-28 01:16:53 +02:00
twinaphex
83ce4259a0 Have only one getter for runloop_state 2021-09-21 19:08:26 +02:00
twinaphex
f21641d898 Get rid of another 'getter' function 2021-09-21 18:30:56 +02:00
Michael Burgardt
d8db234df0
Concatinate some previously truncated strings for easier translation (#12120) 2021-09-16 19:00:14 +02:00
twinaphex
b5138b6122 Move input_config_get_bind_string to input_driver.c 2021-09-12 17:41:00 +02:00
Autechre
7b9cbc08d7
Add HDR support for D3D12 (rebased PR from MajorPainTheCactus) (#12917)
* Add HDR support

* Attempt to fix Mingw build and Metal builds

* (D3D12) Fix relative header includes

* Add missing hdr_sm5.hlsl.h

* (d3d12_common.c) Some C89 build fixes

* Fix MSVC build

* - Attempt to fix build on mingw/msys unix with dirty hack
- Fix shader compilation of hdr_sm5.hlsl.h on MSVC/Visual Studio -
the define was seen as an error and was causing the first pipeline
to error out
- Make sure we manually set handle of backBuffer to NULL

* Moving the release of the texture above the freeing of desc.srv_heap
and desc.rtv_heap solves the hard crashes on teardown/setup in RA -
it was crashing hard in d3d12_release_texture before

* Add HAVE_D3D12_HDR ifdef - needs to be disabled for WinRT for now
because of several things that are Windows desktop-specific right now
(GetWindowRect)

* Add dirty GUID hack - should work for both mingw/msys on Windows/Linux
as well as MSVC/Visual Studio (hopefully)

* Change HAVE_D3D12_HDR to HAVE_DXGI_HDR

* Move away from camelcase named variables

* Fix RARCH_ERR logs - they need a newline at the end

* d3d12_check_display_hdr_support - make it return a bool on return
and set d3d12->hdr.support and d3d12->hdr.enable outside of the
function

* (DXGI) Remove D3D12 dependencies from dxgi_check_display_hdr_support and
move it to dxgi_common.c instead

* (DXGI) move d3d12_swapchain_color_space over to dxgi_common.c and
rename it dxgi_swapchain_color_space

* (DXGI) move d3d12_set_hdr_metadata to dxgi_common.c and
rename it dxgi_set_hdr_metadata

* (DXGI) dxgi_check_display_hdr_support - better error handling?

* Fix typo

* Remove video_force_resolution

* (D3D12) Address TODO/FIXME

* (D3D12) Backport
c1b6c0bff2
- Fixed resource transition for present when HDR is off
Fixed cel shader displaying all black as blending was enabled when the hdr shader was being applied - turned off blending during this shader

* Move d3d12_hdr_uniform_t to dxgi_common.h and
rename it dxgi_hdr_uniform_t

* (D3D11) Add HDR support

* Add TODO/FIXME notes

* Cache hdr_enable in video_frame_info_t

* Update comment
2021-09-03 06:15:25 +02:00
Autechre
dbb74ba5ab
Merge pull request #12823 from markwkidd/input-drivers
input_driver refactor
2021-08-24 18:45:20 +02:00
jdgleaver
b0c5362da6 (Qt) Fix segfault when accessing Video Options menu on non-Windows platforms 2021-08-23 12:40:46 +01:00
Mark W. Kidd
5f834a8cb3 input_driver refactor 2021-08-19 20:02:39 -04:00
Autechre
ae327a769b
Revert "input refactoring: create input_driver.c" 2021-08-18 18:45:53 +02:00
Autechre
a66b1b3e48
Merge pull request #12703 from markwkidd/input-drivers
input refactoring: create input_driver.c
2021-08-18 18:17:43 +02:00
jdgleaver
0e98b4ddea Add environment callback for enabling core option menu visibility updates without toggling Quick Menu 2021-08-18 16:08:26 +01:00
Tatsuya79
bf8f527143
QT: windowed settings update 2021-08-17 15:41:49 +02:00
Mark W. Kidd
5a8920c862 input_driver refactor 2021-08-17 08:56:29 -04:00
jdgleaver
fe1f311a35 Add core option category support 2021-08-06 15:33:47 +01:00
Autechre
ed3412c004
Merge pull request #12618 from markwkidd/input-remapping
consolidate and comment input_remapping.h
2021-07-08 14:22:51 +02:00
HyperspaceMadness
d14c4d2883 Added Aspect Ratio Full
Fixes

Fixes

Moved ASPECT_RATIO_FULL to end of list, added TODO

Fixed Full Order

Fixed UI Visibility
2021-07-07 09:37:36 -04:00
Mark W. Kidd
b17dd28ff2 consolidate and comment input_remapping.h 2021-07-06 16:13:43 -04:00
jdgleaver
d1f7d8af0d (Qt) Fix default core detection when playlist file name does not match 'db_name' 2021-06-29 16:51:20 +01:00
toshixm
4fab84ca9e improve message wrapping with CJK languages 2021-06-03 21:09:35 +09:00
jdgleaver
8e54b4cec9 (Show Inputs on Overlay) DISABLE_MENU=1 buildfix + Qt settings update 2021-05-26 18:15:23 +01:00
twinaphex
7a2115670a Fix relative path includes 2021-05-19 15:41:40 +02:00
twinaphex
35543ecd91 Move defines files over to libretro-common 2021-05-18 22:15:04 +02:00
jdgleaver
f4511f6fa4 (core_info) Performance optimisations + code clean-ups/refactors 2021-04-26 14:30:31 +01:00
twinaphex
ab877c429f (Qt) Use string append() where possible 2021-04-10 23:57:31 +02:00
twinaphex
ea9f3f13ca (Apple OSX) Swallow 'escape' key being pressed - would previously make the game
go from fullscreen to windowed
2021-04-07 00:48:21 +02:00
twinaphex
ed0c9ef1dc Buildfix 2021-03-24 02:39:57 +01:00
twinaphex
71b4a4558c (DISABLE_MENU) Add another conditional 2021-03-24 02:10:35 +01:00
twinaphex
118ff58e6b Add more conditionals for --disable-menu 2021-03-24 01:44:30 +01:00
twinaphex
95f5df358a Fix --disable-menu 2021-03-24 01:24:49 +01:00
twinaphex
48f9a5fbc0 (Qt) Silence sign comparison warnings 2021-03-22 20:20:33 +01:00
twinaphex
d8d034bacb (menu_displaylist_build_list) Pass settings pointer around 2021-03-21 16:16:41 +01:00