1495 Commits

Author SHA1 Message Date
twinaphex
4d112da58d Silence some MSVC code analysis warnings 2022-03-07 19:02:46 +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
Vladimir Serbinenko
4e24fb3d01
Add osx-ppc compilation for frontend (#13532)
* Fix old osx condition

Current code assumes that osx < 10.12 is equivalent to ppc osx. It's not
true as Leopard x86 is still < 10.12 but not ppc. As xcode compiles fat
binaries it includes osx x86 and compilation fails.

* Disable crtswitchres when no c++11 is available

Crtswitchres altually needs c++11. Since it's not that important to make
it compatible with lower c++, just disable if no c++11 is available

* Don't use firstObject on old Mac OS X.

It was introduced in 10.6, so on old ones just implement it ourselves

* Compile osx-ppc frontend

* osx-ppc: Build a fat binary

On 10.6 i386 xcode apparently refuses to build a pure ppc.
Settle for a fat binary.
2022-01-24 16:22:07 +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
jdgleaver
e3217b4a35
Remove frame limit from audio batch callback (#13333) 2021-12-06 18:11:46 +01:00
Poligraf
b4ef32cfce
add oss audio to retrofw (#13303)
Co-authored-by: Poligraf <>
2021-12-01 17:19:39 +01:00
twinaphex
b4137915e8 Move code to proper locations 2021-11-23 16:58:36 +01:00
Autechre
1280151d13
Merge pull request #13216 from libretro/splitup-record
Split up recording code
2021-11-11 02:00:52 +01:00
twinaphex
86f899c844 Revert "Shorten character arrays that are passed to fill_pathname_base_noext"
This reverts commit 318108ac82859a166f45cd081d6b58bc3f844db9.
2021-11-10 08:22:19 +01:00
twinaphex
0b768d0460 Split up recording code 2021-11-10 02:34:04 +01:00
twinaphex
318108ac82 Shorten character arrays that are passed to fill_pathname_base_noext 2021-11-10 00:09:33 +01:00
twinaphex
88c771fc66 Cleanups 2021-11-07 01:44:45 +01:00
twinaphex
514ed00f2d Move configuration state over to configuration.c - take it out of
p_rarch
2021-11-03 21:22:37 +01:00
mahoneyt944
df6b1c306f
Log 2021-10-19 09:46:40 -04:00
twinaphex
70b337782d Fix MSVC build 2021-10-15 00:11:52 +02:00
twinaphex
d87e0c1744 * Fix implicit declaration
* Move more code to gfx/video_driver.c
2021-10-13 16:36:38 +02:00
twinaphex
e47e9968ed Move audio_driver_menu_sample to audio_driver.c and turn
audio_driver_flush into static function
2021-10-13 16:29:41 +02: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
Autechre
dcf77c4d1e
Merge pull request #12821 from markwkidd/config_h
standardize include paths for config.h
2021-09-10 16:59:15 +02:00
Autechre
9a5f4602cc
Add intrinsic NEON versions for float_to_s16/s16_to_float (#12933)
* Add intrinsic NEON versions for float_to_s16/s16_to_float courtesy
of davidgfnet

* Define -DDONT_WANT_ARM_OPTIMIZATIONS for resampler sinc - this should
default to intrinsic versions

* Default to ARM NEON intrinsic codepath and make the ASM codepaths
optional by defining HAVE_ARM_NEON_ASM_OPTIMIZATIONS

* (Pkg/apple/Android) Take out ASM files being compiled in
2021-09-04 00:25:21 +02:00
twinaphex
b620325714 Rename HAVE_ARM_NEON_OPTIMIZATIOn to HAVE_ARM_NEON_ASM_OPTIMIZATIONS,
rename DONT_WANT_ARM_OPTIMIZATIONS to DONT_WANT_ARM_NEON_OPTIMIZATIONS
2021-08-21 18:00:59 +02:00
Mark W. Kidd
2b3dfeb10c standardize include path for config.h 2021-08-18 18:54:40 -04:00
twinaphex
a736dd27d2 (platform_switch) arg_data/args don't seem used anywhere
(switch_thread_audio) Pass correct type to function
2021-08-12 18:22:09 +02:00
sonninnos
c737947d74 (WASAPI) Stop deactivating audio on fast forward 2021-08-11 04:21:52 +03:00
twinaphex
406c8bee7b Silenc some warnings 2021-08-09 21:24:03 +02:00
p-sam
1bc588acbd Fix building with libnx 4.0.0 2021-06-28 17:38:17 +02:00
Tony
49bd8d2d27
(XAudio+DSound) Fail instead of crash (#12527) 2021-06-16 15:35:20 +02:00
twinaphex
35543ecd91 Move defines files over to libretro-common 2021-05-18 22:15:04 +02:00
jdgleaver
0a08437e0a Add OpenDingux Beta support 2021-03-25 16:19:42 +00:00
unknown
ad059aed78 Add some PSL1GHT ifdefs 2021-03-01 15:57:01 +01:00
sonninnos
6c3c2bea5f Logging cleanups 2021-02-18 18:35:31 +02:00
twinaphex
b70217b7fc (Mac) Add CoreAudio3 for Metal x64 and ARM64 builds on buildbot 2021-02-17 05:20:51 +01:00
twinaphex
c01df07f3d Fix ARM NEON detection 2021-02-16 23:02:06 +01:00
twinaphex
22c3f35726 Buildfix 2021-02-08 09:38:12 +01:00
twinaphex
da17588f0c CXX_BUILD build fixes 2021-02-08 09:35:57 +01:00
Francisco Javier Trujillo Mata
082fa22b05 Clean all the warnings in PS2 2021-01-30 15:47:52 +01:00
IAmBoring
88a1379053
XAudio2 threaded creation
COM initialization
2021-01-05 16:10:11 +00:00
Autechre
9ef98928d2
Revert "Windows: Fix multiple XAudio instances" 2021-01-03 06:48:24 +01:00
SimpleTease
ef51cf4ee1 Windows: Fix multiple XAudio instances 2021-01-03 04:36:03 +00:00
twinaphex
51f0d04569 Update 2020-12-20 16:41:44 +01:00
twinaphex
870707dbe8 Remove obsolete __CELLOS_LV2__ references - use PSL1GHT instead 2020-12-19 15:32:26 +01:00
Oschowa
78bb0de6e9 (Audio/JACK) Deinterleave in the process callback
This allows us to avoid the extra copy to the deinterleave buffer and
lets us use only a single jack ringbuffer.
2020-12-04 00:18:23 +01:00
Oschowa
604eb32c35 (Audio/JACK) Fix non-blocking write
Previously we would wait on the condition variable even in the non-blocking case.
This improves fast-forward performance massively and brings JACK in line
with other backends in that regard.
2020-12-04 00:09:40 +01:00
Oschowa
8058735cdb (Audio/ALSA) Fill hw_params configuration space before trying to detect
float format.
Otherwire detection will always fail.
2020-11-06 23:09:42 +01:00
twinaphex
6c067d149d (Xaudio) Cleanups 2020-10-03 20:35:50 +02:00
twinaphex
783bcb7a61 Avoid printf/puts 2020-09-28 03:17:21 +02:00
twinaphex
8811c555fe (OSS) Buildfix 2020-09-20 23:33:13 +02:00
twinaphex
e50d5af2db (OSS) Get rid of static globals 2020-09-20 23:30:19 +02:00
twinaphex
f8a71e8ea4 (Rwebaudio) Get rid of static global variables, put it in struct 2020-09-20 23:09:18 +02:00
twinaphex
45c257e0dd (Rwebaudio) Cleanups 2020-09-20 23:05:09 +02:00