2012-04-21 23:13:50 +02:00
|
|
|
/* RetroArch - A frontend for libretro.
|
2014-01-01 01:50:59 +01:00
|
|
|
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
2017-03-22 03:09:18 +01:00
|
|
|
* Copyright (C) 2011-2017 - Daniel De Matteis
|
|
|
|
* Copyright (C) 2014-2017 - Jean-André Santoni
|
2020-06-23 22:18:33 +02:00
|
|
|
* Copyright (C) 2015-2019 - Andrés Suárez (input remapping + other things)
|
2019-01-09 17:19:19 -05:00
|
|
|
* Copyright (C) 2016-2019 - Brad Parker
|
2015-04-05 11:14:24 -05:00
|
|
|
*
|
2012-04-21 23:13:50 +02:00
|
|
|
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
2010-12-30 01:50:37 +01:00
|
|
|
* of the GNU General Public License as published by the Free Software Found-
|
|
|
|
* ation, either version 3 of the License, or (at your option) any later version.
|
|
|
|
*
|
2012-04-21 23:13:50 +02:00
|
|
|
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
2010-12-30 01:50:37 +01:00
|
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE. See the GNU General Public License for more details.
|
|
|
|
*
|
2012-04-21 23:31:57 +02:00
|
|
|
* You should have received a copy of the GNU General Public License along with RetroArch.
|
2010-12-30 01:50:37 +01:00
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2015-06-22 20:42:41 +02:00
|
|
|
#include <ctype.h>
|
|
|
|
|
2017-12-11 12:15:00 +01:00
|
|
|
#include <libretro.h>
|
2014-10-22 03:35:04 +02:00
|
|
|
#include <file/config_file.h>
|
2015-06-22 20:42:41 +02:00
|
|
|
#include <file/file_path.h>
|
2014-10-21 07:58:58 +02:00
|
|
|
#include <compat/strl.h>
|
|
|
|
#include <compat/posix_string.h>
|
2015-12-26 07:19:04 +01:00
|
|
|
#include <string/stdstring.h>
|
2017-10-29 12:08:20 -04:00
|
|
|
#include <streams/file_stream.h>
|
2022-07-19 21:00:40 +02:00
|
|
|
#include <array/rhmap.h>
|
2015-06-22 20:42:41 +02:00
|
|
|
|
2016-09-08 05:48:43 +02:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2016-05-01 15:07:45 +02:00
|
|
|
#include "file_path_special.h"
|
2015-12-02 03:16:04 +01:00
|
|
|
#include "configuration.h"
|
2016-05-27 16:42:20 +02:00
|
|
|
#include "content.h"
|
2011-01-08 22:15:02 +01:00
|
|
|
#include "config.def.h"
|
2017-06-21 19:28:40 -04:00
|
|
|
#include "config.features.h"
|
2015-01-12 02:52:52 +01:00
|
|
|
#include "input/input_keymaps.h"
|
2015-01-24 23:49:35 +01:00
|
|
|
#include "input/input_remapping.h"
|
2017-12-27 11:05:12 -05:00
|
|
|
#include "led/led_defines.h"
|
2015-12-06 22:48:57 +01:00
|
|
|
#include "defaults.h"
|
2020-02-04 04:49:25 +01:00
|
|
|
#include "core.h"
|
2016-09-17 12:35:29 +02:00
|
|
|
#include "paths.h"
|
2020-02-04 04:49:25 +01:00
|
|
|
#include "retroarch.h"
|
2015-11-23 12:03:38 +01:00
|
|
|
#include "verbosity.h"
|
2011-01-07 17:59:53 +01:00
|
|
|
|
2021-10-11 18:01:37 +02:00
|
|
|
#include "audio/audio_driver.h"
|
2021-11-10 02:34:04 +01:00
|
|
|
#include "record/record_driver.h"
|
2020-02-16 16:54:58 +01:00
|
|
|
#include "gfx/gfx_animation.h"
|
|
|
|
|
2019-01-20 03:16:58 +01:00
|
|
|
#include "tasks/task_content.h"
|
2016-05-27 16:42:20 +02:00
|
|
|
#include "tasks/tasks_internal.h"
|
|
|
|
|
2019-07-23 05:34:14 +02:00
|
|
|
#include "list_special.h"
|
2018-06-04 07:48:08 +02:00
|
|
|
|
2019-01-02 13:30:58 +01:00
|
|
|
#if defined(__WINRT__) || defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
|
2018-12-28 12:41:38 +01:00
|
|
|
#include "uwp/uwp_func.h"
|
|
|
|
#endif
|
|
|
|
|
2021-08-12 19:03:42 +02:00
|
|
|
#include "lakka.h"
|
|
|
|
|
2023-10-06 04:55:22 -07:00
|
|
|
#ifdef HAVE_LAKKA_SWITCH
|
|
|
|
#include "lakka-switch.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(HAVE_LIBNX)
|
2021-08-12 19:03:42 +02:00
|
|
|
#include "switch_performance_profiles.h"
|
|
|
|
#endif
|
|
|
|
|
2023-05-11 22:30:06 -04:00
|
|
|
#if TARGET_OS_TV
|
|
|
|
#include "ui/drivers/cocoa/apple_platform.h"
|
|
|
|
#endif
|
|
|
|
|
2017-05-08 02:25:55 +02:00
|
|
|
enum video_driver_enum
|
|
|
|
{
|
|
|
|
VIDEO_GL = 0,
|
2019-04-24 03:23:57 +02:00
|
|
|
VIDEO_GL1,
|
|
|
|
VIDEO_GL_CORE,
|
2017-05-08 02:25:55 +02:00
|
|
|
VIDEO_VULKAN,
|
2018-07-12 21:33:18 -07:00
|
|
|
VIDEO_METAL,
|
2017-05-08 02:25:55 +02:00
|
|
|
VIDEO_DRM,
|
|
|
|
VIDEO_XVIDEO,
|
|
|
|
VIDEO_SDL,
|
|
|
|
VIDEO_SDL2,
|
2019-12-28 21:21:57 -05:00
|
|
|
VIDEO_SDL_DINGUX,
|
2021-07-13 11:36:48 -05:00
|
|
|
VIDEO_SDL_RS90,
|
2017-05-08 02:25:55 +02:00
|
|
|
VIDEO_EXT,
|
|
|
|
VIDEO_WII,
|
|
|
|
VIDEO_WIIU,
|
|
|
|
VIDEO_XENON360,
|
|
|
|
VIDEO_PSP1,
|
|
|
|
VIDEO_VITA2D,
|
2018-09-18 08:08:06 +02:00
|
|
|
VIDEO_PS2,
|
2017-05-08 02:25:55 +02:00
|
|
|
VIDEO_CTR,
|
2017-12-23 17:26:58 -08:00
|
|
|
VIDEO_SWITCH,
|
2018-01-23 02:55:33 +01:00
|
|
|
VIDEO_D3D8,
|
2022-04-19 15:45:22 +02:00
|
|
|
VIDEO_D3D9_CG,
|
|
|
|
VIDEO_D3D9_HLSL,
|
2018-01-23 18:04:55 +01:00
|
|
|
VIDEO_D3D10,
|
2018-01-21 04:10:45 +01:00
|
|
|
VIDEO_D3D11,
|
|
|
|
VIDEO_D3D12,
|
2017-05-08 02:25:55 +02:00
|
|
|
VIDEO_VG,
|
|
|
|
VIDEO_OMAP,
|
|
|
|
VIDEO_EXYNOS,
|
|
|
|
VIDEO_SUNXI,
|
|
|
|
VIDEO_DISPMANX,
|
|
|
|
VIDEO_CACA,
|
|
|
|
VIDEO_GDI,
|
|
|
|
VIDEO_VGA,
|
2019-09-17 08:16:50 +02:00
|
|
|
VIDEO_FPGA,
|
2021-05-19 22:50:34 +02:00
|
|
|
VIDEO_RSX,
|
2017-05-08 02:25:55 +02:00
|
|
|
VIDEO_NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
enum audio_driver_enum
|
|
|
|
{
|
|
|
|
AUDIO_RSOUND = VIDEO_NULL + 1,
|
2019-05-09 17:30:44 +00:00
|
|
|
AUDIO_AUDIOIO,
|
2017-05-08 02:25:55 +02:00
|
|
|
AUDIO_OSS,
|
|
|
|
AUDIO_ALSA,
|
|
|
|
AUDIO_ALSATHREAD,
|
2017-06-23 20:44:00 -05:00
|
|
|
AUDIO_TINYALSA,
|
2017-05-08 02:25:55 +02:00
|
|
|
AUDIO_ROAR,
|
|
|
|
AUDIO_AL,
|
|
|
|
AUDIO_SL,
|
|
|
|
AUDIO_JACK,
|
|
|
|
AUDIO_SDL,
|
|
|
|
AUDIO_SDL2,
|
|
|
|
AUDIO_XAUDIO,
|
|
|
|
AUDIO_PULSE,
|
|
|
|
AUDIO_EXT,
|
|
|
|
AUDIO_DSOUND,
|
|
|
|
AUDIO_WASAPI,
|
|
|
|
AUDIO_COREAUDIO,
|
2019-01-31 23:14:20 +01:00
|
|
|
AUDIO_COREAUDIO3,
|
2017-05-08 02:25:55 +02:00
|
|
|
AUDIO_PS3,
|
|
|
|
AUDIO_XENON360,
|
|
|
|
AUDIO_WII,
|
|
|
|
AUDIO_WIIU,
|
|
|
|
AUDIO_RWEBAUDIO,
|
|
|
|
AUDIO_PSP,
|
2018-09-18 08:08:06 +02:00
|
|
|
AUDIO_PS2,
|
2017-05-08 02:25:55 +02:00
|
|
|
AUDIO_CTR,
|
2017-12-24 14:33:48 -08:00
|
|
|
AUDIO_SWITCH,
|
2017-05-08 02:25:55 +02:00
|
|
|
AUDIO_NULL
|
|
|
|
};
|
|
|
|
|
Add microphone support via a new driver (#14731)
* Some slight fixes
* Update libretro.h
* Log calls to RETRO_ENVIRONMENT_GET_MICROPHONE_INTERFACE
* Finish proof-of-concept for mic support
- It works, but doesn't support floating-point audio yet
- It may need to be resampled, too
* Add macros that aren't available in SDL 2
* Comment out a variable definition for now
- For C89 compliance
* Add some comments for clarity
* Let ALSA tolerate a null new_rate
* Partial ALSA microphone support
- Not yet tested
- Mic is created and destroyed
- Mic can also be paused or unpaused
- Mic is paused or unpaused with the rest of the driver
- Microphone is not yet read
* Install error logging in the ALSA driver
- It defers to RARCH_ERR
* Free the ALSA microphone in alsa_free
* Fix an indent
* First draft of alsa_read_microphone
* Deinitialize SDL Audio in sdl_audio_free
* Save and restore the ALSA error logger
- You should always practice safe global state
* Add newlines to some RARCH_ERRs
* Add some logging
* Check for the mic being active via settings instead of via flags
* Adjusted a log entry to be less misleading
- A frequency of 0Hz looks weird to the uninformed
- In reality, it means the driver used the requested frequency
* Fix an incorrect format string
* Tidy up logging in alsa.c
* Rename audio_enable_microphone to audio_enable_input
* Rename microphone_device to audio_input_device
* Add audio_input_latency and audio_input_block_frames settings
* Add all mic-related settings to the options menu
* Adjust logging for alsa.c
- Log the ALSA library version
- Add errno details
* Refer to the microphone in logs by name
* Use %u instead of %d for some log items
* Add input_samples_buf
* Remove an inaccurate comment
* Change type of input_samples_buf
* Clean up audio_driver_flush_microphone_input
* Comment convert_float_to_s16
- It helped me understand what it's doing
- Turns out it'll work just fine on mono audio
* Don't use the resampler for mic input
* Fix crash in the ALSA driver when reading from a mic
* Update some logging messages
* ALSA support now works for mics
* Reuse some common functions in alsa.c
* Add alsa_thread_microphone_t
* Refactor alsa.c
- Introduce alsa_init_pcm to init any PCM that we're using
- Vastly simplifies the implementation of alsa_init and alsa_init_microphone
- Will be used for the read-based versions next
* Make ALSA logging a little more consistent
* Clean up the mic with alsa_free_microphone if alsa_init_microphone fails
* Remove an unused function
* Move some cleanup in alsa.c to a common function
* First crack at mic support for alsathread
- Refactor some duplicate code into functions
- Use functions introduced in alsa.c
- Create and destroy the mic
* Slight cleanups for clarity
* Implement alsa_thread_set/get_microphone_state
* More work on alsathread
- No more crashing, but the mic just returns silence
* Slight cleanups for clarity
* Add alsa_set_mic_enabled_internal
- For setting the state of a microphone while considering its current state
* Use alsa_set_mic_enabled_internal
* Log a little more info
* Log when the audio driver is started/stopped
* Move base microphone driver code into a new directory
- Add microphone_driver.c to Makefile.common
- Rename functions as needed
* Initialize and deinitialize the microphone driver
* Implement sdl_microphone.c
* Un-const an argument
- In case the driver context needs to do any locking
* Revise comments for microphone_driver.h
* Remove an unimplemented function
* Remove some functions from the mic driver
* Remove mic functions from audio_thread_wrapper
* Remove mic functions from sdl_audio
* Fix microphone_null
* Split the mic code for the alsa audio drivers into microphone drivers
* Fix an extra struct member
* Add a setting for the mic driver
* Add a command to reinitialize the microphone driver
* Rename mic-related settings
* Add DRIVER_MICROPHONE_MASK to DRIVERS_CMD_ALL
* Rename audio_enable_input to microphone_enable
* Remove some labels from qt_options
* Search for microphone_driver within find_driver_nonempty
* Clean up some mic driver code
* Pending mics now return silence
* Adjust some logging and comments
* Some cleanup in the microphone driver
* Invert a flag check
- Oops
* Fix a log message
* Fix the wrong flags being checked
* Slight refactor of wasapi_init_device
- Add a data_flow parameter
- Declare it in a header
- In preparation for WASAPI mic support
* Add some WASAPI macros for _IAudioCaptureClient
* Move some common WASAPI functions to audio/common/wasapi.c
- They'll be used by the mic and the audio drivers
* Add wasapi_log_hr
* Generalize mmdevice_list_new to look for capture devices, too
* Fix a function declaration
* Move driver-specific device_list_new functions into their respective files
* Clean up some declarations
* First draft of wasapi microphone driver
* Add wasapi_microphone_device_list_free
* Change function parameter names to be consistent with microphone_driver
* Partially implement wasapi_microphone_read
- Mostly copied from the audio driver so far
- It doesn't compile yet
- But it'll be beautiful when I'm done with it
* Refactor the mic driver's functions
- Rename get_mic_active to mic_alive
- Split set_mic_active into start_mic and stop_mic
- Refactor the SDL mic driver accordingly
* Edit some WASAPI functions for logging and clarity
* Implement more of the WASAPI mic driver
* Rename write_event to read_event
* Pass the WASAPI driver context to the various read functions
* Mostly implement the read function for the WASAPI mic driver
* Fix a crash in microphone_driver
- Forgot to move the position of the name of null_driver
* Reduce some logging in wasapi common functions
- Only log the chosen audio client format, not all attempted ones
* Add some macro wrappers for IAudioClient methods
* Update mic driver configuration
- Make the mic driver configurable in the menu
- Add config items for WASAPI-related options similar to the audio driver
* Fix a menu entry scrolling through audio devices instead of mic devices
* Add some utility functions
* Expose the new utility functions in wasapi.h
* Add extra logging in the WASAPI common functions
* Add sharemode_name
* Use _IAudioClient_Initialize macro in some places
* Pass channels to wasapi_init_client
- Remember, mics are in mono
* Use _IAudioClient_Initialize macro some more
* Forgot to pass channels in some places
* Add some utility functions
* Forgot an #include
* Add wasapi_select_device_format
* Simplify the format selection logic in wasapi_init_client_sh
* Unset the microphone in wasapi_microphone_close_mic
- Ought to prevent a potential segfault
* Simplify some logging
* Fix incorrect value being passed to _IAudioCaptureClient_ReleaseBuffer
* Remove some unneeded logging
* Add some values to hresult_name
* Polish up wasapi_select_device_format
- Test for formats manually when Windows can't
- Add some debug logging
- Check for channels
* Compute the fields of WAVEFORMATEXTENSIBLE correctly
- As per the doc's stated requirements
* Simplify logic for WASAPI client creation
* Fix a potential hang in wasapi_microphone_read_shared_buffered
* Stop the microphone if the driver is stopped
* Don't name the microphone event
* Ensure that wasapi_init_client reports the correct format and rate
* Implement exclusive microphone read access for WASAPI
* Add _IAudioCaptureClient_GetNextPacketSize macro
* Organize cases in hresult_name
* Clear some extra fields if wasapi_set_format is setting a Pcm format
* Adjust some logs
* Adjust some logs
* Remove unneeded local vars
* Add a log
* Update wasapi.c
* Update wasapi.c
* Fix shared-mode mic support in WASAPI producing broken input
- Turns out it had nothing to do with shared mode
* Reuse a common function
- Remove wasapi_microphone_read_shared_buffered
- Rename wasapi_microphone_read_exclusive to wasapi_microphone_read_buffered
* Remove some code I was using for test purposes
* Clarify some language
* Double the default shared-mode mic buffer length
* Split getting a device's name into a separate function, then use it
* Fix the ALSA mic drivers
- To comply with changes I previously made to the mic driver interface
* Remove unused synchronization primitives from the SDL microphone driver
* Add sdl_microphone_mic_use_float
* Document audio_driver_state_flags
- I needed to understand these to see if similar flags were required for the mic driver
* Remove an unused function in wasapi.c
* Add and document flags in microphone_driver.h
* Remove driver-specific mic start/stop functions
- The mic driver itself doesn't do much processing
- That honor goes to individual mics
* Remove some unused fields in microphone_driver.h
* Add CMD_EVENT_MICROPHONE_STOP/START
* Remove unused functions from microphone_null
* Change how the mic driver state is referenced in some places
* Simplify the SDL microphone driver
- The driver backend no longer keeps a reference to the mic (the frontend does that)
- Remove functions that are no longer needed
- Don't track paused state, just query the mic itself
* Simplify the WASAPI microphone driver
- Don't track the driver running state or the microphone handle, the frontend does that now
- Remove support for unbuffered input (hunterk suggested that it wasn't necessary)
* Make microphone_wasapi_sh_buffer_length a uint, not an int
- It won't be negative anymore
- 0 now represents the default value
* Make the microphone frontend more robust
- Improve documentation for how various functions should be implemented
- Closes all microphones before freeing the driver (so backends don't have to)
- Tracks the enabled state of each microphone, so backends don't have to (but they still can)
* Stop the mic driver in core_unload_game
* Ensure mic support is compatible with the revised menu code
* Move alsa.h into audio/common
* Remove RETRO_ENVIRONMENT_GET_MICROPHONE_ENABLED
- It was never really needed
* Refactor the ALSA microphone driver
- Move common ALSA functions to audio/common/alsa.c
- Replace alsa_set_mic_enabled_internal with alsa_start/stop_pcm
- Don't track the microphone handle in the ALSA driver context
- Remove unneeded fields
* Move some common alsathread code into audio/common/alsathread.c
* Change return type of mic_driver_open_mic_internal to bool
* First crack at resampling mic input
* Remove an extraneous check
- I think something distracted me when I was writing this line
* Add stereo/mono conversion functions
* Make alsa_start_pcm and alsa_stop_pcm more robust
- They now return success if the stream is already running and stopped, respectively
* Revise some mic-related comments in libretro.h
* First crack at resampling mic input
* Simplify an expression
* Simplify an expression
* Fix a log tag
* Allow mic resampler to be configured separately from audio resampler
* Add some comments
* Set the source ratio to something sensible
* Stop deadlock in `alsathread` mic driver
* Allow mics to be initialized even when core is loaded from CLI
- When loading content from CLI, the drivers are initialized a little differently
- That threw off the mic initialization code
* Rename the functions in retro_microphone_interface
* Revise some mic-related comments in libretro.h
* Update retro_microphone_interface
- Add get_mic_rate
- Add a parameter to open_mic
- The modifications don't do anything yet
* Use parameter objects in the microphone handle
* Replace get_mic_rate with get_params
* Add a microphone interface version
* Remove part of a comment
* Set the effective params in mic_driver_microphone_handle_init
* Drop a stray newline
* Change where the mic interface is zeroed
- I was accidentally throwing out the version that the core was asking for
* Reduce logspam for wasapi_set_nonblock_state
- Now it only logs when the sync mode is changed
* Change DEFAULT_WASAPI_SH_BUFFER_LENGTH to 0
- -16 is no longer a valid value
* Set the new_rate in wasapi_init
* Change description of microphone sample rate in the settings
* First attempt at resampling configured mic input
* Forgot a section
* Fix some input samples being skipped
* Rename a variable for clarity
* Add microphone.outgoing_samples
* Update the mic driver
- Processed samples are now buffered
- The resampler is skipped if the ratio is (very close to) 1
* Remove part of a comment
* Update some comments in audio_resampler.h
* Slightly refactor the SDL microphone driver
- Move SDL_AudioSpec to a field of sdl_microphone_handle_t
- Allow SDL to change the requested format and sample rate
- Request floating-point input
- Implement sdl_microphone_mic_use_float
* Fix a non-C89-compliant declaration
* Add new files to griffin.c
* Remove a C++-style comment
* Add two more files to griffin.c
* Remove some unneeded declarations in microphone_driver.h
* Remove a stray comma in configuration.c
- For C89 compliance
* Fix compilation on some platforms
* Change some function signatures
* Make the ALSA drivers always set the audio rate
* Fix the alsathread mic driver
* Make state_manager_frame_is_reversed return false if HAVE_REWIND isn't defined
* Mute the microphone if the core is running in fast-forward, slow-mo, or rewind
* Clarify a comment
* Clarify a comment
* Add a comment
* Don't allocate memory for slowmo samples in the mic driver
- We're not supporting slowmo for mics, so it's not needed
* Fix a {
* Add my name to AUTHORS.h
* Add driver_lifetime_flags
- For drivers that have special setup/teardown needs
* Ensure that resetting the mic driver maintains active mic handles
- Prevents fullscreen toggle from stopping all mic input
* Update CHANGES.md
* Move some default microphone settings to a new part of the config file
* Ensure that RetroArch can use the audio format that Windows suggests
* Remove references to mic support in the SDL audio driver
* Remove unused WASAPI functions
* Return failure if RetroArch couldn't select a WASAPI format
* Ensure that Windows uses the WASAPI mic driver by default
* Treat disabled mic support as a warning, not an error
* Clarify some WASAPI-related microphone settings
* Remove some unused variables
* Add or revise microphone-related comments
* Rearrange doc comments for microphone types in libretro.h
* Remove a space
* Remove some unused flags
* Remove ALSA error logger
- It was never used anyway
* Remove unneeded microphone-related arguments
* Document a parameter
* Remove a logging call
* Add a constant for the microphone's shared buffer length for WASAPI
* Fix stylistic inconsistencies
* Make mic_driver_get_sample_size a macro instead of a function
* Move the microphone implementation to the audio directory
* Make microphone support optional (but enabled by default)
* Fix the griffin build
2023-06-06 15:55:06 -04:00
|
|
|
enum microphone_driver_enum
|
|
|
|
{
|
|
|
|
MICROPHONE_ALSA = AUDIO_NULL + 1,
|
|
|
|
MICROPHONE_ALSATHREAD,
|
|
|
|
MICROPHONE_SDL2,
|
|
|
|
MICROPHONE_WASAPI,
|
|
|
|
MICROPHONE_NULL
|
|
|
|
};
|
|
|
|
|
2017-05-08 02:25:55 +02:00
|
|
|
enum audio_resampler_driver_enum
|
|
|
|
{
|
Add microphone support via a new driver (#14731)
* Some slight fixes
* Update libretro.h
* Log calls to RETRO_ENVIRONMENT_GET_MICROPHONE_INTERFACE
* Finish proof-of-concept for mic support
- It works, but doesn't support floating-point audio yet
- It may need to be resampled, too
* Add macros that aren't available in SDL 2
* Comment out a variable definition for now
- For C89 compliance
* Add some comments for clarity
* Let ALSA tolerate a null new_rate
* Partial ALSA microphone support
- Not yet tested
- Mic is created and destroyed
- Mic can also be paused or unpaused
- Mic is paused or unpaused with the rest of the driver
- Microphone is not yet read
* Install error logging in the ALSA driver
- It defers to RARCH_ERR
* Free the ALSA microphone in alsa_free
* Fix an indent
* First draft of alsa_read_microphone
* Deinitialize SDL Audio in sdl_audio_free
* Save and restore the ALSA error logger
- You should always practice safe global state
* Add newlines to some RARCH_ERRs
* Add some logging
* Check for the mic being active via settings instead of via flags
* Adjusted a log entry to be less misleading
- A frequency of 0Hz looks weird to the uninformed
- In reality, it means the driver used the requested frequency
* Fix an incorrect format string
* Tidy up logging in alsa.c
* Rename audio_enable_microphone to audio_enable_input
* Rename microphone_device to audio_input_device
* Add audio_input_latency and audio_input_block_frames settings
* Add all mic-related settings to the options menu
* Adjust logging for alsa.c
- Log the ALSA library version
- Add errno details
* Refer to the microphone in logs by name
* Use %u instead of %d for some log items
* Add input_samples_buf
* Remove an inaccurate comment
* Change type of input_samples_buf
* Clean up audio_driver_flush_microphone_input
* Comment convert_float_to_s16
- It helped me understand what it's doing
- Turns out it'll work just fine on mono audio
* Don't use the resampler for mic input
* Fix crash in the ALSA driver when reading from a mic
* Update some logging messages
* ALSA support now works for mics
* Reuse some common functions in alsa.c
* Add alsa_thread_microphone_t
* Refactor alsa.c
- Introduce alsa_init_pcm to init any PCM that we're using
- Vastly simplifies the implementation of alsa_init and alsa_init_microphone
- Will be used for the read-based versions next
* Make ALSA logging a little more consistent
* Clean up the mic with alsa_free_microphone if alsa_init_microphone fails
* Remove an unused function
* Move some cleanup in alsa.c to a common function
* First crack at mic support for alsathread
- Refactor some duplicate code into functions
- Use functions introduced in alsa.c
- Create and destroy the mic
* Slight cleanups for clarity
* Implement alsa_thread_set/get_microphone_state
* More work on alsathread
- No more crashing, but the mic just returns silence
* Slight cleanups for clarity
* Add alsa_set_mic_enabled_internal
- For setting the state of a microphone while considering its current state
* Use alsa_set_mic_enabled_internal
* Log a little more info
* Log when the audio driver is started/stopped
* Move base microphone driver code into a new directory
- Add microphone_driver.c to Makefile.common
- Rename functions as needed
* Initialize and deinitialize the microphone driver
* Implement sdl_microphone.c
* Un-const an argument
- In case the driver context needs to do any locking
* Revise comments for microphone_driver.h
* Remove an unimplemented function
* Remove some functions from the mic driver
* Remove mic functions from audio_thread_wrapper
* Remove mic functions from sdl_audio
* Fix microphone_null
* Split the mic code for the alsa audio drivers into microphone drivers
* Fix an extra struct member
* Add a setting for the mic driver
* Add a command to reinitialize the microphone driver
* Rename mic-related settings
* Add DRIVER_MICROPHONE_MASK to DRIVERS_CMD_ALL
* Rename audio_enable_input to microphone_enable
* Remove some labels from qt_options
* Search for microphone_driver within find_driver_nonempty
* Clean up some mic driver code
* Pending mics now return silence
* Adjust some logging and comments
* Some cleanup in the microphone driver
* Invert a flag check
- Oops
* Fix a log message
* Fix the wrong flags being checked
* Slight refactor of wasapi_init_device
- Add a data_flow parameter
- Declare it in a header
- In preparation for WASAPI mic support
* Add some WASAPI macros for _IAudioCaptureClient
* Move some common WASAPI functions to audio/common/wasapi.c
- They'll be used by the mic and the audio drivers
* Add wasapi_log_hr
* Generalize mmdevice_list_new to look for capture devices, too
* Fix a function declaration
* Move driver-specific device_list_new functions into their respective files
* Clean up some declarations
* First draft of wasapi microphone driver
* Add wasapi_microphone_device_list_free
* Change function parameter names to be consistent with microphone_driver
* Partially implement wasapi_microphone_read
- Mostly copied from the audio driver so far
- It doesn't compile yet
- But it'll be beautiful when I'm done with it
* Refactor the mic driver's functions
- Rename get_mic_active to mic_alive
- Split set_mic_active into start_mic and stop_mic
- Refactor the SDL mic driver accordingly
* Edit some WASAPI functions for logging and clarity
* Implement more of the WASAPI mic driver
* Rename write_event to read_event
* Pass the WASAPI driver context to the various read functions
* Mostly implement the read function for the WASAPI mic driver
* Fix a crash in microphone_driver
- Forgot to move the position of the name of null_driver
* Reduce some logging in wasapi common functions
- Only log the chosen audio client format, not all attempted ones
* Add some macro wrappers for IAudioClient methods
* Update mic driver configuration
- Make the mic driver configurable in the menu
- Add config items for WASAPI-related options similar to the audio driver
* Fix a menu entry scrolling through audio devices instead of mic devices
* Add some utility functions
* Expose the new utility functions in wasapi.h
* Add extra logging in the WASAPI common functions
* Add sharemode_name
* Use _IAudioClient_Initialize macro in some places
* Pass channels to wasapi_init_client
- Remember, mics are in mono
* Use _IAudioClient_Initialize macro some more
* Forgot to pass channels in some places
* Add some utility functions
* Forgot an #include
* Add wasapi_select_device_format
* Simplify the format selection logic in wasapi_init_client_sh
* Unset the microphone in wasapi_microphone_close_mic
- Ought to prevent a potential segfault
* Simplify some logging
* Fix incorrect value being passed to _IAudioCaptureClient_ReleaseBuffer
* Remove some unneeded logging
* Add some values to hresult_name
* Polish up wasapi_select_device_format
- Test for formats manually when Windows can't
- Add some debug logging
- Check for channels
* Compute the fields of WAVEFORMATEXTENSIBLE correctly
- As per the doc's stated requirements
* Simplify logic for WASAPI client creation
* Fix a potential hang in wasapi_microphone_read_shared_buffered
* Stop the microphone if the driver is stopped
* Don't name the microphone event
* Ensure that wasapi_init_client reports the correct format and rate
* Implement exclusive microphone read access for WASAPI
* Add _IAudioCaptureClient_GetNextPacketSize macro
* Organize cases in hresult_name
* Clear some extra fields if wasapi_set_format is setting a Pcm format
* Adjust some logs
* Adjust some logs
* Remove unneeded local vars
* Add a log
* Update wasapi.c
* Update wasapi.c
* Fix shared-mode mic support in WASAPI producing broken input
- Turns out it had nothing to do with shared mode
* Reuse a common function
- Remove wasapi_microphone_read_shared_buffered
- Rename wasapi_microphone_read_exclusive to wasapi_microphone_read_buffered
* Remove some code I was using for test purposes
* Clarify some language
* Double the default shared-mode mic buffer length
* Split getting a device's name into a separate function, then use it
* Fix the ALSA mic drivers
- To comply with changes I previously made to the mic driver interface
* Remove unused synchronization primitives from the SDL microphone driver
* Add sdl_microphone_mic_use_float
* Document audio_driver_state_flags
- I needed to understand these to see if similar flags were required for the mic driver
* Remove an unused function in wasapi.c
* Add and document flags in microphone_driver.h
* Remove driver-specific mic start/stop functions
- The mic driver itself doesn't do much processing
- That honor goes to individual mics
* Remove some unused fields in microphone_driver.h
* Add CMD_EVENT_MICROPHONE_STOP/START
* Remove unused functions from microphone_null
* Change how the mic driver state is referenced in some places
* Simplify the SDL microphone driver
- The driver backend no longer keeps a reference to the mic (the frontend does that)
- Remove functions that are no longer needed
- Don't track paused state, just query the mic itself
* Simplify the WASAPI microphone driver
- Don't track the driver running state or the microphone handle, the frontend does that now
- Remove support for unbuffered input (hunterk suggested that it wasn't necessary)
* Make microphone_wasapi_sh_buffer_length a uint, not an int
- It won't be negative anymore
- 0 now represents the default value
* Make the microphone frontend more robust
- Improve documentation for how various functions should be implemented
- Closes all microphones before freeing the driver (so backends don't have to)
- Tracks the enabled state of each microphone, so backends don't have to (but they still can)
* Stop the mic driver in core_unload_game
* Ensure mic support is compatible with the revised menu code
* Move alsa.h into audio/common
* Remove RETRO_ENVIRONMENT_GET_MICROPHONE_ENABLED
- It was never really needed
* Refactor the ALSA microphone driver
- Move common ALSA functions to audio/common/alsa.c
- Replace alsa_set_mic_enabled_internal with alsa_start/stop_pcm
- Don't track the microphone handle in the ALSA driver context
- Remove unneeded fields
* Move some common alsathread code into audio/common/alsathread.c
* Change return type of mic_driver_open_mic_internal to bool
* First crack at resampling mic input
* Remove an extraneous check
- I think something distracted me when I was writing this line
* Add stereo/mono conversion functions
* Make alsa_start_pcm and alsa_stop_pcm more robust
- They now return success if the stream is already running and stopped, respectively
* Revise some mic-related comments in libretro.h
* First crack at resampling mic input
* Simplify an expression
* Simplify an expression
* Fix a log tag
* Allow mic resampler to be configured separately from audio resampler
* Add some comments
* Set the source ratio to something sensible
* Stop deadlock in `alsathread` mic driver
* Allow mics to be initialized even when core is loaded from CLI
- When loading content from CLI, the drivers are initialized a little differently
- That threw off the mic initialization code
* Rename the functions in retro_microphone_interface
* Revise some mic-related comments in libretro.h
* Update retro_microphone_interface
- Add get_mic_rate
- Add a parameter to open_mic
- The modifications don't do anything yet
* Use parameter objects in the microphone handle
* Replace get_mic_rate with get_params
* Add a microphone interface version
* Remove part of a comment
* Set the effective params in mic_driver_microphone_handle_init
* Drop a stray newline
* Change where the mic interface is zeroed
- I was accidentally throwing out the version that the core was asking for
* Reduce logspam for wasapi_set_nonblock_state
- Now it only logs when the sync mode is changed
* Change DEFAULT_WASAPI_SH_BUFFER_LENGTH to 0
- -16 is no longer a valid value
* Set the new_rate in wasapi_init
* Change description of microphone sample rate in the settings
* First attempt at resampling configured mic input
* Forgot a section
* Fix some input samples being skipped
* Rename a variable for clarity
* Add microphone.outgoing_samples
* Update the mic driver
- Processed samples are now buffered
- The resampler is skipped if the ratio is (very close to) 1
* Remove part of a comment
* Update some comments in audio_resampler.h
* Slightly refactor the SDL microphone driver
- Move SDL_AudioSpec to a field of sdl_microphone_handle_t
- Allow SDL to change the requested format and sample rate
- Request floating-point input
- Implement sdl_microphone_mic_use_float
* Fix a non-C89-compliant declaration
* Add new files to griffin.c
* Remove a C++-style comment
* Add two more files to griffin.c
* Remove some unneeded declarations in microphone_driver.h
* Remove a stray comma in configuration.c
- For C89 compliance
* Fix compilation on some platforms
* Change some function signatures
* Make the ALSA drivers always set the audio rate
* Fix the alsathread mic driver
* Make state_manager_frame_is_reversed return false if HAVE_REWIND isn't defined
* Mute the microphone if the core is running in fast-forward, slow-mo, or rewind
* Clarify a comment
* Clarify a comment
* Add a comment
* Don't allocate memory for slowmo samples in the mic driver
- We're not supporting slowmo for mics, so it's not needed
* Fix a {
* Add my name to AUTHORS.h
* Add driver_lifetime_flags
- For drivers that have special setup/teardown needs
* Ensure that resetting the mic driver maintains active mic handles
- Prevents fullscreen toggle from stopping all mic input
* Update CHANGES.md
* Move some default microphone settings to a new part of the config file
* Ensure that RetroArch can use the audio format that Windows suggests
* Remove references to mic support in the SDL audio driver
* Remove unused WASAPI functions
* Return failure if RetroArch couldn't select a WASAPI format
* Ensure that Windows uses the WASAPI mic driver by default
* Treat disabled mic support as a warning, not an error
* Clarify some WASAPI-related microphone settings
* Remove some unused variables
* Add or revise microphone-related comments
* Rearrange doc comments for microphone types in libretro.h
* Remove a space
* Remove some unused flags
* Remove ALSA error logger
- It was never used anyway
* Remove unneeded microphone-related arguments
* Document a parameter
* Remove a logging call
* Add a constant for the microphone's shared buffer length for WASAPI
* Fix stylistic inconsistencies
* Make mic_driver_get_sample_size a macro instead of a function
* Move the microphone implementation to the audio directory
* Make microphone support optional (but enabled by default)
* Fix the griffin build
2023-06-06 15:55:06 -04:00
|
|
|
AUDIO_RESAMPLER_CC = MICROPHONE_NULL + 1,
|
2017-05-08 02:25:55 +02:00
|
|
|
AUDIO_RESAMPLER_SINC,
|
|
|
|
AUDIO_RESAMPLER_NEAREST,
|
|
|
|
AUDIO_RESAMPLER_NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
enum input_driver_enum
|
|
|
|
{
|
|
|
|
INPUT_ANDROID = AUDIO_RESAMPLER_NULL + 1,
|
|
|
|
INPUT_SDL,
|
|
|
|
INPUT_SDL2,
|
2020-10-08 13:22:35 +01:00
|
|
|
INPUT_SDL_DINGUX,
|
2017-05-08 02:25:55 +02:00
|
|
|
INPUT_X,
|
|
|
|
INPUT_WAYLAND,
|
|
|
|
INPUT_DINPUT,
|
2018-12-30 01:29:34 +01:00
|
|
|
INPUT_PS4,
|
2017-05-08 02:25:55 +02:00
|
|
|
INPUT_PS3,
|
|
|
|
INPUT_PSP,
|
2018-09-18 08:08:06 +02:00
|
|
|
INPUT_PS2,
|
2017-05-08 02:25:55 +02:00
|
|
|
INPUT_CTR,
|
2017-12-23 17:26:58 -08:00
|
|
|
INPUT_SWITCH,
|
2017-05-08 02:25:55 +02:00
|
|
|
INPUT_XENON360,
|
|
|
|
INPUT_WII,
|
|
|
|
INPUT_WIIU,
|
|
|
|
INPUT_XINPUT,
|
2018-12-28 12:29:04 +01:00
|
|
|
INPUT_UWP,
|
2017-05-08 02:25:55 +02:00
|
|
|
INPUT_UDEV,
|
|
|
|
INPUT_LINUXRAW,
|
|
|
|
INPUT_COCOA,
|
|
|
|
INPUT_QNX,
|
|
|
|
INPUT_RWEBINPUT,
|
|
|
|
INPUT_DOS,
|
2019-02-26 21:20:00 +08:00
|
|
|
INPUT_WINRAW,
|
2017-05-08 02:25:55 +02:00
|
|
|
INPUT_NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
enum joypad_driver_enum
|
|
|
|
{
|
|
|
|
JOYPAD_PS3 = INPUT_NULL + 1,
|
|
|
|
JOYPAD_XINPUT,
|
|
|
|
JOYPAD_GX,
|
|
|
|
JOYPAD_WIIU,
|
|
|
|
JOYPAD_XDK,
|
2018-12-30 14:00:18 +01:00
|
|
|
JOYPAD_PS4,
|
2017-05-08 02:25:55 +02:00
|
|
|
JOYPAD_PSP,
|
2018-09-18 08:08:06 +02:00
|
|
|
JOYPAD_PS2,
|
2017-05-08 02:25:55 +02:00
|
|
|
JOYPAD_CTR,
|
2017-12-23 17:26:58 -08:00
|
|
|
JOYPAD_SWITCH,
|
2017-05-08 02:25:55 +02:00
|
|
|
JOYPAD_DINPUT,
|
|
|
|
JOYPAD_UDEV,
|
|
|
|
JOYPAD_LINUXRAW,
|
|
|
|
JOYPAD_ANDROID,
|
|
|
|
JOYPAD_SDL,
|
2020-10-08 13:22:35 +01:00
|
|
|
JOYPAD_SDL_DINGUX,
|
2017-05-08 02:25:55 +02:00
|
|
|
JOYPAD_DOS,
|
|
|
|
JOYPAD_HID,
|
|
|
|
JOYPAD_QNX,
|
2018-01-15 00:06:57 -06:00
|
|
|
JOYPAD_RWEBPAD,
|
2018-01-25 02:20:52 +01:00
|
|
|
JOYPAD_MFI,
|
2017-05-08 02:25:55 +02:00
|
|
|
JOYPAD_NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
enum camera_driver_enum
|
|
|
|
{
|
|
|
|
CAMERA_V4L2 = JOYPAD_NULL + 1,
|
|
|
|
CAMERA_RWEBCAM,
|
|
|
|
CAMERA_ANDROID,
|
|
|
|
CAMERA_AVFOUNDATION,
|
|
|
|
CAMERA_NULL
|
|
|
|
};
|
|
|
|
|
2020-06-17 14:56:44 +03:00
|
|
|
enum bluetooth_driver_enum
|
|
|
|
{
|
2023-01-24 02:42:50 +02:00
|
|
|
BLUETOOTH_BLUETOOTHCTL = CAMERA_NULL + 1,
|
2020-06-24 02:51:42 +03:00
|
|
|
BLUETOOTH_BLUEZ,
|
2020-06-17 14:56:44 +03:00
|
|
|
BLUETOOTH_NULL
|
|
|
|
};
|
|
|
|
|
2017-05-08 02:25:55 +02:00
|
|
|
enum wifi_driver_enum
|
|
|
|
{
|
2020-06-17 14:56:44 +03:00
|
|
|
WIFI_CONNMANCTL = BLUETOOTH_NULL + 1,
|
2021-05-31 02:20:34 +00:00
|
|
|
WIFI_NMCLI,
|
2017-05-08 02:25:55 +02:00
|
|
|
WIFI_NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
enum location_driver_enum
|
|
|
|
{
|
|
|
|
LOCATION_ANDROID = WIFI_NULL + 1,
|
|
|
|
LOCATION_CORELOCATION,
|
|
|
|
LOCATION_NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
enum osk_driver_enum
|
|
|
|
{
|
|
|
|
OSK_PS3 = LOCATION_NULL + 1,
|
|
|
|
OSK_NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
enum menu_driver_enum
|
|
|
|
{
|
|
|
|
MENU_RGUI = OSK_NULL + 1,
|
|
|
|
MENU_MATERIALUI,
|
|
|
|
MENU_XMB,
|
2018-04-08 09:55:16 +07:00
|
|
|
MENU_STRIPES,
|
2018-09-18 15:13:33 +02:00
|
|
|
MENU_OZONE,
|
2017-05-08 02:25:55 +02:00
|
|
|
MENU_NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
enum record_driver_enum
|
|
|
|
{
|
|
|
|
RECORD_FFMPEG = MENU_NULL + 1,
|
|
|
|
RECORD_NULL
|
|
|
|
};
|
|
|
|
|
2018-06-04 07:48:08 +02:00
|
|
|
enum midi_driver_enum
|
|
|
|
{
|
|
|
|
MIDI_WINMM = RECORD_NULL + 1,
|
2018-09-28 16:07:51 +02:00
|
|
|
MIDI_ALSA,
|
2018-06-04 07:48:08 +02:00
|
|
|
MIDI_NULL
|
|
|
|
};
|
2017-05-08 02:25:55 +02:00
|
|
|
|
2021-08-30 16:52:05 +02:00
|
|
|
#define DECLARE_BIND(base, bind, desc) { #base, desc, 0, bind, true }
|
|
|
|
#define DECLARE_META_BIND(level, base, bind, desc) { #base, desc, level, bind, true }
|
|
|
|
|
|
|
|
const struct input_bind_map input_config_bind_map[RARCH_BIND_LIST_END_NULL] = {
|
|
|
|
DECLARE_BIND(b, RETRO_DEVICE_ID_JOYPAD_B, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_B),
|
|
|
|
DECLARE_BIND(y, RETRO_DEVICE_ID_JOYPAD_Y, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_Y),
|
|
|
|
DECLARE_BIND(select, RETRO_DEVICE_ID_JOYPAD_SELECT,MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_SELECT),
|
|
|
|
DECLARE_BIND(start, RETRO_DEVICE_ID_JOYPAD_START, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_START),
|
|
|
|
DECLARE_BIND(up, RETRO_DEVICE_ID_JOYPAD_UP, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_UP),
|
|
|
|
DECLARE_BIND(down, RETRO_DEVICE_ID_JOYPAD_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_DOWN),
|
|
|
|
DECLARE_BIND(left, RETRO_DEVICE_ID_JOYPAD_LEFT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_LEFT),
|
|
|
|
DECLARE_BIND(right, RETRO_DEVICE_ID_JOYPAD_RIGHT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_RIGHT),
|
|
|
|
DECLARE_BIND(a, RETRO_DEVICE_ID_JOYPAD_A, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_A),
|
|
|
|
DECLARE_BIND(x, RETRO_DEVICE_ID_JOYPAD_X, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_X),
|
|
|
|
DECLARE_BIND(l, RETRO_DEVICE_ID_JOYPAD_L, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L),
|
|
|
|
DECLARE_BIND(r, RETRO_DEVICE_ID_JOYPAD_R, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R),
|
|
|
|
DECLARE_BIND(l2, RETRO_DEVICE_ID_JOYPAD_L2, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L2),
|
|
|
|
DECLARE_BIND(r2, RETRO_DEVICE_ID_JOYPAD_R2, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R2),
|
|
|
|
DECLARE_BIND(l3, RETRO_DEVICE_ID_JOYPAD_L3, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L3),
|
|
|
|
DECLARE_BIND(r3, RETRO_DEVICE_ID_JOYPAD_R3, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R3),
|
|
|
|
DECLARE_BIND(l_x_plus, RARCH_ANALOG_LEFT_X_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_X_PLUS),
|
|
|
|
DECLARE_BIND(l_x_minus, RARCH_ANALOG_LEFT_X_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_X_MINUS),
|
|
|
|
DECLARE_BIND(l_y_plus, RARCH_ANALOG_LEFT_Y_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_Y_PLUS),
|
|
|
|
DECLARE_BIND(l_y_minus, RARCH_ANALOG_LEFT_Y_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_Y_MINUS),
|
|
|
|
DECLARE_BIND(r_x_plus, RARCH_ANALOG_RIGHT_X_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_X_PLUS),
|
|
|
|
DECLARE_BIND(r_x_minus, RARCH_ANALOG_RIGHT_X_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_X_MINUS),
|
|
|
|
DECLARE_BIND(r_y_plus, RARCH_ANALOG_RIGHT_Y_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_Y_PLUS),
|
|
|
|
DECLARE_BIND(r_y_minus, RARCH_ANALOG_RIGHT_Y_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_Y_MINUS),
|
|
|
|
|
2022-11-20 08:26:34 +02:00
|
|
|
DECLARE_BIND(gun_trigger, RARCH_LIGHTGUN_TRIGGER, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_TRIGGER),
|
|
|
|
DECLARE_BIND(gun_offscreen_shot, RARCH_LIGHTGUN_RELOAD, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_RELOAD),
|
|
|
|
DECLARE_BIND(gun_aux_a, RARCH_LIGHTGUN_AUX_A, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_AUX_A),
|
|
|
|
DECLARE_BIND(gun_aux_b, RARCH_LIGHTGUN_AUX_B, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_AUX_B),
|
|
|
|
DECLARE_BIND(gun_aux_c, RARCH_LIGHTGUN_AUX_C, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_AUX_C),
|
|
|
|
DECLARE_BIND(gun_start, RARCH_LIGHTGUN_START, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_START),
|
|
|
|
DECLARE_BIND(gun_select, RARCH_LIGHTGUN_SELECT, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_SELECT),
|
|
|
|
DECLARE_BIND(gun_dpad_up, RARCH_LIGHTGUN_DPAD_UP, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_UP),
|
|
|
|
DECLARE_BIND(gun_dpad_down, RARCH_LIGHTGUN_DPAD_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_DOWN),
|
|
|
|
DECLARE_BIND(gun_dpad_left, RARCH_LIGHTGUN_DPAD_LEFT, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_LEFT),
|
|
|
|
DECLARE_BIND(gun_dpad_right, RARCH_LIGHTGUN_DPAD_RIGHT, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_RIGHT),
|
2021-08-30 16:52:05 +02:00
|
|
|
|
|
|
|
DECLARE_BIND(turbo, RARCH_TURBO_ENABLE, MENU_ENUM_LABEL_VALUE_INPUT_TURBO_ENABLE),
|
|
|
|
|
2022-11-20 08:26:34 +02:00
|
|
|
DECLARE_META_BIND(2, enable_hotkey, RARCH_ENABLE_HOTKEY, MENU_ENUM_LABEL_VALUE_INPUT_META_ENABLE_HOTKEY),
|
|
|
|
#ifdef HAVE_MENU
|
|
|
|
DECLARE_META_BIND(1, menu_toggle, RARCH_MENU_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_MENU_TOGGLE),
|
|
|
|
#endif
|
2021-08-30 16:52:05 +02:00
|
|
|
#ifdef HAVE_LAKKA
|
|
|
|
DECLARE_META_BIND(2, exit_emulator, RARCH_QUIT_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_RESTART_KEY),
|
|
|
|
#else
|
|
|
|
DECLARE_META_BIND(2, exit_emulator, RARCH_QUIT_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_QUIT_KEY),
|
|
|
|
#endif
|
2022-11-20 08:26:34 +02:00
|
|
|
DECLARE_META_BIND(2, close_content, RARCH_CLOSE_CONTENT_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_CLOSE_CONTENT_KEY),
|
|
|
|
DECLARE_META_BIND(2, reset, RARCH_RESET, MENU_ENUM_LABEL_VALUE_INPUT_META_RESET),
|
|
|
|
DECLARE_META_BIND(1, toggle_fast_forward, RARCH_FAST_FORWARD_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FAST_FORWARD_KEY),
|
|
|
|
DECLARE_META_BIND(2, hold_fast_forward, RARCH_FAST_FORWARD_HOLD_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FAST_FORWARD_HOLD_KEY),
|
|
|
|
DECLARE_META_BIND(1, toggle_slowmotion, RARCH_SLOWMOTION_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_SLOWMOTION_KEY),
|
|
|
|
DECLARE_META_BIND(2, hold_slowmotion, RARCH_SLOWMOTION_HOLD_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_SLOWMOTION_HOLD_KEY),
|
2021-08-30 16:52:05 +02:00
|
|
|
DECLARE_META_BIND(1, rewind, RARCH_REWIND, MENU_ENUM_LABEL_VALUE_INPUT_META_REWIND),
|
|
|
|
DECLARE_META_BIND(2, pause_toggle, RARCH_PAUSE_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_PAUSE_TOGGLE),
|
|
|
|
DECLARE_META_BIND(2, frame_advance, RARCH_FRAMEADVANCE, MENU_ENUM_LABEL_VALUE_INPUT_META_FRAMEADVANCE),
|
2022-11-20 08:26:34 +02:00
|
|
|
|
|
|
|
DECLARE_META_BIND(2, audio_mute, RARCH_MUTE, MENU_ENUM_LABEL_VALUE_INPUT_META_MUTE),
|
|
|
|
DECLARE_META_BIND(2, volume_up, RARCH_VOLUME_UP, MENU_ENUM_LABEL_VALUE_INPUT_META_VOLUME_UP),
|
|
|
|
DECLARE_META_BIND(2, volume_down, RARCH_VOLUME_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_META_VOLUME_DOWN),
|
|
|
|
|
|
|
|
DECLARE_META_BIND(1, load_state, RARCH_LOAD_STATE_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_LOAD_STATE_KEY),
|
|
|
|
DECLARE_META_BIND(1, save_state, RARCH_SAVE_STATE_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_SAVE_STATE_KEY),
|
|
|
|
DECLARE_META_BIND(2, state_slot_increase, RARCH_STATE_SLOT_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_META_STATE_SLOT_PLUS),
|
|
|
|
DECLARE_META_BIND(2, state_slot_decrease, RARCH_STATE_SLOT_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_META_STATE_SLOT_MINUS),
|
|
|
|
|
Replay UI support (#15048)
* Add bsv replay controls (not yet fully implemented), remove toggle
see notes in task_movie.c, make sure command.c calls the right
functions, check retroarch.c and other todos.
bsv files are also now stored with states, not saves.
* Compilation fixes
* Added command impls for play and record replay, and some code in load state to do the right thing there
* Guard some parts of the new code with HAVE_BSV_MOVIE
* wip, menu fixes
* more menu fixes, osd for movie errors, halt recording properly
* Menu and label fixes
* move bsvs to own file suffix series under savestates, fix recording and playback command validity checks
* Fix replay autoincrement
* fix endif placement, whoops
---------
Co-authored-by: Joseph C. Osborn <jcoa2018@pomona.edu>
2023-03-02 15:52:22 -08:00
|
|
|
DECLARE_META_BIND(1, play_replay, RARCH_PLAY_REPLAY_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_PLAY_REPLAY_KEY),
|
|
|
|
DECLARE_META_BIND(1, record_replay, RARCH_RECORD_REPLAY_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_RECORD_REPLAY_KEY),
|
|
|
|
DECLARE_META_BIND(1, halt_replay, RARCH_HALT_REPLAY_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_HALT_REPLAY_KEY),
|
|
|
|
DECLARE_META_BIND(2, replay_slot_increase, RARCH_REPLAY_SLOT_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_META_REPLAY_SLOT_PLUS),
|
|
|
|
DECLARE_META_BIND(2, replay_slot_decrease, RARCH_REPLAY_SLOT_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_META_REPLAY_SLOT_MINUS),
|
|
|
|
|
2022-11-20 08:26:34 +02:00
|
|
|
DECLARE_META_BIND(2, disk_eject_toggle, RARCH_DISK_EJECT_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_DISK_EJECT_TOGGLE),
|
|
|
|
DECLARE_META_BIND(2, disk_next, RARCH_DISK_NEXT, MENU_ENUM_LABEL_VALUE_INPUT_META_DISK_NEXT),
|
|
|
|
DECLARE_META_BIND(2, disk_prev, RARCH_DISK_PREV, MENU_ENUM_LABEL_VALUE_INPUT_META_DISK_PREV),
|
|
|
|
|
|
|
|
DECLARE_META_BIND(2, shader_toggle, RARCH_SHADER_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_SHADER_TOGGLE),
|
2021-08-30 16:52:05 +02:00
|
|
|
DECLARE_META_BIND(2, shader_next, RARCH_SHADER_NEXT, MENU_ENUM_LABEL_VALUE_INPUT_META_SHADER_NEXT),
|
|
|
|
DECLARE_META_BIND(2, shader_prev, RARCH_SHADER_PREV, MENU_ENUM_LABEL_VALUE_INPUT_META_SHADER_PREV),
|
2022-11-20 08:26:34 +02:00
|
|
|
|
|
|
|
DECLARE_META_BIND(2, cheat_toggle, RARCH_CHEAT_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_CHEAT_TOGGLE),
|
2021-08-30 16:52:05 +02:00
|
|
|
DECLARE_META_BIND(2, cheat_index_plus, RARCH_CHEAT_INDEX_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_META_CHEAT_INDEX_PLUS),
|
|
|
|
DECLARE_META_BIND(2, cheat_index_minus, RARCH_CHEAT_INDEX_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_META_CHEAT_INDEX_MINUS),
|
2022-11-20 08:26:34 +02:00
|
|
|
|
2021-08-30 16:52:05 +02:00
|
|
|
DECLARE_META_BIND(2, screenshot, RARCH_SCREENSHOT, MENU_ENUM_LABEL_VALUE_INPUT_META_SCREENSHOT),
|
2022-11-20 08:26:34 +02:00
|
|
|
DECLARE_META_BIND(2, recording_toggle, RARCH_RECORDING_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_RECORDING_TOGGLE),
|
|
|
|
DECLARE_META_BIND(2, streaming_toggle, RARCH_STREAMING_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_STREAMING_TOGGLE),
|
|
|
|
|
|
|
|
DECLARE_META_BIND(2, grab_mouse_toggle, RARCH_GRAB_MOUSE_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_GRAB_MOUSE_TOGGLE),
|
|
|
|
DECLARE_META_BIND(2, game_focus_toggle, RARCH_GAME_FOCUS_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_GAME_FOCUS_TOGGLE),
|
|
|
|
DECLARE_META_BIND(2, toggle_fullscreen, RARCH_FULLSCREEN_TOGGLE_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FULLSCREEN_TOGGLE_KEY),
|
|
|
|
DECLARE_META_BIND(2, desktop_menu_toggle, RARCH_UI_COMPANION_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_UI_COMPANION_TOGGLE),
|
|
|
|
|
|
|
|
DECLARE_META_BIND(2, toggle_vrr_runloop, RARCH_VRR_RUNLOOP_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_VRR_RUNLOOP_TOGGLE),
|
|
|
|
DECLARE_META_BIND(2, runahead_toggle, RARCH_RUNAHEAD_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_RUNAHEAD_TOGGLE),
|
2023-01-10 00:22:14 -06:00
|
|
|
DECLARE_META_BIND(2, preempt_toggle, RARCH_PREEMPT_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_PREEMPT_TOGGLE),
|
2021-08-30 16:52:05 +02:00
|
|
|
DECLARE_META_BIND(2, fps_toggle, RARCH_FPS_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_FPS_TOGGLE),
|
2021-12-21 01:03:35 +02:00
|
|
|
DECLARE_META_BIND(2, toggle_statistics, RARCH_STATISTICS_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_STATISTICS_TOGGLE),
|
2022-11-20 08:26:34 +02:00
|
|
|
DECLARE_META_BIND(2, ai_service, RARCH_AI_SERVICE, MENU_ENUM_LABEL_VALUE_INPUT_META_AI_SERVICE),
|
|
|
|
|
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 12:58:01 -03:00
|
|
|
DECLARE_META_BIND(2, netplay_ping_toggle, RARCH_NETPLAY_PING_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_PING_TOGGLE),
|
2021-08-30 16:52:05 +02:00
|
|
|
DECLARE_META_BIND(2, netplay_host_toggle, RARCH_NETPLAY_HOST_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_HOST_TOGGLE),
|
|
|
|
DECLARE_META_BIND(2, netplay_game_watch, RARCH_NETPLAY_GAME_WATCH, MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_GAME_WATCH),
|
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 12:58:01 -03:00
|
|
|
DECLARE_META_BIND(2, netplay_player_chat, RARCH_NETPLAY_PLAYER_CHAT, MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_PLAYER_CHAT),
|
|
|
|
DECLARE_META_BIND(2, netplay_fade_chat_toggle, RARCH_NETPLAY_FADE_CHAT_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_FADE_CHAT_TOGGLE),
|
2022-11-20 08:26:34 +02:00
|
|
|
|
2022-11-22 15:45:30 +02:00
|
|
|
/* Hidden in displaylist */
|
|
|
|
DECLARE_META_BIND(2, overlay_next, RARCH_OVERLAY_NEXT, MENU_ENUM_LABEL_VALUE_INPUT_META_OVERLAY_NEXT),
|
2023-07-08 12:45:13 -05:00
|
|
|
|
2022-11-22 15:45:30 +02:00
|
|
|
DECLARE_META_BIND(2, osk_toggle, RARCH_OSK, MENU_ENUM_LABEL_VALUE_INPUT_META_OSK),
|
|
|
|
#if 0
|
|
|
|
/* Deprecated */
|
2022-11-20 08:26:34 +02:00
|
|
|
DECLARE_META_BIND(2, send_debug_info, RARCH_SEND_DEBUG_INFO, MENU_ENUM_LABEL_VALUE_INPUT_META_SEND_DEBUG_INFO),
|
2022-11-22 15:45:30 +02:00
|
|
|
#endif
|
2021-08-30 16:52:05 +02:00
|
|
|
};
|
|
|
|
|
2019-02-28 21:38:36 +01:00
|
|
|
#if defined(HAVE_METAL)
|
2023-01-31 18:20:59 +01:00
|
|
|
#if defined(HAVE_VULKAN)
|
|
|
|
/* Default to Vulkan/MoltenVK when available */
|
|
|
|
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_VULKAN;
|
|
|
|
#else
|
2020-08-09 19:24:13 +02:00
|
|
|
/* iOS supports both the OpenGL and Metal video drivers; default to OpenGL since Metal support is preliminary */
|
2020-08-09 06:08:16 -10:00
|
|
|
#if defined(HAVE_COCOATOUCH) && defined(HAVE_OPENGL)
|
|
|
|
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_GL;
|
|
|
|
#else
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_METAL;
|
2020-08-09 06:08:16 -10:00
|
|
|
#endif
|
2023-01-31 18:20:59 +01:00
|
|
|
#endif
|
2023-11-16 19:40:45 +02:00
|
|
|
#elif defined(HAVE_D3D11) || defined(__WINRT__) || (defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
|
|
|
|
/* Default to D3D11 in UWP, even when its compiled with ANGLE, since ANGLE is just calling D3D anyway.*/
|
2023-11-16 16:04:48 +02:00
|
|
|
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_D3D11;
|
2021-02-10 12:08:21 +00:00
|
|
|
#elif defined(HAVE_OPENGL1) && defined(_MSC_VER) && (_MSC_VER <= 1600)
|
|
|
|
/* On Windows XP and earlier, use gl1 by default
|
|
|
|
* (regular opengl has compatibility issues with
|
|
|
|
* obsolete hardware drivers...) */
|
|
|
|
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_GL1;
|
2019-12-12 19:16:28 +01:00
|
|
|
#elif defined(HAVE_VITA2D)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_VITA2D;
|
2021-05-19 22:50:34 +02:00
|
|
|
#elif defined(HAVE_OPENGL) || defined(HAVE_OPENGLES) || defined(HAVE_PSGL)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_GL;
|
2020-03-15 20:36:38 +08:00
|
|
|
#elif defined(HAVE_OPENGL_CORE) && !defined(__HAIKU__)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_GL_CORE;
|
2019-04-24 03:23:57 +02:00
|
|
|
#elif defined(HAVE_OPENGL1)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_GL1;
|
2023-01-31 18:20:59 +01:00
|
|
|
#elif defined(HAVE_VULKAN)
|
|
|
|
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_VULKAN;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(GEKKO)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_WII;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(WIIU)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_WIIU;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(XENON)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_XENON360;
|
2019-02-28 21:38:36 +01:00
|
|
|
#elif defined(HAVE_D3D12)
|
2023-03-15 17:06:18 +01:00
|
|
|
/* FIXME/WARNING: DX12 performance on Xbox is horrible for
|
2019-02-28 21:38:36 +01:00
|
|
|
* some reason. For now, we will default to D3D11 when possible. */
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_D3D12;
|
2018-12-28 12:41:38 +01:00
|
|
|
#elif defined(HAVE_D3D10)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_D3D10;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(HAVE_D3D9)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_D3D9;
|
2018-01-23 02:55:33 +01:00
|
|
|
#elif defined(HAVE_D3D8)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_D3D8;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(HAVE_VG)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_VG;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(PSP)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_PSP1;
|
2018-09-18 08:08:06 +02:00
|
|
|
#elif defined(PS2)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_PS2;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(_3DS)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_CTR;
|
2017-12-23 17:26:58 -08:00
|
|
|
#elif defined(SWITCH)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_SWITCH;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(HAVE_XVIDEO)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_XVIDEO;
|
2019-12-28 21:21:57 -05:00
|
|
|
#elif defined(HAVE_SDL) && !defined(HAVE_SDL_DINGUX)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_SDL;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(HAVE_SDL2)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_SDL2;
|
2019-12-28 21:21:57 -05:00
|
|
|
#elif defined(HAVE_SDL_DINGUX)
|
2021-10-08 13:53:49 +02:00
|
|
|
#if defined(RS90) || defined(MIYOO)
|
2021-07-13 11:36:48 -05:00
|
|
|
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_SDL_RS90;
|
|
|
|
#else
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_SDL_DINGUX;
|
2021-07-13 11:36:48 -05:00
|
|
|
#endif
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(_WIN32) && !defined(_XBOX)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_GDI;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(DJGPP)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_VGA;
|
2019-09-17 08:16:50 +02:00
|
|
|
#elif defined(HAVE_FPGA)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_FPGA;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(HAVE_DYLIB) && !defined(ANDROID)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_EXT;
|
2021-05-19 22:50:34 +02:00
|
|
|
#elif defined(__PSL1GHT__)
|
|
|
|
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_RSX;
|
2017-05-08 02:25:55 +02:00
|
|
|
#else
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_NULL;
|
2017-05-08 02:25:55 +02:00
|
|
|
#endif
|
|
|
|
|
2020-12-19 15:32:26 +01:00
|
|
|
#if defined(XENON)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_XENON360;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(GEKKO)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_WII;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(WIIU)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_WIIU;
|
2018-12-31 00:37:08 +01:00
|
|
|
#elif defined(PSP) || defined(VITA) || defined(ORBIS)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_PSP;
|
2018-09-18 08:08:06 +02:00
|
|
|
#elif defined(PS2)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_PS2;
|
2020-12-27 18:56:00 +01:00
|
|
|
#elif defined(__PS3__)
|
|
|
|
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_PS3;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(_3DS)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_CTR;
|
2017-12-24 14:33:48 -08:00
|
|
|
#elif defined(SWITCH)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_SWITCH;
|
2022-04-02 08:07:25 +01:00
|
|
|
#elif (defined(DINGUX_BETA) || defined(MIYOO)) && defined(HAVE_ALSA)
|
2021-07-13 14:18:11 +01:00
|
|
|
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_ALSA;
|
2021-06-26 14:54:42 -05:00
|
|
|
#elif defined(DINGUX) && defined(HAVE_AL)
|
|
|
|
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_AL;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(HAVE_PULSE)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_PULSE;
|
2021-06-10 16:19:52 +01:00
|
|
|
#elif defined(HAVE_ALSA) && defined(HAVE_THREADS)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_ALSATHREAD;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(HAVE_ALSA)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_ALSA;
|
2017-06-23 20:44:00 -05:00
|
|
|
#elif defined(HAVE_TINYALSA)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_TINYALSA;
|
2019-05-09 17:30:44 +00:00
|
|
|
#elif defined(HAVE_AUDIOIO)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_AUDIOIO;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(HAVE_OSS)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_OSS;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(HAVE_JACK)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_JACK;
|
2019-10-04 18:13:58 +02:00
|
|
|
#elif defined(HAVE_COREAUDIO3)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_COREAUDIO3;
|
2020-07-19 15:19:15 -10:00
|
|
|
#elif defined(HAVE_COREAUDIO)
|
|
|
|
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_COREAUDIO;
|
2023-11-16 16:04:48 +02:00
|
|
|
#elif defined(HAVE_WASAPI)
|
|
|
|
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_WASAPI;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(HAVE_XAUDIO)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_XAUDIO;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(HAVE_DSOUND)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_DSOUND;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(HAVE_AL)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_AL;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(HAVE_SL)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_SL;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(EMSCRIPTEN)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_RWEBAUDIO;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(HAVE_SDL)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_SDL;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(HAVE_SDL2)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_SDL2;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(HAVE_RSOUND)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_RSOUND;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(HAVE_ROAR)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_ROAR;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(HAVE_DYLIB) && !defined(ANDROID)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_EXT;
|
2017-05-08 02:25:55 +02:00
|
|
|
#else
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_NULL;
|
2017-05-08 02:25:55 +02:00
|
|
|
#endif
|
|
|
|
|
Add microphone support via a new driver (#14731)
* Some slight fixes
* Update libretro.h
* Log calls to RETRO_ENVIRONMENT_GET_MICROPHONE_INTERFACE
* Finish proof-of-concept for mic support
- It works, but doesn't support floating-point audio yet
- It may need to be resampled, too
* Add macros that aren't available in SDL 2
* Comment out a variable definition for now
- For C89 compliance
* Add some comments for clarity
* Let ALSA tolerate a null new_rate
* Partial ALSA microphone support
- Not yet tested
- Mic is created and destroyed
- Mic can also be paused or unpaused
- Mic is paused or unpaused with the rest of the driver
- Microphone is not yet read
* Install error logging in the ALSA driver
- It defers to RARCH_ERR
* Free the ALSA microphone in alsa_free
* Fix an indent
* First draft of alsa_read_microphone
* Deinitialize SDL Audio in sdl_audio_free
* Save and restore the ALSA error logger
- You should always practice safe global state
* Add newlines to some RARCH_ERRs
* Add some logging
* Check for the mic being active via settings instead of via flags
* Adjusted a log entry to be less misleading
- A frequency of 0Hz looks weird to the uninformed
- In reality, it means the driver used the requested frequency
* Fix an incorrect format string
* Tidy up logging in alsa.c
* Rename audio_enable_microphone to audio_enable_input
* Rename microphone_device to audio_input_device
* Add audio_input_latency and audio_input_block_frames settings
* Add all mic-related settings to the options menu
* Adjust logging for alsa.c
- Log the ALSA library version
- Add errno details
* Refer to the microphone in logs by name
* Use %u instead of %d for some log items
* Add input_samples_buf
* Remove an inaccurate comment
* Change type of input_samples_buf
* Clean up audio_driver_flush_microphone_input
* Comment convert_float_to_s16
- It helped me understand what it's doing
- Turns out it'll work just fine on mono audio
* Don't use the resampler for mic input
* Fix crash in the ALSA driver when reading from a mic
* Update some logging messages
* ALSA support now works for mics
* Reuse some common functions in alsa.c
* Add alsa_thread_microphone_t
* Refactor alsa.c
- Introduce alsa_init_pcm to init any PCM that we're using
- Vastly simplifies the implementation of alsa_init and alsa_init_microphone
- Will be used for the read-based versions next
* Make ALSA logging a little more consistent
* Clean up the mic with alsa_free_microphone if alsa_init_microphone fails
* Remove an unused function
* Move some cleanup in alsa.c to a common function
* First crack at mic support for alsathread
- Refactor some duplicate code into functions
- Use functions introduced in alsa.c
- Create and destroy the mic
* Slight cleanups for clarity
* Implement alsa_thread_set/get_microphone_state
* More work on alsathread
- No more crashing, but the mic just returns silence
* Slight cleanups for clarity
* Add alsa_set_mic_enabled_internal
- For setting the state of a microphone while considering its current state
* Use alsa_set_mic_enabled_internal
* Log a little more info
* Log when the audio driver is started/stopped
* Move base microphone driver code into a new directory
- Add microphone_driver.c to Makefile.common
- Rename functions as needed
* Initialize and deinitialize the microphone driver
* Implement sdl_microphone.c
* Un-const an argument
- In case the driver context needs to do any locking
* Revise comments for microphone_driver.h
* Remove an unimplemented function
* Remove some functions from the mic driver
* Remove mic functions from audio_thread_wrapper
* Remove mic functions from sdl_audio
* Fix microphone_null
* Split the mic code for the alsa audio drivers into microphone drivers
* Fix an extra struct member
* Add a setting for the mic driver
* Add a command to reinitialize the microphone driver
* Rename mic-related settings
* Add DRIVER_MICROPHONE_MASK to DRIVERS_CMD_ALL
* Rename audio_enable_input to microphone_enable
* Remove some labels from qt_options
* Search for microphone_driver within find_driver_nonempty
* Clean up some mic driver code
* Pending mics now return silence
* Adjust some logging and comments
* Some cleanup in the microphone driver
* Invert a flag check
- Oops
* Fix a log message
* Fix the wrong flags being checked
* Slight refactor of wasapi_init_device
- Add a data_flow parameter
- Declare it in a header
- In preparation for WASAPI mic support
* Add some WASAPI macros for _IAudioCaptureClient
* Move some common WASAPI functions to audio/common/wasapi.c
- They'll be used by the mic and the audio drivers
* Add wasapi_log_hr
* Generalize mmdevice_list_new to look for capture devices, too
* Fix a function declaration
* Move driver-specific device_list_new functions into their respective files
* Clean up some declarations
* First draft of wasapi microphone driver
* Add wasapi_microphone_device_list_free
* Change function parameter names to be consistent with microphone_driver
* Partially implement wasapi_microphone_read
- Mostly copied from the audio driver so far
- It doesn't compile yet
- But it'll be beautiful when I'm done with it
* Refactor the mic driver's functions
- Rename get_mic_active to mic_alive
- Split set_mic_active into start_mic and stop_mic
- Refactor the SDL mic driver accordingly
* Edit some WASAPI functions for logging and clarity
* Implement more of the WASAPI mic driver
* Rename write_event to read_event
* Pass the WASAPI driver context to the various read functions
* Mostly implement the read function for the WASAPI mic driver
* Fix a crash in microphone_driver
- Forgot to move the position of the name of null_driver
* Reduce some logging in wasapi common functions
- Only log the chosen audio client format, not all attempted ones
* Add some macro wrappers for IAudioClient methods
* Update mic driver configuration
- Make the mic driver configurable in the menu
- Add config items for WASAPI-related options similar to the audio driver
* Fix a menu entry scrolling through audio devices instead of mic devices
* Add some utility functions
* Expose the new utility functions in wasapi.h
* Add extra logging in the WASAPI common functions
* Add sharemode_name
* Use _IAudioClient_Initialize macro in some places
* Pass channels to wasapi_init_client
- Remember, mics are in mono
* Use _IAudioClient_Initialize macro some more
* Forgot to pass channels in some places
* Add some utility functions
* Forgot an #include
* Add wasapi_select_device_format
* Simplify the format selection logic in wasapi_init_client_sh
* Unset the microphone in wasapi_microphone_close_mic
- Ought to prevent a potential segfault
* Simplify some logging
* Fix incorrect value being passed to _IAudioCaptureClient_ReleaseBuffer
* Remove some unneeded logging
* Add some values to hresult_name
* Polish up wasapi_select_device_format
- Test for formats manually when Windows can't
- Add some debug logging
- Check for channels
* Compute the fields of WAVEFORMATEXTENSIBLE correctly
- As per the doc's stated requirements
* Simplify logic for WASAPI client creation
* Fix a potential hang in wasapi_microphone_read_shared_buffered
* Stop the microphone if the driver is stopped
* Don't name the microphone event
* Ensure that wasapi_init_client reports the correct format and rate
* Implement exclusive microphone read access for WASAPI
* Add _IAudioCaptureClient_GetNextPacketSize macro
* Organize cases in hresult_name
* Clear some extra fields if wasapi_set_format is setting a Pcm format
* Adjust some logs
* Adjust some logs
* Remove unneeded local vars
* Add a log
* Update wasapi.c
* Update wasapi.c
* Fix shared-mode mic support in WASAPI producing broken input
- Turns out it had nothing to do with shared mode
* Reuse a common function
- Remove wasapi_microphone_read_shared_buffered
- Rename wasapi_microphone_read_exclusive to wasapi_microphone_read_buffered
* Remove some code I was using for test purposes
* Clarify some language
* Double the default shared-mode mic buffer length
* Split getting a device's name into a separate function, then use it
* Fix the ALSA mic drivers
- To comply with changes I previously made to the mic driver interface
* Remove unused synchronization primitives from the SDL microphone driver
* Add sdl_microphone_mic_use_float
* Document audio_driver_state_flags
- I needed to understand these to see if similar flags were required for the mic driver
* Remove an unused function in wasapi.c
* Add and document flags in microphone_driver.h
* Remove driver-specific mic start/stop functions
- The mic driver itself doesn't do much processing
- That honor goes to individual mics
* Remove some unused fields in microphone_driver.h
* Add CMD_EVENT_MICROPHONE_STOP/START
* Remove unused functions from microphone_null
* Change how the mic driver state is referenced in some places
* Simplify the SDL microphone driver
- The driver backend no longer keeps a reference to the mic (the frontend does that)
- Remove functions that are no longer needed
- Don't track paused state, just query the mic itself
* Simplify the WASAPI microphone driver
- Don't track the driver running state or the microphone handle, the frontend does that now
- Remove support for unbuffered input (hunterk suggested that it wasn't necessary)
* Make microphone_wasapi_sh_buffer_length a uint, not an int
- It won't be negative anymore
- 0 now represents the default value
* Make the microphone frontend more robust
- Improve documentation for how various functions should be implemented
- Closes all microphones before freeing the driver (so backends don't have to)
- Tracks the enabled state of each microphone, so backends don't have to (but they still can)
* Stop the mic driver in core_unload_game
* Ensure mic support is compatible with the revised menu code
* Move alsa.h into audio/common
* Remove RETRO_ENVIRONMENT_GET_MICROPHONE_ENABLED
- It was never really needed
* Refactor the ALSA microphone driver
- Move common ALSA functions to audio/common/alsa.c
- Replace alsa_set_mic_enabled_internal with alsa_start/stop_pcm
- Don't track the microphone handle in the ALSA driver context
- Remove unneeded fields
* Move some common alsathread code into audio/common/alsathread.c
* Change return type of mic_driver_open_mic_internal to bool
* First crack at resampling mic input
* Remove an extraneous check
- I think something distracted me when I was writing this line
* Add stereo/mono conversion functions
* Make alsa_start_pcm and alsa_stop_pcm more robust
- They now return success if the stream is already running and stopped, respectively
* Revise some mic-related comments in libretro.h
* First crack at resampling mic input
* Simplify an expression
* Simplify an expression
* Fix a log tag
* Allow mic resampler to be configured separately from audio resampler
* Add some comments
* Set the source ratio to something sensible
* Stop deadlock in `alsathread` mic driver
* Allow mics to be initialized even when core is loaded from CLI
- When loading content from CLI, the drivers are initialized a little differently
- That threw off the mic initialization code
* Rename the functions in retro_microphone_interface
* Revise some mic-related comments in libretro.h
* Update retro_microphone_interface
- Add get_mic_rate
- Add a parameter to open_mic
- The modifications don't do anything yet
* Use parameter objects in the microphone handle
* Replace get_mic_rate with get_params
* Add a microphone interface version
* Remove part of a comment
* Set the effective params in mic_driver_microphone_handle_init
* Drop a stray newline
* Change where the mic interface is zeroed
- I was accidentally throwing out the version that the core was asking for
* Reduce logspam for wasapi_set_nonblock_state
- Now it only logs when the sync mode is changed
* Change DEFAULT_WASAPI_SH_BUFFER_LENGTH to 0
- -16 is no longer a valid value
* Set the new_rate in wasapi_init
* Change description of microphone sample rate in the settings
* First attempt at resampling configured mic input
* Forgot a section
* Fix some input samples being skipped
* Rename a variable for clarity
* Add microphone.outgoing_samples
* Update the mic driver
- Processed samples are now buffered
- The resampler is skipped if the ratio is (very close to) 1
* Remove part of a comment
* Update some comments in audio_resampler.h
* Slightly refactor the SDL microphone driver
- Move SDL_AudioSpec to a field of sdl_microphone_handle_t
- Allow SDL to change the requested format and sample rate
- Request floating-point input
- Implement sdl_microphone_mic_use_float
* Fix a non-C89-compliant declaration
* Add new files to griffin.c
* Remove a C++-style comment
* Add two more files to griffin.c
* Remove some unneeded declarations in microphone_driver.h
* Remove a stray comma in configuration.c
- For C89 compliance
* Fix compilation on some platforms
* Change some function signatures
* Make the ALSA drivers always set the audio rate
* Fix the alsathread mic driver
* Make state_manager_frame_is_reversed return false if HAVE_REWIND isn't defined
* Mute the microphone if the core is running in fast-forward, slow-mo, or rewind
* Clarify a comment
* Clarify a comment
* Add a comment
* Don't allocate memory for slowmo samples in the mic driver
- We're not supporting slowmo for mics, so it's not needed
* Fix a {
* Add my name to AUTHORS.h
* Add driver_lifetime_flags
- For drivers that have special setup/teardown needs
* Ensure that resetting the mic driver maintains active mic handles
- Prevents fullscreen toggle from stopping all mic input
* Update CHANGES.md
* Move some default microphone settings to a new part of the config file
* Ensure that RetroArch can use the audio format that Windows suggests
* Remove references to mic support in the SDL audio driver
* Remove unused WASAPI functions
* Return failure if RetroArch couldn't select a WASAPI format
* Ensure that Windows uses the WASAPI mic driver by default
* Treat disabled mic support as a warning, not an error
* Clarify some WASAPI-related microphone settings
* Remove some unused variables
* Add or revise microphone-related comments
* Rearrange doc comments for microphone types in libretro.h
* Remove a space
* Remove some unused flags
* Remove ALSA error logger
- It was never used anyway
* Remove unneeded microphone-related arguments
* Document a parameter
* Remove a logging call
* Add a constant for the microphone's shared buffer length for WASAPI
* Fix stylistic inconsistencies
* Make mic_driver_get_sample_size a macro instead of a function
* Move the microphone implementation to the audio directory
* Make microphone support optional (but enabled by default)
* Fix the griffin build
2023-06-06 15:55:06 -04:00
|
|
|
#if defined(HAVE_MICROPHONE)
|
|
|
|
#if defined(HAVE_WASAPI)
|
|
|
|
/* The default mic driver on Windows is WASAPI if it's available. */
|
|
|
|
static const enum microphone_driver_enum MICROPHONE_DEFAULT_DRIVER = MICROPHONE_WASAPI;
|
|
|
|
#elif defined(HAVE_ALSA) && defined(HAVE_THREADS)
|
|
|
|
/* The default mic driver on Linux is the threaded ALSA driver, if available. */
|
|
|
|
static const enum microphone_driver_enum MICROPHONE_DEFAULT_DRIVER = MICROPHONE_ALSATHREAD;
|
|
|
|
#elif defined(HAVE_ALSA)
|
|
|
|
static const enum microphone_driver_enum MICROPHONE_DEFAULT_DRIVER = MICROPHONE_ALSA;
|
|
|
|
#elif defined(HAVE_SDL2)
|
|
|
|
/* The default fallback driver is SDL2, if available. */
|
|
|
|
static const enum microphone_driver_enum MICROPHONE_DEFAULT_DRIVER = MICROPHONE_SDL2;
|
|
|
|
#else
|
|
|
|
static const enum microphone_driver_enum MICROPHONE_DEFAULT_DRIVER = MICROPHONE_NULL;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2021-10-08 13:53:49 +02:00
|
|
|
#if defined(RS90) || defined(MIYOO)
|
2021-07-13 11:36:48 -05:00
|
|
|
static const enum audio_resampler_driver_enum AUDIO_DEFAULT_RESAMPLER_DRIVER = AUDIO_RESAMPLER_NEAREST;
|
|
|
|
#elif defined(PSP) || defined(EMSCRIPTEN)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum audio_resampler_driver_enum AUDIO_DEFAULT_RESAMPLER_DRIVER = AUDIO_RESAMPLER_CC;
|
2017-05-08 02:25:55 +02:00
|
|
|
#else
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum audio_resampler_driver_enum AUDIO_DEFAULT_RESAMPLER_DRIVER = AUDIO_RESAMPLER_SINC;
|
2017-05-08 02:25:55 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(HAVE_FFMPEG)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum record_driver_enum RECORD_DEFAULT_DRIVER = RECORD_FFMPEG;
|
2017-05-08 02:25:55 +02:00
|
|
|
#else
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum record_driver_enum RECORD_DEFAULT_DRIVER = RECORD_NULL;
|
2017-05-08 02:25:55 +02:00
|
|
|
#endif
|
|
|
|
|
2018-06-04 07:48:08 +02:00
|
|
|
#ifdef HAVE_WINMM
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum midi_driver_enum MIDI_DEFAULT_DRIVER = MIDI_WINMM;
|
2021-06-26 14:54:42 -05:00
|
|
|
#elif defined(HAVE_ALSA) && !defined(HAVE_HAKCHI) && !defined(HAVE_SEGAM) && !defined(DINGUX)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum midi_driver_enum MIDI_DEFAULT_DRIVER = MIDI_ALSA;
|
2018-06-04 07:48:08 +02:00
|
|
|
#else
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum midi_driver_enum MIDI_DEFAULT_DRIVER = MIDI_NULL;
|
2018-06-04 07:48:08 +02:00
|
|
|
#endif
|
|
|
|
|
2021-11-20 21:04:30 +01:00
|
|
|
#if defined(HAVE_STEAM) && defined(__linux__) && defined(HAVE_SDL2)
|
|
|
|
static const enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_SDL2;
|
|
|
|
#elif defined(__WINRT__) || defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_UWP;
|
2018-12-28 12:29:04 +01:00
|
|
|
#elif defined(XENON)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_XENON360;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(_XBOX360) || defined(_XBOX) || defined(HAVE_XINPUT2) || defined(HAVE_XINPUT_XBOX1)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_XINPUT;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(ANDROID)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_ANDROID;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(EMSCRIPTEN) && defined(HAVE_SDL2)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_SDL2;
|
2021-08-11 20:04:11 +02:00
|
|
|
#elif defined(WEBOS) && defined(HAVE_SDL2)
|
|
|
|
static const enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_SDL2;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(EMSCRIPTEN)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_RWEBINPUT;
|
2019-02-26 21:20:00 +08:00
|
|
|
#elif defined(_WIN32) && defined(HAVE_DINPUT)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_DINPUT;
|
2019-02-26 21:20:00 +08:00
|
|
|
#elif defined(_WIN32) && !defined(HAVE_DINPUT) && _WIN32_WINNT >= 0x0501
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_WINRAW;
|
2020-12-27 18:56:00 +01:00
|
|
|
#elif defined(PS2)
|
|
|
|
static const enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_PS2;
|
|
|
|
#elif defined(__PS3__)
|
|
|
|
static const enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_PS3;
|
2018-12-30 01:29:34 +01:00
|
|
|
#elif defined(ORBIS)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_PS4;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(PSP) || defined(VITA)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_PSP;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(_3DS)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_CTR;
|
2017-12-23 17:26:58 -08:00
|
|
|
#elif defined(SWITCH)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_SWITCH;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(GEKKO)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_WII;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(WIIU)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_WIIU;
|
2020-10-08 13:22:35 +01:00
|
|
|
#elif defined(DINGUX) && defined(HAVE_SDL_DINGUX)
|
|
|
|
static const enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_SDL_DINGUX;
|
2017-06-06 21:03:37 +02:00
|
|
|
#elif defined(HAVE_X11)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_X;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(HAVE_UDEV)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_UDEV;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(__linux__) && !defined(ANDROID)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_LINUXRAW;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(HAVE_WAYLAND)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_WAYLAND;
|
2018-11-04 09:29:40 -07:00
|
|
|
#elif defined(HAVE_COCOA) || defined(HAVE_COCOATOUCH) || defined(HAVE_COCOA_METAL)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_COCOA;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(__QNX__)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_QNX;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(HAVE_SDL)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_SDL;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(HAVE_SDL2)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_SDL2;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(DJGPP)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_DOS;
|
2017-05-08 02:25:55 +02:00
|
|
|
#else
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_NULL;
|
2017-05-08 02:25:55 +02:00
|
|
|
#endif
|
|
|
|
|
2021-11-20 21:04:30 +01:00
|
|
|
#if defined(HAVE_STEAM) && defined(__linux__) && defined(HAVE_SDL2)
|
|
|
|
static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_SDL;
|
|
|
|
#elif defined(HAVE_XINPUT)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_XINPUT;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(GEKKO)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_GX;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(WIIU)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_WIIU;
|
2021-08-11 20:04:11 +02:00
|
|
|
#elif defined(WEBOS)
|
|
|
|
static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_SDL;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(_XBOX)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_XDK;
|
2020-12-27 18:56:00 +01:00
|
|
|
#elif defined(PS2)
|
|
|
|
static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_PS2;
|
2021-05-19 00:31:09 +02:00
|
|
|
#elif defined(__PS3__) || defined(__PSL1GHT__)
|
2020-12-27 18:56:00 +01:00
|
|
|
static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_PS3;
|
2018-12-30 14:00:18 +01:00
|
|
|
#elif defined(ORBIS)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_PS4;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(PSP) || defined(VITA)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_PSP;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(_3DS)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_CTR;
|
2017-12-23 17:26:58 -08:00
|
|
|
#elif defined(SWITCH)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_SWITCH;
|
2020-10-08 13:22:35 +01:00
|
|
|
#elif defined(DINGUX) && defined(HAVE_SDL_DINGUX)
|
|
|
|
static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_SDL_DINGUX;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(HAVE_DINPUT)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_DINPUT;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(HAVE_UDEV)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_UDEV;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(__linux) && !defined(ANDROID)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_LINUXRAW;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(ANDROID)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_ANDROID;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(HAVE_SDL) || defined(HAVE_SDL2)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_SDL;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(DJGPP)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_DOS;
|
2023-02-13 15:49:35 -05:00
|
|
|
#elif defined(HAVE_MFI)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_MFI;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(HAVE_HID)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_HID;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(__QNX__)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_QNX;
|
2018-01-15 00:06:57 -06:00
|
|
|
#elif defined(EMSCRIPTEN)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_RWEBPAD;
|
2017-05-08 02:25:55 +02:00
|
|
|
#else
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_NULL;
|
2017-05-08 02:25:55 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(HAVE_V4L2)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum camera_driver_enum CAMERA_DEFAULT_DRIVER = CAMERA_V4L2;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(EMSCRIPTEN)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum camera_driver_enum CAMERA_DEFAULT_DRIVER = CAMERA_RWEBCAM;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(ANDROID)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum camera_driver_enum CAMERA_DEFAULT_DRIVER = CAMERA_ANDROID;
|
2017-05-08 02:25:55 +02:00
|
|
|
#else
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum camera_driver_enum CAMERA_DEFAULT_DRIVER = CAMERA_NULL;
|
2017-05-08 02:25:55 +02:00
|
|
|
#endif
|
|
|
|
|
2020-06-17 14:56:44 +03:00
|
|
|
#if defined(HAVE_BLUETOOTH)
|
2020-06-24 02:51:42 +03:00
|
|
|
# if defined(HAVE_DBUS)
|
|
|
|
static const enum bluetooth_driver_enum BLUETOOTH_DEFAULT_DRIVER = BLUETOOTH_BLUEZ;
|
|
|
|
# else
|
2020-06-17 14:56:44 +03:00
|
|
|
static const enum bluetooth_driver_enum BLUETOOTH_DEFAULT_DRIVER = BLUETOOTH_BLUETOOTHCTL;
|
2020-06-24 02:51:42 +03:00
|
|
|
# endif
|
2020-06-17 14:56:44 +03:00
|
|
|
#else
|
|
|
|
static const enum bluetooth_driver_enum BLUETOOTH_DEFAULT_DRIVER = BLUETOOTH_NULL;
|
|
|
|
#endif
|
|
|
|
|
2017-05-08 02:25:55 +02:00
|
|
|
#if defined(HAVE_LAKKA)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum wifi_driver_enum WIFI_DEFAULT_DRIVER = WIFI_CONNMANCTL;
|
2017-05-08 02:25:55 +02:00
|
|
|
#else
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum wifi_driver_enum WIFI_DEFAULT_DRIVER = WIFI_NULL;
|
2017-05-08 02:25:55 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(ANDROID)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum location_driver_enum LOCATION_DEFAULT_DRIVER = LOCATION_ANDROID;
|
2017-05-08 02:25:55 +02:00
|
|
|
#else
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum location_driver_enum LOCATION_DEFAULT_DRIVER = LOCATION_NULL;
|
2017-05-08 02:25:55 +02:00
|
|
|
#endif
|
|
|
|
|
2020-10-01 15:54:11 +01:00
|
|
|
#if (defined(_3DS) || defined(DINGUX)) && defined(HAVE_RGUI)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum menu_driver_enum MENU_DEFAULT_DRIVER = MENU_RGUI;
|
2020-10-01 15:54:11 +01:00
|
|
|
#elif defined(HAVE_MATERIALUI) && defined(RARCH_MOBILE)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum menu_driver_enum MENU_DEFAULT_DRIVER = MENU_MATERIALUI;
|
2020-02-21 20:19:13 +01:00
|
|
|
#elif defined(HAVE_OZONE)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum menu_driver_enum MENU_DEFAULT_DRIVER = MENU_OZONE;
|
2018-01-20 06:47:46 +01:00
|
|
|
#elif defined(HAVE_XMB) && !defined(_XBOX)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum menu_driver_enum MENU_DEFAULT_DRIVER = MENU_XMB;
|
2017-05-08 02:25:55 +02:00
|
|
|
#elif defined(HAVE_RGUI)
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum menu_driver_enum MENU_DEFAULT_DRIVER = MENU_RGUI;
|
2017-05-08 02:25:55 +02:00
|
|
|
#else
|
2020-06-07 00:33:48 +02:00
|
|
|
static const enum menu_driver_enum MENU_DEFAULT_DRIVER = MENU_NULL;
|
2017-05-08 02:25:55 +02:00
|
|
|
#endif
|
|
|
|
|
2020-08-14 23:03:15 +02:00
|
|
|
/* All config related settings go here. */
|
|
|
|
|
|
|
|
struct config_bool_setting
|
|
|
|
{
|
|
|
|
const char *ident;
|
|
|
|
bool *ptr;
|
|
|
|
enum rarch_override_setting override;
|
|
|
|
bool def_enable;
|
|
|
|
bool def;
|
|
|
|
bool handle;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct config_int_setting
|
|
|
|
{
|
|
|
|
const char *ident;
|
|
|
|
int *ptr;
|
|
|
|
int def;
|
|
|
|
enum rarch_override_setting override;
|
|
|
|
bool def_enable;
|
|
|
|
bool handle;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct config_uint_setting
|
|
|
|
{
|
|
|
|
const char *ident;
|
|
|
|
unsigned *ptr;
|
|
|
|
unsigned def;
|
|
|
|
enum rarch_override_setting override;
|
|
|
|
bool def_enable;
|
|
|
|
bool handle;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct config_size_setting
|
|
|
|
{
|
|
|
|
const char *ident;
|
|
|
|
size_t *ptr;
|
|
|
|
size_t def;
|
|
|
|
enum rarch_override_setting override;
|
|
|
|
bool def_enable;
|
|
|
|
bool handle;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct config_float_setting
|
|
|
|
{
|
|
|
|
const char *ident;
|
|
|
|
float *ptr;
|
|
|
|
float def;
|
|
|
|
enum rarch_override_setting override;
|
|
|
|
bool def_enable;
|
|
|
|
bool handle;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct config_array_setting
|
|
|
|
{
|
|
|
|
const char *ident;
|
|
|
|
const char *def;
|
|
|
|
char *ptr;
|
|
|
|
enum rarch_override_setting override;
|
|
|
|
bool def_enable;
|
|
|
|
bool handle;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct config_path_setting
|
|
|
|
{
|
|
|
|
const char *ident;
|
|
|
|
char *ptr;
|
|
|
|
char *def;
|
|
|
|
bool def_enable;
|
|
|
|
bool handle;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2016-09-01 03:51:54 +02:00
|
|
|
#define GENERAL_SETTING(key, configval, default_enable, default_setting, type, handle_setting) \
|
2016-08-29 19:10:00 +02:00
|
|
|
{ \
|
2016-08-29 19:26:08 +02:00
|
|
|
tmp[count].ident = key; \
|
|
|
|
tmp[count].ptr = configval; \
|
|
|
|
tmp[count].def_enable = default_enable; \
|
|
|
|
if (default_enable) \
|
|
|
|
tmp[count].def = default_setting; \
|
2016-09-01 03:51:54 +02:00
|
|
|
tmp[count].handle = handle_setting; \
|
2016-08-29 19:10:00 +02:00
|
|
|
count++; \
|
2017-07-14 15:11:27 -04:00
|
|
|
}
|
2016-08-29 19:10:00 +02:00
|
|
|
|
2016-09-01 03:51:54 +02:00
|
|
|
#define SETTING_BOOL(key, configval, default_enable, default_setting, handle_setting) \
|
2017-04-29 00:43:20 +02:00
|
|
|
GENERAL_SETTING(key, configval, default_enable, default_setting, struct config_bool_setting, handle_setting)
|
2016-08-30 04:05:27 +02:00
|
|
|
|
2016-09-01 03:51:54 +02:00
|
|
|
#define SETTING_FLOAT(key, configval, default_enable, default_setting, handle_setting) \
|
2017-04-29 00:43:20 +02:00
|
|
|
GENERAL_SETTING(key, configval, default_enable, default_setting, struct config_float_setting, handle_setting)
|
2016-08-29 19:10:00 +02:00
|
|
|
|
2016-09-01 03:51:54 +02:00
|
|
|
#define SETTING_INT(key, configval, default_enable, default_setting, handle_setting) \
|
2017-04-29 00:43:20 +02:00
|
|
|
GENERAL_SETTING(key, configval, default_enable, default_setting, struct config_int_setting, handle_setting)
|
2016-08-30 04:05:27 +02:00
|
|
|
|
2017-04-28 19:55:09 +02:00
|
|
|
#define SETTING_UINT(key, configval, default_enable, default_setting, handle_setting) \
|
2017-04-29 00:43:20 +02:00
|
|
|
GENERAL_SETTING(key, configval, default_enable, default_setting, struct config_uint_setting, handle_setting)
|
2017-04-28 19:55:09 +02:00
|
|
|
|
2018-07-13 16:12:09 -04:00
|
|
|
#define SETTING_SIZE(key, configval, default_enable, default_setting, handle_setting) \
|
|
|
|
GENERAL_SETTING(key, configval, default_enable, default_setting, struct config_size_setting, handle_setting)
|
|
|
|
|
2016-09-01 03:51:54 +02:00
|
|
|
#define SETTING_PATH(key, configval, default_enable, default_setting, handle_setting) \
|
2016-09-05 17:16:37 +02:00
|
|
|
GENERAL_SETTING(key, configval, default_enable, default_setting, struct config_path_setting, handle_setting)
|
2016-08-29 19:10:00 +02:00
|
|
|
|
2016-09-01 02:53:04 +02:00
|
|
|
#define SETTING_ARRAY(key, configval, default_enable, default_setting, handle_setting) \
|
2017-04-29 00:43:20 +02:00
|
|
|
GENERAL_SETTING(key, configval, default_enable, default_setting, struct config_array_setting, handle_setting)
|
2016-08-29 19:10:00 +02:00
|
|
|
|
2018-03-09 17:23:34 -05:00
|
|
|
#define SETTING_OVERRIDE(override_setting) \
|
|
|
|
tmp[count-1].override = override_setting
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/* Forward declarations */
|
|
|
|
#ifdef HAVE_CONFIGFILE
|
|
|
|
static void config_parse_file(global_t *global);
|
|
|
|
#endif
|
|
|
|
|
2014-06-12 18:06:29 +02:00
|
|
|
struct defaults g_defaults;
|
2015-12-04 09:02:30 +01:00
|
|
|
|
2021-11-03 21:22:37 +01:00
|
|
|
static settings_t *config_st = NULL;
|
|
|
|
|
|
|
|
settings_t *config_get_ptr(void)
|
|
|
|
{
|
|
|
|
return config_st;
|
|
|
|
}
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/**
|
|
|
|
* config_get_default_audio:
|
|
|
|
*
|
|
|
|
* Gets default audio driver.
|
|
|
|
*
|
|
|
|
* Returns: Default audio driver.
|
|
|
|
**/
|
|
|
|
const char *config_get_default_audio(void)
|
2010-12-29 19:00:21 +01:00
|
|
|
{
|
2020-06-26 18:40:20 +02:00
|
|
|
enum audio_driver_enum default_driver = AUDIO_DEFAULT_DRIVER;
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
switch (default_driver)
|
|
|
|
{
|
|
|
|
case AUDIO_RSOUND:
|
|
|
|
return "rsound";
|
|
|
|
case AUDIO_AUDIOIO:
|
|
|
|
return "audioio";
|
|
|
|
case AUDIO_OSS:
|
|
|
|
return "oss";
|
|
|
|
case AUDIO_ALSA:
|
|
|
|
return "alsa";
|
|
|
|
case AUDIO_ALSATHREAD:
|
|
|
|
return "alsathread";
|
|
|
|
case AUDIO_TINYALSA:
|
|
|
|
return "tinyalsa";
|
|
|
|
case AUDIO_ROAR:
|
|
|
|
return "roar";
|
|
|
|
case AUDIO_COREAUDIO:
|
|
|
|
return "coreaudio";
|
|
|
|
case AUDIO_COREAUDIO3:
|
|
|
|
return "coreaudio3";
|
|
|
|
case AUDIO_AL:
|
|
|
|
return "openal";
|
|
|
|
case AUDIO_SL:
|
|
|
|
return "opensl";
|
|
|
|
case AUDIO_SDL:
|
|
|
|
return "sdl";
|
|
|
|
case AUDIO_SDL2:
|
|
|
|
return "sdl2";
|
|
|
|
case AUDIO_DSOUND:
|
|
|
|
return "dsound";
|
|
|
|
case AUDIO_WASAPI:
|
|
|
|
return "wasapi";
|
|
|
|
case AUDIO_XAUDIO:
|
|
|
|
return "xaudio";
|
|
|
|
case AUDIO_PULSE:
|
|
|
|
return "pulse";
|
|
|
|
case AUDIO_EXT:
|
|
|
|
return "ext";
|
|
|
|
case AUDIO_XENON360:
|
|
|
|
return "xenon360";
|
|
|
|
case AUDIO_PS3:
|
|
|
|
return "ps3";
|
|
|
|
case AUDIO_WII:
|
|
|
|
return "gx";
|
|
|
|
case AUDIO_WIIU:
|
|
|
|
return "AX";
|
|
|
|
case AUDIO_PSP:
|
|
|
|
#if defined(VITA)
|
|
|
|
return "vita";
|
|
|
|
#elif defined(ORBIS)
|
|
|
|
return "orbis";
|
|
|
|
#else
|
|
|
|
return "psp";
|
2015-08-31 15:26:37 +02:00
|
|
|
#endif
|
2020-06-26 18:40:20 +02:00
|
|
|
case AUDIO_PS2:
|
|
|
|
return "ps2";
|
|
|
|
case AUDIO_CTR:
|
|
|
|
return "dsp";
|
|
|
|
case AUDIO_SWITCH:
|
|
|
|
#if defined(HAVE_LIBNX)
|
|
|
|
return "switch_audren_thread";
|
|
|
|
#else
|
|
|
|
return "switch";
|
2019-07-07 13:30:04 +00:00
|
|
|
#endif
|
2020-06-26 18:40:20 +02:00
|
|
|
case AUDIO_RWEBAUDIO:
|
|
|
|
return "rwebaudio";
|
|
|
|
case AUDIO_JACK:
|
|
|
|
return "jack";
|
|
|
|
case AUDIO_NULL:
|
|
|
|
break;
|
|
|
|
}
|
2016-12-05 06:37:26 +01:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
return "null";
|
|
|
|
}
|
2014-10-03 17:07:51 +02:00
|
|
|
|
Add microphone support via a new driver (#14731)
* Some slight fixes
* Update libretro.h
* Log calls to RETRO_ENVIRONMENT_GET_MICROPHONE_INTERFACE
* Finish proof-of-concept for mic support
- It works, but doesn't support floating-point audio yet
- It may need to be resampled, too
* Add macros that aren't available in SDL 2
* Comment out a variable definition for now
- For C89 compliance
* Add some comments for clarity
* Let ALSA tolerate a null new_rate
* Partial ALSA microphone support
- Not yet tested
- Mic is created and destroyed
- Mic can also be paused or unpaused
- Mic is paused or unpaused with the rest of the driver
- Microphone is not yet read
* Install error logging in the ALSA driver
- It defers to RARCH_ERR
* Free the ALSA microphone in alsa_free
* Fix an indent
* First draft of alsa_read_microphone
* Deinitialize SDL Audio in sdl_audio_free
* Save and restore the ALSA error logger
- You should always practice safe global state
* Add newlines to some RARCH_ERRs
* Add some logging
* Check for the mic being active via settings instead of via flags
* Adjusted a log entry to be less misleading
- A frequency of 0Hz looks weird to the uninformed
- In reality, it means the driver used the requested frequency
* Fix an incorrect format string
* Tidy up logging in alsa.c
* Rename audio_enable_microphone to audio_enable_input
* Rename microphone_device to audio_input_device
* Add audio_input_latency and audio_input_block_frames settings
* Add all mic-related settings to the options menu
* Adjust logging for alsa.c
- Log the ALSA library version
- Add errno details
* Refer to the microphone in logs by name
* Use %u instead of %d for some log items
* Add input_samples_buf
* Remove an inaccurate comment
* Change type of input_samples_buf
* Clean up audio_driver_flush_microphone_input
* Comment convert_float_to_s16
- It helped me understand what it's doing
- Turns out it'll work just fine on mono audio
* Don't use the resampler for mic input
* Fix crash in the ALSA driver when reading from a mic
* Update some logging messages
* ALSA support now works for mics
* Reuse some common functions in alsa.c
* Add alsa_thread_microphone_t
* Refactor alsa.c
- Introduce alsa_init_pcm to init any PCM that we're using
- Vastly simplifies the implementation of alsa_init and alsa_init_microphone
- Will be used for the read-based versions next
* Make ALSA logging a little more consistent
* Clean up the mic with alsa_free_microphone if alsa_init_microphone fails
* Remove an unused function
* Move some cleanup in alsa.c to a common function
* First crack at mic support for alsathread
- Refactor some duplicate code into functions
- Use functions introduced in alsa.c
- Create and destroy the mic
* Slight cleanups for clarity
* Implement alsa_thread_set/get_microphone_state
* More work on alsathread
- No more crashing, but the mic just returns silence
* Slight cleanups for clarity
* Add alsa_set_mic_enabled_internal
- For setting the state of a microphone while considering its current state
* Use alsa_set_mic_enabled_internal
* Log a little more info
* Log when the audio driver is started/stopped
* Move base microphone driver code into a new directory
- Add microphone_driver.c to Makefile.common
- Rename functions as needed
* Initialize and deinitialize the microphone driver
* Implement sdl_microphone.c
* Un-const an argument
- In case the driver context needs to do any locking
* Revise comments for microphone_driver.h
* Remove an unimplemented function
* Remove some functions from the mic driver
* Remove mic functions from audio_thread_wrapper
* Remove mic functions from sdl_audio
* Fix microphone_null
* Split the mic code for the alsa audio drivers into microphone drivers
* Fix an extra struct member
* Add a setting for the mic driver
* Add a command to reinitialize the microphone driver
* Rename mic-related settings
* Add DRIVER_MICROPHONE_MASK to DRIVERS_CMD_ALL
* Rename audio_enable_input to microphone_enable
* Remove some labels from qt_options
* Search for microphone_driver within find_driver_nonempty
* Clean up some mic driver code
* Pending mics now return silence
* Adjust some logging and comments
* Some cleanup in the microphone driver
* Invert a flag check
- Oops
* Fix a log message
* Fix the wrong flags being checked
* Slight refactor of wasapi_init_device
- Add a data_flow parameter
- Declare it in a header
- In preparation for WASAPI mic support
* Add some WASAPI macros for _IAudioCaptureClient
* Move some common WASAPI functions to audio/common/wasapi.c
- They'll be used by the mic and the audio drivers
* Add wasapi_log_hr
* Generalize mmdevice_list_new to look for capture devices, too
* Fix a function declaration
* Move driver-specific device_list_new functions into their respective files
* Clean up some declarations
* First draft of wasapi microphone driver
* Add wasapi_microphone_device_list_free
* Change function parameter names to be consistent with microphone_driver
* Partially implement wasapi_microphone_read
- Mostly copied from the audio driver so far
- It doesn't compile yet
- But it'll be beautiful when I'm done with it
* Refactor the mic driver's functions
- Rename get_mic_active to mic_alive
- Split set_mic_active into start_mic and stop_mic
- Refactor the SDL mic driver accordingly
* Edit some WASAPI functions for logging and clarity
* Implement more of the WASAPI mic driver
* Rename write_event to read_event
* Pass the WASAPI driver context to the various read functions
* Mostly implement the read function for the WASAPI mic driver
* Fix a crash in microphone_driver
- Forgot to move the position of the name of null_driver
* Reduce some logging in wasapi common functions
- Only log the chosen audio client format, not all attempted ones
* Add some macro wrappers for IAudioClient methods
* Update mic driver configuration
- Make the mic driver configurable in the menu
- Add config items for WASAPI-related options similar to the audio driver
* Fix a menu entry scrolling through audio devices instead of mic devices
* Add some utility functions
* Expose the new utility functions in wasapi.h
* Add extra logging in the WASAPI common functions
* Add sharemode_name
* Use _IAudioClient_Initialize macro in some places
* Pass channels to wasapi_init_client
- Remember, mics are in mono
* Use _IAudioClient_Initialize macro some more
* Forgot to pass channels in some places
* Add some utility functions
* Forgot an #include
* Add wasapi_select_device_format
* Simplify the format selection logic in wasapi_init_client_sh
* Unset the microphone in wasapi_microphone_close_mic
- Ought to prevent a potential segfault
* Simplify some logging
* Fix incorrect value being passed to _IAudioCaptureClient_ReleaseBuffer
* Remove some unneeded logging
* Add some values to hresult_name
* Polish up wasapi_select_device_format
- Test for formats manually when Windows can't
- Add some debug logging
- Check for channels
* Compute the fields of WAVEFORMATEXTENSIBLE correctly
- As per the doc's stated requirements
* Simplify logic for WASAPI client creation
* Fix a potential hang in wasapi_microphone_read_shared_buffered
* Stop the microphone if the driver is stopped
* Don't name the microphone event
* Ensure that wasapi_init_client reports the correct format and rate
* Implement exclusive microphone read access for WASAPI
* Add _IAudioCaptureClient_GetNextPacketSize macro
* Organize cases in hresult_name
* Clear some extra fields if wasapi_set_format is setting a Pcm format
* Adjust some logs
* Adjust some logs
* Remove unneeded local vars
* Add a log
* Update wasapi.c
* Update wasapi.c
* Fix shared-mode mic support in WASAPI producing broken input
- Turns out it had nothing to do with shared mode
* Reuse a common function
- Remove wasapi_microphone_read_shared_buffered
- Rename wasapi_microphone_read_exclusive to wasapi_microphone_read_buffered
* Remove some code I was using for test purposes
* Clarify some language
* Double the default shared-mode mic buffer length
* Split getting a device's name into a separate function, then use it
* Fix the ALSA mic drivers
- To comply with changes I previously made to the mic driver interface
* Remove unused synchronization primitives from the SDL microphone driver
* Add sdl_microphone_mic_use_float
* Document audio_driver_state_flags
- I needed to understand these to see if similar flags were required for the mic driver
* Remove an unused function in wasapi.c
* Add and document flags in microphone_driver.h
* Remove driver-specific mic start/stop functions
- The mic driver itself doesn't do much processing
- That honor goes to individual mics
* Remove some unused fields in microphone_driver.h
* Add CMD_EVENT_MICROPHONE_STOP/START
* Remove unused functions from microphone_null
* Change how the mic driver state is referenced in some places
* Simplify the SDL microphone driver
- The driver backend no longer keeps a reference to the mic (the frontend does that)
- Remove functions that are no longer needed
- Don't track paused state, just query the mic itself
* Simplify the WASAPI microphone driver
- Don't track the driver running state or the microphone handle, the frontend does that now
- Remove support for unbuffered input (hunterk suggested that it wasn't necessary)
* Make microphone_wasapi_sh_buffer_length a uint, not an int
- It won't be negative anymore
- 0 now represents the default value
* Make the microphone frontend more robust
- Improve documentation for how various functions should be implemented
- Closes all microphones before freeing the driver (so backends don't have to)
- Tracks the enabled state of each microphone, so backends don't have to (but they still can)
* Stop the mic driver in core_unload_game
* Ensure mic support is compatible with the revised menu code
* Move alsa.h into audio/common
* Remove RETRO_ENVIRONMENT_GET_MICROPHONE_ENABLED
- It was never really needed
* Refactor the ALSA microphone driver
- Move common ALSA functions to audio/common/alsa.c
- Replace alsa_set_mic_enabled_internal with alsa_start/stop_pcm
- Don't track the microphone handle in the ALSA driver context
- Remove unneeded fields
* Move some common alsathread code into audio/common/alsathread.c
* Change return type of mic_driver_open_mic_internal to bool
* First crack at resampling mic input
* Remove an extraneous check
- I think something distracted me when I was writing this line
* Add stereo/mono conversion functions
* Make alsa_start_pcm and alsa_stop_pcm more robust
- They now return success if the stream is already running and stopped, respectively
* Revise some mic-related comments in libretro.h
* First crack at resampling mic input
* Simplify an expression
* Simplify an expression
* Fix a log tag
* Allow mic resampler to be configured separately from audio resampler
* Add some comments
* Set the source ratio to something sensible
* Stop deadlock in `alsathread` mic driver
* Allow mics to be initialized even when core is loaded from CLI
- When loading content from CLI, the drivers are initialized a little differently
- That threw off the mic initialization code
* Rename the functions in retro_microphone_interface
* Revise some mic-related comments in libretro.h
* Update retro_microphone_interface
- Add get_mic_rate
- Add a parameter to open_mic
- The modifications don't do anything yet
* Use parameter objects in the microphone handle
* Replace get_mic_rate with get_params
* Add a microphone interface version
* Remove part of a comment
* Set the effective params in mic_driver_microphone_handle_init
* Drop a stray newline
* Change where the mic interface is zeroed
- I was accidentally throwing out the version that the core was asking for
* Reduce logspam for wasapi_set_nonblock_state
- Now it only logs when the sync mode is changed
* Change DEFAULT_WASAPI_SH_BUFFER_LENGTH to 0
- -16 is no longer a valid value
* Set the new_rate in wasapi_init
* Change description of microphone sample rate in the settings
* First attempt at resampling configured mic input
* Forgot a section
* Fix some input samples being skipped
* Rename a variable for clarity
* Add microphone.outgoing_samples
* Update the mic driver
- Processed samples are now buffered
- The resampler is skipped if the ratio is (very close to) 1
* Remove part of a comment
* Update some comments in audio_resampler.h
* Slightly refactor the SDL microphone driver
- Move SDL_AudioSpec to a field of sdl_microphone_handle_t
- Allow SDL to change the requested format and sample rate
- Request floating-point input
- Implement sdl_microphone_mic_use_float
* Fix a non-C89-compliant declaration
* Add new files to griffin.c
* Remove a C++-style comment
* Add two more files to griffin.c
* Remove some unneeded declarations in microphone_driver.h
* Remove a stray comma in configuration.c
- For C89 compliance
* Fix compilation on some platforms
* Change some function signatures
* Make the ALSA drivers always set the audio rate
* Fix the alsathread mic driver
* Make state_manager_frame_is_reversed return false if HAVE_REWIND isn't defined
* Mute the microphone if the core is running in fast-forward, slow-mo, or rewind
* Clarify a comment
* Clarify a comment
* Add a comment
* Don't allocate memory for slowmo samples in the mic driver
- We're not supporting slowmo for mics, so it's not needed
* Fix a {
* Add my name to AUTHORS.h
* Add driver_lifetime_flags
- For drivers that have special setup/teardown needs
* Ensure that resetting the mic driver maintains active mic handles
- Prevents fullscreen toggle from stopping all mic input
* Update CHANGES.md
* Move some default microphone settings to a new part of the config file
* Ensure that RetroArch can use the audio format that Windows suggests
* Remove references to mic support in the SDL audio driver
* Remove unused WASAPI functions
* Return failure if RetroArch couldn't select a WASAPI format
* Ensure that Windows uses the WASAPI mic driver by default
* Treat disabled mic support as a warning, not an error
* Clarify some WASAPI-related microphone settings
* Remove some unused variables
* Add or revise microphone-related comments
* Rearrange doc comments for microphone types in libretro.h
* Remove a space
* Remove some unused flags
* Remove ALSA error logger
- It was never used anyway
* Remove unneeded microphone-related arguments
* Document a parameter
* Remove a logging call
* Add a constant for the microphone's shared buffer length for WASAPI
* Fix stylistic inconsistencies
* Make mic_driver_get_sample_size a macro instead of a function
* Move the microphone implementation to the audio directory
* Make microphone support optional (but enabled by default)
* Fix the griffin build
2023-06-06 15:55:06 -04:00
|
|
|
#if defined(HAVE_MICROPHONE)
|
|
|
|
/**
|
|
|
|
* config_get_default_microphone:
|
|
|
|
*
|
|
|
|
* Gets default microphone driver.
|
|
|
|
*
|
|
|
|
* Returns: Default microphone driver.
|
|
|
|
**/
|
|
|
|
const char *config_get_default_microphone(void)
|
|
|
|
{
|
|
|
|
enum microphone_driver_enum default_driver = MICROPHONE_DEFAULT_DRIVER;
|
|
|
|
|
|
|
|
switch (default_driver)
|
|
|
|
{
|
|
|
|
case MICROPHONE_ALSA:
|
|
|
|
return "alsa";
|
|
|
|
case MICROPHONE_ALSATHREAD:
|
|
|
|
return "alsathread";
|
|
|
|
case MICROPHONE_WASAPI:
|
|
|
|
return "wasapi";
|
|
|
|
case MICROPHONE_SDL2:
|
|
|
|
return "sdl2";
|
|
|
|
case MICROPHONE_NULL:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return "null";
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
const char *config_get_default_record(void)
|
|
|
|
{
|
|
|
|
enum record_driver_enum default_driver = RECORD_DEFAULT_DRIVER;
|
|
|
|
|
|
|
|
switch (default_driver)
|
|
|
|
{
|
|
|
|
case RECORD_FFMPEG:
|
|
|
|
return "ffmpeg";
|
|
|
|
case RECORD_NULL:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return "null";
|
2014-07-18 19:11:53 +02:00
|
|
|
}
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/**
|
|
|
|
* config_get_default_audio_resampler:
|
|
|
|
*
|
|
|
|
* Gets default audio resampler driver.
|
|
|
|
*
|
|
|
|
* Returns: Default audio resampler driver.
|
|
|
|
**/
|
|
|
|
const char *config_get_default_audio_resampler(void)
|
2012-05-07 23:20:13 +02:00
|
|
|
{
|
2020-06-26 18:40:20 +02:00
|
|
|
enum audio_resampler_driver_enum default_driver = AUDIO_DEFAULT_RESAMPLER_DRIVER;
|
2014-10-03 17:07:51 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
switch (default_driver)
|
|
|
|
{
|
|
|
|
case AUDIO_RESAMPLER_CC:
|
|
|
|
return "cc";
|
|
|
|
case AUDIO_RESAMPLER_SINC:
|
|
|
|
return "sinc";
|
|
|
|
case AUDIO_RESAMPLER_NEAREST:
|
|
|
|
return "nearest";
|
|
|
|
case AUDIO_RESAMPLER_NULL:
|
|
|
|
break;
|
|
|
|
}
|
2019-01-10 22:24:43 +01:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
return "null";
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* config_get_default_video:
|
|
|
|
*
|
|
|
|
* Gets default video driver.
|
|
|
|
*
|
|
|
|
* Returns: Default video driver.
|
|
|
|
**/
|
|
|
|
const char *config_get_default_video(void)
|
|
|
|
{
|
|
|
|
enum video_driver_enum default_driver = VIDEO_DEFAULT_DRIVER;
|
2016-08-29 19:10:00 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
switch (default_driver)
|
2016-12-26 03:16:27 +01:00
|
|
|
{
|
2020-06-26 18:40:20 +02:00
|
|
|
case VIDEO_GL:
|
|
|
|
return "gl";
|
|
|
|
case VIDEO_GL1:
|
|
|
|
return "gl1";
|
|
|
|
case VIDEO_GL_CORE:
|
|
|
|
return "glcore";
|
|
|
|
case VIDEO_VULKAN:
|
|
|
|
return "vulkan";
|
|
|
|
case VIDEO_METAL:
|
|
|
|
return "metal";
|
|
|
|
case VIDEO_DRM:
|
|
|
|
return "drm";
|
|
|
|
case VIDEO_WII:
|
|
|
|
return "gx";
|
|
|
|
case VIDEO_WIIU:
|
|
|
|
return "gx2";
|
|
|
|
case VIDEO_XENON360:
|
|
|
|
return "xenon360";
|
|
|
|
case VIDEO_D3D8:
|
|
|
|
return "d3d8";
|
2022-04-19 15:45:22 +02:00
|
|
|
case VIDEO_D3D9_CG:
|
|
|
|
return "d3d9_cg";
|
|
|
|
case VIDEO_D3D9_HLSL:
|
|
|
|
return "d3d9_hlsl";
|
2020-06-26 18:40:20 +02:00
|
|
|
case VIDEO_D3D10:
|
|
|
|
return "d3d10";
|
|
|
|
case VIDEO_D3D11:
|
|
|
|
return "d3d11";
|
|
|
|
case VIDEO_D3D12:
|
|
|
|
return "d3d12";
|
|
|
|
case VIDEO_PSP1:
|
|
|
|
return "psp1";
|
|
|
|
case VIDEO_PS2:
|
|
|
|
return "ps2";
|
|
|
|
case VIDEO_VITA2D:
|
|
|
|
return "vita2d";
|
|
|
|
case VIDEO_CTR:
|
|
|
|
return "ctr";
|
|
|
|
case VIDEO_SWITCH:
|
|
|
|
return "switch";
|
|
|
|
case VIDEO_XVIDEO:
|
|
|
|
return "xvideo";
|
|
|
|
case VIDEO_SDL_DINGUX:
|
|
|
|
return "sdl_dingux";
|
2021-07-13 11:36:48 -05:00
|
|
|
case VIDEO_SDL_RS90:
|
|
|
|
return "sdl_rs90";
|
2020-06-26 18:40:20 +02:00
|
|
|
case VIDEO_SDL:
|
|
|
|
return "sdl";
|
|
|
|
case VIDEO_SDL2:
|
|
|
|
return "sdl2";
|
|
|
|
case VIDEO_EXT:
|
|
|
|
return "ext";
|
|
|
|
case VIDEO_VG:
|
|
|
|
return "vg";
|
|
|
|
case VIDEO_OMAP:
|
|
|
|
return "omap";
|
|
|
|
case VIDEO_EXYNOS:
|
|
|
|
return "exynos";
|
|
|
|
case VIDEO_DISPMANX:
|
|
|
|
return "dispmanx";
|
|
|
|
case VIDEO_SUNXI:
|
|
|
|
return "sunxi";
|
|
|
|
case VIDEO_CACA:
|
|
|
|
return "caca";
|
|
|
|
case VIDEO_GDI:
|
|
|
|
return "gdi";
|
|
|
|
case VIDEO_VGA:
|
|
|
|
return "vga";
|
|
|
|
case VIDEO_FPGA:
|
|
|
|
return "fpga";
|
2021-05-19 22:50:34 +02:00
|
|
|
case VIDEO_RSX:
|
|
|
|
return "rsx";
|
2020-06-26 18:40:20 +02:00
|
|
|
case VIDEO_NULL:
|
|
|
|
break;
|
2016-12-26 03:16:27 +01:00
|
|
|
}
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
return "null";
|
2016-08-29 19:10:00 +02:00
|
|
|
}
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/**
|
|
|
|
* config_get_default_input:
|
|
|
|
*
|
|
|
|
* Gets default input driver.
|
|
|
|
*
|
|
|
|
* Returns: Default input driver.
|
|
|
|
**/
|
|
|
|
const char *config_get_default_input(void)
|
2016-08-29 19:10:00 +02:00
|
|
|
{
|
2020-06-26 18:40:20 +02:00
|
|
|
enum input_driver_enum default_driver = INPUT_DEFAULT_DRIVER;
|
2016-08-29 19:10:00 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
switch (default_driver)
|
|
|
|
{
|
|
|
|
case INPUT_ANDROID:
|
|
|
|
return "android";
|
|
|
|
case INPUT_PS4:
|
|
|
|
return "ps4";
|
|
|
|
case INPUT_PS3:
|
|
|
|
return "ps3";
|
|
|
|
case INPUT_PSP:
|
|
|
|
#ifdef VITA
|
|
|
|
return "vita";
|
|
|
|
#else
|
|
|
|
return "psp";
|
2017-04-28 13:43:47 +02:00
|
|
|
#endif
|
2020-06-26 18:40:20 +02:00
|
|
|
case INPUT_PS2:
|
|
|
|
return "ps2";
|
|
|
|
case INPUT_CTR:
|
|
|
|
return "ctr";
|
|
|
|
case INPUT_SWITCH:
|
|
|
|
return "switch";
|
|
|
|
case INPUT_SDL:
|
|
|
|
return "sdl";
|
|
|
|
case INPUT_SDL2:
|
|
|
|
return "sdl2";
|
2020-10-08 13:22:35 +01:00
|
|
|
case INPUT_SDL_DINGUX:
|
|
|
|
return "sdl_dingux";
|
2020-06-26 18:40:20 +02:00
|
|
|
case INPUT_DINPUT:
|
|
|
|
return "dinput";
|
|
|
|
case INPUT_WINRAW:
|
|
|
|
return "raw";
|
|
|
|
case INPUT_X:
|
|
|
|
return "x";
|
|
|
|
case INPUT_WAYLAND:
|
|
|
|
return "wayland";
|
|
|
|
case INPUT_XENON360:
|
|
|
|
return "xenon360";
|
|
|
|
case INPUT_XINPUT:
|
|
|
|
return "xinput";
|
|
|
|
case INPUT_UWP:
|
|
|
|
return "uwp";
|
|
|
|
case INPUT_WII:
|
|
|
|
return "gx";
|
|
|
|
case INPUT_WIIU:
|
|
|
|
return "wiiu";
|
|
|
|
case INPUT_LINUXRAW:
|
|
|
|
return "linuxraw";
|
|
|
|
case INPUT_UDEV:
|
|
|
|
return "udev";
|
|
|
|
case INPUT_COCOA:
|
|
|
|
return "cocoa";
|
|
|
|
case INPUT_QNX:
|
|
|
|
return "qnx_input";
|
|
|
|
case INPUT_RWEBINPUT:
|
|
|
|
return "rwebinput";
|
|
|
|
case INPUT_DOS:
|
|
|
|
return "dos";
|
|
|
|
case INPUT_NULL:
|
|
|
|
break;
|
|
|
|
}
|
2016-08-29 21:03:01 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
return "null";
|
|
|
|
}
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2016-08-29 19:10:00 +02:00
|
|
|
/**
|
2020-06-26 18:40:20 +02:00
|
|
|
* config_get_default_joypad:
|
2016-08-29 19:10:00 +02:00
|
|
|
*
|
2020-06-26 18:40:20 +02:00
|
|
|
* Gets default input joypad driver.
|
2020-06-26 18:25:12 +02:00
|
|
|
*
|
2020-06-26 18:40:20 +02:00
|
|
|
* Returns: Default input joypad driver.
|
2016-08-29 19:10:00 +02:00
|
|
|
**/
|
2020-06-26 18:40:20 +02:00
|
|
|
const char *config_get_default_joypad(void)
|
2016-08-29 19:10:00 +02:00
|
|
|
{
|
2020-06-26 18:40:20 +02:00
|
|
|
enum joypad_driver_enum default_driver = JOYPAD_DEFAULT_DRIVER;
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
switch (default_driver)
|
|
|
|
{
|
|
|
|
case JOYPAD_PS4:
|
|
|
|
return "ps4";
|
|
|
|
case JOYPAD_PS3:
|
|
|
|
return "ps3";
|
|
|
|
case JOYPAD_XINPUT:
|
|
|
|
return "xinput";
|
|
|
|
case JOYPAD_GX:
|
|
|
|
return "gx";
|
|
|
|
case JOYPAD_WIIU:
|
|
|
|
return "wiiu";
|
|
|
|
case JOYPAD_XDK:
|
|
|
|
return "xdk";
|
|
|
|
case JOYPAD_PSP:
|
|
|
|
#ifdef VITA
|
|
|
|
return "vita";
|
2020-06-26 18:25:12 +02:00
|
|
|
#else
|
2020-06-26 18:40:20 +02:00
|
|
|
return "psp";
|
2016-08-29 19:10:00 +02:00
|
|
|
#endif
|
2020-06-26 18:40:20 +02:00
|
|
|
case JOYPAD_PS2:
|
|
|
|
return "ps2";
|
|
|
|
case JOYPAD_CTR:
|
|
|
|
return "ctr";
|
|
|
|
case JOYPAD_SWITCH:
|
|
|
|
return "switch";
|
|
|
|
case JOYPAD_DINPUT:
|
|
|
|
return "dinput";
|
|
|
|
case JOYPAD_UDEV:
|
|
|
|
return "udev";
|
|
|
|
case JOYPAD_LINUXRAW:
|
|
|
|
return "linuxraw";
|
|
|
|
case JOYPAD_ANDROID:
|
|
|
|
return "android";
|
|
|
|
case JOYPAD_SDL:
|
|
|
|
#ifdef HAVE_SDL2
|
|
|
|
return "sdl2";
|
|
|
|
#else
|
|
|
|
return "sdl";
|
|
|
|
#endif
|
2020-10-08 13:22:35 +01:00
|
|
|
case JOYPAD_SDL_DINGUX:
|
|
|
|
return "sdl_dingux";
|
2020-06-26 18:40:20 +02:00
|
|
|
case JOYPAD_HID:
|
|
|
|
return "hid";
|
|
|
|
case JOYPAD_QNX:
|
|
|
|
return "qnx";
|
|
|
|
case JOYPAD_RWEBPAD:
|
|
|
|
return "rwebpad";
|
|
|
|
case JOYPAD_DOS:
|
|
|
|
return "dos";
|
|
|
|
case JOYPAD_MFI:
|
|
|
|
return "mfi";
|
|
|
|
case JOYPAD_NULL:
|
|
|
|
break;
|
2016-08-30 03:20:55 +02:00
|
|
|
}
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
return "null";
|
|
|
|
}
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/**
|
|
|
|
* config_get_default_camera:
|
|
|
|
*
|
|
|
|
* Gets default camera driver.
|
|
|
|
*
|
|
|
|
* Returns: Default camera driver.
|
|
|
|
**/
|
|
|
|
const char *config_get_default_camera(void)
|
|
|
|
{
|
|
|
|
enum camera_driver_enum default_driver = CAMERA_DEFAULT_DRIVER;
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
switch (default_driver)
|
2017-04-28 19:55:09 +02:00
|
|
|
{
|
2020-06-26 18:40:20 +02:00
|
|
|
case CAMERA_V4L2:
|
|
|
|
return "video4linux2";
|
|
|
|
case CAMERA_RWEBCAM:
|
|
|
|
return "rwebcam";
|
|
|
|
case CAMERA_ANDROID:
|
|
|
|
return "android";
|
|
|
|
case CAMERA_AVFOUNDATION:
|
|
|
|
return "avfoundation";
|
|
|
|
case CAMERA_NULL:
|
|
|
|
break;
|
2020-06-26 18:25:12 +02:00
|
|
|
}
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
return "null";
|
|
|
|
}
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2020-06-17 14:56:44 +03:00
|
|
|
/**
|
|
|
|
* config_get_default_bluetooth:
|
|
|
|
*
|
|
|
|
* Gets default bluetooth driver.
|
|
|
|
*
|
|
|
|
* Returns: Default bluetooth driver.
|
|
|
|
**/
|
|
|
|
const char *config_get_default_bluetooth(void)
|
|
|
|
{
|
|
|
|
enum bluetooth_driver_enum default_driver = BLUETOOTH_DEFAULT_DRIVER;
|
|
|
|
|
|
|
|
switch (default_driver)
|
|
|
|
{
|
|
|
|
case BLUETOOTH_BLUETOOTHCTL:
|
|
|
|
return "bluetoothctl";
|
2020-06-24 02:51:42 +03:00
|
|
|
case BLUETOOTH_BLUEZ:
|
|
|
|
return "bluez";
|
2020-06-17 14:56:44 +03:00
|
|
|
case BLUETOOTH_NULL:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return "null";
|
|
|
|
}
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/**
|
|
|
|
* config_get_default_wifi:
|
|
|
|
*
|
|
|
|
* Gets default wifi driver.
|
|
|
|
*
|
|
|
|
* Returns: Default wifi driver.
|
|
|
|
**/
|
|
|
|
const char *config_get_default_wifi(void)
|
|
|
|
{
|
|
|
|
enum wifi_driver_enum default_driver = WIFI_DEFAULT_DRIVER;
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
switch (default_driver)
|
2020-06-26 18:25:12 +02:00
|
|
|
{
|
2020-06-26 18:40:20 +02:00
|
|
|
case WIFI_CONNMANCTL:
|
|
|
|
return "connmanctl";
|
2021-05-31 02:20:34 +00:00
|
|
|
case WIFI_NMCLI:
|
|
|
|
return "nmcli";
|
2020-06-26 18:40:20 +02:00
|
|
|
case WIFI_NULL:
|
|
|
|
break;
|
|
|
|
}
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
return "null";
|
|
|
|
}
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/**
|
|
|
|
* config_get_default_led:
|
|
|
|
*
|
|
|
|
* Gets default led driver.
|
|
|
|
*
|
|
|
|
* Returns: Default led driver.
|
|
|
|
**/
|
|
|
|
const char *config_get_default_led(void)
|
|
|
|
{
|
|
|
|
return "null";
|
|
|
|
}
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/**
|
|
|
|
* config_get_default_location:
|
|
|
|
*
|
|
|
|
* Gets default location driver.
|
|
|
|
*
|
|
|
|
* Returns: Default location driver.
|
|
|
|
**/
|
|
|
|
const char *config_get_default_location(void)
|
|
|
|
{
|
|
|
|
enum location_driver_enum default_driver = LOCATION_DEFAULT_DRIVER;
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
switch (default_driver)
|
|
|
|
{
|
|
|
|
case LOCATION_ANDROID:
|
|
|
|
return "android";
|
|
|
|
case LOCATION_CORELOCATION:
|
|
|
|
return "corelocation";
|
|
|
|
case LOCATION_NULL:
|
|
|
|
break;
|
|
|
|
}
|
2017-04-28 19:55:09 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
return "null";
|
|
|
|
}
|
2018-07-13 16:12:09 -04:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/**
|
|
|
|
* config_get_default_menu:
|
|
|
|
*
|
|
|
|
* Gets default menu driver.
|
|
|
|
*
|
|
|
|
* Returns: Default menu driver.
|
|
|
|
**/
|
|
|
|
const char *config_get_default_menu(void)
|
|
|
|
{
|
|
|
|
#ifdef HAVE_MENU
|
|
|
|
enum menu_driver_enum default_driver = MENU_DEFAULT_DRIVER;
|
2018-07-13 16:12:09 -04:00
|
|
|
|
2020-08-16 04:38:02 +02:00
|
|
|
if (!string_is_empty(g_defaults.settings_menu))
|
|
|
|
return g_defaults.settings_menu;
|
2016-12-26 03:16:27 +01:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
switch (default_driver)
|
|
|
|
{
|
|
|
|
case MENU_RGUI:
|
|
|
|
return "rgui";
|
|
|
|
case MENU_OZONE:
|
|
|
|
return "ozone";
|
|
|
|
case MENU_MATERIALUI:
|
|
|
|
return "glui";
|
|
|
|
case MENU_XMB:
|
|
|
|
return "xmb";
|
|
|
|
case MENU_STRIPES:
|
|
|
|
return "stripes";
|
|
|
|
case MENU_NULL:
|
|
|
|
break;
|
2016-08-29 20:57:24 +02:00
|
|
|
}
|
2016-08-29 19:10:00 +02:00
|
|
|
#endif
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
return "null";
|
|
|
|
}
|
2019-05-10 22:15:39 -07:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
const char *config_get_default_midi(void)
|
|
|
|
{
|
|
|
|
enum midi_driver_enum default_driver = MIDI_DEFAULT_DRIVER;
|
2019-05-10 22:15:39 -07:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
switch (default_driver)
|
|
|
|
{
|
|
|
|
case MIDI_WINMM:
|
|
|
|
return "winmm";
|
|
|
|
case MIDI_ALSA:
|
|
|
|
return "alsa";
|
|
|
|
case MIDI_NULL:
|
|
|
|
break;
|
|
|
|
}
|
2016-08-29 19:10:00 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
return "null";
|
|
|
|
}
|
2016-08-29 19:10:00 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
const char *config_get_midi_driver_options(void)
|
|
|
|
{
|
|
|
|
return char_list_new_special(STRING_LIST_MIDI_DRIVERS, NULL);
|
2020-06-26 18:25:12 +02:00
|
|
|
}
|
2016-08-29 19:10:00 +02:00
|
|
|
|
2021-04-17 23:54:45 +02:00
|
|
|
#ifdef HAVE_LAKKA
|
|
|
|
void config_set_timezone(char *timezone)
|
|
|
|
{
|
|
|
|
setenv("TZ", timezone, 1);
|
|
|
|
tzset();
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *config_get_all_timezones(void)
|
|
|
|
{
|
|
|
|
return char_list_new_special(STRING_LIST_TIMEZONES, NULL);
|
|
|
|
}
|
|
|
|
|
2023-07-15 09:52:47 +02:00
|
|
|
static void load_timezone(char *s)
|
2021-04-17 23:54:45 +02:00
|
|
|
{
|
|
|
|
char haystack[TIMEZONE_LENGTH+32];
|
2023-07-15 09:52:47 +02:00
|
|
|
static char *needle = "TIMEZONE=";
|
|
|
|
RFILE *tzfp = filestream_open(LAKKA_TIMEZONE_PATH,
|
2021-04-17 23:54:45 +02:00
|
|
|
RETRO_VFS_FILE_ACCESS_READ,
|
|
|
|
RETRO_VFS_FILE_ACCESS_HINT_NONE);
|
2023-01-22 18:39:06 +01:00
|
|
|
if (tzfp)
|
2021-04-17 23:54:45 +02:00
|
|
|
{
|
2023-07-15 09:52:47 +02:00
|
|
|
char *start = NULL;
|
2023-01-22 18:39:06 +01:00
|
|
|
|
2021-04-17 23:54:45 +02:00
|
|
|
filestream_gets(tzfp, haystack, sizeof(haystack)-1);
|
|
|
|
filestream_close(tzfp);
|
|
|
|
|
2023-07-15 09:52:47 +02:00
|
|
|
if ((start = strstr(haystack, needle)))
|
|
|
|
{
|
|
|
|
size_t needle_len = STRLEN_CONST("TIMEZONE=");
|
|
|
|
strlcpy(s, start + needle_len, TIMEZONE_LENGTH);
|
|
|
|
}
|
2021-04-17 23:54:45 +02:00
|
|
|
else
|
2023-07-15 09:52:47 +02:00
|
|
|
strlcpy(s, DEFAULT_TIMEZONE, TIMEZONE_LENGTH);
|
2021-04-17 23:54:45 +02:00
|
|
|
}
|
|
|
|
else
|
2023-07-15 09:52:47 +02:00
|
|
|
strlcpy(s, DEFAULT_TIMEZONE, TIMEZONE_LENGTH);
|
2021-04-17 23:54:45 +02:00
|
|
|
|
2023-07-15 09:52:47 +02:00
|
|
|
config_set_timezone(s);
|
2021-04-17 23:54:45 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
bool config_overlay_enable_default(void)
|
2020-06-26 18:25:12 +02:00
|
|
|
{
|
2020-08-16 04:38:02 +02:00
|
|
|
if (g_defaults.overlay_set)
|
|
|
|
return g_defaults.overlay_enable;
|
2023-07-18 21:41:08 +03:00
|
|
|
#if defined(RARCH_MOBILE)
|
2020-06-26 18:40:20 +02:00
|
|
|
return true;
|
2023-07-18 21:41:08 +03:00
|
|
|
#else
|
|
|
|
return false;
|
|
|
|
#endif
|
2020-06-26 18:40:20 +02:00
|
|
|
}
|
2011-01-23 02:48:06 +01:00
|
|
|
|
2023-08-22 18:34:29 +03:00
|
|
|
static struct config_array_setting *populate_settings_array(
|
|
|
|
settings_t *settings, int *size)
|
2020-06-26 18:40:20 +02:00
|
|
|
{
|
2023-01-22 18:39:06 +01:00
|
|
|
unsigned count = 0;
|
2020-06-26 18:40:20 +02:00
|
|
|
struct config_array_setting *tmp = (struct config_array_setting*)calloc(1, (*size + 1) * sizeof(struct config_array_setting));
|
2014-06-13 01:10:14 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
if (!tmp)
|
|
|
|
return NULL;
|
2014-06-12 18:30:41 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/* Arrays */
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_ARRAY("audio_driver", settings->arrays.audio_driver, false, NULL, true);
|
|
|
|
SETTING_ARRAY("audio_device", settings->arrays.audio_device, false, NULL, true);
|
|
|
|
SETTING_ARRAY("audio_resampler", settings->arrays.audio_resampler, false, NULL, true);
|
|
|
|
#ifdef HAVE_MICROPHONE
|
|
|
|
SETTING_ARRAY("microphone_device", settings->arrays.microphone_device, false, NULL, true);
|
|
|
|
SETTING_ARRAY("microphone_driver", settings->arrays.microphone_driver, false, NULL, true);
|
|
|
|
SETTING_ARRAY("microphone_resampler", settings->arrays.microphone_resampler, false, NULL, true);
|
|
|
|
#endif
|
|
|
|
SETTING_ARRAY("midi_driver", settings->arrays.midi_driver, false, NULL, true);
|
|
|
|
SETTING_ARRAY("midi_input", settings->arrays.midi_input, true, DEFAULT_MIDI_INPUT, true);
|
|
|
|
SETTING_ARRAY("midi_output", settings->arrays.midi_output, true, DEFAULT_MIDI_OUTPUT, true);
|
|
|
|
|
|
|
|
SETTING_ARRAY("video_driver", settings->arrays.video_driver, false, NULL, true);
|
|
|
|
SETTING_ARRAY("video_context_driver", settings->arrays.video_context_driver, false, NULL, true);
|
|
|
|
SETTING_ARRAY("crt_switch_timings", settings->arrays.crt_switch_timings, false, NULL, true);
|
|
|
|
|
|
|
|
SETTING_ARRAY("input_driver", settings->arrays.input_driver, false, NULL, true);
|
|
|
|
SETTING_ARRAY("input_joypad_driver", settings->arrays.input_joypad_driver, false, NULL, true);
|
|
|
|
SETTING_ARRAY("input_keyboard_layout", settings->arrays.input_keyboard_layout, false, NULL, true);
|
|
|
|
#ifdef ANDROID
|
|
|
|
SETTING_ARRAY("input_android_physical_keyboard", settings->arrays.input_android_physical_keyboard, false, NULL, true);
|
|
|
|
#endif
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
#ifdef HAVE_MENU
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_ARRAY("menu_driver", settings->arrays.menu_driver, false, NULL, true);
|
2020-06-26 18:40:20 +02:00
|
|
|
#endif
|
2023-08-22 18:34:29 +03:00
|
|
|
|
|
|
|
SETTING_ARRAY("record_driver", settings->arrays.record_driver, false, NULL, true);
|
|
|
|
SETTING_ARRAY("camera_driver", settings->arrays.camera_driver, false, NULL, true);
|
|
|
|
SETTING_ARRAY("camera_device", settings->arrays.camera_device, false, NULL, true);
|
|
|
|
SETTING_ARRAY("bluetooth_driver", settings->arrays.bluetooth_driver, false, NULL, true);
|
|
|
|
SETTING_ARRAY("wifi_driver", settings->arrays.wifi_driver, false, NULL, true);
|
|
|
|
SETTING_ARRAY("led_driver", settings->arrays.led_driver, false, NULL, true);
|
|
|
|
SETTING_ARRAY("location_driver", settings->arrays.location_driver, false, NULL, true);
|
|
|
|
SETTING_ARRAY("cloud_sync_driver", settings->arrays.cloud_sync_driver, false, NULL, true);
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
#ifdef HAVE_CHEEVOS
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_ARRAY("cheevos_custom_host", settings->arrays.cheevos_custom_host, false, NULL, true);
|
|
|
|
SETTING_ARRAY("cheevos_username", settings->arrays.cheevos_username, false, NULL, true);
|
|
|
|
SETTING_ARRAY("cheevos_password", settings->arrays.cheevos_password, false, NULL, true);
|
|
|
|
SETTING_ARRAY("cheevos_token", settings->arrays.cheevos_token, false, NULL, true);
|
|
|
|
SETTING_ARRAY("cheevos_leaderboards_enable", settings->arrays.cheevos_leaderboards_enable, true, "", true); /* deprecated */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_NETWORKING
|
|
|
|
SETTING_ARRAY("netplay_mitm_server", settings->arrays.netplay_mitm_server, false, NULL, true);
|
|
|
|
SETTING_ARRAY("webdav_url", settings->arrays.webdav_url, false, NULL, true);
|
|
|
|
SETTING_ARRAY("webdav_username", settings->arrays.webdav_username, false, NULL, true);
|
|
|
|
SETTING_ARRAY("webdav_password", settings->arrays.webdav_password, false, NULL, true);
|
|
|
|
SETTING_ARRAY("youtube_stream_key", settings->arrays.youtube_stream_key, true, NULL, true);
|
|
|
|
SETTING_ARRAY("twitch_stream_key", settings->arrays.twitch_stream_key, true, NULL, true);
|
|
|
|
SETTING_ARRAY("facebook_stream_key", settings->arrays.facebook_stream_key, true, NULL, true);
|
|
|
|
SETTING_ARRAY("discord_app_id", settings->arrays.discord_app_id, true, DEFAULT_DISCORD_APP_ID, true);
|
|
|
|
SETTING_ARRAY("ai_service_url", settings->arrays.ai_service_url, true, DEFAULT_AI_SERVICE_URL, true);
|
Add microphone support via a new driver (#14731)
* Some slight fixes
* Update libretro.h
* Log calls to RETRO_ENVIRONMENT_GET_MICROPHONE_INTERFACE
* Finish proof-of-concept for mic support
- It works, but doesn't support floating-point audio yet
- It may need to be resampled, too
* Add macros that aren't available in SDL 2
* Comment out a variable definition for now
- For C89 compliance
* Add some comments for clarity
* Let ALSA tolerate a null new_rate
* Partial ALSA microphone support
- Not yet tested
- Mic is created and destroyed
- Mic can also be paused or unpaused
- Mic is paused or unpaused with the rest of the driver
- Microphone is not yet read
* Install error logging in the ALSA driver
- It defers to RARCH_ERR
* Free the ALSA microphone in alsa_free
* Fix an indent
* First draft of alsa_read_microphone
* Deinitialize SDL Audio in sdl_audio_free
* Save and restore the ALSA error logger
- You should always practice safe global state
* Add newlines to some RARCH_ERRs
* Add some logging
* Check for the mic being active via settings instead of via flags
* Adjusted a log entry to be less misleading
- A frequency of 0Hz looks weird to the uninformed
- In reality, it means the driver used the requested frequency
* Fix an incorrect format string
* Tidy up logging in alsa.c
* Rename audio_enable_microphone to audio_enable_input
* Rename microphone_device to audio_input_device
* Add audio_input_latency and audio_input_block_frames settings
* Add all mic-related settings to the options menu
* Adjust logging for alsa.c
- Log the ALSA library version
- Add errno details
* Refer to the microphone in logs by name
* Use %u instead of %d for some log items
* Add input_samples_buf
* Remove an inaccurate comment
* Change type of input_samples_buf
* Clean up audio_driver_flush_microphone_input
* Comment convert_float_to_s16
- It helped me understand what it's doing
- Turns out it'll work just fine on mono audio
* Don't use the resampler for mic input
* Fix crash in the ALSA driver when reading from a mic
* Update some logging messages
* ALSA support now works for mics
* Reuse some common functions in alsa.c
* Add alsa_thread_microphone_t
* Refactor alsa.c
- Introduce alsa_init_pcm to init any PCM that we're using
- Vastly simplifies the implementation of alsa_init and alsa_init_microphone
- Will be used for the read-based versions next
* Make ALSA logging a little more consistent
* Clean up the mic with alsa_free_microphone if alsa_init_microphone fails
* Remove an unused function
* Move some cleanup in alsa.c to a common function
* First crack at mic support for alsathread
- Refactor some duplicate code into functions
- Use functions introduced in alsa.c
- Create and destroy the mic
* Slight cleanups for clarity
* Implement alsa_thread_set/get_microphone_state
* More work on alsathread
- No more crashing, but the mic just returns silence
* Slight cleanups for clarity
* Add alsa_set_mic_enabled_internal
- For setting the state of a microphone while considering its current state
* Use alsa_set_mic_enabled_internal
* Log a little more info
* Log when the audio driver is started/stopped
* Move base microphone driver code into a new directory
- Add microphone_driver.c to Makefile.common
- Rename functions as needed
* Initialize and deinitialize the microphone driver
* Implement sdl_microphone.c
* Un-const an argument
- In case the driver context needs to do any locking
* Revise comments for microphone_driver.h
* Remove an unimplemented function
* Remove some functions from the mic driver
* Remove mic functions from audio_thread_wrapper
* Remove mic functions from sdl_audio
* Fix microphone_null
* Split the mic code for the alsa audio drivers into microphone drivers
* Fix an extra struct member
* Add a setting for the mic driver
* Add a command to reinitialize the microphone driver
* Rename mic-related settings
* Add DRIVER_MICROPHONE_MASK to DRIVERS_CMD_ALL
* Rename audio_enable_input to microphone_enable
* Remove some labels from qt_options
* Search for microphone_driver within find_driver_nonempty
* Clean up some mic driver code
* Pending mics now return silence
* Adjust some logging and comments
* Some cleanup in the microphone driver
* Invert a flag check
- Oops
* Fix a log message
* Fix the wrong flags being checked
* Slight refactor of wasapi_init_device
- Add a data_flow parameter
- Declare it in a header
- In preparation for WASAPI mic support
* Add some WASAPI macros for _IAudioCaptureClient
* Move some common WASAPI functions to audio/common/wasapi.c
- They'll be used by the mic and the audio drivers
* Add wasapi_log_hr
* Generalize mmdevice_list_new to look for capture devices, too
* Fix a function declaration
* Move driver-specific device_list_new functions into their respective files
* Clean up some declarations
* First draft of wasapi microphone driver
* Add wasapi_microphone_device_list_free
* Change function parameter names to be consistent with microphone_driver
* Partially implement wasapi_microphone_read
- Mostly copied from the audio driver so far
- It doesn't compile yet
- But it'll be beautiful when I'm done with it
* Refactor the mic driver's functions
- Rename get_mic_active to mic_alive
- Split set_mic_active into start_mic and stop_mic
- Refactor the SDL mic driver accordingly
* Edit some WASAPI functions for logging and clarity
* Implement more of the WASAPI mic driver
* Rename write_event to read_event
* Pass the WASAPI driver context to the various read functions
* Mostly implement the read function for the WASAPI mic driver
* Fix a crash in microphone_driver
- Forgot to move the position of the name of null_driver
* Reduce some logging in wasapi common functions
- Only log the chosen audio client format, not all attempted ones
* Add some macro wrappers for IAudioClient methods
* Update mic driver configuration
- Make the mic driver configurable in the menu
- Add config items for WASAPI-related options similar to the audio driver
* Fix a menu entry scrolling through audio devices instead of mic devices
* Add some utility functions
* Expose the new utility functions in wasapi.h
* Add extra logging in the WASAPI common functions
* Add sharemode_name
* Use _IAudioClient_Initialize macro in some places
* Pass channels to wasapi_init_client
- Remember, mics are in mono
* Use _IAudioClient_Initialize macro some more
* Forgot to pass channels in some places
* Add some utility functions
* Forgot an #include
* Add wasapi_select_device_format
* Simplify the format selection logic in wasapi_init_client_sh
* Unset the microphone in wasapi_microphone_close_mic
- Ought to prevent a potential segfault
* Simplify some logging
* Fix incorrect value being passed to _IAudioCaptureClient_ReleaseBuffer
* Remove some unneeded logging
* Add some values to hresult_name
* Polish up wasapi_select_device_format
- Test for formats manually when Windows can't
- Add some debug logging
- Check for channels
* Compute the fields of WAVEFORMATEXTENSIBLE correctly
- As per the doc's stated requirements
* Simplify logic for WASAPI client creation
* Fix a potential hang in wasapi_microphone_read_shared_buffered
* Stop the microphone if the driver is stopped
* Don't name the microphone event
* Ensure that wasapi_init_client reports the correct format and rate
* Implement exclusive microphone read access for WASAPI
* Add _IAudioCaptureClient_GetNextPacketSize macro
* Organize cases in hresult_name
* Clear some extra fields if wasapi_set_format is setting a Pcm format
* Adjust some logs
* Adjust some logs
* Remove unneeded local vars
* Add a log
* Update wasapi.c
* Update wasapi.c
* Fix shared-mode mic support in WASAPI producing broken input
- Turns out it had nothing to do with shared mode
* Reuse a common function
- Remove wasapi_microphone_read_shared_buffered
- Rename wasapi_microphone_read_exclusive to wasapi_microphone_read_buffered
* Remove some code I was using for test purposes
* Clarify some language
* Double the default shared-mode mic buffer length
* Split getting a device's name into a separate function, then use it
* Fix the ALSA mic drivers
- To comply with changes I previously made to the mic driver interface
* Remove unused synchronization primitives from the SDL microphone driver
* Add sdl_microphone_mic_use_float
* Document audio_driver_state_flags
- I needed to understand these to see if similar flags were required for the mic driver
* Remove an unused function in wasapi.c
* Add and document flags in microphone_driver.h
* Remove driver-specific mic start/stop functions
- The mic driver itself doesn't do much processing
- That honor goes to individual mics
* Remove some unused fields in microphone_driver.h
* Add CMD_EVENT_MICROPHONE_STOP/START
* Remove unused functions from microphone_null
* Change how the mic driver state is referenced in some places
* Simplify the SDL microphone driver
- The driver backend no longer keeps a reference to the mic (the frontend does that)
- Remove functions that are no longer needed
- Don't track paused state, just query the mic itself
* Simplify the WASAPI microphone driver
- Don't track the driver running state or the microphone handle, the frontend does that now
- Remove support for unbuffered input (hunterk suggested that it wasn't necessary)
* Make microphone_wasapi_sh_buffer_length a uint, not an int
- It won't be negative anymore
- 0 now represents the default value
* Make the microphone frontend more robust
- Improve documentation for how various functions should be implemented
- Closes all microphones before freeing the driver (so backends don't have to)
- Tracks the enabled state of each microphone, so backends don't have to (but they still can)
* Stop the mic driver in core_unload_game
* Ensure mic support is compatible with the revised menu code
* Move alsa.h into audio/common
* Remove RETRO_ENVIRONMENT_GET_MICROPHONE_ENABLED
- It was never really needed
* Refactor the ALSA microphone driver
- Move common ALSA functions to audio/common/alsa.c
- Replace alsa_set_mic_enabled_internal with alsa_start/stop_pcm
- Don't track the microphone handle in the ALSA driver context
- Remove unneeded fields
* Move some common alsathread code into audio/common/alsathread.c
* Change return type of mic_driver_open_mic_internal to bool
* First crack at resampling mic input
* Remove an extraneous check
- I think something distracted me when I was writing this line
* Add stereo/mono conversion functions
* Make alsa_start_pcm and alsa_stop_pcm more robust
- They now return success if the stream is already running and stopped, respectively
* Revise some mic-related comments in libretro.h
* First crack at resampling mic input
* Simplify an expression
* Simplify an expression
* Fix a log tag
* Allow mic resampler to be configured separately from audio resampler
* Add some comments
* Set the source ratio to something sensible
* Stop deadlock in `alsathread` mic driver
* Allow mics to be initialized even when core is loaded from CLI
- When loading content from CLI, the drivers are initialized a little differently
- That threw off the mic initialization code
* Rename the functions in retro_microphone_interface
* Revise some mic-related comments in libretro.h
* Update retro_microphone_interface
- Add get_mic_rate
- Add a parameter to open_mic
- The modifications don't do anything yet
* Use parameter objects in the microphone handle
* Replace get_mic_rate with get_params
* Add a microphone interface version
* Remove part of a comment
* Set the effective params in mic_driver_microphone_handle_init
* Drop a stray newline
* Change where the mic interface is zeroed
- I was accidentally throwing out the version that the core was asking for
* Reduce logspam for wasapi_set_nonblock_state
- Now it only logs when the sync mode is changed
* Change DEFAULT_WASAPI_SH_BUFFER_LENGTH to 0
- -16 is no longer a valid value
* Set the new_rate in wasapi_init
* Change description of microphone sample rate in the settings
* First attempt at resampling configured mic input
* Forgot a section
* Fix some input samples being skipped
* Rename a variable for clarity
* Add microphone.outgoing_samples
* Update the mic driver
- Processed samples are now buffered
- The resampler is skipped if the ratio is (very close to) 1
* Remove part of a comment
* Update some comments in audio_resampler.h
* Slightly refactor the SDL microphone driver
- Move SDL_AudioSpec to a field of sdl_microphone_handle_t
- Allow SDL to change the requested format and sample rate
- Request floating-point input
- Implement sdl_microphone_mic_use_float
* Fix a non-C89-compliant declaration
* Add new files to griffin.c
* Remove a C++-style comment
* Add two more files to griffin.c
* Remove some unneeded declarations in microphone_driver.h
* Remove a stray comma in configuration.c
- For C89 compliance
* Fix compilation on some platforms
* Change some function signatures
* Make the ALSA drivers always set the audio rate
* Fix the alsathread mic driver
* Make state_manager_frame_is_reversed return false if HAVE_REWIND isn't defined
* Mute the microphone if the core is running in fast-forward, slow-mo, or rewind
* Clarify a comment
* Clarify a comment
* Add a comment
* Don't allocate memory for slowmo samples in the mic driver
- We're not supporting slowmo for mics, so it's not needed
* Fix a {
* Add my name to AUTHORS.h
* Add driver_lifetime_flags
- For drivers that have special setup/teardown needs
* Ensure that resetting the mic driver maintains active mic handles
- Prevents fullscreen toggle from stopping all mic input
* Update CHANGES.md
* Move some default microphone settings to a new part of the config file
* Ensure that RetroArch can use the audio format that Windows suggests
* Remove references to mic support in the SDL audio driver
* Remove unused WASAPI functions
* Return failure if RetroArch couldn't select a WASAPI format
* Ensure that Windows uses the WASAPI mic driver by default
* Treat disabled mic support as a warning, not an error
* Clarify some WASAPI-related microphone settings
* Remove some unused variables
* Add or revise microphone-related comments
* Rearrange doc comments for microphone types in libretro.h
* Remove a space
* Remove some unused flags
* Remove ALSA error logger
- It was never used anyway
* Remove unneeded microphone-related arguments
* Document a parameter
* Remove a logging call
* Add a constant for the microphone's shared buffer length for WASAPI
* Fix stylistic inconsistencies
* Make mic_driver_get_sample_size a macro instead of a function
* Move the microphone implementation to the audio directory
* Make microphone support optional (but enabled by default)
* Fix the griffin build
2023-06-06 15:55:06 -04:00
|
|
|
#endif
|
2023-08-22 18:34:29 +03:00
|
|
|
|
2021-05-12 02:16:25 +02:00
|
|
|
#ifdef HAVE_LAKKA
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_ARRAY("cpu_main_gov", settings->arrays.cpu_main_gov, false, NULL, true);
|
|
|
|
SETTING_ARRAY("cpu_menu_gov", settings->arrays.cpu_menu_gov, false, NULL, true);
|
2021-05-12 02:16:25 +02:00
|
|
|
#endif
|
2015-04-13 02:12:28 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
*size = count;
|
2015-05-19 21:18:07 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
return tmp;
|
2020-06-26 18:25:12 +02:00
|
|
|
}
|
2015-04-13 02:12:28 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
static struct config_path_setting *populate_settings_path(
|
|
|
|
settings_t *settings, int *size)
|
2020-06-26 18:25:12 +02:00
|
|
|
{
|
2020-06-26 18:40:20 +02:00
|
|
|
unsigned count = 0;
|
2021-11-10 02:34:04 +01:00
|
|
|
recording_state_t *recording_st = recording_state_get_ptr();
|
2020-06-26 18:40:20 +02:00
|
|
|
struct config_path_setting *tmp = (struct config_path_setting*)calloc(1, (*size + 1) * sizeof(struct config_path_setting));
|
2016-03-22 05:46:36 +07:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
if (!tmp)
|
|
|
|
return NULL;
|
2013-10-05 11:11:43 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/* Paths */
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_PATH("bundle_assets_src_path", settings->paths.bundle_assets_src, false, NULL, true);
|
|
|
|
SETTING_PATH("bundle_assets_dst_path", settings->paths.bundle_assets_dst, false, NULL, true);
|
|
|
|
SETTING_PATH("bundle_assets_dst_path_subdir", settings->paths.bundle_assets_dst_subdir, false, NULL, true);
|
|
|
|
SETTING_PATH("core_updater_buildbot_cores_url", settings->paths.network_buildbot_url, false, NULL, true);
|
2020-06-26 18:40:20 +02:00
|
|
|
SETTING_PATH("core_updater_buildbot_assets_url", settings->paths.network_buildbot_assets_url, false, NULL, true);
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_PATH("libretro_directory", settings->paths.directory_libretro, false, NULL, false);
|
|
|
|
SETTING_PATH("core_options_path", settings->paths.path_core_options, false, NULL, true);
|
|
|
|
SETTING_PATH("libretro_info_path", settings->paths.path_libretro_info, false, NULL, true);
|
|
|
|
SETTING_PATH("playlist_directory", settings->paths.directory_playlist, true, NULL, true);
|
|
|
|
SETTING_PATH("cheat_database_path", settings->paths.path_cheat_database, false, NULL, true);
|
|
|
|
SETTING_PATH("system_directory", settings->paths.directory_system, true, NULL, true);
|
|
|
|
SETTING_PATH("cache_directory", settings->paths.directory_cache, false, NULL, true);
|
|
|
|
SETTING_PATH("audio_dsp_plugin", settings->paths.path_audio_dsp_plugin, false, NULL, true);
|
|
|
|
SETTING_PATH("audio_filter_dir", settings->paths.directory_audio_filter, true, NULL, true);
|
|
|
|
SETTING_PATH("resampler_directory", settings->paths.directory_resampler, false, NULL, true);
|
|
|
|
SETTING_PATH("video_shader_dir", settings->paths.directory_video_shader, true, NULL, true);
|
|
|
|
SETTING_PATH("video_filter_dir", settings->paths.directory_video_filter, true, NULL, true);
|
|
|
|
SETTING_PATH("video_filter", settings->paths.path_softfilter_plugin, false, NULL, true);
|
|
|
|
SETTING_PATH("video_font_path", settings->paths.path_font, false, NULL, true);
|
|
|
|
SETTING_PATH("video_record_config", settings->paths.path_record_config, false, NULL, true);
|
|
|
|
SETTING_PATH("video_stream_config", settings->paths.path_stream_config, false, NULL, true);
|
|
|
|
SETTING_PATH("video_stream_url", settings->paths.path_stream_url, false, NULL, true);
|
|
|
|
SETTING_PATH("input_remapping_directory", settings->paths.directory_input_remapping, false, NULL, true);
|
|
|
|
SETTING_PATH("core_assets_directory", settings->paths.directory_core_assets, true, NULL, true);
|
|
|
|
SETTING_PATH("assets_directory", settings->paths.directory_assets, true, NULL, true);
|
|
|
|
SETTING_PATH("dynamic_wallpapers_directory", settings->paths.directory_dynamic_wallpapers, true, NULL, true);
|
|
|
|
SETTING_PATH("thumbnails_directory", settings->paths.directory_thumbnails, true, NULL, true);
|
|
|
|
SETTING_PATH("runtime_log_directory", settings->paths.directory_runtime_log, true, NULL, true);
|
|
|
|
SETTING_PATH("joypad_autoconfig_dir", settings->paths.directory_autoconfig, false, NULL, true);
|
|
|
|
SETTING_PATH("savefile_directory", dir_get_ptr(RARCH_DIR_SAVEFILE), true, NULL, false);
|
|
|
|
SETTING_PATH("savestate_directory", dir_get_ptr(RARCH_DIR_SAVESTATE), true, NULL, false);
|
|
|
|
SETTING_PATH("screenshot_directory", settings->paths.directory_screenshot, true, NULL, true);
|
|
|
|
SETTING_PATH("recording_output_directory", recording_st->output_dir, false, NULL, true);
|
|
|
|
SETTING_PATH("recording_config_directory", recording_st->config_dir, false, NULL, true);
|
|
|
|
|
|
|
|
SETTING_PATH("content_database_path", settings->paths.path_content_database, false, NULL, true);
|
|
|
|
SETTING_PATH("content_favorites_path", settings->paths.path_content_favorites, false, NULL, true);
|
|
|
|
SETTING_PATH("content_history_path", settings->paths.path_content_history, false, NULL, true);
|
|
|
|
SETTING_PATH("content_image_history_path", settings->paths.path_content_image_history, false, NULL, true);
|
|
|
|
SETTING_PATH("content_music_history_path", settings->paths.path_content_music_history, false, NULL, true);
|
|
|
|
SETTING_PATH("content_video_history_path", settings->paths.path_content_video_history, false, NULL, true);
|
|
|
|
SETTING_PATH("content_favorites_directory", settings->paths.directory_content_favorites, true, NULL, true);
|
|
|
|
SETTING_PATH("content_history_directory", settings->paths.directory_content_history, true, NULL, true);
|
|
|
|
SETTING_PATH("content_image_history_directory", settings->paths.directory_content_image_history, true, NULL, true);
|
|
|
|
SETTING_PATH("content_music_history_directory", settings->paths.directory_content_music_history, true, NULL, true);
|
|
|
|
SETTING_PATH("content_video_directory", settings->paths.directory_content_video_history, true, NULL, true);
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
#ifdef HAVE_MENU
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_PATH("content_show_settings_password", settings->paths.menu_content_show_settings_password, false, NULL, true);
|
|
|
|
SETTING_PATH("kiosk_mode_password", settings->paths.kiosk_mode_password, false, NULL, true);
|
|
|
|
SETTING_PATH("menu_wallpaper", settings->paths.path_menu_wallpaper, false, NULL, true);
|
|
|
|
#ifdef HAVE_RGUI
|
|
|
|
SETTING_PATH("rgui_menu_theme_preset", settings->paths.path_rgui_theme_preset, false, NULL, true);
|
2023-10-15 14:47:26 +02:00
|
|
|
#endif
|
|
|
|
/* Browser and config directories are not RGUI dependent, but name is kept to avoid config file change */
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_PATH("rgui_browser_directory", settings->paths.directory_menu_content, true, NULL, true);
|
|
|
|
SETTING_PATH("rgui_config_directory", settings->paths.directory_menu_config, true, NULL, true);
|
|
|
|
#ifdef HAVE_XMB
|
|
|
|
SETTING_PATH("xmb_font", settings->paths.path_menu_xmb_font, false, NULL, true);
|
|
|
|
#endif
|
|
|
|
#endif /* HAVE_MENU */
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
#ifdef HAVE_OVERLAY
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_PATH("input_overlay", settings->paths.path_overlay, false, NULL, true);
|
|
|
|
SETTING_PATH("input_osk_overlay", settings->paths.path_osk_overlay, false, NULL, true);
|
|
|
|
SETTING_PATH("overlay_directory", settings->paths.directory_overlay, true, NULL, true);
|
|
|
|
SETTING_PATH("osk_overlay_directory", settings->paths.directory_osk_overlay, true, NULL, true);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_NETWORKING
|
|
|
|
SETTING_PATH("netplay_ip_address", settings->paths.netplay_server, false, NULL, true);
|
|
|
|
SETTING_PATH("netplay_custom_mitm_server", settings->paths.netplay_custom_mitm_server, false, NULL, true);
|
|
|
|
SETTING_PATH("netplay_nickname", settings->paths.username, false, NULL, true);
|
|
|
|
SETTING_PATH("netplay_password", settings->paths.netplay_password, false, NULL, true);
|
|
|
|
SETTING_PATH("netplay_spectate_password", settings->paths.netplay_spectate_password, false, NULL, true);
|
|
|
|
#endif
|
|
|
|
|
2022-08-17 08:23:07 +02:00
|
|
|
#ifdef _3DS
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_PATH("bottom_assets_directory", settings->paths.directory_bottom_assets, true, NULL, true);
|
2022-08-17 08:23:07 +02:00
|
|
|
#endif
|
2023-08-22 18:34:29 +03:00
|
|
|
|
|
|
|
SETTING_ARRAY("log_dir", settings->paths.log_dir, true, NULL, true);
|
2023-12-24 19:36:49 -05:00
|
|
|
SETTING_ARRAY("app_icon", settings->paths.app_icon, true, NULL, true);
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
*size = count;
|
2017-04-25 15:49:27 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
return tmp;
|
|
|
|
}
|
2012-02-01 23:02:17 +01:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
static struct config_bool_setting *populate_settings_bool(
|
|
|
|
settings_t *settings, int *size)
|
|
|
|
{
|
|
|
|
struct config_bool_setting *tmp = (struct config_bool_setting*)calloc(1, (*size + 1) * sizeof(struct config_bool_setting));
|
|
|
|
unsigned count = 0;
|
2015-01-19 04:09:28 +01:00
|
|
|
|
2022-12-25 19:17:16 +02:00
|
|
|
SETTING_BOOL("accessibility_enable", &settings->bools.accessibility_enable, true, DEFAULT_ACCESSIBILITY_ENABLE, false);
|
|
|
|
SETTING_BOOL("driver_switch_enable", &settings->bools.driver_switch_enable, true, DEFAULT_DRIVER_SWITCH_ENABLE, false);
|
2022-10-18 12:13:47 +02:00
|
|
|
SETTING_BOOL("ui_companion_start_on_boot", &settings->bools.ui_companion_start_on_boot, true, DEFAULT_UI_COMPANION_START_ON_BOOT, false);
|
|
|
|
SETTING_BOOL("ui_companion_enable", &settings->bools.ui_companion_enable, true, DEFAULT_UI_COMPANION_ENABLE, false);
|
|
|
|
SETTING_BOOL("ui_companion_toggle", &settings->bools.ui_companion_toggle, false, DEFAULT_UI_COMPANION_TOGGLE, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
SETTING_BOOL("desktop_menu_enable", &settings->bools.desktop_menu_enable, true, DEFAULT_DESKTOP_MENU_ENABLE, false);
|
|
|
|
SETTING_BOOL("video_gpu_record", &settings->bools.video_gpu_record, true, DEFAULT_GPU_RECORD, false);
|
2022-10-18 12:13:47 +02:00
|
|
|
SETTING_BOOL("input_descriptor_label_show", &settings->bools.input_descriptor_label_show, true, DEFAULT_INPUT_DESCRIPTOR_LABEL_SHOW, false);
|
|
|
|
SETTING_BOOL("input_descriptor_hide_unbound", &settings->bools.input_descriptor_hide_unbound, true, DEFAULT_INPUT_DESCRIPTOR_HIDE_UNBOUND, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
SETTING_BOOL("load_dummy_on_core_shutdown", &settings->bools.load_dummy_on_core_shutdown, true, DEFAULT_LOAD_DUMMY_ON_CORE_SHUTDOWN, false);
|
|
|
|
SETTING_BOOL("check_firmware_before_loading", &settings->bools.check_firmware_before_loading, true, DEFAULT_CHECK_FIRMWARE_BEFORE_LOADING, false);
|
2021-08-13 16:16:10 +01:00
|
|
|
SETTING_BOOL("core_option_category_enable", &settings->bools.core_option_category_enable, true, DEFAULT_CORE_OPTION_CATEGORY_ENABLE, false);
|
2023-01-26 15:56:33 +01:00
|
|
|
SETTING_BOOL("core_info_savestate_bypass", &settings->bools.core_info_savestate_bypass, true, DEFAULT_CORE_INFO_SAVESTATE_BYPASS, false);
|
2021-07-26 20:17:35 +01:00
|
|
|
#if defined(__WINRT__) || defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
|
|
|
|
SETTING_BOOL("core_info_cache_enable", &settings->bools.core_info_cache_enable, false, DEFAULT_CORE_INFO_CACHE_ENABLE, false);
|
|
|
|
#else
|
2021-05-06 11:58:45 +01:00
|
|
|
SETTING_BOOL("core_info_cache_enable", &settings->bools.core_info_cache_enable, true, DEFAULT_CORE_INFO_CACHE_ENABLE, false);
|
2021-07-26 20:17:35 +01:00
|
|
|
#endif
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_BOOL("core_set_supports_no_game_enable", &settings->bools.set_supports_no_game_enable, true, true, false);
|
|
|
|
SETTING_BOOL("core_updater_auto_extract_archive", &settings->bools.network_buildbot_auto_extract_archive, true, DEFAULT_NETWORK_BUILDBOT_AUTO_EXTRACT_ARCHIVE, false);
|
|
|
|
SETTING_BOOL("core_updater_show_experimental_cores", &settings->bools.network_buildbot_show_experimental_cores, true, DEFAULT_NETWORK_BUILDBOT_SHOW_EXPERIMENTAL_CORES, false);
|
|
|
|
SETTING_BOOL("core_updater_auto_backup", &settings->bools.core_updater_auto_backup, true, DEFAULT_CORE_UPDATER_AUTO_BACKUP, false);
|
2020-07-03 17:00:43 +01:00
|
|
|
#ifndef HAVE_DYNAMIC
|
|
|
|
SETTING_BOOL("always_reload_core_on_run_content", &settings->bools.always_reload_core_on_run_content, true, DEFAULT_ALWAYS_RELOAD_CORE_ON_RUN_CONTENT, false);
|
|
|
|
#endif
|
2020-07-16 01:07:14 +01:00
|
|
|
SETTING_BOOL("builtin_mediaplayer_enable", &settings->bools.multimedia_builtin_mediaplayer_enable, true, DEFAULT_BUILTIN_MEDIAPLAYER_ENABLE, false);
|
|
|
|
SETTING_BOOL("builtin_imageviewer_enable", &settings->bools.multimedia_builtin_imageviewer_enable, true, DEFAULT_BUILTIN_IMAGEVIEWER_ENABLE, false);
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_BOOL("bundle_assets_extract_enable", &settings->bools.bundle_assets_extract_enable, true, DEFAULT_BUNDLE_ASSETS_EXTRACT_ENABLE, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
SETTING_BOOL("fps_show", &settings->bools.video_fps_show, true, DEFAULT_FPS_SHOW, false);
|
|
|
|
SETTING_BOOL("statistics_show", &settings->bools.video_statistics_show, true, DEFAULT_STATISTICS_SHOW, false);
|
|
|
|
SETTING_BOOL("framecount_show", &settings->bools.video_framecount_show, true, DEFAULT_FRAMECOUNT_SHOW, false);
|
|
|
|
SETTING_BOOL("memory_show", &settings->bools.video_memory_show, true, DEFAULT_MEMORY_SHOW, false);
|
|
|
|
SETTING_BOOL("ui_menubar_enable", &settings->bools.ui_menubar_enable, true, DEFAULT_UI_MENUBAR_ENABLE, false);
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_BOOL("pause_nonactive", &settings->bools.pause_nonactive, true, DEFAULT_PAUSE_NONACTIVE, false);
|
|
|
|
SETTING_BOOL("pause_on_disconnect", &settings->bools.pause_on_disconnect, true, DEFAULT_PAUSE_ON_DISCONNECT, false);
|
|
|
|
SETTING_BOOL("auto_screenshot_filename", &settings->bools.auto_screenshot_filename, true, DEFAULT_AUTO_SCREENSHOT_FILENAME, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
SETTING_BOOL("suspend_screensaver_enable", &settings->bools.ui_suspend_screensaver_enable, true, true, false);
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_BOOL("apply_cheats_after_toggle", &settings->bools.apply_cheats_after_toggle, true, DEFAULT_APPLY_CHEATS_AFTER_TOGGLE, false);
|
|
|
|
SETTING_BOOL("apply_cheats_after_load", &settings->bools.apply_cheats_after_load, true, DEFAULT_APPLY_CHEATS_AFTER_LOAD, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
SETTING_BOOL("rewind_enable", &settings->bools.rewind_enable, true, DEFAULT_REWIND_ENABLE, false);
|
2022-01-26 19:30:33 +02:00
|
|
|
SETTING_BOOL("fastforward_frameskip", &settings->bools.fastforward_frameskip, true, DEFAULT_FASTFORWARD_FRAMESKIP, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
SETTING_BOOL("vrr_runloop_enable", &settings->bools.vrr_runloop_enable, true, DEFAULT_VRR_RUNLOOP_ENABLE, false);
|
2023-11-11 04:40:02 +02:00
|
|
|
SETTING_BOOL("menu_throttle_framerate", &settings->bools.menu_throttle_framerate, true, true, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
SETTING_BOOL("run_ahead_enabled", &settings->bools.run_ahead_enabled, true, false, false);
|
|
|
|
SETTING_BOOL("run_ahead_secondary_instance", &settings->bools.run_ahead_secondary_instance, true, DEFAULT_RUN_AHEAD_SECONDARY_INSTANCE, false);
|
|
|
|
SETTING_BOOL("run_ahead_hide_warnings", &settings->bools.run_ahead_hide_warnings, true, DEFAULT_RUN_AHEAD_HIDE_WARNINGS, false);
|
2023-01-10 00:22:14 -06:00
|
|
|
SETTING_BOOL("preemptive_frames_enable", &settings->bools.preemptive_frames_enable, true, false, false);
|
|
|
|
SETTING_BOOL("preemptive_frames_hide_warnings", &settings->bools.preemptive_frames_hide_warnings, true, DEFAULT_PREEMPT_HIDE_WARNINGS, false);
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_BOOL("kiosk_mode_enable", &settings->bools.kiosk_mode_enable, true, DEFAULT_KIOSK_MODE_ENABLE, false);
|
|
|
|
SETTING_BOOL("block_sram_overwrite", &settings->bools.block_sram_overwrite, true, DEFAULT_BLOCK_SRAM_OVERWRITE, false);
|
|
|
|
SETTING_BOOL("replay_auto_index", &settings->bools.replay_auto_index, true, DEFAULT_REPLAY_AUTO_INDEX, false);
|
|
|
|
SETTING_BOOL("savestate_auto_index", &settings->bools.savestate_auto_index, true, DEFAULT_SAVESTATE_AUTO_INDEX, false);
|
|
|
|
SETTING_BOOL("savestate_auto_save", &settings->bools.savestate_auto_save, true, DEFAULT_SAVESTATE_AUTO_SAVE, false);
|
|
|
|
SETTING_BOOL("savestate_auto_load", &settings->bools.savestate_auto_load, true, DEFAULT_SAVESTATE_AUTO_LOAD, false);
|
|
|
|
SETTING_BOOL("savestate_thumbnail_enable", &settings->bools.savestate_thumbnail_enable, true, DEFAULT_SAVESTATE_THUMBNAIL_ENABLE, false);
|
|
|
|
SETTING_BOOL("save_file_compression", &settings->bools.save_file_compression, true, DEFAULT_SAVE_FILE_COMPRESSION, false);
|
|
|
|
SETTING_BOOL("savestate_file_compression", &settings->bools.savestate_file_compression, true, DEFAULT_SAVESTATE_FILE_COMPRESSION, false);
|
|
|
|
SETTING_BOOL("game_specific_options", &settings->bools.game_specific_options, true, DEFAULT_GAME_SPECIFIC_OPTIONS, false);
|
|
|
|
SETTING_BOOL("auto_overrides_enable", &settings->bools.auto_overrides_enable, true, DEFAULT_AUTO_OVERRIDES_ENABLE, false);
|
|
|
|
SETTING_BOOL("auto_remaps_enable", &settings->bools.auto_remaps_enable, true, DEFAULT_AUTO_REMAPS_ENABLE, false);
|
|
|
|
SETTING_BOOL("global_core_options", &settings->bools.global_core_options, true, DEFAULT_GLOBAL_CORE_OPTIONS, false);
|
|
|
|
SETTING_BOOL("auto_shaders_enable", &settings->bools.auto_shaders_enable, true, DEFAULT_AUTO_SHADERS_ENABLE, false);
|
|
|
|
SETTING_BOOL("scan_without_core_match", &settings->bools.scan_without_core_match, true, DEFAULT_SCAN_WITHOUT_CORE_MATCH, false);
|
2024-01-02 00:57:44 -05:00
|
|
|
SETTING_BOOL("scan_serial_and_crc", &settings->bools.scan_serial_and_crc, true, DEFAULT_SCAN_SERIAL_AND_CRC, false);
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_BOOL("sort_savefiles_enable", &settings->bools.sort_savefiles_enable, true, DEFAULT_SORT_SAVEFILES_ENABLE, false);
|
|
|
|
SETTING_BOOL("sort_savestates_enable", &settings->bools.sort_savestates_enable, true, DEFAULT_SORT_SAVESTATES_ENABLE, false);
|
|
|
|
SETTING_BOOL("sort_savefiles_by_content_enable", &settings->bools.sort_savefiles_by_content_enable, true, DEFAULT_SORT_SAVEFILES_BY_CONTENT_ENABLE, false);
|
|
|
|
SETTING_BOOL("sort_savestates_by_content_enable", &settings->bools.sort_savestates_by_content_enable, true, DEFAULT_SORT_SAVESTATES_BY_CONTENT_ENABLE, false);
|
|
|
|
SETTING_BOOL("sort_screenshots_by_content_enable", &settings->bools.sort_screenshots_by_content_enable, true, DEFAULT_SORT_SCREENSHOTS_BY_CONTENT_ENABLE, false);
|
|
|
|
SETTING_BOOL("savestates_in_content_dir", &settings->bools.savestates_in_content_dir, true, DEFAULT_SAVESTATES_IN_CONTENT_DIR, false);
|
|
|
|
SETTING_BOOL("savefiles_in_content_dir", &settings->bools.savefiles_in_content_dir, true, DEFAULT_SAVEFILES_IN_CONTENT_DIR, false);
|
|
|
|
SETTING_BOOL("systemfiles_in_content_dir", &settings->bools.systemfiles_in_content_dir, true, DEFAULT_SYSTEMFILES_IN_CONTENT_DIR, false);
|
|
|
|
SETTING_BOOL("screenshots_in_content_dir", &settings->bools.screenshots_in_content_dir, true, DEFAULT_SCREENSHOTS_IN_CONTENT_DIR, false);
|
|
|
|
SETTING_BOOL("quit_press_twice", &settings->bools.quit_press_twice, true, DEFAULT_QUIT_PRESS_TWICE, false);
|
|
|
|
SETTING_BOOL("config_save_on_exit", &settings->bools.config_save_on_exit, true, DEFAULT_CONFIG_SAVE_ON_EXIT, false);
|
|
|
|
SETTING_BOOL("remap_save_on_exit", &settings->bools.remap_save_on_exit, true, DEFAULT_REMAP_SAVE_ON_EXIT, false);
|
|
|
|
SETTING_BOOL("show_hidden_files", &settings->bools.show_hidden_files, true, DEFAULT_SHOW_HIDDEN_FILES, false);
|
|
|
|
SETTING_BOOL("use_last_start_directory", &settings->bools.use_last_start_directory, true, DEFAULT_USE_LAST_START_DIRECTORY, false);
|
|
|
|
SETTING_BOOL("camera_allow", &settings->bools.camera_allow, true, false, false);
|
|
|
|
SETTING_BOOL("location_allow", &settings->bools.location_allow, true, false, false);
|
|
|
|
SETTING_BOOL("cloud_sync_enable", &settings->bools.cloud_sync_enable, true, false, false);
|
|
|
|
SETTING_BOOL("cloud_sync_destructive", &settings->bools.cloud_sync_destructive, true, false, false);
|
|
|
|
SETTING_BOOL("discord_allow", &settings->bools.discord_enable, true, false, false);
|
|
|
|
#ifdef HAVE_MIST
|
|
|
|
SETTING_BOOL("steam_rich_presence_enable", &settings->bools.steam_rich_presence_enable, true, false, false);
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_THREADS
|
|
|
|
SETTING_BOOL("threaded_data_runloop_enable", &settings->bools.threaded_data_runloop_enable, true, DEFAULT_THREADED_DATA_RUNLOOP_ENABLE, false);
|
|
|
|
#endif
|
|
|
|
SETTING_BOOL("log_to_file", &settings->bools.log_to_file, true, DEFAULT_LOG_TO_FILE, false);
|
|
|
|
SETTING_OVERRIDE(RARCH_OVERRIDE_SETTING_LOG_TO_FILE);
|
|
|
|
SETTING_BOOL("log_to_file_timestamp", &settings->bools.log_to_file_timestamp, true, DEFAULT_LOG_TO_FILE_TIMESTAMP, false);
|
|
|
|
SETTING_BOOL("ai_service_enable", &settings->bools.ai_service_enable, true, DEFAULT_AI_SERVICE_ENABLE, false);
|
|
|
|
SETTING_BOOL("ai_service_pause", &settings->bools.ai_service_pause, true, DEFAULT_AI_SERVICE_PAUSE, false);
|
|
|
|
SETTING_BOOL("wifi_enabled", &settings->bools.wifi_enabled, true, DEFAULT_WIFI_ENABLE, false);
|
2023-10-06 04:55:22 -07:00
|
|
|
#ifndef HAVE_LAKKA
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_BOOL("gamemode_enable", &settings->bools.gamemode_enable, true, DEFAULT_GAMEMODE_ENABLE, false);
|
2023-10-06 04:55:22 -07:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_LAKKA_SWITCH
|
|
|
|
SETTING_BOOL("switch_oc", &settings->bools.switch_oc, true, DEFAULT_SWITCH_OC, false);
|
|
|
|
SETTING_BOOL("switch_cec", &settings->bools.switch_cec, true, DEFAULT_SWITCH_CEC, false);
|
|
|
|
SETTING_BOOL("bluetooth_ertm_disable", &settings->bools.bluetooth_ertm_disable, true, DEFAULT_BLUETOOTH_ERTM, false);
|
|
|
|
#endif
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_BOOL("audio_enable", &settings->bools.audio_enable, true, DEFAULT_AUDIO_ENABLE, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
SETTING_BOOL("audio_sync", &settings->bools.audio_sync, true, DEFAULT_AUDIO_SYNC, false);
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_BOOL("audio_rate_control", &settings->bools.audio_rate_control, true, DEFAULT_RATE_CONTROL, false);
|
|
|
|
SETTING_BOOL("audio_enable_menu", &settings->bools.audio_enable_menu, true, DEFAULT_AUDIO_ENABLE_MENU, false);
|
|
|
|
SETTING_BOOL("audio_enable_menu_ok", &settings->bools.audio_enable_menu_ok, true, DEFAULT_AUDIO_ENABLE_MENU_OK, false);
|
|
|
|
SETTING_BOOL("audio_enable_menu_cancel", &settings->bools.audio_enable_menu_cancel, true, DEFAULT_AUDIO_ENABLE_MENU_CANCEL, false);
|
|
|
|
SETTING_BOOL("audio_enable_menu_notice", &settings->bools.audio_enable_menu_notice, true, DEFAULT_AUDIO_ENABLE_MENU_NOTICE, false);
|
|
|
|
SETTING_BOOL("audio_enable_menu_bgm", &settings->bools.audio_enable_menu_bgm, true, DEFAULT_AUDIO_ENABLE_MENU_BGM, false);
|
|
|
|
SETTING_BOOL("audio_enable_menu_scroll", &settings->bools.audio_enable_menu_scroll, true, DEFAULT_AUDIO_ENABLE_MENU_SCROLL, false);
|
|
|
|
SETTING_BOOL("audio_mute_enable", audio_get_bool_ptr(AUDIO_ACTION_MUTE_ENABLE), true, false, false);
|
|
|
|
#ifdef HAVE_AUDIOMIXER
|
|
|
|
SETTING_BOOL("audio_mixer_mute_enable", audio_get_bool_ptr(AUDIO_ACTION_MIXER_MUTE_ENABLE), true, false, false);
|
2023-11-26 07:59:14 -05:00
|
|
|
#endif
|
|
|
|
#if TARGET_OS_IOS
|
|
|
|
SETTING_BOOL("audio_respect_silent_mode", &settings->bools.audio_respect_silent_mode, true, DEFAULT_AUDIO_RESPECT_SILENT_MODE, false);
|
2023-08-22 18:34:29 +03:00
|
|
|
#endif
|
|
|
|
SETTING_BOOL("audio_fastforward_mute", &settings->bools.audio_fastforward_mute, true, DEFAULT_AUDIO_FASTFORWARD_MUTE, false);
|
|
|
|
SETTING_BOOL("audio_fastforward_speedup", &settings->bools.audio_fastforward_speedup, true, DEFAULT_AUDIO_FASTFORWARD_SPEEDUP, false);
|
|
|
|
|
|
|
|
#ifdef HAVE_WASAPI
|
|
|
|
SETTING_BOOL("audio_wasapi_exclusive_mode", &settings->bools.audio_wasapi_exclusive_mode, true, DEFAULT_WASAPI_EXCLUSIVE_MODE, false);
|
|
|
|
SETTING_BOOL("audio_wasapi_float_format", &settings->bools.audio_wasapi_float_format, true, DEFAULT_WASAPI_FLOAT_FORMAT, false);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_MICROPHONE
|
|
|
|
SETTING_BOOL("microphone_enable", &settings->bools.microphone_enable, true, DEFAULT_MICROPHONE_ENABLE, false);
|
|
|
|
#ifdef HAVE_WASAPI
|
|
|
|
SETTING_BOOL("microphone_wasapi_exclusive_mode", &settings->bools.microphone_wasapi_exclusive_mode, true, DEFAULT_WASAPI_EXCLUSIVE_MODE, false);
|
|
|
|
SETTING_BOOL("microphone_wasapi_float_format", &settings->bools.microphone_wasapi_float_format, true, DEFAULT_WASAPI_FLOAT_FORMAT, false);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
SETTING_BOOL("crt_switch_resolution_use_custom_refresh_rate", &settings->bools.crt_switch_custom_refresh_enable, true, false, false);
|
|
|
|
SETTING_BOOL("crt_switch_hires_menu", &settings->bools.crt_switch_hires_menu, true, false, true);
|
2020-06-26 18:40:20 +02:00
|
|
|
SETTING_BOOL("video_shader_enable", &settings->bools.video_shader_enable, true, DEFAULT_SHADER_ENABLE, false);
|
|
|
|
SETTING_BOOL("video_shader_watch_files", &settings->bools.video_shader_watch_files, true, DEFAULT_VIDEO_SHADER_WATCH_FILES, false);
|
2020-08-21 17:00:44 +01:00
|
|
|
SETTING_BOOL("video_shader_remember_last_dir", &settings->bools.video_shader_remember_last_dir, true, DEFAULT_VIDEO_SHADER_REMEMBER_LAST_DIR, false);
|
2022-12-25 19:17:16 +02:00
|
|
|
SETTING_BOOL("video_shader_preset_save_reference_enable", &settings->bools.video_shader_preset_save_reference_enable, true, DEFAULT_VIDEO_SHADER_PRESET_SAVE_REFERENCE_ENABLE, false);
|
2013-01-05 20:06:59 +01:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/* Let implementation decide if automatic, or 1:1 PAR. */
|
|
|
|
SETTING_BOOL("video_aspect_ratio_auto", &settings->bools.video_aspect_ratio_auto, true, DEFAULT_ASPECT_RATIO_AUTO, false);
|
2012-05-28 23:14:18 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
SETTING_BOOL("video_allow_rotate", &settings->bools.video_allow_rotate, true, DEFAULT_ALLOW_ROTATE, false);
|
|
|
|
SETTING_BOOL("video_windowed_fullscreen", &settings->bools.video_windowed_fullscreen, true, DEFAULT_WINDOWED_FULLSCREEN, false);
|
|
|
|
SETTING_BOOL("video_crop_overscan", &settings->bools.video_crop_overscan, true, DEFAULT_CROP_OVERSCAN, false);
|
|
|
|
SETTING_BOOL("video_scale_integer", &settings->bools.video_scale_integer, true, DEFAULT_SCALE_INTEGER, false);
|
2021-06-24 00:56:52 +03:00
|
|
|
SETTING_BOOL("video_scale_integer_overscale", &settings->bools.video_scale_integer_overscale, true, DEFAULT_SCALE_INTEGER_OVERSCALE, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
SETTING_BOOL("video_smooth", &settings->bools.video_smooth, true, DEFAULT_VIDEO_SMOOTH, false);
|
2021-09-03 06:15:25 +02:00
|
|
|
SETTING_BOOL("video_ctx_scaling", &settings->bools.video_ctx_scaling, true, DEFAULT_VIDEO_CTX_SCALING, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
SETTING_BOOL("video_force_aspect", &settings->bools.video_force_aspect, true, DEFAULT_FORCE_ASPECT, false);
|
2021-11-06 00:42:23 +02:00
|
|
|
SETTING_BOOL("video_frame_delay_auto", &settings->bools.video_frame_delay_auto, true, DEFAULT_FRAME_DELAY_AUTO, false);
|
2023-10-26 14:20:48 +03:00
|
|
|
SETTING_BOOL("video_frame_rest", &settings->bools.video_frame_rest, true, DEFAULT_FRAME_REST, false);
|
2020-10-01 15:54:11 +01:00
|
|
|
#if defined(DINGUX)
|
|
|
|
SETTING_BOOL("video_dingux_ipu_keep_aspect", &settings->bools.video_dingux_ipu_keep_aspect, true, DEFAULT_DINGUX_IPU_KEEP_ASPECT, false);
|
|
|
|
#endif
|
2020-06-26 18:40:20 +02:00
|
|
|
SETTING_BOOL("video_threaded", video_driver_get_threaded(), true, DEFAULT_VIDEO_THREADED, false);
|
|
|
|
SETTING_BOOL("video_shared_context", &settings->bools.video_shared_context, true, DEFAULT_VIDEO_SHARED_CONTEXT, false);
|
2023-08-22 18:34:29 +03:00
|
|
|
#ifdef GEKKO
|
|
|
|
SETTING_BOOL("video_vfilter", &settings->bools.video_vfilter, true, DEFAULT_VIDEO_VFILTER, false);
|
|
|
|
#endif
|
|
|
|
SETTING_BOOL("video_font_enable", &settings->bools.video_font_enable, true, DEFAULT_FONT_ENABLE, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
SETTING_BOOL("video_force_srgb_disable", &settings->bools.video_force_srgb_disable, true, false, false);
|
|
|
|
SETTING_BOOL("video_fullscreen", &settings->bools.video_fullscreen, true, DEFAULT_FULLSCREEN, false);
|
2021-09-03 06:15:25 +02:00
|
|
|
SETTING_BOOL("video_hdr_enable", &settings->bools.video_hdr_enable, true, DEFAULT_VIDEO_HDR_ENABLE, false);
|
|
|
|
SETTING_BOOL("video_hdr_expand_gamut", &settings->bools.video_hdr_expand_gamut, true, DEFAULT_VIDEO_HDR_EXPAND_GAMUT, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
SETTING_BOOL("video_vsync", &settings->bools.video_vsync, true, DEFAULT_VSYNC, false);
|
|
|
|
SETTING_BOOL("video_adaptive_vsync", &settings->bools.video_adaptive_vsync, true, DEFAULT_ADAPTIVE_VSYNC, false);
|
|
|
|
SETTING_BOOL("video_hard_sync", &settings->bools.video_hard_sync, true, DEFAULT_HARD_SYNC, false);
|
2022-06-19 22:25:37 +03:00
|
|
|
SETTING_BOOL("video_waitable_swapchains", &settings->bools.video_waitable_swapchains, true, DEFAULT_WAITABLE_SWAPCHAINS, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
SETTING_BOOL("video_disable_composition", &settings->bools.video_disable_composition, true, DEFAULT_DISABLE_COMPOSITION, false);
|
|
|
|
SETTING_BOOL("video_gpu_screenshot", &settings->bools.video_gpu_screenshot, true, DEFAULT_GPU_SCREENSHOT, false);
|
|
|
|
SETTING_BOOL("video_post_filter_record", &settings->bools.video_post_filter_record, true, DEFAULT_POST_FILTER_RECORD, false);
|
2020-08-27 20:41:30 -03:00
|
|
|
SETTING_BOOL("video_notch_write_over_enable", &settings->bools.video_notch_write_over_enable, true, DEFAULT_NOTCH_WRITE_OVER_ENABLE, false);
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_BOOL("video_msg_bgcolor_enable", &settings->bools.video_msg_bgcolor_enable, true, DEFAULT_MESSAGE_BGCOLOR_ENABLE, false);
|
|
|
|
SETTING_BOOL("video_window_show_decorations", &settings->bools.video_window_show_decorations, true, DEFAULT_WINDOW_DECORATIONS, false);
|
|
|
|
SETTING_BOOL("video_window_save_positions", &settings->bools.video_window_save_positions, true, DEFAULT_WINDOW_SAVE_POSITIONS, false);
|
|
|
|
SETTING_BOOL("video_window_custom_size_enable", &settings->bools.video_window_custom_size_enable, true, DEFAULT_WINDOW_CUSTOM_SIZE_ENABLE, false);
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
SETTING_BOOL("menu_enable_widgets", &settings->bools.menu_enable_widgets, true, DEFAULT_MENU_ENABLE_WIDGETS, false);
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_BOOL("menu_widget_scale_auto", &settings->bools.menu_widget_scale_auto, true, DEFAULT_MENU_WIDGET_SCALE_AUTO, false);
|
2020-07-09 13:03:55 +01:00
|
|
|
SETTING_BOOL("menu_show_load_content_animation", &settings->bools.menu_show_load_content_animation, true, DEFAULT_MENU_SHOW_LOAD_CONTENT_ANIMATION, false);
|
2022-12-25 19:17:16 +02:00
|
|
|
SETTING_BOOL("notification_show_autoconfig", &settings->bools.notification_show_autoconfig, true, DEFAULT_NOTIFICATION_SHOW_AUTOCONFIG, false);
|
2020-07-17 03:32:22 +02:00
|
|
|
SETTING_BOOL("notification_show_cheats_applied", &settings->bools.notification_show_cheats_applied, true, DEFAULT_NOTIFICATION_SHOW_CHEATS_APPLIED, false);
|
2021-04-17 09:13:35 +02:00
|
|
|
SETTING_BOOL("notification_show_patch_applied", &settings->bools.notification_show_patch_applied, true, DEFAULT_NOTIFICATION_SHOW_PATCH_APPLIED, false);
|
2022-12-25 19:17:16 +02:00
|
|
|
SETTING_BOOL("notification_show_remap_load", &settings->bools.notification_show_remap_load, true, DEFAULT_NOTIFICATION_SHOW_REMAP_LOAD, false);
|
2020-07-16 16:30:38 +01:00
|
|
|
SETTING_BOOL("notification_show_config_override_load", &settings->bools.notification_show_config_override_load, true, DEFAULT_NOTIFICATION_SHOW_CONFIG_OVERRIDE_LOAD, false);
|
2020-07-17 12:50:28 +01:00
|
|
|
SETTING_BOOL("notification_show_set_initial_disk", &settings->bools.notification_show_set_initial_disk, true, DEFAULT_NOTIFICATION_SHOW_SET_INITIAL_DISK, false);
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_BOOL("notification_show_save_state", &settings->bools.notification_show_save_state, true, DEFAULT_NOTIFICATION_SHOW_SAVE_STATE, false);
|
2020-07-16 16:30:38 +01:00
|
|
|
SETTING_BOOL("notification_show_fast_forward", &settings->bools.notification_show_fast_forward, true, DEFAULT_NOTIFICATION_SHOW_FAST_FORWARD, false);
|
2020-07-20 00:50:40 +02:00
|
|
|
#ifdef HAVE_SCREENSHOTS
|
2022-12-25 19:17:16 +02:00
|
|
|
SETTING_BOOL("notification_show_screenshot", &settings->bools.notification_show_screenshot, true, DEFAULT_NOTIFICATION_SHOW_SCREENSHOT, false);
|
2020-07-20 00:50:40 +02:00
|
|
|
#endif
|
2021-01-08 17:32:33 +01:00
|
|
|
SETTING_BOOL("notification_show_refresh_rate", &settings->bools.notification_show_refresh_rate, true, DEFAULT_NOTIFICATION_SHOW_REFRESH_RATE, false);
|
2021-11-05 18:52:56 +01:00
|
|
|
#ifdef HAVE_NETWORKING
|
|
|
|
SETTING_BOOL("notification_show_netplay_extra", &settings->bools.notification_show_netplay_extra, true, DEFAULT_NOTIFICATION_SHOW_NETPLAY_EXTRA, false);
|
2021-12-16 15:38:43 +02:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_MENU
|
|
|
|
SETTING_BOOL("notification_show_when_menu_is_alive", &settings->bools.notification_show_when_menu_is_alive, true, DEFAULT_NOTIFICATION_SHOW_WHEN_MENU_IS_ALIVE, false);
|
2021-11-05 18:52:56 +01:00
|
|
|
#endif
|
2023-09-03 17:37:00 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
#ifdef HAVE_MENU
|
|
|
|
SETTING_BOOL("menu_unified_controls", &settings->bools.menu_unified_controls, true, false, false);
|
2022-09-12 17:17:24 -04:00
|
|
|
SETTING_BOOL("menu_disable_info_button", &settings->bools.menu_disable_info_button, true, false, false);
|
|
|
|
SETTING_BOOL("menu_disable_search_button", &settings->bools.menu_disable_search_button, true, false, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
SETTING_BOOL("menu_linear_filter", &settings->bools.menu_linear_filter, true, DEFAULT_VIDEO_SMOOTH, false);
|
|
|
|
SETTING_BOOL("menu_horizontal_animation", &settings->bools.menu_horizontal_animation, true, DEFAULT_MENU_HORIZONTAL_ANIMATION, false);
|
|
|
|
SETTING_BOOL("menu_pause_libretro", &settings->bools.menu_pause_libretro, true, true, false);
|
2022-12-25 19:17:16 +02:00
|
|
|
SETTING_BOOL("menu_savestate_resume", &settings->bools.menu_savestate_resume, true, DEFAULT_MENU_SAVESTATE_RESUME, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
SETTING_BOOL("menu_insert_disk_resume", &settings->bools.menu_insert_disk_resume, true, DEFAULT_MENU_INSERT_DISK_RESUME, false);
|
|
|
|
SETTING_BOOL("menu_mouse_enable", &settings->bools.menu_mouse_enable, true, DEFAULT_MOUSE_ENABLE, false);
|
|
|
|
SETTING_BOOL("menu_pointer_enable", &settings->bools.menu_pointer_enable, true, DEFAULT_POINTER_ENABLE, false);
|
2021-07-14 15:27:07 +01:00
|
|
|
SETTING_BOOL("menu_timedate_enable", &settings->bools.menu_timedate_enable, true, DEFAULT_MENU_TIMEDATE_ENABLE, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
SETTING_BOOL("menu_battery_level_enable", &settings->bools.menu_battery_level_enable, true, true, false);
|
|
|
|
SETTING_BOOL("menu_core_enable", &settings->bools.menu_core_enable, true, true, false);
|
2022-12-25 19:17:16 +02:00
|
|
|
SETTING_BOOL("menu_show_sublabels", &settings->bools.menu_show_sublabels, true, DEFAULT_MENU_SHOW_SUBLABELS, false);
|
|
|
|
SETTING_BOOL("menu_dynamic_wallpaper_enable", &settings->bools.menu_dynamic_wallpaper_enable, true, DEFAULT_MENU_DYNAMIC_WALLPAPER_ENABLE, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
SETTING_BOOL("menu_ticker_smooth", &settings->bools.menu_ticker_smooth, true, DEFAULT_MENU_TICKER_SMOOTH, false);
|
2022-12-25 19:17:16 +02:00
|
|
|
SETTING_BOOL("menu_scroll_fast", &settings->bools.menu_scroll_fast, true, DEFAULT_MENU_SCROLL_FAST, false);
|
2020-10-16 01:54:11 +03:00
|
|
|
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_BOOL("settings_show_drivers", &settings->bools.settings_show_drivers, true, DEFAULT_SETTINGS_SHOW_DRIVERS, false);
|
|
|
|
SETTING_BOOL("settings_show_video", &settings->bools.settings_show_video, true, DEFAULT_SETTINGS_SHOW_VIDEO, false);
|
|
|
|
SETTING_BOOL("settings_show_audio", &settings->bools.settings_show_audio, true, DEFAULT_SETTINGS_SHOW_AUDIO, false);
|
|
|
|
SETTING_BOOL("settings_show_input", &settings->bools.settings_show_input, true, DEFAULT_SETTINGS_SHOW_INPUT, false);
|
|
|
|
SETTING_BOOL("settings_show_latency", &settings->bools.settings_show_latency, true, DEFAULT_SETTINGS_SHOW_LATENCY, false);
|
|
|
|
SETTING_BOOL("settings_show_core", &settings->bools.settings_show_core, true, DEFAULT_SETTINGS_SHOW_CORE, false);
|
|
|
|
SETTING_BOOL("settings_show_configuration", &settings->bools.settings_show_configuration, true, DEFAULT_SETTINGS_SHOW_CONFIGURATION, false);
|
|
|
|
SETTING_BOOL("settings_show_saving", &settings->bools.settings_show_saving, true, DEFAULT_SETTINGS_SHOW_SAVING, false);
|
|
|
|
SETTING_BOOL("settings_show_logging", &settings->bools.settings_show_logging, true, DEFAULT_SETTINGS_SHOW_LOGGING, false);
|
|
|
|
SETTING_BOOL("settings_show_file_browser", &settings->bools.settings_show_file_browser, true, DEFAULT_SETTINGS_SHOW_FILE_BROWSER, false);
|
|
|
|
SETTING_BOOL("settings_show_frame_throttle", &settings->bools.settings_show_frame_throttle, true, DEFAULT_SETTINGS_SHOW_FRAME_THROTTLE, false);
|
|
|
|
SETTING_BOOL("settings_show_recording", &settings->bools.settings_show_recording, true, DEFAULT_SETTINGS_SHOW_RECORDING, false);
|
|
|
|
SETTING_BOOL("settings_show_onscreen_display",&settings->bools.settings_show_onscreen_display, true, DEFAULT_SETTINGS_SHOW_ONSCREEN_DISPLAY, false);
|
|
|
|
SETTING_BOOL("settings_show_user_interface", &settings->bools.settings_show_user_interface, true, DEFAULT_SETTINGS_SHOW_USER_INTERFACE, false);
|
|
|
|
SETTING_BOOL("settings_show_ai_service", &settings->bools.settings_show_ai_service, true, DEFAULT_SETTINGS_SHOW_AI_SERVICE, false);
|
|
|
|
SETTING_BOOL("settings_show_accessibility", &settings->bools.settings_show_accessibility, true, DEFAULT_SETTINGS_SHOW_ACCESSIBILITY, false);
|
|
|
|
SETTING_BOOL("settings_show_power_management",&settings->bools.settings_show_power_management, true, DEFAULT_SETTINGS_SHOW_POWER_MANAGEMENT, false);
|
|
|
|
SETTING_BOOL("settings_show_achievements", &settings->bools.settings_show_achievements, true, DEFAULT_SETTINGS_SHOW_ACHIEVEMENTS, false);
|
|
|
|
SETTING_BOOL("settings_show_network", &settings->bools.settings_show_network, true, DEFAULT_SETTINGS_SHOW_NETWORK, false);
|
|
|
|
SETTING_BOOL("settings_show_playlists", &settings->bools.settings_show_playlists, true, DEFAULT_SETTINGS_SHOW_PLAYLISTS, false);
|
|
|
|
SETTING_BOOL("settings_show_user", &settings->bools.settings_show_user, true, DEFAULT_SETTINGS_SHOW_USER, false);
|
|
|
|
SETTING_BOOL("settings_show_directory", &settings->bools.settings_show_directory, true, DEFAULT_SETTINGS_SHOW_DIRECTORY, false);
|
2022-04-02 09:07:40 +02:00
|
|
|
#ifdef HAVE_MIST
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_BOOL("settings_show_steam", &settings->bools.settings_show_steam, true, DEFAULT_SETTINGS_SHOW_STEAM, false);
|
2022-04-02 09:07:40 +02:00
|
|
|
#endif
|
2020-10-16 01:54:11 +03:00
|
|
|
|
|
|
|
SETTING_BOOL("quick_menu_show_resume_content", &settings->bools.quick_menu_show_resume_content, true, DEFAULT_QUICK_MENU_SHOW_RESUME_CONTENT, false);
|
|
|
|
SETTING_BOOL("quick_menu_show_restart_content", &settings->bools.quick_menu_show_restart_content, true, DEFAULT_QUICK_MENU_SHOW_RESTART_CONTENT, false);
|
|
|
|
SETTING_BOOL("quick_menu_show_close_content", &settings->bools.quick_menu_show_close_content, true, DEFAULT_QUICK_MENU_SHOW_CLOSE_CONTENT, false);
|
2022-04-06 01:58:48 +03:00
|
|
|
SETTING_BOOL("quick_menu_show_savestate_submenu", &settings->bools.quick_menu_show_savestate_submenu, true, DEFAULT_QUICK_MENU_SHOW_SAVESTATE_SUBMENU, false);
|
2020-10-16 01:54:11 +03:00
|
|
|
SETTING_BOOL("quick_menu_show_save_load_state", &settings->bools.quick_menu_show_save_load_state, true, DEFAULT_QUICK_MENU_SHOW_SAVE_LOAD_STATE, false);
|
2023-05-29 21:36:30 +03:00
|
|
|
SETTING_BOOL("quick_menu_show_replay", &settings->bools.quick_menu_show_replay, true, DEFAULT_QUICK_MENU_SHOW_REPLAY, false);
|
2020-10-16 01:54:11 +03:00
|
|
|
SETTING_BOOL("quick_menu_show_take_screenshot", &settings->bools.quick_menu_show_take_screenshot, true, DEFAULT_QUICK_MENU_SHOW_TAKE_SCREENSHOT, false);
|
|
|
|
SETTING_BOOL("quick_menu_show_undo_save_load_state", &settings->bools.quick_menu_show_undo_save_load_state, true, DEFAULT_QUICK_MENU_SHOW_UNDO_SAVE_LOAD_STATE, false);
|
2022-11-27 22:01:53 +02:00
|
|
|
SETTING_BOOL("quick_menu_show_add_to_favorites", &settings->bools.quick_menu_show_add_to_favorites, true, DEFAULT_QUICK_MENU_SHOW_ADD_TO_FAVORITES, false);
|
|
|
|
SETTING_BOOL("quick_menu_show_start_recording", &settings->bools.quick_menu_show_start_recording, true, DEFAULT_QUICK_MENU_SHOW_START_RECORDING, false);
|
|
|
|
SETTING_BOOL("quick_menu_show_start_streaming", &settings->bools.quick_menu_show_start_streaming, true, DEFAULT_QUICK_MENU_SHOW_START_STREAMING, false);
|
|
|
|
SETTING_BOOL("quick_menu_show_set_core_association", &settings->bools.quick_menu_show_set_core_association, true, DEFAULT_QUICK_MENU_SHOW_SET_CORE_ASSOCIATION, false);
|
|
|
|
SETTING_BOOL("quick_menu_show_reset_core_association", &settings->bools.quick_menu_show_reset_core_association, true, DEFAULT_QUICK_MENU_SHOW_RESET_CORE_ASSOCIATION, false);
|
|
|
|
SETTING_BOOL("quick_menu_show_options", &settings->bools.quick_menu_show_options, true, DEFAULT_QUICK_MENU_SHOW_CORE_OPTIONS, false);
|
2021-08-26 11:41:28 +01:00
|
|
|
SETTING_BOOL("quick_menu_show_core_options_flush", &settings->bools.quick_menu_show_core_options_flush, true, DEFAULT_QUICK_MENU_SHOW_CORE_OPTIONS_FLUSH, false);
|
2022-11-27 22:01:53 +02:00
|
|
|
SETTING_BOOL("quick_menu_show_controls", &settings->bools.quick_menu_show_controls, true, DEFAULT_QUICK_MENU_SHOW_CONTROLS, false);
|
|
|
|
SETTING_BOOL("quick_menu_show_cheats", &settings->bools.quick_menu_show_cheats, true, DEFAULT_QUICK_MENU_SHOW_CHEATS, false);
|
|
|
|
SETTING_BOOL("quick_menu_show_shaders", &settings->bools.quick_menu_show_shaders, true, DEFAULT_QUICK_MENU_SHOW_SHADERS, false);
|
|
|
|
SETTING_BOOL("quick_menu_show_save_core_overrides", &settings->bools.quick_menu_show_save_core_overrides, true, DEFAULT_QUICK_MENU_SHOW_SAVE_CORE_OVERRIDES, false);
|
|
|
|
SETTING_BOOL("quick_menu_show_save_content_dir_overrides", &settings->bools.quick_menu_show_save_content_dir_overrides, true, DEFAULT_QUICK_MENU_SHOW_SAVE_CONTENT_DIR_OVERRIDES, false);
|
2023-05-29 21:36:30 +03:00
|
|
|
SETTING_BOOL("quick_menu_show_save_game_overrides", &settings->bools.quick_menu_show_save_game_overrides, true, DEFAULT_QUICK_MENU_SHOW_SAVE_GAME_OVERRIDES, false);
|
2022-11-27 22:01:53 +02:00
|
|
|
SETTING_BOOL("quick_menu_show_information", &settings->bools.quick_menu_show_information, true, DEFAULT_QUICK_MENU_SHOW_INFORMATION, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
#ifdef HAVE_NETWORKING
|
2022-11-27 22:01:53 +02:00
|
|
|
SETTING_BOOL("quick_menu_show_download_thumbnails", &settings->bools.quick_menu_show_download_thumbnails, true, DEFAULT_QUICK_MENU_SHOW_DOWNLOAD_THUMBNAILS, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
#endif
|
2023-08-22 18:34:29 +03:00
|
|
|
|
2022-11-27 22:01:53 +02:00
|
|
|
SETTING_BOOL("content_show_settings", &settings->bools.menu_content_show_settings, true, DEFAULT_CONTENT_SHOW_SETTINGS, false);
|
|
|
|
SETTING_BOOL("content_show_favorites", &settings->bools.menu_content_show_favorites, true, DEFAULT_CONTENT_SHOW_FAVORITES, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
#ifdef HAVE_IMAGEVIEWER
|
2022-11-27 22:01:53 +02:00
|
|
|
SETTING_BOOL("content_show_images", &settings->bools.menu_content_show_images, true, DEFAULT_CONTENT_SHOW_IMAGES, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
#endif
|
2022-11-27 22:01:53 +02:00
|
|
|
SETTING_BOOL("content_show_music", &settings->bools.menu_content_show_music, true, DEFAULT_CONTENT_SHOW_MUSIC, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
#if defined(HAVE_FFMPEG) || defined(HAVE_MPV)
|
2022-11-27 22:01:53 +02:00
|
|
|
SETTING_BOOL("content_show_video", &settings->bools.menu_content_show_video, true, DEFAULT_CONTENT_SHOW_VIDEO, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_NETWORKING
|
2022-11-27 22:01:53 +02:00
|
|
|
SETTING_BOOL("content_show_netplay", &settings->bools.menu_content_show_netplay, true, DEFAULT_CONTENT_SHOW_NETPLAY, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
#endif
|
2022-11-27 22:01:53 +02:00
|
|
|
SETTING_BOOL("content_show_history", &settings->bools.menu_content_show_history, true, DEFAULT_CONTENT_SHOW_HISTORY, false);
|
2020-08-05 14:21:06 +01:00
|
|
|
SETTING_BOOL("content_show_add", &settings->bools.menu_content_show_add, true, DEFAULT_MENU_CONTENT_SHOW_ADD, false);
|
2022-11-27 22:01:53 +02:00
|
|
|
SETTING_BOOL("content_show_playlists", &settings->bools.menu_content_show_playlists, true, DEFAULT_CONTENT_SHOW_PLAYLISTS, false);
|
2021-07-30 14:17:03 +02:00
|
|
|
#if defined(HAVE_LIBRETRODB)
|
|
|
|
SETTING_BOOL("content_show_explore", &settings->bools.menu_content_show_explore, true, DEFAULT_MENU_CONTENT_SHOW_EXPLORE, false);
|
2020-07-29 12:59:55 +01:00
|
|
|
#endif
|
2022-11-27 22:01:53 +02:00
|
|
|
SETTING_BOOL("menu_show_load_core", &settings->bools.menu_show_load_core, true, DEFAULT_MENU_SHOW_LOAD_CORE, false);
|
|
|
|
SETTING_BOOL("menu_show_load_content", &settings->bools.menu_show_load_content, true, DEFAULT_MENU_SHOW_LOAD_CONTENT, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
#ifdef HAVE_CDROM
|
2022-11-27 22:01:53 +02:00
|
|
|
SETTING_BOOL("menu_show_load_disc", &settings->bools.menu_show_load_disc, true, DEFAULT_MENU_SHOW_LOAD_DISC, false);
|
|
|
|
SETTING_BOOL("menu_show_dump_disc", &settings->bools.menu_show_dump_disc, true, DEFAULT_MENU_SHOW_DUMP_DISC, false);
|
2021-11-17 21:33:23 +01:00
|
|
|
#ifdef HAVE_LAKKA
|
2022-11-27 22:01:53 +02:00
|
|
|
SETTING_BOOL("menu_show_eject_disc", &settings->bools.menu_show_eject_disc, true, DEFAULT_MENU_SHOW_EJECT_DISC, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
#endif
|
2023-08-22 18:34:29 +03:00
|
|
|
#endif /* HAVE_CDROM */
|
2022-11-27 22:01:53 +02:00
|
|
|
SETTING_BOOL("menu_show_information", &settings->bools.menu_show_information, true, DEFAULT_MENU_SHOW_INFORMATION, false);
|
|
|
|
SETTING_BOOL("menu_show_configurations", &settings->bools.menu_show_configurations, true, DEFAULT_MENU_SHOW_CONFIGURATIONS, false);
|
|
|
|
|
|
|
|
/* Actually Quick Menu items, but too late to change without breaking old confs */
|
|
|
|
SETTING_BOOL("menu_show_latency", &settings->bools.menu_show_latency, true, DEFAULT_QUICK_MENU_SHOW_LATENCY, false);
|
|
|
|
SETTING_BOOL("menu_show_rewind", &settings->bools.menu_show_rewind, true, DEFAULT_QUICK_MENU_SHOW_REWIND, false);
|
|
|
|
SETTING_BOOL("menu_show_overlays", &settings->bools.menu_show_overlays, true, DEFAULT_QUICK_MENU_SHOW_OVERLAYS, false);
|
|
|
|
|
|
|
|
SETTING_BOOL("menu_show_help", &settings->bools.menu_show_help, true, DEFAULT_MENU_SHOW_HELP, false);
|
|
|
|
SETTING_BOOL("menu_show_quit_retroarch", &settings->bools.menu_show_quit_retroarch, true, DEFAULT_MENU_SHOW_QUIT, false);
|
|
|
|
SETTING_BOOL("menu_show_restart_retroarch", &settings->bools.menu_show_restart_retroarch, true, DEFAULT_MENU_SHOW_RESTART, false);
|
|
|
|
SETTING_BOOL("menu_show_reboot", &settings->bools.menu_show_reboot, true, DEFAULT_MENU_SHOW_REBOOT, false);
|
|
|
|
SETTING_BOOL("menu_show_shutdown", &settings->bools.menu_show_shutdown, true, DEFAULT_MENU_SHOW_SHUTDOWN, false);
|
|
|
|
SETTING_BOOL("menu_show_online_updater", &settings->bools.menu_show_online_updater, true, DEFAULT_MENU_SHOW_ONLINE_UPDATER, false);
|
|
|
|
SETTING_BOOL("menu_show_core_updater", &settings->bools.menu_show_core_updater, true, DEFAULT_MENU_SHOW_CORE_UPDATER, false);
|
2024-01-09 09:17:47 +01:00
|
|
|
#if 0
|
|
|
|
/* Thumbnailpack removal */
|
2022-11-27 22:01:53 +02:00
|
|
|
SETTING_BOOL("menu_show_legacy_thumbnail_updater", &settings->bools.menu_show_legacy_thumbnail_updater, true, DEFAULT_MENU_SHOW_LEGACY_THUMBNAIL_UPDATER, false);
|
2024-01-09 09:17:47 +01:00
|
|
|
#endif
|
2022-03-09 15:05:07 +01:00
|
|
|
#ifdef HAVE_MIST
|
2022-11-27 22:01:53 +02:00
|
|
|
SETTING_BOOL("menu_show_core_manager_steam", &settings->bools.menu_show_core_manager_steam, true, DEFAULT_MENU_SHOW_CORE_MANAGER_STEAM, false);
|
2022-03-09 15:05:07 +01:00
|
|
|
#endif
|
2020-07-16 01:07:14 +01:00
|
|
|
SETTING_BOOL("filter_by_current_core", &settings->bools.filter_by_current_core, true, DEFAULT_FILTER_BY_CURRENT_CORE, false);
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_BOOL("menu_use_preferred_system_color_theme", &settings->bools.menu_use_preferred_system_color_theme, true, DEFAULT_MENU_USE_PREFERRED_SYSTEM_COLOR_THEME, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
SETTING_BOOL("menu_navigation_wraparound_enable", &settings->bools.menu_navigation_wraparound_enable, true, true, false);
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_BOOL("menu_navigation_browser_filter_supported_extensions_enable", &settings->bools.menu_navigation_browser_filter_supported_extensions_enable, true, true, false);
|
2022-12-25 19:17:16 +02:00
|
|
|
SETTING_BOOL("menu_show_advanced_settings", &settings->bools.menu_show_advanced_settings, true, DEFAULT_SHOW_ADVANCED_SETTINGS, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
#ifdef HAVE_MATERIALUI
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_BOOL("materialui_icons_enable", &settings->bools.menu_materialui_icons_enable, true, DEFAULT_MATERIALUI_ICONS_ENABLE, false);
|
|
|
|
SETTING_BOOL("materialui_switch_icons", &settings->bools.menu_materialui_switch_icons, true, DEFAULT_MATERIALUI_SWITCH_ICONS, false);
|
|
|
|
SETTING_BOOL("materialui_playlist_icons_enable", &settings->bools.menu_materialui_playlist_icons_enable, true, DEFAULT_MATERIALUI_PLAYLIST_ICONS_ENABLE, false);
|
|
|
|
SETTING_BOOL("materialui_show_nav_bar", &settings->bools.menu_materialui_show_nav_bar, true, DEFAULT_MATERIALUI_SHOW_NAV_BAR, false);
|
|
|
|
SETTING_BOOL("materialui_auto_rotate_nav_bar", &settings->bools.menu_materialui_auto_rotate_nav_bar, true, DEFAULT_MATERIALUI_AUTO_ROTATE_NAV_BAR, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
SETTING_BOOL("materialui_dual_thumbnail_list_view_enable", &settings->bools.menu_materialui_dual_thumbnail_list_view_enable, true, DEFAULT_MATERIALUI_DUAL_THUMBNAIL_LIST_VIEW_ENABLE, false);
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_BOOL("materialui_thumbnail_background_enable", &settings->bools.menu_materialui_thumbnail_background_enable, true, DEFAULT_MATERIALUI_THUMBNAIL_BACKGROUND_ENABLE, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_RGUI
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_BOOL("rgui_show_start_screen", &settings->bools.menu_show_start_screen, false, false /* TODO */, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
SETTING_BOOL("rgui_background_filler_thickness_enable", &settings->bools.menu_rgui_background_filler_thickness_enable, true, true, false);
|
|
|
|
SETTING_BOOL("rgui_border_filler_thickness_enable", &settings->bools.menu_rgui_border_filler_thickness_enable, true, true, false);
|
|
|
|
SETTING_BOOL("rgui_border_filler_enable", &settings->bools.menu_rgui_border_filler_enable, true, true, false);
|
2021-04-15 12:31:33 +01:00
|
|
|
SETTING_BOOL("menu_rgui_transparency", &settings->bools.menu_rgui_transparency, true, DEFAULT_RGUI_TRANSPARENCY, false);
|
2022-10-18 12:13:47 +02:00
|
|
|
SETTING_BOOL("menu_rgui_shadows", &settings->bools.menu_rgui_shadows, true, DEFAULT_RGUI_SHADOWS, false);
|
2022-11-27 22:15:59 +01:00
|
|
|
SETTING_BOOL("menu_rgui_full_width_layout", &settings->bools.menu_rgui_full_width_layout, true, DEFAULT_RGUI_FULL_WIDTH_LAYOUT, false);
|
2022-12-25 19:17:16 +02:00
|
|
|
SETTING_BOOL("rgui_inline_thumbnails", &settings->bools.menu_rgui_inline_thumbnails, true, DEFAULT_RGUI_INLINE_THUMBNAILS, false);
|
|
|
|
SETTING_BOOL("rgui_swap_thumbnails", &settings->bools.menu_rgui_swap_thumbnails, true, DEFAULT_RGUI_SWAP_THUMBNAILS, false);
|
2022-10-18 12:13:47 +02:00
|
|
|
SETTING_BOOL("rgui_extended_ascii", &settings->bools.menu_rgui_extended_ascii, true, DEFAULT_RGUI_EXTENDED_ASCII, false);
|
2020-07-27 14:43:54 +01:00
|
|
|
SETTING_BOOL("rgui_switch_icons", &settings->bools.menu_rgui_switch_icons, true, DEFAULT_RGUI_SWITCH_ICONS, false);
|
2021-04-01 17:25:45 +01:00
|
|
|
SETTING_BOOL("rgui_particle_effect_screensaver", &settings->bools.menu_rgui_particle_effect_screensaver, true, DEFAULT_RGUI_PARTICLE_EFFECT_SCREENSAVER, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_XMB
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_BOOL("xmb_shadows_enable", &settings->bools.menu_xmb_shadows_enable, true, DEFAULT_XMB_SHADOWS_ENABLE, false);
|
|
|
|
SETTING_BOOL("xmb_switch_icons", &settings->bools.menu_xmb_switch_icons, true, DEFAULT_XMB_SWITCH_ICONS, false);
|
|
|
|
SETTING_BOOL("xmb_vertical_thumbnails", &settings->bools.menu_xmb_vertical_thumbnails, true, DEFAULT_XMB_VERTICAL_THUMBNAILS, false);
|
|
|
|
SETTING_BOOL("menu_xmb_show_title_header", &settings->bools.menu_xmb_show_title_header, true, DEFAULT_XMB_SHOW_TITLE_HEADER, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
#endif
|
2023-08-22 18:34:29 +03:00
|
|
|
#ifdef HAVE_OZONE
|
|
|
|
SETTING_BOOL("ozone_collapse_sidebar", &settings->bools.ozone_collapse_sidebar, true, DEFAULT_OZONE_COLLAPSE_SIDEBAR, false);
|
|
|
|
SETTING_BOOL("ozone_scroll_content_metadata", &settings->bools.ozone_scroll_content_metadata, true, DEFAULT_OZONE_SCROLL_CONTENT_METADATA, false);
|
|
|
|
#endif
|
|
|
|
#if defined(HAVE_OZONE) || defined(HAVE_XMB)
|
|
|
|
SETTING_BOOL("ozone_truncate_playlist_name", &settings->bools.ozone_truncate_playlist_name, true, DEFAULT_OZONE_TRUNCATE_PLAYLIST_NAME, false);
|
|
|
|
SETTING_BOOL("ozone_sort_after_truncate_playlist_name", &settings->bools.ozone_sort_after_truncate_playlist_name, true, DEFAULT_OZONE_SORT_AFTER_TRUNCATE_PLAYLIST_NAME, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
#endif
|
2023-08-22 18:34:29 +03:00
|
|
|
#endif /* HAVE_MENU */
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
#ifdef HAVE_CHEEVOS
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_BOOL("cheevos_enable", &settings->bools.cheevos_enable, true, DEFAULT_CHEEVOS_ENABLE, false);
|
|
|
|
SETTING_BOOL("cheevos_test_unofficial", &settings->bools.cheevos_test_unofficial, true, false, false);
|
|
|
|
SETTING_BOOL("cheevos_hardcore_mode_enable", &settings->bools.cheevos_hardcore_mode_enable, true, true, false);
|
|
|
|
SETTING_BOOL("cheevos_challenge_indicators", &settings->bools.cheevos_challenge_indicators, true, true, false);
|
|
|
|
SETTING_BOOL("cheevos_richpresence_enable", &settings->bools.cheevos_richpresence_enable, true, true, false);
|
|
|
|
SETTING_BOOL("cheevos_unlock_sound_enable", &settings->bools.cheevos_unlock_sound_enable, true, false, false);
|
|
|
|
SETTING_BOOL("cheevos_verbose_enable", &settings->bools.cheevos_verbose_enable, true, true, false);
|
|
|
|
SETTING_BOOL("cheevos_auto_screenshot", &settings->bools.cheevos_auto_screenshot, true, false, false);
|
|
|
|
SETTING_BOOL("cheevos_badges_enable", &settings->bools.cheevos_badges_enable, true, false, false);
|
|
|
|
SETTING_BOOL("cheevos_start_active", &settings->bools.cheevos_start_active, true, false, false);
|
2022-12-30 15:55:38 +00:00
|
|
|
SETTING_BOOL("cheevos_appearance_padding_auto", &settings->bools.cheevos_appearance_padding_auto, true, DEFAULT_CHEEVOS_APPEARANCE_PADDING_AUTO, false);
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_BOOL("cheevos_visibility_unlock", &settings->bools.cheevos_visibility_unlock, true, DEFAULT_CHEEVOS_VISIBILITY_UNLOCK, false);
|
|
|
|
SETTING_BOOL("cheevos_visibility_mastery", &settings->bools.cheevos_visibility_mastery, true, DEFAULT_CHEEVOS_VISIBILITY_MASTERY, false);
|
|
|
|
SETTING_BOOL("cheevos_visibility_account", &settings->bools.cheevos_visibility_account, true, DEFAULT_CHEEVOS_VISIBILITY_ACCOUNT, false);
|
2023-04-16 11:44:46 -06:00
|
|
|
SETTING_BOOL("cheevos_visibility_lboard_start", &settings->bools.cheevos_visibility_lboard_start, true, DEFAULT_CHEEVOS_VISIBILITY_LBOARD_START, false);
|
|
|
|
SETTING_BOOL("cheevos_visibility_lboard_submit", &settings->bools.cheevos_visibility_lboard_submit, true, DEFAULT_CHEEVOS_VISIBILITY_LBOARD_SUBMIT, false);
|
|
|
|
SETTING_BOOL("cheevos_visibility_lboard_cancel", &settings->bools.cheevos_visibility_lboard_cancel, true, DEFAULT_CHEEVOS_VISIBILITY_LBOARD_CANCEL, false);
|
|
|
|
SETTING_BOOL("cheevos_visibility_lboard_trackers", &settings->bools.cheevos_visibility_lboard_trackers, true, DEFAULT_CHEEVOS_VISIBILITY_LBOARD_TRACKERS, false);
|
2023-05-14 13:42:01 -06:00
|
|
|
SETTING_BOOL("cheevos_visibility_progress_tracker", &settings->bools.cheevos_visibility_progress_tracker, true, DEFAULT_CHEEVOS_VISIBILITY_PROGRESS_TRACKER, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_OVERLAY
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_BOOL("input_overlay_enable", &settings->bools.input_overlay_enable, true, config_overlay_enable_default(), false);
|
2020-07-16 01:07:14 +01:00
|
|
|
SETTING_BOOL("input_overlay_enable_autopreferred", &settings->bools.input_overlay_enable_autopreferred, true, DEFAULT_OVERLAY_ENABLE_AUTOPREFERRED, false);
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_BOOL("input_overlay_behind_menu", &settings->bools.input_overlay_behind_menu, true, DEFAULT_OVERLAY_BEHIND_MENU, false);
|
|
|
|
SETTING_BOOL("input_overlay_hide_in_menu", &settings->bools.input_overlay_hide_in_menu, true, DEFAULT_OVERLAY_HIDE_IN_MENU, false);
|
2020-08-25 11:10:37 +01:00
|
|
|
SETTING_BOOL("input_overlay_hide_when_gamepad_connected", &settings->bools.input_overlay_hide_when_gamepad_connected, true, DEFAULT_OVERLAY_HIDE_WHEN_GAMEPAD_CONNECTED, false);
|
2022-12-25 19:17:16 +02:00
|
|
|
SETTING_BOOL("input_overlay_show_mouse_cursor", &settings->bools.input_overlay_show_mouse_cursor, true, DEFAULT_OVERLAY_SHOW_MOUSE_CURSOR, false);
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_BOOL("input_overlay_auto_rotate", &settings->bools.input_overlay_auto_rotate, true, DEFAULT_OVERLAY_AUTO_ROTATE, false);
|
|
|
|
SETTING_BOOL("input_overlay_auto_scale", &settings->bools.input_overlay_auto_scale, true, DEFAULT_INPUT_OVERLAY_AUTO_SCALE, false);
|
|
|
|
SETTING_BOOL("input_osk_overlay_auto_scale", &settings->bools.input_osk_overlay_auto_scale, true, DEFAULT_INPUT_OVERLAY_AUTO_SCALE, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
#endif
|
2023-05-28 20:36:38 +02:00
|
|
|
#ifdef UDEV_TOUCH_SUPPORT
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_BOOL("input_touch_vmouse_pointer", &settings->bools.input_touch_vmouse_pointer, true, DEFAULT_INPUT_TOUCH_VMOUSE_POINTER, false);
|
|
|
|
SETTING_BOOL("input_touch_vmouse_mouse", &settings->bools.input_touch_vmouse_mouse, true, DEFAULT_INPUT_TOUCH_VMOUSE_MOUSE, false);
|
|
|
|
SETTING_BOOL("input_touch_vmouse_touchpad", &settings->bools.input_touch_vmouse_touchpad, true, DEFAULT_INPUT_TOUCH_VMOUSE_TOUCHPAD, false);
|
|
|
|
SETTING_BOOL("input_touch_vmouse_trackball", &settings->bools.input_touch_vmouse_trackball, true, DEFAULT_INPUT_TOUCH_VMOUSE_TRACKBALL, false);
|
|
|
|
SETTING_BOOL("input_touch_vmouse_gesture", &settings->bools.input_touch_vmouse_gesture, true, DEFAULT_INPUT_TOUCH_VMOUSE_GESTURE, false);
|
2023-05-28 20:36:38 +02:00
|
|
|
#endif
|
2023-08-22 18:34:29 +03:00
|
|
|
#if defined(VITA)
|
|
|
|
SETTING_BOOL("input_backtouch_enable", &settings->bools.input_backtouch_enable, false, DEFAULT_INPUT_BACKTOUCH_ENABLE, false);
|
|
|
|
SETTING_BOOL("input_backtouch_toggle", &settings->bools.input_backtouch_toggle, false, DEFAULT_INPUT_BACKTOUCH_TOGGLE, false);
|
2020-06-26 18:25:12 +02:00
|
|
|
#endif
|
2023-08-22 18:34:29 +03:00
|
|
|
#if TARGET_OS_IPHONE
|
|
|
|
SETTING_BOOL("small_keyboard_enable", &settings->bools.input_small_keyboard_enable, true, false, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
#endif
|
2023-11-26 22:34:45 -05:00
|
|
|
SETTING_BOOL("keyboard_gamepad_enable", &settings->bools.input_keyboard_gamepad_enable, true, DEFAULT_INPUT_KEYBOARD_GAMEPAD_ENABLE, false);
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_BOOL("input_autodetect_enable", &settings->bools.input_autodetect_enable, true, DEFAULT_INPUT_AUTODETECT_ENABLE, false);
|
2023-12-13 20:36:09 -06:00
|
|
|
SETTING_BOOL("input_allow_turbo_dpad", &settings->bools.input_allow_turbo_dpad, true, DEFAULT_ALLOW_TURBO_DPAD, false);
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_BOOL("input_auto_mouse_grab", &settings->bools.input_auto_mouse_grab, true, false, false);
|
|
|
|
SETTING_BOOL("input_remap_binds_enable", &settings->bools.input_remap_binds_enable, true, true, false);
|
|
|
|
SETTING_BOOL("all_users_control_menu", &settings->bools.input_all_users_control_menu, true, DEFAULT_ALL_USERS_CONTROL_MENU, false);
|
|
|
|
#ifdef HAVE_MENU
|
|
|
|
SETTING_BOOL("menu_swap_ok_cancel_buttons", &settings->bools.input_menu_swap_ok_cancel_buttons, true, DEFAULT_MENU_SWAP_OK_CANCEL_BUTTONS, false);
|
|
|
|
SETTING_BOOL("menu_swap_scroll_buttons", &settings->bools.input_menu_swap_scroll_buttons, true, DEFAULT_MENU_SWAP_SCROLL_BUTTONS, false);
|
2020-12-09 00:03:40 +02:00
|
|
|
#endif
|
2023-08-22 18:34:29 +03:00
|
|
|
#if defined(HAVE_DINPUT) || defined(HAVE_WINRAWINPUT)
|
|
|
|
SETTING_BOOL("input_nowinkey_enable", &settings->bools.input_nowinkey_enable, true, false, false);
|
2020-06-26 18:25:12 +02:00
|
|
|
#endif
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_BOOL("input_sensors_enable", &settings->bools.input_sensors_enable, true, DEFAULT_INPUT_SENSORS_ENABLE, false);
|
|
|
|
SETTING_BOOL("vibrate_on_keypress", &settings->bools.vibrate_on_keypress, true, DEFAULT_VIBRATE_ON_KEYPRESS, false);
|
|
|
|
SETTING_BOOL("enable_device_vibration", &settings->bools.enable_device_vibration, true, DEFAULT_ENABLE_DEVICE_VIBRATION, false);
|
2022-10-18 12:13:47 +02:00
|
|
|
SETTING_BOOL("sustained_performance_mode", &settings->bools.sustained_performance_mode, true, DEFAULT_SUSTAINED_PERFORMANCE_MODE, false);
|
2020-02-02 21:27:38 +01:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
SETTING_BOOL("content_runtime_log", &settings->bools.content_runtime_log, true, DEFAULT_CONTENT_RUNTIME_LOG, false);
|
|
|
|
SETTING_BOOL("content_runtime_log_aggregate", &settings->bools.content_runtime_log_aggregate, true, DEFAULT_CONTENT_RUNTIME_LOG_AGGREGATE, false);
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_BOOL("history_list_enable", &settings->bools.history_list_enable, true, DEFAULT_HISTORY_LIST_ENABLE, false);
|
|
|
|
SETTING_BOOL("playlist_entry_rename", &settings->bools.playlist_entry_rename, true, DEFAULT_PLAYLIST_ENTRY_RENAME, false);
|
|
|
|
SETTING_BOOL("playlist_use_old_format", &settings->bools.playlist_use_old_format, true, DEFAULT_PLAYLIST_USE_OLD_FORMAT, false);
|
|
|
|
SETTING_BOOL("playlist_compression", &settings->bools.playlist_compression, true, DEFAULT_PLAYLIST_COMPRESSION, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
SETTING_BOOL("playlist_show_sublabels", &settings->bools.playlist_show_sublabels, true, DEFAULT_PLAYLIST_SHOW_SUBLABELS, false);
|
2021-05-13 10:52:47 +02:00
|
|
|
SETTING_BOOL("playlist_show_entry_idx", &settings->bools.playlist_show_entry_idx, true, DEFAULT_PLAYLIST_SHOW_ENTRY_IDX, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
SETTING_BOOL("playlist_sort_alphabetical", &settings->bools.playlist_sort_alphabetical, true, DEFAULT_PLAYLIST_SORT_ALPHABETICAL, false);
|
|
|
|
SETTING_BOOL("playlist_fuzzy_archive_match", &settings->bools.playlist_fuzzy_archive_match, true, DEFAULT_PLAYLIST_FUZZY_ARCHIVE_MATCH, false);
|
2020-07-23 20:08:43 +02:00
|
|
|
SETTING_BOOL("playlist_portable_paths", &settings->bools.playlist_portable_paths, true, DEFAULT_PLAYLIST_PORTABLE_PATHS, false);
|
2023-09-26 21:31:59 +09:00
|
|
|
SETTING_BOOL("playlist_use_filename", &settings->bools.playlist_use_filename, true, DEFAULT_PLAYLIST_USE_FILENAME, false);
|
2020-02-02 21:27:38 +01:00
|
|
|
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_BOOL("frame_time_counter_reset_after_fastforwarding", &settings->bools.frame_time_counter_reset_after_fastforwarding, true, false, false);
|
|
|
|
SETTING_BOOL("frame_time_counter_reset_after_load_state", &settings->bools.frame_time_counter_reset_after_load_state, true, false, false);
|
|
|
|
SETTING_BOOL("frame_time_counter_reset_after_save_state", &settings->bools.frame_time_counter_reset_after_save_state, true, false, false);
|
2020-02-02 21:27:38 +01:00
|
|
|
|
2023-08-22 18:34:29 +03:00
|
|
|
#ifdef HAVE_COMMAND
|
|
|
|
SETTING_BOOL("network_cmd_enable", &settings->bools.network_cmd_enable, true, DEFAULT_NETWORK_CMD_ENABLE, false);
|
|
|
|
SETTING_BOOL("stdin_cmd_enable", &settings->bools.stdin_cmd_enable, true, DEFAULT_STDIN_CMD_ENABLE, false);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_NETWORKING
|
|
|
|
SETTING_BOOL("netplay_show_only_connectable", &settings->bools.netplay_show_only_connectable, true, DEFAULT_NETPLAY_SHOW_ONLY_CONNECTABLE, false);
|
|
|
|
SETTING_BOOL("netplay_show_only_installed_cores", &settings->bools.netplay_show_only_installed_cores, true, DEFAULT_NETPLAY_SHOW_ONLY_INSTALLED_CORES, false);
|
|
|
|
SETTING_BOOL("netplay_show_passworded", &settings->bools.netplay_show_passworded, true, DEFAULT_NETPLAY_SHOW_PASSWORDED, false);
|
|
|
|
SETTING_BOOL("netplay_public_announce", &settings->bools.netplay_public_announce, true, DEFAULT_NETPLAY_PUBLIC_ANNOUNCE, false);
|
|
|
|
SETTING_BOOL("netplay_start_as_spectator", &settings->bools.netplay_start_as_spectator, false, DEFAULT_NETPLAY_START_AS_SPECTATOR, false);
|
|
|
|
SETTING_BOOL("netplay_nat_traversal", &settings->bools.netplay_nat_traversal, true, true, false);
|
|
|
|
SETTING_BOOL("netplay_fade_chat", &settings->bools.netplay_fade_chat, true, DEFAULT_NETPLAY_FADE_CHAT, false);
|
|
|
|
SETTING_BOOL("netplay_allow_pausing", &settings->bools.netplay_allow_pausing, true, DEFAULT_NETPLAY_ALLOW_PAUSING, false);
|
|
|
|
SETTING_BOOL("netplay_allow_slaves", &settings->bools.netplay_allow_slaves, true, DEFAULT_NETPLAY_ALLOW_SLAVES, false);
|
|
|
|
SETTING_BOOL("netplay_require_slaves", &settings->bools.netplay_require_slaves, true, DEFAULT_NETPLAY_REQUIRE_SLAVES, false);
|
|
|
|
SETTING_BOOL("netplay_use_mitm_server", &settings->bools.netplay_use_mitm_server, true, DEFAULT_NETPLAY_USE_MITM_SERVER, false);
|
|
|
|
SETTING_BOOL("netplay_request_device_p1", &settings->bools.netplay_request_devices[0], true, false, false);
|
|
|
|
SETTING_BOOL("netplay_request_device_p2", &settings->bools.netplay_request_devices[1], true, false, false);
|
|
|
|
SETTING_BOOL("netplay_request_device_p3", &settings->bools.netplay_request_devices[2], true, false, false);
|
|
|
|
SETTING_BOOL("netplay_request_device_p4", &settings->bools.netplay_request_devices[3], true, false, false);
|
|
|
|
SETTING_BOOL("netplay_request_device_p5", &settings->bools.netplay_request_devices[4], true, false, false);
|
|
|
|
SETTING_BOOL("netplay_request_device_p6", &settings->bools.netplay_request_devices[5], true, false, false);
|
|
|
|
SETTING_BOOL("netplay_request_device_p7", &settings->bools.netplay_request_devices[6], true, false, false);
|
|
|
|
SETTING_BOOL("netplay_request_device_p8", &settings->bools.netplay_request_devices[7], true, false, false);
|
|
|
|
SETTING_BOOL("netplay_request_device_p9", &settings->bools.netplay_request_devices[8], true, false, false);
|
|
|
|
SETTING_BOOL("netplay_request_device_p10", &settings->bools.netplay_request_devices[9], true, false, false);
|
|
|
|
SETTING_BOOL("netplay_request_device_p11", &settings->bools.netplay_request_devices[10], true, false, false);
|
|
|
|
SETTING_BOOL("netplay_request_device_p12", &settings->bools.netplay_request_devices[11], true, false, false);
|
|
|
|
SETTING_BOOL("netplay_request_device_p13", &settings->bools.netplay_request_devices[12], true, false, false);
|
|
|
|
SETTING_BOOL("netplay_request_device_p14", &settings->bools.netplay_request_devices[13], true, false, false);
|
|
|
|
SETTING_BOOL("netplay_request_device_p15", &settings->bools.netplay_request_devices[14], true, false, false);
|
|
|
|
SETTING_BOOL("netplay_request_device_p16", &settings->bools.netplay_request_devices[15], true, false, false);
|
|
|
|
SETTING_BOOL("netplay_ping_show", &settings->bools.netplay_ping_show, true, DEFAULT_NETPLAY_PING_SHOW, false);
|
|
|
|
SETTING_BOOL("network_on_demand_thumbnails", &settings->bools.network_on_demand_thumbnails, true, DEFAULT_NETWORK_ON_DEMAND_THUMBNAILS, false);
|
|
|
|
#ifdef HAVE_NETWORKGAMEPAD
|
|
|
|
SETTING_BOOL("network_remote_enable", &settings->bools.network_remote_enable, false, false /* TODO */, false);
|
2022-10-27 06:42:46 +03:00
|
|
|
#endif
|
2020-02-02 21:27:38 +01:00
|
|
|
#endif
|
|
|
|
|
2022-02-21 14:13:02 +01:00
|
|
|
#ifdef ANDROID
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_BOOL("android_input_disconnect_workaround", &settings->bools.android_input_disconnect_workaround, true, false, false);
|
2022-02-21 14:13:02 +01:00
|
|
|
#endif
|
|
|
|
|
2023-08-22 18:34:29 +03:00
|
|
|
#ifdef _3DS
|
|
|
|
SETTING_BOOL("new3ds_speedup_enable", &settings->bools.new3ds_speedup_enable, true, DEFAULT_NEW_3DS_SPEEDUP_ENABLE, false);
|
|
|
|
SETTING_BOOL("video_3ds_lcd_bottom", &settings->bools.video_3ds_lcd_bottom, true, DEFAULT_VIDEO_3DS_LCD_BOTTOM, false);
|
|
|
|
SETTING_BOOL("bottom_font_enable", &settings->bools.bottom_font_enable, true, DEFAULT_BOTTOM_FONT_ENABLE, false);
|
2023-02-15 05:59:06 -05:00
|
|
|
#endif
|
|
|
|
|
2023-08-22 18:34:29 +03:00
|
|
|
#ifdef WIIU
|
|
|
|
SETTING_BOOL("video_wiiu_prefer_drc", &settings->bools.video_wiiu_prefer_drc, true, DEFAULT_WIIU_PREFER_DRC, false);
|
Add microphone support via a new driver (#14731)
* Some slight fixes
* Update libretro.h
* Log calls to RETRO_ENVIRONMENT_GET_MICROPHONE_INTERFACE
* Finish proof-of-concept for mic support
- It works, but doesn't support floating-point audio yet
- It may need to be resampled, too
* Add macros that aren't available in SDL 2
* Comment out a variable definition for now
- For C89 compliance
* Add some comments for clarity
* Let ALSA tolerate a null new_rate
* Partial ALSA microphone support
- Not yet tested
- Mic is created and destroyed
- Mic can also be paused or unpaused
- Mic is paused or unpaused with the rest of the driver
- Microphone is not yet read
* Install error logging in the ALSA driver
- It defers to RARCH_ERR
* Free the ALSA microphone in alsa_free
* Fix an indent
* First draft of alsa_read_microphone
* Deinitialize SDL Audio in sdl_audio_free
* Save and restore the ALSA error logger
- You should always practice safe global state
* Add newlines to some RARCH_ERRs
* Add some logging
* Check for the mic being active via settings instead of via flags
* Adjusted a log entry to be less misleading
- A frequency of 0Hz looks weird to the uninformed
- In reality, it means the driver used the requested frequency
* Fix an incorrect format string
* Tidy up logging in alsa.c
* Rename audio_enable_microphone to audio_enable_input
* Rename microphone_device to audio_input_device
* Add audio_input_latency and audio_input_block_frames settings
* Add all mic-related settings to the options menu
* Adjust logging for alsa.c
- Log the ALSA library version
- Add errno details
* Refer to the microphone in logs by name
* Use %u instead of %d for some log items
* Add input_samples_buf
* Remove an inaccurate comment
* Change type of input_samples_buf
* Clean up audio_driver_flush_microphone_input
* Comment convert_float_to_s16
- It helped me understand what it's doing
- Turns out it'll work just fine on mono audio
* Don't use the resampler for mic input
* Fix crash in the ALSA driver when reading from a mic
* Update some logging messages
* ALSA support now works for mics
* Reuse some common functions in alsa.c
* Add alsa_thread_microphone_t
* Refactor alsa.c
- Introduce alsa_init_pcm to init any PCM that we're using
- Vastly simplifies the implementation of alsa_init and alsa_init_microphone
- Will be used for the read-based versions next
* Make ALSA logging a little more consistent
* Clean up the mic with alsa_free_microphone if alsa_init_microphone fails
* Remove an unused function
* Move some cleanup in alsa.c to a common function
* First crack at mic support for alsathread
- Refactor some duplicate code into functions
- Use functions introduced in alsa.c
- Create and destroy the mic
* Slight cleanups for clarity
* Implement alsa_thread_set/get_microphone_state
* More work on alsathread
- No more crashing, but the mic just returns silence
* Slight cleanups for clarity
* Add alsa_set_mic_enabled_internal
- For setting the state of a microphone while considering its current state
* Use alsa_set_mic_enabled_internal
* Log a little more info
* Log when the audio driver is started/stopped
* Move base microphone driver code into a new directory
- Add microphone_driver.c to Makefile.common
- Rename functions as needed
* Initialize and deinitialize the microphone driver
* Implement sdl_microphone.c
* Un-const an argument
- In case the driver context needs to do any locking
* Revise comments for microphone_driver.h
* Remove an unimplemented function
* Remove some functions from the mic driver
* Remove mic functions from audio_thread_wrapper
* Remove mic functions from sdl_audio
* Fix microphone_null
* Split the mic code for the alsa audio drivers into microphone drivers
* Fix an extra struct member
* Add a setting for the mic driver
* Add a command to reinitialize the microphone driver
* Rename mic-related settings
* Add DRIVER_MICROPHONE_MASK to DRIVERS_CMD_ALL
* Rename audio_enable_input to microphone_enable
* Remove some labels from qt_options
* Search for microphone_driver within find_driver_nonempty
* Clean up some mic driver code
* Pending mics now return silence
* Adjust some logging and comments
* Some cleanup in the microphone driver
* Invert a flag check
- Oops
* Fix a log message
* Fix the wrong flags being checked
* Slight refactor of wasapi_init_device
- Add a data_flow parameter
- Declare it in a header
- In preparation for WASAPI mic support
* Add some WASAPI macros for _IAudioCaptureClient
* Move some common WASAPI functions to audio/common/wasapi.c
- They'll be used by the mic and the audio drivers
* Add wasapi_log_hr
* Generalize mmdevice_list_new to look for capture devices, too
* Fix a function declaration
* Move driver-specific device_list_new functions into their respective files
* Clean up some declarations
* First draft of wasapi microphone driver
* Add wasapi_microphone_device_list_free
* Change function parameter names to be consistent with microphone_driver
* Partially implement wasapi_microphone_read
- Mostly copied from the audio driver so far
- It doesn't compile yet
- But it'll be beautiful when I'm done with it
* Refactor the mic driver's functions
- Rename get_mic_active to mic_alive
- Split set_mic_active into start_mic and stop_mic
- Refactor the SDL mic driver accordingly
* Edit some WASAPI functions for logging and clarity
* Implement more of the WASAPI mic driver
* Rename write_event to read_event
* Pass the WASAPI driver context to the various read functions
* Mostly implement the read function for the WASAPI mic driver
* Fix a crash in microphone_driver
- Forgot to move the position of the name of null_driver
* Reduce some logging in wasapi common functions
- Only log the chosen audio client format, not all attempted ones
* Add some macro wrappers for IAudioClient methods
* Update mic driver configuration
- Make the mic driver configurable in the menu
- Add config items for WASAPI-related options similar to the audio driver
* Fix a menu entry scrolling through audio devices instead of mic devices
* Add some utility functions
* Expose the new utility functions in wasapi.h
* Add extra logging in the WASAPI common functions
* Add sharemode_name
* Use _IAudioClient_Initialize macro in some places
* Pass channels to wasapi_init_client
- Remember, mics are in mono
* Use _IAudioClient_Initialize macro some more
* Forgot to pass channels in some places
* Add some utility functions
* Forgot an #include
* Add wasapi_select_device_format
* Simplify the format selection logic in wasapi_init_client_sh
* Unset the microphone in wasapi_microphone_close_mic
- Ought to prevent a potential segfault
* Simplify some logging
* Fix incorrect value being passed to _IAudioCaptureClient_ReleaseBuffer
* Remove some unneeded logging
* Add some values to hresult_name
* Polish up wasapi_select_device_format
- Test for formats manually when Windows can't
- Add some debug logging
- Check for channels
* Compute the fields of WAVEFORMATEXTENSIBLE correctly
- As per the doc's stated requirements
* Simplify logic for WASAPI client creation
* Fix a potential hang in wasapi_microphone_read_shared_buffered
* Stop the microphone if the driver is stopped
* Don't name the microphone event
* Ensure that wasapi_init_client reports the correct format and rate
* Implement exclusive microphone read access for WASAPI
* Add _IAudioCaptureClient_GetNextPacketSize macro
* Organize cases in hresult_name
* Clear some extra fields if wasapi_set_format is setting a Pcm format
* Adjust some logs
* Adjust some logs
* Remove unneeded local vars
* Add a log
* Update wasapi.c
* Update wasapi.c
* Fix shared-mode mic support in WASAPI producing broken input
- Turns out it had nothing to do with shared mode
* Reuse a common function
- Remove wasapi_microphone_read_shared_buffered
- Rename wasapi_microphone_read_exclusive to wasapi_microphone_read_buffered
* Remove some code I was using for test purposes
* Clarify some language
* Double the default shared-mode mic buffer length
* Split getting a device's name into a separate function, then use it
* Fix the ALSA mic drivers
- To comply with changes I previously made to the mic driver interface
* Remove unused synchronization primitives from the SDL microphone driver
* Add sdl_microphone_mic_use_float
* Document audio_driver_state_flags
- I needed to understand these to see if similar flags were required for the mic driver
* Remove an unused function in wasapi.c
* Add and document flags in microphone_driver.h
* Remove driver-specific mic start/stop functions
- The mic driver itself doesn't do much processing
- That honor goes to individual mics
* Remove some unused fields in microphone_driver.h
* Add CMD_EVENT_MICROPHONE_STOP/START
* Remove unused functions from microphone_null
* Change how the mic driver state is referenced in some places
* Simplify the SDL microphone driver
- The driver backend no longer keeps a reference to the mic (the frontend does that)
- Remove functions that are no longer needed
- Don't track paused state, just query the mic itself
* Simplify the WASAPI microphone driver
- Don't track the driver running state or the microphone handle, the frontend does that now
- Remove support for unbuffered input (hunterk suggested that it wasn't necessary)
* Make microphone_wasapi_sh_buffer_length a uint, not an int
- It won't be negative anymore
- 0 now represents the default value
* Make the microphone frontend more robust
- Improve documentation for how various functions should be implemented
- Closes all microphones before freeing the driver (so backends don't have to)
- Tracks the enabled state of each microphone, so backends don't have to (but they still can)
* Stop the mic driver in core_unload_game
* Ensure mic support is compatible with the revised menu code
* Move alsa.h into audio/common
* Remove RETRO_ENVIRONMENT_GET_MICROPHONE_ENABLED
- It was never really needed
* Refactor the ALSA microphone driver
- Move common ALSA functions to audio/common/alsa.c
- Replace alsa_set_mic_enabled_internal with alsa_start/stop_pcm
- Don't track the microphone handle in the ALSA driver context
- Remove unneeded fields
* Move some common alsathread code into audio/common/alsathread.c
* Change return type of mic_driver_open_mic_internal to bool
* First crack at resampling mic input
* Remove an extraneous check
- I think something distracted me when I was writing this line
* Add stereo/mono conversion functions
* Make alsa_start_pcm and alsa_stop_pcm more robust
- They now return success if the stream is already running and stopped, respectively
* Revise some mic-related comments in libretro.h
* First crack at resampling mic input
* Simplify an expression
* Simplify an expression
* Fix a log tag
* Allow mic resampler to be configured separately from audio resampler
* Add some comments
* Set the source ratio to something sensible
* Stop deadlock in `alsathread` mic driver
* Allow mics to be initialized even when core is loaded from CLI
- When loading content from CLI, the drivers are initialized a little differently
- That threw off the mic initialization code
* Rename the functions in retro_microphone_interface
* Revise some mic-related comments in libretro.h
* Update retro_microphone_interface
- Add get_mic_rate
- Add a parameter to open_mic
- The modifications don't do anything yet
* Use parameter objects in the microphone handle
* Replace get_mic_rate with get_params
* Add a microphone interface version
* Remove part of a comment
* Set the effective params in mic_driver_microphone_handle_init
* Drop a stray newline
* Change where the mic interface is zeroed
- I was accidentally throwing out the version that the core was asking for
* Reduce logspam for wasapi_set_nonblock_state
- Now it only logs when the sync mode is changed
* Change DEFAULT_WASAPI_SH_BUFFER_LENGTH to 0
- -16 is no longer a valid value
* Set the new_rate in wasapi_init
* Change description of microphone sample rate in the settings
* First attempt at resampling configured mic input
* Forgot a section
* Fix some input samples being skipped
* Rename a variable for clarity
* Add microphone.outgoing_samples
* Update the mic driver
- Processed samples are now buffered
- The resampler is skipped if the ratio is (very close to) 1
* Remove part of a comment
* Update some comments in audio_resampler.h
* Slightly refactor the SDL microphone driver
- Move SDL_AudioSpec to a field of sdl_microphone_handle_t
- Allow SDL to change the requested format and sample rate
- Request floating-point input
- Implement sdl_microphone_mic_use_float
* Fix a non-C89-compliant declaration
* Add new files to griffin.c
* Remove a C++-style comment
* Add two more files to griffin.c
* Remove some unneeded declarations in microphone_driver.h
* Remove a stray comma in configuration.c
- For C89 compliance
* Fix compilation on some platforms
* Change some function signatures
* Make the ALSA drivers always set the audio rate
* Fix the alsathread mic driver
* Make state_manager_frame_is_reversed return false if HAVE_REWIND isn't defined
* Mute the microphone if the core is running in fast-forward, slow-mo, or rewind
* Clarify a comment
* Clarify a comment
* Add a comment
* Don't allocate memory for slowmo samples in the mic driver
- We're not supporting slowmo for mics, so it's not needed
* Fix a {
* Add my name to AUTHORS.h
* Add driver_lifetime_flags
- For drivers that have special setup/teardown needs
* Ensure that resetting the mic driver maintains active mic handles
- Prevents fullscreen toggle from stopping all mic input
* Update CHANGES.md
* Move some default microphone settings to a new part of the config file
* Ensure that RetroArch can use the audio format that Windows suggests
* Remove references to mic support in the SDL audio driver
* Remove unused WASAPI functions
* Return failure if RetroArch couldn't select a WASAPI format
* Ensure that Windows uses the WASAPI mic driver by default
* Treat disabled mic support as a warning, not an error
* Clarify some WASAPI-related microphone settings
* Remove some unused variables
* Add or revise microphone-related comments
* Rearrange doc comments for microphone types in libretro.h
* Remove a space
* Remove some unused flags
* Remove ALSA error logger
- It was never used anyway
* Remove unneeded microphone-related arguments
* Document a parameter
* Remove a logging call
* Add a constant for the microphone's shared buffer length for WASAPI
* Fix stylistic inconsistencies
* Make mic_driver_get_sample_size a macro instead of a function
* Move the microphone implementation to the audio directory
* Make microphone support optional (but enabled by default)
* Fix the griffin build
2023-06-06 15:55:06 -04:00
|
|
|
#endif
|
2023-08-22 18:34:29 +03:00
|
|
|
|
|
|
|
#if defined(HAVE_COCOATOUCH) && defined(TARGET_OS_TV)
|
|
|
|
SETTING_BOOL("gcdwebserver_alert", &settings->bools.gcdwebserver_alert, true, true, false);
|
Add microphone support via a new driver (#14731)
* Some slight fixes
* Update libretro.h
* Log calls to RETRO_ENVIRONMENT_GET_MICROPHONE_INTERFACE
* Finish proof-of-concept for mic support
- It works, but doesn't support floating-point audio yet
- It may need to be resampled, too
* Add macros that aren't available in SDL 2
* Comment out a variable definition for now
- For C89 compliance
* Add some comments for clarity
* Let ALSA tolerate a null new_rate
* Partial ALSA microphone support
- Not yet tested
- Mic is created and destroyed
- Mic can also be paused or unpaused
- Mic is paused or unpaused with the rest of the driver
- Microphone is not yet read
* Install error logging in the ALSA driver
- It defers to RARCH_ERR
* Free the ALSA microphone in alsa_free
* Fix an indent
* First draft of alsa_read_microphone
* Deinitialize SDL Audio in sdl_audio_free
* Save and restore the ALSA error logger
- You should always practice safe global state
* Add newlines to some RARCH_ERRs
* Add some logging
* Check for the mic being active via settings instead of via flags
* Adjusted a log entry to be less misleading
- A frequency of 0Hz looks weird to the uninformed
- In reality, it means the driver used the requested frequency
* Fix an incorrect format string
* Tidy up logging in alsa.c
* Rename audio_enable_microphone to audio_enable_input
* Rename microphone_device to audio_input_device
* Add audio_input_latency and audio_input_block_frames settings
* Add all mic-related settings to the options menu
* Adjust logging for alsa.c
- Log the ALSA library version
- Add errno details
* Refer to the microphone in logs by name
* Use %u instead of %d for some log items
* Add input_samples_buf
* Remove an inaccurate comment
* Change type of input_samples_buf
* Clean up audio_driver_flush_microphone_input
* Comment convert_float_to_s16
- It helped me understand what it's doing
- Turns out it'll work just fine on mono audio
* Don't use the resampler for mic input
* Fix crash in the ALSA driver when reading from a mic
* Update some logging messages
* ALSA support now works for mics
* Reuse some common functions in alsa.c
* Add alsa_thread_microphone_t
* Refactor alsa.c
- Introduce alsa_init_pcm to init any PCM that we're using
- Vastly simplifies the implementation of alsa_init and alsa_init_microphone
- Will be used for the read-based versions next
* Make ALSA logging a little more consistent
* Clean up the mic with alsa_free_microphone if alsa_init_microphone fails
* Remove an unused function
* Move some cleanup in alsa.c to a common function
* First crack at mic support for alsathread
- Refactor some duplicate code into functions
- Use functions introduced in alsa.c
- Create and destroy the mic
* Slight cleanups for clarity
* Implement alsa_thread_set/get_microphone_state
* More work on alsathread
- No more crashing, but the mic just returns silence
* Slight cleanups for clarity
* Add alsa_set_mic_enabled_internal
- For setting the state of a microphone while considering its current state
* Use alsa_set_mic_enabled_internal
* Log a little more info
* Log when the audio driver is started/stopped
* Move base microphone driver code into a new directory
- Add microphone_driver.c to Makefile.common
- Rename functions as needed
* Initialize and deinitialize the microphone driver
* Implement sdl_microphone.c
* Un-const an argument
- In case the driver context needs to do any locking
* Revise comments for microphone_driver.h
* Remove an unimplemented function
* Remove some functions from the mic driver
* Remove mic functions from audio_thread_wrapper
* Remove mic functions from sdl_audio
* Fix microphone_null
* Split the mic code for the alsa audio drivers into microphone drivers
* Fix an extra struct member
* Add a setting for the mic driver
* Add a command to reinitialize the microphone driver
* Rename mic-related settings
* Add DRIVER_MICROPHONE_MASK to DRIVERS_CMD_ALL
* Rename audio_enable_input to microphone_enable
* Remove some labels from qt_options
* Search for microphone_driver within find_driver_nonempty
* Clean up some mic driver code
* Pending mics now return silence
* Adjust some logging and comments
* Some cleanup in the microphone driver
* Invert a flag check
- Oops
* Fix a log message
* Fix the wrong flags being checked
* Slight refactor of wasapi_init_device
- Add a data_flow parameter
- Declare it in a header
- In preparation for WASAPI mic support
* Add some WASAPI macros for _IAudioCaptureClient
* Move some common WASAPI functions to audio/common/wasapi.c
- They'll be used by the mic and the audio drivers
* Add wasapi_log_hr
* Generalize mmdevice_list_new to look for capture devices, too
* Fix a function declaration
* Move driver-specific device_list_new functions into their respective files
* Clean up some declarations
* First draft of wasapi microphone driver
* Add wasapi_microphone_device_list_free
* Change function parameter names to be consistent with microphone_driver
* Partially implement wasapi_microphone_read
- Mostly copied from the audio driver so far
- It doesn't compile yet
- But it'll be beautiful when I'm done with it
* Refactor the mic driver's functions
- Rename get_mic_active to mic_alive
- Split set_mic_active into start_mic and stop_mic
- Refactor the SDL mic driver accordingly
* Edit some WASAPI functions for logging and clarity
* Implement more of the WASAPI mic driver
* Rename write_event to read_event
* Pass the WASAPI driver context to the various read functions
* Mostly implement the read function for the WASAPI mic driver
* Fix a crash in microphone_driver
- Forgot to move the position of the name of null_driver
* Reduce some logging in wasapi common functions
- Only log the chosen audio client format, not all attempted ones
* Add some macro wrappers for IAudioClient methods
* Update mic driver configuration
- Make the mic driver configurable in the menu
- Add config items for WASAPI-related options similar to the audio driver
* Fix a menu entry scrolling through audio devices instead of mic devices
* Add some utility functions
* Expose the new utility functions in wasapi.h
* Add extra logging in the WASAPI common functions
* Add sharemode_name
* Use _IAudioClient_Initialize macro in some places
* Pass channels to wasapi_init_client
- Remember, mics are in mono
* Use _IAudioClient_Initialize macro some more
* Forgot to pass channels in some places
* Add some utility functions
* Forgot an #include
* Add wasapi_select_device_format
* Simplify the format selection logic in wasapi_init_client_sh
* Unset the microphone in wasapi_microphone_close_mic
- Ought to prevent a potential segfault
* Simplify some logging
* Fix incorrect value being passed to _IAudioCaptureClient_ReleaseBuffer
* Remove some unneeded logging
* Add some values to hresult_name
* Polish up wasapi_select_device_format
- Test for formats manually when Windows can't
- Add some debug logging
- Check for channels
* Compute the fields of WAVEFORMATEXTENSIBLE correctly
- As per the doc's stated requirements
* Simplify logic for WASAPI client creation
* Fix a potential hang in wasapi_microphone_read_shared_buffered
* Stop the microphone if the driver is stopped
* Don't name the microphone event
* Ensure that wasapi_init_client reports the correct format and rate
* Implement exclusive microphone read access for WASAPI
* Add _IAudioCaptureClient_GetNextPacketSize macro
* Organize cases in hresult_name
* Clear some extra fields if wasapi_set_format is setting a Pcm format
* Adjust some logs
* Adjust some logs
* Remove unneeded local vars
* Add a log
* Update wasapi.c
* Update wasapi.c
* Fix shared-mode mic support in WASAPI producing broken input
- Turns out it had nothing to do with shared mode
* Reuse a common function
- Remove wasapi_microphone_read_shared_buffered
- Rename wasapi_microphone_read_exclusive to wasapi_microphone_read_buffered
* Remove some code I was using for test purposes
* Clarify some language
* Double the default shared-mode mic buffer length
* Split getting a device's name into a separate function, then use it
* Fix the ALSA mic drivers
- To comply with changes I previously made to the mic driver interface
* Remove unused synchronization primitives from the SDL microphone driver
* Add sdl_microphone_mic_use_float
* Document audio_driver_state_flags
- I needed to understand these to see if similar flags were required for the mic driver
* Remove an unused function in wasapi.c
* Add and document flags in microphone_driver.h
* Remove driver-specific mic start/stop functions
- The mic driver itself doesn't do much processing
- That honor goes to individual mics
* Remove some unused fields in microphone_driver.h
* Add CMD_EVENT_MICROPHONE_STOP/START
* Remove unused functions from microphone_null
* Change how the mic driver state is referenced in some places
* Simplify the SDL microphone driver
- The driver backend no longer keeps a reference to the mic (the frontend does that)
- Remove functions that are no longer needed
- Don't track paused state, just query the mic itself
* Simplify the WASAPI microphone driver
- Don't track the driver running state or the microphone handle, the frontend does that now
- Remove support for unbuffered input (hunterk suggested that it wasn't necessary)
* Make microphone_wasapi_sh_buffer_length a uint, not an int
- It won't be negative anymore
- 0 now represents the default value
* Make the microphone frontend more robust
- Improve documentation for how various functions should be implemented
- Closes all microphones before freeing the driver (so backends don't have to)
- Tracks the enabled state of each microphone, so backends don't have to (but they still can)
* Stop the mic driver in core_unload_game
* Ensure mic support is compatible with the revised menu code
* Move alsa.h into audio/common
* Remove RETRO_ENVIRONMENT_GET_MICROPHONE_ENABLED
- It was never really needed
* Refactor the ALSA microphone driver
- Move common ALSA functions to audio/common/alsa.c
- Replace alsa_set_mic_enabled_internal with alsa_start/stop_pcm
- Don't track the microphone handle in the ALSA driver context
- Remove unneeded fields
* Move some common alsathread code into audio/common/alsathread.c
* Change return type of mic_driver_open_mic_internal to bool
* First crack at resampling mic input
* Remove an extraneous check
- I think something distracted me when I was writing this line
* Add stereo/mono conversion functions
* Make alsa_start_pcm and alsa_stop_pcm more robust
- They now return success if the stream is already running and stopped, respectively
* Revise some mic-related comments in libretro.h
* First crack at resampling mic input
* Simplify an expression
* Simplify an expression
* Fix a log tag
* Allow mic resampler to be configured separately from audio resampler
* Add some comments
* Set the source ratio to something sensible
* Stop deadlock in `alsathread` mic driver
* Allow mics to be initialized even when core is loaded from CLI
- When loading content from CLI, the drivers are initialized a little differently
- That threw off the mic initialization code
* Rename the functions in retro_microphone_interface
* Revise some mic-related comments in libretro.h
* Update retro_microphone_interface
- Add get_mic_rate
- Add a parameter to open_mic
- The modifications don't do anything yet
* Use parameter objects in the microphone handle
* Replace get_mic_rate with get_params
* Add a microphone interface version
* Remove part of a comment
* Set the effective params in mic_driver_microphone_handle_init
* Drop a stray newline
* Change where the mic interface is zeroed
- I was accidentally throwing out the version that the core was asking for
* Reduce logspam for wasapi_set_nonblock_state
- Now it only logs when the sync mode is changed
* Change DEFAULT_WASAPI_SH_BUFFER_LENGTH to 0
- -16 is no longer a valid value
* Set the new_rate in wasapi_init
* Change description of microphone sample rate in the settings
* First attempt at resampling configured mic input
* Forgot a section
* Fix some input samples being skipped
* Rename a variable for clarity
* Add microphone.outgoing_samples
* Update the mic driver
- Processed samples are now buffered
- The resampler is skipped if the ratio is (very close to) 1
* Remove part of a comment
* Update some comments in audio_resampler.h
* Slightly refactor the SDL microphone driver
- Move SDL_AudioSpec to a field of sdl_microphone_handle_t
- Allow SDL to change the requested format and sample rate
- Request floating-point input
- Implement sdl_microphone_mic_use_float
* Fix a non-C89-compliant declaration
* Add new files to griffin.c
* Remove a C++-style comment
* Add two more files to griffin.c
* Remove some unneeded declarations in microphone_driver.h
* Remove a stray comma in configuration.c
- For C89 compliance
* Fix compilation on some platforms
* Change some function signatures
* Make the ALSA drivers always set the audio rate
* Fix the alsathread mic driver
* Make state_manager_frame_is_reversed return false if HAVE_REWIND isn't defined
* Mute the microphone if the core is running in fast-forward, slow-mo, or rewind
* Clarify a comment
* Clarify a comment
* Add a comment
* Don't allocate memory for slowmo samples in the mic driver
- We're not supporting slowmo for mics, so it's not needed
* Fix a {
* Add my name to AUTHORS.h
* Add driver_lifetime_flags
- For drivers that have special setup/teardown needs
* Ensure that resetting the mic driver maintains active mic handles
- Prevents fullscreen toggle from stopping all mic input
* Update CHANGES.md
* Move some default microphone settings to a new part of the config file
* Ensure that RetroArch can use the audio format that Windows suggests
* Remove references to mic support in the SDL audio driver
* Remove unused WASAPI functions
* Return failure if RetroArch couldn't select a WASAPI format
* Ensure that Windows uses the WASAPI mic driver by default
* Treat disabled mic support as a warning, not an error
* Clarify some WASAPI-related microphone settings
* Remove some unused variables
* Add or revise microphone-related comments
* Rearrange doc comments for microphone types in libretro.h
* Remove a space
* Remove some unused flags
* Remove ALSA error logger
- It was never used anyway
* Remove unneeded microphone-related arguments
* Document a parameter
* Remove a logging call
* Add a constant for the microphone's shared buffer length for WASAPI
* Fix stylistic inconsistencies
* Make mic_driver_get_sample_size a macro instead of a function
* Move the microphone implementation to the audio directory
* Make microphone support optional (but enabled by default)
* Fix the griffin build
2023-06-06 15:55:06 -04:00
|
|
|
#endif
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
*size = count;
|
2018-01-04 16:55:28 +01:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
return tmp;
|
|
|
|
}
|
2016-10-16 01:25:31 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
static struct config_float_setting *populate_settings_float(
|
|
|
|
settings_t *settings, int *size)
|
|
|
|
{
|
|
|
|
unsigned count = 0;
|
|
|
|
struct config_float_setting *tmp = (struct config_float_setting*)calloc(1, (*size + 1) * sizeof(struct config_float_setting));
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
if (!tmp)
|
|
|
|
return NULL;
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2023-08-22 18:34:29 +03:00
|
|
|
#ifdef HAVE_MENU
|
|
|
|
SETTING_FLOAT("menu_scale_factor", &settings->floats.menu_scale_factor, true, DEFAULT_MENU_SCALE_FACTOR, false);
|
|
|
|
SETTING_FLOAT("menu_widget_scale_factor", &settings->floats.menu_widget_scale_factor, true, DEFAULT_MENU_WIDGET_SCALE_FACTOR, false);
|
|
|
|
#if !(defined(RARCH_CONSOLE) || defined(RARCH_MOBILE))
|
|
|
|
SETTING_FLOAT("menu_widget_scale_factor_windowed", &settings->floats.menu_widget_scale_factor_windowed, true, DEFAULT_MENU_WIDGET_SCALE_FACTOR_WINDOWED, false);
|
|
|
|
#endif
|
|
|
|
SETTING_FLOAT("menu_wallpaper_opacity", &settings->floats.menu_wallpaper_opacity, true, DEFAULT_MENU_WALLPAPER_OPACITY, false);
|
|
|
|
SETTING_FLOAT("menu_framebuffer_opacity", &settings->floats.menu_framebuffer_opacity, true, DEFAULT_MENU_FRAMEBUFFER_OPACITY, false);
|
|
|
|
SETTING_FLOAT("menu_footer_opacity", &settings->floats.menu_footer_opacity, true, DEFAULT_MENU_FOOTER_OPACITY, false);
|
|
|
|
SETTING_FLOAT("menu_header_opacity", &settings->floats.menu_header_opacity, true, DEFAULT_MENU_HEADER_OPACITY, false);
|
|
|
|
SETTING_FLOAT("menu_ticker_speed", &settings->floats.menu_ticker_speed, true, DEFAULT_MENU_TICKER_SPEED, false);
|
|
|
|
#ifdef HAVE_RGUI
|
|
|
|
SETTING_FLOAT("rgui_particle_effect_speed", &settings->floats.menu_rgui_particle_effect_speed, true, DEFAULT_RGUI_PARTICLE_EFFECT_SPEED, false);
|
|
|
|
#endif
|
|
|
|
#if defined(HAVE_MATERIALUI) || defined(HAVE_XMB) || defined(HAVE_OZONE)
|
|
|
|
SETTING_FLOAT("menu_screensaver_animation_speed", &settings->floats.menu_screensaver_animation_speed, true, DEFAULT_MENU_SCREENSAVER_ANIMATION_SPEED, false);
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_OZONE
|
|
|
|
SETTING_FLOAT("ozone_thumbnail_scale_factor", &settings->floats.ozone_thumbnail_scale_factor, true, DEFAULT_OZONE_THUMBNAIL_SCALE_FACTOR, false);
|
|
|
|
#endif
|
|
|
|
#endif /* HAVE_MENU */
|
|
|
|
|
|
|
|
#ifdef HAVE_CHEEVOS
|
|
|
|
SETTING_FLOAT("cheevos_appearance_padding_h", &settings->floats.cheevos_appearance_padding_h, true, DEFAULT_CHEEVOS_APPEARANCE_PADDING_H, false);
|
|
|
|
SETTING_FLOAT("cheevos_appearance_padding_v", &settings->floats.cheevos_appearance_padding_v, true, DEFAULT_CHEEVOS_APPEARANCE_PADDING_V, false);
|
2018-12-28 12:41:38 +01:00
|
|
|
#endif
|
2023-08-22 18:34:29 +03:00
|
|
|
|
|
|
|
SETTING_FLOAT("fastforward_ratio", &settings->floats.fastforward_ratio, true, DEFAULT_FASTFORWARD_RATIO, false);
|
|
|
|
SETTING_FLOAT("slowmotion_ratio", &settings->floats.slowmotion_ratio, true, DEFAULT_SLOWMOTION_RATIO, false);
|
|
|
|
|
|
|
|
SETTING_FLOAT("audio_rate_control_delta", audio_get_float_ptr(AUDIO_ACTION_RATE_CONTROL_DELTA), true, DEFAULT_RATE_CONTROL_DELTA, false);
|
|
|
|
SETTING_FLOAT("audio_max_timing_skew", &settings->floats.audio_max_timing_skew, true, DEFAULT_MAX_TIMING_SKEW, false);
|
|
|
|
SETTING_FLOAT("audio_volume", &settings->floats.audio_volume, true, DEFAULT_AUDIO_VOLUME, false);
|
|
|
|
#ifdef HAVE_AUDIOMIXER
|
|
|
|
SETTING_FLOAT("audio_mixer_volume", &settings->floats.audio_mixer_volume, true, DEFAULT_AUDIO_MIXER_VOLUME, false);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
SETTING_FLOAT("video_aspect_ratio", &settings->floats.video_aspect_ratio, true, DEFAULT_ASPECT_RATIO, false);
|
|
|
|
SETTING_FLOAT("video_refresh_rate", &settings->floats.video_refresh_rate, true, DEFAULT_REFRESH_RATE, false);
|
2023-08-23 00:56:15 +03:00
|
|
|
SETTING_FLOAT("video_autoswitch_pal_threshold", &settings->floats.video_autoswitch_pal_threshold, true, DEFAULT_AUTOSWITCH_PAL_THRESHOLD, false);
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_FLOAT("crt_video_refresh_rate", &settings->floats.crt_video_refresh_rate, true, DEFAULT_CRT_REFRESH_RATE, false);
|
|
|
|
SETTING_FLOAT("video_message_pos_x", &settings->floats.video_msg_pos_x, true, DEFAULT_MESSAGE_POS_OFFSET_X, false);
|
|
|
|
SETTING_FLOAT("video_message_pos_y", &settings->floats.video_msg_pos_y, true, DEFAULT_MESSAGE_POS_OFFSET_Y, false);
|
|
|
|
SETTING_FLOAT("video_font_size", &settings->floats.video_font_size, true, DEFAULT_FONT_SIZE, false);
|
|
|
|
SETTING_FLOAT("video_msg_bgcolor_opacity", &settings->floats.video_msg_bgcolor_opacity, true, DEFAULT_MESSAGE_BGCOLOR_OPACITY, false);
|
|
|
|
SETTING_FLOAT("video_hdr_max_nits", &settings->floats.video_hdr_max_nits, true, DEFAULT_VIDEO_HDR_MAX_NITS, false);
|
|
|
|
SETTING_FLOAT("video_hdr_paper_white_nits", &settings->floats.video_hdr_paper_white_nits, true, DEFAULT_VIDEO_HDR_PAPER_WHITE_NITS, false);
|
|
|
|
SETTING_FLOAT("video_hdr_display_contrast", &settings->floats.video_hdr_display_contrast, true, DEFAULT_VIDEO_HDR_CONTRAST, false);
|
|
|
|
|
|
|
|
SETTING_FLOAT("input_axis_threshold", &settings->floats.input_axis_threshold, true, DEFAULT_AXIS_THRESHOLD, false);
|
|
|
|
SETTING_FLOAT("input_analog_deadzone", &settings->floats.input_analog_deadzone, true, DEFAULT_ANALOG_DEADZONE, false);
|
|
|
|
SETTING_FLOAT("input_analog_sensitivity", &settings->floats.input_analog_sensitivity, true, DEFAULT_ANALOG_SENSITIVITY, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
#ifdef HAVE_OVERLAY
|
2020-09-08 13:36:45 +01:00
|
|
|
SETTING_FLOAT("input_overlay_opacity", &settings->floats.input_overlay_opacity, true, DEFAULT_INPUT_OVERLAY_OPACITY, false);
|
2023-07-08 12:45:13 -05:00
|
|
|
SETTING_FLOAT("input_osk_overlay_opacity", &settings->floats.input_osk_overlay_opacity, true, DEFAULT_INPUT_OVERLAY_OPACITY, false);
|
2020-09-08 13:36:45 +01:00
|
|
|
SETTING_FLOAT("input_overlay_scale_landscape", &settings->floats.input_overlay_scale_landscape, true, DEFAULT_INPUT_OVERLAY_SCALE_LANDSCAPE, false);
|
|
|
|
SETTING_FLOAT("input_overlay_aspect_adjust_landscape", &settings->floats.input_overlay_aspect_adjust_landscape, true, DEFAULT_INPUT_OVERLAY_ASPECT_ADJUST_LANDSCAPE, false);
|
|
|
|
SETTING_FLOAT("input_overlay_x_separation_landscape", &settings->floats.input_overlay_x_separation_landscape, true, DEFAULT_INPUT_OVERLAY_X_SEPARATION_LANDSCAPE, false);
|
|
|
|
SETTING_FLOAT("input_overlay_y_separation_landscape", &settings->floats.input_overlay_y_separation_landscape, true, DEFAULT_INPUT_OVERLAY_Y_SEPARATION_LANDSCAPE, false);
|
|
|
|
SETTING_FLOAT("input_overlay_x_offset_landscape", &settings->floats.input_overlay_x_offset_landscape, true, DEFAULT_INPUT_OVERLAY_X_OFFSET_LANDSCAPE, false);
|
|
|
|
SETTING_FLOAT("input_overlay_y_offset_landscape", &settings->floats.input_overlay_y_offset_landscape, true, DEFAULT_INPUT_OVERLAY_Y_OFFSET_LANDSCAPE, false);
|
|
|
|
SETTING_FLOAT("input_overlay_scale_portrait", &settings->floats.input_overlay_scale_portrait, true, DEFAULT_INPUT_OVERLAY_SCALE_PORTRAIT, false);
|
|
|
|
SETTING_FLOAT("input_overlay_aspect_adjust_portrait", &settings->floats.input_overlay_aspect_adjust_portrait, true, DEFAULT_INPUT_OVERLAY_ASPECT_ADJUST_PORTRAIT, false);
|
|
|
|
SETTING_FLOAT("input_overlay_x_separation_portrait", &settings->floats.input_overlay_x_separation_portrait, true, DEFAULT_INPUT_OVERLAY_X_SEPARATION_PORTRAIT, false);
|
2020-09-17 17:23:07 +01:00
|
|
|
SETTING_FLOAT("input_overlay_y_separation_portrait", &settings->floats.input_overlay_y_separation_portrait, true, DEFAULT_INPUT_OVERLAY_Y_SEPARATION_PORTRAIT, false);
|
2020-09-08 13:36:45 +01:00
|
|
|
SETTING_FLOAT("input_overlay_x_offset_portrait", &settings->floats.input_overlay_x_offset_portrait, true, DEFAULT_INPUT_OVERLAY_X_OFFSET_PORTRAIT, false);
|
|
|
|
SETTING_FLOAT("input_overlay_y_offset_portrait", &settings->floats.input_overlay_y_offset_portrait, true, DEFAULT_INPUT_OVERLAY_Y_OFFSET_PORTRAIT, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
#endif
|
2023-08-22 18:34:29 +03:00
|
|
|
|
2022-08-17 08:23:07 +02:00
|
|
|
#ifdef _3DS
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_FLOAT("bottom_font_scale", &settings->floats.bottom_font_scale, true, DEFAULT_BOTTOM_FONT_SCALE, false);
|
2022-08-17 08:23:07 +02:00
|
|
|
#endif
|
2023-08-22 18:34:29 +03:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
*size = count;
|
2015-11-21 18:08:37 +01:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
return tmp;
|
|
|
|
}
|
2016-08-29 16:57:33 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
static struct config_uint_setting *populate_settings_uint(
|
|
|
|
settings_t *settings, int *size)
|
|
|
|
{
|
|
|
|
unsigned count = 0;
|
|
|
|
struct config_uint_setting *tmp = (struct config_uint_setting*)calloc(1, (*size + 1) * sizeof(struct config_uint_setting));
|
2016-08-29 19:10:00 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
if (!tmp)
|
|
|
|
return NULL;
|
2016-08-29 19:10:00 +02:00
|
|
|
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_UINT("frontend_log_level", &settings->uints.frontend_log_level, true, DEFAULT_FRONTEND_LOG_LEVEL, false);
|
|
|
|
SETTING_UINT("libretro_log_level", &settings->uints.libretro_log_level, true, DEFAULT_LIBRETRO_LOG_LEVEL, false);
|
|
|
|
SETTING_UINT("fps_update_interval", &settings->uints.fps_update_interval, true, DEFAULT_FPS_UPDATE_INTERVAL, false);
|
|
|
|
SETTING_UINT("memory_update_interval", &settings->uints.memory_update_interval, true, DEFAULT_MEMORY_UPDATE_INTERVAL, false);
|
|
|
|
SETTING_UINT("core_updater_auto_backup_history_size", &settings->uints.core_updater_auto_backup_history_size, true, DEFAULT_CORE_UPDATER_AUTO_BACKUP_HISTORY_SIZE, false);
|
|
|
|
SETTING_UINT("autosave_interval", &settings->uints.autosave_interval, true, DEFAULT_AUTOSAVE_INTERVAL, false);
|
|
|
|
SETTING_UINT("rewind_granularity", &settings->uints.rewind_granularity, true, DEFAULT_REWIND_GRANULARITY, false);
|
|
|
|
SETTING_UINT("rewind_buffer_size_step", &settings->uints.rewind_buffer_size_step, true, DEFAULT_REWIND_BUFFER_SIZE_STEP, false);
|
|
|
|
SETTING_UINT("run_ahead_frames", &settings->uints.run_ahead_frames, true, 1, false);
|
|
|
|
SETTING_UINT("replay_max_keep", &settings->uints.replay_max_keep, true, DEFAULT_REPLAY_MAX_KEEP, false);
|
|
|
|
SETTING_UINT("replay_checkpoint_interval", &settings->uints.replay_checkpoint_interval, true, DEFAULT_REPLAY_CHECKPOINT_INTERVAL, false);
|
|
|
|
SETTING_UINT("savestate_max_keep", &settings->uints.savestate_max_keep, true, DEFAULT_SAVESTATE_MAX_KEEP, false);
|
2020-06-26 18:25:12 +02:00
|
|
|
#ifdef HAVE_MENU
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_UINT("content_show_add_entry", &settings->uints.menu_content_show_add_entry, true, DEFAULT_MENU_CONTENT_SHOW_ADD_ENTRY, false);
|
|
|
|
SETTING_UINT("content_show_contentless_cores",&settings->uints.menu_content_show_contentless_cores, true, DEFAULT_MENU_CONTENT_SHOW_CONTENTLESS_CORES, false);
|
|
|
|
SETTING_UINT("content_history_size", &settings->uints.content_history_size, true, DEFAULT_CONTENT_HISTORY_SIZE, false);
|
|
|
|
SETTING_UINT("playlist_entry_remove_enable", &settings->uints.playlist_entry_remove_enable, true, DEFAULT_PLAYLIST_ENTRY_REMOVE_ENABLE, false);
|
|
|
|
SETTING_UINT("playlist_show_inline_core_name", &settings->uints.playlist_show_inline_core_name, true, DEFAULT_PLAYLIST_SHOW_INLINE_CORE_NAME, false);
|
|
|
|
SETTING_UINT("playlist_show_history_icons", &settings->uints.playlist_show_history_icons, true, DEFAULT_PLAYLIST_SHOW_HISTORY_ICONS, false);
|
|
|
|
SETTING_UINT("playlist_sublabel_runtime_type", &settings->uints.playlist_sublabel_runtime_type, true, DEFAULT_PLAYLIST_SUBLABEL_RUNTIME_TYPE, false);
|
|
|
|
SETTING_UINT("playlist_sublabel_last_played_style", &settings->uints.playlist_sublabel_last_played_style, true, DEFAULT_PLAYLIST_SUBLABEL_LAST_PLAYED_STYLE, false);
|
|
|
|
SETTING_UINT("quit_on_close_content", &settings->uints.quit_on_close_content, true, DEFAULT_QUIT_ON_CLOSE_CONTENT, false);
|
|
|
|
SETTING_UINT("menu_thumbnails", &settings->uints.gfx_thumbnails, true, DEFAULT_GFX_THUMBNAILS_DEFAULT, false);
|
|
|
|
SETTING_UINT("menu_left_thumbnails", &settings->uints.menu_left_thumbnails, true, DEFAULT_MENU_LEFT_THUMBNAILS_DEFAULT, false);
|
2022-11-27 22:15:59 +01:00
|
|
|
SETTING_UINT("menu_thumbnail_upscale_threshold", &settings->uints.gfx_thumbnail_upscale_threshold, true, DEFAULT_GFX_THUMBNAIL_UPSCALE_THRESHOLD, false);
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_UINT("menu_timedate_style", &settings->uints.menu_timedate_style, true, DEFAULT_MENU_TIMEDATE_STYLE, false);
|
|
|
|
SETTING_UINT("menu_timedate_date_separator", &settings->uints.menu_timedate_date_separator, true, DEFAULT_MENU_TIMEDATE_DATE_SEPARATOR, false);
|
|
|
|
SETTING_UINT("menu_ticker_type", &settings->uints.menu_ticker_type, true, DEFAULT_MENU_TICKER_TYPE, false);
|
|
|
|
SETTING_UINT("menu_scroll_delay", &settings->uints.menu_scroll_delay, true, DEFAULT_MENU_SCROLL_DELAY, false);
|
|
|
|
SETTING_UINT("menu_screensaver_timeout", &settings->uints.menu_screensaver_timeout, true, DEFAULT_MENU_SCREENSAVER_TIMEOUT, false);
|
2021-04-13 13:58:42 +01:00
|
|
|
#if defined(HAVE_MATERIALUI) || defined(HAVE_XMB) || defined(HAVE_OZONE)
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_UINT("menu_screensaver_animation", &settings->uints.menu_screensaver_animation, true, DEFAULT_MENU_SCREENSAVER_ANIMATION, false);
|
2021-04-13 13:58:42 +01:00
|
|
|
#endif
|
2022-11-10 15:46:44 +01:00
|
|
|
#if defined(HAVE_XMB) || defined(HAVE_OZONE)
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_UINT("menu_remember_selection", &settings->uints.menu_remember_selection, true, DEFAULT_MENU_REMEMBER_SELECTION, false);
|
2022-11-10 15:46:44 +01:00
|
|
|
#endif
|
2020-06-26 18:40:20 +02:00
|
|
|
#ifdef HAVE_RGUI
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_UINT("rgui_menu_color_theme", &settings->uints.menu_rgui_color_theme, true, DEFAULT_RGUI_COLOR_THEME, false);
|
|
|
|
SETTING_UINT("rgui_thumbnail_downscaler", &settings->uints.menu_rgui_thumbnail_downscaler, true, DEFAULT_RGUI_THUMBNAIL_DOWNSCALER, false);
|
|
|
|
SETTING_UINT("rgui_thumbnail_delay", &settings->uints.menu_rgui_thumbnail_delay, true, DEFAULT_RGUI_THUMBNAIL_DELAY, false);
|
|
|
|
SETTING_UINT("rgui_internal_upscale_level", &settings->uints.menu_rgui_internal_upscale_level, true, DEFAULT_RGUI_INTERNAL_UPSCALE_LEVEL, false);
|
|
|
|
SETTING_UINT("rgui_aspect_ratio", &settings->uints.menu_rgui_aspect_ratio, true, DEFAULT_RGUI_ASPECT, false);
|
|
|
|
SETTING_UINT("rgui_aspect_ratio_lock", &settings->uints.menu_rgui_aspect_ratio_lock, true, DEFAULT_RGUI_ASPECT_LOCK, false);
|
|
|
|
SETTING_UINT("rgui_particle_effect", &settings->uints.menu_rgui_particle_effect, true, DEFAULT_RGUI_PARTICLE_EFFECT, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_XMB
|
2020-10-17 20:52:27 +03:00
|
|
|
SETTING_UINT("menu_xmb_animation_opening_main_menu", &settings->uints.menu_xmb_animation_opening_main_menu, true, DEFAULT_XMB_ANIMATION, false);
|
|
|
|
SETTING_UINT("menu_xmb_animation_horizontal_highlight", &settings->uints.menu_xmb_animation_horizontal_highlight, true, DEFAULT_XMB_ANIMATION, false);
|
|
|
|
SETTING_UINT("menu_xmb_animation_move_up_down", &settings->uints.menu_xmb_animation_move_up_down, true, DEFAULT_XMB_ANIMATION, false);
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_UINT("menu_xmb_thumbnail_scale_factor", &settings->uints.menu_xmb_thumbnail_scale_factor, true, DEFAULT_XMB_THUMBNAIL_SCALE_FACTOR, false);
|
|
|
|
SETTING_UINT("menu_xmb_vertical_fade_factor", &settings->uints.menu_xmb_vertical_fade_factor, true, DEFAULT_XMB_VERTICAL_FADE_FACTOR, false);
|
|
|
|
SETTING_UINT("xmb_alpha_factor", &settings->uints.menu_xmb_alpha_factor, true, DEFAULT_XMB_ALPHA_FACTOR, false);
|
|
|
|
SETTING_UINT("xmb_layout", &settings->uints.menu_xmb_layout, true, DEFAULT_XMB_MENU_LAYOUT, false);
|
|
|
|
SETTING_UINT("xmb_theme", &settings->uints.menu_xmb_theme, true, DEFAULT_XMB_ICON_THEME, false);
|
|
|
|
SETTING_UINT("xmb_menu_color_theme", &settings->uints.menu_xmb_color_theme, true, DEFAULT_XMB_THEME, false);
|
|
|
|
SETTING_UINT("menu_shader_pipeline", &settings->uints.menu_xmb_shader_pipeline, true, DEFAULT_MENU_SHADER_PIPELINE, false);
|
|
|
|
SETTING_UINT("menu_font_color_red", &settings->uints.menu_font_color_red, true, DEFAULT_MENU_FONT_COLOR_RED, false);
|
|
|
|
SETTING_UINT("menu_font_color_green", &settings->uints.menu_font_color_green, true, DEFAULT_MENU_FONT_COLOR_GREEN, false);
|
|
|
|
SETTING_UINT("menu_font_color_blue", &settings->uints.menu_font_color_blue, true, DEFAULT_MENU_FONT_COLOR_BLUE, false);
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_MATERIALUI
|
|
|
|
SETTING_UINT("materialui_menu_color_theme", &settings->uints.menu_materialui_color_theme, true, DEFAULT_MATERIALUI_THEME, false);
|
|
|
|
SETTING_UINT("materialui_menu_transition_animation", &settings->uints.menu_materialui_transition_animation, true, DEFAULT_MATERIALUI_TRANSITION_ANIM, false);
|
|
|
|
SETTING_UINT("materialui_thumbnail_view_portrait", &settings->uints.menu_materialui_thumbnail_view_portrait, true, DEFAULT_MATERIALUI_THUMBNAIL_VIEW_PORTRAIT, false);
|
|
|
|
SETTING_UINT("materialui_thumbnail_view_landscape", &settings->uints.menu_materialui_thumbnail_view_landscape, true, DEFAULT_MATERIALUI_THUMBNAIL_VIEW_LANDSCAPE, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
SETTING_UINT("materialui_landscape_layout_optimization", &settings->uints.menu_materialui_landscape_layout_optimization, true, DEFAULT_MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION, false);
|
2023-08-22 18:34:29 +03:00
|
|
|
#endif
|
2020-06-26 18:40:20 +02:00
|
|
|
#ifdef HAVE_OZONE
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_UINT("ozone_menu_color_theme", &settings->uints.menu_ozone_color_theme, true, DEFAULT_OZONE_COLOR_THEME, false);
|
|
|
|
#endif
|
|
|
|
#endif /* HAVE_MENU */
|
|
|
|
|
|
|
|
SETTING_UINT("audio_out_rate", &settings->uints.audio_output_sample_rate, true, DEFAULT_OUTPUT_RATE, false);
|
|
|
|
SETTING_UINT("audio_latency", &settings->uints.audio_latency, false, 0 /* TODO */, false);
|
|
|
|
SETTING_UINT("audio_resampler_quality", &settings->uints.audio_resampler_quality, true, DEFAULT_AUDIO_RESAMPLER_QUALITY_LEVEL, false);
|
|
|
|
SETTING_UINT("audio_block_frames", &settings->uints.audio_block_frames, true, 0, false);
|
|
|
|
SETTING_UINT("midi_volume", &settings->uints.midi_volume, true, DEFAULT_MIDI_VOLUME, false);
|
2023-11-19 18:44:25 +02:00
|
|
|
|
|
|
|
#ifdef HAVE_WASAPI
|
|
|
|
SETTING_UINT("audio_wasapi_sh_buffer_length", &settings->uints.audio_wasapi_sh_buffer_length, true, DEFAULT_WASAPI_SH_BUFFER_LENGTH, false);
|
|
|
|
#endif
|
|
|
|
|
2023-08-22 18:34:29 +03:00
|
|
|
#ifdef HAVE_MICROPHONE
|
|
|
|
SETTING_UINT("microphone_latency", &settings->uints.microphone_latency, false, 0 /* TODO */, false);
|
|
|
|
SETTING_UINT("microphone_resampler_quality", &settings->uints.microphone_resampler_quality, true, DEFAULT_AUDIO_RESAMPLER_QUALITY_LEVEL, false);
|
|
|
|
SETTING_UINT("microphone_block_frames", &settings->uints.microphone_block_frames, true, 0, false);
|
|
|
|
SETTING_UINT("microphone_rate", &settings->uints.microphone_sample_rate, true, DEFAULT_INPUT_RATE, false);
|
|
|
|
#ifdef HAVE_WASAPI
|
|
|
|
SETTING_UINT("microphone_wasapi_sh_buffer_length", &settings->uints.microphone_wasapi_sh_buffer_length, true, DEFAULT_WASAPI_MICROPHONE_SH_BUFFER_LENGTH, false);
|
2020-06-26 18:25:12 +02:00
|
|
|
#endif
|
2022-12-30 15:55:38 +00:00
|
|
|
#endif
|
2023-08-22 18:34:29 +03:00
|
|
|
|
|
|
|
SETTING_UINT("crt_switch_resolution", &settings->uints.crt_switch_resolution, true, DEFAULT_CRT_SWITCH_RESOLUTION, false);
|
|
|
|
SETTING_UINT("crt_switch_resolution_super", &settings->uints.crt_switch_resolution_super, true, DEFAULT_CRT_SWITCH_RESOLUTION_SUPER, false);
|
|
|
|
SETTING_UINT("custom_viewport_width", &settings->video_viewport_custom.width, false, 0 /* TODO */, false);
|
|
|
|
SETTING_UINT("custom_viewport_height", &settings->video_viewport_custom.height, false, 0 /* TODO */, false);
|
|
|
|
SETTING_UINT("custom_viewport_x", (unsigned*)&settings->video_viewport_custom.x, false, 0 /* TODO */, false);
|
|
|
|
SETTING_UINT("custom_viewport_y", (unsigned*)&settings->video_viewport_custom.y, false, 0 /* TODO */, false);
|
|
|
|
SETTING_UINT("aspect_ratio_index", &settings->uints.video_aspect_ratio_idx, true, DEFAULT_ASPECT_RATIO_IDX, false);
|
|
|
|
SETTING_UINT("video_autoswitch_refresh_rate", &settings->uints.video_autoswitch_refresh_rate, true, DEFAULT_AUTOSWITCH_REFRESH_RATE, false);
|
|
|
|
SETTING_UINT("video_monitor_index", &settings->uints.video_monitor_index, true, DEFAULT_MONITOR_INDEX, false);
|
|
|
|
SETTING_UINT("video_windowed_position_x", &settings->uints.window_position_x, true, 0, false);
|
|
|
|
SETTING_UINT("video_windowed_position_y", &settings->uints.window_position_y, true, 0, false);
|
|
|
|
SETTING_UINT("video_windowed_position_width", &settings->uints.window_position_width, true, DEFAULT_WINDOW_WIDTH, false);
|
|
|
|
SETTING_UINT("video_windowed_position_height",&settings->uints.window_position_height, true, DEFAULT_WINDOW_HEIGHT, false);
|
|
|
|
SETTING_UINT("video_window_auto_width_max", &settings->uints.window_auto_width_max, true, DEFAULT_WINDOW_AUTO_WIDTH_MAX, false);
|
|
|
|
SETTING_UINT("video_window_auto_height_max", &settings->uints.window_auto_height_max, true, DEFAULT_WINDOW_AUTO_HEIGHT_MAX, false);
|
|
|
|
#ifdef __WINRT__
|
|
|
|
SETTING_UINT("video_fullscreen_x", &settings->uints.video_fullscreen_x, true, uwp_get_width(), false);
|
|
|
|
SETTING_UINT("video_fullscreen_y", &settings->uints.video_fullscreen_y, true, uwp_get_height(), false);
|
|
|
|
#else
|
|
|
|
SETTING_UINT("video_fullscreen_x", &settings->uints.video_fullscreen_x, true, DEFAULT_FULLSCREEN_X, false);
|
|
|
|
SETTING_UINT("video_fullscreen_y", &settings->uints.video_fullscreen_y, true, DEFAULT_FULLSCREEN_Y, false);
|
|
|
|
#endif
|
|
|
|
SETTING_UINT("video_scale", &settings->uints.video_scale, true, DEFAULT_SCALE, false);
|
|
|
|
SETTING_UINT("video_window_opacity", &settings->uints.video_window_opacity, true, DEFAULT_WINDOW_OPACITY, false);
|
|
|
|
SETTING_UINT("video_shader_delay", &settings->uints.video_shader_delay, true, DEFAULT_SHADER_DELAY, false);
|
|
|
|
#ifdef GEKKO
|
|
|
|
SETTING_UINT("video_viwidth", &settings->uints.video_viwidth, true, DEFAULT_VIDEO_VI_WIDTH, false);
|
|
|
|
SETTING_UINT("video_overscan_correction_top", &settings->uints.video_overscan_correction_top, true, DEFAULT_VIDEO_OVERSCAN_CORRECTION_TOP, false);
|
|
|
|
SETTING_UINT("video_overscan_correction_bottom", &settings->uints.video_overscan_correction_bottom, true, DEFAULT_VIDEO_OVERSCAN_CORRECTION_BOTTOM, false);
|
|
|
|
#endif
|
|
|
|
SETTING_UINT("video_hard_sync_frames", &settings->uints.video_hard_sync_frames, true, DEFAULT_HARD_SYNC_FRAMES, false);
|
|
|
|
SETTING_UINT("video_frame_delay", &settings->uints.video_frame_delay, true, DEFAULT_FRAME_DELAY, false);
|
|
|
|
SETTING_UINT("video_max_swapchain_images", &settings->uints.video_max_swapchain_images, true, DEFAULT_MAX_SWAPCHAIN_IMAGES, false);
|
|
|
|
SETTING_UINT("video_max_frame_latency", &settings->uints.video_max_frame_latency, true, DEFAULT_MAX_FRAME_LATENCY, false);
|
|
|
|
SETTING_UINT("video_black_frame_insertion", &settings->uints.video_black_frame_insertion, true, DEFAULT_BLACK_FRAME_INSERTION, false);
|
2024-01-20 02:11:31 -05:00
|
|
|
SETTING_UINT("video_bfi_dark_frames", &settings->uints.video_bfi_dark_frames, true, DEFAULT_BFI_DARK_FRAMES, false);
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_UINT("video_swap_interval", &settings->uints.video_swap_interval, true, DEFAULT_SWAP_INTERVAL, false);
|
|
|
|
SETTING_UINT("video_rotation", &settings->uints.video_rotation, true, ORIENTATION_NORMAL, false);
|
|
|
|
SETTING_UINT("screen_orientation", &settings->uints.screen_orientation, true, ORIENTATION_NORMAL, false);
|
|
|
|
SETTING_UINT("video_msg_bgcolor_red", &settings->uints.video_msg_bgcolor_red, true, DEFAULT_MESSAGE_BGCOLOR_RED, false);
|
|
|
|
SETTING_UINT("video_msg_bgcolor_green", &settings->uints.video_msg_bgcolor_green, true, DEFAULT_MESSAGE_BGCOLOR_GREEN, false);
|
|
|
|
SETTING_UINT("video_msg_bgcolor_blue", &settings->uints.video_msg_bgcolor_blue, true, DEFAULT_MESSAGE_BGCOLOR_BLUE, false);
|
|
|
|
|
|
|
|
SETTING_UINT("video_stream_port", &settings->uints.video_stream_port, true, RARCH_STREAM_DEFAULT_PORT, false);
|
|
|
|
SETTING_UINT("video_record_threads", &settings->uints.video_record_threads, true, DEFAULT_VIDEO_RECORD_THREADS, false);
|
|
|
|
SETTING_UINT("video_record_quality", &settings->uints.video_record_quality, true, RECORD_CONFIG_TYPE_RECORDING_MED_QUALITY, false);
|
|
|
|
SETTING_UINT("video_stream_quality", &settings->uints.video_stream_quality, true, RECORD_CONFIG_TYPE_STREAMING_MED_QUALITY, false);
|
|
|
|
SETTING_UINT("video_record_scale_factor", &settings->uints.video_record_scale_factor, true, 1, false);
|
|
|
|
SETTING_UINT("video_stream_scale_factor", &settings->uints.video_stream_scale_factor, true, 1, false);
|
|
|
|
|
|
|
|
#ifdef HAVE_NETWORKING
|
|
|
|
SETTING_UINT("streaming_mode", &settings->uints.streaming_mode, true, STREAMING_MODE_TWITCH, false);
|
|
|
|
#endif
|
|
|
|
SETTING_UINT("screen_brightness", &settings->uints.screen_brightness, true, DEFAULT_SCREEN_BRIGHTNESS, false);
|
|
|
|
|
|
|
|
SETTING_UINT("input_bind_timeout", &settings->uints.input_bind_timeout, true, DEFAULT_INPUT_BIND_TIMEOUT, false);
|
|
|
|
SETTING_UINT("input_bind_hold", &settings->uints.input_bind_hold, true, DEFAULT_INPUT_BIND_HOLD, false);
|
|
|
|
SETTING_UINT("input_turbo_period", &settings->uints.input_turbo_period, true, DEFAULT_TURBO_PERIOD, false);
|
|
|
|
SETTING_UINT("input_duty_cycle", &settings->uints.input_turbo_duty_cycle, true, DEFAULT_TURBO_DUTY_CYCLE, false);
|
|
|
|
SETTING_UINT("input_turbo_mode", &settings->uints.input_turbo_mode, true, DEFAULT_TURBO_MODE, false);
|
|
|
|
SETTING_UINT("input_turbo_default_button", &settings->uints.input_turbo_default_button, true, DEFAULT_TURBO_DEFAULT_BTN, false);
|
|
|
|
SETTING_UINT("input_max_users", &settings->uints.input_max_users, true, DEFAULT_INPUT_MAX_USERS, false);
|
|
|
|
SETTING_UINT("input_menu_toggle_gamepad_combo", &settings->uints.input_menu_toggle_gamepad_combo, true, DEFAULT_MENU_TOGGLE_GAMEPAD_COMBO, false);
|
|
|
|
SETTING_UINT("input_poll_type_behavior", &settings->uints.input_poll_type_behavior, true, DEFAULT_INPUT_POLL_TYPE_BEHAVIOR, false);
|
|
|
|
SETTING_UINT("input_quit_gamepad_combo", &settings->uints.input_quit_gamepad_combo, true, DEFAULT_QUIT_GAMEPAD_COMBO, false);
|
|
|
|
SETTING_UINT("input_hotkey_block_delay", &settings->uints.input_hotkey_block_delay, true, DEFAULT_INPUT_HOTKEY_BLOCK_DELAY, false);
|
|
|
|
#ifdef GEKKO
|
|
|
|
SETTING_UINT("input_mouse_scale", &settings->uints.input_mouse_scale, true, DEFAULT_MOUSE_SCALE, false);
|
|
|
|
#endif
|
|
|
|
SETTING_UINT("input_touch_scale", &settings->uints.input_touch_scale, true, DEFAULT_TOUCH_SCALE, false);
|
|
|
|
SETTING_UINT("input_rumble_gain", &settings->uints.input_rumble_gain, true, DEFAULT_RUMBLE_GAIN, false);
|
|
|
|
SETTING_UINT("input_auto_game_focus", &settings->uints.input_auto_game_focus, true, DEFAULT_INPUT_AUTO_GAME_FOCUS, false);
|
|
|
|
#ifdef ANDROID
|
|
|
|
SETTING_UINT("input_block_timeout", &settings->uints.input_block_timeout, true, 0, false);
|
|
|
|
#endif
|
|
|
|
SETTING_UINT("keyboard_gamepad_mapping_type", &settings->uints.input_keyboard_gamepad_mapping_type, true, 1, false);
|
|
|
|
|
|
|
|
#if defined(HAVE_OVERLAY)
|
|
|
|
SETTING_UINT("input_overlay_show_inputs", &settings->uints.input_overlay_show_inputs, true, DEFAULT_OVERLAY_SHOW_INPUTS, false);
|
|
|
|
SETTING_UINT("input_overlay_show_inputs_port", &settings->uints.input_overlay_show_inputs_port, true, DEFAULT_OVERLAY_SHOW_INPUTS_PORT, false);
|
|
|
|
SETTING_UINT("input_overlay_dpad_diagonal_sensitivity", &settings->uints.input_overlay_dpad_diagonal_sensitivity, true, DEFAULT_OVERLAY_DPAD_DIAGONAL_SENSITIVITY, false);
|
|
|
|
SETTING_UINT("input_overlay_abxy_diagonal_sensitivity", &settings->uints.input_overlay_abxy_diagonal_sensitivity, true, DEFAULT_OVERLAY_ABXY_DIAGONAL_SENSITIVITY, false);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_LIBNX
|
|
|
|
SETTING_UINT("split_joycon_p1", &settings->uints.input_split_joycon[0], true, 0, false);
|
|
|
|
SETTING_UINT("split_joycon_p2", &settings->uints.input_split_joycon[1], true, 0, false);
|
|
|
|
SETTING_UINT("split_joycon_p3", &settings->uints.input_split_joycon[2], true, 0, false);
|
|
|
|
SETTING_UINT("split_joycon_p4", &settings->uints.input_split_joycon[3], true, 0, false);
|
|
|
|
SETTING_UINT("split_joycon_p5", &settings->uints.input_split_joycon[4], true, 0, false);
|
|
|
|
SETTING_UINT("split_joycon_p6", &settings->uints.input_split_joycon[5], true, 0, false);
|
|
|
|
SETTING_UINT("split_joycon_p7", &settings->uints.input_split_joycon[6], true, 0, false);
|
|
|
|
SETTING_UINT("split_joycon_p8", &settings->uints.input_split_joycon[7], true, 0, false);
|
|
|
|
#endif
|
|
|
|
|
2020-07-20 00:50:40 +02:00
|
|
|
#ifdef HAVE_SCREENSHOTS
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_UINT("notification_show_screenshot_duration", &settings->uints.notification_show_screenshot_duration, true, DEFAULT_NOTIFICATION_SHOW_SCREENSHOT_DURATION, false);
|
|
|
|
SETTING_UINT("notification_show_screenshot_flash", &settings->uints.notification_show_screenshot_flash, true, DEFAULT_NOTIFICATION_SHOW_SCREENSHOT_FLASH, false);
|
2020-07-20 00:50:40 +02:00
|
|
|
#endif
|
2023-08-22 18:34:29 +03:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
#ifdef HAVE_NETWORKING
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_UINT("netplay_ip_port", &settings->uints.netplay_port, true, RARCH_DEFAULT_PORT, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
SETTING_OVERRIDE(RARCH_OVERRIDE_SETTING_NETPLAY_IP_PORT);
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_UINT("netplay_max_connections", &settings->uints.netplay_max_connections, true, DEFAULT_NETPLAY_MAX_CONNECTIONS, false);
|
|
|
|
SETTING_UINT("netplay_max_ping", &settings->uints.netplay_max_ping, true, DEFAULT_NETPLAY_MAX_PING, false);
|
|
|
|
SETTING_UINT("netplay_chat_color_name", &settings->uints.netplay_chat_color_name, true, DEFAULT_NETPLAY_CHAT_COLOR_NAME, false);
|
|
|
|
SETTING_UINT("netplay_chat_color_msg", &settings->uints.netplay_chat_color_msg, true, DEFAULT_NETPLAY_CHAT_COLOR_MSG, false);
|
|
|
|
SETTING_UINT("netplay_input_latency_frames_min", &settings->uints.netplay_input_latency_frames_min, true, 0, false);
|
|
|
|
SETTING_UINT("netplay_input_latency_frames_range", &settings->uints.netplay_input_latency_frames_range, true, 0, false);
|
|
|
|
SETTING_UINT("netplay_share_digital", &settings->uints.netplay_share_digital, true, DEFAULT_NETPLAY_SHARE_DIGITAL, false);
|
|
|
|
SETTING_UINT("netplay_share_analog", &settings->uints.netplay_share_analog, true, DEFAULT_NETPLAY_SHARE_ANALOG, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
#endif
|
2023-08-22 18:34:29 +03:00
|
|
|
#ifdef HAVE_COMMAND
|
|
|
|
SETTING_UINT("network_cmd_port", &settings->uints.network_cmd_port, true, DEFAULT_NETWORK_CMD_PORT, false);
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_NETWORKGAMEPAD
|
|
|
|
SETTING_UINT("network_remote_base_port", &settings->uints.network_remote_base_port, true, DEFAULT_NETWORK_REMOTE_BASE_PORT, false);
|
|
|
|
#endif
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
#ifdef HAVE_LANGEXTRA
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_UINT("user_language", msg_hash_get_uint(MSG_HASH_USER_LANGUAGE), true, frontend_driver_get_user_language(), false);
|
2020-06-26 18:40:20 +02:00
|
|
|
#endif
|
2021-03-11 23:12:52 -10:00
|
|
|
#ifndef __APPLE__
|
2020-06-26 18:40:20 +02:00
|
|
|
SETTING_UINT("bundle_assets_extract_version_current", &settings->uints.bundle_assets_extract_version_current, true, 0, false);
|
2021-03-11 23:12:52 -10:00
|
|
|
#endif
|
2020-06-26 18:40:20 +02:00
|
|
|
SETTING_UINT("bundle_assets_extract_last_version", &settings->uints.bundle_assets_extract_last_version, true, 0, false);
|
2021-05-25 17:44:32 +01:00
|
|
|
|
2023-08-22 18:34:29 +03:00
|
|
|
|
|
|
|
#ifdef HAVE_CHEEVOS
|
|
|
|
SETTING_UINT("cheevos_appearance_anchor", &settings->uints.cheevos_appearance_anchor, true, DEFAULT_CHEEVOS_APPEARANCE_ANCHOR, false);
|
|
|
|
SETTING_UINT("cheevos_visibility_summary", &settings->uints.cheevos_visibility_summary, true, DEFAULT_CHEEVOS_VISIBILITY_SUMMARY, false);
|
2021-05-25 17:44:32 +01:00
|
|
|
#endif
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_UINT("accessibility_narrator_speech_speed", &settings->uints.accessibility_narrator_speech_speed, true, DEFAULT_ACCESSIBILITY_NARRATOR_SPEECH_SPEED, false);
|
2023-10-24 00:27:06 -07:00
|
|
|
SETTING_UINT("ai_service_mode", &settings->uints.ai_service_mode, true, DEFAULT_AI_SERVICE_MODE, false);
|
|
|
|
SETTING_UINT("ai_service_target_lang", &settings->uints.ai_service_target_lang, true, 0, false);
|
|
|
|
SETTING_UINT("ai_service_source_lang", &settings->uints.ai_service_source_lang, true, 0, false);
|
|
|
|
SETTING_UINT("ai_service_poll_delay", &settings->uints.ai_service_poll_delay, true, DEFAULT_AI_SERVICE_POLL_DELAY, false);
|
|
|
|
SETTING_UINT("ai_service_text_position", &settings->uints.ai_service_text_position, true, DEFAULT_AI_SERVICE_TEXT_POSITION, false);
|
|
|
|
SETTING_UINT("ai_service_text_padding", &settings->uints.ai_service_text_padding, true, DEFAULT_AI_SERVICE_TEXT_PADDING, false);
|
2019-07-17 20:20:39 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
#ifdef HAVE_LIBNX
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_UINT("libnx_overclock", &settings->uints.libnx_overclock, true, SWITCH_DEFAULT_CPU_PROFILE, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
#endif
|
|
|
|
#ifdef _3DS
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_UINT("video_3ds_display_mode", &settings->uints.video_3ds_display_mode, true, DEFAULT_VIDEO_3DS_DISPLAY_MODE, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
#endif
|
2020-10-05 14:31:26 +01:00
|
|
|
#if defined(DINGUX)
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_UINT("video_dingux_ipu_filter_type", &settings->uints.video_dingux_ipu_filter_type, true, DEFAULT_DINGUX_IPU_FILTER_TYPE, false);
|
2021-04-06 14:02:40 +01:00
|
|
|
#if defined(DINGUX_BETA)
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_UINT("video_dingux_refresh_rate", &settings->uints.video_dingux_refresh_rate, true, DEFAULT_DINGUX_REFRESH_RATE, false);
|
2021-04-06 14:02:40 +01:00
|
|
|
#endif
|
2021-10-08 13:53:49 +02:00
|
|
|
#if defined(RS90) || defined(MIYOO)
|
2021-07-21 14:11:42 +01:00
|
|
|
SETTING_UINT("video_dingux_rs90_softfilter_type", &settings->uints.video_dingux_rs90_softfilter_type, true, DEFAULT_DINGUX_RS90_SOFTFILTER_TYPE, false);
|
|
|
|
#endif
|
2020-10-05 14:31:26 +01:00
|
|
|
#endif
|
|
|
|
|
2021-05-12 02:16:25 +02:00
|
|
|
#ifdef HAVE_LAKKA
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_UINT("cpu_scaling_mode", &settings->uints.cpu_scaling_mode, true, 0, false);
|
|
|
|
SETTING_UINT("cpu_min_freq", &settings->uints.cpu_min_freq, true, 1, false);
|
|
|
|
SETTING_UINT("cpu_max_freq", &settings->uints.cpu_max_freq, true, ~0U, false);
|
2021-05-12 02:16:25 +02:00
|
|
|
#endif
|
|
|
|
|
2022-04-02 09:07:40 +02:00
|
|
|
#ifdef HAVE_MIST
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_UINT("steam_rich_presence_format", &settings->uints.steam_rich_presence_format, true, DEFAULT_STEAM_RICH_PRESENCE_FORMAT, false);
|
Add microphone support via a new driver (#14731)
* Some slight fixes
* Update libretro.h
* Log calls to RETRO_ENVIRONMENT_GET_MICROPHONE_INTERFACE
* Finish proof-of-concept for mic support
- It works, but doesn't support floating-point audio yet
- It may need to be resampled, too
* Add macros that aren't available in SDL 2
* Comment out a variable definition for now
- For C89 compliance
* Add some comments for clarity
* Let ALSA tolerate a null new_rate
* Partial ALSA microphone support
- Not yet tested
- Mic is created and destroyed
- Mic can also be paused or unpaused
- Mic is paused or unpaused with the rest of the driver
- Microphone is not yet read
* Install error logging in the ALSA driver
- It defers to RARCH_ERR
* Free the ALSA microphone in alsa_free
* Fix an indent
* First draft of alsa_read_microphone
* Deinitialize SDL Audio in sdl_audio_free
* Save and restore the ALSA error logger
- You should always practice safe global state
* Add newlines to some RARCH_ERRs
* Add some logging
* Check for the mic being active via settings instead of via flags
* Adjusted a log entry to be less misleading
- A frequency of 0Hz looks weird to the uninformed
- In reality, it means the driver used the requested frequency
* Fix an incorrect format string
* Tidy up logging in alsa.c
* Rename audio_enable_microphone to audio_enable_input
* Rename microphone_device to audio_input_device
* Add audio_input_latency and audio_input_block_frames settings
* Add all mic-related settings to the options menu
* Adjust logging for alsa.c
- Log the ALSA library version
- Add errno details
* Refer to the microphone in logs by name
* Use %u instead of %d for some log items
* Add input_samples_buf
* Remove an inaccurate comment
* Change type of input_samples_buf
* Clean up audio_driver_flush_microphone_input
* Comment convert_float_to_s16
- It helped me understand what it's doing
- Turns out it'll work just fine on mono audio
* Don't use the resampler for mic input
* Fix crash in the ALSA driver when reading from a mic
* Update some logging messages
* ALSA support now works for mics
* Reuse some common functions in alsa.c
* Add alsa_thread_microphone_t
* Refactor alsa.c
- Introduce alsa_init_pcm to init any PCM that we're using
- Vastly simplifies the implementation of alsa_init and alsa_init_microphone
- Will be used for the read-based versions next
* Make ALSA logging a little more consistent
* Clean up the mic with alsa_free_microphone if alsa_init_microphone fails
* Remove an unused function
* Move some cleanup in alsa.c to a common function
* First crack at mic support for alsathread
- Refactor some duplicate code into functions
- Use functions introduced in alsa.c
- Create and destroy the mic
* Slight cleanups for clarity
* Implement alsa_thread_set/get_microphone_state
* More work on alsathread
- No more crashing, but the mic just returns silence
* Slight cleanups for clarity
* Add alsa_set_mic_enabled_internal
- For setting the state of a microphone while considering its current state
* Use alsa_set_mic_enabled_internal
* Log a little more info
* Log when the audio driver is started/stopped
* Move base microphone driver code into a new directory
- Add microphone_driver.c to Makefile.common
- Rename functions as needed
* Initialize and deinitialize the microphone driver
* Implement sdl_microphone.c
* Un-const an argument
- In case the driver context needs to do any locking
* Revise comments for microphone_driver.h
* Remove an unimplemented function
* Remove some functions from the mic driver
* Remove mic functions from audio_thread_wrapper
* Remove mic functions from sdl_audio
* Fix microphone_null
* Split the mic code for the alsa audio drivers into microphone drivers
* Fix an extra struct member
* Add a setting for the mic driver
* Add a command to reinitialize the microphone driver
* Rename mic-related settings
* Add DRIVER_MICROPHONE_MASK to DRIVERS_CMD_ALL
* Rename audio_enable_input to microphone_enable
* Remove some labels from qt_options
* Search for microphone_driver within find_driver_nonempty
* Clean up some mic driver code
* Pending mics now return silence
* Adjust some logging and comments
* Some cleanup in the microphone driver
* Invert a flag check
- Oops
* Fix a log message
* Fix the wrong flags being checked
* Slight refactor of wasapi_init_device
- Add a data_flow parameter
- Declare it in a header
- In preparation for WASAPI mic support
* Add some WASAPI macros for _IAudioCaptureClient
* Move some common WASAPI functions to audio/common/wasapi.c
- They'll be used by the mic and the audio drivers
* Add wasapi_log_hr
* Generalize mmdevice_list_new to look for capture devices, too
* Fix a function declaration
* Move driver-specific device_list_new functions into their respective files
* Clean up some declarations
* First draft of wasapi microphone driver
* Add wasapi_microphone_device_list_free
* Change function parameter names to be consistent with microphone_driver
* Partially implement wasapi_microphone_read
- Mostly copied from the audio driver so far
- It doesn't compile yet
- But it'll be beautiful when I'm done with it
* Refactor the mic driver's functions
- Rename get_mic_active to mic_alive
- Split set_mic_active into start_mic and stop_mic
- Refactor the SDL mic driver accordingly
* Edit some WASAPI functions for logging and clarity
* Implement more of the WASAPI mic driver
* Rename write_event to read_event
* Pass the WASAPI driver context to the various read functions
* Mostly implement the read function for the WASAPI mic driver
* Fix a crash in microphone_driver
- Forgot to move the position of the name of null_driver
* Reduce some logging in wasapi common functions
- Only log the chosen audio client format, not all attempted ones
* Add some macro wrappers for IAudioClient methods
* Update mic driver configuration
- Make the mic driver configurable in the menu
- Add config items for WASAPI-related options similar to the audio driver
* Fix a menu entry scrolling through audio devices instead of mic devices
* Add some utility functions
* Expose the new utility functions in wasapi.h
* Add extra logging in the WASAPI common functions
* Add sharemode_name
* Use _IAudioClient_Initialize macro in some places
* Pass channels to wasapi_init_client
- Remember, mics are in mono
* Use _IAudioClient_Initialize macro some more
* Forgot to pass channels in some places
* Add some utility functions
* Forgot an #include
* Add wasapi_select_device_format
* Simplify the format selection logic in wasapi_init_client_sh
* Unset the microphone in wasapi_microphone_close_mic
- Ought to prevent a potential segfault
* Simplify some logging
* Fix incorrect value being passed to _IAudioCaptureClient_ReleaseBuffer
* Remove some unneeded logging
* Add some values to hresult_name
* Polish up wasapi_select_device_format
- Test for formats manually when Windows can't
- Add some debug logging
- Check for channels
* Compute the fields of WAVEFORMATEXTENSIBLE correctly
- As per the doc's stated requirements
* Simplify logic for WASAPI client creation
* Fix a potential hang in wasapi_microphone_read_shared_buffered
* Stop the microphone if the driver is stopped
* Don't name the microphone event
* Ensure that wasapi_init_client reports the correct format and rate
* Implement exclusive microphone read access for WASAPI
* Add _IAudioCaptureClient_GetNextPacketSize macro
* Organize cases in hresult_name
* Clear some extra fields if wasapi_set_format is setting a Pcm format
* Adjust some logs
* Adjust some logs
* Remove unneeded local vars
* Add a log
* Update wasapi.c
* Update wasapi.c
* Fix shared-mode mic support in WASAPI producing broken input
- Turns out it had nothing to do with shared mode
* Reuse a common function
- Remove wasapi_microphone_read_shared_buffered
- Rename wasapi_microphone_read_exclusive to wasapi_microphone_read_buffered
* Remove some code I was using for test purposes
* Clarify some language
* Double the default shared-mode mic buffer length
* Split getting a device's name into a separate function, then use it
* Fix the ALSA mic drivers
- To comply with changes I previously made to the mic driver interface
* Remove unused synchronization primitives from the SDL microphone driver
* Add sdl_microphone_mic_use_float
* Document audio_driver_state_flags
- I needed to understand these to see if similar flags were required for the mic driver
* Remove an unused function in wasapi.c
* Add and document flags in microphone_driver.h
* Remove driver-specific mic start/stop functions
- The mic driver itself doesn't do much processing
- That honor goes to individual mics
* Remove some unused fields in microphone_driver.h
* Add CMD_EVENT_MICROPHONE_STOP/START
* Remove unused functions from microphone_null
* Change how the mic driver state is referenced in some places
* Simplify the SDL microphone driver
- The driver backend no longer keeps a reference to the mic (the frontend does that)
- Remove functions that are no longer needed
- Don't track paused state, just query the mic itself
* Simplify the WASAPI microphone driver
- Don't track the driver running state or the microphone handle, the frontend does that now
- Remove support for unbuffered input (hunterk suggested that it wasn't necessary)
* Make microphone_wasapi_sh_buffer_length a uint, not an int
- It won't be negative anymore
- 0 now represents the default value
* Make the microphone frontend more robust
- Improve documentation for how various functions should be implemented
- Closes all microphones before freeing the driver (so backends don't have to)
- Tracks the enabled state of each microphone, so backends don't have to (but they still can)
* Stop the mic driver in core_unload_game
* Ensure mic support is compatible with the revised menu code
* Move alsa.h into audio/common
* Remove RETRO_ENVIRONMENT_GET_MICROPHONE_ENABLED
- It was never really needed
* Refactor the ALSA microphone driver
- Move common ALSA functions to audio/common/alsa.c
- Replace alsa_set_mic_enabled_internal with alsa_start/stop_pcm
- Don't track the microphone handle in the ALSA driver context
- Remove unneeded fields
* Move some common alsathread code into audio/common/alsathread.c
* Change return type of mic_driver_open_mic_internal to bool
* First crack at resampling mic input
* Remove an extraneous check
- I think something distracted me when I was writing this line
* Add stereo/mono conversion functions
* Make alsa_start_pcm and alsa_stop_pcm more robust
- They now return success if the stream is already running and stopped, respectively
* Revise some mic-related comments in libretro.h
* First crack at resampling mic input
* Simplify an expression
* Simplify an expression
* Fix a log tag
* Allow mic resampler to be configured separately from audio resampler
* Add some comments
* Set the source ratio to something sensible
* Stop deadlock in `alsathread` mic driver
* Allow mics to be initialized even when core is loaded from CLI
- When loading content from CLI, the drivers are initialized a little differently
- That threw off the mic initialization code
* Rename the functions in retro_microphone_interface
* Revise some mic-related comments in libretro.h
* Update retro_microphone_interface
- Add get_mic_rate
- Add a parameter to open_mic
- The modifications don't do anything yet
* Use parameter objects in the microphone handle
* Replace get_mic_rate with get_params
* Add a microphone interface version
* Remove part of a comment
* Set the effective params in mic_driver_microphone_handle_init
* Drop a stray newline
* Change where the mic interface is zeroed
- I was accidentally throwing out the version that the core was asking for
* Reduce logspam for wasapi_set_nonblock_state
- Now it only logs when the sync mode is changed
* Change DEFAULT_WASAPI_SH_BUFFER_LENGTH to 0
- -16 is no longer a valid value
* Set the new_rate in wasapi_init
* Change description of microphone sample rate in the settings
* First attempt at resampling configured mic input
* Forgot a section
* Fix some input samples being skipped
* Rename a variable for clarity
* Add microphone.outgoing_samples
* Update the mic driver
- Processed samples are now buffered
- The resampler is skipped if the ratio is (very close to) 1
* Remove part of a comment
* Update some comments in audio_resampler.h
* Slightly refactor the SDL microphone driver
- Move SDL_AudioSpec to a field of sdl_microphone_handle_t
- Allow SDL to change the requested format and sample rate
- Request floating-point input
- Implement sdl_microphone_mic_use_float
* Fix a non-C89-compliant declaration
* Add new files to griffin.c
* Remove a C++-style comment
* Add two more files to griffin.c
* Remove some unneeded declarations in microphone_driver.h
* Remove a stray comma in configuration.c
- For C89 compliance
* Fix compilation on some platforms
* Change some function signatures
* Make the ALSA drivers always set the audio rate
* Fix the alsathread mic driver
* Make state_manager_frame_is_reversed return false if HAVE_REWIND isn't defined
* Mute the microphone if the core is running in fast-forward, slow-mo, or rewind
* Clarify a comment
* Clarify a comment
* Add a comment
* Don't allocate memory for slowmo samples in the mic driver
- We're not supporting slowmo for mics, so it's not needed
* Fix a {
* Add my name to AUTHORS.h
* Add driver_lifetime_flags
- For drivers that have special setup/teardown needs
* Ensure that resetting the mic driver maintains active mic handles
- Prevents fullscreen toggle from stopping all mic input
* Update CHANGES.md
* Move some default microphone settings to a new part of the config file
* Ensure that RetroArch can use the audio format that Windows suggests
* Remove references to mic support in the SDL audio driver
* Remove unused WASAPI functions
* Return failure if RetroArch couldn't select a WASAPI format
* Ensure that Windows uses the WASAPI mic driver by default
* Treat disabled mic support as a warning, not an error
* Clarify some WASAPI-related microphone settings
* Remove some unused variables
* Add or revise microphone-related comments
* Rearrange doc comments for microphone types in libretro.h
* Remove a space
* Remove some unused flags
* Remove ALSA error logger
- It was never used anyway
* Remove unneeded microphone-related arguments
* Document a parameter
* Remove a logging call
* Add a constant for the microphone's shared buffer length for WASAPI
* Fix stylistic inconsistencies
* Make mic_driver_get_sample_size a macro instead of a function
* Move the microphone implementation to the audio directory
* Make microphone support optional (but enabled by default)
* Fix the griffin build
2023-06-06 15:55:06 -04:00
|
|
|
#endif
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
*size = count;
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
return tmp;
|
|
|
|
}
|
2016-08-29 16:57:33 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
static struct config_size_setting *populate_settings_size(
|
|
|
|
settings_t *settings, int *size)
|
|
|
|
{
|
|
|
|
unsigned count = 0;
|
|
|
|
struct config_size_setting *tmp = (struct config_size_setting*)calloc((*size + 1), sizeof(struct config_size_setting));
|
2016-08-29 19:10:00 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
if (!tmp)
|
|
|
|
return NULL;
|
2016-08-29 19:10:00 +02:00
|
|
|
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_SIZE("rewind_buffer_size", &settings->sizes.rewind_buffer_size, true, DEFAULT_REWIND_BUFFER_SIZE, false);
|
2016-08-30 04:40:13 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
*size = count;
|
2017-09-09 21:35:09 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
return tmp;
|
2020-06-23 22:27:40 +02:00
|
|
|
}
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
static struct config_int_setting *populate_settings_int(
|
|
|
|
settings_t *settings, int *size)
|
2011-01-19 12:54:19 +01:00
|
|
|
{
|
2020-06-26 18:40:20 +02:00
|
|
|
unsigned count = 0;
|
|
|
|
struct config_int_setting *tmp = (struct config_int_setting*)calloc((*size + 1), sizeof(struct config_int_setting));
|
|
|
|
|
|
|
|
if (!tmp)
|
|
|
|
return NULL;
|
|
|
|
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_INT("content_favorites_size", &settings->ints.content_favorites_size, true, DEFAULT_CONTENT_FAVORITES_SIZE, false);
|
|
|
|
SETTING_INT("state_slot", &settings->ints.state_slot, false, 0, false);
|
|
|
|
SETTING_INT("replay_slot", &settings->ints.replay_slot, false, 0, false);
|
|
|
|
|
|
|
|
#ifdef HAVE_XMB
|
|
|
|
SETTING_INT("menu_xmb_title_margin", &settings->ints.menu_xmb_title_margin, true, DEFAULT_XMB_TITLE_MARGIN, false);
|
|
|
|
SETTING_INT("menu_xmb_title_margin_horizontal_offset", &settings->ints.menu_xmb_title_margin_horizontal_offset, true, DEFAULT_XMB_TITLE_MARGIN_HORIZONTAL_OFFSET, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
#endif
|
2023-08-22 18:34:29 +03:00
|
|
|
|
|
|
|
SETTING_INT("crt_switch_center_adjust", &settings->ints.crt_switch_center_adjust, false, DEFAULT_CRT_SWITCH_CENTER_ADJUST, false);
|
|
|
|
SETTING_INT("crt_switch_porch_adjust", &settings->ints.crt_switch_porch_adjust, false, DEFAULT_CRT_SWITCH_PORCH_ADJUST, false);
|
|
|
|
#ifdef HAVE_WINDOW_OFFSET
|
|
|
|
SETTING_INT("video_window_offset_x", &settings->ints.video_window_offset_x, true, DEFAULT_WINDOW_OFFSET_X, false);
|
|
|
|
SETTING_INT("video_window_offset_y", &settings->ints.video_window_offset_y, true, DEFAULT_WINDOW_OFFSET_Y, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
#endif
|
2023-08-22 18:34:29 +03:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
#ifdef HAVE_D3D10
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_INT("d3d10_gpu_index", &settings->ints.d3d10_gpu_index, true, DEFAULT_D3D10_GPU_INDEX, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_D3D11
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_INT("d3d11_gpu_index", &settings->ints.d3d11_gpu_index, true, DEFAULT_D3D11_GPU_INDEX, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_D3D12
|
2023-08-22 18:34:29 +03:00
|
|
|
SETTING_INT("d3d12_gpu_index", &settings->ints.d3d12_gpu_index, true, DEFAULT_D3D12_GPU_INDEX, false);
|
2021-08-11 19:13:40 +02:00
|
|
|
#endif
|
2023-08-22 18:34:29 +03:00
|
|
|
#ifdef HAVE_VULKAN
|
|
|
|
SETTING_INT("vulkan_gpu_index", &settings->ints.vulkan_gpu_index, true, DEFAULT_VULKAN_GPU_INDEX, false);
|
2020-06-26 18:40:20 +02:00
|
|
|
#endif
|
2023-08-22 18:34:29 +03:00
|
|
|
|
|
|
|
#ifdef HAVE_NETWORKING
|
|
|
|
SETTING_INT("netplay_check_frames", &settings->ints.netplay_check_frames, true, DEFAULT_NETPLAY_CHECK_FRAMES, false);
|
|
|
|
SETTING_OVERRIDE(RARCH_OVERRIDE_SETTING_NETPLAY_CHECK_FRAMES);
|
2022-09-26 13:57:20 +03:00
|
|
|
#endif
|
2023-08-22 18:34:29 +03:00
|
|
|
|
|
|
|
#ifdef _3DS
|
|
|
|
SETTING_INT("bottom_font_color_red", &settings->ints.bottom_font_color_red, true, DEFAULT_BOTTOM_FONT_COLOR, false);
|
|
|
|
SETTING_INT("bottom_font_color_green", &settings->ints.bottom_font_color_green, true, DEFAULT_BOTTOM_FONT_COLOR, false);
|
|
|
|
SETTING_INT("bottom_font_color_blue", &settings->ints.bottom_font_color_blue, true, DEFAULT_BOTTOM_FONT_COLOR, false);
|
|
|
|
SETTING_INT("bottom_font_color_opacity", &settings->ints.bottom_font_color_opacity, true, DEFAULT_BOTTOM_FONT_COLOR, false);
|
2022-08-17 08:23:07 +02:00
|
|
|
#endif
|
2023-08-22 18:34:29 +03:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
*size = count;
|
2015-09-28 18:12:02 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
return tmp;
|
2020-06-26 18:25:12 +02:00
|
|
|
}
|
2016-09-17 14:14:58 +02:00
|
|
|
|
2021-04-08 01:54:44 +02:00
|
|
|
static void video_driver_default_settings(global_t *global)
|
2020-06-26 18:25:12 +02:00
|
|
|
{
|
2020-06-26 18:40:20 +02:00
|
|
|
if (!global)
|
2020-06-26 18:25:12 +02:00
|
|
|
return;
|
2010-12-29 19:00:21 +01:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
global->console.screen.gamma_correction = DEFAULT_GAMMA;
|
|
|
|
global->console.flickerfilter_enable = false;
|
|
|
|
global->console.softfilter_enable = false;
|
2016-09-03 08:12:40 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
global->console.screen.resolutions.current.id = 0;
|
2020-06-26 18:25:12 +02:00
|
|
|
}
|
2016-09-03 08:12:40 +02:00
|
|
|
|
2020-06-26 18:25:12 +02:00
|
|
|
/**
|
|
|
|
* config_set_defaults:
|
|
|
|
*
|
|
|
|
* Set 'default' configuration values.
|
|
|
|
**/
|
|
|
|
void config_set_defaults(void *data)
|
|
|
|
{
|
2023-02-18 17:04:02 +01:00
|
|
|
size_t i;
|
2020-06-26 18:25:12 +02:00
|
|
|
#ifdef HAVE_MENU
|
|
|
|
static bool first_initialized = true;
|
|
|
|
#endif
|
2023-05-30 12:19:53 +02:00
|
|
|
global_t *global = (global_t*)data;
|
|
|
|
settings_t *settings = config_st;
|
|
|
|
recording_state_t *recording_st = recording_state_get_ptr();
|
|
|
|
int bool_settings_size = sizeof(settings->bools) / sizeof(settings->bools.placeholder);
|
|
|
|
int float_settings_size = sizeof(settings->floats) / sizeof(settings->floats.placeholder);
|
|
|
|
int int_settings_size = sizeof(settings->ints) / sizeof(settings->ints.placeholder);
|
|
|
|
int uint_settings_size = sizeof(settings->uints) / sizeof(settings->uints.placeholder);
|
|
|
|
int size_settings_size = sizeof(settings->sizes) / sizeof(settings->sizes.placeholder);
|
|
|
|
const char *def_video = config_get_default_video();
|
|
|
|
const char *def_audio = config_get_default_audio();
|
Add microphone support via a new driver (#14731)
* Some slight fixes
* Update libretro.h
* Log calls to RETRO_ENVIRONMENT_GET_MICROPHONE_INTERFACE
* Finish proof-of-concept for mic support
- It works, but doesn't support floating-point audio yet
- It may need to be resampled, too
* Add macros that aren't available in SDL 2
* Comment out a variable definition for now
- For C89 compliance
* Add some comments for clarity
* Let ALSA tolerate a null new_rate
* Partial ALSA microphone support
- Not yet tested
- Mic is created and destroyed
- Mic can also be paused or unpaused
- Mic is paused or unpaused with the rest of the driver
- Microphone is not yet read
* Install error logging in the ALSA driver
- It defers to RARCH_ERR
* Free the ALSA microphone in alsa_free
* Fix an indent
* First draft of alsa_read_microphone
* Deinitialize SDL Audio in sdl_audio_free
* Save and restore the ALSA error logger
- You should always practice safe global state
* Add newlines to some RARCH_ERRs
* Add some logging
* Check for the mic being active via settings instead of via flags
* Adjusted a log entry to be less misleading
- A frequency of 0Hz looks weird to the uninformed
- In reality, it means the driver used the requested frequency
* Fix an incorrect format string
* Tidy up logging in alsa.c
* Rename audio_enable_microphone to audio_enable_input
* Rename microphone_device to audio_input_device
* Add audio_input_latency and audio_input_block_frames settings
* Add all mic-related settings to the options menu
* Adjust logging for alsa.c
- Log the ALSA library version
- Add errno details
* Refer to the microphone in logs by name
* Use %u instead of %d for some log items
* Add input_samples_buf
* Remove an inaccurate comment
* Change type of input_samples_buf
* Clean up audio_driver_flush_microphone_input
* Comment convert_float_to_s16
- It helped me understand what it's doing
- Turns out it'll work just fine on mono audio
* Don't use the resampler for mic input
* Fix crash in the ALSA driver when reading from a mic
* Update some logging messages
* ALSA support now works for mics
* Reuse some common functions in alsa.c
* Add alsa_thread_microphone_t
* Refactor alsa.c
- Introduce alsa_init_pcm to init any PCM that we're using
- Vastly simplifies the implementation of alsa_init and alsa_init_microphone
- Will be used for the read-based versions next
* Make ALSA logging a little more consistent
* Clean up the mic with alsa_free_microphone if alsa_init_microphone fails
* Remove an unused function
* Move some cleanup in alsa.c to a common function
* First crack at mic support for alsathread
- Refactor some duplicate code into functions
- Use functions introduced in alsa.c
- Create and destroy the mic
* Slight cleanups for clarity
* Implement alsa_thread_set/get_microphone_state
* More work on alsathread
- No more crashing, but the mic just returns silence
* Slight cleanups for clarity
* Add alsa_set_mic_enabled_internal
- For setting the state of a microphone while considering its current state
* Use alsa_set_mic_enabled_internal
* Log a little more info
* Log when the audio driver is started/stopped
* Move base microphone driver code into a new directory
- Add microphone_driver.c to Makefile.common
- Rename functions as needed
* Initialize and deinitialize the microphone driver
* Implement sdl_microphone.c
* Un-const an argument
- In case the driver context needs to do any locking
* Revise comments for microphone_driver.h
* Remove an unimplemented function
* Remove some functions from the mic driver
* Remove mic functions from audio_thread_wrapper
* Remove mic functions from sdl_audio
* Fix microphone_null
* Split the mic code for the alsa audio drivers into microphone drivers
* Fix an extra struct member
* Add a setting for the mic driver
* Add a command to reinitialize the microphone driver
* Rename mic-related settings
* Add DRIVER_MICROPHONE_MASK to DRIVERS_CMD_ALL
* Rename audio_enable_input to microphone_enable
* Remove some labels from qt_options
* Search for microphone_driver within find_driver_nonempty
* Clean up some mic driver code
* Pending mics now return silence
* Adjust some logging and comments
* Some cleanup in the microphone driver
* Invert a flag check
- Oops
* Fix a log message
* Fix the wrong flags being checked
* Slight refactor of wasapi_init_device
- Add a data_flow parameter
- Declare it in a header
- In preparation for WASAPI mic support
* Add some WASAPI macros for _IAudioCaptureClient
* Move some common WASAPI functions to audio/common/wasapi.c
- They'll be used by the mic and the audio drivers
* Add wasapi_log_hr
* Generalize mmdevice_list_new to look for capture devices, too
* Fix a function declaration
* Move driver-specific device_list_new functions into their respective files
* Clean up some declarations
* First draft of wasapi microphone driver
* Add wasapi_microphone_device_list_free
* Change function parameter names to be consistent with microphone_driver
* Partially implement wasapi_microphone_read
- Mostly copied from the audio driver so far
- It doesn't compile yet
- But it'll be beautiful when I'm done with it
* Refactor the mic driver's functions
- Rename get_mic_active to mic_alive
- Split set_mic_active into start_mic and stop_mic
- Refactor the SDL mic driver accordingly
* Edit some WASAPI functions for logging and clarity
* Implement more of the WASAPI mic driver
* Rename write_event to read_event
* Pass the WASAPI driver context to the various read functions
* Mostly implement the read function for the WASAPI mic driver
* Fix a crash in microphone_driver
- Forgot to move the position of the name of null_driver
* Reduce some logging in wasapi common functions
- Only log the chosen audio client format, not all attempted ones
* Add some macro wrappers for IAudioClient methods
* Update mic driver configuration
- Make the mic driver configurable in the menu
- Add config items for WASAPI-related options similar to the audio driver
* Fix a menu entry scrolling through audio devices instead of mic devices
* Add some utility functions
* Expose the new utility functions in wasapi.h
* Add extra logging in the WASAPI common functions
* Add sharemode_name
* Use _IAudioClient_Initialize macro in some places
* Pass channels to wasapi_init_client
- Remember, mics are in mono
* Use _IAudioClient_Initialize macro some more
* Forgot to pass channels in some places
* Add some utility functions
* Forgot an #include
* Add wasapi_select_device_format
* Simplify the format selection logic in wasapi_init_client_sh
* Unset the microphone in wasapi_microphone_close_mic
- Ought to prevent a potential segfault
* Simplify some logging
* Fix incorrect value being passed to _IAudioCaptureClient_ReleaseBuffer
* Remove some unneeded logging
* Add some values to hresult_name
* Polish up wasapi_select_device_format
- Test for formats manually when Windows can't
- Add some debug logging
- Check for channels
* Compute the fields of WAVEFORMATEXTENSIBLE correctly
- As per the doc's stated requirements
* Simplify logic for WASAPI client creation
* Fix a potential hang in wasapi_microphone_read_shared_buffered
* Stop the microphone if the driver is stopped
* Don't name the microphone event
* Ensure that wasapi_init_client reports the correct format and rate
* Implement exclusive microphone read access for WASAPI
* Add _IAudioCaptureClient_GetNextPacketSize macro
* Organize cases in hresult_name
* Clear some extra fields if wasapi_set_format is setting a Pcm format
* Adjust some logs
* Adjust some logs
* Remove unneeded local vars
* Add a log
* Update wasapi.c
* Update wasapi.c
* Fix shared-mode mic support in WASAPI producing broken input
- Turns out it had nothing to do with shared mode
* Reuse a common function
- Remove wasapi_microphone_read_shared_buffered
- Rename wasapi_microphone_read_exclusive to wasapi_microphone_read_buffered
* Remove some code I was using for test purposes
* Clarify some language
* Double the default shared-mode mic buffer length
* Split getting a device's name into a separate function, then use it
* Fix the ALSA mic drivers
- To comply with changes I previously made to the mic driver interface
* Remove unused synchronization primitives from the SDL microphone driver
* Add sdl_microphone_mic_use_float
* Document audio_driver_state_flags
- I needed to understand these to see if similar flags were required for the mic driver
* Remove an unused function in wasapi.c
* Add and document flags in microphone_driver.h
* Remove driver-specific mic start/stop functions
- The mic driver itself doesn't do much processing
- That honor goes to individual mics
* Remove some unused fields in microphone_driver.h
* Add CMD_EVENT_MICROPHONE_STOP/START
* Remove unused functions from microphone_null
* Change how the mic driver state is referenced in some places
* Simplify the SDL microphone driver
- The driver backend no longer keeps a reference to the mic (the frontend does that)
- Remove functions that are no longer needed
- Don't track paused state, just query the mic itself
* Simplify the WASAPI microphone driver
- Don't track the driver running state or the microphone handle, the frontend does that now
- Remove support for unbuffered input (hunterk suggested that it wasn't necessary)
* Make microphone_wasapi_sh_buffer_length a uint, not an int
- It won't be negative anymore
- 0 now represents the default value
* Make the microphone frontend more robust
- Improve documentation for how various functions should be implemented
- Closes all microphones before freeing the driver (so backends don't have to)
- Tracks the enabled state of each microphone, so backends don't have to (but they still can)
* Stop the mic driver in core_unload_game
* Ensure mic support is compatible with the revised menu code
* Move alsa.h into audio/common
* Remove RETRO_ENVIRONMENT_GET_MICROPHONE_ENABLED
- It was never really needed
* Refactor the ALSA microphone driver
- Move common ALSA functions to audio/common/alsa.c
- Replace alsa_set_mic_enabled_internal with alsa_start/stop_pcm
- Don't track the microphone handle in the ALSA driver context
- Remove unneeded fields
* Move some common alsathread code into audio/common/alsathread.c
* Change return type of mic_driver_open_mic_internal to bool
* First crack at resampling mic input
* Remove an extraneous check
- I think something distracted me when I was writing this line
* Add stereo/mono conversion functions
* Make alsa_start_pcm and alsa_stop_pcm more robust
- They now return success if the stream is already running and stopped, respectively
* Revise some mic-related comments in libretro.h
* First crack at resampling mic input
* Simplify an expression
* Simplify an expression
* Fix a log tag
* Allow mic resampler to be configured separately from audio resampler
* Add some comments
* Set the source ratio to something sensible
* Stop deadlock in `alsathread` mic driver
* Allow mics to be initialized even when core is loaded from CLI
- When loading content from CLI, the drivers are initialized a little differently
- That threw off the mic initialization code
* Rename the functions in retro_microphone_interface
* Revise some mic-related comments in libretro.h
* Update retro_microphone_interface
- Add get_mic_rate
- Add a parameter to open_mic
- The modifications don't do anything yet
* Use parameter objects in the microphone handle
* Replace get_mic_rate with get_params
* Add a microphone interface version
* Remove part of a comment
* Set the effective params in mic_driver_microphone_handle_init
* Drop a stray newline
* Change where the mic interface is zeroed
- I was accidentally throwing out the version that the core was asking for
* Reduce logspam for wasapi_set_nonblock_state
- Now it only logs when the sync mode is changed
* Change DEFAULT_WASAPI_SH_BUFFER_LENGTH to 0
- -16 is no longer a valid value
* Set the new_rate in wasapi_init
* Change description of microphone sample rate in the settings
* First attempt at resampling configured mic input
* Forgot a section
* Fix some input samples being skipped
* Rename a variable for clarity
* Add microphone.outgoing_samples
* Update the mic driver
- Processed samples are now buffered
- The resampler is skipped if the ratio is (very close to) 1
* Remove part of a comment
* Update some comments in audio_resampler.h
* Slightly refactor the SDL microphone driver
- Move SDL_AudioSpec to a field of sdl_microphone_handle_t
- Allow SDL to change the requested format and sample rate
- Request floating-point input
- Implement sdl_microphone_mic_use_float
* Fix a non-C89-compliant declaration
* Add new files to griffin.c
* Remove a C++-style comment
* Add two more files to griffin.c
* Remove some unneeded declarations in microphone_driver.h
* Remove a stray comma in configuration.c
- For C89 compliance
* Fix compilation on some platforms
* Change some function signatures
* Make the ALSA drivers always set the audio rate
* Fix the alsathread mic driver
* Make state_manager_frame_is_reversed return false if HAVE_REWIND isn't defined
* Mute the microphone if the core is running in fast-forward, slow-mo, or rewind
* Clarify a comment
* Clarify a comment
* Add a comment
* Don't allocate memory for slowmo samples in the mic driver
- We're not supporting slowmo for mics, so it's not needed
* Fix a {
* Add my name to AUTHORS.h
* Add driver_lifetime_flags
- For drivers that have special setup/teardown needs
* Ensure that resetting the mic driver maintains active mic handles
- Prevents fullscreen toggle from stopping all mic input
* Update CHANGES.md
* Move some default microphone settings to a new part of the config file
* Ensure that RetroArch can use the audio format that Windows suggests
* Remove references to mic support in the SDL audio driver
* Remove unused WASAPI functions
* Return failure if RetroArch couldn't select a WASAPI format
* Ensure that Windows uses the WASAPI mic driver by default
* Treat disabled mic support as a warning, not an error
* Clarify some WASAPI-related microphone settings
* Remove some unused variables
* Add or revise microphone-related comments
* Rearrange doc comments for microphone types in libretro.h
* Remove a space
* Remove some unused flags
* Remove ALSA error logger
- It was never used anyway
* Remove unneeded microphone-related arguments
* Document a parameter
* Remove a logging call
* Add a constant for the microphone's shared buffer length for WASAPI
* Fix stylistic inconsistencies
* Make mic_driver_get_sample_size a macro instead of a function
* Move the microphone implementation to the audio directory
* Make microphone support optional (but enabled by default)
* Fix the griffin build
2023-06-06 15:55:06 -04:00
|
|
|
#ifdef HAVE_MICROPHONE
|
|
|
|
const char *def_microphone = config_get_default_microphone();
|
|
|
|
#endif
|
2023-05-30 12:19:53 +02:00
|
|
|
const char *def_audio_resampler = config_get_default_audio_resampler();
|
|
|
|
const char *def_input = config_get_default_input();
|
|
|
|
const char *def_joypad = config_get_default_joypad();
|
2020-06-26 18:25:12 +02:00
|
|
|
#ifdef HAVE_MENU
|
2023-05-30 12:19:53 +02:00
|
|
|
const char *def_menu = config_get_default_menu();
|
|
|
|
#endif
|
|
|
|
const char *def_camera = config_get_default_camera();
|
|
|
|
const char *def_bluetooth = config_get_default_bluetooth();
|
|
|
|
const char *def_wifi = config_get_default_wifi();
|
|
|
|
const char *def_led = config_get_default_led();
|
|
|
|
const char *def_location = config_get_default_location();
|
|
|
|
const char *def_record = config_get_default_record();
|
|
|
|
const char *def_midi = config_get_default_midi();
|
|
|
|
const char *def_mitm = DEFAULT_NETPLAY_MITM_SERVER;
|
|
|
|
struct video_viewport *custom_vp = &settings->video_viewport_custom;
|
2022-11-20 08:26:34 +02:00
|
|
|
struct config_float_setting *float_settings = populate_settings_float (settings, &float_settings_size);
|
2020-06-26 18:25:12 +02:00
|
|
|
struct config_bool_setting *bool_settings = populate_settings_bool (settings, &bool_settings_size);
|
|
|
|
struct config_int_setting *int_settings = populate_settings_int (settings, &int_settings_size);
|
2022-11-20 08:26:34 +02:00
|
|
|
struct config_uint_setting *uint_settings = populate_settings_uint (settings, &uint_settings_size);
|
|
|
|
struct config_size_setting *size_settings = populate_settings_size (settings, &size_settings_size);
|
2016-07-25 08:01:47 +02:00
|
|
|
|
2020-06-26 18:25:12 +02:00
|
|
|
if (bool_settings && (bool_settings_size > 0))
|
2016-07-24 09:43:16 +02:00
|
|
|
{
|
2020-06-26 18:25:12 +02:00
|
|
|
for (i = 0; i < (unsigned)bool_settings_size; i++)
|
|
|
|
{
|
|
|
|
if (bool_settings[i].def_enable)
|
|
|
|
*bool_settings[i].ptr = bool_settings[i].def;
|
|
|
|
}
|
|
|
|
|
|
|
|
free(bool_settings);
|
2016-07-24 09:43:16 +02:00
|
|
|
}
|
2016-09-17 14:14:58 +02:00
|
|
|
|
2020-06-26 18:25:12 +02:00
|
|
|
if (int_settings && (int_settings_size > 0))
|
2016-07-25 08:01:47 +02:00
|
|
|
{
|
2020-06-26 18:25:12 +02:00
|
|
|
for (i = 0; i < (unsigned)int_settings_size; i++)
|
|
|
|
{
|
|
|
|
if (int_settings[i].def_enable)
|
|
|
|
*int_settings[i].ptr = int_settings[i].def;
|
|
|
|
}
|
2016-10-09 09:05:41 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
free(int_settings);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (uint_settings && (uint_settings_size > 0))
|
|
|
|
{
|
|
|
|
for (i = 0; i < (unsigned)uint_settings_size; i++)
|
|
|
|
{
|
|
|
|
if (uint_settings[i].def_enable)
|
|
|
|
*uint_settings[i].ptr = uint_settings[i].def;
|
|
|
|
}
|
|
|
|
|
|
|
|
free(uint_settings);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (size_settings && (size_settings_size > 0))
|
|
|
|
{
|
|
|
|
for (i = 0; i < (unsigned)size_settings_size; i++)
|
|
|
|
{
|
|
|
|
if (size_settings[i].def_enable)
|
|
|
|
*size_settings[i].ptr = size_settings[i].def;
|
|
|
|
}
|
|
|
|
|
|
|
|
free(size_settings);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (float_settings && (float_settings_size > 0))
|
|
|
|
{
|
|
|
|
for (i = 0; i < (unsigned)float_settings_size; i++)
|
|
|
|
{
|
|
|
|
if (float_settings[i].def_enable)
|
|
|
|
*float_settings[i].ptr = float_settings[i].def;
|
|
|
|
}
|
|
|
|
|
|
|
|
free(float_settings);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (def_camera)
|
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->arrays.camera_driver,
|
|
|
|
def_camera);
|
2020-06-17 14:56:44 +03:00
|
|
|
if (def_bluetooth)
|
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->arrays.bluetooth_driver,
|
|
|
|
def_bluetooth);
|
2020-06-26 18:40:20 +02:00
|
|
|
if (def_wifi)
|
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->arrays.wifi_driver,
|
|
|
|
def_wifi);
|
|
|
|
if (def_led)
|
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->arrays.led_driver,
|
|
|
|
def_led);
|
|
|
|
if (def_location)
|
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->arrays.location_driver,
|
|
|
|
def_location);
|
|
|
|
if (def_video)
|
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->arrays.video_driver,
|
|
|
|
def_video);
|
|
|
|
if (def_audio)
|
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->arrays.audio_driver,
|
|
|
|
def_audio);
|
Add microphone support via a new driver (#14731)
* Some slight fixes
* Update libretro.h
* Log calls to RETRO_ENVIRONMENT_GET_MICROPHONE_INTERFACE
* Finish proof-of-concept for mic support
- It works, but doesn't support floating-point audio yet
- It may need to be resampled, too
* Add macros that aren't available in SDL 2
* Comment out a variable definition for now
- For C89 compliance
* Add some comments for clarity
* Let ALSA tolerate a null new_rate
* Partial ALSA microphone support
- Not yet tested
- Mic is created and destroyed
- Mic can also be paused or unpaused
- Mic is paused or unpaused with the rest of the driver
- Microphone is not yet read
* Install error logging in the ALSA driver
- It defers to RARCH_ERR
* Free the ALSA microphone in alsa_free
* Fix an indent
* First draft of alsa_read_microphone
* Deinitialize SDL Audio in sdl_audio_free
* Save and restore the ALSA error logger
- You should always practice safe global state
* Add newlines to some RARCH_ERRs
* Add some logging
* Check for the mic being active via settings instead of via flags
* Adjusted a log entry to be less misleading
- A frequency of 0Hz looks weird to the uninformed
- In reality, it means the driver used the requested frequency
* Fix an incorrect format string
* Tidy up logging in alsa.c
* Rename audio_enable_microphone to audio_enable_input
* Rename microphone_device to audio_input_device
* Add audio_input_latency and audio_input_block_frames settings
* Add all mic-related settings to the options menu
* Adjust logging for alsa.c
- Log the ALSA library version
- Add errno details
* Refer to the microphone in logs by name
* Use %u instead of %d for some log items
* Add input_samples_buf
* Remove an inaccurate comment
* Change type of input_samples_buf
* Clean up audio_driver_flush_microphone_input
* Comment convert_float_to_s16
- It helped me understand what it's doing
- Turns out it'll work just fine on mono audio
* Don't use the resampler for mic input
* Fix crash in the ALSA driver when reading from a mic
* Update some logging messages
* ALSA support now works for mics
* Reuse some common functions in alsa.c
* Add alsa_thread_microphone_t
* Refactor alsa.c
- Introduce alsa_init_pcm to init any PCM that we're using
- Vastly simplifies the implementation of alsa_init and alsa_init_microphone
- Will be used for the read-based versions next
* Make ALSA logging a little more consistent
* Clean up the mic with alsa_free_microphone if alsa_init_microphone fails
* Remove an unused function
* Move some cleanup in alsa.c to a common function
* First crack at mic support for alsathread
- Refactor some duplicate code into functions
- Use functions introduced in alsa.c
- Create and destroy the mic
* Slight cleanups for clarity
* Implement alsa_thread_set/get_microphone_state
* More work on alsathread
- No more crashing, but the mic just returns silence
* Slight cleanups for clarity
* Add alsa_set_mic_enabled_internal
- For setting the state of a microphone while considering its current state
* Use alsa_set_mic_enabled_internal
* Log a little more info
* Log when the audio driver is started/stopped
* Move base microphone driver code into a new directory
- Add microphone_driver.c to Makefile.common
- Rename functions as needed
* Initialize and deinitialize the microphone driver
* Implement sdl_microphone.c
* Un-const an argument
- In case the driver context needs to do any locking
* Revise comments for microphone_driver.h
* Remove an unimplemented function
* Remove some functions from the mic driver
* Remove mic functions from audio_thread_wrapper
* Remove mic functions from sdl_audio
* Fix microphone_null
* Split the mic code for the alsa audio drivers into microphone drivers
* Fix an extra struct member
* Add a setting for the mic driver
* Add a command to reinitialize the microphone driver
* Rename mic-related settings
* Add DRIVER_MICROPHONE_MASK to DRIVERS_CMD_ALL
* Rename audio_enable_input to microphone_enable
* Remove some labels from qt_options
* Search for microphone_driver within find_driver_nonempty
* Clean up some mic driver code
* Pending mics now return silence
* Adjust some logging and comments
* Some cleanup in the microphone driver
* Invert a flag check
- Oops
* Fix a log message
* Fix the wrong flags being checked
* Slight refactor of wasapi_init_device
- Add a data_flow parameter
- Declare it in a header
- In preparation for WASAPI mic support
* Add some WASAPI macros for _IAudioCaptureClient
* Move some common WASAPI functions to audio/common/wasapi.c
- They'll be used by the mic and the audio drivers
* Add wasapi_log_hr
* Generalize mmdevice_list_new to look for capture devices, too
* Fix a function declaration
* Move driver-specific device_list_new functions into their respective files
* Clean up some declarations
* First draft of wasapi microphone driver
* Add wasapi_microphone_device_list_free
* Change function parameter names to be consistent with microphone_driver
* Partially implement wasapi_microphone_read
- Mostly copied from the audio driver so far
- It doesn't compile yet
- But it'll be beautiful when I'm done with it
* Refactor the mic driver's functions
- Rename get_mic_active to mic_alive
- Split set_mic_active into start_mic and stop_mic
- Refactor the SDL mic driver accordingly
* Edit some WASAPI functions for logging and clarity
* Implement more of the WASAPI mic driver
* Rename write_event to read_event
* Pass the WASAPI driver context to the various read functions
* Mostly implement the read function for the WASAPI mic driver
* Fix a crash in microphone_driver
- Forgot to move the position of the name of null_driver
* Reduce some logging in wasapi common functions
- Only log the chosen audio client format, not all attempted ones
* Add some macro wrappers for IAudioClient methods
* Update mic driver configuration
- Make the mic driver configurable in the menu
- Add config items for WASAPI-related options similar to the audio driver
* Fix a menu entry scrolling through audio devices instead of mic devices
* Add some utility functions
* Expose the new utility functions in wasapi.h
* Add extra logging in the WASAPI common functions
* Add sharemode_name
* Use _IAudioClient_Initialize macro in some places
* Pass channels to wasapi_init_client
- Remember, mics are in mono
* Use _IAudioClient_Initialize macro some more
* Forgot to pass channels in some places
* Add some utility functions
* Forgot an #include
* Add wasapi_select_device_format
* Simplify the format selection logic in wasapi_init_client_sh
* Unset the microphone in wasapi_microphone_close_mic
- Ought to prevent a potential segfault
* Simplify some logging
* Fix incorrect value being passed to _IAudioCaptureClient_ReleaseBuffer
* Remove some unneeded logging
* Add some values to hresult_name
* Polish up wasapi_select_device_format
- Test for formats manually when Windows can't
- Add some debug logging
- Check for channels
* Compute the fields of WAVEFORMATEXTENSIBLE correctly
- As per the doc's stated requirements
* Simplify logic for WASAPI client creation
* Fix a potential hang in wasapi_microphone_read_shared_buffered
* Stop the microphone if the driver is stopped
* Don't name the microphone event
* Ensure that wasapi_init_client reports the correct format and rate
* Implement exclusive microphone read access for WASAPI
* Add _IAudioCaptureClient_GetNextPacketSize macro
* Organize cases in hresult_name
* Clear some extra fields if wasapi_set_format is setting a Pcm format
* Adjust some logs
* Adjust some logs
* Remove unneeded local vars
* Add a log
* Update wasapi.c
* Update wasapi.c
* Fix shared-mode mic support in WASAPI producing broken input
- Turns out it had nothing to do with shared mode
* Reuse a common function
- Remove wasapi_microphone_read_shared_buffered
- Rename wasapi_microphone_read_exclusive to wasapi_microphone_read_buffered
* Remove some code I was using for test purposes
* Clarify some language
* Double the default shared-mode mic buffer length
* Split getting a device's name into a separate function, then use it
* Fix the ALSA mic drivers
- To comply with changes I previously made to the mic driver interface
* Remove unused synchronization primitives from the SDL microphone driver
* Add sdl_microphone_mic_use_float
* Document audio_driver_state_flags
- I needed to understand these to see if similar flags were required for the mic driver
* Remove an unused function in wasapi.c
* Add and document flags in microphone_driver.h
* Remove driver-specific mic start/stop functions
- The mic driver itself doesn't do much processing
- That honor goes to individual mics
* Remove some unused fields in microphone_driver.h
* Add CMD_EVENT_MICROPHONE_STOP/START
* Remove unused functions from microphone_null
* Change how the mic driver state is referenced in some places
* Simplify the SDL microphone driver
- The driver backend no longer keeps a reference to the mic (the frontend does that)
- Remove functions that are no longer needed
- Don't track paused state, just query the mic itself
* Simplify the WASAPI microphone driver
- Don't track the driver running state or the microphone handle, the frontend does that now
- Remove support for unbuffered input (hunterk suggested that it wasn't necessary)
* Make microphone_wasapi_sh_buffer_length a uint, not an int
- It won't be negative anymore
- 0 now represents the default value
* Make the microphone frontend more robust
- Improve documentation for how various functions should be implemented
- Closes all microphones before freeing the driver (so backends don't have to)
- Tracks the enabled state of each microphone, so backends don't have to (but they still can)
* Stop the mic driver in core_unload_game
* Ensure mic support is compatible with the revised menu code
* Move alsa.h into audio/common
* Remove RETRO_ENVIRONMENT_GET_MICROPHONE_ENABLED
- It was never really needed
* Refactor the ALSA microphone driver
- Move common ALSA functions to audio/common/alsa.c
- Replace alsa_set_mic_enabled_internal with alsa_start/stop_pcm
- Don't track the microphone handle in the ALSA driver context
- Remove unneeded fields
* Move some common alsathread code into audio/common/alsathread.c
* Change return type of mic_driver_open_mic_internal to bool
* First crack at resampling mic input
* Remove an extraneous check
- I think something distracted me when I was writing this line
* Add stereo/mono conversion functions
* Make alsa_start_pcm and alsa_stop_pcm more robust
- They now return success if the stream is already running and stopped, respectively
* Revise some mic-related comments in libretro.h
* First crack at resampling mic input
* Simplify an expression
* Simplify an expression
* Fix a log tag
* Allow mic resampler to be configured separately from audio resampler
* Add some comments
* Set the source ratio to something sensible
* Stop deadlock in `alsathread` mic driver
* Allow mics to be initialized even when core is loaded from CLI
- When loading content from CLI, the drivers are initialized a little differently
- That threw off the mic initialization code
* Rename the functions in retro_microphone_interface
* Revise some mic-related comments in libretro.h
* Update retro_microphone_interface
- Add get_mic_rate
- Add a parameter to open_mic
- The modifications don't do anything yet
* Use parameter objects in the microphone handle
* Replace get_mic_rate with get_params
* Add a microphone interface version
* Remove part of a comment
* Set the effective params in mic_driver_microphone_handle_init
* Drop a stray newline
* Change where the mic interface is zeroed
- I was accidentally throwing out the version that the core was asking for
* Reduce logspam for wasapi_set_nonblock_state
- Now it only logs when the sync mode is changed
* Change DEFAULT_WASAPI_SH_BUFFER_LENGTH to 0
- -16 is no longer a valid value
* Set the new_rate in wasapi_init
* Change description of microphone sample rate in the settings
* First attempt at resampling configured mic input
* Forgot a section
* Fix some input samples being skipped
* Rename a variable for clarity
* Add microphone.outgoing_samples
* Update the mic driver
- Processed samples are now buffered
- The resampler is skipped if the ratio is (very close to) 1
* Remove part of a comment
* Update some comments in audio_resampler.h
* Slightly refactor the SDL microphone driver
- Move SDL_AudioSpec to a field of sdl_microphone_handle_t
- Allow SDL to change the requested format and sample rate
- Request floating-point input
- Implement sdl_microphone_mic_use_float
* Fix a non-C89-compliant declaration
* Add new files to griffin.c
* Remove a C++-style comment
* Add two more files to griffin.c
* Remove some unneeded declarations in microphone_driver.h
* Remove a stray comma in configuration.c
- For C89 compliance
* Fix compilation on some platforms
* Change some function signatures
* Make the ALSA drivers always set the audio rate
* Fix the alsathread mic driver
* Make state_manager_frame_is_reversed return false if HAVE_REWIND isn't defined
* Mute the microphone if the core is running in fast-forward, slow-mo, or rewind
* Clarify a comment
* Clarify a comment
* Add a comment
* Don't allocate memory for slowmo samples in the mic driver
- We're not supporting slowmo for mics, so it's not needed
* Fix a {
* Add my name to AUTHORS.h
* Add driver_lifetime_flags
- For drivers that have special setup/teardown needs
* Ensure that resetting the mic driver maintains active mic handles
- Prevents fullscreen toggle from stopping all mic input
* Update CHANGES.md
* Move some default microphone settings to a new part of the config file
* Ensure that RetroArch can use the audio format that Windows suggests
* Remove references to mic support in the SDL audio driver
* Remove unused WASAPI functions
* Return failure if RetroArch couldn't select a WASAPI format
* Ensure that Windows uses the WASAPI mic driver by default
* Treat disabled mic support as a warning, not an error
* Clarify some WASAPI-related microphone settings
* Remove some unused variables
* Add or revise microphone-related comments
* Rearrange doc comments for microphone types in libretro.h
* Remove a space
* Remove some unused flags
* Remove ALSA error logger
- It was never used anyway
* Remove unneeded microphone-related arguments
* Document a parameter
* Remove a logging call
* Add a constant for the microphone's shared buffer length for WASAPI
* Fix stylistic inconsistencies
* Make mic_driver_get_sample_size a macro instead of a function
* Move the microphone implementation to the audio directory
* Make microphone support optional (but enabled by default)
* Fix the griffin build
2023-06-06 15:55:06 -04:00
|
|
|
#ifdef HAVE_MICROPHONE
|
|
|
|
if (def_microphone)
|
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->arrays.microphone_driver,
|
|
|
|
def_microphone);
|
|
|
|
if (def_audio_resampler) /* not a typo, microphone's default sampler is the same as audio's */
|
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->arrays.microphone_resampler,
|
|
|
|
def_audio_resampler);
|
|
|
|
#endif
|
2020-06-26 18:40:20 +02:00
|
|
|
if (def_audio_resampler)
|
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->arrays.audio_resampler,
|
|
|
|
def_audio_resampler);
|
|
|
|
if (def_input)
|
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->arrays.input_driver,
|
|
|
|
def_input);
|
|
|
|
if (def_joypad)
|
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->arrays.input_joypad_driver,
|
|
|
|
def_joypad);
|
|
|
|
if (def_record)
|
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->arrays.record_driver,
|
|
|
|
def_record);
|
|
|
|
if (def_midi)
|
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->arrays.midi_driver,
|
|
|
|
def_midi);
|
|
|
|
if (def_mitm)
|
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->arrays.netplay_mitm_server,
|
|
|
|
def_mitm);
|
|
|
|
#ifdef HAVE_MENU
|
|
|
|
if (def_menu)
|
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->arrays.menu_driver,
|
|
|
|
def_menu);
|
|
|
|
#ifdef HAVE_XMB
|
|
|
|
*settings->paths.path_menu_xmb_font = '\0';
|
|
|
|
#endif
|
|
|
|
|
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->arrays.discord_app_id,
|
|
|
|
DEFAULT_DISCORD_APP_ID);
|
|
|
|
|
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->arrays.ai_service_url,
|
|
|
|
DEFAULT_AI_SERVICE_URL);
|
|
|
|
|
|
|
|
#ifdef HAVE_MATERIALUI
|
2020-08-16 04:38:02 +02:00
|
|
|
if (g_defaults.menu_materialui_menu_color_theme_enable)
|
|
|
|
settings->uints.menu_materialui_color_theme = g_defaults.menu_materialui_menu_color_theme;
|
2020-06-26 18:40:20 +02:00
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2022-09-05 04:03:04 +02:00
|
|
|
settings->uints.video_scale = DEFAULT_SCALE;
|
2020-06-26 18:40:20 +02:00
|
|
|
|
|
|
|
video_driver_set_threaded(DEFAULT_VIDEO_THREADED);
|
|
|
|
|
2022-10-18 13:39:21 +02:00
|
|
|
settings->floats.video_msg_color_r = ((DEFAULT_MESSAGE_COLOR >> 16) & 0xff) / 255.0f;
|
|
|
|
settings->floats.video_msg_color_g = ((DEFAULT_MESSAGE_COLOR >> 8) & 0xff) / 255.0f;
|
|
|
|
settings->floats.video_msg_color_b = ((DEFAULT_MESSAGE_COLOR >> 0) & 0xff) / 255.0f;
|
2020-06-26 18:40:20 +02:00
|
|
|
|
2020-08-16 04:38:02 +02:00
|
|
|
if (g_defaults.settings_video_refresh_rate > 0.0 &&
|
|
|
|
g_defaults.settings_video_refresh_rate != DEFAULT_REFRESH_RATE)
|
|
|
|
settings->floats.video_refresh_rate = g_defaults.settings_video_refresh_rate;
|
2020-06-26 18:40:20 +02:00
|
|
|
|
|
|
|
if (DEFAULT_AUDIO_DEVICE)
|
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->arrays.audio_device,
|
|
|
|
DEFAULT_AUDIO_DEVICE);
|
|
|
|
|
2020-08-16 04:38:02 +02:00
|
|
|
if (!g_defaults.settings_out_latency)
|
|
|
|
g_defaults.settings_out_latency = DEFAULT_OUT_LATENCY;
|
2020-06-26 18:40:20 +02:00
|
|
|
|
2020-08-16 04:38:02 +02:00
|
|
|
settings->uints.audio_latency = g_defaults.settings_out_latency;
|
2020-06-26 18:40:20 +02:00
|
|
|
|
Add microphone support via a new driver (#14731)
* Some slight fixes
* Update libretro.h
* Log calls to RETRO_ENVIRONMENT_GET_MICROPHONE_INTERFACE
* Finish proof-of-concept for mic support
- It works, but doesn't support floating-point audio yet
- It may need to be resampled, too
* Add macros that aren't available in SDL 2
* Comment out a variable definition for now
- For C89 compliance
* Add some comments for clarity
* Let ALSA tolerate a null new_rate
* Partial ALSA microphone support
- Not yet tested
- Mic is created and destroyed
- Mic can also be paused or unpaused
- Mic is paused or unpaused with the rest of the driver
- Microphone is not yet read
* Install error logging in the ALSA driver
- It defers to RARCH_ERR
* Free the ALSA microphone in alsa_free
* Fix an indent
* First draft of alsa_read_microphone
* Deinitialize SDL Audio in sdl_audio_free
* Save and restore the ALSA error logger
- You should always practice safe global state
* Add newlines to some RARCH_ERRs
* Add some logging
* Check for the mic being active via settings instead of via flags
* Adjusted a log entry to be less misleading
- A frequency of 0Hz looks weird to the uninformed
- In reality, it means the driver used the requested frequency
* Fix an incorrect format string
* Tidy up logging in alsa.c
* Rename audio_enable_microphone to audio_enable_input
* Rename microphone_device to audio_input_device
* Add audio_input_latency and audio_input_block_frames settings
* Add all mic-related settings to the options menu
* Adjust logging for alsa.c
- Log the ALSA library version
- Add errno details
* Refer to the microphone in logs by name
* Use %u instead of %d for some log items
* Add input_samples_buf
* Remove an inaccurate comment
* Change type of input_samples_buf
* Clean up audio_driver_flush_microphone_input
* Comment convert_float_to_s16
- It helped me understand what it's doing
- Turns out it'll work just fine on mono audio
* Don't use the resampler for mic input
* Fix crash in the ALSA driver when reading from a mic
* Update some logging messages
* ALSA support now works for mics
* Reuse some common functions in alsa.c
* Add alsa_thread_microphone_t
* Refactor alsa.c
- Introduce alsa_init_pcm to init any PCM that we're using
- Vastly simplifies the implementation of alsa_init and alsa_init_microphone
- Will be used for the read-based versions next
* Make ALSA logging a little more consistent
* Clean up the mic with alsa_free_microphone if alsa_init_microphone fails
* Remove an unused function
* Move some cleanup in alsa.c to a common function
* First crack at mic support for alsathread
- Refactor some duplicate code into functions
- Use functions introduced in alsa.c
- Create and destroy the mic
* Slight cleanups for clarity
* Implement alsa_thread_set/get_microphone_state
* More work on alsathread
- No more crashing, but the mic just returns silence
* Slight cleanups for clarity
* Add alsa_set_mic_enabled_internal
- For setting the state of a microphone while considering its current state
* Use alsa_set_mic_enabled_internal
* Log a little more info
* Log when the audio driver is started/stopped
* Move base microphone driver code into a new directory
- Add microphone_driver.c to Makefile.common
- Rename functions as needed
* Initialize and deinitialize the microphone driver
* Implement sdl_microphone.c
* Un-const an argument
- In case the driver context needs to do any locking
* Revise comments for microphone_driver.h
* Remove an unimplemented function
* Remove some functions from the mic driver
* Remove mic functions from audio_thread_wrapper
* Remove mic functions from sdl_audio
* Fix microphone_null
* Split the mic code for the alsa audio drivers into microphone drivers
* Fix an extra struct member
* Add a setting for the mic driver
* Add a command to reinitialize the microphone driver
* Rename mic-related settings
* Add DRIVER_MICROPHONE_MASK to DRIVERS_CMD_ALL
* Rename audio_enable_input to microphone_enable
* Remove some labels from qt_options
* Search for microphone_driver within find_driver_nonempty
* Clean up some mic driver code
* Pending mics now return silence
* Adjust some logging and comments
* Some cleanup in the microphone driver
* Invert a flag check
- Oops
* Fix a log message
* Fix the wrong flags being checked
* Slight refactor of wasapi_init_device
- Add a data_flow parameter
- Declare it in a header
- In preparation for WASAPI mic support
* Add some WASAPI macros for _IAudioCaptureClient
* Move some common WASAPI functions to audio/common/wasapi.c
- They'll be used by the mic and the audio drivers
* Add wasapi_log_hr
* Generalize mmdevice_list_new to look for capture devices, too
* Fix a function declaration
* Move driver-specific device_list_new functions into their respective files
* Clean up some declarations
* First draft of wasapi microphone driver
* Add wasapi_microphone_device_list_free
* Change function parameter names to be consistent with microphone_driver
* Partially implement wasapi_microphone_read
- Mostly copied from the audio driver so far
- It doesn't compile yet
- But it'll be beautiful when I'm done with it
* Refactor the mic driver's functions
- Rename get_mic_active to mic_alive
- Split set_mic_active into start_mic and stop_mic
- Refactor the SDL mic driver accordingly
* Edit some WASAPI functions for logging and clarity
* Implement more of the WASAPI mic driver
* Rename write_event to read_event
* Pass the WASAPI driver context to the various read functions
* Mostly implement the read function for the WASAPI mic driver
* Fix a crash in microphone_driver
- Forgot to move the position of the name of null_driver
* Reduce some logging in wasapi common functions
- Only log the chosen audio client format, not all attempted ones
* Add some macro wrappers for IAudioClient methods
* Update mic driver configuration
- Make the mic driver configurable in the menu
- Add config items for WASAPI-related options similar to the audio driver
* Fix a menu entry scrolling through audio devices instead of mic devices
* Add some utility functions
* Expose the new utility functions in wasapi.h
* Add extra logging in the WASAPI common functions
* Add sharemode_name
* Use _IAudioClient_Initialize macro in some places
* Pass channels to wasapi_init_client
- Remember, mics are in mono
* Use _IAudioClient_Initialize macro some more
* Forgot to pass channels in some places
* Add some utility functions
* Forgot an #include
* Add wasapi_select_device_format
* Simplify the format selection logic in wasapi_init_client_sh
* Unset the microphone in wasapi_microphone_close_mic
- Ought to prevent a potential segfault
* Simplify some logging
* Fix incorrect value being passed to _IAudioCaptureClient_ReleaseBuffer
* Remove some unneeded logging
* Add some values to hresult_name
* Polish up wasapi_select_device_format
- Test for formats manually when Windows can't
- Add some debug logging
- Check for channels
* Compute the fields of WAVEFORMATEXTENSIBLE correctly
- As per the doc's stated requirements
* Simplify logic for WASAPI client creation
* Fix a potential hang in wasapi_microphone_read_shared_buffered
* Stop the microphone if the driver is stopped
* Don't name the microphone event
* Ensure that wasapi_init_client reports the correct format and rate
* Implement exclusive microphone read access for WASAPI
* Add _IAudioCaptureClient_GetNextPacketSize macro
* Organize cases in hresult_name
* Clear some extra fields if wasapi_set_format is setting a Pcm format
* Adjust some logs
* Adjust some logs
* Remove unneeded local vars
* Add a log
* Update wasapi.c
* Update wasapi.c
* Fix shared-mode mic support in WASAPI producing broken input
- Turns out it had nothing to do with shared mode
* Reuse a common function
- Remove wasapi_microphone_read_shared_buffered
- Rename wasapi_microphone_read_exclusive to wasapi_microphone_read_buffered
* Remove some code I was using for test purposes
* Clarify some language
* Double the default shared-mode mic buffer length
* Split getting a device's name into a separate function, then use it
* Fix the ALSA mic drivers
- To comply with changes I previously made to the mic driver interface
* Remove unused synchronization primitives from the SDL microphone driver
* Add sdl_microphone_mic_use_float
* Document audio_driver_state_flags
- I needed to understand these to see if similar flags were required for the mic driver
* Remove an unused function in wasapi.c
* Add and document flags in microphone_driver.h
* Remove driver-specific mic start/stop functions
- The mic driver itself doesn't do much processing
- That honor goes to individual mics
* Remove some unused fields in microphone_driver.h
* Add CMD_EVENT_MICROPHONE_STOP/START
* Remove unused functions from microphone_null
* Change how the mic driver state is referenced in some places
* Simplify the SDL microphone driver
- The driver backend no longer keeps a reference to the mic (the frontend does that)
- Remove functions that are no longer needed
- Don't track paused state, just query the mic itself
* Simplify the WASAPI microphone driver
- Don't track the driver running state or the microphone handle, the frontend does that now
- Remove support for unbuffered input (hunterk suggested that it wasn't necessary)
* Make microphone_wasapi_sh_buffer_length a uint, not an int
- It won't be negative anymore
- 0 now represents the default value
* Make the microphone frontend more robust
- Improve documentation for how various functions should be implemented
- Closes all microphones before freeing the driver (so backends don't have to)
- Tracks the enabled state of each microphone, so backends don't have to (but they still can)
* Stop the mic driver in core_unload_game
* Ensure mic support is compatible with the revised menu code
* Move alsa.h into audio/common
* Remove RETRO_ENVIRONMENT_GET_MICROPHONE_ENABLED
- It was never really needed
* Refactor the ALSA microphone driver
- Move common ALSA functions to audio/common/alsa.c
- Replace alsa_set_mic_enabled_internal with alsa_start/stop_pcm
- Don't track the microphone handle in the ALSA driver context
- Remove unneeded fields
* Move some common alsathread code into audio/common/alsathread.c
* Change return type of mic_driver_open_mic_internal to bool
* First crack at resampling mic input
* Remove an extraneous check
- I think something distracted me when I was writing this line
* Add stereo/mono conversion functions
* Make alsa_start_pcm and alsa_stop_pcm more robust
- They now return success if the stream is already running and stopped, respectively
* Revise some mic-related comments in libretro.h
* First crack at resampling mic input
* Simplify an expression
* Simplify an expression
* Fix a log tag
* Allow mic resampler to be configured separately from audio resampler
* Add some comments
* Set the source ratio to something sensible
* Stop deadlock in `alsathread` mic driver
* Allow mics to be initialized even when core is loaded from CLI
- When loading content from CLI, the drivers are initialized a little differently
- That threw off the mic initialization code
* Rename the functions in retro_microphone_interface
* Revise some mic-related comments in libretro.h
* Update retro_microphone_interface
- Add get_mic_rate
- Add a parameter to open_mic
- The modifications don't do anything yet
* Use parameter objects in the microphone handle
* Replace get_mic_rate with get_params
* Add a microphone interface version
* Remove part of a comment
* Set the effective params in mic_driver_microphone_handle_init
* Drop a stray newline
* Change where the mic interface is zeroed
- I was accidentally throwing out the version that the core was asking for
* Reduce logspam for wasapi_set_nonblock_state
- Now it only logs when the sync mode is changed
* Change DEFAULT_WASAPI_SH_BUFFER_LENGTH to 0
- -16 is no longer a valid value
* Set the new_rate in wasapi_init
* Change description of microphone sample rate in the settings
* First attempt at resampling configured mic input
* Forgot a section
* Fix some input samples being skipped
* Rename a variable for clarity
* Add microphone.outgoing_samples
* Update the mic driver
- Processed samples are now buffered
- The resampler is skipped if the ratio is (very close to) 1
* Remove part of a comment
* Update some comments in audio_resampler.h
* Slightly refactor the SDL microphone driver
- Move SDL_AudioSpec to a field of sdl_microphone_handle_t
- Allow SDL to change the requested format and sample rate
- Request floating-point input
- Implement sdl_microphone_mic_use_float
* Fix a non-C89-compliant declaration
* Add new files to griffin.c
* Remove a C++-style comment
* Add two more files to griffin.c
* Remove some unneeded declarations in microphone_driver.h
* Remove a stray comma in configuration.c
- For C89 compliance
* Fix compilation on some platforms
* Change some function signatures
* Make the ALSA drivers always set the audio rate
* Fix the alsathread mic driver
* Make state_manager_frame_is_reversed return false if HAVE_REWIND isn't defined
* Mute the microphone if the core is running in fast-forward, slow-mo, or rewind
* Clarify a comment
* Clarify a comment
* Add a comment
* Don't allocate memory for slowmo samples in the mic driver
- We're not supporting slowmo for mics, so it's not needed
* Fix a {
* Add my name to AUTHORS.h
* Add driver_lifetime_flags
- For drivers that have special setup/teardown needs
* Ensure that resetting the mic driver maintains active mic handles
- Prevents fullscreen toggle from stopping all mic input
* Update CHANGES.md
* Move some default microphone settings to a new part of the config file
* Ensure that RetroArch can use the audio format that Windows suggests
* Remove references to mic support in the SDL audio driver
* Remove unused WASAPI functions
* Return failure if RetroArch couldn't select a WASAPI format
* Ensure that Windows uses the WASAPI mic driver by default
* Treat disabled mic support as a warning, not an error
* Clarify some WASAPI-related microphone settings
* Remove some unused variables
* Add or revise microphone-related comments
* Rearrange doc comments for microphone types in libretro.h
* Remove a space
* Remove some unused flags
* Remove ALSA error logger
- It was never used anyway
* Remove unneeded microphone-related arguments
* Document a parameter
* Remove a logging call
* Add a constant for the microphone's shared buffer length for WASAPI
* Fix stylistic inconsistencies
* Make mic_driver_get_sample_size a macro instead of a function
* Move the microphone implementation to the audio directory
* Make microphone support optional (but enabled by default)
* Fix the griffin build
2023-06-06 15:55:06 -04:00
|
|
|
if (!g_defaults.settings_in_latency)
|
|
|
|
g_defaults.settings_in_latency = DEFAULT_IN_LATENCY;
|
|
|
|
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
audio_set_float(AUDIO_ACTION_VOLUME_GAIN, settings->floats.audio_volume);
|
|
|
|
#ifdef HAVE_AUDIOMIXER
|
|
|
|
audio_set_float(AUDIO_ACTION_MIXER_VOLUME_GAIN, settings->floats.audio_mixer_volume);
|
|
|
|
#endif
|
|
|
|
|
Add microphone support via a new driver (#14731)
* Some slight fixes
* Update libretro.h
* Log calls to RETRO_ENVIRONMENT_GET_MICROPHONE_INTERFACE
* Finish proof-of-concept for mic support
- It works, but doesn't support floating-point audio yet
- It may need to be resampled, too
* Add macros that aren't available in SDL 2
* Comment out a variable definition for now
- For C89 compliance
* Add some comments for clarity
* Let ALSA tolerate a null new_rate
* Partial ALSA microphone support
- Not yet tested
- Mic is created and destroyed
- Mic can also be paused or unpaused
- Mic is paused or unpaused with the rest of the driver
- Microphone is not yet read
* Install error logging in the ALSA driver
- It defers to RARCH_ERR
* Free the ALSA microphone in alsa_free
* Fix an indent
* First draft of alsa_read_microphone
* Deinitialize SDL Audio in sdl_audio_free
* Save and restore the ALSA error logger
- You should always practice safe global state
* Add newlines to some RARCH_ERRs
* Add some logging
* Check for the mic being active via settings instead of via flags
* Adjusted a log entry to be less misleading
- A frequency of 0Hz looks weird to the uninformed
- In reality, it means the driver used the requested frequency
* Fix an incorrect format string
* Tidy up logging in alsa.c
* Rename audio_enable_microphone to audio_enable_input
* Rename microphone_device to audio_input_device
* Add audio_input_latency and audio_input_block_frames settings
* Add all mic-related settings to the options menu
* Adjust logging for alsa.c
- Log the ALSA library version
- Add errno details
* Refer to the microphone in logs by name
* Use %u instead of %d for some log items
* Add input_samples_buf
* Remove an inaccurate comment
* Change type of input_samples_buf
* Clean up audio_driver_flush_microphone_input
* Comment convert_float_to_s16
- It helped me understand what it's doing
- Turns out it'll work just fine on mono audio
* Don't use the resampler for mic input
* Fix crash in the ALSA driver when reading from a mic
* Update some logging messages
* ALSA support now works for mics
* Reuse some common functions in alsa.c
* Add alsa_thread_microphone_t
* Refactor alsa.c
- Introduce alsa_init_pcm to init any PCM that we're using
- Vastly simplifies the implementation of alsa_init and alsa_init_microphone
- Will be used for the read-based versions next
* Make ALSA logging a little more consistent
* Clean up the mic with alsa_free_microphone if alsa_init_microphone fails
* Remove an unused function
* Move some cleanup in alsa.c to a common function
* First crack at mic support for alsathread
- Refactor some duplicate code into functions
- Use functions introduced in alsa.c
- Create and destroy the mic
* Slight cleanups for clarity
* Implement alsa_thread_set/get_microphone_state
* More work on alsathread
- No more crashing, but the mic just returns silence
* Slight cleanups for clarity
* Add alsa_set_mic_enabled_internal
- For setting the state of a microphone while considering its current state
* Use alsa_set_mic_enabled_internal
* Log a little more info
* Log when the audio driver is started/stopped
* Move base microphone driver code into a new directory
- Add microphone_driver.c to Makefile.common
- Rename functions as needed
* Initialize and deinitialize the microphone driver
* Implement sdl_microphone.c
* Un-const an argument
- In case the driver context needs to do any locking
* Revise comments for microphone_driver.h
* Remove an unimplemented function
* Remove some functions from the mic driver
* Remove mic functions from audio_thread_wrapper
* Remove mic functions from sdl_audio
* Fix microphone_null
* Split the mic code for the alsa audio drivers into microphone drivers
* Fix an extra struct member
* Add a setting for the mic driver
* Add a command to reinitialize the microphone driver
* Rename mic-related settings
* Add DRIVER_MICROPHONE_MASK to DRIVERS_CMD_ALL
* Rename audio_enable_input to microphone_enable
* Remove some labels from qt_options
* Search for microphone_driver within find_driver_nonempty
* Clean up some mic driver code
* Pending mics now return silence
* Adjust some logging and comments
* Some cleanup in the microphone driver
* Invert a flag check
- Oops
* Fix a log message
* Fix the wrong flags being checked
* Slight refactor of wasapi_init_device
- Add a data_flow parameter
- Declare it in a header
- In preparation for WASAPI mic support
* Add some WASAPI macros for _IAudioCaptureClient
* Move some common WASAPI functions to audio/common/wasapi.c
- They'll be used by the mic and the audio drivers
* Add wasapi_log_hr
* Generalize mmdevice_list_new to look for capture devices, too
* Fix a function declaration
* Move driver-specific device_list_new functions into their respective files
* Clean up some declarations
* First draft of wasapi microphone driver
* Add wasapi_microphone_device_list_free
* Change function parameter names to be consistent with microphone_driver
* Partially implement wasapi_microphone_read
- Mostly copied from the audio driver so far
- It doesn't compile yet
- But it'll be beautiful when I'm done with it
* Refactor the mic driver's functions
- Rename get_mic_active to mic_alive
- Split set_mic_active into start_mic and stop_mic
- Refactor the SDL mic driver accordingly
* Edit some WASAPI functions for logging and clarity
* Implement more of the WASAPI mic driver
* Rename write_event to read_event
* Pass the WASAPI driver context to the various read functions
* Mostly implement the read function for the WASAPI mic driver
* Fix a crash in microphone_driver
- Forgot to move the position of the name of null_driver
* Reduce some logging in wasapi common functions
- Only log the chosen audio client format, not all attempted ones
* Add some macro wrappers for IAudioClient methods
* Update mic driver configuration
- Make the mic driver configurable in the menu
- Add config items for WASAPI-related options similar to the audio driver
* Fix a menu entry scrolling through audio devices instead of mic devices
* Add some utility functions
* Expose the new utility functions in wasapi.h
* Add extra logging in the WASAPI common functions
* Add sharemode_name
* Use _IAudioClient_Initialize macro in some places
* Pass channels to wasapi_init_client
- Remember, mics are in mono
* Use _IAudioClient_Initialize macro some more
* Forgot to pass channels in some places
* Add some utility functions
* Forgot an #include
* Add wasapi_select_device_format
* Simplify the format selection logic in wasapi_init_client_sh
* Unset the microphone in wasapi_microphone_close_mic
- Ought to prevent a potential segfault
* Simplify some logging
* Fix incorrect value being passed to _IAudioCaptureClient_ReleaseBuffer
* Remove some unneeded logging
* Add some values to hresult_name
* Polish up wasapi_select_device_format
- Test for formats manually when Windows can't
- Add some debug logging
- Check for channels
* Compute the fields of WAVEFORMATEXTENSIBLE correctly
- As per the doc's stated requirements
* Simplify logic for WASAPI client creation
* Fix a potential hang in wasapi_microphone_read_shared_buffered
* Stop the microphone if the driver is stopped
* Don't name the microphone event
* Ensure that wasapi_init_client reports the correct format and rate
* Implement exclusive microphone read access for WASAPI
* Add _IAudioCaptureClient_GetNextPacketSize macro
* Organize cases in hresult_name
* Clear some extra fields if wasapi_set_format is setting a Pcm format
* Adjust some logs
* Adjust some logs
* Remove unneeded local vars
* Add a log
* Update wasapi.c
* Update wasapi.c
* Fix shared-mode mic support in WASAPI producing broken input
- Turns out it had nothing to do with shared mode
* Reuse a common function
- Remove wasapi_microphone_read_shared_buffered
- Rename wasapi_microphone_read_exclusive to wasapi_microphone_read_buffered
* Remove some code I was using for test purposes
* Clarify some language
* Double the default shared-mode mic buffer length
* Split getting a device's name into a separate function, then use it
* Fix the ALSA mic drivers
- To comply with changes I previously made to the mic driver interface
* Remove unused synchronization primitives from the SDL microphone driver
* Add sdl_microphone_mic_use_float
* Document audio_driver_state_flags
- I needed to understand these to see if similar flags were required for the mic driver
* Remove an unused function in wasapi.c
* Add and document flags in microphone_driver.h
* Remove driver-specific mic start/stop functions
- The mic driver itself doesn't do much processing
- That honor goes to individual mics
* Remove some unused fields in microphone_driver.h
* Add CMD_EVENT_MICROPHONE_STOP/START
* Remove unused functions from microphone_null
* Change how the mic driver state is referenced in some places
* Simplify the SDL microphone driver
- The driver backend no longer keeps a reference to the mic (the frontend does that)
- Remove functions that are no longer needed
- Don't track paused state, just query the mic itself
* Simplify the WASAPI microphone driver
- Don't track the driver running state or the microphone handle, the frontend does that now
- Remove support for unbuffered input (hunterk suggested that it wasn't necessary)
* Make microphone_wasapi_sh_buffer_length a uint, not an int
- It won't be negative anymore
- 0 now represents the default value
* Make the microphone frontend more robust
- Improve documentation for how various functions should be implemented
- Closes all microphones before freeing the driver (so backends don't have to)
- Tracks the enabled state of each microphone, so backends don't have to (but they still can)
* Stop the mic driver in core_unload_game
* Ensure mic support is compatible with the revised menu code
* Move alsa.h into audio/common
* Remove RETRO_ENVIRONMENT_GET_MICROPHONE_ENABLED
- It was never really needed
* Refactor the ALSA microphone driver
- Move common ALSA functions to audio/common/alsa.c
- Replace alsa_set_mic_enabled_internal with alsa_start/stop_pcm
- Don't track the microphone handle in the ALSA driver context
- Remove unneeded fields
* Move some common alsathread code into audio/common/alsathread.c
* Change return type of mic_driver_open_mic_internal to bool
* First crack at resampling mic input
* Remove an extraneous check
- I think something distracted me when I was writing this line
* Add stereo/mono conversion functions
* Make alsa_start_pcm and alsa_stop_pcm more robust
- They now return success if the stream is already running and stopped, respectively
* Revise some mic-related comments in libretro.h
* First crack at resampling mic input
* Simplify an expression
* Simplify an expression
* Fix a log tag
* Allow mic resampler to be configured separately from audio resampler
* Add some comments
* Set the source ratio to something sensible
* Stop deadlock in `alsathread` mic driver
* Allow mics to be initialized even when core is loaded from CLI
- When loading content from CLI, the drivers are initialized a little differently
- That threw off the mic initialization code
* Rename the functions in retro_microphone_interface
* Revise some mic-related comments in libretro.h
* Update retro_microphone_interface
- Add get_mic_rate
- Add a parameter to open_mic
- The modifications don't do anything yet
* Use parameter objects in the microphone handle
* Replace get_mic_rate with get_params
* Add a microphone interface version
* Remove part of a comment
* Set the effective params in mic_driver_microphone_handle_init
* Drop a stray newline
* Change where the mic interface is zeroed
- I was accidentally throwing out the version that the core was asking for
* Reduce logspam for wasapi_set_nonblock_state
- Now it only logs when the sync mode is changed
* Change DEFAULT_WASAPI_SH_BUFFER_LENGTH to 0
- -16 is no longer a valid value
* Set the new_rate in wasapi_init
* Change description of microphone sample rate in the settings
* First attempt at resampling configured mic input
* Forgot a section
* Fix some input samples being skipped
* Rename a variable for clarity
* Add microphone.outgoing_samples
* Update the mic driver
- Processed samples are now buffered
- The resampler is skipped if the ratio is (very close to) 1
* Remove part of a comment
* Update some comments in audio_resampler.h
* Slightly refactor the SDL microphone driver
- Move SDL_AudioSpec to a field of sdl_microphone_handle_t
- Allow SDL to change the requested format and sample rate
- Request floating-point input
- Implement sdl_microphone_mic_use_float
* Fix a non-C89-compliant declaration
* Add new files to griffin.c
* Remove a C++-style comment
* Add two more files to griffin.c
* Remove some unneeded declarations in microphone_driver.h
* Remove a stray comma in configuration.c
- For C89 compliance
* Fix compilation on some platforms
* Change some function signatures
* Make the ALSA drivers always set the audio rate
* Fix the alsathread mic driver
* Make state_manager_frame_is_reversed return false if HAVE_REWIND isn't defined
* Mute the microphone if the core is running in fast-forward, slow-mo, or rewind
* Clarify a comment
* Clarify a comment
* Add a comment
* Don't allocate memory for slowmo samples in the mic driver
- We're not supporting slowmo for mics, so it's not needed
* Fix a {
* Add my name to AUTHORS.h
* Add driver_lifetime_flags
- For drivers that have special setup/teardown needs
* Ensure that resetting the mic driver maintains active mic handles
- Prevents fullscreen toggle from stopping all mic input
* Update CHANGES.md
* Move some default microphone settings to a new part of the config file
* Ensure that RetroArch can use the audio format that Windows suggests
* Remove references to mic support in the SDL audio driver
* Remove unused WASAPI functions
* Return failure if RetroArch couldn't select a WASAPI format
* Ensure that Windows uses the WASAPI mic driver by default
* Treat disabled mic support as a warning, not an error
* Clarify some WASAPI-related microphone settings
* Remove some unused variables
* Add or revise microphone-related comments
* Rearrange doc comments for microphone types in libretro.h
* Remove a space
* Remove some unused flags
* Remove ALSA error logger
- It was never used anyway
* Remove unneeded microphone-related arguments
* Document a parameter
* Remove a logging call
* Add a constant for the microphone's shared buffer length for WASAPI
* Fix stylistic inconsistencies
* Make mic_driver_get_sample_size a macro instead of a function
* Move the microphone implementation to the audio directory
* Make microphone support optional (but enabled by default)
* Fix the griffin build
2023-06-06 15:55:06 -04:00
|
|
|
#ifdef HAVE_MICROPHONE
|
|
|
|
if (DEFAULT_MICROPHONE_DEVICE)
|
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->arrays.microphone_device,
|
|
|
|
DEFAULT_MICROPHONE_DEVICE);
|
|
|
|
|
|
|
|
settings->uints.microphone_latency = g_defaults.settings_in_latency;
|
|
|
|
#endif
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
#ifdef HAVE_LAKKA
|
|
|
|
configuration_set_bool(settings,
|
|
|
|
settings->bools.ssh_enable, filestream_exists(LAKKA_SSH_PATH));
|
|
|
|
configuration_set_bool(settings,
|
|
|
|
settings->bools.samba_enable, filestream_exists(LAKKA_SAMBA_PATH));
|
|
|
|
configuration_set_bool(settings,
|
|
|
|
settings->bools.bluetooth_enable, filestream_exists(LAKKA_BLUETOOTH_PATH));
|
|
|
|
configuration_set_bool(settings, settings->bools.localap_enable, false);
|
2021-04-17 23:54:45 +02:00
|
|
|
load_timezone(settings->arrays.timezone);
|
2020-06-26 18:40:20 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_MENU
|
|
|
|
if (first_initialized)
|
|
|
|
configuration_set_bool(settings,
|
|
|
|
settings->bools.menu_show_start_screen,
|
|
|
|
DEFAULT_MENU_SHOW_START_SCREEN);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_CHEEVOS
|
|
|
|
*settings->arrays.cheevos_username = '\0';
|
|
|
|
*settings->arrays.cheevos_password = '\0';
|
|
|
|
*settings->arrays.cheevos_token = '\0';
|
|
|
|
#endif
|
|
|
|
|
|
|
|
input_config_reset();
|
2022-03-16 16:59:07 +00:00
|
|
|
input_remapping_deinit(false);
|
2021-06-17 17:45:24 +01:00
|
|
|
input_remapping_set_defaults(false);
|
2020-06-26 18:40:20 +02:00
|
|
|
|
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->paths.network_buildbot_url, DEFAULT_BUILDBOT_SERVER_URL);
|
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->paths.network_buildbot_assets_url,
|
|
|
|
DEFAULT_BUILDBOT_ASSETS_SERVER_URL);
|
|
|
|
|
|
|
|
*settings->arrays.input_keyboard_layout = '\0';
|
|
|
|
|
|
|
|
for (i = 0; i < MAX_USERS; i++)
|
|
|
|
{
|
2023-02-18 17:15:52 +01:00
|
|
|
settings->uints.input_joypad_index[i] = (unsigned)i;
|
2020-06-26 18:40:20 +02:00
|
|
|
#ifdef SWITCH /* Switch prefered default dpad mode */
|
|
|
|
settings->uints.input_analog_dpad_mode[i] = ANALOG_DPAD_LSTICK;
|
|
|
|
#else
|
|
|
|
settings->uints.input_analog_dpad_mode[i] = ANALOG_DPAD_NONE;
|
|
|
|
#endif
|
2023-02-18 17:15:52 +01:00
|
|
|
input_config_set_device((unsigned)i, RETRO_DEVICE_JOYPAD);
|
|
|
|
settings->uints.input_mouse_index[i] = (unsigned)i;
|
2020-06-26 18:40:20 +02:00
|
|
|
}
|
|
|
|
|
2023-05-30 12:19:53 +02:00
|
|
|
custom_vp->width = 0;
|
|
|
|
custom_vp->height = 0;
|
|
|
|
custom_vp->x = 0;
|
|
|
|
custom_vp->y = 0;
|
2020-06-26 18:40:20 +02:00
|
|
|
|
|
|
|
/* Make sure settings from other configs carry over into defaults
|
|
|
|
* for another config. */
|
|
|
|
if (!retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_SAVE_PATH, NULL))
|
|
|
|
dir_clear(RARCH_DIR_SAVEFILE);
|
|
|
|
if (!retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_STATE_PATH, NULL))
|
|
|
|
dir_clear(RARCH_DIR_SAVESTATE);
|
|
|
|
|
|
|
|
*settings->paths.path_libretro_info = '\0';
|
|
|
|
*settings->paths.directory_libretro = '\0';
|
|
|
|
*settings->paths.directory_resampler = '\0';
|
|
|
|
*settings->paths.directory_screenshot = '\0';
|
|
|
|
*settings->paths.directory_system = '\0';
|
|
|
|
*settings->paths.directory_cache = '\0';
|
|
|
|
*settings->paths.directory_input_remapping = '\0';
|
|
|
|
*settings->paths.directory_core_assets = '\0';
|
|
|
|
*settings->paths.directory_assets = '\0';
|
|
|
|
*settings->paths.directory_dynamic_wallpapers = '\0';
|
|
|
|
*settings->paths.directory_thumbnails = '\0';
|
|
|
|
*settings->paths.directory_playlist = '\0';
|
2021-01-21 21:28:10 +01:00
|
|
|
*settings->paths.directory_content_favorites = '\0';
|
|
|
|
*settings->paths.directory_content_history = '\0';
|
|
|
|
*settings->paths.directory_content_image_history = '\0';
|
|
|
|
*settings->paths.directory_content_music_history = '\0';
|
|
|
|
*settings->paths.directory_content_video_history = '\0';
|
2020-06-26 18:40:20 +02:00
|
|
|
*settings->paths.directory_runtime_log = '\0';
|
|
|
|
*settings->paths.directory_autoconfig = '\0';
|
|
|
|
#ifdef HAVE_MENU
|
|
|
|
*settings->paths.directory_menu_content = '\0';
|
|
|
|
*settings->paths.directory_menu_config = '\0';
|
|
|
|
#endif
|
|
|
|
*settings->paths.directory_video_shader = '\0';
|
|
|
|
*settings->paths.directory_video_filter = '\0';
|
|
|
|
*settings->paths.directory_audio_filter = '\0';
|
|
|
|
|
2021-09-28 12:56:10 +02:00
|
|
|
retroarch_ctl(RARCH_CTL_UNSET_UPS_PREF, NULL);
|
|
|
|
retroarch_ctl(RARCH_CTL_UNSET_BPS_PREF, NULL);
|
|
|
|
retroarch_ctl(RARCH_CTL_UNSET_IPS_PREF, NULL);
|
2023-11-23 23:19:07 -05:00
|
|
|
retroarch_ctl(RARCH_CTL_UNSET_XDELTA_PREF, NULL);
|
2016-07-25 08:01:47 +02:00
|
|
|
|
2021-11-10 02:34:04 +01:00
|
|
|
*recording_st->output_dir = '\0';
|
|
|
|
*recording_st->config_dir = '\0';
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2021-11-10 02:34:04 +01:00
|
|
|
*settings->paths.path_core_options = '\0';
|
|
|
|
*settings->paths.path_content_favorites = '\0';
|
|
|
|
*settings->paths.path_content_history = '\0';
|
2020-06-26 18:40:20 +02:00
|
|
|
*settings->paths.path_content_image_history = '\0';
|
2021-01-21 21:28:10 +01:00
|
|
|
*settings->paths.path_content_music_history = '\0';
|
2020-06-26 18:40:20 +02:00
|
|
|
*settings->paths.path_content_video_history = '\0';
|
2021-11-10 02:34:04 +01:00
|
|
|
*settings->paths.path_cheat_settings = '\0';
|
2021-03-12 10:33:21 +01:00
|
|
|
#if !defined(__APPLE__)
|
2022-07-05 19:15:29 +02:00
|
|
|
*settings->paths.bundle_assets_src = '\0';
|
|
|
|
*settings->paths.bundle_assets_dst = '\0';
|
|
|
|
*settings->paths.bundle_assets_dst_subdir = '\0';
|
2020-06-26 18:40:20 +02:00
|
|
|
#endif
|
|
|
|
*settings->paths.path_cheat_database = '\0';
|
|
|
|
*settings->paths.path_menu_wallpaper = '\0';
|
|
|
|
*settings->paths.path_rgui_theme_preset = '\0';
|
|
|
|
*settings->paths.path_content_database = '\0';
|
|
|
|
*settings->paths.path_overlay = '\0';
|
2023-07-08 12:45:13 -05:00
|
|
|
*settings->paths.path_osk_overlay = '\0';
|
2020-06-26 18:40:20 +02:00
|
|
|
*settings->paths.path_record_config = '\0';
|
|
|
|
*settings->paths.path_stream_config = '\0';
|
2020-10-17 20:52:27 +03:00
|
|
|
*settings->paths.path_stream_url = '\0';
|
2020-06-26 18:40:20 +02:00
|
|
|
*settings->paths.path_softfilter_plugin = '\0';
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
*settings->paths.path_audio_dsp_plugin = '\0';
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
*settings->paths.log_dir = '\0';
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2021-04-08 01:54:44 +02:00
|
|
|
video_driver_default_settings(global);
|
2016-07-25 08:01:47 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
if (!string_is_empty(g_defaults.dirs[DEFAULT_DIR_WALLPAPERS]))
|
2020-06-26 18:25:12 +02:00
|
|
|
configuration_set_string(settings,
|
2020-06-26 18:40:20 +02:00
|
|
|
settings->paths.directory_dynamic_wallpapers,
|
|
|
|
g_defaults.dirs[DEFAULT_DIR_WALLPAPERS]);
|
|
|
|
if (!string_is_empty(g_defaults.dirs[DEFAULT_DIR_THUMBNAILS]))
|
2020-06-26 18:25:12 +02:00
|
|
|
configuration_set_string(settings,
|
2020-06-26 18:40:20 +02:00
|
|
|
settings->paths.directory_thumbnails,
|
|
|
|
g_defaults.dirs[DEFAULT_DIR_THUMBNAILS]);
|
|
|
|
if (!string_is_empty(g_defaults.dirs[DEFAULT_DIR_REMAP]))
|
2020-06-26 18:25:12 +02:00
|
|
|
configuration_set_string(settings,
|
2020-06-26 18:40:20 +02:00
|
|
|
settings->paths.directory_input_remapping,
|
|
|
|
g_defaults.dirs[DEFAULT_DIR_REMAP]);
|
|
|
|
if (!string_is_empty(g_defaults.dirs[DEFAULT_DIR_CACHE]))
|
2020-06-26 18:25:12 +02:00
|
|
|
configuration_set_string(settings,
|
2020-06-26 18:40:20 +02:00
|
|
|
settings->paths.directory_cache,
|
|
|
|
g_defaults.dirs[DEFAULT_DIR_CACHE]);
|
|
|
|
if (!string_is_empty(g_defaults.dirs[DEFAULT_DIR_ASSETS]))
|
2020-06-26 18:25:12 +02:00
|
|
|
configuration_set_string(settings,
|
2020-06-26 18:40:20 +02:00
|
|
|
settings->paths.directory_assets,
|
|
|
|
g_defaults.dirs[DEFAULT_DIR_ASSETS]);
|
|
|
|
if (!string_is_empty(g_defaults.dirs[DEFAULT_DIR_CORE_ASSETS]))
|
2020-06-26 18:25:12 +02:00
|
|
|
configuration_set_string(settings,
|
2020-06-26 18:40:20 +02:00
|
|
|
settings->paths.directory_core_assets,
|
|
|
|
g_defaults.dirs[DEFAULT_DIR_CORE_ASSETS]);
|
|
|
|
if (!string_is_empty(g_defaults.dirs[DEFAULT_DIR_PLAYLIST]))
|
2020-06-26 18:25:12 +02:00
|
|
|
configuration_set_string(settings,
|
2020-06-26 18:40:20 +02:00
|
|
|
settings->paths.directory_playlist,
|
|
|
|
g_defaults.dirs[DEFAULT_DIR_PLAYLIST]);
|
2021-01-21 21:28:10 +01:00
|
|
|
if (!string_is_empty(g_defaults.dirs[DEFAULT_DIR_CONTENT_FAVORITES]))
|
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->paths.directory_content_favorites,
|
|
|
|
g_defaults.dirs[DEFAULT_DIR_CONTENT_FAVORITES]);
|
|
|
|
if (!string_is_empty(g_defaults.dirs[DEFAULT_DIR_CONTENT_HISTORY]))
|
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->paths.directory_content_history,
|
|
|
|
g_defaults.dirs[DEFAULT_DIR_CONTENT_HISTORY]);
|
|
|
|
if (!string_is_empty(g_defaults.dirs[DEFAULT_DIR_CONTENT_IMAGE_HISTORY]))
|
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->paths.directory_content_image_history,
|
|
|
|
g_defaults.dirs[DEFAULT_DIR_CONTENT_IMAGE_HISTORY]);
|
|
|
|
if (!string_is_empty(g_defaults.dirs[DEFAULT_DIR_CONTENT_MUSIC_HISTORY]))
|
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->paths.directory_content_music_history,
|
|
|
|
g_defaults.dirs[DEFAULT_DIR_CONTENT_MUSIC_HISTORY]);
|
|
|
|
if (!string_is_empty(g_defaults.dirs[DEFAULT_DIR_CONTENT_VIDEO_HISTORY]))
|
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->paths.directory_content_video_history,
|
|
|
|
g_defaults.dirs[DEFAULT_DIR_CONTENT_VIDEO_HISTORY]);
|
2020-06-26 18:40:20 +02:00
|
|
|
if (!string_is_empty(g_defaults.dirs[DEFAULT_DIR_CORE]))
|
|
|
|
fill_pathname_expand_special(settings->paths.directory_libretro,
|
|
|
|
g_defaults.dirs[DEFAULT_DIR_CORE],
|
|
|
|
sizeof(settings->paths.directory_libretro));
|
|
|
|
if (!string_is_empty(g_defaults.dirs[DEFAULT_DIR_AUDIO_FILTER]))
|
2020-06-26 18:25:12 +02:00
|
|
|
configuration_set_string(settings,
|
2020-06-26 18:40:20 +02:00
|
|
|
settings->paths.directory_audio_filter,
|
|
|
|
g_defaults.dirs[DEFAULT_DIR_AUDIO_FILTER]);
|
|
|
|
if (!string_is_empty(g_defaults.dirs[DEFAULT_DIR_VIDEO_FILTER]))
|
2020-06-26 18:25:12 +02:00
|
|
|
configuration_set_string(settings,
|
2020-06-26 18:40:20 +02:00
|
|
|
settings->paths.directory_video_filter,
|
|
|
|
g_defaults.dirs[DEFAULT_DIR_VIDEO_FILTER]);
|
|
|
|
if (!string_is_empty(g_defaults.dirs[DEFAULT_DIR_SHADER]))
|
|
|
|
fill_pathname_expand_special(settings->paths.directory_video_shader,
|
|
|
|
g_defaults.dirs[DEFAULT_DIR_SHADER],
|
|
|
|
sizeof(settings->paths.directory_video_shader));
|
|
|
|
|
2020-08-16 04:38:02 +02:00
|
|
|
if (!string_is_empty(g_defaults.path_buildbot_server_url))
|
2020-06-26 18:25:12 +02:00
|
|
|
configuration_set_string(settings,
|
2020-06-26 18:40:20 +02:00
|
|
|
settings->paths.network_buildbot_url,
|
2020-08-16 04:38:02 +02:00
|
|
|
g_defaults.path_buildbot_server_url);
|
2020-06-26 18:40:20 +02:00
|
|
|
if (!string_is_empty(g_defaults.dirs[DEFAULT_DIR_DATABASE]))
|
2020-06-26 18:25:12 +02:00
|
|
|
configuration_set_string(settings,
|
2020-06-26 18:40:20 +02:00
|
|
|
settings->paths.path_content_database,
|
|
|
|
g_defaults.dirs[DEFAULT_DIR_DATABASE]);
|
|
|
|
if (!string_is_empty(g_defaults.dirs[DEFAULT_DIR_CHEATS]))
|
2020-06-26 18:25:12 +02:00
|
|
|
configuration_set_string(settings,
|
2020-06-26 18:40:20 +02:00
|
|
|
settings->paths.path_cheat_database,
|
|
|
|
g_defaults.dirs[DEFAULT_DIR_CHEATS]);
|
|
|
|
if (!string_is_empty(g_defaults.dirs[DEFAULT_DIR_CORE_INFO]))
|
|
|
|
fill_pathname_expand_special(settings->paths.path_libretro_info,
|
|
|
|
g_defaults.dirs[DEFAULT_DIR_CORE_INFO],
|
|
|
|
sizeof(settings->paths.path_libretro_info));
|
|
|
|
#ifdef HAVE_OVERLAY
|
|
|
|
if (!string_is_empty(g_defaults.dirs[DEFAULT_DIR_OVERLAY]))
|
|
|
|
{
|
|
|
|
fill_pathname_expand_special(settings->paths.directory_overlay,
|
|
|
|
g_defaults.dirs[DEFAULT_DIR_OVERLAY],
|
|
|
|
sizeof(settings->paths.directory_overlay));
|
|
|
|
#ifdef RARCH_MOBILE
|
|
|
|
if (string_is_empty(settings->paths.path_overlay))
|
2022-08-04 14:18:11 +02:00
|
|
|
fill_pathname_join_special(settings->paths.path_overlay,
|
2020-09-11 17:58:44 +01:00
|
|
|
settings->paths.directory_overlay,
|
|
|
|
FILE_PATH_DEFAULT_OVERLAY,
|
|
|
|
sizeof(settings->paths.path_overlay));
|
2020-06-26 18:25:12 +02:00
|
|
|
#endif
|
2020-06-26 18:40:20 +02:00
|
|
|
}
|
2023-07-08 12:45:13 -05:00
|
|
|
if (!string_is_empty(g_defaults.dirs[DEFAULT_DIR_OSK_OVERLAY]))
|
|
|
|
fill_pathname_expand_special(settings->paths.directory_osk_overlay,
|
|
|
|
g_defaults.dirs[DEFAULT_DIR_OSK_OVERLAY],
|
|
|
|
sizeof(settings->paths.directory_osk_overlay));
|
2020-06-26 18:25:12 +02:00
|
|
|
#endif
|
2016-10-09 09:05:41 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
#ifdef HAVE_MENU
|
|
|
|
if (!string_is_empty(g_defaults.dirs[DEFAULT_DIR_MENU_CONFIG]))
|
|
|
|
{
|
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->paths.directory_menu_config,
|
|
|
|
g_defaults.dirs[DEFAULT_DIR_MENU_CONFIG]);
|
|
|
|
#if TARGET_OS_IPHONE
|
|
|
|
{
|
2020-08-18 12:44:14 +02:00
|
|
|
char config_file_path[PATH_MAX_LENGTH];
|
2022-08-04 14:18:11 +02:00
|
|
|
fill_pathname_join_special(config_file_path,
|
2020-08-18 12:44:14 +02:00
|
|
|
settings->paths.directory_menu_config,
|
2020-08-22 01:06:10 +02:00
|
|
|
FILE_PATH_MAIN_CONFIG,
|
2020-08-18 12:44:14 +02:00
|
|
|
sizeof(config_file_path));
|
2020-06-26 18:40:20 +02:00
|
|
|
path_set(RARCH_PATH_CONFIG,
|
|
|
|
config_file_path);
|
|
|
|
}
|
2020-06-26 18:25:12 +02:00
|
|
|
#endif
|
2020-06-26 18:40:20 +02:00
|
|
|
}
|
2016-10-09 09:05:41 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
if (!string_is_empty(g_defaults.dirs[DEFAULT_DIR_MENU_CONTENT]))
|
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->paths.directory_menu_content,
|
|
|
|
g_defaults.dirs[DEFAULT_DIR_MENU_CONTENT]);
|
|
|
|
#endif
|
|
|
|
if (!string_is_empty(g_defaults.dirs[DEFAULT_DIR_AUTOCONFIG]))
|
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->paths.directory_autoconfig,
|
|
|
|
g_defaults.dirs[DEFAULT_DIR_AUTOCONFIG]);
|
2013-09-22 11:08:09 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
if (!string_is_empty(g_defaults.dirs[DEFAULT_DIR_SAVESTATE]))
|
|
|
|
dir_set(RARCH_DIR_SAVESTATE, g_defaults.dirs[DEFAULT_DIR_SAVESTATE]);
|
2014-01-08 17:31:14 +01:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
if (!string_is_empty(g_defaults.dirs[DEFAULT_DIR_SRAM]))
|
|
|
|
dir_set(RARCH_DIR_SAVEFILE, g_defaults.dirs[DEFAULT_DIR_SRAM]);
|
2017-06-08 16:13:45 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
if (!string_is_empty(g_defaults.dirs[DEFAULT_DIR_SYSTEM]))
|
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->paths.directory_system,
|
|
|
|
g_defaults.dirs[DEFAULT_DIR_SYSTEM]);
|
|
|
|
if (!string_is_empty(g_defaults.dirs[DEFAULT_DIR_SCREENSHOT]))
|
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->paths.directory_screenshot,
|
|
|
|
g_defaults.dirs[DEFAULT_DIR_SCREENSHOT]);
|
|
|
|
if (!string_is_empty(g_defaults.dirs[DEFAULT_DIR_RESAMPLER]))
|
2020-06-26 18:25:12 +02:00
|
|
|
configuration_set_string(settings,
|
2020-06-26 18:40:20 +02:00
|
|
|
settings->paths.directory_resampler,
|
|
|
|
g_defaults.dirs[DEFAULT_DIR_RESAMPLER]);
|
|
|
|
if (!string_is_empty(g_defaults.dirs[DEFAULT_DIR_LOGS]))
|
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->paths.log_dir,
|
|
|
|
g_defaults.dirs[DEFAULT_DIR_LOGS]);
|
2017-12-27 11:05:12 -05:00
|
|
|
|
2020-10-17 20:52:27 +03:00
|
|
|
if (!string_is_empty(g_defaults.dirs[DEFAULT_DIR_RECORD_OUTPUT]))
|
2021-11-10 02:34:04 +01:00
|
|
|
fill_pathname_expand_special(recording_st->output_dir,
|
2020-10-17 20:52:27 +03:00
|
|
|
g_defaults.dirs[DEFAULT_DIR_RECORD_OUTPUT],
|
2021-11-10 02:34:04 +01:00
|
|
|
sizeof(recording_st->output_dir));
|
2020-10-17 20:52:27 +03:00
|
|
|
if (!string_is_empty(g_defaults.dirs[DEFAULT_DIR_RECORD_CONFIG]))
|
2021-11-10 02:34:04 +01:00
|
|
|
fill_pathname_expand_special(recording_st->config_dir,
|
2020-10-17 20:52:27 +03:00
|
|
|
g_defaults.dirs[DEFAULT_DIR_RECORD_CONFIG],
|
2021-11-10 02:34:04 +01:00
|
|
|
sizeof(recording_st->config_dir));
|
2020-10-17 20:52:27 +03:00
|
|
|
|
2020-08-16 04:38:02 +02:00
|
|
|
if (!string_is_empty(g_defaults.path_config))
|
2020-06-26 18:40:20 +02:00
|
|
|
{
|
2020-08-18 12:44:14 +02:00
|
|
|
char temp_str[PATH_MAX_LENGTH];
|
2017-12-27 11:05:12 -05:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
temp_str[0] = '\0';
|
2017-12-27 11:05:12 -05:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
fill_pathname_expand_special(temp_str,
|
2020-08-16 04:38:02 +02:00
|
|
|
g_defaults.path_config,
|
2020-08-18 12:44:14 +02:00
|
|
|
sizeof(temp_str));
|
2020-06-26 18:40:20 +02:00
|
|
|
path_set(RARCH_PATH_CONFIG, temp_str);
|
|
|
|
}
|
2017-12-27 16:21:56 -05:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->arrays.midi_input,
|
|
|
|
DEFAULT_MIDI_INPUT);
|
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->arrays.midi_output,
|
|
|
|
DEFAULT_MIDI_OUTPUT);
|
2016-07-24 08:52:03 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
#ifdef HAVE_CONFIGFILE
|
|
|
|
/* Avoid reloading config on every content load */
|
|
|
|
if (DEFAULT_BLOCK_CONFIG_READ)
|
2021-09-28 12:56:10 +02:00
|
|
|
retroarch_ctl(RARCH_CTL_SET_BLOCK_CONFIG_READ, NULL);
|
2020-06-26 18:40:20 +02:00
|
|
|
else
|
2021-09-28 12:56:10 +02:00
|
|
|
retroarch_ctl(RARCH_CTL_UNSET_BLOCK_CONFIG_READ, NULL);
|
2020-06-26 18:25:12 +02:00
|
|
|
#endif
|
2016-07-24 08:52:03 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
#ifdef HAVE_MENU
|
|
|
|
first_initialized = false;
|
2020-06-26 18:25:12 +02:00
|
|
|
#endif
|
2020-06-26 18:40:20 +02:00
|
|
|
}
|
2015-01-13 03:13:19 +01:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/**
|
|
|
|
* config_load:
|
|
|
|
*
|
|
|
|
* Loads a config file and reads all the values into memory.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void config_load(void *data)
|
|
|
|
{
|
|
|
|
global_t *global = (global_t*)data;
|
|
|
|
config_set_defaults(global);
|
2020-06-26 18:25:12 +02:00
|
|
|
#ifdef HAVE_CONFIGFILE
|
2020-06-26 18:40:20 +02:00
|
|
|
config_parse_file(global);
|
2020-06-26 18:25:12 +02:00
|
|
|
#endif
|
2020-06-26 18:40:20 +02:00
|
|
|
}
|
2016-09-01 02:40:05 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
#ifdef HAVE_CONFIGFILE
|
|
|
|
#if defined(HAVE_MENU) && defined(HAVE_RGUI)
|
|
|
|
static bool check_menu_driver_compatibility(settings_t *settings)
|
|
|
|
{
|
|
|
|
char *video_driver = settings->arrays.video_driver;
|
|
|
|
char *menu_driver = settings->arrays.menu_driver;
|
2016-06-25 07:12:37 +02:00
|
|
|
|
2023-09-03 17:37:00 +02:00
|
|
|
if ( string_is_equal(menu_driver, "rgui")
|
|
|
|
|| string_is_equal(menu_driver, "null")
|
|
|
|
|| string_is_equal(video_driver, "null"))
|
2020-06-26 18:40:20 +02:00
|
|
|
return true;
|
2016-09-03 08:12:40 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/* TODO/FIXME - maintenance hazard */
|
|
|
|
if (string_starts_with_size(video_driver, "d3d", STRLEN_CONST("d3d")))
|
|
|
|
if (
|
2023-09-03 17:37:00 +02:00
|
|
|
string_is_equal(video_driver, "d3d9_hlsl")
|
|
|
|
|| string_is_equal(video_driver, "d3d9_cg")
|
|
|
|
|| string_is_equal(video_driver, "d3d10")
|
|
|
|
|| string_is_equal(video_driver, "d3d11")
|
|
|
|
|| string_is_equal(video_driver, "d3d12")
|
2020-06-26 18:40:20 +02:00
|
|
|
)
|
|
|
|
return true;
|
|
|
|
if (string_starts_with_size(video_driver, "gl", STRLEN_CONST("gl")))
|
|
|
|
if (
|
2023-09-03 17:37:00 +02:00
|
|
|
string_is_equal(video_driver, "gl")
|
|
|
|
|| string_is_equal(video_driver, "gl1")
|
|
|
|
|| string_is_equal(video_driver, "glcore")
|
2020-06-26 18:40:20 +02:00
|
|
|
)
|
|
|
|
return true;
|
|
|
|
if (
|
2023-09-03 17:37:00 +02:00
|
|
|
string_is_equal(video_driver, "caca")
|
|
|
|
|| string_is_equal(video_driver, "gdi")
|
|
|
|
|| string_is_equal(video_driver, "gx2")
|
|
|
|
|| string_is_equal(video_driver, "vulkan")
|
|
|
|
|| string_is_equal(video_driver, "metal")
|
|
|
|
|| string_is_equal(video_driver, "ctr")
|
|
|
|
|| string_is_equal(video_driver, "vita2d")
|
|
|
|
|| string_is_equal(video_driver, "rsx")
|
2020-06-26 18:40:20 +02:00
|
|
|
)
|
|
|
|
return true;
|
2016-09-03 08:12:40 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
return false;
|
|
|
|
}
|
2020-06-26 18:25:12 +02:00
|
|
|
#endif
|
2016-09-03 08:12:40 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/**
|
|
|
|
* open_default_config_file
|
|
|
|
*
|
|
|
|
* Open a default config file. Platform-specific.
|
|
|
|
*
|
|
|
|
* Returns: handle to config file if found, otherwise NULL.
|
|
|
|
**/
|
|
|
|
static config_file_t *open_default_config_file(void)
|
|
|
|
{
|
2020-08-18 12:44:14 +02:00
|
|
|
char conf_path[PATH_MAX_LENGTH];
|
2020-06-26 18:40:20 +02:00
|
|
|
config_file_t *conf = NULL;
|
2022-08-04 16:19:50 +02:00
|
|
|
#ifndef RARCH_CONSOLE
|
|
|
|
char application_data[PATH_MAX_LENGTH] = {0};
|
|
|
|
#endif
|
2020-06-26 18:40:20 +02:00
|
|
|
#if defined(_WIN32) && !defined(_XBOX)
|
2022-08-04 16:19:50 +02:00
|
|
|
char app_path[PATH_MAX_LENGTH] = {0};
|
2020-06-26 18:40:20 +02:00
|
|
|
#if defined(__WINRT__) || defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
|
|
|
|
/* On UWP, the app install directory is not writable so use the writable LocalState dir instead */
|
2020-08-18 12:44:14 +02:00
|
|
|
fill_pathname_home_dir(app_path, sizeof(app_path));
|
2020-06-26 18:40:20 +02:00
|
|
|
#else
|
2020-08-18 12:44:14 +02:00
|
|
|
fill_pathname_application_dir(app_path, sizeof(app_path));
|
2019-07-11 11:51:06 +02:00
|
|
|
#endif
|
2020-06-26 18:40:20 +02:00
|
|
|
fill_pathname_resolve_relative(conf_path, app_path,
|
2020-08-22 01:06:10 +02:00
|
|
|
FILE_PATH_MAIN_CONFIG, sizeof(conf_path));
|
2016-07-24 08:52:03 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
conf = config_file_new_from_path_to_string(conf_path);
|
2017-11-24 06:45:21 +01:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
if (!conf)
|
2016-04-28 20:49:13 +02:00
|
|
|
{
|
2020-06-26 18:40:20 +02:00
|
|
|
if (fill_pathname_application_data(application_data,
|
2020-08-18 12:44:14 +02:00
|
|
|
sizeof(application_data)))
|
2020-06-26 18:40:20 +02:00
|
|
|
{
|
2022-08-04 14:18:11 +02:00
|
|
|
fill_pathname_join_special(conf_path, application_data,
|
2020-08-22 01:06:10 +02:00
|
|
|
FILE_PATH_MAIN_CONFIG, sizeof(conf_path));
|
2020-06-26 18:40:20 +02:00
|
|
|
conf = config_file_new_from_path_to_string(conf_path);
|
|
|
|
}
|
2016-04-28 20:49:13 +02:00
|
|
|
}
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
if (!conf)
|
|
|
|
{
|
|
|
|
bool saved = false;
|
|
|
|
|
|
|
|
/* Try to create a new config file. */
|
|
|
|
conf = config_file_new_alloc();
|
|
|
|
|
|
|
|
if (conf)
|
|
|
|
{
|
|
|
|
/* Since this is a clean config file, we can
|
|
|
|
* safely use config_save_on_exit. */
|
|
|
|
fill_pathname_resolve_relative(conf_path, app_path,
|
2020-08-22 01:06:10 +02:00
|
|
|
FILE_PATH_MAIN_CONFIG, sizeof(conf_path));
|
2022-07-18 01:59:32 +02:00
|
|
|
config_set_string(conf, "config_save_on_exit", "true");
|
2020-06-26 18:40:20 +02:00
|
|
|
saved = config_file_write(conf, conf_path, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!saved)
|
|
|
|
{
|
|
|
|
/* WARN here to make sure user has a good chance of seeing it. */
|
2021-02-18 18:33:47 +02:00
|
|
|
RARCH_ERR("[Config]: Failed to create new config file in: \"%s\".\n",
|
2020-06-26 18:40:20 +02:00
|
|
|
conf_path);
|
|
|
|
goto error;
|
|
|
|
}
|
2017-08-12 17:10:14 +02:00
|
|
|
|
2021-02-18 18:33:47 +02:00
|
|
|
RARCH_WARN("[Config]: Created new config file in: \"%s\".\n", conf_path);
|
2020-06-26 18:40:20 +02:00
|
|
|
}
|
|
|
|
#elif defined(OSX)
|
|
|
|
if (!fill_pathname_application_data(application_data,
|
2020-08-18 12:44:14 +02:00
|
|
|
sizeof(application_data)))
|
2020-06-26 18:40:20 +02:00
|
|
|
goto error;
|
2016-04-28 20:49:13 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/* Group config file with menu configs, remaps, etc: */
|
2020-08-18 12:44:14 +02:00
|
|
|
strlcat(application_data, "/config", sizeof(application_data));
|
2016-07-30 22:32:52 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
path_mkdir(application_data);
|
2016-07-24 08:54:38 +02:00
|
|
|
|
2022-08-04 14:18:11 +02:00
|
|
|
fill_pathname_join_special(conf_path, application_data,
|
2020-08-22 01:06:10 +02:00
|
|
|
FILE_PATH_MAIN_CONFIG, sizeof(conf_path));
|
2016-04-28 20:49:13 +02:00
|
|
|
|
2022-08-06 18:04:40 +02:00
|
|
|
if (!(conf = config_file_new_from_path_to_string(conf_path)))
|
2016-04-28 20:49:13 +02:00
|
|
|
{
|
2020-06-26 18:40:20 +02:00
|
|
|
bool saved = false;
|
|
|
|
|
2022-08-06 18:04:40 +02:00
|
|
|
if ((conf = config_file_new_alloc()))
|
2020-06-26 18:40:20 +02:00
|
|
|
{
|
2022-07-18 01:59:32 +02:00
|
|
|
config_set_string(conf, "config_save_on_exit", "true");
|
2020-06-26 18:40:20 +02:00
|
|
|
saved = config_file_write(conf, conf_path, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!saved)
|
|
|
|
{
|
|
|
|
/* WARN here to make sure user has a good chance of seeing it. */
|
|
|
|
RARCH_ERR("Failed to create new config file in: \"%s\".\n",
|
|
|
|
conf_path);
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
RARCH_WARN("Created new config file in: \"%s\".\n", conf_path);
|
2016-04-28 20:49:13 +02:00
|
|
|
}
|
2020-06-26 18:40:20 +02:00
|
|
|
#elif !defined(RARCH_CONSOLE)
|
2022-08-04 16:19:50 +02:00
|
|
|
bool has_application_data =
|
2020-06-26 18:40:20 +02:00
|
|
|
fill_pathname_application_data(application_data,
|
2020-08-18 12:44:14 +02:00
|
|
|
sizeof(application_data));
|
2020-06-26 18:40:20 +02:00
|
|
|
|
|
|
|
if (has_application_data)
|
2020-06-26 18:25:12 +02:00
|
|
|
{
|
2022-08-04 14:18:11 +02:00
|
|
|
fill_pathname_join_special(conf_path, application_data,
|
2020-08-22 01:06:10 +02:00
|
|
|
FILE_PATH_MAIN_CONFIG, sizeof(conf_path));
|
2021-02-18 18:33:47 +02:00
|
|
|
RARCH_LOG("[Config]: Looking for config in: \"%s\".\n", conf_path);
|
2020-06-26 18:40:20 +02:00
|
|
|
conf = config_file_new_from_path_to_string(conf_path);
|
2020-06-26 18:25:12 +02:00
|
|
|
}
|
2011-02-05 11:31:35 +01:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/* Fallback to $HOME/.retroarch.cfg. */
|
|
|
|
if (!conf && getenv("HOME"))
|
2019-03-21 16:56:24 +00:00
|
|
|
{
|
2022-08-04 14:18:11 +02:00
|
|
|
fill_pathname_join_special(conf_path, getenv("HOME"),
|
2020-08-22 12:49:35 +02:00
|
|
|
"." FILE_PATH_MAIN_CONFIG, sizeof(conf_path));
|
2021-02-18 18:33:47 +02:00
|
|
|
RARCH_LOG("[Config]: Looking for config in: \"%s\".\n", conf_path);
|
2020-06-26 18:40:20 +02:00
|
|
|
conf = config_file_new_from_path_to_string(conf_path);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!conf && has_application_data)
|
|
|
|
{
|
|
|
|
bool dir_created = false;
|
2020-08-18 12:44:14 +02:00
|
|
|
char basedir[PATH_MAX_LENGTH];
|
2020-06-26 18:40:20 +02:00
|
|
|
/* Try to create a new config file. */
|
2020-08-18 12:44:14 +02:00
|
|
|
fill_pathname_basedir(basedir, application_data, sizeof(basedir));
|
2022-08-04 14:18:11 +02:00
|
|
|
fill_pathname_join_special(conf_path, application_data,
|
2020-08-22 01:06:10 +02:00
|
|
|
FILE_PATH_MAIN_CONFIG, sizeof(conf_path));
|
2020-06-26 18:40:20 +02:00
|
|
|
|
|
|
|
dir_created = path_mkdir(basedir);
|
|
|
|
|
|
|
|
if (dir_created)
|
2020-03-05 13:00:43 +01:00
|
|
|
{
|
2020-08-18 12:44:14 +02:00
|
|
|
char skeleton_conf[PATH_MAX_LENGTH];
|
2020-06-26 18:40:20 +02:00
|
|
|
bool saved = false;
|
|
|
|
/* Build a retroarch.cfg path from the
|
|
|
|
* global config directory (/etc). */
|
2022-08-04 14:18:11 +02:00
|
|
|
fill_pathname_join_special(skeleton_conf, GLOBAL_CONFIG_DIR,
|
2020-08-22 01:06:10 +02:00
|
|
|
FILE_PATH_MAIN_CONFIG, sizeof(skeleton_conf));
|
2022-07-23 10:44:41 +02:00
|
|
|
if ((conf = config_file_new_from_path_to_string(skeleton_conf)))
|
2021-02-18 18:33:47 +02:00
|
|
|
RARCH_WARN("[Config]: Using skeleton config \"%s\" as base for a new config file.\n", skeleton_conf);
|
2020-06-26 18:40:20 +02:00
|
|
|
else
|
|
|
|
conf = config_file_new_alloc();
|
|
|
|
|
|
|
|
if (conf)
|
|
|
|
{
|
|
|
|
/* Since this is a clean config file, we can
|
|
|
|
* safely use config_save_on_exit. */
|
2022-07-18 01:59:32 +02:00
|
|
|
config_set_string(conf, "config_save_on_exit", "true");
|
2020-06-26 18:40:20 +02:00
|
|
|
saved = config_file_write(conf, conf_path, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!saved)
|
|
|
|
{
|
|
|
|
/* WARN here to make sure user has a good chance of seeing it. */
|
2021-02-18 18:33:47 +02:00
|
|
|
RARCH_ERR("[Config]: Failed to create new config file in: \"%s\".\n",
|
2020-08-18 12:44:14 +02:00
|
|
|
conf_path);
|
2020-06-26 18:40:20 +02:00
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
2021-02-18 18:33:47 +02:00
|
|
|
RARCH_WARN("[Config]: Created new config file in: \"%s\".\n",
|
2020-08-18 12:44:14 +02:00
|
|
|
conf_path);
|
2020-03-05 13:00:43 +01:00
|
|
|
}
|
2019-03-21 16:56:24 +00:00
|
|
|
}
|
2016-03-22 05:46:36 +07:00
|
|
|
#endif
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
if (!conf)
|
|
|
|
goto error;
|
2016-09-17 14:49:35 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
path_set(RARCH_PATH_CONFIG, conf_path);
|
|
|
|
|
|
|
|
return conf;
|
|
|
|
|
|
|
|
error:
|
|
|
|
if (conf)
|
|
|
|
config_file_free(conf);
|
|
|
|
return NULL;
|
|
|
|
}
|
2012-06-12 00:28:34 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
#ifdef RARCH_CONSOLE
|
2022-01-09 05:19:03 -05:00
|
|
|
static void video_driver_load_settings(global_t *global,
|
2021-04-08 01:54:44 +02:00
|
|
|
config_file_t *conf)
|
2020-06-26 18:40:20 +02:00
|
|
|
{
|
|
|
|
bool tmp_bool = false;
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
CONFIG_GET_INT_BASE(conf, global,
|
|
|
|
console.screen.gamma_correction, "gamma_correction");
|
2011-08-24 15:47:39 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
if (config_get_bool(conf, "flicker_filter_enable",
|
|
|
|
&tmp_bool))
|
|
|
|
global->console.flickerfilter_enable = tmp_bool;
|
2010-12-29 21:12:56 +01:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
if (config_get_bool(conf, "soft_filter_enable",
|
|
|
|
&tmp_bool))
|
|
|
|
global->console.softfilter_enable = tmp_bool;
|
2018-10-06 17:48:12 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
CONFIG_GET_INT_BASE(conf, global,
|
|
|
|
console.screen.soft_filter_index,
|
|
|
|
"soft_filter_index");
|
|
|
|
CONFIG_GET_INT_BASE(conf, global,
|
|
|
|
console.screen.resolutions.current.id,
|
|
|
|
"current_resolution_id");
|
|
|
|
CONFIG_GET_INT_BASE(conf, global,
|
|
|
|
console.screen.flicker_filter_index,
|
|
|
|
"flicker_filter_index");
|
2020-06-26 18:25:12 +02:00
|
|
|
}
|
2020-06-26 18:40:20 +02:00
|
|
|
#endif
|
2018-11-29 18:42:44 +01:00
|
|
|
|
2022-10-12 12:37:36 +03:00
|
|
|
static void check_verbosity_settings(config_file_t *conf,
|
|
|
|
settings_t *settings)
|
|
|
|
{
|
|
|
|
unsigned tmp_uint = 0;
|
|
|
|
bool tmp_bool = false;
|
|
|
|
|
|
|
|
/* Make sure log_to_file is true if 'log-file' command line argument was used. */
|
|
|
|
if (retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_LOG_TO_FILE, NULL))
|
|
|
|
{
|
|
|
|
configuration_set_bool(settings, settings->bools.log_to_file, true);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Make sure current 'log_to_file' is effective */
|
|
|
|
if (config_get_bool(conf, "log_to_file", &tmp_bool))
|
|
|
|
configuration_set_bool(settings, settings->bools.log_to_file, tmp_bool);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Set frontend log level */
|
|
|
|
if (config_get_uint(conf, "frontend_log_level", &tmp_uint))
|
|
|
|
verbosity_set_log_level(tmp_uint);
|
|
|
|
|
|
|
|
/* Set verbosity according to config only if command line argument was not used. */
|
|
|
|
if (retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_VERBOSITY, NULL))
|
|
|
|
{
|
|
|
|
verbosity_enable();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (config_get_bool(conf, "log_verbosity", &tmp_bool))
|
|
|
|
{
|
|
|
|
if (tmp_bool)
|
|
|
|
verbosity_enable();
|
|
|
|
else
|
|
|
|
verbosity_disable();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-26 18:25:12 +02:00
|
|
|
/**
|
|
|
|
* config_load:
|
2020-06-26 18:40:20 +02:00
|
|
|
* @path : path to be read from.
|
|
|
|
* @set_defaults : set default values first before
|
|
|
|
* reading the values from the config file
|
2020-06-26 18:25:12 +02:00
|
|
|
*
|
|
|
|
* Loads a config file and reads all the values into memory.
|
|
|
|
*
|
|
|
|
*/
|
2020-06-26 18:40:20 +02:00
|
|
|
static bool config_load_file(global_t *global,
|
|
|
|
const char *path, settings_t *settings)
|
2020-06-26 18:25:12 +02:00
|
|
|
{
|
2020-06-26 18:40:20 +02:00
|
|
|
unsigned i;
|
2020-08-18 12:44:14 +02:00
|
|
|
char tmp_str[PATH_MAX_LENGTH];
|
2021-08-02 20:31:48 -05:00
|
|
|
static bool first_load = true;
|
2023-01-29 01:12:08 +02:00
|
|
|
bool without_overrides = false;
|
2020-06-26 18:40:20 +02:00
|
|
|
unsigned msg_color = 0;
|
|
|
|
char *save = NULL;
|
|
|
|
char *override_username = NULL;
|
|
|
|
const char *path_config = NULL;
|
2021-11-09 06:03:00 +01:00
|
|
|
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
2020-06-26 18:40:20 +02:00
|
|
|
int bool_settings_size = sizeof(settings->bools) / sizeof(settings->bools.placeholder);
|
|
|
|
int float_settings_size = sizeof(settings->floats) / sizeof(settings->floats.placeholder);
|
|
|
|
int int_settings_size = sizeof(settings->ints) / sizeof(settings->ints.placeholder);
|
|
|
|
int uint_settings_size = sizeof(settings->uints) / sizeof(settings->uints.placeholder);
|
|
|
|
int size_settings_size = sizeof(settings->sizes) / sizeof(settings->sizes.placeholder);
|
|
|
|
int array_settings_size = sizeof(settings->arrays) / sizeof(settings->arrays.placeholder);
|
|
|
|
int path_settings_size = sizeof(settings->paths) / sizeof(settings->paths.placeholder);
|
2021-08-30 17:52:50 +02:00
|
|
|
struct config_bool_setting *bool_settings = NULL;
|
|
|
|
struct config_float_setting *float_settings = NULL;
|
|
|
|
struct config_int_setting *int_settings = NULL;
|
|
|
|
struct config_uint_setting *uint_settings = NULL;
|
|
|
|
struct config_size_setting *size_settings = NULL;
|
|
|
|
struct config_array_setting *array_settings = NULL;
|
|
|
|
struct config_path_setting *path_settings = NULL;
|
2023-01-29 01:12:08 +02:00
|
|
|
config_file_t *conf = NULL;
|
2022-10-12 13:27:31 +02:00
|
|
|
uint16_t rarch_flags = retroarch_get_flags();
|
2010-12-30 04:51:08 +01:00
|
|
|
|
2021-08-30 17:52:50 +02:00
|
|
|
tmp_str[0] = '\0';
|
2015-11-17 18:30:11 -05:00
|
|
|
|
2023-01-29 01:12:08 +02:00
|
|
|
/* Override config comparison must be compared to config before overrides */
|
|
|
|
if (string_is_equal(path, "without-overrides"))
|
|
|
|
{
|
|
|
|
path = path_get(RARCH_PATH_CONFIG);
|
|
|
|
without_overrides = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
conf = (path) ? config_file_new_from_path_to_string(path) : open_default_config_file();
|
|
|
|
|
2023-05-11 22:30:06 -04:00
|
|
|
#if TARGET_OS_TV
|
|
|
|
if (!conf && path && string_is_equal(path, path_get(RARCH_PATH_CONFIG)))
|
|
|
|
{
|
|
|
|
/* Sometimes the OS decides it needs to reclaim disk space
|
|
|
|
* by emptying the cache, which is the only disk space we
|
|
|
|
* have access to, other than NSUserDefaults. */
|
|
|
|
conf = open_userdefaults_config_file();
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
if (!conf)
|
|
|
|
{
|
2021-08-30 17:52:50 +02:00
|
|
|
first_load = false;
|
2020-06-26 18:40:20 +02:00
|
|
|
if (!path)
|
2021-08-30 17:52:50 +02:00
|
|
|
return true;
|
|
|
|
return false;
|
2020-06-26 18:40:20 +02:00
|
|
|
}
|
2015-11-17 18:30:11 -05:00
|
|
|
|
2023-09-03 17:37:00 +02:00
|
|
|
bool_settings = populate_settings_bool (settings, &bool_settings_size);
|
|
|
|
float_settings = populate_settings_float (settings, &float_settings_size);
|
|
|
|
int_settings = populate_settings_int (settings, &int_settings_size);
|
|
|
|
uint_settings = populate_settings_uint (settings, &uint_settings_size);
|
|
|
|
size_settings = populate_settings_size (settings, &size_settings_size);
|
|
|
|
array_settings = populate_settings_array (settings, &array_settings_size);
|
|
|
|
path_settings = populate_settings_path (settings, &path_settings_size);
|
2021-08-30 17:52:50 +02:00
|
|
|
|
2022-10-12 12:37:36 +03:00
|
|
|
/* Initialize verbosity settings */
|
|
|
|
check_verbosity_settings(conf, settings);
|
|
|
|
|
|
|
|
if (!first_load)
|
|
|
|
{
|
|
|
|
if (!path)
|
|
|
|
RARCH_LOG("[Config]: Loading default config.\n");
|
|
|
|
else
|
|
|
|
RARCH_LOG("[Config]: Loading config: \"%s\".\n", path);
|
|
|
|
}
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
if (!path_is_empty(RARCH_PATH_CONFIG_APPEND))
|
|
|
|
{
|
|
|
|
/* Don't destroy append_config_path, store in temporary
|
|
|
|
* variable. */
|
2020-08-18 12:44:14 +02:00
|
|
|
char tmp_append_path[PATH_MAX_LENGTH];
|
2020-06-26 18:40:20 +02:00
|
|
|
const char *extra_path = NULL;
|
|
|
|
strlcpy(tmp_append_path, path_get(RARCH_PATH_CONFIG_APPEND),
|
2020-08-18 12:44:14 +02:00
|
|
|
sizeof(tmp_append_path));
|
2020-06-26 18:40:20 +02:00
|
|
|
extra_path = strtok_r(tmp_append_path, "|", &save);
|
2015-04-05 11:14:24 -05:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
while (extra_path)
|
|
|
|
{
|
|
|
|
bool result = config_append_file(conf, extra_path);
|
2015-04-05 11:14:24 -05:00
|
|
|
|
2022-10-12 12:37:36 +03:00
|
|
|
if (!first_load)
|
|
|
|
{
|
|
|
|
RARCH_LOG("[Config]: Appending config: \"%s\".\n", extra_path);
|
2018-05-09 08:40:25 -05:00
|
|
|
|
2022-10-12 12:37:36 +03:00
|
|
|
if (!result)
|
|
|
|
RARCH_ERR("[Config]: Failed to append config: \"%s\".\n", extra_path);
|
|
|
|
}
|
2020-06-26 18:40:20 +02:00
|
|
|
extra_path = strtok_r(NULL, "|", &save);
|
|
|
|
}
|
2022-10-12 12:37:36 +03:00
|
|
|
|
|
|
|
/* Re-check verbosity settings */
|
|
|
|
check_verbosity_settings(conf, settings);
|
2020-06-26 18:40:20 +02:00
|
|
|
}
|
2019-04-27 14:01:50 +02:00
|
|
|
|
2023-01-29 01:12:08 +02:00
|
|
|
if (!path_is_empty(RARCH_PATH_CONFIG_OVERRIDE) && !without_overrides)
|
2023-01-25 08:15:42 +02:00
|
|
|
{
|
|
|
|
/* Don't destroy append_config_path, store in temporary
|
|
|
|
* variable. */
|
|
|
|
char tmp_append_path[PATH_MAX_LENGTH];
|
|
|
|
const char *extra_path = NULL;
|
|
|
|
strlcpy(tmp_append_path, path_get(RARCH_PATH_CONFIG_OVERRIDE),
|
|
|
|
sizeof(tmp_append_path));
|
|
|
|
extra_path = strtok_r(tmp_append_path, "|", &save);
|
|
|
|
|
|
|
|
while (extra_path)
|
|
|
|
{
|
|
|
|
bool result = config_append_file(conf, extra_path);
|
|
|
|
|
|
|
|
if (!first_load)
|
|
|
|
{
|
|
|
|
RARCH_LOG("[Config]: Appending override config: \"%s\".\n", extra_path);
|
|
|
|
|
|
|
|
if (!result)
|
|
|
|
RARCH_ERR("[Config]: Failed to append override config: \"%s\".\n", extra_path);
|
|
|
|
}
|
|
|
|
extra_path = strtok_r(NULL, "|", &save);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Re-check verbosity settings */
|
|
|
|
check_verbosity_settings(conf, settings);
|
|
|
|
}
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
#if 0
|
|
|
|
if (verbosity_is_enabled())
|
2015-04-05 11:14:24 -05:00
|
|
|
{
|
2020-06-26 18:40:20 +02:00
|
|
|
RARCH_LOG_OUTPUT("=== Config ===\n");
|
|
|
|
config_file_dump_all(conf);
|
|
|
|
RARCH_LOG_OUTPUT("=== Config end ===\n");
|
|
|
|
}
|
|
|
|
#endif
|
2016-09-17 14:14:58 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/* Overrides */
|
2015-11-15 22:02:24 +01:00
|
|
|
|
2022-10-12 13:27:31 +02:00
|
|
|
if (rarch_flags & RARCH_FLAGS_HAS_SET_USERNAME)
|
2020-06-26 18:40:20 +02:00
|
|
|
override_username = strdup(settings->paths.username);
|
|
|
|
|
|
|
|
/* Boolean settings */
|
|
|
|
|
|
|
|
for (i = 0; i < (unsigned)bool_settings_size; i++)
|
|
|
|
{
|
|
|
|
bool tmp = false;
|
|
|
|
if (config_get_bool(conf, bool_settings[i].ident, &tmp))
|
|
|
|
*bool_settings[i].ptr = tmp;
|
2015-04-05 11:14:24 -05:00
|
|
|
}
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
#ifdef HAVE_NETWORKGAMEPAD
|
2018-05-09 08:40:25 -05:00
|
|
|
{
|
2020-06-26 18:40:20 +02:00
|
|
|
char tmp[64];
|
2023-04-30 17:26:27 +02:00
|
|
|
size_t _len = strlcpy(tmp, "network_remote_enable_user_p", sizeof(tmp));
|
|
|
|
for (i = 0; i < MAX_USERS; i++)
|
|
|
|
{
|
|
|
|
bool tmp_bool = false;
|
|
|
|
snprintf(tmp + _len, sizeof(tmp) - _len, "%u", i + 1);
|
|
|
|
if (config_get_bool(conf, tmp, &tmp_bool))
|
|
|
|
configuration_set_bool(settings,
|
|
|
|
settings->bools.network_remote_enable_user[i], tmp_bool);
|
|
|
|
}
|
2020-06-26 18:40:20 +02:00
|
|
|
}
|
|
|
|
#endif
|
2018-05-13 15:24:10 -05:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/* Integer settings */
|
2018-05-13 15:24:10 -05:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
for (i = 0; i < (unsigned)int_settings_size; i++)
|
|
|
|
{
|
|
|
|
int tmp = 0;
|
|
|
|
if (config_get_int(conf, int_settings[i].ident, &tmp))
|
|
|
|
*int_settings[i].ptr = tmp;
|
|
|
|
}
|
2018-05-09 08:40:25 -05:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
for (i = 0; i < (unsigned)uint_settings_size; i++)
|
|
|
|
{
|
|
|
|
int tmp = 0;
|
|
|
|
if (config_get_int(conf, uint_settings[i].ident, &tmp))
|
|
|
|
*uint_settings[i].ptr = tmp;
|
2018-05-09 08:40:25 -05:00
|
|
|
}
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
for (i = 0; i < (unsigned)size_settings_size; i++)
|
2015-04-05 11:14:24 -05:00
|
|
|
{
|
2020-06-26 18:40:20 +02:00
|
|
|
size_t tmp = 0;
|
|
|
|
if (config_get_size_t(conf, size_settings[i].ident, &tmp))
|
2023-09-03 17:37:00 +02:00
|
|
|
*size_settings[i].ptr = tmp;
|
2022-01-09 05:19:03 -05:00
|
|
|
/* Special case for rewind_buffer_size - need to convert
|
2020-08-22 12:49:35 +02:00
|
|
|
* low values to what they were
|
2020-06-26 18:40:20 +02:00
|
|
|
* intended to be based on the default value in config.def.h
|
2022-01-09 05:19:03 -05:00
|
|
|
* If the value is less than 10000 then multiple by 1MB because if
|
2020-08-22 12:49:35 +02:00
|
|
|
* the retroarch.cfg
|
|
|
|
* file contains rewind_buffer_size = "100",
|
|
|
|
* then that ultimately gets interpreted as
|
2020-06-26 18:40:20 +02:00
|
|
|
* 100MB, so ensure the internal values represent that.*/
|
|
|
|
if (string_is_equal(size_settings[i].ident, "rewind_buffer_size"))
|
|
|
|
if (*size_settings[i].ptr < 10000)
|
|
|
|
*size_settings[i].ptr = *size_settings[i].ptr * 1024 * 1024;
|
|
|
|
}
|
2016-10-27 09:44:20 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
{
|
2022-08-23 08:29:48 +02:00
|
|
|
char prefix[24];
|
2023-04-30 17:26:27 +02:00
|
|
|
size_t _len = strlcpy(prefix, "input_player", sizeof(prefix));
|
|
|
|
for (i = 0; i < MAX_USERS; i++)
|
|
|
|
{
|
2023-06-18 12:06:12 +02:00
|
|
|
size_t _len2;
|
2023-04-30 17:26:27 +02:00
|
|
|
char buf[64];
|
|
|
|
snprintf(prefix + _len, sizeof(prefix) - _len, "%u", i + 1);
|
|
|
|
|
2023-06-18 12:06:12 +02:00
|
|
|
_len2 = strlcpy(buf, prefix, sizeof(buf));
|
|
|
|
|
|
|
|
strlcpy(buf + _len2, "_mouse_index", sizeof(buf) - _len2);
|
|
|
|
CONFIG_GET_INT_BASE(conf, settings, uints.input_mouse_index[i], buf);
|
2023-04-30 17:26:27 +02:00
|
|
|
|
2023-06-18 12:06:12 +02:00
|
|
|
strlcpy(buf + _len2, "_joypad_index", sizeof(buf) - _len2);
|
2023-04-30 17:26:27 +02:00
|
|
|
CONFIG_GET_INT_BASE(conf, settings, uints.input_joypad_index[i], buf);
|
|
|
|
|
2023-06-18 12:06:12 +02:00
|
|
|
strlcpy(buf + _len2, "_analog_dpad_mode", sizeof(buf) - _len2);
|
|
|
|
CONFIG_GET_INT_BASE(conf, settings, uints.input_analog_dpad_mode[i], buf);
|
2023-04-30 17:26:27 +02:00
|
|
|
}
|
2015-04-05 11:14:24 -05:00
|
|
|
}
|
2015-04-11 23:03:30 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/* LED map for use by the led driver */
|
|
|
|
for (i = 0; i < MAX_LEDS; i++)
|
|
|
|
{
|
|
|
|
char buf[64];
|
2015-05-07 00:36:29 -05:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
buf[0] = '\0';
|
2015-05-07 00:36:29 -05:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
snprintf(buf, sizeof(buf), "led%u_map", i + 1);
|
2020-08-01 18:14:48 +02:00
|
|
|
|
|
|
|
/* TODO/FIXME - change of sign - led_map is unsigned */
|
2020-08-22 18:04:34 +02:00
|
|
|
settings->uints.led_map[i] = -1;
|
2020-08-01 18:14:48 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
CONFIG_GET_INT_BASE(conf, settings, uints.led_map[i], buf);
|
|
|
|
}
|
2015-11-21 18:21:53 +01:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/* Hexadecimal settings */
|
2015-04-05 11:14:24 -05:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
if (config_get_hex(conf, "video_message_color", &msg_color))
|
|
|
|
{
|
|
|
|
settings->floats.video_msg_color_r = ((msg_color >> 16) & 0xff) / 255.0f;
|
|
|
|
settings->floats.video_msg_color_g = ((msg_color >> 8) & 0xff) / 255.0f;
|
|
|
|
settings->floats.video_msg_color_b = ((msg_color >> 0) & 0xff) / 255.0f;
|
|
|
|
}
|
2016-09-17 14:14:58 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/* Float settings */
|
|
|
|
for (i = 0; i < (unsigned)float_settings_size; i++)
|
|
|
|
{
|
|
|
|
float tmp = 0.0f;
|
|
|
|
if (config_get_float(conf, float_settings[i].ident, &tmp))
|
|
|
|
*float_settings[i].ptr = tmp;
|
|
|
|
}
|
2016-09-17 14:14:58 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/* Array settings */
|
|
|
|
for (i = 0; i < (unsigned)array_settings_size; i++)
|
|
|
|
{
|
|
|
|
if (!array_settings[i].handle)
|
|
|
|
continue;
|
|
|
|
config_get_array(conf, array_settings[i].ident,
|
|
|
|
array_settings[i].ptr, PATH_MAX_LENGTH);
|
|
|
|
}
|
2017-09-09 21:35:09 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/* Path settings */
|
|
|
|
for (i = 0; i < (unsigned)path_settings_size; i++)
|
|
|
|
{
|
|
|
|
if (!path_settings[i].handle)
|
|
|
|
continue;
|
2020-08-18 12:44:14 +02:00
|
|
|
if (config_get_path(conf, path_settings[i].ident, tmp_str, sizeof(tmp_str)))
|
2020-06-26 18:40:20 +02:00
|
|
|
strlcpy(path_settings[i].ptr, tmp_str, PATH_MAX_LENGTH);
|
|
|
|
}
|
2015-05-07 18:06:14 -05:00
|
|
|
|
2020-08-18 12:44:14 +02:00
|
|
|
if (config_get_path(conf, "libretro_directory", tmp_str, sizeof(tmp_str)))
|
2020-06-26 18:40:20 +02:00
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->paths.directory_libretro, tmp_str);
|
2015-05-07 18:06:14 -05:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
#ifdef RARCH_CONSOLE
|
2021-04-08 01:54:44 +02:00
|
|
|
if (conf)
|
|
|
|
video_driver_load_settings(global, conf);
|
2020-06-26 18:40:20 +02:00
|
|
|
#endif
|
2015-05-07 00:36:29 -05:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/* Post-settings load */
|
2015-05-08 09:12:49 +02:00
|
|
|
|
2022-10-12 13:27:31 +02:00
|
|
|
if ( (rarch_flags & RARCH_FLAGS_HAS_SET_USERNAME)
|
|
|
|
&& (override_username))
|
2020-06-26 18:40:20 +02:00
|
|
|
{
|
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->paths.username,
|
|
|
|
override_username);
|
|
|
|
free(override_username);
|
|
|
|
}
|
2018-05-13 16:20:51 -05:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
if (settings->uints.video_hard_sync_frames > 3)
|
|
|
|
settings->uints.video_hard_sync_frames = 3;
|
2015-11-17 18:30:11 -05:00
|
|
|
|
2021-06-09 07:32:01 +03:00
|
|
|
if (settings->uints.video_frame_delay > MAXIMUM_FRAME_DELAY)
|
|
|
|
settings->uints.video_frame_delay = MAXIMUM_FRAME_DELAY;
|
2015-12-26 07:19:04 +01:00
|
|
|
|
2022-05-11 11:06:49 +01:00
|
|
|
settings->uints.video_swap_interval = MAX(settings->uints.video_swap_interval, 0);
|
2020-06-26 18:40:20 +02:00
|
|
|
settings->uints.video_swap_interval = MIN(settings->uints.video_swap_interval, 4);
|
2019-04-28 03:21:30 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
audio_set_float(AUDIO_ACTION_VOLUME_GAIN, settings->floats.audio_volume);
|
|
|
|
#ifdef HAVE_AUDIOMIXER
|
|
|
|
audio_set_float(AUDIO_ACTION_MIXER_VOLUME_GAIN, settings->floats.audio_mixer_volume);
|
|
|
|
#endif
|
2016-10-20 18:33:25 +02:00
|
|
|
|
2023-11-19 18:44:25 +02:00
|
|
|
#ifdef HAVE_WASAPI
|
|
|
|
{
|
|
|
|
/* Migrate from old deprecated negative value */
|
|
|
|
int wasapi_sh_buffer_length = settings->uints.audio_wasapi_sh_buffer_length;
|
|
|
|
|
|
|
|
if (wasapi_sh_buffer_length < 0)
|
|
|
|
settings->uints.audio_wasapi_sh_buffer_length = 0;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2022-12-02 19:21:56 +02:00
|
|
|
/* MIDI fallback for old OFF-string */
|
|
|
|
if (string_is_equal(settings->arrays.midi_input, "Off"))
|
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->arrays.midi_input,
|
|
|
|
DEFAULT_MIDI_INPUT);
|
|
|
|
if (string_is_equal(settings->arrays.midi_output, "Off"))
|
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->arrays.midi_output,
|
|
|
|
DEFAULT_MIDI_OUTPUT);
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
path_config = path_get(RARCH_PATH_CONFIG);
|
2015-04-05 15:41:24 -05:00
|
|
|
|
2021-01-21 21:28:10 +01:00
|
|
|
if (string_is_empty(settings->paths.path_content_favorites))
|
2023-09-03 17:37:00 +02:00
|
|
|
strlcpy(settings->paths.directory_content_favorites, "default",
|
|
|
|
sizeof(settings->paths.directory_content_favorites));
|
2021-01-21 21:28:10 +01:00
|
|
|
|
2023-09-03 17:37:00 +02:00
|
|
|
if ( string_is_empty(settings->paths.directory_content_favorites)
|
|
|
|
|| string_is_equal(settings->paths.directory_content_favorites, "default"))
|
2021-01-21 21:28:10 +01:00
|
|
|
fill_pathname_resolve_relative(
|
|
|
|
settings->paths.path_content_favorites,
|
|
|
|
path_config,
|
|
|
|
FILE_PATH_CONTENT_FAVORITES,
|
|
|
|
sizeof(settings->paths.path_content_favorites));
|
|
|
|
else
|
2022-08-04 14:18:11 +02:00
|
|
|
fill_pathname_join_special(
|
2021-01-21 21:28:10 +01:00
|
|
|
settings->paths.path_content_favorites,
|
|
|
|
settings->paths.directory_content_favorites,
|
|
|
|
FILE_PATH_CONTENT_FAVORITES,
|
|
|
|
sizeof(settings->paths.path_content_favorites));
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
if (string_is_empty(settings->paths.path_content_history))
|
2023-09-03 17:37:00 +02:00
|
|
|
strlcpy(settings->paths.directory_content_history, "default",
|
|
|
|
sizeof(settings->paths.directory_content_history));
|
2021-01-21 21:28:10 +01:00
|
|
|
|
2023-09-03 17:37:00 +02:00
|
|
|
if ( string_is_empty(settings->paths.directory_content_history)
|
|
|
|
|| string_is_equal(settings->paths.directory_content_history, "default"))
|
2020-06-26 18:40:20 +02:00
|
|
|
fill_pathname_resolve_relative(
|
|
|
|
settings->paths.path_content_history,
|
|
|
|
path_config,
|
2020-08-22 01:06:10 +02:00
|
|
|
FILE_PATH_CONTENT_HISTORY,
|
2020-06-26 18:40:20 +02:00
|
|
|
sizeof(settings->paths.path_content_history));
|
2021-01-21 21:28:10 +01:00
|
|
|
else
|
2022-08-04 14:18:11 +02:00
|
|
|
fill_pathname_join_special(
|
2021-01-21 21:28:10 +01:00
|
|
|
settings->paths.path_content_history,
|
2020-06-26 18:40:20 +02:00
|
|
|
settings->paths.directory_content_history,
|
2020-08-22 01:06:10 +02:00
|
|
|
FILE_PATH_CONTENT_HISTORY,
|
2020-06-26 18:40:20 +02:00
|
|
|
sizeof(settings->paths.path_content_history));
|
2015-04-05 15:41:24 -05:00
|
|
|
|
2021-01-21 21:28:10 +01:00
|
|
|
if (string_is_empty(settings->paths.path_content_image_history))
|
2023-09-03 17:37:00 +02:00
|
|
|
strlcpy(settings->paths.directory_content_image_history, "default",
|
|
|
|
sizeof(settings->paths.directory_content_image_history));
|
2021-01-21 21:28:10 +01:00
|
|
|
|
2023-09-03 17:37:00 +02:00
|
|
|
if ( string_is_empty(settings->paths.directory_content_image_history)
|
|
|
|
|| string_is_equal(settings->paths.directory_content_image_history, "default"))
|
2020-06-26 18:40:20 +02:00
|
|
|
fill_pathname_resolve_relative(
|
2021-01-21 21:28:10 +01:00
|
|
|
settings->paths.path_content_image_history,
|
2020-06-26 18:40:20 +02:00
|
|
|
path_config,
|
2021-01-21 21:28:10 +01:00
|
|
|
FILE_PATH_CONTENT_IMAGE_HISTORY,
|
|
|
|
sizeof(settings->paths.path_content_image_history));
|
|
|
|
else
|
2022-08-04 14:18:11 +02:00
|
|
|
fill_pathname_join_special(
|
2021-01-21 21:28:10 +01:00
|
|
|
settings->paths.path_content_image_history,
|
|
|
|
settings->paths.directory_content_image_history,
|
|
|
|
FILE_PATH_CONTENT_IMAGE_HISTORY,
|
|
|
|
sizeof(settings->paths.path_content_image_history));
|
2018-05-13 16:20:51 -05:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
if (string_is_empty(settings->paths.path_content_music_history))
|
2023-09-03 17:37:00 +02:00
|
|
|
strlcpy(settings->paths.directory_content_music_history, "default",
|
|
|
|
sizeof(settings->paths.directory_content_music_history));
|
2021-01-21 21:28:10 +01:00
|
|
|
|
2023-09-03 17:37:00 +02:00
|
|
|
if ( string_is_empty(settings->paths.directory_content_music_history)
|
|
|
|
|| string_is_equal(settings->paths.directory_content_music_history, "default"))
|
2020-06-26 18:40:20 +02:00
|
|
|
fill_pathname_resolve_relative(
|
|
|
|
settings->paths.path_content_music_history,
|
|
|
|
path_config,
|
2020-08-22 01:06:10 +02:00
|
|
|
FILE_PATH_CONTENT_MUSIC_HISTORY,
|
2020-06-26 18:40:20 +02:00
|
|
|
sizeof(settings->paths.path_content_music_history));
|
2021-01-21 21:28:10 +01:00
|
|
|
else
|
2022-08-04 14:18:11 +02:00
|
|
|
fill_pathname_join_special(
|
2021-01-21 21:28:10 +01:00
|
|
|
settings->paths.path_content_music_history,
|
|
|
|
settings->paths.directory_content_music_history,
|
2020-08-22 01:06:10 +02:00
|
|
|
FILE_PATH_CONTENT_MUSIC_HISTORY,
|
2020-06-26 18:40:20 +02:00
|
|
|
sizeof(settings->paths.path_content_music_history));
|
2015-04-05 15:41:24 -05:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
if (string_is_empty(settings->paths.path_content_video_history))
|
2023-09-03 17:37:00 +02:00
|
|
|
strlcpy(settings->paths.directory_content_video_history, "default",
|
|
|
|
sizeof(settings->paths.directory_content_video_history));
|
2021-01-21 21:28:10 +01:00
|
|
|
|
2023-09-03 17:37:00 +02:00
|
|
|
if ( string_is_empty(settings->paths.directory_content_video_history)
|
|
|
|
|| string_is_equal(settings->paths.directory_content_video_history, "default"))
|
2020-06-26 18:40:20 +02:00
|
|
|
fill_pathname_resolve_relative(
|
|
|
|
settings->paths.path_content_video_history,
|
|
|
|
path_config,
|
2020-08-22 01:06:10 +02:00
|
|
|
FILE_PATH_CONTENT_VIDEO_HISTORY,
|
2020-06-26 18:40:20 +02:00
|
|
|
sizeof(settings->paths.path_content_video_history));
|
2021-01-21 21:28:10 +01:00
|
|
|
else
|
2022-08-04 14:18:11 +02:00
|
|
|
fill_pathname_join_special(
|
2021-01-21 21:28:10 +01:00
|
|
|
settings->paths.path_content_video_history,
|
|
|
|
settings->paths.directory_content_video_history,
|
2020-08-22 01:06:10 +02:00
|
|
|
FILE_PATH_CONTENT_VIDEO_HISTORY,
|
2020-06-26 18:40:20 +02:00
|
|
|
sizeof(settings->paths.path_content_video_history));
|
2018-05-13 16:20:51 -05:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
if (!string_is_empty(settings->paths.directory_screenshot))
|
2018-05-13 16:20:51 -05:00
|
|
|
{
|
2020-06-26 18:40:20 +02:00
|
|
|
if (string_is_equal(settings->paths.directory_screenshot, "default"))
|
|
|
|
*settings->paths.directory_screenshot = '\0';
|
|
|
|
else if (!path_is_directory(settings->paths.directory_screenshot))
|
2018-05-13 16:20:51 -05:00
|
|
|
{
|
2023-01-24 02:42:50 +02:00
|
|
|
RARCH_WARN("[Config]: 'screenshot_directory' is not an existing directory, ignoring..\n");
|
2020-06-26 18:40:20 +02:00
|
|
|
*settings->paths.directory_screenshot = '\0';
|
2018-05-13 16:20:51 -05:00
|
|
|
}
|
|
|
|
}
|
2022-01-09 05:19:03 -05:00
|
|
|
|
2021-03-23 03:10:38 +01:00
|
|
|
#if defined(__APPLE__) && defined(OSX)
|
|
|
|
#if defined(__aarch64__)
|
|
|
|
/* Wrong architecture, set it back to arm64 */
|
2023-09-03 17:37:00 +02:00
|
|
|
if (string_is_equal(settings->paths.network_buildbot_url,
|
|
|
|
"http://buildbot.libretro.com/nightly/apple/osx/x86_64/latest/"))
|
2021-03-23 03:10:38 +01:00
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->paths.network_buildbot_url, DEFAULT_BUILDBOT_SERVER_URL);
|
|
|
|
#elif defined(__x86_64__)
|
|
|
|
/* Wrong architecture, set it back to x86_64 */
|
2023-09-03 17:37:00 +02:00
|
|
|
if (string_is_equal(settings->paths.network_buildbot_url,
|
|
|
|
"http://buildbot.libretro.com/nightly/apple/osx/arm64/latest/"))
|
2021-03-23 03:10:38 +01:00
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->paths.network_buildbot_url, DEFAULT_BUILDBOT_SERVER_URL);
|
|
|
|
#endif
|
|
|
|
#endif
|
2015-04-05 15:41:24 -05:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
if (string_is_equal(settings->paths.path_menu_wallpaper, "default"))
|
|
|
|
*settings->paths.path_menu_wallpaper = '\0';
|
|
|
|
if (string_is_equal(settings->paths.path_rgui_theme_preset, "default"))
|
|
|
|
*settings->paths.path_rgui_theme_preset = '\0';
|
|
|
|
if (string_is_equal(settings->paths.directory_video_shader, "default"))
|
|
|
|
*settings->paths.directory_video_shader = '\0';
|
|
|
|
if (string_is_equal(settings->paths.directory_video_filter, "default"))
|
|
|
|
*settings->paths.directory_video_filter = '\0';
|
|
|
|
if (string_is_equal(settings->paths.directory_audio_filter, "default"))
|
|
|
|
*settings->paths.directory_audio_filter = '\0';
|
|
|
|
if (string_is_equal(settings->paths.directory_core_assets, "default"))
|
|
|
|
*settings->paths.directory_core_assets = '\0';
|
|
|
|
if (string_is_equal(settings->paths.directory_assets, "default"))
|
|
|
|
*settings->paths.directory_assets = '\0';
|
2022-09-03 20:40:01 +02:00
|
|
|
#ifdef _3DS
|
|
|
|
if (string_is_equal(settings->paths.directory_bottom_assets, "default"))
|
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->paths.directory_bottom_assets,
|
|
|
|
g_defaults.dirs[DEFAULT_DIR_BOTTOM_ASSETS]);
|
|
|
|
#endif
|
2020-06-26 18:40:20 +02:00
|
|
|
if (string_is_equal(settings->paths.directory_dynamic_wallpapers, "default"))
|
|
|
|
*settings->paths.directory_dynamic_wallpapers = '\0';
|
|
|
|
if (string_is_equal(settings->paths.directory_thumbnails, "default"))
|
|
|
|
*settings->paths.directory_thumbnails = '\0';
|
|
|
|
if (string_is_equal(settings->paths.directory_playlist, "default"))
|
|
|
|
*settings->paths.directory_playlist = '\0';
|
2021-01-21 21:28:10 +01:00
|
|
|
if (string_is_equal(settings->paths.directory_content_favorites, "default"))
|
|
|
|
*settings->paths.directory_content_favorites = '\0';
|
|
|
|
if (string_is_equal(settings->paths.directory_content_history, "default"))
|
|
|
|
*settings->paths.directory_content_history = '\0';
|
|
|
|
if (string_is_equal(settings->paths.directory_content_image_history, "default"))
|
|
|
|
*settings->paths.directory_content_image_history = '\0';
|
|
|
|
if (string_is_equal(settings->paths.directory_content_music_history, "default"))
|
|
|
|
*settings->paths.directory_content_music_history = '\0';
|
|
|
|
if (string_is_equal(settings->paths.directory_content_video_history, "default"))
|
|
|
|
*settings->paths.directory_content_video_history = '\0';
|
2020-06-26 18:40:20 +02:00
|
|
|
if (string_is_equal(settings->paths.directory_runtime_log, "default"))
|
|
|
|
*settings->paths.directory_runtime_log = '\0';
|
|
|
|
#ifdef HAVE_MENU
|
|
|
|
if (string_is_equal(settings->paths.directory_menu_content, "default"))
|
|
|
|
*settings->paths.directory_menu_content = '\0';
|
|
|
|
if (string_is_equal(settings->paths.directory_menu_config, "default"))
|
|
|
|
*settings->paths.directory_menu_config = '\0';
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_OVERLAY
|
|
|
|
if (string_is_equal(settings->paths.directory_overlay, "default"))
|
|
|
|
*settings->paths.directory_overlay = '\0';
|
2023-07-08 12:45:13 -05:00
|
|
|
if (string_is_equal(settings->paths.directory_osk_overlay, "default"))
|
|
|
|
*settings->paths.directory_osk_overlay = '\0';
|
2020-06-26 18:40:20 +02:00
|
|
|
#endif
|
|
|
|
if (string_is_equal(settings->paths.directory_system, "default"))
|
|
|
|
*settings->paths.directory_system = '\0';
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/* Log directory is a special case, since it must contain
|
|
|
|
* a valid path as soon as possible - if config file
|
|
|
|
* value is 'default' must copy g_defaults.dirs[DEFAULT_DIR_LOGS]
|
|
|
|
* directly... */
|
|
|
|
if (string_is_equal(settings->paths.log_dir, "default"))
|
2020-06-26 18:25:12 +02:00
|
|
|
{
|
2020-06-26 18:40:20 +02:00
|
|
|
if (!string_is_empty(g_defaults.dirs[DEFAULT_DIR_LOGS]))
|
2020-06-26 18:25:12 +02:00
|
|
|
{
|
2020-06-26 18:40:20 +02:00
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->paths.log_dir,
|
|
|
|
g_defaults.dirs[DEFAULT_DIR_LOGS]);
|
2020-06-26 18:25:12 +02:00
|
|
|
}
|
2020-06-26 18:40:20 +02:00
|
|
|
else
|
|
|
|
*settings->paths.log_dir = '\0';
|
2020-06-26 18:25:12 +02:00
|
|
|
}
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
if (settings->floats.slowmotion_ratio < 1.0f)
|
|
|
|
configuration_set_float(settings, settings->floats.slowmotion_ratio, 1.0f);
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/* Sanitize fastforward_ratio value - previously range was -1
|
|
|
|
* and up (with 0 being skipped) */
|
|
|
|
if (settings->floats.fastforward_ratio < 0.0f)
|
|
|
|
configuration_set_float(settings, settings->floats.fastforward_ratio, 0.0f);
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2023-04-16 11:44:46 -06:00
|
|
|
#ifdef HAVE_CHEEVOS
|
|
|
|
if (!string_is_empty(settings->arrays.cheevos_leaderboards_enable))
|
|
|
|
{
|
|
|
|
if (string_is_equal(settings->arrays.cheevos_leaderboards_enable, "true"))
|
|
|
|
{
|
2023-09-03 17:37:00 +02:00
|
|
|
settings->bools.cheevos_visibility_lboard_start = true;
|
|
|
|
settings->bools.cheevos_visibility_lboard_submit = true;
|
|
|
|
settings->bools.cheevos_visibility_lboard_cancel = true;
|
2023-04-16 11:44:46 -06:00
|
|
|
settings->bools.cheevos_visibility_lboard_trackers = true;
|
|
|
|
}
|
|
|
|
else if (string_is_equal(settings->arrays.cheevos_leaderboards_enable, "trackers"))
|
|
|
|
{
|
2023-09-03 17:37:00 +02:00
|
|
|
settings->bools.cheevos_visibility_lboard_start = false;
|
|
|
|
settings->bools.cheevos_visibility_lboard_submit = true;
|
|
|
|
settings->bools.cheevos_visibility_lboard_cancel = false;
|
2023-04-16 11:44:46 -06:00
|
|
|
settings->bools.cheevos_visibility_lboard_trackers = true;
|
|
|
|
}
|
|
|
|
else if (string_is_equal(settings->arrays.cheevos_leaderboards_enable, "notifications"))
|
|
|
|
{
|
2023-09-03 17:37:00 +02:00
|
|
|
settings->bools.cheevos_visibility_lboard_start = true;
|
|
|
|
settings->bools.cheevos_visibility_lboard_submit = true;
|
|
|
|
settings->bools.cheevos_visibility_lboard_cancel = true;
|
2023-04-16 11:44:46 -06:00
|
|
|
settings->bools.cheevos_visibility_lboard_trackers = false;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2023-09-03 17:37:00 +02:00
|
|
|
settings->bools.cheevos_visibility_lboard_start = false;
|
|
|
|
settings->bools.cheevos_visibility_lboard_submit = false;
|
|
|
|
settings->bools.cheevos_visibility_lboard_cancel = false;
|
2023-04-16 11:44:46 -06:00
|
|
|
settings->bools.cheevos_visibility_lboard_trackers = false;
|
|
|
|
}
|
2023-09-03 17:37:00 +02:00
|
|
|
settings->arrays.cheevos_leaderboards_enable[0] = '\0';
|
2023-04-16 11:44:46 -06:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
#ifdef HAVE_LAKKA
|
|
|
|
configuration_set_bool(settings,
|
|
|
|
settings->bools.ssh_enable, filestream_exists(LAKKA_SSH_PATH));
|
|
|
|
configuration_set_bool(settings,
|
|
|
|
settings->bools.samba_enable, filestream_exists(LAKKA_SAMBA_PATH));
|
|
|
|
configuration_set_bool(settings,
|
|
|
|
settings->bools.bluetooth_enable, filestream_exists(LAKKA_BLUETOOTH_PATH));
|
|
|
|
#endif
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2023-09-03 17:37:00 +02:00
|
|
|
if ( !retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_SAVE_PATH, NULL)
|
|
|
|
&& config_get_path(conf, "savefile_directory", tmp_str, sizeof(tmp_str)))
|
2020-06-26 18:40:20 +02:00
|
|
|
{
|
|
|
|
if (string_is_equal(tmp_str, "default"))
|
|
|
|
dir_set(RARCH_DIR_SAVEFILE, g_defaults.dirs[DEFAULT_DIR_SRAM]);
|
|
|
|
else if (path_is_directory(tmp_str))
|
|
|
|
{
|
|
|
|
dir_set(RARCH_DIR_SAVEFILE, tmp_str);
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2021-11-09 06:03:00 +01:00
|
|
|
strlcpy(runloop_st->name.savefile, tmp_str,
|
|
|
|
sizeof(runloop_st->name.savefile));
|
|
|
|
fill_pathname_dir(runloop_st->name.savefile,
|
|
|
|
path_get(RARCH_PATH_BASENAME),
|
|
|
|
FILE_PATH_SRM_EXTENSION,
|
|
|
|
sizeof(runloop_st->name.savefile));
|
2020-06-26 18:40:20 +02:00
|
|
|
}
|
|
|
|
else
|
2023-01-24 02:42:50 +02:00
|
|
|
RARCH_WARN("[Config]: 'savefile_directory' is not a directory, ignoring..\n");
|
2020-06-26 18:40:20 +02:00
|
|
|
}
|
|
|
|
|
2023-09-03 17:37:00 +02:00
|
|
|
if ( !retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_STATE_PATH, NULL)
|
|
|
|
&& config_get_path(conf, "savestate_directory", tmp_str, sizeof(tmp_str)))
|
2020-06-26 18:25:12 +02:00
|
|
|
{
|
2020-06-26 18:40:20 +02:00
|
|
|
if (string_is_equal(tmp_str, "default"))
|
|
|
|
dir_set(RARCH_DIR_SAVESTATE, g_defaults.dirs[DEFAULT_DIR_SAVESTATE]);
|
|
|
|
else if (path_is_directory(tmp_str))
|
2020-06-26 18:25:12 +02:00
|
|
|
{
|
2020-06-26 18:40:20 +02:00
|
|
|
dir_set(RARCH_DIR_SAVESTATE, tmp_str);
|
|
|
|
|
2021-11-09 06:03:00 +01:00
|
|
|
strlcpy(runloop_st->name.savestate, tmp_str,
|
|
|
|
sizeof(runloop_st->name.savestate));
|
|
|
|
fill_pathname_dir(runloop_st->name.savestate,
|
|
|
|
path_get(RARCH_PATH_BASENAME),
|
|
|
|
".state",
|
|
|
|
sizeof(runloop_st->name.savestate));
|
Replay UI support (#15048)
* Add bsv replay controls (not yet fully implemented), remove toggle
see notes in task_movie.c, make sure command.c calls the right
functions, check retroarch.c and other todos.
bsv files are also now stored with states, not saves.
* Compilation fixes
* Added command impls for play and record replay, and some code in load state to do the right thing there
* Guard some parts of the new code with HAVE_BSV_MOVIE
* wip, menu fixes
* more menu fixes, osd for movie errors, halt recording properly
* Menu and label fixes
* move bsvs to own file suffix series under savestates, fix recording and playback command validity checks
* Fix replay autoincrement
* fix endif placement, whoops
---------
Co-authored-by: Joseph C. Osborn <jcoa2018@pomona.edu>
2023-03-02 15:52:22 -08:00
|
|
|
strlcpy(runloop_st->name.replay, tmp_str,
|
|
|
|
sizeof(runloop_st->name.replay));
|
|
|
|
fill_pathname_dir(runloop_st->name.replay,
|
|
|
|
path_get(RARCH_PATH_BASENAME),
|
2023-03-03 14:16:48 -08:00
|
|
|
".replay",
|
Replay UI support (#15048)
* Add bsv replay controls (not yet fully implemented), remove toggle
see notes in task_movie.c, make sure command.c calls the right
functions, check retroarch.c and other todos.
bsv files are also now stored with states, not saves.
* Compilation fixes
* Added command impls for play and record replay, and some code in load state to do the right thing there
* Guard some parts of the new code with HAVE_BSV_MOVIE
* wip, menu fixes
* more menu fixes, osd for movie errors, halt recording properly
* Menu and label fixes
* move bsvs to own file suffix series under savestates, fix recording and playback command validity checks
* Fix replay autoincrement
* fix endif placement, whoops
---------
Co-authored-by: Joseph C. Osborn <jcoa2018@pomona.edu>
2023-03-02 15:52:22 -08:00
|
|
|
sizeof(runloop_st->name.replay));
|
2020-06-26 18:25:12 +02:00
|
|
|
}
|
2020-06-26 18:40:20 +02:00
|
|
|
else
|
2023-01-24 02:42:50 +02:00
|
|
|
RARCH_WARN("[Config]: 'savestate_directory' is not a directory, ignoring..\n");
|
2020-06-26 18:25:12 +02:00
|
|
|
}
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
config_read_keybinds_conf(conf);
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
#if defined(HAVE_MENU) && defined(HAVE_RGUI)
|
|
|
|
if (!check_menu_driver_compatibility(settings))
|
|
|
|
configuration_set_string(settings,
|
|
|
|
settings->arrays.menu_driver, "rgui");
|
|
|
|
#endif
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
#ifdef HAVE_LIBNX
|
|
|
|
/* Apply initial clocks */
|
|
|
|
extern void libnx_apply_overclock();
|
|
|
|
libnx_apply_overclock();
|
|
|
|
#endif
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2023-10-06 04:55:22 -07:00
|
|
|
#ifdef HAVE_LAKKA_SWITCH
|
|
|
|
FILE* f = fopen(SWITCH_OC_TOGGLE_PATH, "w");
|
|
|
|
if (settings->bools.switch_oc == true) {
|
|
|
|
fprintf(f, "1\n");
|
|
|
|
} else {
|
|
|
|
fprintf(f, "0\n");
|
|
|
|
}
|
|
|
|
fclose(f);
|
|
|
|
if (settings->bools.switch_cec == true) {
|
|
|
|
FILE* f = fopen(SWITCH_CEC_TOGGLE_PATH, "w");
|
|
|
|
fprintf(f, "\n");
|
|
|
|
fclose(f);
|
|
|
|
} else {
|
|
|
|
filestream_delete(SWITCH_CEC_TOGGLE_PATH);
|
|
|
|
}
|
|
|
|
if (settings->bools.bluetooth_ertm_disable == true) {
|
|
|
|
FILE* f = fopen(BLUETOOTH_ERTM_TOGGLE_PATH, "w");
|
|
|
|
fprintf(f, "1\n");
|
|
|
|
fclose(f);
|
|
|
|
} else {
|
|
|
|
FILE* f = fopen(BLUETOOTH_ERTM_TOGGLE_PATH, "w");
|
|
|
|
fprintf(f, "0\n");
|
|
|
|
fclose(f);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
frontend_driver_set_sustained_performance_mode(settings->bools.sustained_performance_mode);
|
|
|
|
recording_driver_update_streaming_url();
|
|
|
|
|
2022-07-19 21:00:40 +02:00
|
|
|
if (!(bool)RHMAP_HAS_STR(conf->entries_map, "user_language"))
|
2020-06-26 18:40:20 +02:00
|
|
|
msg_hash_set_uint(MSG_HASH_USER_LANGUAGE, frontend_driver_get_user_language());
|
|
|
|
|
2021-12-15 18:01:39 +00:00
|
|
|
if (frontend_driver_has_gamemode() &&
|
|
|
|
!frontend_driver_set_gamemode(settings->bools.gamemode_enable) &&
|
|
|
|
settings->bools.gamemode_enable)
|
|
|
|
{
|
2023-01-24 02:42:50 +02:00
|
|
|
RARCH_WARN("[Config]: GameMode unsupported - disabling..\n");
|
2021-12-15 18:01:39 +00:00
|
|
|
configuration_set_bool(settings,
|
|
|
|
settings->bools.gamemode_enable, false);
|
|
|
|
}
|
2021-12-14 15:07:42 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/* If this is the first run of an existing installation
|
|
|
|
* after the independent favourites playlist size limit was
|
|
|
|
* added, set the favourites limit according to the current
|
|
|
|
* history playlist size limit. (Have to do this, otherwise
|
|
|
|
* users with large custom history size limits may lose
|
|
|
|
* favourites entries when updating RetroArch...) */
|
2023-09-03 17:37:00 +02:00
|
|
|
if ( (bool)RHMAP_HAS_STR(conf->entries_map, "content_history_size")
|
|
|
|
&& !(bool)RHMAP_HAS_STR(conf->entries_map, "content_favorites_size"))
|
2020-06-26 18:25:12 +02:00
|
|
|
{
|
2020-06-26 18:40:20 +02:00
|
|
|
if (settings->uints.content_history_size > 999)
|
|
|
|
settings->ints.content_favorites_size = -1;
|
|
|
|
else
|
|
|
|
settings->ints.content_favorites_size = (int)settings->uints.content_history_size;
|
2020-06-26 18:25:12 +02:00
|
|
|
}
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
if (conf)
|
|
|
|
config_file_free(conf);
|
|
|
|
if (bool_settings)
|
|
|
|
free(bool_settings);
|
|
|
|
if (int_settings)
|
|
|
|
free(int_settings);
|
|
|
|
if (uint_settings)
|
|
|
|
free(uint_settings);
|
|
|
|
if (float_settings)
|
|
|
|
free(float_settings);
|
|
|
|
if (array_settings)
|
|
|
|
free(array_settings);
|
|
|
|
if (path_settings)
|
|
|
|
free(path_settings);
|
|
|
|
if (size_settings)
|
|
|
|
free(size_settings);
|
2021-08-02 20:31:48 -05:00
|
|
|
first_load = false;
|
2021-08-30 17:52:50 +02:00
|
|
|
return true;
|
2020-06-26 18:25:12 +02:00
|
|
|
}
|
2020-06-26 18:40:20 +02:00
|
|
|
|
2020-06-26 18:25:12 +02:00
|
|
|
/**
|
2020-06-26 18:40:20 +02:00
|
|
|
* config_load_override:
|
2020-06-26 18:25:12 +02:00
|
|
|
*
|
2020-06-26 18:40:20 +02:00
|
|
|
* Tries to append game-specific and core-specific configuration.
|
|
|
|
* These settings will always have precedence, thus this feature
|
|
|
|
* can be used to enforce overrides.
|
2020-06-26 18:25:12 +02:00
|
|
|
*
|
2020-06-26 18:40:20 +02:00
|
|
|
* This function only has an effect if a game-specific or core-specific
|
|
|
|
* configuration file exists at respective locations.
|
|
|
|
*
|
|
|
|
* core-specific: $CONFIG_DIR/$CORE_NAME/$CORE_NAME.cfg
|
|
|
|
* fallback: $CURRENT_CFG_LOCATION/$CORE_NAME/$CORE_NAME.cfg
|
|
|
|
*
|
|
|
|
* game-specific: $CONFIG_DIR/$CORE_NAME/$ROM_NAME.cfg
|
|
|
|
* fallback: $CURRENT_CFG_LOCATION/$CORE_NAME/$GAME_NAME.cfg
|
|
|
|
*
|
|
|
|
* Returns: false if there was an error or no action was performed.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
bool config_load_override(void *data)
|
2020-06-26 18:25:12 +02:00
|
|
|
{
|
2020-08-18 12:44:14 +02:00
|
|
|
char core_path[PATH_MAX_LENGTH];
|
|
|
|
char game_path[PATH_MAX_LENGTH];
|
|
|
|
char content_path[PATH_MAX_LENGTH];
|
|
|
|
char content_dir_name[PATH_MAX_LENGTH];
|
|
|
|
char config_directory[PATH_MAX_LENGTH];
|
2020-06-26 18:40:20 +02:00
|
|
|
bool should_append = false;
|
2022-11-14 21:52:05 +02:00
|
|
|
bool show_notification = true;
|
2023-07-05 03:29:16 +02:00
|
|
|
rarch_system_info_t *sys_info = (rarch_system_info_t*)data;
|
|
|
|
const char *core_name = sys_info
|
|
|
|
? sys_info->info.library_name : NULL;
|
2020-06-26 18:40:20 +02:00
|
|
|
const char *rarch_path_basename = path_get(RARCH_PATH_BASENAME);
|
2022-02-28 12:45:51 +00:00
|
|
|
const char *game_name = NULL;
|
2021-11-03 21:22:37 +01:00
|
|
|
settings_t *settings = config_st;
|
2022-02-28 12:45:51 +00:00
|
|
|
bool has_content = !string_is_empty(rarch_path_basename);
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2022-02-28 12:45:51 +00:00
|
|
|
core_path[0] = '\0';
|
|
|
|
game_path[0] = '\0';
|
|
|
|
content_path[0] = '\0';
|
|
|
|
content_dir_name[0] = '\0';
|
|
|
|
config_directory[0] = '\0';
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2023-01-24 02:42:50 +02:00
|
|
|
path_clear(RARCH_PATH_CONFIG_OVERRIDE);
|
|
|
|
|
2022-02-28 12:45:51 +00:00
|
|
|
/* Cannot load an override if we have no core */
|
|
|
|
if (string_is_empty(core_name))
|
2020-06-26 18:25:12 +02:00
|
|
|
return false;
|
|
|
|
|
2022-02-28 12:45:51 +00:00
|
|
|
/* Get base config directory */
|
|
|
|
fill_pathname_application_special(config_directory,
|
|
|
|
sizeof(config_directory),
|
2020-06-26 18:40:20 +02:00
|
|
|
APPLICATION_SPECIAL_DIRECTORY_CONFIG);
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2022-02-28 12:45:51 +00:00
|
|
|
/* Concatenate strings into full paths for core_path,
|
|
|
|
* game_path, content_path */
|
|
|
|
if (has_content)
|
|
|
|
{
|
|
|
|
fill_pathname_parent_dir_name(content_dir_name,
|
|
|
|
rarch_path_basename, sizeof(content_dir_name));
|
2022-07-12 20:44:00 +02:00
|
|
|
game_name = path_basename_nocompression(rarch_path_basename);
|
2022-02-28 12:45:51 +00:00
|
|
|
|
|
|
|
fill_pathname_join_special_ext(game_path,
|
|
|
|
config_directory, core_name,
|
|
|
|
game_name,
|
|
|
|
".cfg",
|
|
|
|
sizeof(game_path));
|
|
|
|
|
|
|
|
fill_pathname_join_special_ext(content_path,
|
2020-06-26 18:40:20 +02:00
|
|
|
config_directory, core_name,
|
2022-02-28 12:45:51 +00:00
|
|
|
content_dir_name,
|
2020-06-26 18:40:20 +02:00
|
|
|
".cfg",
|
2022-02-28 12:45:51 +00:00
|
|
|
sizeof(content_path));
|
|
|
|
}
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
fill_pathname_join_special_ext(core_path,
|
|
|
|
config_directory, core_name,
|
|
|
|
core_name,
|
|
|
|
".cfg",
|
2020-08-18 12:44:14 +02:00
|
|
|
sizeof(core_path));
|
2020-06-26 18:40:20 +02:00
|
|
|
|
2022-10-12 12:37:36 +03:00
|
|
|
/* Prevent "--appendconfig" from being ignored */
|
|
|
|
if (!path_is_empty(RARCH_PATH_CONFIG_APPEND))
|
2022-11-14 21:52:05 +02:00
|
|
|
{
|
|
|
|
should_append = true;
|
|
|
|
show_notification = false;
|
|
|
|
}
|
2022-10-12 12:37:36 +03:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/* per-core overrides */
|
|
|
|
/* Create a new config file from core_path */
|
2022-09-03 06:35:41 +02:00
|
|
|
if (path_is_valid(core_path))
|
2020-06-26 18:25:12 +02:00
|
|
|
{
|
2022-10-12 12:37:36 +03:00
|
|
|
char tmp_path[PATH_MAX_LENGTH + 1];
|
|
|
|
|
2021-02-03 13:43:56 +02:00
|
|
|
RARCH_LOG("[Overrides]: Core-specific overrides found at \"%s\".\n",
|
2020-06-26 18:40:20 +02:00
|
|
|
core_path);
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2023-01-25 08:15:42 +02:00
|
|
|
if (should_append && !string_is_empty(path_get(RARCH_PATH_CONFIG_OVERRIDE)))
|
2022-10-12 12:37:36 +03:00
|
|
|
{
|
|
|
|
size_t _len = strlcpy(tmp_path,
|
2023-01-25 08:15:42 +02:00
|
|
|
path_get(RARCH_PATH_CONFIG_OVERRIDE),
|
2022-10-12 12:37:36 +03:00
|
|
|
sizeof(tmp_path));
|
2023-06-20 16:33:55 +02:00
|
|
|
tmp_path[ _len] = '|';
|
|
|
|
tmp_path[++_len] = '\0';
|
2023-06-18 22:37:01 +02:00
|
|
|
strlcpy(tmp_path + _len, core_path, sizeof(tmp_path) - _len);
|
2022-10-12 12:37:36 +03:00
|
|
|
RARCH_LOG("[Overrides]: Core-specific overrides stacking on top of previous overrides.\n");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
strlcpy(tmp_path, core_path, sizeof(tmp_path));
|
|
|
|
|
2023-01-24 02:42:50 +02:00
|
|
|
path_set(RARCH_PATH_CONFIG_OVERRIDE, tmp_path);
|
2020-06-26 18:40:20 +02:00
|
|
|
|
2022-11-14 21:52:05 +02:00
|
|
|
should_append = true;
|
|
|
|
show_notification = true;
|
2020-06-26 18:25:12 +02:00
|
|
|
}
|
|
|
|
|
2022-02-28 12:45:51 +00:00
|
|
|
if (has_content)
|
2020-06-26 18:25:12 +02:00
|
|
|
{
|
2022-02-28 12:45:51 +00:00
|
|
|
/* per-content-dir overrides */
|
|
|
|
/* Create a new config file from content_path */
|
2022-09-03 06:35:41 +02:00
|
|
|
if (path_is_valid(content_path))
|
2022-02-28 12:45:51 +00:00
|
|
|
{
|
2022-07-05 19:06:38 +02:00
|
|
|
char tmp_path[PATH_MAX_LENGTH + 1];
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2022-02-28 12:45:51 +00:00
|
|
|
RARCH_LOG("[Overrides]: Content dir-specific overrides found at \"%s\".\n",
|
|
|
|
content_path);
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2023-01-25 08:15:42 +02:00
|
|
|
if (should_append && !string_is_empty(path_get(RARCH_PATH_CONFIG_OVERRIDE)))
|
2022-02-28 12:45:51 +00:00
|
|
|
{
|
2022-08-23 08:29:48 +02:00
|
|
|
size_t _len = strlcpy(tmp_path,
|
2023-01-25 08:15:42 +02:00
|
|
|
path_get(RARCH_PATH_CONFIG_OVERRIDE),
|
2022-08-23 08:29:48 +02:00
|
|
|
sizeof(tmp_path));
|
2023-06-20 16:33:55 +02:00
|
|
|
tmp_path[ _len] = '|';
|
|
|
|
tmp_path[++_len] = '\0';
|
2023-06-18 22:37:01 +02:00
|
|
|
strlcpy(tmp_path + _len, content_path, sizeof(tmp_path) - _len);
|
2022-08-23 08:29:48 +02:00
|
|
|
RARCH_LOG("[Overrides]: Content dir-specific overrides stacking on top of previous overrides.\n");
|
2022-02-28 12:45:51 +00:00
|
|
|
}
|
|
|
|
else
|
2022-07-05 19:06:38 +02:00
|
|
|
strlcpy(tmp_path, content_path, sizeof(tmp_path));
|
2022-02-28 12:45:51 +00:00
|
|
|
|
2023-01-24 02:42:50 +02:00
|
|
|
path_set(RARCH_PATH_CONFIG_OVERRIDE, tmp_path);
|
2022-02-28 12:45:51 +00:00
|
|
|
|
2022-11-14 21:52:05 +02:00
|
|
|
should_append = true;
|
|
|
|
show_notification = true;
|
2020-06-26 18:40:20 +02:00
|
|
|
}
|
2022-02-28 12:45:51 +00:00
|
|
|
|
|
|
|
/* per-game overrides */
|
|
|
|
/* Create a new config file from game_path */
|
2022-09-03 06:35:41 +02:00
|
|
|
if (path_is_valid(game_path))
|
2021-05-18 23:18:09 +02:00
|
|
|
{
|
2022-07-05 19:06:38 +02:00
|
|
|
char tmp_path[PATH_MAX_LENGTH + 1];
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2022-02-28 12:45:51 +00:00
|
|
|
RARCH_LOG("[Overrides]: Game-specific overrides found at \"%s\".\n",
|
|
|
|
game_path);
|
2015-04-05 14:06:23 -05:00
|
|
|
|
2023-01-25 08:15:42 +02:00
|
|
|
if (should_append && !string_is_empty(path_get(RARCH_PATH_CONFIG_OVERRIDE)))
|
2022-02-28 12:45:51 +00:00
|
|
|
{
|
2022-08-23 08:29:48 +02:00
|
|
|
size_t _len = strlcpy(tmp_path,
|
2023-08-22 18:34:29 +03:00
|
|
|
path_get(RARCH_PATH_CONFIG_OVERRIDE),
|
|
|
|
sizeof(tmp_path));
|
2023-06-20 16:33:55 +02:00
|
|
|
tmp_path[ _len] = '|';
|
|
|
|
tmp_path[++_len] = '\0';
|
2023-06-18 22:37:01 +02:00
|
|
|
strlcpy(tmp_path + _len, game_path, sizeof(tmp_path) - _len);
|
2022-02-28 12:45:51 +00:00
|
|
|
RARCH_LOG("[Overrides]: Game-specific overrides stacking on top of previous overrides.\n");
|
|
|
|
}
|
|
|
|
else
|
2022-07-05 19:06:38 +02:00
|
|
|
strlcpy(tmp_path, game_path, sizeof(tmp_path));
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2023-01-24 02:42:50 +02:00
|
|
|
path_set(RARCH_PATH_CONFIG_OVERRIDE, tmp_path);
|
2015-01-24 23:42:31 +01:00
|
|
|
|
2022-11-14 21:52:05 +02:00
|
|
|
should_append = true;
|
|
|
|
show_notification = true;
|
2020-06-26 18:40:20 +02:00
|
|
|
}
|
2019-07-04 17:29:29 +02:00
|
|
|
}
|
2020-06-23 22:27:40 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
if (!should_append)
|
2020-08-18 12:44:14 +02:00
|
|
|
return false;
|
2020-06-23 22:27:40 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/* Re-load the configuration with any overrides
|
|
|
|
* that might have been found */
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/* Toggle has_save_path to false so it resets */
|
|
|
|
retroarch_override_setting_unset(RARCH_OVERRIDE_SETTING_STATE_PATH, NULL);
|
2022-11-14 21:52:05 +02:00
|
|
|
retroarch_override_setting_unset(RARCH_OVERRIDE_SETTING_SAVE_PATH, NULL);
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
if (!config_load_file(global_get_ptr(),
|
2020-07-16 16:30:38 +01:00
|
|
|
path_get(RARCH_PATH_CONFIG), settings))
|
2020-08-18 12:44:14 +02:00
|
|
|
return false;
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2022-11-14 21:52:05 +02:00
|
|
|
if (settings->bools.notification_show_config_override_load
|
|
|
|
&& show_notification)
|
2020-07-16 16:30:38 +01:00
|
|
|
runloop_msg_queue_push(msg_hash_to_str(MSG_CONFIG_OVERRIDE_LOADED),
|
|
|
|
1, 100, false,
|
|
|
|
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/* Reset save paths. */
|
|
|
|
retroarch_override_setting_set(RARCH_OVERRIDE_SETTING_STATE_PATH, NULL);
|
|
|
|
retroarch_override_setting_set(RARCH_OVERRIDE_SETTING_SAVE_PATH, NULL);
|
2020-06-23 22:27:40 +02:00
|
|
|
|
2023-01-29 01:12:08 +02:00
|
|
|
if (!string_is_empty(path_get(RARCH_PATH_CONFIG_OVERRIDE)))
|
|
|
|
runloop_state_get_ptr()->flags |= RUNLOOP_FLAG_OVERRIDES_ACTIVE;
|
|
|
|
else
|
|
|
|
runloop_state_get_ptr()->flags &= ~RUNLOOP_FLAG_OVERRIDES_ACTIVE;
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
return true;
|
2020-06-26 18:25:12 +02:00
|
|
|
}
|
2020-06-26 18:40:20 +02:00
|
|
|
|
2023-01-24 02:42:50 +02:00
|
|
|
bool config_load_override_file(const char *config_path)
|
|
|
|
{
|
|
|
|
char config_directory[PATH_MAX_LENGTH];
|
|
|
|
bool should_append = false;
|
|
|
|
bool show_notification = true;
|
|
|
|
settings_t *settings = config_st;
|
|
|
|
|
|
|
|
config_directory[0] = '\0';
|
|
|
|
|
|
|
|
path_clear(RARCH_PATH_CONFIG_OVERRIDE);
|
|
|
|
|
|
|
|
/* Get base config directory */
|
|
|
|
fill_pathname_application_special(config_directory,
|
|
|
|
sizeof(config_directory),
|
|
|
|
APPLICATION_SPECIAL_DIRECTORY_CONFIG);
|
|
|
|
|
|
|
|
if (path_is_valid(config_path))
|
|
|
|
{
|
|
|
|
path_set(RARCH_PATH_CONFIG_OVERRIDE, config_path);
|
|
|
|
should_append = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!should_append)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
/* Re-load the configuration with any overrides
|
|
|
|
* that might have been found */
|
|
|
|
|
|
|
|
/* Toggle has_save_path to false so it resets */
|
|
|
|
retroarch_override_setting_unset(RARCH_OVERRIDE_SETTING_STATE_PATH, NULL);
|
|
|
|
retroarch_override_setting_unset(RARCH_OVERRIDE_SETTING_SAVE_PATH, NULL);
|
|
|
|
|
|
|
|
if (!config_load_file(global_get_ptr(),
|
|
|
|
path_get(RARCH_PATH_CONFIG), settings))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (settings->bools.notification_show_config_override_load
|
|
|
|
&& show_notification)
|
|
|
|
runloop_msg_queue_push(msg_hash_to_str(MSG_CONFIG_OVERRIDE_LOADED),
|
|
|
|
1, 100, false,
|
|
|
|
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
|
|
|
|
|
|
|
/* Reset save paths. */
|
|
|
|
retroarch_override_setting_set(RARCH_OVERRIDE_SETTING_STATE_PATH, NULL);
|
|
|
|
retroarch_override_setting_set(RARCH_OVERRIDE_SETTING_SAVE_PATH, NULL);
|
|
|
|
|
2023-01-29 01:12:08 +02:00
|
|
|
if (!string_is_empty(path_get(RARCH_PATH_CONFIG_OVERRIDE)))
|
|
|
|
runloop_state_get_ptr()->flags |= RUNLOOP_FLAG_OVERRIDES_ACTIVE;
|
|
|
|
else
|
|
|
|
runloop_state_get_ptr()->flags &= ~RUNLOOP_FLAG_OVERRIDES_ACTIVE;
|
|
|
|
|
2023-01-24 02:42:50 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-07-10 20:14:36 -05:00
|
|
|
/**
|
2020-06-26 18:40:20 +02:00
|
|
|
* config_unload_override:
|
2020-06-26 18:25:12 +02:00
|
|
|
*
|
2020-06-26 18:40:20 +02:00
|
|
|
* Unloads configuration overrides if overrides are active.
|
2020-06-26 18:25:12 +02:00
|
|
|
*
|
2020-06-26 18:40:20 +02:00
|
|
|
*
|
|
|
|
* Returns: false if there was an error.
|
|
|
|
*/
|
|
|
|
bool config_unload_override(void)
|
2015-07-10 20:14:36 -05:00
|
|
|
{
|
2023-01-29 01:12:08 +02:00
|
|
|
runloop_state_get_ptr()->flags &= ~RUNLOOP_FLAG_OVERRIDES_ACTIVE;
|
2023-01-24 02:42:50 +02:00
|
|
|
path_clear(RARCH_PATH_CONFIG_OVERRIDE);
|
2020-06-26 18:40:20 +02:00
|
|
|
|
|
|
|
/* Toggle has_save_path to false so it resets */
|
|
|
|
retroarch_override_setting_unset(RARCH_OVERRIDE_SETTING_STATE_PATH, NULL);
|
2022-11-14 21:52:05 +02:00
|
|
|
retroarch_override_setting_unset(RARCH_OVERRIDE_SETTING_SAVE_PATH, NULL);
|
2017-11-13 16:59:23 -05:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
if (!config_load_file(global_get_ptr(),
|
2021-11-03 21:22:37 +01:00
|
|
|
path_get(RARCH_PATH_CONFIG), config_st))
|
2020-06-26 18:40:20 +02:00
|
|
|
return false;
|
|
|
|
|
|
|
|
RARCH_LOG("[Overrides]: Configuration overrides unloaded, original configuration restored.\n");
|
|
|
|
|
|
|
|
/* Reset save paths */
|
|
|
|
retroarch_override_setting_set(RARCH_OVERRIDE_SETTING_STATE_PATH, NULL);
|
|
|
|
retroarch_override_setting_set(RARCH_OVERRIDE_SETTING_SAVE_PATH, NULL);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* config_load_remap:
|
|
|
|
*
|
|
|
|
* Tries to append game-specific and core-specific remap files.
|
|
|
|
*
|
|
|
|
* This function only has an effect if a game-specific or core-specific
|
|
|
|
* configuration file exists at respective locations.
|
|
|
|
*
|
|
|
|
* core-specific: $REMAP_DIR/$CORE_NAME/$CORE_NAME.cfg
|
|
|
|
* game-specific: $REMAP_DIR/$CORE_NAME/$GAME_NAME.cfg
|
|
|
|
*
|
|
|
|
* Returns: false if there was an error or no action was performed.
|
|
|
|
*/
|
|
|
|
bool config_load_remap(const char *directory_input_remapping,
|
|
|
|
void *data)
|
|
|
|
{
|
2022-03-01 08:45:17 +00:00
|
|
|
char content_dir_name[PATH_MAX_LENGTH];
|
2020-08-18 12:44:14 +02:00
|
|
|
/* final path for core-specific configuration (prefix+suffix) */
|
|
|
|
char core_path[PATH_MAX_LENGTH];
|
|
|
|
/* final path for game-specific configuration (prefix+suffix) */
|
|
|
|
char game_path[PATH_MAX_LENGTH];
|
|
|
|
/* final path for content-dir-specific configuration (prefix+suffix) */
|
|
|
|
char content_path[PATH_MAX_LENGTH];
|
2020-06-26 18:40:20 +02:00
|
|
|
config_file_t *new_conf = NULL;
|
2023-07-05 03:29:16 +02:00
|
|
|
rarch_system_info_t *sys_info = (rarch_system_info_t*)data;
|
|
|
|
const char *core_name = sys_info ? sys_info->info.library_name : NULL;
|
2020-06-26 18:40:20 +02:00
|
|
|
const char *rarch_path_basename = path_get(RARCH_PATH_BASENAME);
|
2022-03-01 08:45:17 +00:00
|
|
|
const char *game_name = NULL;
|
|
|
|
bool has_content = !string_is_empty(rarch_path_basename);
|
2020-06-26 18:40:20 +02:00
|
|
|
enum msg_hash_enums msg_remap_loaded = MSG_GAME_REMAP_FILE_LOADED;
|
2021-11-03 21:22:37 +01:00
|
|
|
settings_t *settings = config_st;
|
2020-07-16 16:30:38 +01:00
|
|
|
bool notification_show_remap_load = settings->bools.notification_show_remap_load;
|
2017-11-13 16:59:23 -05:00
|
|
|
|
2022-03-01 08:45:17 +00:00
|
|
|
content_dir_name[0] = '\0';
|
|
|
|
core_path[0] = '\0';
|
|
|
|
game_path[0] = '\0';
|
|
|
|
content_path[0] = '\0';
|
2017-11-13 16:59:23 -05:00
|
|
|
|
2022-03-01 08:45:17 +00:00
|
|
|
/* > Cannot load remaps if we have no core
|
|
|
|
* > Cannot load remaps if remap directory is unset */
|
2023-09-03 17:37:00 +02:00
|
|
|
if ( string_is_empty(core_name)
|
|
|
|
|| string_is_empty(directory_input_remapping))
|
2020-06-26 18:40:20 +02:00
|
|
|
return false;
|
2016-10-09 09:05:41 +02:00
|
|
|
|
2022-03-01 08:45:17 +00:00
|
|
|
/* Concatenate strings into full paths for core_path,
|
|
|
|
* game_path, content_path */
|
|
|
|
if (has_content)
|
|
|
|
{
|
2020-06-26 18:40:20 +02:00
|
|
|
fill_pathname_parent_dir_name(content_dir_name,
|
|
|
|
rarch_path_basename, sizeof(content_dir_name));
|
2022-07-12 20:44:00 +02:00
|
|
|
game_name = path_basename_nocompression(rarch_path_basename);
|
2016-08-29 04:02:58 +02:00
|
|
|
|
2022-03-01 08:45:17 +00:00
|
|
|
fill_pathname_join_special_ext(game_path,
|
|
|
|
directory_input_remapping, core_name,
|
|
|
|
game_name,
|
|
|
|
FILE_PATH_REMAP_EXTENSION,
|
|
|
|
sizeof(game_path));
|
2017-09-09 21:35:09 +02:00
|
|
|
|
2022-03-01 08:45:17 +00:00
|
|
|
fill_pathname_join_special_ext(content_path,
|
|
|
|
directory_input_remapping, core_name,
|
|
|
|
content_dir_name,
|
|
|
|
FILE_PATH_REMAP_EXTENSION,
|
|
|
|
sizeof(content_path));
|
|
|
|
}
|
2015-07-10 20:14:36 -05:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
fill_pathname_join_special_ext(core_path,
|
2022-03-01 08:45:17 +00:00
|
|
|
directory_input_remapping, core_name,
|
2020-06-26 18:40:20 +02:00
|
|
|
core_name,
|
2020-08-22 12:49:35 +02:00
|
|
|
FILE_PATH_REMAP_EXTENSION,
|
2020-08-18 12:44:14 +02:00
|
|
|
sizeof(core_path));
|
2019-04-22 08:21:57 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/* If a game remap file exists, load it. */
|
2022-03-01 08:45:17 +00:00
|
|
|
if (has_content && (new_conf = config_file_new_from_path_to_string(game_path)))
|
2020-06-26 18:40:20 +02:00
|
|
|
{
|
2021-04-11 13:48:25 +02:00
|
|
|
bool ret = input_remapping_load_file(new_conf, game_path);
|
|
|
|
config_file_free(new_conf);
|
|
|
|
new_conf = NULL;
|
2021-02-03 13:43:56 +02:00
|
|
|
RARCH_LOG("[Remaps]: Game-specific remap found at \"%s\".\n", game_path);
|
2021-04-11 13:48:25 +02:00
|
|
|
if (ret)
|
2020-06-26 18:40:20 +02:00
|
|
|
{
|
2021-09-28 12:56:10 +02:00
|
|
|
retroarch_ctl(RARCH_CTL_SET_REMAPS_GAME_ACTIVE, NULL);
|
2020-06-26 18:40:20 +02:00
|
|
|
/* msg_remap_loaded is set to MSG_GAME_REMAP_FILE_LOADED
|
|
|
|
* by default - no need to change it here */
|
|
|
|
goto success;
|
|
|
|
}
|
|
|
|
}
|
2016-05-27 05:13:05 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/* If a content-dir remap file exists, load it. */
|
2022-03-01 08:45:17 +00:00
|
|
|
if (has_content && (new_conf = config_file_new_from_path_to_string(content_path)))
|
2020-06-26 18:40:20 +02:00
|
|
|
{
|
2021-04-11 13:48:25 +02:00
|
|
|
bool ret = input_remapping_load_file(new_conf, content_path);
|
|
|
|
config_file_free(new_conf);
|
|
|
|
new_conf = NULL;
|
2021-02-03 13:43:56 +02:00
|
|
|
RARCH_LOG("[Remaps]: Content-dir-specific remap found at \"%s\".\n", content_path);
|
2021-04-11 13:48:25 +02:00
|
|
|
if (ret)
|
2020-06-26 18:40:20 +02:00
|
|
|
{
|
2021-09-28 12:56:10 +02:00
|
|
|
retroarch_ctl(RARCH_CTL_SET_REMAPS_CONTENT_DIR_ACTIVE, NULL);
|
2020-06-26 18:40:20 +02:00
|
|
|
msg_remap_loaded = MSG_DIRECTORY_REMAP_FILE_LOADED;
|
|
|
|
goto success;
|
|
|
|
}
|
|
|
|
}
|
2016-05-27 05:13:05 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/* If a core remap file exists, load it. */
|
|
|
|
if ((new_conf = config_file_new_from_path_to_string(core_path)))
|
|
|
|
{
|
2021-04-11 13:48:25 +02:00
|
|
|
bool ret = input_remapping_load_file(new_conf, core_path);
|
|
|
|
config_file_free(new_conf);
|
|
|
|
new_conf = NULL;
|
2021-02-03 13:43:56 +02:00
|
|
|
RARCH_LOG("[Remaps]: Core-specific remap found at \"%s\".\n", core_path);
|
2021-04-11 13:48:25 +02:00
|
|
|
if (ret)
|
2020-06-26 18:40:20 +02:00
|
|
|
{
|
2021-09-28 12:56:10 +02:00
|
|
|
retroarch_ctl(RARCH_CTL_SET_REMAPS_CORE_ACTIVE, NULL);
|
2020-06-26 18:40:20 +02:00
|
|
|
msg_remap_loaded = MSG_CORE_REMAP_FILE_LOADED;
|
|
|
|
goto success;
|
|
|
|
}
|
|
|
|
}
|
2015-07-10 20:14:36 -05:00
|
|
|
|
2021-04-11 13:48:25 +02:00
|
|
|
if (new_conf)
|
|
|
|
config_file_free(new_conf);
|
2020-06-26 18:40:20 +02:00
|
|
|
new_conf = NULL;
|
2016-08-26 11:26:24 -05:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
return false;
|
2016-08-26 11:26:24 -05:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
success:
|
2020-07-16 16:30:38 +01:00
|
|
|
if (notification_show_remap_load)
|
|
|
|
runloop_msg_queue_push(
|
|
|
|
msg_hash_to_str(msg_remap_loaded), 1, 100, false,
|
|
|
|
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
2020-06-26 18:40:20 +02:00
|
|
|
return true;
|
|
|
|
}
|
2016-08-26 11:26:24 -05:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/**
|
|
|
|
* config_parse_file:
|
|
|
|
*
|
|
|
|
* Loads a config file and reads all the values into memory.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
static void config_parse_file(global_t *global)
|
|
|
|
{
|
2021-08-02 20:31:48 -05:00
|
|
|
const char *config_path = path_get(RARCH_PATH_CONFIG);
|
2016-08-25 20:10:01 -05:00
|
|
|
|
2022-10-12 12:37:36 +03:00
|
|
|
if (!config_load_file(global, config_path, config_st))
|
2016-07-24 07:14:24 +02:00
|
|
|
{
|
2022-10-12 12:37:36 +03:00
|
|
|
RARCH_ERR("[Config]: Config not found at: \"%s\".\n",
|
|
|
|
config_path);
|
2020-06-26 18:40:20 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-08 01:54:44 +02:00
|
|
|
static void video_driver_save_settings(global_t *global, config_file_t *conf)
|
2020-06-26 18:40:20 +02:00
|
|
|
{
|
|
|
|
config_set_int(conf, "gamma_correction",
|
|
|
|
global->console.screen.gamma_correction);
|
2022-07-18 01:59:32 +02:00
|
|
|
config_set_string(conf, "flicker_filter_enable",
|
|
|
|
global->console.flickerfilter_enable
|
|
|
|
? "true"
|
|
|
|
: "false");
|
|
|
|
config_set_string(conf, "soft_filter_enable",
|
|
|
|
global->console.softfilter_enable
|
|
|
|
? "true"
|
|
|
|
: "false");
|
2020-06-26 18:40:20 +02:00
|
|
|
|
|
|
|
config_set_int(conf, "soft_filter_index",
|
|
|
|
global->console.screen.soft_filter_index);
|
|
|
|
config_set_int(conf, "current_resolution_id",
|
|
|
|
global->console.screen.resolutions.current.id);
|
|
|
|
config_set_int(conf, "flicker_filter_index",
|
|
|
|
global->console.screen.flicker_filter_index);
|
|
|
|
}
|
|
|
|
|
2021-08-30 16:52:05 +02:00
|
|
|
static void save_keybind_hat(config_file_t *conf, const char *key,
|
|
|
|
const struct retro_keybind *bind)
|
|
|
|
{
|
2023-09-03 17:37:00 +02:00
|
|
|
size_t _len;
|
2021-08-30 16:52:05 +02:00
|
|
|
char config[16];
|
2023-09-03 17:37:00 +02:00
|
|
|
config[0] = '\0';
|
|
|
|
_len = snprintf(config, sizeof(config), "h%u", GET_HAT(bind->joykey));
|
2021-08-30 16:52:05 +02:00
|
|
|
|
|
|
|
switch (GET_HAT_DIR(bind->joykey))
|
|
|
|
{
|
|
|
|
case HAT_UP_MASK:
|
2023-09-03 17:37:00 +02:00
|
|
|
strlcpy(config + _len, "up", sizeof(config) - _len);
|
2021-08-30 16:52:05 +02:00
|
|
|
break;
|
|
|
|
case HAT_DOWN_MASK:
|
2023-09-03 17:37:00 +02:00
|
|
|
strlcpy(config + _len, "down", sizeof(config) - _len);
|
2021-08-30 16:52:05 +02:00
|
|
|
break;
|
|
|
|
case HAT_LEFT_MASK:
|
2023-09-03 17:37:00 +02:00
|
|
|
strlcpy(config + _len, "left", sizeof(config) - _len);
|
2021-08-30 16:52:05 +02:00
|
|
|
break;
|
|
|
|
case HAT_RIGHT_MASK:
|
2023-09-03 17:37:00 +02:00
|
|
|
strlcpy(config + _len, "right", sizeof(config) - _len);
|
2021-08-30 16:52:05 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
config_set_string(conf, key, config);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void save_keybind_joykey(config_file_t *conf,
|
|
|
|
const char *prefix,
|
|
|
|
const char *base,
|
|
|
|
const struct retro_keybind *bind, bool save_empty)
|
|
|
|
{
|
|
|
|
char key[64];
|
2022-08-06 18:04:40 +02:00
|
|
|
size_t len = fill_pathname_join_delim(key, prefix,
|
2022-07-11 19:56:46 +02:00
|
|
|
base, '_', sizeof(key));
|
2023-06-20 16:33:55 +02:00
|
|
|
strlcpy(key + len, "_btn", sizeof(key) - len);
|
2021-08-30 16:52:05 +02:00
|
|
|
|
|
|
|
if (bind->joykey == NO_BTN)
|
|
|
|
{
|
|
|
|
if (save_empty)
|
|
|
|
config_set_string(conf, key, "nul");
|
|
|
|
}
|
|
|
|
else if (GET_HAT_DIR(bind->joykey))
|
|
|
|
save_keybind_hat(conf, key, bind);
|
|
|
|
else
|
|
|
|
config_set_uint64(conf, key, bind->joykey);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void save_keybind_axis(config_file_t *conf,
|
|
|
|
const char *prefix,
|
|
|
|
const char *base,
|
|
|
|
const struct retro_keybind *bind, bool save_empty)
|
|
|
|
{
|
|
|
|
char key[64];
|
2022-08-06 18:04:40 +02:00
|
|
|
size_t len = fill_pathname_join_delim(key, prefix, base, '_', sizeof(key));
|
2023-06-20 16:33:55 +02:00
|
|
|
strlcpy(key + len, "_axis", sizeof(key) - len);
|
2021-08-30 16:52:05 +02:00
|
|
|
|
|
|
|
if (bind->joyaxis == AXIS_NONE)
|
|
|
|
{
|
|
|
|
if (save_empty)
|
|
|
|
config_set_string(conf, key, "nul");
|
|
|
|
}
|
|
|
|
else if (AXIS_NEG_GET(bind->joyaxis) != AXIS_DIR_NONE)
|
|
|
|
{
|
2022-07-23 10:44:41 +02:00
|
|
|
char config[16];
|
2022-08-29 12:40:25 +02:00
|
|
|
config[0] = '-';
|
|
|
|
config[1] = '\0';
|
|
|
|
snprintf(config + 1, sizeof(config) - 1, "%u",
|
|
|
|
AXIS_NEG_GET(bind->joyaxis));
|
2022-07-23 10:44:41 +02:00
|
|
|
config_set_string(conf, key, config);
|
2021-08-30 16:52:05 +02:00
|
|
|
}
|
|
|
|
else if (AXIS_POS_GET(bind->joyaxis) != AXIS_DIR_NONE)
|
|
|
|
{
|
|
|
|
char config[16];
|
2022-08-29 12:40:25 +02:00
|
|
|
config[0] = '+';
|
|
|
|
config[1] = '\0';
|
|
|
|
snprintf(config + 1, sizeof(config) - 1, "%u",
|
|
|
|
AXIS_POS_GET(bind->joyaxis));
|
2021-08-30 16:52:05 +02:00
|
|
|
config_set_string(conf, key, config);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void save_keybind_mbutton(config_file_t *conf,
|
|
|
|
const char *prefix,
|
|
|
|
const char *base,
|
|
|
|
const struct retro_keybind *bind, bool save_empty)
|
|
|
|
{
|
|
|
|
char key[64];
|
2022-08-06 18:04:40 +02:00
|
|
|
size_t len = fill_pathname_join_delim(key, prefix,
|
2022-07-11 19:56:46 +02:00
|
|
|
base, '_', sizeof(key));
|
2023-06-20 16:33:55 +02:00
|
|
|
strlcpy(key + len, "_mbtn", sizeof(key) - len);
|
2021-08-30 16:52:05 +02:00
|
|
|
|
|
|
|
switch (bind->mbutton)
|
|
|
|
{
|
|
|
|
case RETRO_DEVICE_ID_MOUSE_LEFT:
|
|
|
|
config_set_uint64(conf, key, 1);
|
|
|
|
break;
|
|
|
|
case RETRO_DEVICE_ID_MOUSE_RIGHT:
|
|
|
|
config_set_uint64(conf, key, 2);
|
|
|
|
break;
|
|
|
|
case RETRO_DEVICE_ID_MOUSE_MIDDLE:
|
|
|
|
config_set_uint64(conf, key, 3);
|
|
|
|
break;
|
|
|
|
case RETRO_DEVICE_ID_MOUSE_BUTTON_4:
|
|
|
|
config_set_uint64(conf, key, 4);
|
|
|
|
break;
|
|
|
|
case RETRO_DEVICE_ID_MOUSE_BUTTON_5:
|
|
|
|
config_set_uint64(conf, key, 5);
|
|
|
|
break;
|
|
|
|
case RETRO_DEVICE_ID_MOUSE_WHEELUP:
|
|
|
|
config_set_string(conf, key, "wu");
|
|
|
|
break;
|
|
|
|
case RETRO_DEVICE_ID_MOUSE_WHEELDOWN:
|
|
|
|
config_set_string(conf, key, "wd");
|
|
|
|
break;
|
|
|
|
case RETRO_DEVICE_ID_MOUSE_HORIZ_WHEELUP:
|
|
|
|
config_set_string(conf, key, "whu");
|
|
|
|
break;
|
|
|
|
case RETRO_DEVICE_ID_MOUSE_HORIZ_WHEELDOWN:
|
|
|
|
config_set_string(conf, key, "whd");
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
if (save_empty)
|
|
|
|
config_set_string(conf, key, "nul");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* input_config_save_keybind:
|
|
|
|
* @conf : pointer to config file object
|
|
|
|
* @prefix : prefix name of keybind
|
|
|
|
* @base : base name of keybind
|
|
|
|
* @bind : pointer to key binding object
|
|
|
|
* @kb : save keyboard binds
|
|
|
|
*
|
|
|
|
* Save a key binding to the config file.
|
|
|
|
*/
|
|
|
|
static void input_config_save_keybind(config_file_t *conf,
|
|
|
|
const char *prefix,
|
|
|
|
const char *base,
|
|
|
|
const struct retro_keybind *bind,
|
|
|
|
bool save_empty)
|
|
|
|
{
|
|
|
|
save_keybind_joykey (conf, prefix, base, bind, save_empty);
|
|
|
|
save_keybind_axis (conf, prefix, base, bind, save_empty);
|
|
|
|
save_keybind_mbutton(conf, prefix, base, bind, save_empty);
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *input_config_get_prefix(unsigned user, bool meta)
|
|
|
|
{
|
|
|
|
static const char *bind_user_prefix[MAX_USERS] = {
|
|
|
|
"input_player1",
|
|
|
|
"input_player2",
|
|
|
|
"input_player3",
|
|
|
|
"input_player4",
|
|
|
|
"input_player5",
|
|
|
|
"input_player6",
|
|
|
|
"input_player7",
|
|
|
|
"input_player8",
|
|
|
|
"input_player9",
|
|
|
|
"input_player10",
|
|
|
|
"input_player11",
|
|
|
|
"input_player12",
|
|
|
|
"input_player13",
|
|
|
|
"input_player14",
|
|
|
|
"input_player15",
|
|
|
|
"input_player16",
|
|
|
|
};
|
|
|
|
if (meta)
|
|
|
|
{
|
|
|
|
if (user == 0)
|
|
|
|
return "input";
|
|
|
|
/* Don't bother with meta bind for anyone else than first user. */
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
return bind_user_prefix[user];
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* input_config_save_keybinds_user:
|
|
|
|
* @conf : pointer to config file object
|
|
|
|
* @user : user number
|
|
|
|
*
|
|
|
|
* Save the current keybinds of a user (@user) to the config file (@conf).
|
|
|
|
*/
|
|
|
|
static void input_config_save_keybinds_user(config_file_t *conf, unsigned user)
|
|
|
|
{
|
|
|
|
unsigned i = 0;
|
|
|
|
|
|
|
|
for (i = 0; input_config_bind_map_get_valid(i); i++)
|
|
|
|
{
|
|
|
|
char key[64];
|
|
|
|
char btn[64];
|
|
|
|
const struct input_bind_map *keybind =
|
|
|
|
(const struct input_bind_map*)INPUT_CONFIG_BIND_MAP_GET(i);
|
|
|
|
bool meta = keybind ? keybind->meta : false;
|
|
|
|
const char *prefix = input_config_get_prefix(user, meta);
|
|
|
|
const struct retro_keybind *bind = &input_config_binds[user][i];
|
|
|
|
const char *base = NULL;
|
|
|
|
|
|
|
|
if (!prefix || !bind->valid || !keybind)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
base = keybind->base;
|
2022-07-23 10:44:41 +02:00
|
|
|
btn[0] = '\0';
|
2021-08-30 16:52:05 +02:00
|
|
|
|
|
|
|
fill_pathname_join_delim(key, prefix, base, '_', sizeof(key));
|
|
|
|
|
|
|
|
input_keymaps_translate_rk_to_str(bind->key, btn, sizeof(btn));
|
|
|
|
|
2023-01-24 02:42:50 +02:00
|
|
|
config_set_string(conf, key, btn);
|
2021-08-30 16:52:05 +02:00
|
|
|
input_config_save_keybind(conf, prefix, base, bind, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-01-24 02:42:50 +02:00
|
|
|
/**
|
|
|
|
* input_config_save_keybinds_user_override:
|
|
|
|
* @conf : pointer to config file object
|
|
|
|
* @user : user number
|
|
|
|
* @bind_id : bind number
|
|
|
|
* @override_bind : override retro_keybind for comparison and saving
|
|
|
|
*
|
|
|
|
* Save the current bind (@override_bind) override of a user (@user) to the
|
|
|
|
* config file (@conf), and skip binds that are not modified.
|
|
|
|
*/
|
|
|
|
static void input_config_save_keybinds_user_override(config_file_t *conf,
|
|
|
|
unsigned user, unsigned bind_id,
|
|
|
|
const struct retro_keybind *override_bind)
|
|
|
|
{
|
|
|
|
unsigned i = bind_id;
|
|
|
|
|
|
|
|
if (input_config_bind_map_get_valid(i))
|
|
|
|
{
|
|
|
|
char key[64];
|
|
|
|
char btn[64];
|
|
|
|
const struct input_bind_map *keybind =
|
|
|
|
(const struct input_bind_map*)INPUT_CONFIG_BIND_MAP_GET(i);
|
|
|
|
bool meta = keybind ? keybind->meta : false;
|
|
|
|
const char *prefix = input_config_get_prefix(user, meta);
|
|
|
|
const struct retro_keybind *bind = &input_config_binds[user][i];
|
|
|
|
const char *base = NULL;
|
|
|
|
|
|
|
|
if (!prefix || !bind->valid || !keybind)
|
|
|
|
return;
|
|
|
|
|
|
|
|
base = keybind->base;
|
|
|
|
btn[0] = '\0';
|
|
|
|
|
|
|
|
fill_pathname_join_delim(key, prefix, base, '_', sizeof(key));
|
|
|
|
|
|
|
|
input_keymaps_translate_rk_to_str(override_bind->key, btn, sizeof(btn));
|
|
|
|
|
|
|
|
config_set_string(conf, key, btn);
|
|
|
|
|
|
|
|
if (bind->joykey != override_bind->joykey)
|
|
|
|
save_keybind_joykey (conf, prefix, base, override_bind, true);
|
|
|
|
if (bind->joyaxis != override_bind->joyaxis)
|
|
|
|
save_keybind_axis (conf, prefix, base, override_bind, true);
|
|
|
|
if (bind->mbutton != override_bind->mbutton)
|
|
|
|
save_keybind_mbutton(conf, prefix, base, override_bind, true);
|
|
|
|
|
|
|
|
RARCH_DBG("[Overrides]: %s = \"%s\"\n", key, btn);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/**
|
|
|
|
* config_save_autoconf_profile:
|
2020-08-03 13:08:47 +01:00
|
|
|
* @device_name : Input device name
|
2020-06-26 18:40:20 +02:00
|
|
|
* @user : Controller number to save
|
|
|
|
* Writes a controller autoconf file to disk.
|
|
|
|
**/
|
2022-01-09 05:19:03 -05:00
|
|
|
bool config_save_autoconf_profile(const
|
2020-08-18 12:44:14 +02:00
|
|
|
char *device_name, unsigned user)
|
2020-06-26 18:40:20 +02:00
|
|
|
{
|
|
|
|
static const char* invalid_filename_chars[] = {
|
|
|
|
/* https://support.microsoft.com/en-us/help/905231/information-about-the-characters-that-you-cannot-use-in-site-names--fo */
|
|
|
|
"~", "#", "%", "&", "*", "{", "}", "\\", ":", "[", "]", "?", "/", "|", "\'", "\"",
|
|
|
|
NULL
|
|
|
|
};
|
2022-08-04 14:18:11 +02:00
|
|
|
size_t len;
|
2021-01-16 20:47:07 +01:00
|
|
|
unsigned i;
|
2020-08-18 12:44:14 +02:00
|
|
|
char buf[PATH_MAX_LENGTH];
|
|
|
|
char autoconf_file[PATH_MAX_LENGTH];
|
2020-06-26 18:40:20 +02:00
|
|
|
config_file_t *conf = NULL;
|
|
|
|
int32_t pid_user = 0;
|
|
|
|
int32_t vid_user = 0;
|
|
|
|
bool ret = false;
|
2021-11-03 21:22:37 +01:00
|
|
|
settings_t *settings = config_st;
|
2020-06-26 18:40:20 +02:00
|
|
|
const char *autoconf_dir = settings->paths.directory_autoconfig;
|
2020-08-03 13:08:47 +01:00
|
|
|
const char *joypad_driver_fallback = settings->arrays.input_joypad_driver;
|
|
|
|
const char *joypad_driver = NULL;
|
|
|
|
char *sanitised_name = NULL;
|
|
|
|
|
|
|
|
if (string_is_empty(device_name))
|
|
|
|
goto end;
|
|
|
|
|
|
|
|
/* Get currently set joypad driver */
|
|
|
|
joypad_driver = input_config_get_device_joypad_driver(user);
|
|
|
|
if (string_is_empty(joypad_driver))
|
|
|
|
{
|
|
|
|
/* This cannot happen, but if we reach this
|
|
|
|
* point without a driver being set for the
|
|
|
|
* current input device then use the value
|
|
|
|
* from the settings struct as a fallback */
|
|
|
|
joypad_driver = joypad_driver_fallback;
|
|
|
|
|
|
|
|
if (string_is_empty(joypad_driver))
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
|
|
|
|
sanitised_name = strdup(device_name);
|
|
|
|
|
2020-08-18 12:44:14 +02:00
|
|
|
/* Remove invalid filename characters from
|
|
|
|
* input device name */
|
2020-06-26 18:40:20 +02:00
|
|
|
for (i = 0; invalid_filename_chars[i]; i++)
|
|
|
|
{
|
|
|
|
for (;;)
|
2020-06-26 18:25:12 +02:00
|
|
|
{
|
2020-08-18 12:44:14 +02:00
|
|
|
char *tmp = strstr(sanitised_name,
|
|
|
|
invalid_filename_chars[i]);
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
if (tmp)
|
|
|
|
*tmp = '_';
|
|
|
|
else
|
|
|
|
break;
|
2020-06-26 18:25:12 +02:00
|
|
|
}
|
2020-06-26 18:40:20 +02:00
|
|
|
}
|
2016-08-30 04:20:28 +02:00
|
|
|
|
2020-08-18 12:44:14 +02:00
|
|
|
/* Generate autoconfig file path */
|
2022-08-04 14:18:11 +02:00
|
|
|
fill_pathname_join_special(buf, autoconf_dir, joypad_driver, sizeof(buf));
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
if (path_is_directory(buf))
|
2022-08-04 14:18:11 +02:00
|
|
|
len = fill_pathname_join_special(autoconf_file, buf,
|
2022-07-11 19:56:46 +02:00
|
|
|
sanitised_name, sizeof(autoconf_file));
|
2020-06-26 18:40:20 +02:00
|
|
|
else
|
2022-08-04 14:18:11 +02:00
|
|
|
len = fill_pathname_join_special(autoconf_file, autoconf_dir,
|
2022-07-11 19:56:46 +02:00
|
|
|
sanitised_name, sizeof(autoconf_file));
|
2023-06-20 16:33:55 +02:00
|
|
|
strlcpy(autoconf_file + len, ".cfg", sizeof(autoconf_file) - len);
|
2016-12-26 03:01:29 +01:00
|
|
|
|
2020-08-03 13:08:47 +01:00
|
|
|
/* Open config file */
|
2022-07-07 10:45:15 +02:00
|
|
|
if ( !(conf = config_file_new_from_path_to_string(autoconf_file))
|
|
|
|
&& !(conf = config_file_new_alloc())
|
|
|
|
)
|
|
|
|
goto end;
|
2016-12-26 03:01:29 +01:00
|
|
|
|
2020-08-03 13:08:47 +01:00
|
|
|
/* Update config file */
|
2020-06-26 18:40:20 +02:00
|
|
|
config_set_string(conf, "input_driver",
|
2020-08-03 13:08:47 +01:00
|
|
|
joypad_driver);
|
2020-06-26 18:40:20 +02:00
|
|
|
config_set_string(conf, "input_device",
|
|
|
|
input_config_get_device_name(user));
|
2016-07-23 14:59:07 +02:00
|
|
|
|
2020-07-14 17:44:27 +01:00
|
|
|
pid_user = input_config_get_device_pid(user);
|
|
|
|
vid_user = input_config_get_device_vid(user);
|
2016-12-26 03:01:29 +01:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
if (pid_user && vid_user)
|
|
|
|
{
|
|
|
|
config_set_int(conf, "input_vendor_id",
|
|
|
|
vid_user);
|
|
|
|
config_set_int(conf, "input_product_id",
|
|
|
|
pid_user);
|
|
|
|
}
|
2016-07-24 05:01:11 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
for (i = 0; i < RARCH_FIRST_META_KEY; i++)
|
|
|
|
{
|
|
|
|
const struct retro_keybind *bind = &input_config_binds[user][i];
|
|
|
|
if (bind->valid)
|
2024-01-10 16:26:23 +01:00
|
|
|
{
|
|
|
|
save_keybind_joykey(
|
|
|
|
conf, "input", input_config_bind_map_get_base(i),
|
|
|
|
bind, false);
|
|
|
|
save_keybind_axis(
|
2020-06-26 18:40:20 +02:00
|
|
|
conf, "input", input_config_bind_map_get_base(i),
|
|
|
|
bind, false);
|
2024-01-10 16:26:23 +01:00
|
|
|
}
|
2020-06-26 18:40:20 +02:00
|
|
|
}
|
2017-04-28 19:55:09 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
ret = config_file_write(conf, autoconf_file, false);
|
|
|
|
|
2020-08-03 13:08:47 +01:00
|
|
|
end:
|
|
|
|
if (sanitised_name)
|
|
|
|
free(sanitised_name);
|
|
|
|
|
|
|
|
if (conf)
|
|
|
|
config_file_free(conf);
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
return ret;
|
2020-06-26 18:25:12 +02:00
|
|
|
}
|
2020-06-26 18:40:20 +02:00
|
|
|
|
2020-06-26 18:25:12 +02:00
|
|
|
/**
|
2020-06-26 18:40:20 +02:00
|
|
|
* config_save_file:
|
|
|
|
* @path : Path that shall be written to.
|
2020-06-26 18:25:12 +02:00
|
|
|
*
|
2020-06-26 18:40:20 +02:00
|
|
|
* Writes a config file to disk.
|
2020-06-26 18:25:12 +02:00
|
|
|
*
|
2020-06-26 18:40:20 +02:00
|
|
|
* Returns: true (1) on success, otherwise returns false (0).
|
2020-06-26 18:25:12 +02:00
|
|
|
**/
|
2020-06-26 18:40:20 +02:00
|
|
|
bool config_save_file(const char *path)
|
2020-06-26 18:25:12 +02:00
|
|
|
{
|
2020-06-26 18:40:20 +02:00
|
|
|
float msg_color;
|
|
|
|
unsigned i = 0;
|
|
|
|
bool ret = false;
|
|
|
|
struct config_bool_setting *bool_settings = NULL;
|
|
|
|
struct config_int_setting *int_settings = NULL;
|
|
|
|
struct config_uint_setting *uint_settings = NULL;
|
|
|
|
struct config_size_setting *size_settings = NULL;
|
|
|
|
struct config_float_setting *float_settings = NULL;
|
|
|
|
struct config_array_setting *array_settings = NULL;
|
|
|
|
struct config_path_setting *path_settings = NULL;
|
2022-10-10 08:59:27 +02:00
|
|
|
uint32_t flags = runloop_get_flags();
|
2020-06-26 18:40:20 +02:00
|
|
|
config_file_t *conf = config_file_new_from_path_to_string(path);
|
2021-11-03 21:22:37 +01:00
|
|
|
settings_t *settings = config_st;
|
2021-04-08 01:54:44 +02:00
|
|
|
global_t *global = global_get_ptr();
|
2020-06-26 18:40:20 +02:00
|
|
|
int bool_settings_size = sizeof(settings->bools) / sizeof(settings->bools.placeholder);
|
|
|
|
int float_settings_size = sizeof(settings->floats)/ sizeof(settings->floats.placeholder);
|
|
|
|
int int_settings_size = sizeof(settings->ints) / sizeof(settings->ints.placeholder);
|
|
|
|
int uint_settings_size = sizeof(settings->uints) / sizeof(settings->uints.placeholder);
|
|
|
|
int size_settings_size = sizeof(settings->sizes) / sizeof(settings->sizes.placeholder);
|
|
|
|
int array_settings_size = sizeof(settings->arrays)/ sizeof(settings->arrays.placeholder);
|
|
|
|
int path_settings_size = sizeof(settings->paths) / sizeof(settings->paths.placeholder);
|
2018-07-13 16:12:09 -04:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
if (!conf)
|
|
|
|
conf = config_file_new_alloc();
|
2018-07-13 16:12:09 -04:00
|
|
|
|
2022-10-10 08:59:27 +02:00
|
|
|
if (!conf || (flags & RUNLOOP_FLAG_OVERRIDES_ACTIVE))
|
2016-07-24 05:57:20 +02:00
|
|
|
{
|
2020-06-26 18:40:20 +02:00
|
|
|
if (conf)
|
|
|
|
config_file_free(conf);
|
|
|
|
return false;
|
|
|
|
}
|
2016-12-26 03:01:29 +01:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
bool_settings = populate_settings_bool (settings, &bool_settings_size);
|
|
|
|
int_settings = populate_settings_int (settings, &int_settings_size);
|
|
|
|
uint_settings = populate_settings_uint (settings, &uint_settings_size);
|
|
|
|
size_settings = populate_settings_size (settings, &size_settings_size);
|
|
|
|
float_settings = populate_settings_float (settings, &float_settings_size);
|
|
|
|
array_settings = populate_settings_array (settings, &array_settings_size);
|
|
|
|
path_settings = populate_settings_path (settings, &path_settings_size);
|
2016-08-30 04:20:28 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/* Path settings */
|
|
|
|
if (path_settings && (path_settings_size > 0))
|
|
|
|
{
|
|
|
|
for (i = 0; i < (unsigned)path_settings_size; i++)
|
2020-06-26 18:25:12 +02:00
|
|
|
{
|
2020-06-26 18:40:20 +02:00
|
|
|
const char *value = path_settings[i].ptr;
|
2016-10-09 09:05:41 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
if (path_settings[i].def_enable && string_is_empty(path_settings[i].ptr))
|
|
|
|
value = "default";
|
2016-10-09 09:05:41 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
config_set_path(conf, path_settings[i].ident, value);
|
|
|
|
}
|
2016-08-30 04:20:28 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
free(path_settings);
|
|
|
|
}
|
2016-07-24 04:37:46 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
#ifdef HAVE_MENU
|
|
|
|
config_set_path(conf, "xmb_font",
|
|
|
|
!string_is_empty(settings->paths.path_menu_xmb_font)
|
|
|
|
? settings->paths.path_menu_xmb_font : "");
|
|
|
|
#endif
|
2016-07-25 08:06:04 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/* String settings */
|
|
|
|
if (array_settings && (array_settings_size > 0))
|
|
|
|
{
|
|
|
|
for (i = 0; i < (unsigned)array_settings_size; i++)
|
2023-09-03 17:37:00 +02:00
|
|
|
if ( !array_settings[i].override
|
|
|
|
|| !retroarch_override_setting_is_set(array_settings[i].override, NULL))
|
2020-06-26 18:40:20 +02:00
|
|
|
config_set_string(conf,
|
|
|
|
array_settings[i].ident,
|
|
|
|
array_settings[i].ptr);
|
2016-07-24 05:57:20 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
free(array_settings);
|
|
|
|
}
|
2015-05-20 23:13:39 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/* Float settings */
|
|
|
|
if (float_settings && (float_settings_size > 0))
|
|
|
|
{
|
|
|
|
for (i = 0; i < (unsigned)float_settings_size; i++)
|
2023-09-03 17:37:00 +02:00
|
|
|
if ( !float_settings[i].override
|
|
|
|
|| !retroarch_override_setting_is_set(float_settings[i].override, NULL))
|
2020-06-26 18:40:20 +02:00
|
|
|
config_set_float(conf,
|
|
|
|
float_settings[i].ident,
|
|
|
|
*float_settings[i].ptr);
|
2016-03-22 05:46:36 +07:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
free(float_settings);
|
|
|
|
}
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/* Integer settings */
|
|
|
|
if (int_settings && (int_settings_size > 0))
|
|
|
|
{
|
|
|
|
for (i = 0; i < (unsigned)int_settings_size; i++)
|
2023-09-03 17:37:00 +02:00
|
|
|
if ( !int_settings[i].override
|
|
|
|
|| !retroarch_override_setting_is_set(int_settings[i].override, NULL))
|
2020-06-26 18:40:20 +02:00
|
|
|
config_set_int(conf,
|
|
|
|
int_settings[i].ident,
|
|
|
|
*int_settings[i].ptr);
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
free(int_settings);
|
|
|
|
}
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
if (uint_settings && (uint_settings_size > 0))
|
|
|
|
{
|
|
|
|
for (i = 0; i < (unsigned)uint_settings_size; i++)
|
2023-09-03 17:37:00 +02:00
|
|
|
if ( !uint_settings[i].override
|
|
|
|
|| !retroarch_override_setting_is_set(uint_settings[i].override, NULL))
|
2020-06-26 18:40:20 +02:00
|
|
|
config_set_int(conf,
|
|
|
|
uint_settings[i].ident,
|
|
|
|
*uint_settings[i].ptr);
|
|
|
|
|
|
|
|
free(uint_settings);
|
2020-06-26 18:25:12 +02:00
|
|
|
}
|
2013-09-29 19:37:48 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
if (size_settings && (size_settings_size > 0))
|
|
|
|
{
|
|
|
|
for (i = 0; i < (unsigned)size_settings_size; i++)
|
2023-09-03 17:37:00 +02:00
|
|
|
if ( !size_settings[i].override
|
|
|
|
|| !retroarch_override_setting_is_set(size_settings[i].override, NULL))
|
2020-06-26 18:40:20 +02:00
|
|
|
config_set_int(conf,
|
|
|
|
size_settings[i].ident,
|
|
|
|
(int)*size_settings[i].ptr);
|
2016-08-25 19:00:06 -05:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
free(size_settings);
|
|
|
|
}
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
for (i = 0; i < MAX_USERS; i++)
|
|
|
|
{
|
2023-06-18 22:37:01 +02:00
|
|
|
size_t _len;
|
2020-06-26 18:40:20 +02:00
|
|
|
char cfg[64];
|
2022-08-27 07:52:31 +02:00
|
|
|
char formatted_number[4];
|
2018-05-13 16:20:51 -05:00
|
|
|
|
2022-09-01 04:17:07 +02:00
|
|
|
formatted_number[0] = '\0';
|
2016-08-26 11:26:24 -05:00
|
|
|
|
2022-08-27 07:52:31 +02:00
|
|
|
snprintf(formatted_number, sizeof(formatted_number), "%u", i + 1);
|
|
|
|
|
2023-06-20 17:43:33 +02:00
|
|
|
_len = strlcpy(cfg, "input_device_p", sizeof(cfg));
|
|
|
|
strlcpy(cfg + _len, formatted_number, sizeof(cfg) - _len);
|
2020-06-26 18:40:20 +02:00
|
|
|
config_set_int(conf, cfg, settings->uints.input_device[i]);
|
2023-01-24 02:42:50 +02:00
|
|
|
|
2023-06-20 17:43:33 +02:00
|
|
|
_len = strlcpy(cfg, "input_player", sizeof(cfg));
|
|
|
|
_len += strlcpy(cfg + _len, formatted_number, sizeof(cfg) - _len);
|
2023-01-24 02:42:50 +02:00
|
|
|
|
2023-06-18 22:37:01 +02:00
|
|
|
strlcpy(cfg + _len, "_mouse_index", sizeof(cfg) - _len);
|
|
|
|
config_set_int(conf, cfg, settings->uints.input_mouse_index[i]);
|
|
|
|
|
|
|
|
strlcpy(cfg + _len, "_joypad_index", sizeof(cfg) - _len);
|
2023-01-24 02:42:50 +02:00
|
|
|
config_set_int(conf, cfg, settings->uints.input_joypad_index[i]);
|
|
|
|
|
2023-06-18 22:37:01 +02:00
|
|
|
strlcpy(cfg + _len, "_analog_dpad_mode", sizeof(cfg) - _len);
|
|
|
|
config_set_int(conf, cfg, settings->uints.input_analog_dpad_mode[i]);
|
2020-06-26 18:40:20 +02:00
|
|
|
}
|
2016-08-26 11:26:24 -05:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/* Boolean settings */
|
|
|
|
if (bool_settings && (bool_settings_size > 0))
|
2020-06-26 18:25:12 +02:00
|
|
|
{
|
2020-06-26 18:40:20 +02:00
|
|
|
for (i = 0; i < (unsigned)bool_settings_size; i++)
|
2023-09-03 17:37:00 +02:00
|
|
|
if ( !bool_settings[i].override
|
|
|
|
|| !retroarch_override_setting_is_set(bool_settings[i].override, NULL))
|
2022-07-18 01:59:32 +02:00
|
|
|
config_set_string(conf, bool_settings[i].ident,
|
|
|
|
*bool_settings[i].ptr
|
|
|
|
? "true" : "false");
|
2020-06-26 18:40:20 +02:00
|
|
|
|
|
|
|
free(bool_settings);
|
2020-06-26 18:25:12 +02:00
|
|
|
}
|
2016-08-26 11:26:24 -05:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
#ifdef HAVE_NETWORKGAMEPAD
|
2020-06-26 18:25:12 +02:00
|
|
|
{
|
2020-06-26 18:40:20 +02:00
|
|
|
char tmp[64];
|
2022-08-29 12:40:25 +02:00
|
|
|
size_t _len = strlcpy(tmp, "network_remote_enable_user_p", sizeof(tmp));
|
2022-09-01 18:38:20 +02:00
|
|
|
for (i = 0; i < MAX_USERS; i++)
|
|
|
|
{
|
|
|
|
snprintf(tmp + _len, sizeof(tmp) - _len, "%u", i + 1);
|
|
|
|
config_set_string(conf, tmp,
|
|
|
|
settings->bools.network_remote_enable_user[i]
|
|
|
|
? "true" : "false");
|
|
|
|
}
|
2020-06-26 18:40:20 +02:00
|
|
|
}
|
|
|
|
#endif
|
2016-08-26 09:43:29 -05:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/* Verbosity isn't in bool_settings since it needs to be loaded differently */
|
|
|
|
if (!retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_VERBOSITY, NULL))
|
2022-07-18 01:59:32 +02:00
|
|
|
config_set_string(conf, "log_verbosity",
|
|
|
|
verbosity_is_enabled() ? "true" : "false");
|
|
|
|
config_set_string(conf, "perfcnt_enable",
|
2023-09-03 17:37:00 +02:00
|
|
|
retroarch_ctl(RARCH_CTL_IS_PERFCNT_ENABLE, NULL)
|
2022-07-18 01:59:32 +02:00
|
|
|
? "true" : "false");
|
2016-08-26 09:43:29 -05:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
msg_color = (((int)(settings->floats.video_msg_color_r * 255.0f) & 0xff) << 16) +
|
|
|
|
(((int)(settings->floats.video_msg_color_g * 255.0f) & 0xff) << 8) +
|
|
|
|
(((int)(settings->floats.video_msg_color_b * 255.0f) & 0xff));
|
2016-08-26 00:44:05 -05:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/* Hexadecimal settings */
|
|
|
|
config_set_hex(conf, "video_message_color", msg_color);
|
2018-05-13 16:20:51 -05:00
|
|
|
|
2021-04-08 01:54:44 +02:00
|
|
|
if (conf)
|
|
|
|
video_driver_save_settings(global, conf);
|
2016-08-26 00:44:05 -05:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
#ifdef HAVE_LAKKA
|
|
|
|
if (settings->bools.ssh_enable)
|
|
|
|
filestream_close(filestream_open(LAKKA_SSH_PATH,
|
|
|
|
RETRO_VFS_FILE_ACCESS_WRITE,
|
|
|
|
RETRO_VFS_FILE_ACCESS_HINT_NONE));
|
|
|
|
else
|
|
|
|
filestream_delete(LAKKA_SSH_PATH);
|
|
|
|
if (settings->bools.samba_enable)
|
|
|
|
filestream_close(filestream_open(LAKKA_SAMBA_PATH,
|
|
|
|
RETRO_VFS_FILE_ACCESS_WRITE,
|
|
|
|
RETRO_VFS_FILE_ACCESS_HINT_NONE));
|
|
|
|
else
|
|
|
|
filestream_delete(LAKKA_SAMBA_PATH);
|
|
|
|
if (settings->bools.bluetooth_enable)
|
|
|
|
filestream_close(filestream_open(LAKKA_BLUETOOTH_PATH,
|
|
|
|
RETRO_VFS_FILE_ACCESS_WRITE,
|
|
|
|
RETRO_VFS_FILE_ACCESS_HINT_NONE));
|
|
|
|
else
|
|
|
|
filestream_delete(LAKKA_BLUETOOTH_PATH);
|
|
|
|
#endif
|
2016-08-26 00:44:05 -05:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
for (i = 0; i < MAX_USERS; i++)
|
|
|
|
input_config_save_keybinds_user(conf, i);
|
2016-08-25 10:30:30 -05:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
ret = config_file_write(conf, path, true);
|
2020-06-26 18:25:12 +02:00
|
|
|
config_file_free(conf);
|
2016-12-26 04:14:09 +01:00
|
|
|
|
2023-05-11 22:30:06 -04:00
|
|
|
#if TARGET_OS_TV
|
|
|
|
if (ret && string_is_equal(path, path_get(RARCH_PATH_CONFIG)))
|
|
|
|
write_userdefaults_config_file();
|
|
|
|
#endif
|
|
|
|
|
2020-06-26 18:25:12 +02:00
|
|
|
return ret;
|
|
|
|
}
|
2016-12-26 04:14:09 +01:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/**
|
|
|
|
* config_save_overrides:
|
|
|
|
* @path : Path that shall be written to.
|
|
|
|
*
|
|
|
|
* Writes a config file override to disk.
|
|
|
|
*
|
2023-01-24 02:42:50 +02:00
|
|
|
* Returns: true (1) on success, (-1) if nothing to write, otherwise returns false (0).
|
2020-06-26 18:40:20 +02:00
|
|
|
**/
|
2023-08-22 02:11:48 +03:00
|
|
|
int8_t config_save_overrides(enum override_type type,
|
|
|
|
void *data, bool remove, const char *path)
|
2020-06-26 18:25:12 +02:00
|
|
|
{
|
2020-06-26 18:40:20 +02:00
|
|
|
int tmp_i = 0;
|
|
|
|
unsigned i = 0;
|
2023-01-24 02:42:50 +02:00
|
|
|
int8_t ret = 0;
|
|
|
|
retro_keybind_set input_override_binds[MAX_USERS]
|
|
|
|
= {0};
|
2020-06-26 18:40:20 +02:00
|
|
|
config_file_t *conf = NULL;
|
|
|
|
settings_t *settings = NULL;
|
|
|
|
struct config_bool_setting *bool_settings = NULL;
|
|
|
|
struct config_bool_setting *bool_overrides = NULL;
|
|
|
|
struct config_int_setting *int_settings = NULL;
|
|
|
|
struct config_uint_setting *uint_settings = NULL;
|
|
|
|
struct config_size_setting *size_settings = NULL;
|
|
|
|
struct config_int_setting *int_overrides = NULL;
|
|
|
|
struct config_uint_setting *uint_overrides = NULL;
|
|
|
|
struct config_size_setting *size_overrides = NULL;
|
|
|
|
struct config_float_setting *float_settings = NULL;
|
|
|
|
struct config_float_setting *float_overrides= NULL;
|
|
|
|
struct config_array_setting *array_settings = NULL;
|
|
|
|
struct config_array_setting *array_overrides= NULL;
|
|
|
|
struct config_path_setting *path_settings = NULL;
|
|
|
|
struct config_path_setting *path_overrides = NULL;
|
2020-08-18 12:44:14 +02:00
|
|
|
char config_directory[PATH_MAX_LENGTH];
|
|
|
|
char override_directory[PATH_MAX_LENGTH];
|
2022-02-28 12:45:51 +00:00
|
|
|
char content_dir_name[PATH_MAX_LENGTH];
|
2023-01-24 02:42:50 +02:00
|
|
|
char override_path[PATH_MAX_LENGTH];
|
2021-11-03 21:22:37 +01:00
|
|
|
settings_t *overrides = config_st;
|
2020-06-26 18:40:20 +02:00
|
|
|
int bool_settings_size = sizeof(settings->bools) / sizeof(settings->bools.placeholder);
|
|
|
|
int float_settings_size = sizeof(settings->floats) / sizeof(settings->floats.placeholder);
|
|
|
|
int int_settings_size = sizeof(settings->ints) / sizeof(settings->ints.placeholder);
|
|
|
|
int uint_settings_size = sizeof(settings->uints) / sizeof(settings->uints.placeholder);
|
|
|
|
int size_settings_size = sizeof(settings->sizes) / sizeof(settings->sizes.placeholder);
|
|
|
|
int array_settings_size = sizeof(settings->arrays) / sizeof(settings->arrays.placeholder);
|
|
|
|
int path_settings_size = sizeof(settings->paths) / sizeof(settings->paths.placeholder);
|
2023-07-05 03:29:16 +02:00
|
|
|
rarch_system_info_t *sys_info = (rarch_system_info_t*)data;
|
|
|
|
const char *core_name = sys_info ? sys_info->info.library_name : NULL;
|
2020-06-26 18:40:20 +02:00
|
|
|
const char *rarch_path_basename = path_get(RARCH_PATH_BASENAME);
|
2022-02-28 12:45:51 +00:00
|
|
|
const char *game_name = NULL;
|
|
|
|
bool has_content = !string_is_empty(rarch_path_basename);
|
|
|
|
|
|
|
|
content_dir_name[0] = '\0';
|
2023-01-24 02:42:50 +02:00
|
|
|
override_path[0] = '\0';
|
2022-02-28 12:45:51 +00:00
|
|
|
|
|
|
|
/* > Cannot save an override if we have no core
|
|
|
|
* > Cannot save a per-game or per-content-directory
|
|
|
|
* override if we have no content */
|
2023-09-03 17:37:00 +02:00
|
|
|
if ( string_is_empty(core_name)
|
|
|
|
|| (!has_content && (type != OVERRIDE_CORE)))
|
2020-06-26 18:40:20 +02:00
|
|
|
return false;
|
2016-12-26 04:14:09 +01:00
|
|
|
|
2022-02-28 12:45:51 +00:00
|
|
|
settings = (settings_t*)calloc(1, sizeof(settings_t));
|
|
|
|
conf = config_file_new_alloc();
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2022-02-28 12:45:51 +00:00
|
|
|
/* Get base config directory */
|
|
|
|
fill_pathname_application_special(config_directory,
|
|
|
|
sizeof(config_directory),
|
2020-06-26 18:40:20 +02:00
|
|
|
APPLICATION_SPECIAL_DIRECTORY_CONFIG);
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2022-08-04 14:18:11 +02:00
|
|
|
fill_pathname_join_special(override_directory,
|
2022-02-28 12:45:51 +00:00
|
|
|
config_directory, core_name,
|
2020-08-18 12:44:14 +02:00
|
|
|
sizeof(override_directory));
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2022-02-28 12:45:51 +00:00
|
|
|
/* Ensure base config directory exists */
|
2020-06-26 18:40:20 +02:00
|
|
|
if (!path_is_directory(override_directory))
|
2022-02-28 12:45:51 +00:00
|
|
|
path_mkdir(override_directory);
|
2020-06-26 18:40:20 +02:00
|
|
|
|
2023-01-24 02:42:50 +02:00
|
|
|
/* Store current binds as override binds */
|
|
|
|
memcpy(input_override_binds, input_config_binds, sizeof(input_override_binds));
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/* Load the original config file in memory */
|
|
|
|
config_load_file(global_get_ptr(),
|
2023-01-29 01:12:08 +02:00
|
|
|
"without-overrides", settings);
|
2020-06-26 18:40:20 +02:00
|
|
|
|
|
|
|
bool_settings = populate_settings_bool(settings, &bool_settings_size);
|
|
|
|
tmp_i = sizeof(settings->bools) / sizeof(settings->bools.placeholder);
|
|
|
|
bool_overrides = populate_settings_bool(overrides, &tmp_i);
|
2016-12-26 04:14:09 +01:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
int_settings = populate_settings_int(settings, &int_settings_size);
|
|
|
|
tmp_i = sizeof(settings->ints) / sizeof(settings->ints.placeholder);
|
2023-01-24 02:42:50 +02:00
|
|
|
int_overrides = populate_settings_int(overrides, &tmp_i);
|
2016-08-25 20:10:01 -05:00
|
|
|
|
2023-01-24 02:42:50 +02:00
|
|
|
uint_settings = populate_settings_uint(settings, &uint_settings_size);
|
2020-06-26 18:40:20 +02:00
|
|
|
tmp_i = sizeof(settings->uints) / sizeof(settings->uints.placeholder);
|
2023-01-24 02:42:50 +02:00
|
|
|
uint_overrides = populate_settings_uint(overrides, &tmp_i);
|
2016-08-29 15:36:55 +02:00
|
|
|
|
2023-01-24 02:42:50 +02:00
|
|
|
size_settings = populate_settings_size(settings, &size_settings_size);
|
2020-06-26 18:40:20 +02:00
|
|
|
tmp_i = sizeof(settings->sizes) / sizeof(settings->sizes.placeholder);
|
2023-01-24 02:42:50 +02:00
|
|
|
size_overrides = populate_settings_size(overrides, &tmp_i);
|
2016-11-20 11:47:50 -05:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
float_settings = populate_settings_float(settings, &float_settings_size);
|
|
|
|
tmp_i = sizeof(settings->floats) / sizeof(settings->floats.placeholder);
|
|
|
|
float_overrides = populate_settings_float(overrides, &tmp_i);
|
2018-02-17 11:55:39 +01:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
array_settings = populate_settings_array(settings, &array_settings_size);
|
2023-01-24 02:42:50 +02:00
|
|
|
tmp_i = sizeof(settings->arrays) / sizeof(settings->arrays.placeholder);
|
|
|
|
array_overrides = populate_settings_array(overrides, &tmp_i);
|
2016-11-20 11:47:50 -05:00
|
|
|
|
2023-01-24 02:42:50 +02:00
|
|
|
path_settings = populate_settings_path(settings, &path_settings_size);
|
|
|
|
tmp_i = sizeof(settings->paths) / sizeof(settings->paths.placeholder);
|
|
|
|
path_overrides = populate_settings_path(overrides, &tmp_i);
|
2020-06-26 18:40:20 +02:00
|
|
|
|
2023-01-24 02:42:50 +02:00
|
|
|
if (conf->modified)
|
|
|
|
RARCH_LOG("[Overrides]: Looking for changed settings..\n");
|
2020-06-26 18:40:20 +02:00
|
|
|
|
|
|
|
if (conf)
|
2020-06-26 18:25:12 +02:00
|
|
|
{
|
2020-06-26 18:40:20 +02:00
|
|
|
for (i = 0; i < (unsigned)bool_settings_size; i++)
|
|
|
|
{
|
|
|
|
if ((*bool_settings[i].ptr) != (*bool_overrides[i].ptr))
|
2023-01-24 02:42:50 +02:00
|
|
|
{
|
2022-07-18 01:59:32 +02:00
|
|
|
config_set_string(conf, bool_overrides[i].ident,
|
|
|
|
(*bool_overrides[i].ptr) ? "true" : "false");
|
2023-01-24 02:42:50 +02:00
|
|
|
RARCH_DBG("[Overrides]: %s = \"%s\"\n",
|
|
|
|
bool_overrides[i].ident,
|
|
|
|
(*bool_overrides[i].ptr) ? "true" : "false");
|
|
|
|
}
|
2020-06-26 18:40:20 +02:00
|
|
|
}
|
|
|
|
for (i = 0; i < (unsigned)int_settings_size; i++)
|
|
|
|
{
|
|
|
|
if ((*int_settings[i].ptr) != (*int_overrides[i].ptr))
|
2023-01-24 02:42:50 +02:00
|
|
|
{
|
2020-06-26 18:40:20 +02:00
|
|
|
config_set_int(conf, int_overrides[i].ident,
|
|
|
|
(*int_overrides[i].ptr));
|
2023-01-24 02:42:50 +02:00
|
|
|
RARCH_DBG("[Overrides]: %s = \"%d\"\n",
|
|
|
|
int_overrides[i].ident, *int_overrides[i].ptr);
|
|
|
|
}
|
2020-06-26 18:40:20 +02:00
|
|
|
}
|
|
|
|
for (i = 0; i < (unsigned)uint_settings_size; i++)
|
|
|
|
{
|
|
|
|
if ((*uint_settings[i].ptr) != (*uint_overrides[i].ptr))
|
2023-01-24 02:42:50 +02:00
|
|
|
{
|
2020-06-26 18:40:20 +02:00
|
|
|
config_set_int(conf, uint_overrides[i].ident,
|
|
|
|
(*uint_overrides[i].ptr));
|
2023-01-24 02:42:50 +02:00
|
|
|
RARCH_DBG("[Overrides]: %s = \"%d\"\n",
|
|
|
|
uint_overrides[i].ident, *uint_overrides[i].ptr);
|
|
|
|
}
|
2020-06-26 18:40:20 +02:00
|
|
|
}
|
|
|
|
for (i = 0; i < (unsigned)size_settings_size; i++)
|
|
|
|
{
|
|
|
|
if ((*size_settings[i].ptr) != (*size_overrides[i].ptr))
|
2023-01-24 02:42:50 +02:00
|
|
|
{
|
2020-06-26 18:40:20 +02:00
|
|
|
config_set_int(conf, size_overrides[i].ident,
|
|
|
|
(int)(*size_overrides[i].ptr));
|
2023-01-24 02:42:50 +02:00
|
|
|
RARCH_DBG("[Overrides]: %s = \"%d\"\n",
|
|
|
|
size_overrides[i].ident, *size_overrides[i].ptr);
|
|
|
|
}
|
2020-06-26 18:40:20 +02:00
|
|
|
}
|
|
|
|
for (i = 0; i < (unsigned)float_settings_size; i++)
|
|
|
|
{
|
|
|
|
if ((*float_settings[i].ptr) != (*float_overrides[i].ptr))
|
2023-01-24 02:42:50 +02:00
|
|
|
{
|
2020-06-26 18:40:20 +02:00
|
|
|
config_set_float(conf, float_overrides[i].ident,
|
|
|
|
*float_overrides[i].ptr);
|
2023-01-24 02:42:50 +02:00
|
|
|
RARCH_DBG("[Overrides]: %s = \"%f\"\n",
|
|
|
|
float_overrides[i].ident, *float_overrides[i].ptr);
|
|
|
|
}
|
2020-06-26 18:40:20 +02:00
|
|
|
}
|
2016-09-22 00:58:19 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
for (i = 0; i < (unsigned)array_settings_size; i++)
|
|
|
|
{
|
|
|
|
if (!string_is_equal(array_settings[i].ptr, array_overrides[i].ptr))
|
2021-09-08 11:34:19 -06:00
|
|
|
{
|
|
|
|
#ifdef HAVE_CHEEVOS
|
|
|
|
/* As authentication doesn't occur until after content is loaded,
|
|
|
|
* the achievement authentication token might only exist in the
|
|
|
|
* override set, and therefore differ from the master config set.
|
|
|
|
* Storing the achievement authentication token in an override
|
|
|
|
* is a recipe for disaster. If it expires and the user generates
|
|
|
|
* a new token, then the override will be out of date and the
|
|
|
|
* user will have to reauthenticate for each override (and also
|
|
|
|
* remember to update each override). Also exclude the username
|
|
|
|
* as it's directly tied to the token and password.
|
|
|
|
*/
|
2023-09-03 17:37:00 +02:00
|
|
|
if ( string_is_equal(array_settings[i].ident, "cheevos_token")
|
|
|
|
|| string_is_equal(array_settings[i].ident, "cheevos_password")
|
|
|
|
|| string_is_equal(array_settings[i].ident, "cheevos_username"))
|
2021-09-08 11:34:19 -06:00
|
|
|
continue;
|
|
|
|
#endif
|
2020-06-26 18:40:20 +02:00
|
|
|
config_set_string(conf, array_overrides[i].ident,
|
|
|
|
array_overrides[i].ptr);
|
2023-01-24 02:42:50 +02:00
|
|
|
RARCH_DBG("[Overrides]: %s = \"%s\"\n",
|
2023-05-10 12:28:54 +03:00
|
|
|
array_overrides[i].ident, array_overrides[i].ptr);
|
2021-09-08 11:34:19 -06:00
|
|
|
}
|
2020-06-26 18:40:20 +02:00
|
|
|
}
|
2016-09-22 00:58:19 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
for (i = 0; i < (unsigned)path_settings_size; i++)
|
|
|
|
{
|
|
|
|
if (!string_is_equal(path_settings[i].ptr, path_overrides[i].ptr))
|
2023-01-24 02:42:50 +02:00
|
|
|
{
|
2020-06-26 18:40:20 +02:00
|
|
|
config_set_path(conf, path_overrides[i].ident,
|
|
|
|
path_overrides[i].ptr);
|
2023-01-24 02:42:50 +02:00
|
|
|
RARCH_DBG("[Overrides]: %s = \"%s\"\n",
|
2023-05-10 12:28:54 +03:00
|
|
|
path_overrides[i].ident, path_overrides[i].ptr);
|
2023-01-24 02:42:50 +02:00
|
|
|
}
|
2020-06-26 18:40:20 +02:00
|
|
|
}
|
2016-08-26 01:06:15 -05:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
for (i = 0; i < MAX_USERS; i++)
|
|
|
|
{
|
2023-06-18 22:37:01 +02:00
|
|
|
size_t _len;
|
2023-01-24 02:42:50 +02:00
|
|
|
uint8_t j;
|
2020-06-26 18:40:20 +02:00
|
|
|
char cfg[64];
|
2022-08-27 07:52:31 +02:00
|
|
|
char formatted_number[4];
|
|
|
|
cfg[0] = formatted_number[0] = '\0';
|
|
|
|
|
|
|
|
snprintf(formatted_number, sizeof(formatted_number), "%u", i + 1);
|
2020-06-26 18:40:20 +02:00
|
|
|
|
|
|
|
if (settings->uints.input_device[i]
|
|
|
|
!= overrides->uints.input_device[i])
|
|
|
|
{
|
2023-06-18 12:06:12 +02:00
|
|
|
size_t _len = strlcpy(cfg, "input_device_p", sizeof(cfg));
|
|
|
|
strlcpy(cfg + _len, formatted_number, sizeof(cfg) - _len);
|
2020-06-26 18:40:20 +02:00
|
|
|
config_set_int(conf, cfg, overrides->uints.input_device[i]);
|
2023-01-24 02:42:50 +02:00
|
|
|
RARCH_DBG("[Overrides]: %s = \"%u\"\n", cfg, overrides->uints.input_device[i]);
|
|
|
|
}
|
|
|
|
|
2023-06-20 17:43:33 +02:00
|
|
|
_len = strlcpy(cfg, "input_player", sizeof(cfg));
|
|
|
|
_len += strlcpy(cfg + _len, formatted_number, sizeof(cfg) - _len);
|
2023-06-18 22:37:01 +02:00
|
|
|
|
|
|
|
if (settings->uints.input_mouse_index[i]
|
|
|
|
!= overrides->uints.input_mouse_index[i])
|
2023-01-24 02:42:50 +02:00
|
|
|
{
|
2023-06-18 22:37:01 +02:00
|
|
|
strlcpy(cfg + _len, "_mouse_index", sizeof(cfg) - _len);
|
|
|
|
config_set_int(conf, cfg, overrides->uints.input_mouse_index[i]);
|
|
|
|
RARCH_DBG("[Overrides]: %s = \"%u\"\n", cfg, overrides->uints.input_mouse_index[i]);
|
2020-06-26 18:40:20 +02:00
|
|
|
}
|
|
|
|
|
2021-06-17 17:45:24 +01:00
|
|
|
if (settings->uints.input_joypad_index[i]
|
|
|
|
!= overrides->uints.input_joypad_index[i])
|
2020-06-26 18:40:20 +02:00
|
|
|
{
|
2023-06-18 22:37:01 +02:00
|
|
|
strlcpy(cfg + _len, "_joypad_index", sizeof(cfg) - _len);
|
2021-06-17 17:45:24 +01:00
|
|
|
config_set_int(conf, cfg, overrides->uints.input_joypad_index[i]);
|
2023-01-24 02:42:50 +02:00
|
|
|
RARCH_DBG("[Overrides]: %s = \"%u\"\n", cfg, overrides->uints.input_joypad_index[i]);
|
|
|
|
}
|
|
|
|
|
2023-06-18 22:37:01 +02:00
|
|
|
if (settings->uints.input_analog_dpad_mode[i]
|
|
|
|
!= overrides->uints.input_analog_dpad_mode[i])
|
2023-01-24 02:42:50 +02:00
|
|
|
{
|
2023-06-18 22:37:01 +02:00
|
|
|
strlcpy(cfg + _len, "_analog_dpad_mode", sizeof(cfg) - _len);
|
|
|
|
config_set_int(conf, cfg, overrides->uints.input_analog_dpad_mode[i]);
|
|
|
|
RARCH_DBG("[Overrides]: %s = \"%u\"\n", cfg, overrides->uints.input_analog_dpad_mode[i]);
|
2023-01-24 02:42:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
for (j = 0; j < RARCH_BIND_LIST_END; j++)
|
|
|
|
{
|
|
|
|
const struct retro_keybind *override_bind = &input_override_binds[i][j];
|
|
|
|
const struct retro_keybind *config_bind = &input_config_binds[i][j];
|
|
|
|
|
|
|
|
if ( config_bind->joyaxis != override_bind->joyaxis
|
|
|
|
|| config_bind->joykey != override_bind->joykey
|
|
|
|
|| config_bind->key != override_bind->key
|
|
|
|
|| config_bind->mbutton != override_bind->mbutton
|
|
|
|
)
|
|
|
|
input_config_save_keybinds_user_override(conf, i, j, override_bind);
|
2020-06-26 18:40:20 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-01-24 02:42:50 +02:00
|
|
|
ret = 0;
|
2020-06-26 18:40:20 +02:00
|
|
|
|
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case OVERRIDE_CORE:
|
2023-01-24 02:42:50 +02:00
|
|
|
fill_pathname_join_special_ext(override_path,
|
2022-02-28 12:45:51 +00:00
|
|
|
config_directory, core_name,
|
|
|
|
core_name,
|
|
|
|
FILE_PATH_CONFIG_EXTENSION,
|
2023-01-24 02:42:50 +02:00
|
|
|
sizeof(override_path));
|
2020-06-26 18:40:20 +02:00
|
|
|
break;
|
|
|
|
case OVERRIDE_GAME:
|
2022-07-12 20:44:00 +02:00
|
|
|
game_name = path_basename_nocompression(rarch_path_basename);
|
2023-01-24 02:42:50 +02:00
|
|
|
fill_pathname_join_special_ext(override_path,
|
2022-02-28 12:45:51 +00:00
|
|
|
config_directory, core_name,
|
|
|
|
game_name,
|
|
|
|
FILE_PATH_CONFIG_EXTENSION,
|
2023-01-24 02:42:50 +02:00
|
|
|
sizeof(override_path));
|
2020-06-26 18:40:20 +02:00
|
|
|
break;
|
|
|
|
case OVERRIDE_CONTENT_DIR:
|
2022-02-28 12:45:51 +00:00
|
|
|
fill_pathname_parent_dir_name(content_dir_name,
|
|
|
|
rarch_path_basename, sizeof(content_dir_name));
|
2023-01-24 02:42:50 +02:00
|
|
|
fill_pathname_join_special_ext(override_path,
|
2022-02-28 12:45:51 +00:00
|
|
|
config_directory, core_name,
|
|
|
|
content_dir_name,
|
|
|
|
FILE_PATH_CONFIG_EXTENSION,
|
2023-01-24 02:42:50 +02:00
|
|
|
sizeof(override_path));
|
2020-06-26 18:40:20 +02:00
|
|
|
break;
|
2023-08-22 02:11:48 +03:00
|
|
|
case OVERRIDE_AS:
|
|
|
|
fill_pathname_join_special_ext(override_path,
|
|
|
|
config_directory, core_name,
|
|
|
|
path,
|
|
|
|
FILE_PATH_CONFIG_EXTENSION,
|
|
|
|
sizeof(override_path));
|
|
|
|
break;
|
2020-06-26 18:40:20 +02:00
|
|
|
case OVERRIDE_NONE:
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2023-01-24 02:42:50 +02:00
|
|
|
if (!conf->modified && !remove)
|
|
|
|
ret = -1;
|
|
|
|
|
|
|
|
if (!string_is_empty(override_path))
|
|
|
|
{
|
|
|
|
if (!conf->modified && !remove)
|
|
|
|
if (path_is_valid(override_path))
|
|
|
|
remove = true;
|
|
|
|
|
|
|
|
if ( remove
|
|
|
|
&& path_is_valid(override_path))
|
|
|
|
{
|
|
|
|
if (filestream_delete(override_path) == 0)
|
|
|
|
{
|
|
|
|
ret = -1;
|
|
|
|
RARCH_LOG("[Overrides]: %s: \"%s\".\n",
|
2023-01-29 01:12:08 +02:00
|
|
|
"Deleted", override_path);
|
2023-01-24 02:42:50 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (conf->modified)
|
|
|
|
{
|
|
|
|
ret = config_file_write(conf, override_path, true);
|
2023-01-29 01:12:08 +02:00
|
|
|
|
|
|
|
if (ret)
|
|
|
|
{
|
|
|
|
path_set(RARCH_PATH_CONFIG_OVERRIDE, override_path);
|
|
|
|
RARCH_LOG("[Overrides]: %s: \"%s\".\n",
|
|
|
|
"Saved", override_path);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
RARCH_LOG("[Overrides]: %s: \"%s\".\n",
|
|
|
|
"Failed to save", override_path);
|
|
|
|
}
|
2023-01-24 02:42:50 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
config_file_free(conf);
|
2020-06-26 18:25:12 +02:00
|
|
|
}
|
2016-08-26 01:06:15 -05:00
|
|
|
|
2023-01-24 02:42:50 +02:00
|
|
|
/* Since config_load_file resets binds, restore overrides back to current binds */
|
|
|
|
memcpy(input_config_binds, input_override_binds, sizeof(input_config_binds));
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
if (bool_settings)
|
|
|
|
free(bool_settings);
|
|
|
|
if (bool_overrides)
|
|
|
|
free(bool_overrides);
|
|
|
|
if (int_settings)
|
|
|
|
free(int_settings);
|
|
|
|
if (uint_settings)
|
|
|
|
free(uint_settings);
|
|
|
|
if (size_settings)
|
|
|
|
free(size_settings);
|
|
|
|
if (int_overrides)
|
|
|
|
free(int_overrides);
|
|
|
|
if (uint_overrides)
|
|
|
|
free(uint_overrides);
|
|
|
|
if (float_settings)
|
|
|
|
free(float_settings);
|
|
|
|
if (float_overrides)
|
|
|
|
free(float_overrides);
|
|
|
|
if (array_settings)
|
|
|
|
free(array_settings);
|
|
|
|
if (array_overrides)
|
|
|
|
free(array_overrides);
|
|
|
|
if (path_settings)
|
|
|
|
free(path_settings);
|
|
|
|
if (path_overrides)
|
|
|
|
free(path_overrides);
|
|
|
|
if (size_overrides)
|
|
|
|
free(size_overrides);
|
|
|
|
free(settings);
|
|
|
|
|
|
|
|
return ret;
|
2016-08-25 01:34:51 -05:00
|
|
|
}
|
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/* Replaces currently loaded configuration file with
|
|
|
|
* another one. Will load a dummy core to flush state
|
|
|
|
* properly. */
|
|
|
|
bool config_replace(bool config_replace_save_on_exit, char *path)
|
2016-05-27 16:42:20 +02:00
|
|
|
{
|
2020-06-26 18:40:20 +02:00
|
|
|
content_ctx_info_t content_info = {0};
|
|
|
|
const char *rarch_path_config = path_get(RARCH_PATH_CONFIG);
|
2016-05-27 16:42:20 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
/* If config file to be replaced is the same as the
|
|
|
|
* current config file, exit. */
|
|
|
|
if (string_is_equal(path, rarch_path_config))
|
|
|
|
return false;
|
2016-05-27 16:42:20 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
if (config_replace_save_on_exit && !path_is_empty(RARCH_PATH_CONFIG))
|
|
|
|
config_save_file(rarch_path_config);
|
2020-06-23 22:18:33 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
path_set(RARCH_PATH_CONFIG, path);
|
2020-06-23 22:18:33 +02:00
|
|
|
|
2021-09-28 12:56:10 +02:00
|
|
|
retroarch_ctl(RARCH_CTL_UNSET_BLOCK_CONFIG_READ, NULL);
|
2020-06-23 22:18:33 +02:00
|
|
|
|
2020-09-05 12:44:56 +01:00
|
|
|
/* Load core in new (salamander) config. */
|
2020-06-26 18:40:20 +02:00
|
|
|
path_clear(RARCH_PATH_CORE);
|
|
|
|
|
|
|
|
return task_push_start_dummy_core(&content_info);
|
2020-06-26 18:25:12 +02:00
|
|
|
}
|
2020-06-23 22:18:33 +02:00
|
|
|
|
2020-06-26 18:25:12 +02:00
|
|
|
/**
|
2020-06-26 18:40:20 +02:00
|
|
|
* input_remapping_load_file:
|
|
|
|
* @data : Path to config file.
|
2020-06-26 18:25:12 +02:00
|
|
|
*
|
2020-06-26 18:40:20 +02:00
|
|
|
* Loads a remap file from disk to memory.
|
2020-06-26 18:25:12 +02:00
|
|
|
*
|
2020-06-26 18:40:20 +02:00
|
|
|
* Returns: true (1) if successful, otherwise false (0).
|
2020-06-26 18:25:12 +02:00
|
|
|
**/
|
2020-06-26 18:40:20 +02:00
|
|
|
bool input_remapping_load_file(void *data, const char *path)
|
2020-06-26 18:25:12 +02:00
|
|
|
{
|
2021-04-11 14:36:51 +02:00
|
|
|
unsigned i, j;
|
2021-04-11 14:11:12 +02:00
|
|
|
config_file_t *conf = (config_file_t*)data;
|
2021-11-03 21:22:37 +01:00
|
|
|
settings_t *settings = config_st;
|
2021-11-09 06:03:00 +01:00
|
|
|
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
2021-04-11 14:11:12 +02:00
|
|
|
char key_strings[RARCH_FIRST_CUSTOM_BIND + 8][8] = {
|
|
|
|
"b", "y", "select", "start",
|
|
|
|
"up", "down", "left", "right",
|
|
|
|
"a", "x", "l", "r", "l2", "r2",
|
|
|
|
"l3", "r3", "l_x+", "l_x-", "l_y+", "l_y-", "r_x+", "r_x-", "r_y+", "r_y-" };
|
2020-06-23 22:18:33 +02:00
|
|
|
|
2023-09-03 17:37:00 +02:00
|
|
|
if ( !conf
|
|
|
|
|| string_is_empty(path))
|
2020-06-26 18:40:20 +02:00
|
|
|
return false;
|
|
|
|
|
2021-11-09 06:03:00 +01:00
|
|
|
if (!string_is_empty(runloop_st->name.remapfile))
|
2022-03-16 16:59:07 +00:00
|
|
|
input_remapping_deinit(false);
|
2023-05-12 10:32:06 +03:00
|
|
|
|
|
|
|
input_remapping_set_defaults(false);
|
2021-11-09 06:03:00 +01:00
|
|
|
runloop_st->name.remapfile = strdup(path);
|
2020-06-26 18:40:20 +02:00
|
|
|
|
|
|
|
for (i = 0; i < MAX_USERS; i++)
|
2020-06-26 18:25:12 +02:00
|
|
|
{
|
2022-08-23 08:29:48 +02:00
|
|
|
size_t _len;
|
|
|
|
char prefix[16];
|
2021-04-11 14:03:03 +02:00
|
|
|
char s1[32], s2[32], s3[32];
|
2022-08-27 07:52:31 +02:00
|
|
|
char formatted_number[4];
|
|
|
|
formatted_number[0] = '\0';
|
|
|
|
snprintf(formatted_number, sizeof(formatted_number), "%u", i + 1);
|
2023-06-18 12:06:12 +02:00
|
|
|
_len = strlcpy(prefix, "input_player", sizeof(prefix));
|
|
|
|
strlcpy(prefix + _len, formatted_number, sizeof(prefix) - _len);
|
2022-08-23 08:29:48 +02:00
|
|
|
_len = strlcpy(s1, prefix, sizeof(s1));
|
2023-06-20 16:33:55 +02:00
|
|
|
strlcpy(s1 + _len, "_btn", sizeof(s1) - _len);
|
2022-08-23 08:29:48 +02:00
|
|
|
_len = strlcpy(s2, prefix, sizeof(s2));
|
2023-06-20 16:33:55 +02:00
|
|
|
strlcpy(s2 + _len, "_key", sizeof(s2) - _len);
|
2022-08-23 08:29:48 +02:00
|
|
|
_len = strlcpy(s3, prefix, sizeof(s3));
|
2023-06-20 16:33:55 +02:00
|
|
|
strlcpy(s3 + _len, "_stk", sizeof(s3) - _len);
|
2020-06-26 18:40:20 +02:00
|
|
|
|
|
|
|
for (j = 0; j < RARCH_FIRST_CUSTOM_BIND + 8; j++)
|
|
|
|
{
|
2021-04-11 14:18:14 +02:00
|
|
|
const char *key_string = key_strings[j];
|
2022-01-09 05:19:03 -05:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
if (j < RARCH_FIRST_CUSTOM_BIND)
|
|
|
|
{
|
|
|
|
int btn_remap = -1;
|
|
|
|
int key_remap = -1;
|
2021-04-11 14:36:51 +02:00
|
|
|
char btn_ident[128];
|
|
|
|
char key_ident[128];
|
2022-01-09 05:19:03 -05:00
|
|
|
|
2021-04-11 14:36:51 +02:00
|
|
|
fill_pathname_join_delim(btn_ident, s1,
|
|
|
|
key_string, '_', sizeof(btn_ident));
|
|
|
|
fill_pathname_join_delim(key_ident, s2,
|
|
|
|
key_string, '_', sizeof(key_ident));
|
2020-06-26 18:40:20 +02:00
|
|
|
|
2021-04-11 14:36:51 +02:00
|
|
|
if (config_get_int(conf, btn_ident, &btn_remap))
|
2020-06-26 18:40:20 +02:00
|
|
|
{
|
|
|
|
if (btn_remap == -1)
|
2021-04-11 14:11:12 +02:00
|
|
|
btn_remap = RARCH_UNMAPPED;
|
2020-06-26 18:40:20 +02:00
|
|
|
|
|
|
|
configuration_set_uint(settings,
|
|
|
|
settings->uints.input_remap_ids[i][j], btn_remap);
|
|
|
|
}
|
|
|
|
|
2021-04-11 14:36:51 +02:00
|
|
|
if (!config_get_int(conf, key_ident, &key_remap))
|
2021-04-11 14:11:12 +02:00
|
|
|
key_remap = RETROK_UNKNOWN;
|
2020-06-26 18:40:20 +02:00
|
|
|
|
|
|
|
configuration_set_uint(settings,
|
|
|
|
settings->uints.input_keymapper_ids[i][j], key_remap);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-08-12 16:01:48 +02:00
|
|
|
char stk_ident[256];
|
2021-06-11 00:00:33 +09:00
|
|
|
char key_ident[128];
|
2020-06-26 18:40:20 +02:00
|
|
|
int stk_remap = -1;
|
2021-06-11 00:00:33 +09:00
|
|
|
int key_remap = -1;
|
2022-01-09 05:19:03 -05:00
|
|
|
|
2021-04-11 14:36:51 +02:00
|
|
|
fill_pathname_join_delim(stk_ident, s3,
|
2022-03-21 10:04:44 +00:00
|
|
|
key_string, '_', sizeof(stk_ident));
|
2020-06-26 18:40:20 +02:00
|
|
|
|
2021-04-11 14:36:51 +02:00
|
|
|
if (config_get_int(conf, stk_ident, &stk_remap))
|
2020-06-26 18:40:20 +02:00
|
|
|
{
|
|
|
|
if (stk_remap == -1)
|
2021-04-11 14:11:12 +02:00
|
|
|
stk_remap = RARCH_UNMAPPED;
|
2020-06-23 22:18:33 +02:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
configuration_set_uint(settings,
|
|
|
|
settings->uints.input_remap_ids[i][j], stk_remap);
|
|
|
|
}
|
2021-06-11 00:00:33 +09:00
|
|
|
|
|
|
|
fill_pathname_join_delim(key_ident, s2,
|
|
|
|
key_string, '_', sizeof(key_ident));
|
|
|
|
|
|
|
|
if (!config_get_int(conf, key_ident, &key_remap))
|
|
|
|
key_remap = RETROK_UNKNOWN;
|
|
|
|
|
|
|
|
configuration_set_uint(settings,
|
|
|
|
settings->uints.input_keymapper_ids[i][j], key_remap);
|
2020-06-26 18:40:20 +02:00
|
|
|
}
|
|
|
|
}
|
2020-06-23 22:18:33 +02:00
|
|
|
|
2023-06-18 12:06:12 +02:00
|
|
|
_len = strlcpy(s1, prefix, sizeof(s1));
|
|
|
|
strlcpy(s1 + _len, "_analog_dpad_mode", sizeof(s1) - _len);
|
2020-06-26 18:40:20 +02:00
|
|
|
CONFIG_GET_INT_BASE(conf, settings, uints.input_analog_dpad_mode[i], s1);
|
2020-06-23 22:18:33 +02:00
|
|
|
|
2023-06-18 12:06:12 +02:00
|
|
|
_len = strlcpy(s1, "input_libretro_device_p", sizeof(s1));
|
|
|
|
strlcpy(s1 + _len, formatted_number, sizeof(s1) - _len);
|
2020-06-26 18:40:20 +02:00
|
|
|
CONFIG_GET_INT_BASE(conf, settings, uints.input_libretro_device[i], s1);
|
2021-06-17 17:45:24 +01:00
|
|
|
|
2023-06-18 12:06:12 +02:00
|
|
|
_len = strlcpy(s1, "input_remap_port_p", sizeof(s1));
|
|
|
|
strlcpy(s1 + _len, formatted_number, sizeof(s1) - _len);
|
2021-06-17 17:45:24 +01:00
|
|
|
CONFIG_GET_INT_BASE(conf, settings, uints.input_remap_ports[i], s1);
|
2020-06-23 22:18:33 +02:00
|
|
|
}
|
|
|
|
|
2021-06-17 17:45:24 +01:00
|
|
|
input_remapping_update_port_map();
|
|
|
|
|
|
|
|
/* Whenever a remap file is loaded, subsequent
|
|
|
|
* changes to global remap-related parameters
|
|
|
|
* must be reset at the next core deinitialisation */
|
2022-11-23 19:54:15 +01:00
|
|
|
input_state_get_ptr()->flags |= INP_FLAG_REMAPPING_CACHE_ACTIVE;
|
2021-06-17 17:45:24 +01:00
|
|
|
|
2020-06-26 18:40:20 +02:00
|
|
|
return true;
|
2020-06-26 18:25:12 +02:00
|
|
|
}
|
2020-06-23 22:18:33 +02:00
|
|
|
|
2020-06-26 18:25:12 +02:00
|
|
|
/**
|
2020-06-26 18:40:20 +02:00
|
|
|
* input_remapping_save_file:
|
2022-03-16 16:59:07 +00:00
|
|
|
* @path : Path to remapping file.
|
2020-06-26 18:25:12 +02:00
|
|
|
*
|
2020-06-26 18:40:20 +02:00
|
|
|
* Saves remapping values to file.
|
2020-06-26 18:25:12 +02:00
|
|
|
*
|
2020-06-26 18:40:20 +02:00
|
|
|
* Returns: true (1) if successful, otherwise false (0).
|
2020-06-26 18:25:12 +02:00
|
|
|
**/
|
2020-06-26 18:40:20 +02:00
|
|
|
bool input_remapping_save_file(const char *path)
|
2020-06-26 18:25:12 +02:00
|
|
|
{
|
2023-07-15 09:52:47 +02:00
|
|
|
size_t _len;
|
2020-06-26 18:40:20 +02:00
|
|
|
bool ret;
|
2021-04-11 14:36:51 +02:00
|
|
|
unsigned i, j;
|
2022-03-16 16:59:07 +00:00
|
|
|
char remap_file_dir[PATH_MAX_LENGTH];
|
2023-08-22 02:11:48 +03:00
|
|
|
char key_strings[RARCH_FIRST_CUSTOM_BIND + 8][8] =
|
|
|
|
{
|
|
|
|
"b", "y", "select", "start",
|
|
|
|
"up", "down", "left", "right",
|
|
|
|
"a", "x", "l", "r",
|
|
|
|
"l2", "r2", "l3", "r3",
|
|
|
|
"l_x+", "l_x-", "l_y+", "l_y-",
|
|
|
|
"r_x+", "r_x-", "r_y+", "r_y-"
|
|
|
|
};
|
2022-03-16 16:59:07 +00:00
|
|
|
config_file_t *conf = NULL;
|
|
|
|
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
|
|
|
settings_t *settings = config_st;
|
|
|
|
unsigned max_users = settings->uints.input_max_users;
|
2020-06-23 22:18:33 +02:00
|
|
|
|
2022-07-07 10:33:31 +02:00
|
|
|
if (string_is_empty(path))
|
2022-03-16 16:59:07 +00:00
|
|
|
return false;
|
|
|
|
|
|
|
|
/* Create output directory, if required */
|
2023-07-15 09:52:47 +02:00
|
|
|
_len = strlcpy(remap_file_dir, path, sizeof(remap_file_dir));
|
|
|
|
path_parent_dir(remap_file_dir, _len);
|
2020-06-26 18:40:20 +02:00
|
|
|
|
2023-07-15 09:52:47 +02:00
|
|
|
if ( !string_is_empty(remap_file_dir)
|
|
|
|
&& !path_is_directory(remap_file_dir)
|
|
|
|
&& !path_mkdir(remap_file_dir))
|
2022-03-16 16:59:07 +00:00
|
|
|
return false;
|
|
|
|
|
|
|
|
/* Attempt to load file */
|
2022-07-07 10:33:31 +02:00
|
|
|
if (!(conf = config_file_new_alloc()))
|
|
|
|
return false;
|
2020-06-23 22:18:33 +02:00
|
|
|
|
2021-06-17 17:45:24 +01:00
|
|
|
for (i = 0; i < MAX_USERS; i++)
|
2020-06-26 18:40:20 +02:00
|
|
|
{
|
2022-08-23 08:29:48 +02:00
|
|
|
size_t _len;
|
2021-06-17 17:45:24 +01:00
|
|
|
bool skip_port = true;
|
2022-08-27 07:52:31 +02:00
|
|
|
char formatted_number[4];
|
2022-08-23 08:29:48 +02:00
|
|
|
char prefix[16];
|
2021-06-17 17:45:24 +01:00
|
|
|
char s1[32];
|
|
|
|
char s2[32];
|
|
|
|
char s3[32];
|
2020-06-23 22:18:33 +02:00
|
|
|
|
2022-08-27 07:59:22 +02:00
|
|
|
formatted_number[0] = '\0';
|
2020-06-23 22:18:33 +02:00
|
|
|
|
2021-06-17 17:45:24 +01:00
|
|
|
/* We must include all mapped ports + all those
|
|
|
|
* with an index less than max_users */
|
|
|
|
if (i < max_users)
|
|
|
|
skip_port = false;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Check whether current port is mapped
|
|
|
|
* to an input device */
|
|
|
|
for (j = 0; j < max_users; j++)
|
|
|
|
{
|
|
|
|
if (i == settings->uints.input_remap_ports[j])
|
|
|
|
{
|
|
|
|
skip_port = false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (skip_port)
|
|
|
|
continue;
|
|
|
|
|
2022-08-27 07:52:31 +02:00
|
|
|
snprintf(formatted_number, sizeof(formatted_number), "%u", i + 1);
|
2023-06-18 12:06:12 +02:00
|
|
|
_len = strlcpy(prefix, "input_player", sizeof(prefix));
|
|
|
|
strlcpy(prefix + _len, formatted_number, sizeof(prefix) - _len);
|
2022-08-23 08:29:48 +02:00
|
|
|
_len = strlcpy(s1, prefix, sizeof(s1));
|
2023-06-20 16:33:55 +02:00
|
|
|
strlcpy(s1 + _len, "_btn", sizeof(s1) - _len);
|
2022-08-23 08:29:48 +02:00
|
|
|
_len = strlcpy(s2, prefix, sizeof(s2));
|
2023-06-20 16:33:55 +02:00
|
|
|
strlcpy(s2 + _len, "_key", sizeof(s2) - _len);
|
2022-08-23 08:29:48 +02:00
|
|
|
_len = strlcpy(s3, prefix, sizeof(s3));
|
2023-06-20 16:33:55 +02:00
|
|
|
strlcpy(s3 + _len, "_stk", sizeof(s3) - _len);
|
2020-06-26 18:25:12 +02:00
|
|
|
|
2021-04-11 18:16:18 +02:00
|
|
|
for (j = 0; j < RARCH_FIRST_CUSTOM_BIND; j++)
|
2020-06-26 18:40:20 +02:00
|
|
|
{
|
2021-04-11 18:16:18 +02:00
|
|
|
char btn_ident[128];
|
2022-03-16 22:10:17 +02:00
|
|
|
char key_ident[128];
|
|
|
|
const char *key_string = key_strings[j];
|
2021-04-11 14:18:14 +02:00
|
|
|
unsigned remap_id = settings->uints.input_remap_ids[i][j];
|
|
|
|
unsigned keymap_id = settings->uints.input_keymapper_ids[i][j];
|
2022-03-16 22:10:17 +02:00
|
|
|
|
2021-04-11 18:16:18 +02:00
|
|
|
fill_pathname_join_delim(btn_ident, s1,
|
2021-04-11 14:36:51 +02:00
|
|
|
key_string, '_', sizeof(btn_ident));
|
2022-03-16 22:10:17 +02:00
|
|
|
fill_pathname_join_delim(key_ident, s2,
|
|
|
|
key_string, '_', sizeof(key_ident));
|
2020-06-23 22:18:33 +02:00
|
|
|
|
2022-03-16 22:10:17 +02:00
|
|
|
/* Only save modified button values */
|
2021-04-11 18:16:18 +02:00
|
|
|
if (remap_id == j)
|
|
|
|
config_unset(conf, btn_ident);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (remap_id == RARCH_UNMAPPED)
|
2021-04-11 14:36:51 +02:00
|
|
|
config_set_int(conf, btn_ident, -1);
|
2020-06-26 18:40:20 +02:00
|
|
|
else
|
2021-04-11 18:16:18 +02:00
|
|
|
config_set_int(conf, btn_ident,
|
|
|
|
settings->uints.input_remap_ids[i][j]);
|
|
|
|
}
|
2020-06-26 18:40:20 +02:00
|
|
|
|
2022-03-16 22:10:17 +02:00
|
|
|
/* Only save non-empty keymapper values */
|
|
|
|
if (keymap_id == RETROK_UNKNOWN)
|
|
|
|
config_unset(conf, key_ident);
|
|
|
|
else
|
2021-04-11 18:16:18 +02:00
|
|
|
config_set_int(conf, key_ident,
|
2020-06-26 18:40:20 +02:00
|
|
|
settings->uints.input_keymapper_ids[i][j]);
|
2021-04-11 18:16:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
for (j = RARCH_FIRST_CUSTOM_BIND; j < (RARCH_FIRST_CUSTOM_BIND + 8); j++)
|
|
|
|
{
|
|
|
|
char stk_ident[128];
|
2022-03-16 22:10:17 +02:00
|
|
|
char key_ident[128];
|
|
|
|
const char *key_string = key_strings[j];
|
2021-04-11 18:16:18 +02:00
|
|
|
unsigned remap_id = settings->uints.input_remap_ids[i][j];
|
2021-06-11 00:00:33 +09:00
|
|
|
unsigned keymap_id = settings->uints.input_keymapper_ids[i][j];
|
2022-03-16 22:10:17 +02:00
|
|
|
|
2021-04-11 18:16:18 +02:00
|
|
|
fill_pathname_join_delim(stk_ident, s3,
|
|
|
|
key_string, '_', sizeof(stk_ident));
|
2022-03-16 22:10:17 +02:00
|
|
|
fill_pathname_join_delim(key_ident, s2,
|
|
|
|
key_string, '_', sizeof(key_ident));
|
2021-04-11 18:16:18 +02:00
|
|
|
|
2022-03-16 22:10:17 +02:00
|
|
|
/* Only save modified button values */
|
2021-04-11 18:16:18 +02:00
|
|
|
if (remap_id == j)
|
|
|
|
config_unset(conf, stk_ident);
|
2020-06-26 18:40:20 +02:00
|
|
|
else
|
|
|
|
{
|
2021-04-11 18:16:18 +02:00
|
|
|
if (remap_id == RARCH_UNMAPPED)
|
2022-03-16 22:10:17 +02:00
|
|
|
config_set_int(conf, stk_ident, -1);
|
2020-06-26 18:40:20 +02:00
|
|
|
else
|
2021-04-11 18:16:18 +02:00
|
|
|
config_set_int(conf, stk_ident,
|
|
|
|
settings->uints.input_remap_ids[i][j]);
|
2020-06-26 18:40:20 +02:00
|
|
|
}
|
2021-06-11 00:00:33 +09:00
|
|
|
|
2022-03-16 22:10:17 +02:00
|
|
|
/* Only save non-empty keymapper values */
|
|
|
|
if (keymap_id == RETROK_UNKNOWN)
|
|
|
|
config_unset(conf, key_ident);
|
|
|
|
else
|
2021-06-11 00:00:33 +09:00
|
|
|
config_set_int(conf, key_ident,
|
|
|
|
settings->uints.input_keymapper_ids[i][j]);
|
2020-06-26 18:40:20 +02:00
|
|
|
}
|
|
|
|
|
2023-06-18 12:06:12 +02:00
|
|
|
_len = strlcpy(s1, "input_libretro_device_p", sizeof(s1));
|
|
|
|
strlcpy(s1 + _len, formatted_number, sizeof(s1) - _len);
|
2020-06-26 18:40:20 +02:00
|
|
|
config_set_int(conf, s1, input_config_get_device(i));
|
2021-06-17 17:45:24 +01:00
|
|
|
|
2023-06-18 12:06:12 +02:00
|
|
|
_len = strlcpy(s1, prefix, sizeof(s1));
|
|
|
|
strlcpy(s1 + _len, "_analog_dpad_mode", sizeof(s1) - _len);
|
2020-06-26 18:40:20 +02:00
|
|
|
config_set_int(conf, s1, settings->uints.input_analog_dpad_mode[i]);
|
2021-06-17 17:45:24 +01:00
|
|
|
|
2023-06-18 12:06:12 +02:00
|
|
|
_len = strlcpy(s1, "input_remap_port_p", sizeof(s1));
|
|
|
|
strlcpy(s1 + _len, formatted_number, sizeof(s1) - _len);
|
2021-06-17 17:45:24 +01:00
|
|
|
config_set_int(conf, s1, settings->uints.input_remap_ports[i]);
|
2020-06-23 22:18:33 +02:00
|
|
|
}
|
|
|
|
|
2022-07-07 10:33:31 +02:00
|
|
|
ret = config_file_write(conf, path, true);
|
2020-06-26 18:40:20 +02:00
|
|
|
config_file_free(conf);
|
|
|
|
|
2022-03-16 16:59:07 +00:00
|
|
|
/* Cache remap file path
|
|
|
|
* > Must guard against the case where
|
|
|
|
* runloop_st->name.remapfile itself
|
|
|
|
* is passed to this function... */
|
2022-07-07 10:33:31 +02:00
|
|
|
if (runloop_st->name.remapfile != path)
|
2022-03-16 16:59:07 +00:00
|
|
|
{
|
|
|
|
if (runloop_st->name.remapfile)
|
|
|
|
free(runloop_st->name.remapfile);
|
2022-07-07 10:33:31 +02:00
|
|
|
runloop_st->name.remapfile = strdup(path);
|
2022-03-16 16:59:07 +00:00
|
|
|
}
|
2020-06-23 22:18:33 +02:00
|
|
|
|
2022-03-16 16:59:07 +00:00
|
|
|
return ret;
|
2020-06-23 22:18:33 +02:00
|
|
|
}
|
2020-06-26 18:40:20 +02:00
|
|
|
#endif
|
2020-09-05 12:44:56 +01:00
|
|
|
|
|
|
|
#if !defined(HAVE_DYNAMIC)
|
|
|
|
/* Salamander config file contains a single
|
|
|
|
* entry (libretro_path), which is linked to
|
|
|
|
* RARCH_PATH_CORE
|
|
|
|
* > Used to select which core to load
|
|
|
|
* when launching a salamander build */
|
|
|
|
|
|
|
|
static bool config_file_salamander_get_path(char *s, size_t len)
|
|
|
|
{
|
|
|
|
const char *rarch_config_path = g_defaults.path_config;
|
|
|
|
|
|
|
|
if (!string_is_empty(rarch_config_path))
|
|
|
|
fill_pathname_resolve_relative(s,
|
|
|
|
rarch_config_path,
|
|
|
|
FILE_PATH_SALAMANDER_CONFIG,
|
|
|
|
len);
|
|
|
|
else
|
2022-08-23 15:04:47 +02:00
|
|
|
strlcpy(s, FILE_PATH_SALAMANDER_CONFIG, len);
|
2020-09-05 12:44:56 +01:00
|
|
|
|
|
|
|
return !string_is_empty(s);
|
|
|
|
}
|
|
|
|
|
|
|
|
void config_load_file_salamander(void)
|
|
|
|
{
|
|
|
|
config_file_t *config = NULL;
|
|
|
|
char config_path[PATH_MAX_LENGTH];
|
|
|
|
char libretro_path[PATH_MAX_LENGTH];
|
|
|
|
|
|
|
|
config_path[0] = '\0';
|
|
|
|
libretro_path[0] = '\0';
|
|
|
|
|
|
|
|
/* Get config file path */
|
|
|
|
if (!config_file_salamander_get_path(
|
|
|
|
config_path, sizeof(config_path)))
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* Open config file */
|
2022-07-23 10:44:41 +02:00
|
|
|
if (!(config = config_file_new_from_path_to_string(config_path)))
|
2020-09-05 12:44:56 +01:00
|
|
|
return;
|
|
|
|
|
|
|
|
/* Read 'libretro_path' value and update
|
|
|
|
* RARCH_PATH_CORE */
|
2021-02-18 18:33:47 +02:00
|
|
|
RARCH_LOG("[Config]: Loading salamander config from: \"%s\".\n",
|
2020-09-05 12:44:56 +01:00
|
|
|
config_path);
|
|
|
|
|
|
|
|
if (config_get_path(config, "libretro_path",
|
|
|
|
libretro_path, sizeof(libretro_path)) &&
|
|
|
|
!string_is_empty(libretro_path) &&
|
|
|
|
!string_is_equal(libretro_path, "builtin"))
|
|
|
|
path_set(RARCH_PATH_CORE, libretro_path);
|
|
|
|
|
|
|
|
config_file_free(config);
|
|
|
|
}
|
|
|
|
|
|
|
|
void config_save_file_salamander(void)
|
|
|
|
{
|
2022-07-07 10:45:15 +02:00
|
|
|
config_file_t *conf = NULL;
|
2020-09-05 12:44:56 +01:00
|
|
|
const char *libretro_path = path_get(RARCH_PATH_CORE);
|
|
|
|
bool success = false;
|
|
|
|
char config_path[PATH_MAX_LENGTH];
|
|
|
|
|
|
|
|
config_path[0] = '\0';
|
|
|
|
|
2023-09-03 17:37:00 +02:00
|
|
|
if ( string_is_empty(libretro_path)
|
|
|
|
|| string_is_equal(libretro_path, "builtin"))
|
2020-09-05 12:44:56 +01:00
|
|
|
return;
|
|
|
|
|
|
|
|
/* Get config file path */
|
|
|
|
if (!config_file_salamander_get_path(
|
|
|
|
config_path, sizeof(config_path)))
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* Open config file */
|
2022-07-07 10:45:15 +02:00
|
|
|
if ( !(conf = config_file_new_from_path_to_string(config_path))
|
|
|
|
&& !(conf = config_file_new_alloc())
|
|
|
|
)
|
2020-09-05 12:44:56 +01:00
|
|
|
goto end;
|
|
|
|
|
|
|
|
/* Update config file */
|
2022-07-07 10:45:15 +02:00
|
|
|
config_set_path(conf, "libretro_path", libretro_path);
|
2020-09-05 12:44:56 +01:00
|
|
|
|
|
|
|
/* Save config file
|
|
|
|
* > Only one entry - no need to sort */
|
2022-07-07 10:45:15 +02:00
|
|
|
success = config_file_write(conf, config_path, false);
|
2020-09-05 12:44:56 +01:00
|
|
|
|
|
|
|
end:
|
|
|
|
if (success)
|
2021-02-18 18:33:47 +02:00
|
|
|
RARCH_LOG("[Config]: Saving salamander config to: \"%s\".\n",
|
2020-09-05 12:44:56 +01:00
|
|
|
config_path);
|
|
|
|
else
|
2021-02-18 18:33:47 +02:00
|
|
|
RARCH_ERR("[Config]: Failed to create new salamander config file in: \"%s\".\n",
|
2020-09-05 12:44:56 +01:00
|
|
|
config_path);
|
|
|
|
|
2022-07-07 10:45:15 +02:00
|
|
|
if (conf)
|
|
|
|
config_file_free(conf);
|
2020-09-05 12:44:56 +01:00
|
|
|
}
|
|
|
|
#endif
|
2021-08-30 16:52:05 +02:00
|
|
|
|
|
|
|
bool input_config_bind_map_get_valid(unsigned bind_index)
|
|
|
|
{
|
|
|
|
const struct input_bind_map *keybind =
|
|
|
|
(const struct input_bind_map*)INPUT_CONFIG_BIND_MAP_GET(bind_index);
|
|
|
|
if (!keybind)
|
|
|
|
return false;
|
|
|
|
return keybind->valid;
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned input_config_bind_map_get_meta(unsigned bind_index)
|
|
|
|
{
|
|
|
|
const struct input_bind_map *keybind =
|
|
|
|
(const struct input_bind_map*)INPUT_CONFIG_BIND_MAP_GET(bind_index);
|
|
|
|
if (!keybind)
|
|
|
|
return 0;
|
|
|
|
return keybind->meta;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *input_config_bind_map_get_base(unsigned bind_index)
|
|
|
|
{
|
|
|
|
const struct input_bind_map *keybind =
|
|
|
|
(const struct input_bind_map*)INPUT_CONFIG_BIND_MAP_GET(bind_index);
|
|
|
|
if (!keybind)
|
|
|
|
return NULL;
|
|
|
|
return keybind->base;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *input_config_bind_map_get_desc(unsigned bind_index)
|
|
|
|
{
|
|
|
|
const struct input_bind_map *keybind =
|
|
|
|
(const struct input_bind_map*)INPUT_CONFIG_BIND_MAP_GET(bind_index);
|
|
|
|
if (!keybind)
|
|
|
|
return NULL;
|
|
|
|
return msg_hash_to_str(keybind->desc);
|
|
|
|
}
|
|
|
|
|
|
|
|
uint8_t input_config_bind_map_get_retro_key(unsigned bind_index)
|
|
|
|
{
|
|
|
|
const struct input_bind_map *keybind =
|
|
|
|
(const struct input_bind_map*)INPUT_CONFIG_BIND_MAP_GET(bind_index);
|
|
|
|
if (!keybind)
|
|
|
|
return 0;
|
|
|
|
return keybind->retro_key;
|
|
|
|
}
|
|
|
|
|
|
|
|
void input_config_reset_autoconfig_binds(unsigned port)
|
|
|
|
{
|
|
|
|
unsigned i;
|
|
|
|
|
|
|
|
if (port >= MAX_USERS)
|
|
|
|
return;
|
|
|
|
|
|
|
|
for (i = 0; i < RARCH_BIND_LIST_END; i++)
|
|
|
|
{
|
|
|
|
input_autoconf_binds[port][i].joykey = NO_BTN;
|
|
|
|
input_autoconf_binds[port][i].joyaxis = AXIS_NONE;
|
|
|
|
|
|
|
|
if (input_autoconf_binds[port][i].joykey_label)
|
|
|
|
{
|
|
|
|
free(input_autoconf_binds[port][i].joykey_label);
|
|
|
|
input_autoconf_binds[port][i].joykey_label = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (input_autoconf_binds[port][i].joyaxis_label)
|
|
|
|
{
|
|
|
|
free(input_autoconf_binds[port][i].joyaxis_label);
|
|
|
|
input_autoconf_binds[port][i].joyaxis_label = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void input_config_set_autoconfig_binds(unsigned port, void *data)
|
|
|
|
{
|
|
|
|
unsigned i;
|
|
|
|
config_file_t *config = (config_file_t*)data;
|
|
|
|
struct retro_keybind *binds = NULL;
|
|
|
|
|
2023-09-03 17:37:00 +02:00
|
|
|
if ( (port >= MAX_USERS)
|
|
|
|
|| !config)
|
2021-08-30 16:52:05 +02:00
|
|
|
return;
|
|
|
|
|
|
|
|
binds = input_autoconf_binds[port];
|
|
|
|
|
|
|
|
for (i = 0; i < RARCH_BIND_LIST_END; i++)
|
|
|
|
{
|
|
|
|
const struct input_bind_map *keybind =
|
|
|
|
(const struct input_bind_map*)INPUT_CONFIG_BIND_MAP_GET(i);
|
|
|
|
if (keybind)
|
|
|
|
{
|
|
|
|
char str[256];
|
|
|
|
const char *base = keybind->base;
|
|
|
|
fill_pathname_join_delim(str, "input", base, '_', sizeof(str));
|
|
|
|
|
|
|
|
input_config_parse_joy_button(str, config, "input", base, &binds[i]);
|
|
|
|
input_config_parse_joy_axis (str, config, "input", base, &binds[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void input_config_parse_mouse_button(
|
|
|
|
char *s,
|
|
|
|
void *conf_data, const char *prefix,
|
|
|
|
const char *btn, void *bind_data)
|
|
|
|
{
|
|
|
|
int val;
|
|
|
|
char tmp[64];
|
|
|
|
char key[64];
|
|
|
|
config_file_t *conf = (config_file_t*)conf_data;
|
|
|
|
struct retro_keybind *bind = (struct retro_keybind*)bind_data;
|
|
|
|
|
2022-07-23 10:44:41 +02:00
|
|
|
tmp[0] = '\0';
|
2021-08-30 16:52:05 +02:00
|
|
|
|
|
|
|
fill_pathname_join_delim(key, s, "mbtn", '_', sizeof(key));
|
|
|
|
|
|
|
|
if (config_get_array(conf, key, tmp, sizeof(tmp)))
|
|
|
|
{
|
|
|
|
bind->mbutton = NO_BTN;
|
|
|
|
|
|
|
|
if (tmp[0]=='w')
|
|
|
|
{
|
|
|
|
switch (tmp[1])
|
|
|
|
{
|
|
|
|
case 'u':
|
|
|
|
bind->mbutton = RETRO_DEVICE_ID_MOUSE_WHEELUP;
|
|
|
|
break;
|
|
|
|
case 'd':
|
|
|
|
bind->mbutton = RETRO_DEVICE_ID_MOUSE_WHEELDOWN;
|
|
|
|
break;
|
|
|
|
case 'h':
|
|
|
|
switch (tmp[2])
|
|
|
|
{
|
|
|
|
case 'u':
|
|
|
|
bind->mbutton = RETRO_DEVICE_ID_MOUSE_HORIZ_WHEELUP;
|
|
|
|
break;
|
|
|
|
case 'd':
|
|
|
|
bind->mbutton = RETRO_DEVICE_ID_MOUSE_HORIZ_WHEELDOWN;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
val = atoi(tmp);
|
|
|
|
switch (val)
|
|
|
|
{
|
|
|
|
case 1:
|
|
|
|
bind->mbutton = RETRO_DEVICE_ID_MOUSE_LEFT;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
bind->mbutton = RETRO_DEVICE_ID_MOUSE_RIGHT;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
bind->mbutton = RETRO_DEVICE_ID_MOUSE_MIDDLE;
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
bind->mbutton = RETRO_DEVICE_ID_MOUSE_BUTTON_4;
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
bind->mbutton = RETRO_DEVICE_ID_MOUSE_BUTTON_5;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void input_config_parse_joy_axis(
|
|
|
|
char *s,
|
|
|
|
void *conf_data, const char *prefix,
|
|
|
|
const char *axis, void *bind_data)
|
|
|
|
{
|
|
|
|
char tmp[64];
|
|
|
|
char key[64];
|
|
|
|
char key_label[64];
|
|
|
|
config_file_t *conf = (config_file_t*)conf_data;
|
|
|
|
struct retro_keybind *bind = (struct retro_keybind*)bind_data;
|
|
|
|
struct config_entry_list *tmp_a = NULL;
|
|
|
|
|
2022-07-23 10:44:41 +02:00
|
|
|
tmp[0] = '\0';
|
2021-08-30 16:52:05 +02:00
|
|
|
|
|
|
|
fill_pathname_join_delim(key, s,
|
|
|
|
"axis", '_', sizeof(key));
|
|
|
|
fill_pathname_join_delim(key_label, s,
|
|
|
|
"axis_label", '_', sizeof(key_label));
|
|
|
|
|
|
|
|
if (config_get_array(conf, key, tmp, sizeof(tmp)))
|
|
|
|
{
|
|
|
|
if ( tmp[0] == 'n'
|
|
|
|
&& tmp[1] == 'u'
|
|
|
|
&& tmp[2] == 'l'
|
|
|
|
&& tmp[3] == '\0'
|
|
|
|
)
|
|
|
|
bind->joyaxis = AXIS_NONE;
|
2023-09-03 17:37:00 +02:00
|
|
|
else if
|
|
|
|
( tmp[0] != '\0'
|
2022-07-20 17:22:57 +02:00
|
|
|
&& tmp[1] != '\0'
|
2023-09-03 17:37:00 +02:00
|
|
|
&& (*tmp == '+'
|
2022-07-20 17:22:57 +02:00
|
|
|
|| *tmp == '-'))
|
2021-08-30 16:52:05 +02:00
|
|
|
{
|
|
|
|
int i_axis = (int)strtol(tmp + 1, NULL, 0);
|
|
|
|
if (*tmp == '+')
|
|
|
|
bind->joyaxis = AXIS_POS(i_axis);
|
|
|
|
else
|
|
|
|
bind->joyaxis = AXIS_NEG(i_axis);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Ensure that D-pad emulation doesn't screw this over. */
|
|
|
|
bind->orig_joyaxis = bind->joyaxis;
|
|
|
|
}
|
|
|
|
|
|
|
|
tmp_a = config_get_entry(conf, key_label);
|
|
|
|
|
|
|
|
if (tmp_a && (!string_is_empty(tmp_a->value)))
|
|
|
|
{
|
|
|
|
if (bind->joyaxis_label &&
|
|
|
|
!string_is_empty(bind->joyaxis_label))
|
|
|
|
free(bind->joyaxis_label);
|
|
|
|
bind->joyaxis_label = strdup(tmp_a->value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static uint16_t input_config_parse_hat(const char *dir)
|
|
|
|
{
|
|
|
|
if ( dir[0] == 'u'
|
|
|
|
&& dir[1] == 'p'
|
|
|
|
&& dir[2] == '\0'
|
|
|
|
)
|
|
|
|
return HAT_UP_MASK;
|
|
|
|
else if (
|
|
|
|
dir[0] == 'd'
|
|
|
|
&& dir[1] == 'o'
|
|
|
|
&& dir[2] == 'w'
|
|
|
|
&& dir[3] == 'n'
|
|
|
|
&& dir[4] == '\0'
|
|
|
|
)
|
|
|
|
return HAT_DOWN_MASK;
|
|
|
|
else if (
|
|
|
|
dir[0] == 'l'
|
|
|
|
&& dir[1] == 'e'
|
|
|
|
&& dir[2] == 'f'
|
|
|
|
&& dir[3] == 't'
|
|
|
|
&& dir[4] == '\0'
|
|
|
|
)
|
|
|
|
return HAT_LEFT_MASK;
|
|
|
|
else if (
|
|
|
|
dir[0] == 'r'
|
|
|
|
&& dir[1] == 'i'
|
|
|
|
&& dir[2] == 'g'
|
|
|
|
&& dir[3] == 'h'
|
|
|
|
&& dir[4] == 't'
|
|
|
|
&& dir[5] == '\0'
|
|
|
|
)
|
|
|
|
return HAT_RIGHT_MASK;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void input_config_parse_joy_button(
|
|
|
|
char *s,
|
|
|
|
void *data, const char *prefix,
|
|
|
|
const char *btn, void *bind_data)
|
|
|
|
{
|
|
|
|
char tmp[64];
|
|
|
|
char key[64];
|
|
|
|
char key_label[64];
|
|
|
|
config_file_t *conf = (config_file_t*)data;
|
|
|
|
struct retro_keybind *bind = (struct retro_keybind*)bind_data;
|
|
|
|
struct config_entry_list *tmp_a = NULL;
|
|
|
|
|
2022-07-23 10:44:41 +02:00
|
|
|
tmp[0] = '\0';
|
2021-08-30 16:52:05 +02:00
|
|
|
|
|
|
|
fill_pathname_join_delim(key, s,
|
|
|
|
"btn", '_', sizeof(key));
|
|
|
|
fill_pathname_join_delim(key_label, s,
|
|
|
|
"btn_label", '_', sizeof(key_label));
|
|
|
|
|
|
|
|
if (config_get_array(conf, key, tmp, sizeof(tmp)))
|
|
|
|
{
|
|
|
|
btn = tmp;
|
|
|
|
if ( btn[0] == 'n'
|
|
|
|
&& btn[1] == 'u'
|
|
|
|
&& btn[2] == 'l'
|
|
|
|
&& btn[3] == '\0'
|
|
|
|
)
|
|
|
|
bind->joykey = NO_BTN;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (*btn == 'h')
|
|
|
|
{
|
|
|
|
const char *str = btn + 1;
|
|
|
|
/* Parse hat? */
|
|
|
|
if (str && ISDIGIT((int)*str))
|
|
|
|
{
|
|
|
|
char *dir = NULL;
|
|
|
|
uint16_t hat = strtoul(str, &dir, 0);
|
|
|
|
uint16_t hat_dir = dir ? input_config_parse_hat(dir) : 0;
|
|
|
|
if (hat_dir)
|
|
|
|
bind->joykey = HAT_MAP(hat, hat_dir);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
bind->joykey = strtoull(tmp, NULL, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tmp_a = config_get_entry(conf, key_label);
|
|
|
|
|
|
|
|
if (tmp_a && !string_is_empty(tmp_a->value))
|
|
|
|
{
|
|
|
|
if (!string_is_empty(bind->joykey_label))
|
|
|
|
free(bind->joykey_label);
|
|
|
|
|
|
|
|
bind->joykey_label = strdup(tmp_a->value);
|
|
|
|
}
|
|
|
|
}
|
2021-11-03 21:22:37 +01:00
|
|
|
|
2023-01-22 16:58:22 +01:00
|
|
|
void retroarch_config_deinit(void)
|
2021-11-03 21:22:37 +01:00
|
|
|
{
|
|
|
|
if (config_st)
|
|
|
|
free(config_st);
|
|
|
|
config_st = NULL;
|
|
|
|
}
|
|
|
|
|
2023-01-22 16:58:22 +01:00
|
|
|
void retroarch_config_init(void)
|
2021-11-03 21:22:37 +01:00
|
|
|
{
|
2023-01-22 16:58:22 +01:00
|
|
|
if (!config_st)
|
|
|
|
config_st = (settings_t*)calloc(1, sizeof(settings_t));
|
2021-11-03 21:22:37 +01:00
|
|
|
}
|