Commit Graph

10562 Commits

Author SHA1 Message Date
Tony
7768c296b9
Prevent refresh rate switching to half frame rate modes (#13656) 2022-02-24 07:10:27 +01:00
Colin Kinloch
6dec52fda7
(Wayland) Fix wayland vulkan not reacting to initial resize (#13640)
(Wayland) Correct log stamps for GL or Vulkan

(Wayland) Fix style issues and sync formatting on identical code in GL and Vulkan
2022-02-22 08:58:46 +01:00
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
Keith Bowes
bbfcecfab0
Fix building against FFmpeg 5.0 (#13611)
Co-authored-by: Maxime Gauduin <alucryd@archlinux.org>
2022-02-18 18:40:54 +01:00
Michael Burgardt
b8242601ec
Fix localisations (#13622)
* Fix translations with messed-up string placement

* Fix Hebrew and Persian text display

Hebrew is now displayed properly as right-to-left.
Miscellaneous whitespaces, like the zero width non-joiner used in Persian, no longer break right-to-left texts.
2022-02-14 02:43:55 +01:00
Salvador
8093f4595c
Gba filter (#13613)
New GBA filter Upscale_240x160-320x240
2022-02-10 12:40:00 +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
jdgleaver
a953b27614
Rework optional fast-forward frame skipping: Drop frames based on frame timing (#13578) 2022-01-31 16:32:17 +01:00
Vladimir Serbinenko
17ccfe4004
Support GL1 on osx-ppc (#13569)
* Fix handling of big-endianness in gl1

* Enable gl1 on osx-ppc

* Force gl1 on apple if gfx supports only gl1

* Backport gl2 apple workaround to gl1

* Fix big-endianness handling in widgets
2022-01-30 09:30:39 +01:00
Giovanni Cascione
ffbbdbd256
fbdev: fix segfault on video thread switch and exit from hw_ctx cores (#13571) 2022-01-30 09:24:33 +01:00
Colin Kinloch
5bd7433ac4
(Vulkan/GL) goto error without HAVE_EGL (#13568) 2022-01-29 19:56:49 +01:00
Tony
86cced8eab
Fix frameskipping with duped frames (#13560) 2022-01-29 10:57:01 +01:00
Tony
84f558db0b
Add optional frame skipping when fast-forwarding (#13550) 2022-01-26 18:30:33 +01:00
Piotr Dobrowolski
a612e7f7cc
sdl_gl_ctx: fix focus detection on webOS (#13526) 2022-01-24 16:31:35 +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
Tony
49d3a947b8
(D3D10/11) Add vsync swap interval (#13521) 2022-01-21 04:35:22 +01:00
Giovanni Cascione
f93548ab56
mali_fbdev fix for fps drop after egl_destroy (#13494)
Currently each time a screen resolution or setting change occurs, fbdev_destroy, fbdev_init and fbdev_set_mode are called in sequence, trying to destroy context and surface (though context pointer seems to remain unchanged) and create again both of them.
However it seems something is wrong with egl_destroy, as after the call fps drops from 60 to 33fps in GUI with huge performance impact, at least with libmali.
Philosophy is changed with this commit to avoid destroying and creating context and surface each time (creation only occurs in fbdev_init and egl_destroy is called only if retroarch is shutting down).
As a minor modification, framebuffer is resetted to 0 on retroarch shutdown to avoid any chance of freezed screen effect.
2022-01-14 15:30:04 +01:00
Dystopian
2095fc53f8
Fix webOS build and run (#13480) 2022-01-12 07:12:34 +01:00
Colin Kinloch
3e3cf904ca
(Vulkan) Double combined image sampler descriptor pool size (#13467) 2022-01-10 09:10:11 +01:00
MajorPainTheCactus
ad4f6176ff
Vulkan driver fixes for HDR (#13468)
* Fixed crash on boot with xmb and vulkan driver Fixed wrong blend state affecting the ribbon shader Fixed up C++ style comments with C style

* Fixed compilation issue - I made a last minute change and thought I had compiled it but obviously hadn't! No wonder it worked.
2022-01-10 06:26:02 +01:00
MajorPainTheCactus
1a228a4e78
Added HDR support to Vulkan driver (#13456) 2022-01-08 13:22:34 +01:00
Tony
5b85339839
(Vulkan) Emulate mailbox only with vsync (#13460) 2022-01-07 17:08:24 +01:00
crystalct
19d05db9ae
PSL1GHT/PS3 build fix (#13446) 2022-01-06 08:21:14 +01:00
Giovanni Cascione
f43b19db4f
mali_fbdev: fix for yoffset>0 (screen freezing), setterm unavailable and refresh_rate division by 0 (#13450)
-In case yoffset is not set=0 by the driver (which seems to occur randomly on certain configurations), on next set_video_mode call screen freezes and cannot be updated. Condition to set yoffset to 0 if current value is >0 is added as fix.
-If setterm is not available, sh error occurs in the shell on gfx_ctx_mali_fbdev_destroy call. Condition based on setterm availability is added to avoid this.
-If pixclock from driver is not available (=0), divide by 0 occurs when trying to calculate refresh rate. Condition is added as a fix, if pixclock=0 refresh rate is set as 60.
2022-01-05 19:26:39 +01:00
cedorg
be05a7e194
Fix buffer overflow. (#13436)
retroarch sometimes crashes at startup when loading asset textures with gl1 driver.

Co-authored-by: cborg <moi@schtroumpf-moi.village>
2021-12-31 18:17:02 +01:00
Nikos Chantziaras
be650a790c
Add option for showing the overlay behind the menu (#13360)
* Add option for showing the overlay behind the menu

This commit lays the groundwork for this option. Support for this option
in the video drivers themselves is going to be added in later commits.

* gl1: Add overlay behind menu support

* gl2: Add overlay behind menu support

* gl3: Add overlay behind menu support

* vulkan: Add overlay behind menu support

* ctr: Add overlay behind menu support

* d3d9: Add overlay behind menu support

* d3d10: Add overlay behind menu support

* d3d11: Add overlay behind menu support

* d3d12: Add overlay behind menu support

* CHANGES.md: overlay behind menu

Co-authored-by: MrHuu <MrHuu@users.noreply.github.com>
Co-authored-by: Tony <45124675+sonninnos@users.noreply.github.com>
2021-12-26 04:56:44 +01:00
Colin Kinloch
22df09885e
(Wayland) Use any display for initial metrics (#13417) 2021-12-26 04:53:57 +01:00
tunip3
a28e226ef4
Make resolution switching automatic and fix angle output issues [UWP/XBOX] (#13406)
* force angle to render at 1080p regardless of screensize as the output is 1080p regardless of screensize.
This fixes an issue where at 4k any angle output would be zoomed into a corner

* set resolution based on display resolution (auto 4k)

* set driver to d3d11 if booting with opengl

* reset width and height of output on boot to match display

Co-authored-by: Tunip3 <tunip3@users.noreply.github.com>
2021-12-24 14:34:30 +01:00
twinaphex
e1d144e2b8 (Wayland) Style nits 2021-12-24 14:29:12 +01:00
Colin Kinloch
f0392474f2
(Wayland) Add libdecor for client side decoration (#13397) 2021-12-24 14:20:45 +01:00
Colin Kinloch
1afbe4a326
(Wayland) Use checked sizes in EGL resize (#13394) 2021-12-24 03:27:07 +01:00
Colin Kinloch
7d52d43667
[Wayland] Fix window title update (#13396) 2021-12-24 03:14:20 +01:00
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