Commit Graph

4006 Commits

Author SHA1 Message Date
jdgleaver c687a29d6a
Input Remaps: Fix saving of 'Analog to Digital Type' when configuration overrides are used (#13824) 2022-04-04 19:08:17 +02:00
Mats 4a1a1e2fa7
(steam) Introduce Steam Rich Presence (#13798) 2022-04-02 08:07:40 +01:00
Michael Burgardt fd35162cbe
Add Valencian language option (#13789) 2022-03-30 17:59:09 +02:00
jdgleaver c6e83d23f5 RETRO_ENVIRONMENT_SHUTDOWN Fixes
- Ensure core is properly unloaded when RETRO_ENVIRONMENT_SHUTDOWN is called
- Ensure menu stack is properly flushed when RETRO_ENVIRONMENT_SHUTDOWN is called
2022-03-18 13:15:47 +01:00
jdgleaver ea77410037 Add 'Manage Remap Files' submenu + automatically save input remaps when closing content 2022-03-16 18:59:49 +01:00
jdgleaver b08314cf60 Prevent 'global' configuration of input libretro device type 2022-03-15 17:43:28 +01:00
jdgleaver 1490ad18a2
Prevent log spam when using rewind hotkey with cores that don't support rewind if rewind functionality itself is disabled (#13741) 2022-03-14 18:17:43 +01:00
Jamiras b4d9d6c5fc
move slowdown disable into toggle_hardcore_active (#13734) 2022-03-11 07:17:54 +01:00
Nikos Chantziaras b094c58081
Add hotkey for toggling sync to exact content framerate (#13725)
* Add hotkey for toggling sync to exact content framerate

* CHANGES.md: add sync to exact content framerate toggle hotkey
2022-03-10 17:21:08 +01:00
Mats 249241d7cd
(steam) Initial integration with Steam API w/ mist (#13710) 2022-03-09 15:05:07 +01:00
Michael Burgardt 56f2e2f7b8
Add Czech language option (#13680) 2022-03-07 19:11:39 +01:00
Vladimir Serbinenko 4a53c6771c
Several fixes and improvements do NGC and Wii (#13698)
* Support new elf2dol path in Makefile.griffin

* Fix NULL pointer dereference when no core info is available

* Fix double include of different versions of libogc

* Move ngc and wii to Makefile.common

Resulting binary is 60K *smaller*. This is surprising but probably due to
less inlining happening

* gx_gfx: Fix hang on gfx initialization

* Remove sthread_isself on NGC/Wii

It relies on pthread_equal that is not there for either legacy pthreads
or normal pthreads on those platforms

* Wii networking

* Missing includes in split

* Network fixes

* Fix logging of non-format string as a format

* Support for gx netlogger

* Network fix

* Network fixes

* Network info

* gx: Move config files to app directory

Otherwise it clashes between wiiU and vWii version with unpredictable
effects
2022-03-04 13:43:00 +01:00
Tony 69cf8b1795
Fix some command line segfaults (#13682) 2022-02-28 10:32:50 +01:00
Tony 3b1d75d9cf
Console help output cleanup (#13678) 2022-02-27 05:30:04 +01:00
jdgleaver b697f556e5
Ensure that cores are deinitialised correctly following initialisation failure (#13665) 2022-02-24 14:49:33 +01:00
twinaphex d2ab5d05ee Remove GONG remnants 2022-02-19 05:33:32 +01:00
jdgleaver e541dd5ab1
Disable run-ahead and rewind based on save state support level defined in core info files (#13594)
* Disable run-ahead based on save state support level defined in core info files

* Disable rewind based on save state support level defined in core info files
2022-02-05 00:25:33 +01:00
Keith Bowes cce04bab70
Remove references to removed features (#13564) 2022-01-30 09:29:43 +01:00
jdgleaver fa213a724f
Fix crash when cores using RETRO_ENVIRONMENT_SET_AUDIO_CALLBACK return false from retro_load_game() (#13547) 2022-01-26 18:30:07 +01:00
Michael Burgardt 311fec15d9
Add Indonesian, Swedish and Ukrainian language options (#13490)
* Add Indonesian, Swedish and Ukrainian language options

* Enable Indonesian and Swedish localisations for RGUI
2022-01-19 19:12:55 +01:00
Jamiras 0a1ffcd4d5
reset hardcore default to enabled; show message when trying to load state in hardcore (#13471) 2022-01-11 13:48:05 +01:00
jdgleaver 1935d217d2
Enable 'short form' notation when specifying core path on the command line (-L, --libretro=FILE) (#13454) 2022-01-08 04:03:06 +01:00
Nikos Chantziaras 0357b6c922
Add on-screen statistics toggle hotkey (#13381)
* Add on-screen statistics toggle hotkey

* CHANGES.md: Add technical statistics hotkey
2021-12-21 00:03:35 +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
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
Tony 09880e92d2
Logging cleanups (#13320) 2021-12-04 14:21:12 +01:00
Tony 121ca3a482
'Automatic Frame Delay' improvements: (#13297)
- swap interval handling
- d3dx handling
2021-12-02 02:32:39 +01:00
twinaphex adc325e908 Move command_get_config_param to command.c 2021-11-23 17:14:38 +01:00
twinaphex bc6433e0f9 Move menu_content_environment_get to task_content.c 2021-11-23 17:10:52 +01:00
twinaphex b4137915e8 Move code to proper locations 2021-11-23 16:58:36 +01:00
twinaphex c2c36177b8 Move two variables to input_driver.c 2021-11-22 15:26:54 +01:00
twinaphex 9982452c18 Move code from retroarch.c to runloop.c 2021-11-22 03:33:58 +01:00
Autechre 2b87cd9313
Create runloop.c and split up runloop code to this new file; (#13269)
* Create runloop.c and split up runloop code to this new file;
retroarch.c now 207Kb and runloop.c 301Kb

* Define empty runloop_secondary_core_destroy
2021-11-22 03:27:23 +01:00
twinaphex d3d7748f92 Move global error_on_init/error_string/sjlj jump to global
state - move g_extern out of p_rarch
2021-11-21 23:26:47 +01:00
Autechre 113e9340c1
Move ui_companion_driver code out of retroarch.c (#13268)
* Move ui_companion_driver code out of retroarch.c

* Buildfix

* Fix error - was reading the array out of (preinitialized) bounds

* Remove unused variable
2021-11-21 23:19:23 +01:00
Autechre 5f49899343
Bluetooth refactor (#13266)
* Use HAVE_BLUETOOTH ifdef to strip out this code when not defined

* Split up bluetooth code into its own file
2021-11-21 20:44:08 +01:00
Autechre 71b30d7846
Split up wifi networking code - move it into separate file (#13262) 2021-11-21 12:37:39 +01:00
Tomáš Kelemen (vudiq) a2f9273979
Bluetooth: add option to remove pairing
Pressing the START button removes the device pairing. Useful in case
the device (e.g. gamepad) was paired with a different adapter/computer
and needs to be paired again with current adapter/computer.

To pair again, RetroArch needs to be restarted, so the device list is
populated again.

Upstream of patch used by Lakka at build time
1943ad296e/packages/libretro/retroarch/patches/retroarch-98-remove_bluetooth_pairing.patch
2021-11-17 22:15:35 +01:00
GavinDarkglider a60df14d81
Lakka/Nintendo Switch: disable cpu scaling for Nintendo Switch
Lakka on Nintendo Switch uses own cpu governor.

Upstream of patch used by Lakka at build time
1943ad296e/packages/libretro/retroarch/patches/retroarch-04-cpufreq-wip-disable-on-switch.patch
2021-11-17 22:15:35 +01:00
Tomáš Kelemen (vudiq) be92517b16
Lakka: use different shutdown/reboot system commands
To avoid any filesystem corruption during shutdown/reboot a sleep is
added before shutdown/reboot is called. Also no quit is called, as the
RetroArch process will be killed by systemd. Quitting RetroArch may
result in unwanted restart of RetroArch by systemd.

Upstream of patch used by Lakka at build time
1943ad296e/packages/libretro/retroarch/patches/retroarch-02-graceful-shutdown-reboot-hack.patch
2021-11-17 22:15:35 +01:00
Tomáš Kelemen (vudiq) 3fa1052dad
Honor config_save_on_exit when Reboot/Shutdown is called
When Shutdown or Reboot are selected from the main menu, configuration
is saved regardless of checking the user setting. Showing the widget and
saving the configuration should be called only in case user wants to
save configuration on exit.
2021-11-17 17:44:27 +01:00
Autechre 0c45d96a99
Merge pull request #13229 from libretro/move-driver
Move driver code to driver.c file - move code outside of retroarch.c
2021-11-15 19:29:54 +01:00
twinaphex d7a8bc55a3 Revert "(Cthulhu88) Add netplay hotkey bind"
This reverts commit deaf116d38.
2021-11-12 19:00:24 +01:00
twinaphex 70ee3fbca7 Revert "(Cthulhu88) New Netplay MITM Part 2"
This reverts commit 34c374737c.
2021-11-12 18:58:40 +01:00
twinaphex 34c374737c (Cthulhu88) New Netplay MITM Part 2 2021-11-12 06:31:54 +01:00
twinaphex 2d5e090eb3 Move driver code to driver.c file - move code outside of retroarch.c 2021-11-12 04:45:09 +01:00
twinaphex 13d662d76b Silence some warnings 2021-11-11 22:28:16 +01:00
twinaphex dfb0e298c5 Buildfix 2021-11-11 07:49:43 +01:00
twinaphex b3a1a769b9 Move location state and camera state out of retroarch.c 2021-11-11 07:43:49 +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 deaf116d38 (Cthulhu88) Add netplay hotkey bind 2021-11-10 04:58:59 +01:00
twinaphex 0b768d0460 Split up recording code 2021-11-10 02:34:04 +01:00
twinaphex 28bef36c74 Remove retroarch_data.h and retroarch_fwd_decls.h 2021-11-10 01:18:24 +01:00
twinaphex 619398bbe4 Backport parts of 73c0760236 2021-11-09 23:12:57 +01:00
twinaphex 3cfab5ab88 Fix symbol conflict with quasi88 2021-11-09 17:07:10 +01:00
twinaphex f671ce4f8c Move global->name to runloop_st 2021-11-09 06:03:00 +01:00
twinaphex fe2c3a5310 Move state from retroarch_data.h over to retroarch.c 2021-11-09 05:16:51 +01:00
twinaphex 2886932968 Move menu global state code from global_t to menu_st 2021-11-08 20:04:55 +01:00
twinaphex bd5295ca76 Get rid of RARCH_TIMER_ macros 2021-11-08 19:54:27 +01:00
barbudreadmon 211e7d4094
always return false if rotation unavailable 2021-11-08 17:59:31 +01:00
twinaphex 88c771fc66 Cleanups 2021-11-07 01:44:45 +01:00
twinaphex 9cdf00e7ee Global variable states - preinitialize to 0 2021-11-06 14:47:34 +01:00
twinaphex 139eaad627 Fix warning 2021-11-06 14:20:02 +01:00
twinaphex 8dcbd61eeb (Netplay) Fix memory leak - pointed out by Cthulhu88 2021-11-06 14:17:03 +01:00
sonninnos 75e16f684e Crash fix for 'Automatic Frame Delay' 2021-11-06 14:36:14 +02:00
twinaphex 61d30cdc31 Move input code from retroarch.c to input_driver.c 2021-11-06 04:34:54 +01:00
twinaphex 0c0b86c4cf Buildfix #4 2021-11-06 03:56:34 +01:00
twinaphex 0e0b3bfc68 Buildfix #3 2021-11-06 03:52:02 +01:00
twinaphex cbe00cad57 Another buildfix (sigh) 2021-11-06 03:41:14 +01:00
twinaphex ae9ebf13d3 Potential buildfix 2021-11-06 03:38:41 +01:00
twinaphex 89fd900429 Define this for HAVE_TRANSLATE too 2021-11-06 02:24:28 +01:00
twinaphex a1165664a6 Buildfixes 2021-11-06 02:20:18 +01:00
twinaphex 6d9c9e2b2c Move more code around 2021-11-06 02:18:01 +01:00
twinaphex 3cea5996bc Move code from retroarch.c to menu_driver.c 2021-11-06 02:13:10 +01:00
twinaphex 538a334fe8 Remove unused variables 2021-11-06 02:04:07 +01:00
twinaphex a594ccd81c (Accessibility) Move out of p_rarch state 2021-11-06 01:59:03 +01:00
Tony 3137f8470b
Add 'Automatic Frame Delay' option (#13190) 2021-11-05 23:42:23 +01:00
twinaphex 0b16a64d40 Remove unused variables 2021-11-05 22:42:09 +01:00
twinaphex 6a0d7c63d5 Use C-style comment 2021-11-05 22:33:08 +01:00
twinaphex ae43a7e7cb (CLI) -C/--connect command-line fix 2021-11-05 22:25:06 +01:00
twinaphex c912619653 * Move port_map to runloop_state
* Get rid of p_rarch dependencies in functions
2021-11-05 22:03:13 +01:00
twinaphex 67c010394d Remove netplay_discovery.h - hopefully fixes other build issues 2021-11-05 19:12:55 +01:00
twinaphex 3ead1ac5df Move discord code to separate file 2021-11-05 14:00:37 +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 8af0c2755d Remove unused variables 2021-11-05 05:10:32 +01:00
twinaphex 11defb4009 Move netplay/networking code to netplay_frontend.c - move it out of
retroarch.c
2021-11-05 04:42:03 +01:00
twinaphex fe0c0d73ff Move aspectratio_lut to video_driver.c 2021-11-05 03:47:04 +01:00
twinaphex c54aeffd9e Cleanups 2021-11-05 02:58:41 +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 c8b69aa506 More preparation for being able to move code out of retroarch.c 2021-11-05 00:50:20 +01:00
twinaphex 574b850dd7 Preparations for being able to move discord and networking code
out of retroarch.c
2021-11-04 22:50:38 +01:00
twinaphex be347e9d49 Move command_event_reinit to command.c 2021-11-04 00:38:18 +01:00
twinaphex f59b420fde * Move more code to command.c
* Buildfix for CTR/3DS
2021-11-03 21:59:58 +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
Autechre 80e0114ccf
Move collect_system_input to input_driver.c (#13183) 2021-11-03 16:48:57 +01:00
gblues 1ef78d3e3d
Any pad can control the menu (#13173)
* Any pad can control the menu

== DETAILS
I am not sure I've quite got it so that any pad can *open* the
menu, but I do have it so any pad can control it.

- split out the input processing into a separate method
- track down and squish some hairy bugs that boiled down to
  bad pointer math
- it looks like `menu_driver.c` has a mix of line endings, so I
  ran it through `dos2unix` so it has consistent line endings
  again.
- verified that this change did not impact actual cores

* optimize out cumulative_bits

* Incorporate PR feedback

Many thanks to @jdgleaver for providing these optimizations.

* apply one more optimization
2021-11-03 16:32:15 +01:00
twinaphex abce5e1c6f (retroarch.c) Cleanups - go through more pointers 2021-10-30 11:32:10 +02: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
Autechre 49e99266f8
Move frontend code to frontend_driver.c (#13170) 2021-10-29 19:43:37 +02:00
twinaphex c5688729c2 Move has_set_libretro_device to runloop_state 2021-10-29 18:24:19 +02:00
twinaphex 5477e34815 Move stray globals subsystem_data and subsystem_current_count to
runloop_state
2021-10-29 17:41:31 +02: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 18707da360 Move menu_driver_ctl to menu_driver.c 2021-10-29 13:31:10 +02:00
twinaphex 80e7e1adde Move state over 2021-10-28 06:03:54 +02:00
jdgleaver c67c7c944d
Initialise 'Explore' menu on a background thread (#13162) 2021-10-27 17:51:22 +02:00
Autechre 514534f99b
Move more state to runloop_state (#13124)
* Move more state to runloop state

* remove unused variable

* Cleanup

* Move more state to runloop_state

* Remove unused variable

* Cleanups

* move input_remapping functions over to input_driver.c

* Some buildfixes
2021-10-18 15:23:22 +02:00
Nathan Strong c0719e737b build fix 2021-10-17 00:25:01 -07:00
Nathan Strong 5b4b766459 Fix wiimotes regression
== DETAILS
- only call disconnect when we're actually disconnecting a remote
  (e.g. read errors or remote goes to sleep).
- clean up some compile warnings introduced by others (mainly
  unused variables)
2021-10-16 23:56:15 -07:00
Autechre f86c28afac
Merge pull request #13120 from libretro/move-runloop2
move more state to runloop_state
2021-10-15 16:43:44 +02:00
twinaphex 9184d0e114 Move hid_data to input_st 2021-10-15 16:31:31 +02:00
twinaphex 5c6d92bb95 move more state to runloop_state 2021-10-15 16:13:21 +02:00
twinaphex b200ced199 Buildfix for --have-menu 2021-10-15 14:43:25 +02:00
twinaphex 9b4636ff62 Fixes --disable-menu 2021-10-15 14:32:07 +02:00
twinaphex af40baa04d Address feedback 2021-10-15 13:54:04 +02:00
twinaphex a291323467 Move some code to gfx/video_driver.c 2021-10-15 02:25:12 +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
twinaphex 6f7b5a3f15 Buildfix for non-HAVE_DYNAMIC 2021-10-15 00:23:40 +02:00
twinaphex 70b337782d Fix MSVC build 2021-10-15 00:11:52 +02:00
twinaphex b9500ff729 Move state over to runloop state 2021-10-14 22:18:14 +02:00
twinaphex 5e8b2bfed1 Move variables to runloop state 2021-10-14 22:02:09 +02:00
twinaphex ba19dc3140 Move more related to core to runloop_state 2021-10-14 21:47:35 +02:00
twinaphex bf2c3902d4 Cleanups 2021-10-14 21:35:38 +02:00
twinaphex 2b41173cd5 Move more state to runloop_state 2021-10-14 21:22:07 +02:00
twinaphex 6d6ed11b60 remove unused p_rarch variables 2021-10-14 21:18:53 +02:00
twinaphex eef9668263 move runloop state from retroarch_data to runloop_state 2021-10-14 21:15:11 +02:00
jdgleaver 40925baacd Enable SRAM for contentless cores 2021-10-14 13:59:23 +01:00
twinaphex c19b04e21e Cleanup emscripten_mainloop 2021-10-13 23:15:14 +02:00
twinaphex b5e7957260 Fix emscripten 2021-10-13 23:14:26 +02:00
twinaphex c098a321b4 silence more warnings 2021-10-13 20:27:31 +02:00
twinaphex a79bd56018 (WiiU) Prevent implicit declarations 2021-10-13 20:22:01 +02:00
twinaphex 22d70a64dd Move command_write_memory and command_read_memory to command.c 2021-10-13 18:15:35 +02:00
twinaphex 753a04c9c1 Move menu_driver_toggle to menu_driver.c 2021-10-13 17:59:45 +02:00
twinaphex 68f0e50a2f rename a bunch of functions to runloop_ prefix instead of retroarch_ -
we need to make a better distinction between runloop and the 'retroarch
state'
2021-10-13 17:48:40 +02:00
twinaphex 0b66c81197 Move state variables to runloop_state 2021-10-13 17:37:24 +02:00
twinaphex e72a88a98e Move some variables to widget state 2021-10-13 17:25:31 +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
twinaphex f070da6dfc Move code to menu_driver.c and input_driver.c 2021-10-13 15:40:01 +02:00
twinaphex 99b09ce359 Move more code to gfx/video_driver.c 2021-10-13 15:20:09 +02:00
twinaphex 5f4d4fe678 Move more code from retroarch.c to video_driver.c - retroarch.c now
778kb
2021-10-13 15:15:24 +02:00
Autechre 0a888f7868
Move video state to gfx/video_driver.c - reduces filesize of retroarch.c to 809kb (#13104)
* Move video state to gfx/video_driver.c - reduces filesize of retroarch.c
to 809Kb
2021-10-13 14:56:22 +02:00
twinaphex e9d4fcc00c Buildfix 2021-10-11 18:06:25 +02:00
Bernhard Schelling a3d9201581
Add environment callback to get the rate retro_run is called (#13022)
* Add GET_THROTTLE_STATE environment callback

* Add RETRO_THROTTLE_UNBLOCKED
to report the case where neither vsync nor audio is limiting the call rate.
Also fix reporting of some special cases when the menu is open.

* Change throttle state mode to unsigned
Use #defines Instead of the untyped C enum to allow easier future additions.

* Spelling fixes

* Avoid any divide-by-zero
2021-10-11 18:05:13 +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
twinaphex 3d710db798 input_state_wrapper symbol name was causing collisions with certain
cores on statically linked platforms
2021-10-08 12:50:45 +02:00
jdgleaver 534f8da487 Add enviroment callback to enable cores to notify the frontend that a core option value has changed 2021-10-06 16:45:14 +01:00
twinaphex 682d45379c Buildfix 2021-10-06 06:03:33 +02:00
twinaphex 61ee2274e6 Move more code over to input_driver.c - BSV code in particular but
also input state function callbacks - retroarch.c code size reduced
to 874Kb
2021-10-06 05:57:39 +02:00
Autechre f242ef6a7c
Merge pull request #13073 from gblues/gblues/wiiu-unified-hid
Gblues/wiiu unified hid
2021-10-06 02:25:08 +02:00
twinaphex f4734d223c Another buildfix 2021-10-05 22:57:49 +02:00
twinaphex 376b7a622c Fix NGC/Wii builds 2021-10-05 22:18:08 +02:00
Nathan Strong e02e345a28 Make GCA driver compatible with other HID drivers
== DETAILS
Use a little trickery to ensure the GCA driver continues working
with other HID implementation.

I've expanded the joypad implementation to support multi-pad devices.
However, this requires changes to each HID implementation to actually
function.

I've made the necessary changes for WIIU, but I don't have the means
of making the change in the other HID implementations.

So, I've built in a backwards-compatibilty mode for the driver.

The trick is to have an identifier byte at the top of both data structs
that the driver returns. We can then use that byte to determine which
of the structs has been passed to the pad functions and act accordingly.

In the GCA case, for non-wiiu platforms, it will simply expose port 1
of the GCA and the other 3 ports do nothing.
2021-10-05 09:47:03 -07:00
Nathan Strong 5da1cd08ff Unify the HID driver architecture
== DETAILS
When I first implemented the Wii U HID architecture, I ended up
having to design my own implementation because, at the time, I did
not have a way to read the HID device string to allow the existing
code to successfully detect the gamepad.

After spending some time experimenting, I've figured out how to
do this. And that means I can better align the HID driver with other
platforms.

change summary:

- create a single state structure for all three sub-types of wiiu pads
  (kpad, wpad, and hid)
- eliminate confusing duplicate pad lists
- eliminate confusing duplicate HID pad drivers (ds3, gamecube
  adapter, etc)
- ensure the ds3 driver still works
2021-10-05 09:23:08 -07:00
Francisco Javier Trujillo Mata 9f96723dd0 Adding proper translations for changing resolution 2021-10-04 23:53:55 +02:00
Francisco Javier Trujillo Mata 3bbfcf7b39 Adding to get_video_output_size 2 parameters for additional info 2021-10-04 23:53:55 +02:00
Francisco Javier Trujillo Mata 216675919b Add PS2 Support for changing resolution and offset 2021-10-04 23:53:55 +02:00
Autechre 8807e2957e
Input refactors pt3 (#13053)
* Move more internal state over to input_driver.c and menu_driver.c -
retroarch.c now down to 893kb
- Remove now unused p_rarch pointers in functions
2021-10-01 07:18:30 +02:00
twinaphex e9a4e811ac Move more code and variables from rarch_state out to input_driver
and menu_driver
2021-10-01 00:41:50 +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 878ad88e5b Buildfix 2021-09-30 21:34:36 +02:00
twinaphex dbe414e1e1 move input_poll_overlay to input_driver.c 2021-09-30 21:29:35 +02:00
twinaphex ef875f6102 Create input_state_get_ptr - move to input_driver.c -
also moved over the functions that had a dependence on this
state - retroarch.c reduced to 979kb now
2021-09-30 20:54:56 +02:00
twinaphex e13073c411 move gfx_thumb_state to gfx_thumbnail.c 2021-09-30 18:05:00 +02:00
twinaphex b1410c72e5 - Move disp_get_ptr to gfx_display.c
- Move menu_driver_init to menu_driver.c, and turn
menu_driver_init_internal into static function
2021-09-30 17:14:26 +02:00
twinaphex 5ba8843354 Move dispwidget_get_ptr over to gfx_widgets.c 2021-09-30 04:40:15 +02:00
twinaphex 0364a277e4 Fix function declaration 2021-09-28 15:22:33 +02:00
twinaphex 4c419466e6 Cleanups 2021-09-28 15:19:08 +02:00
twinaphex 9bb2359a86 More naming consistency changes - take 'retroarch_' prefix out of
functions that don't touch p_rarch state
2021-09-28 13:48:49 +02:00
twinaphex f90809d754 Move data out of retroarch_data.h and into retroarch.c 2021-09-28 13:02:14 +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 e4bec6739c Move code over to menu_driver.c 2021-09-28 12:07:29 +02:00
twinaphex e31fbb8048 Move menu_driver_alive to menu_state 2021-09-28 10:11:13 +02:00
twinaphex 1e29ba3cd6 Move menu_driver_is_binding to menu_state 2021-09-28 09:52:46 +02:00
twinaphex 9e26012751 Move menu_driver_init_internal to menu_driver.c 2021-09-28 09:32:11 +02:00
twinaphex 9727be4de6 Cleanup 2021-09-28 04:03:15 +02:00
twinaphex 774dccca7c Move more code over to gfx/video_driver.c 2021-09-28 02:15:11 +02:00
twinaphex 3dee62ce62 Cleanups and buildfix 2021-09-28 01:16:53 +02:00
twinaphex 05e4aa8bfb move more code over to gfx/video_driver.c 2021-09-28 00:50:48 +02:00
twinaphex 4574a58683 (video_driver.c) Move some code over 2021-09-27 20:31:31 +02:00
twinaphex 0448afab96 Move video driver functions over to gfx/video_driver.c 2021-09-27 19:37:22 +02:00
twinaphex c3afd4b1a5 Buildfix for Emscripten 2021-09-26 23:07:51 +02:00
twinaphex 4b5951bda3 Rename gl_common.h to gl2_common.h and remove some file dependencies
on it
2021-09-26 17:42:12 +02:00
twinaphex ee97c2066a Make sure this is no longer a function behind a ifdef - too much
maintenance chores
2021-09-26 02:47:43 +02:00
twinaphex 89968333a4 Attempt to fix Mac build 2021-09-26 02:38:57 +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
Ben Hamilton (Ben Gertzfield) 1970786932
New feature: Use gamepad combo to quit Retroarch (#13017)
* Refactor menu toggle combo button logic to allow quit combo button

* Quit gamepad combo

* Fixes from @jdgleaver
2021-09-24 18:30:46 +02:00
twinaphex 6eeebeab25 Get rid of gfx_display_set_msg_force 2021-09-21 21:10:38 +02:00
twinaphex 83ce4259a0 Have only one getter for runloop_state 2021-09-21 19:08:26 +02:00
twinaphex 550d3fa766 Create new header runloop.h 2021-09-21 18:38:53 +02:00
twinaphex f21641d898 Get rid of another 'getter' function 2021-09-21 18:30:56 +02:00
twinaphex 1b7dea7e8e Move code over to menu_driver.c 2021-09-21 18:14:01 +02:00
twinaphex c42f932c3f Moved code over to menu_driver.c 2021-09-21 18:04:48 +02:00
twinaphex f11f892076 Put retroarch_apply_shader_preset behind ifdef 2021-09-21 17:31:51 +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
twinaphex 44012ace47 move more menu state over to menu_driver.c 2021-09-21 06:05:25 +02:00
twinaphex 28e0b669d2 (menu) move more state over 2021-09-21 05:44:53 +02:00
twinaphex 58bc88d433 Move menu_driver_state over to menu_driver.c and move it out of
p_rarch
2021-09-21 05:33:46 +02:00
twinaphex 30353ac8f2 move more code out of retroarch.c/retroarch_data.h and into
menu_driver.c
2021-09-21 05:11:39 +02:00
twinaphex d68a138250 Move more menu state to menu_state_t - and move code from
retroarch.c to menu_driver.c
2021-09-21 04:51:38 +02:00
twinaphex c4b8fab0d0 Move menu_input_state to menu_state 2021-09-21 04:20:04 +02:00
twinaphex f3b2e233bb Move more code to menu_driver.c 2021-09-21 00:51:15 +02:00
twinaphex abebf4a421 Cleanups 2021-09-21 00:41:52 +02:00
twinaphex ec55f8188a Move code out of retroarch.c and into menu/menu_driver.c 2021-09-21 00:12:26 +02:00
twinaphex e2e236f1bf Create menu_state_get_ptr() 2021-09-21 00:00:50 +02:00
twinaphex 94b5769375 Cleanups 2021-09-20 21:21:54 +02:00
twinaphex d2af43d457 Cleanups 2021-09-20 21:08:53 +02:00
twinaphex fabdede667 Move anim_get_ptr to gfx_animation.c 2021-09-20 20:17:53 +02:00
Autechre cbfa8d6400
Move coreinfo_get_ptr internal state back to core_info.c (#13020) 2021-09-20 15:43:27 +02:00
twinaphex 9b5a60af53 Move location driver code to separate file 2021-09-20 06:26:14 +02:00
twinaphex 238eb649a2 Split up midi_driver code to midi_driver.c 2021-09-20 03:43:37 +02:00
twinaphex b3d724b7a3 Move code out of retroarch.c 2021-09-18 22:05:03 +02:00
twinaphex eb895f9947 move more code out of retroarch.c 2021-09-18 21:14:15 +02:00
twinaphex 1c546cb7fd move more code out of retroarch.c 2021-09-18 21:03:16 +02:00
twinaphex db3f0a8468 Move code out of retroarch.c - move it into
network/netplay/netplay_frontend.c
2021-09-18 06:15:02 +02:00
twinaphex 7c74e035b0 Small cleanups 2021-09-18 06:15:02 +02:00
Autechre 62a66ff0e5
Prevent crash pointed out by LIJI - primary_joypad can be NULL (#13002) 2021-09-17 05:20:09 +02:00
twinaphex 3c69a941da Move code over to input_driver.c 2021-09-13 18:33:53 +02:00
twinaphex 2b08ebb677 Cleanups 2021-09-13 18:09:44 +02:00
MajorPainTheCactus 3c6bdfd0d8
Fixed numerous issues with HDR (#12979)
* Fix for warning and fix for incorrect comment

* Fixed contrast to be more correct - now scales from 0-10 linearly and behaves more the way you'd expect it to - changed name to ditch legacy settings users may have
Added ability to skip inverse tonemapper to the shader via the constant buffer using 'inverse_tonemap' - set to 0.0f to skip
Fixed potential bug when swapping between hdr and sdr and the bit depth not being set correctly
Fixed dx11's blend, rasterizer and topology states not being set to the sames when using hdr and leaving the menu - caused issues with PCSX2's Shadow of the Colossus
Added numerous helper functions to help create the correct values to colour the UI - normally the white UI elements should be rendered at paper white not max brightness for various reasons

* Fix stylistic issues - * Don't use camelcase for variables and function names * Use '(void)' for function declarations instead of () in C code * Declare variables at the top of a function or code block * Make sure functions that return a value always have a default return path that is not encapsulated by an else block * Use more unique names for retro_math functions which are less likely to overlap with other libraries' function symbols

Co-authored-by: twinaphex <libretro@gmail.com>
2021-09-13 16:54:50 +02:00
twinaphex ad4b51b903 Move cde from retroarch.c to input_driver.c 2021-09-12 19:27:12 +02:00
twinaphex b5138b6122 Move input_config_get_bind_string to input_driver.c 2021-09-12 17:41:00 +02:00
twinaphex ad39b1d115 Simplify osk_update_last_codepoint() 2021-09-12 17:36:22 +02:00
twinaphex 26b9439dbc C89_BUILD buildfix 2021-09-12 16:50:46 +02:00
Autechre cfcd0a7a0d
Merge pull request #12795 from sonninnos/video-rate-switch
Automatic PAL/NTSC refresh rate switch where available
2021-09-12 16:15:04 +02:00
twinaphex 1b8d68c6e4 Another buildfix 2021-09-11 18:36:12 +02:00
twinaphex c4cbcb2ff4 Add ifdef around this 2021-09-11 18:22:07 +02:00
twinaphex 2490f6e215 Move code from retroarch.c to video_shader_parse.c 2021-09-11 18:15:35 +02:00
twinaphex c75bb549e5 Move another function over to menu_driver.c 2021-09-09 17:26:59 +02:00
twinaphex 4830150d22 Move function out of retroarch.c and into menu_driver.c 2021-09-09 17:21:48 +02:00
twinaphex 8564b4f8e3 Fix compilation problem when HAVE_BSV_MOVIE is not defined 2021-09-09 16:58:52 +02:00
twinaphex 6a310ecfed Move more code to command.c 2021-09-09 16:55:14 +02:00
twinaphex 14cd338b97 Move code from retroarch.c to command.c 2021-09-09 16:31:35 +02:00
twinaphex 9b8145f05d Cleanups 2021-09-09 16:06:57 +02:00
twinaphex a11b1c3b72 (retroarch.c) Cleanups 2021-09-09 16:01:33 +02:00
twinaphex 772282eeec Move menu shader code over to menu_driver.c 2021-09-09 15:33:17 +02:00
twinaphex 28389d30e8 Move some code from retroarch.c over to menu_driver.c 2021-09-09 15:22:12 +02:00
twinaphex 6c79cebc6e Move input_overlay_auto_rotate_ out of retroarch.c and into
input_driver.c
2021-09-09 14:24:42 +02:00
twinaphex 81e7dab159 Move code out of retroarch.c and into input_driver.c 2021-09-09 14:11:46 +02:00
Michael Burgardt 303d17e2e6 Rebase 'Add generic rumble gain to input settings' by davidgfnet 2021-09-08 19:52:32 +02:00
Jamiras 8a31b732dd
disable slowmotion when enabling hardcore mode (#12958) 2021-09-08 18:57:19 +02:00
bulzipke 8018be5c9b
Fix ram states to file when core deinit (#12956)
* Fix ram states to file when core deinit

* Fix unterminated state_path
Call CMD_EVENT_RAM_STATE_TO_FILE when CMD_EVENT_UNLOAD_CORE too
2021-09-08 18:01:07 +02:00
twinaphex c9e587a5a7 Move more input code over to input_driver.c from retroarch.c 2021-09-07 14:55:37 +02:00
twinaphex ccbbf45760 retroarch.c - cleanups 2021-09-07 13:55:42 +02:00
twinaphex 276b4fd72c Move more code over from retroarch.c to input_driver.c 2021-09-07 13:08:31 +02:00
twinaphex 67defbcf26 Transfer code over from retroarch.c to input_driver.c 2021-09-07 12:42:03 +02:00
twinaphex 5b1872f6be retroarch.c - some cleanups - retroarch_set_frame_limit - return
value - other cleanups
2021-09-07 12:29:44 +02:00