Commit Graph

1991 Commits

Author SHA1 Message Date
twinaphex
460f5e745d Silence some MSVC 2019 code analysis warnings 2022-03-05 14:39:56 +01:00
jdgleaver
9b0cb0fc92
Add 'Standalone Cores' menu (#13655) 2022-02-22 19:23:48 +01:00
Michael Burgardt
7df18ec59d
Improve some texts (#13645) 2022-02-21 20:11:25 +01:00
jdgleaver
42e03cae83
Disable save states based on save state support level defined in core info files (#13562) 2022-02-02 16:49:53 +01:00
Cthulhu-throwaway
c50087efdc
(UPnP) Minor refactor (#13510)
Don't clear up the request at natt_close_port.
2022-01-18 13:03:32 +01:00
Cthulhu-throwaway
1a7e8e6628
(UPnP) Refactor (#13503)
COMMON: The common library can now be used independently by any number of features.
COMMON: The common library no longer restricts HAVE_SOCKET_LEGACY.
Netplay Task: Network interface scoring changed from byte-level to bit-level.
2022-01-17 13:46:03 +01:00
Cthulhu-throwaway
fb2d600837
(Netplay/UPnP) Smart interface selection (#13470)
Find the most suitable address for UPnP by scoring interfaces on how close their address is to the device's address.
2022-01-10 15:52:15 +01:00
Cthulhu-throwaway
c2df109874
(Netplay) LAN addresses only for UPnP (#13461)
Some router devices might accept non-LAN addresses without raising an error.
2022-01-08 10:45:41 +01:00
pkos
a192064403 (Database) Serial scanning for Gamecube/MegaCD/SegaCD/Saturn/PSX/PSP/Dreamcast/Wii 2021-12-31 21:35:16 -05:00
tunip3
fb6bf6023a
Move roms copied to localstate to a dedicated dir and clear on start up [XBOX/UWP] (#13392)
* make roms copy to a specific cache dir in the localstate folder when its copied

* auto delete vfs cache dir on start up

Co-authored-by: Tunip3 <tunip3@users.noreply.github.com>
2021-12-22 12:55:33 +01:00
Cthulhu-throwaway
cda66d09c3
Netplay Stuff - Addendum (#13378)
Prevents long-term pausing from clients dishonoring allow pausing.

Missing crediting.
2021-12-19 20:43:59 +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
tunip3
6c123dd078
Mitigate need for vfs cores on ntfs drives [UWP/XBOX] (#13368)
* make check for standard io by access rather than the just assuming based on path string

* add code to auto permissions so files can be accessed by non vfs cores
(no exfat or fat32 support yet)

* remove commit from macro because apparently it causes issues

Co-authored-by: Tunip3 <tunip3@users.noreply.github.com>
2021-12-17 13:46:04 +01:00
Tilman M. Jaeschke
682bbab233
[New Feature] Load save states from command-line or playlist (#13354)
* load save states from command-line or playlist

* load save states from command-line or playlist

* removed some brackets
2021-12-14 14:08:06 +01:00
tunip3
62528a483f
Fix roms over 4gb (approx) failing to load, improve copy times, fix scanning for playlists [UWP/XBOX] (#13348)
* Fix scanning for playlists

* Fix issues where games over 4gb (approx) would fail to load and also speed up loading times
2021-12-12 17:29:57 +01:00
Autechre
3b1a1ac8da
Remove miniupnpc dependency (#13340)
* use custom libretro-common UPNP

* Remove miniupnpc
2021-12-09 05:52:42 +01:00
Autechre
fbbe351f7d
UPnP cleanups and refactorings (#13325) 2021-12-04 21:16:34 +01:00
Autechre
a44f5bbf78
Fix UPNP port mapping failed error - switch to a permanent lease time, (#13324)
but request it to be removed when we do netplay_free
2021-12-04 15:45:29 +01:00
Tony
09880e92d2
Logging cleanups (#13320) 2021-12-04 14:21:12 +01:00
twinaphex
bc6433e0f9 Move menu_content_environment_get to task_content.c 2021-11-23 17:10:52 +01:00
Autechre
5bb4df3a42
Move translation task code to tasks/task_translation.c (#13274) 2021-11-22 15:19:20 +01:00
Autechre
71b30d7846
Split up wifi networking code - move it into separate file (#13262) 2021-11-21 12:37:39 +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
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
f671ce4f8c Move global->name to runloop_st 2021-11-09 06:03:00 +01:00
twinaphex
1f4123ba54 Don't include netplay.h header unless we have HAVE_NETWORKING
defined
2021-11-05 19:50:02 +01:00
twinaphex
67c010394d Remove netplay_discovery.h - hopefully fixes other build issues 2021-11-05 19:12:55 +01:00
twinaphex
121174c9af (Discord) Remove stray discord_is_inited global - put it in
discord_state_t instead
2021-11-05 13:45:00 +01:00
twinaphex
d3fd72ba63 Fix header include - should have been relative 2021-11-05 00:09:45 +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
aaad65538c Move rarch_patch_blocked to runloop_state, and get rid of
RARCH_CTL_IS_PATCH_BLOCKED
2021-10-30 11:15:45 +02:00
twinaphex
5477e34815 Move stray globals subsystem_data and subsystem_current_count to
runloop_state
2021-10-29 17:41:31 +02:00
jdgleaver
c67c7c944d
Initialise 'Explore' menu on a background thread (#13162) 2021-10-27 17:51:22 +02:00
twinaphex
9b4636ff62 Fixes --disable-menu 2021-10-15 14:32:07 +02:00
twinaphex
40aa7dad10 Move code to menu_driver.c and rename retroarch_ function to runloop_
function
2021-10-15 02:14:43 +02:00
jdgleaver
40925baacd Enable SRAM for contentless cores 2021-10-14 13:59:23 +01:00
Autechre
e7f182811a
Split up audio code into new file audio/audio_driver.c (#13097)
* Split up audio code into new file audio/audio_driver.c

* Fix build issues #1

* Small cleanup

* Fix typo
2021-10-11 18:01:37 +02:00
twinaphex
6a4a5ae27c Put scaler_ctx back in screenshot_state 2021-10-02 04:19:46 +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
5ba8843354 Move dispwidget_get_ptr over to gfx_widgets.c 2021-09-30 04:40:15 +02:00
twinaphex
0e9b2179af move scaler object out of screenshot_task_state 2021-09-30 02:19:16 +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
Nathan Strong
fb86ca6e33 Fix the snprintf warnings for everyone this time
== DETAILS
So, basically this back-and-forth is because we used fixed-size
data types (i.e. `uint32_t`) which maps to different primitive data
types on different platforms. So `uint32_t` might be a `long` on some
platforms (e.g. Wii U), while it's just a plain integer on others (PC).
And the format specifier works off primitive data type, not data type
size.

So, to resolve this, we:

- keep `%lx` as the format specifier
- cast the parameter to printf to unsigned long

This is better than the alternatives that could cause problems trying to
cast a long down to an int.
2021-09-25 15:08:34 -07:00
Nathan Strong
9b2d4236ad WIIU: Clean up a bunch of compiler warnings
== DETAILS
These changes fall into a few broad categories:

1. Explicitly undefine things we want to re-define due to conflicts with
   the version of devkitpro we're using
2. Clean up hex format specifiers to use `%lx` or `%lX` when working with
   long integers
3. Move variables inside the ifdef they're used in to squelch "unused variable"
   messages
4. Add parenthesis to make Wii U shader declarations stop complaining

And then there's a weird "misleading indent" warning that I fixed by just
rewriting a block of code to use a switch statement instead of if-then-else.

These changes work fine on Wii U, but we'll need to keep an eye on CI/CD to see
if other platform builds break.
2021-09-25 13:25:39 -07: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
twinaphex
7c8c53fb2d Get rid of menu_driver_get_ptr - we are going to be using only one
getter for each component state instead of several getters
2021-09-21 07:14:27 +02:00
Michael Burgardt
d8db234df0
Concatinate some previously truncated strings for easier translation (#12120) 2021-09-16 19:00:14 +02:00
jdgleaver
6da778b934 (Playlist Manager) Add 'Refresh Playlist' option 2021-09-09 16:18:26 +01:00