RetroArch/config.def.h

1848 lines
61 KiB
C
Raw Normal View History

2012-04-21 17:13:50 -04:00
/* RetroArch - A frontend for libretro.
2013-12-31 19:50:59 -05:00
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
2016-01-09 22:06:50 -05:00
* Copyright (C) 2011-2016 - Daniel De Matteis
2019-01-09 17:19:19 -05:00
* Copyright (C) 2016-2019 - Brad Parker
2015-08-30 18:55:34 -04:00
*
2012-04-21 17:13:50 -04:00
* RetroArch is free software: you can redistribute it and/or modify it under the terms
2010-12-22 09:58:43 -05: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 17:13:50 -04:00
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
2010-12-22 09:58:43 -05: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 17:31:57 -04:00
* You should have received a copy of the GNU General Public License along with RetroArch.
2010-12-22 09:58:43 -05:00
* If not, see <http://www.gnu.org/licenses/>.
*/
2011-01-05 14:09:12 -05:00
#ifndef __CONFIG_DEF_H
#define __CONFIG_DEF_H
2010-12-22 09:58:43 -05:00
#include <boolean.h>
#include <audio/audio_resampler.h>
#include "configuration.h"
2016-10-25 14:18:31 -04:00
#include "gfx/video_defines.h"
#include "input/input_defines.h"
2011-01-07 11:59:53 -05:00
#ifdef HAVE_CONFIG_H
#include "config.h"
2011-01-07 11:59:53 -05:00
#endif
2017-09-10 22:49:25 -04:00
#ifdef HAVE_NETWORKING
#include "network/netplay/netplay_defines.h"
2017-09-10 22:49:25 -04:00
#endif
/* Required for 3DS display mode setting */
#if defined(_3DS)
2023-05-31 16:46:34 -04:00
#include "gfx/common/ctr_defines.h"
#endif
2021-04-06 09:02:40 -04:00
/* Required for OpenDingux IPU filter + refresh
* rate settings */
#if defined(DINGUX)
#include "dingux/dingux_utils.h"
#endif
/* Required for 'show inputs on overlay' setting */
#if defined(HAVE_OVERLAY)
#include "../input/input_overlay.h"
#endif
/* Required for Steam enum settings */
#if defined(HAVE_MIST)
#include "steam/steam.h"
#endif
#if defined(HW_RVL)
#define MAX_GAMMA_SETTING 30
#elif defined(GEKKO)
#define MAX_GAMMA_SETTING 2
#else
#define MAX_GAMMA_SETTING 1
#endif
2021-03-03 06:02:32 -05:00
#if defined(XENON) || defined(_XBOX360) || defined(__PSL1GHT__) || defined(__PS3__)
#define DEFAULT_ASPECT_RATIO 1.7778f
#elif defined(_XBOX1) || defined(GEKKO) || defined(ANDROID)
#define DEFAULT_ASPECT_RATIO 1.3333f
#else
#define DEFAULT_ASPECT_RATIO 1.3333f
#endif
2019-09-14 18:46:02 -04:00
#if defined(GEKKO)
#define DEFAULT_MOUSE_SCALE 1
#endif
#define DEFAULT_TOUCH_SCALE 1
2021-08-18 11:41:53 -04:00
#if defined(RARCH_MOBILE) || defined(HAVE_LIBNX) || defined(__WINRT__) || defined(EMSCRIPTEN)
#define DEFAULT_POINTER_ENABLE true
#else
#define DEFAULT_POINTER_ENABLE false
#endif
/* Certain platforms might have assets stored in the bundle that
* we need to extract to a user-writable directory on first boot.
*
* Examples include: Android, iOS/OSX) */
#if defined(ANDROID) || defined(__APPLE__)
#define DEFAULT_BUNDLE_ASSETS_EXTRACT_ENABLE true
#else
#define DEFAULT_BUNDLE_ASSETS_EXTRACT_ENABLE false
#endif
#ifdef HAVE_MATERIALUI
2019-10-23 10:34:17 -04:00
/* Show icons to the left of each menu entry */
#define DEFAULT_MATERIALUI_ICONS_ENABLE true
2022-12-25 12:17:16 -05:00
/* Show boolean option ON/OFF icons */
#define DEFAULT_MATERIALUI_SWITCH_ICONS true
/* Show system-specific icons in the playlists tab */
#define DEFAULT_MATERIALUI_PLAYLIST_ICONS_ENABLE true
#endif
2019-10-23 10:34:17 -04:00
/* Material UI colour theme */
#define DEFAULT_MATERIALUI_THEME MATERIALUI_THEME_OZONE_DARK
/* Type of animation to use when performing menu transitions
* > 'Auto' follows Material UI standards:
* - Slide when switching between parent menus (tabs)
* - Fade when changing levels in a menu
* Note: Not wrapping this with a HAVE_MATERIALUI ifdef
* because there's too much baggage involved... */
#define DEFAULT_MATERIALUI_TRANSITION_ANIM MATERIALUI_TRANSITION_ANIM_AUTO
/* Adjust menu padding etc. to better fit the
* screen when using landscape layouts */
#if defined(RARCH_MOBILE)
2019-11-08 11:25:36 -05:00
#define DEFAULT_MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION_DISABLED
2019-10-23 10:34:17 -04:00
#else
2019-11-08 11:25:36 -05:00
#define DEFAULT_MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION_ALWAYS
2019-10-23 10:34:17 -04:00
#endif
/* Show/hide navigation bar
* > When hidden, MaterialUI menu navigation
* behaves like RGUI */
#define DEFAULT_MATERIALUI_SHOW_NAV_BAR true
/* Reposition navigation bar to make better use
* of screen space when using landscape layouts */
#define DEFAULT_MATERIALUI_AUTO_ROTATE_NAV_BAR true
2019-10-31 13:24:24 -04:00
/* Default portrait/landscape playlist view modes
* (when thumbnails are enabled) */
#define DEFAULT_MATERIALUI_THUMBNAIL_VIEW_PORTRAIT MATERIALUI_THUMBNAIL_VIEW_PORTRAIT_LIST_SMALL
#define DEFAULT_MATERIALUI_THUMBNAIL_VIEW_LANDSCAPE MATERIALUI_THUMBNAIL_VIEW_LANDSCAPE_LIST_MEDIUM
2019-10-31 13:24:24 -04:00
2019-11-08 11:25:36 -05:00
/* Enable second thumbnail when using 'list view'
* thumbnail views
* Note: Second thumbnail will only be drawn if
* display has sufficient horizontal real estate */
#if defined(RARCH_MOBILE)
#define DEFAULT_MATERIALUI_DUAL_THUMBNAIL_LIST_VIEW_ENABLE false
#else
#define DEFAULT_MATERIALUI_DUAL_THUMBNAIL_LIST_VIEW_ENABLE true
#endif
2019-11-11 11:11:32 -05:00
/* Draw solid colour 4:3 background when rendering
* thumbnails
* > Helps to unify menu appearance when viewing
* thumbnails of different sizes */
#define DEFAULT_MATERIALUI_THUMBNAIL_BACKGROUND_ENABLE true
#define DEFAULT_SCREEN_BRIGHTNESS 100
2019-06-14 05:13:02 -04:00
#define DEFAULT_CRT_SWITCH_RESOLUTION CRT_SWITCH_NONE
2018-03-26 10:03:46 -04:00
2019-06-14 05:13:02 -04:00
#define DEFAULT_CRT_SWITCH_RESOLUTION_SUPER 2560
2018-03-26 10:03:46 -04:00
2019-06-14 05:13:02 -04:00
#define DEFAULT_CRT_SWITCH_CENTER_ADJUST 0
#define DEFAULT_CRT_SWITCH_PORCH_ADJUST 0
Ver 0.9.2 SR2 (Switchres API) Implimantation Fixed SR close match refresh bug. Added menu high resolution option. Fixed desktop restore bug cuusing endless resolution change requests. Fixed file conflicts Added destop restore resolution back in for manu only. Pulled Switchres fixes. Added better PI rsolution support. Ver 0.7 SR2 (Switchres API) Implimantation Removed HH experimetal check. This is better done via teh switchres.ini at present. Fixed refresh rate bug. Now new resolution and refesh is added correctly. Removed SR deinit from menu restore. Meanu now stays at last content resolution. Ver 0.6.2 SR2 (Switchres API) Implimantation Fixed super resolution bug casuing abnormal video size and aspect ratio Fixed logging issue casuing seg falts on RA exit Ver 0.6 SR2 (Switchres API) Implimantation Ver 0.2 SR2 (Switchres API) Implimantation Added forced super resolutions. Added Multi-monitor/monitor selection support. Added desktop resolution restore when switching back to menu only. Added new menu items for 31KHz standard and 120hz monitor profiles. Added new menu item INI. load monitor profile from switchrss.ini. Fixed winraw driver. Coordinates new refreshed after a resolution change. Fixed Menu aspect ratio in super resolutions. Removed static glabals. These have been added to videocrt_switch struct. Ver 0.1 SR2 (Switchres API) Implimantation Removed old CRTSwitchRes method. Added new SR2 API implimantaion. Resolution swithcing is now done by switchres libs. Both Linux and Windows working with native and super resolutions. Working multi-monitor support with monitor index selection. Working 31KHz support with standard and 120Hxz modes. The monitor index selection is still done via the RA UI. Only choose native and 15KHz form the CRT options in the RA UI as all options are now set in the switchres.ini. All other CRT optoins in the RA UI currently do nothing. Added SR wrapper to fix compile issues. Added back RPi functionality Fixed windows resize/scaling issues on resolution change Thanks @Calamity no more need for crt_switch_driver_refresh() Fix broken case after prevous commit Monitor preset options 15/31KHz now active. Added new meu option. Moitor persets can now be choosen fom the RA UI. 15KHz and 31KHz will set arcade_15 and aracde_31 respectivly. New option INI, if this is chosen your monitor preset will be selected from your switchres.ini file. Added 3KHhz, 120Hz. for old RA users. Renamed 31KHz to 31 KHz, Standard Fixed winraw input coordinates after switching resolution. Code cleanup Fixed menu aspect ratio issue Added menu resolution restore after closing content Fixed aspect ratio after menu resolution restore. code clean up Fxed menu Resulition Restore Aspect Ratio. When SR uses non integer scalled resolution. super width bug with restoring menu resolution fix added super resolution check after setting desktop resolutoion variables when menu active only sr_deinit() used to restore desktop mode. Fixed menu sr_deinit bug. now setting sr_active false Removed static globals, added them to video_switch struct Fixex compile bug due to comment // Fixed compile issues doe to c++ comments in teh switchres_wrapper.h Temporarily removed SR2 logging to fix compile isses for c90 added logging back in. Removed support for winnt and osx Added define for C89. Disabled SR if defined C89 Removed all RA compile fixes fro C89 C90 etc. Swithing now working again. Put Switchres behind HAVE_SR2. HAVE_SR2=no by default. --enable-sr2 Ver 0.5 SR2 Implimentation. Ver 0.4 SR2 Implimantation. Bake SR inside RA Removed temporary log files Disable switchres when C89/C99 builds. Removed C89 and C90 checks for SR Fixed switchres_wrapper.h location Ver 0.3 SR2 Implimenation Dissable logging for C89 __STDC__ Fix For RPi fixed missing EOL fixed RPi function definition added vidrocrt_switch stuct to RPI funcion fixed xoffset for RPi Removed old RPi function call SR disabled for videocore until VC4 switching ported Reverted back to state 5c8a56c Bake SR inside RA Use native win32 api for threads. Fix static lib linking LIBERROR would be defined twice otherwise + improper function names prefixed by __imp_ Added lidstc++ to makefile.common for switchres Fixed RPi switching. Disabled Switchres for videocore unill it is ported. removed RAA.log. Should not exist Added check for when SR fails to set mode with an aspect ratio fix. added video driver re init for RPi GB, GBA and GBC core check, adjusted reseolutions and scale. Please turn on integer scalling in the RA UI Added logas back in. Checking STDC verstion >= C11 Fixed c89 for loop declaration. Code clean up. Added new functions Fix resolution switching bug introduces with HH code clean up. Fixed menu restore bug on closw content after code clean up Moved SR logging to relevant RA logs Update makefile. Checks for X11 and xrandr fixed makefile Use native win32 api for threads. Fix static lib linking LIBERROR would be defined twice otherwise + improper function names prefixed by __imp_ Update switchres_wrapper.* header comments Update year copyright DRMKMS: build only if libdrm has the required version XRANDR: build only if xrandr is available Simplified maklefile Fixed RPI compile error with unsued functions. As before Disable Griffin. No switching support available. Never has been Removed log file 1 Added Win32 static define Added SR source Removed Videocore check on destroy SR Moved SR deinit to trigger earlier on RA exit. Fixed compile error after upstream rebase Fixed aspect ration bug cused by super resolutions. Temporarily disbabled SR logging Re inabled runtim eSR loggind. Disableed all RARCH logging on retro_deinit_drivers Removed srdeinit from menu restore. Menu stays in current reolution until a fix can be found Fixed refresh rate changes when no reolution change is detected. Forgot to add teh resolution cahge in with the refresh change oops Fixed endless no detection log. Removed HH check. This can been better adjusted using the switchres.ini fixed compile issue Added better PI crt switching and fixed typo Pulled Swicthres fixes. Updated desktop restore resolution. removed unused makefile Lockec menu refresh to 60hz fixed missing new line Fixed file conflicts Forced 640x480@60 for menu Added high resolution menu option Removed item logg checker Fixed typos Removed unused functions Fixed SR close match refesh bug. Fixed typo
2021-05-11 05:08:15 -04:00
#define DEFAULT_CRT_SWITCH_HIRES_MENU true
2019-06-14 05:13:02 -04:00
#define DEFAULT_HISTORY_LIST_ENABLE true
#define DEFAULT_PLAYLIST_ENTRY_RENAME true
#define DEFAULT_WIFI_ENABLE true
#define DEFAULT_ACCESSIBILITY_ENABLE false
#define DEFAULT_ACCESSIBILITY_NARRATOR_SPEECH_SPEED 5
#define DEFAULT_DRIVER_SWITCH_ENABLE true
2019-06-14 05:13:02 -04:00
#define DEFAULT_USER_LANGUAGE 0
2014-10-16 22:17:28 -04:00
#define DEFAULT_GAMEMODE_ENABLE true
#ifdef HAVE_LAKKA_SWITCH
#define DEFAULT_SWITCH_OC false
#define DEFAULT_SWITCH_CEC true
#define DEFAULT_BLUETOOTH_ERTM false
#endif
2018-01-13 21:51:30 -05:00
#if (defined(_WIN32) && !defined(_XBOX)) || (defined(__linux) && !defined(ANDROID) && !defined(HAVE_LAKKA)) || (defined(__MACH__) && !defined(IOS)) || defined(EMSCRIPTEN)
#define DEFAULT_MOUSE_ENABLE true
#else
#define DEFAULT_MOUSE_ENABLE false
#endif
2016-07-25 01:33:41 -04:00
#ifdef HAVE_CHEEVOS
#define DEFAULT_CHEEVOS_ENABLE false
#define DEFAULT_CHEEVOS_APPEARANCE_ANCHOR 0 /* CHEEVOS_APPEARANCE_ANCHOR_TOPLEFT */
#define DEFAULT_CHEEVOS_APPEARANCE_PADDING_AUTO true
#define DEFAULT_CHEEVOS_APPEARANCE_PADDING_H 0.0f
#define DEFAULT_CHEEVOS_APPEARANCE_PADDING_V 0.0f
#define DEFAULT_CHEEVOS_VISIBILITY_SUMMARY 1 /* RCHEEVOS_SUMMARY_HASCHEEVOS */
#define DEFAULT_CHEEVOS_VISIBILITY_UNLOCK true
#define DEFAULT_CHEEVOS_VISIBILITY_MASTERY true
#define DEFAULT_CHEEVOS_VISIBILITY_ACCOUNT true
#define DEFAULT_CHEEVOS_VISIBILITY_LBOARD_START true
#define DEFAULT_CHEEVOS_VISIBILITY_LBOARD_SUBMIT true
#define DEFAULT_CHEEVOS_VISIBILITY_LBOARD_CANCEL true
#define DEFAULT_CHEEVOS_VISIBILITY_LBOARD_TRACKERS true
2023-05-14 15:42:01 -04:00
#define DEFAULT_CHEEVOS_VISIBILITY_PROGRESS_TRACKER true
2016-07-25 01:33:41 -04:00
#endif
2014-09-08 11:12:37 -04:00
/* VIDEO */
2010-12-22 09:58:43 -05:00
#if defined(_XBOX360)
#define DEFAULT_GAMMA 1
#else
#define DEFAULT_GAMMA 0
#endif
2014-09-08 11:12:37 -04:00
/* Windowed
* Real x resolution = aspect * base_size * x scale
* Real y resolution = base_size * y scale
*/
#define DEFAULT_SCALE 3
2010-12-22 09:58:43 -05:00
2014-09-08 11:12:37 -04:00
/* Fullscreen */
/* To start in Fullscreen, or not. */
2019-11-18 02:04:29 -05:00
#if defined(HAVE_STEAM) || defined(DINGUX) || defined(__WINRT__) || defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
/* Start in fullscreen mode for Steam and Dingux
* WinRT and Winapi Family builds */
2019-11-18 02:04:29 -05:00
#define DEFAULT_FULLSCREEN true
#else
#define DEFAULT_FULLSCREEN false
2019-11-18 02:04:29 -05:00
#endif
2014-09-08 11:12:37 -04:00
/* To use windowed mode or not when going fullscreen. */
#if defined(__WINRT__) || defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
/* Do not use windowed mode for WinRT and Winapi Family builds on the Xbox UWP with fixed resolution shrinks the image into the left top corner of the screen with some libretro cores */
#define DEFAULT_WINDOWED_FULLSCREEN false
#else
#define DEFAULT_WINDOWED_FULLSCREEN true
#endif
2014-09-08 11:12:37 -04:00
/* Enable automatic switching of the screen refresh rate when using the specified screen mode(s),
* based on running core/content */
#define DEFAULT_AUTOSWITCH_REFRESH_RATE AUTOSWITCH_REFRESH_RATE_EXCLUSIVE_FULLSCREEN
#define DEFAULT_AUTOSWITCH_PAL_THRESHOLD 54.50f
2014-09-08 11:12:37 -04:00
/* Which monitor to prefer. 0 is any monitor, 1 and up selects
* specific monitors, 1 being the first monitor. */
#define DEFAULT_MONITOR_INDEX 0
2014-09-08 11:12:37 -04:00
2016-11-23 19:43:50 -05:00
/* Window */
/* DEFAULT_WINDOW_DECORATIONS:
Whether to show the usual window decorations like border, titlebar etc. */
#ifdef WEBOS
#define DEFAULT_WINDOW_DECORATIONS false
#else
#define DEFAULT_WINDOW_DECORATIONS true
#endif
/* Amount of transparency to use for the main window.
* 1 is the most transparent while 100 is opaque. */
#define DEFAULT_WINDOW_OPACITY 100
/* DEFAULT_WINDOW_SAVE_POSITIONS:
* Whether to remember window positions
* NOTE: Only enabled for desktop Windows
* at present. */
#define DEFAULT_WINDOW_SAVE_POSITIONS false
/* Whether to use custom (fixed size)
* window dimensions in windowed mode. */
#ifdef WEBOS
#define DEFAULT_WINDOW_CUSTOM_SIZE_ENABLE true
#else
#define DEFAULT_WINDOW_CUSTOM_SIZE_ENABLE false
#endif
/* Window dimensions when using a fixed size
* window. A value of 0 disables fixed size
* windows, using nominal dimensions of
* window scale multiplied by the core
* framebuffer size. */
#if defined(WEBOS)
#define DEFAULT_WINDOW_WIDTH 1920
#define DEFAULT_WINDOW_HEIGHT 1080
#else
#define DEFAULT_WINDOW_WIDTH 1280
#define DEFAULT_WINDOW_HEIGHT 720
#endif
2016-11-23 19:43:50 -05:00
/* Maximum auto-set window dimensions
* when not using a fixed size window */
#define DEFAULT_WINDOW_AUTO_WIDTH_MAX 1920
#define DEFAULT_WINDOW_AUTO_HEIGHT_MAX 1080
2014-09-08 11:12:37 -04:00
/* Fullscreen resolution. A value of 0 uses the desktop
* resolution. */
2020-10-01 10:54:11 -04:00
#if defined(DINGUX)
#define DEFAULT_FULLSCREEN_X 320
#define DEFAULT_FULLSCREEN_Y 240
#elif defined(__WINRT__) || defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
#define DEFAULT_FULLSCREEN_X 1920
#define DEFAULT_FULLSCREEN_Y 1080
2020-10-01 10:54:11 -04:00
#else
#define DEFAULT_FULLSCREEN_X 0
#define DEFAULT_FULLSCREEN_Y 0
2020-10-01 10:54:11 -04:00
#endif
2010-12-22 09:58:43 -05:00
#if defined(HAVE_WINDOW_OFFSET)
/* Screen offsets to center content in CTRs */
#define DEFAULT_WINDOW_OFFSET_X 0
#define DEFAULT_WINDOW_OFFSET_Y 0
#endif
2018-11-25 15:41:26 -05:00
/* Number of threads to use for video recording */
#define DEFAULT_VIDEO_RECORD_THREADS 2
2018-11-25 15:41:26 -05:00
#if defined(RARCH_CONSOLE)
2019-06-02 15:02:59 -04:00
#define DEFAULT_LOAD_DUMMY_ON_CORE_SHUTDOWN false
#else
2019-06-02 15:02:59 -04:00
#define DEFAULT_LOAD_DUMMY_ON_CORE_SHUTDOWN true
#endif
2019-06-02 15:02:59 -04:00
#define DEFAULT_CHECK_FIRMWARE_BEFORE_LOADING false
/* Specifies whether cores are allowed to
* present core options in category submenus */
#define DEFAULT_CORE_OPTION_CATEGORY_ENABLE true
/* Specifies whether to cache core info
* into a single (compressed) file for improved
* load times on platforms with slow IO */
#define DEFAULT_CORE_INFO_CACHE_ENABLE true
/* Specifies whether to ignore core info
* savestate capabilities, allowing to
* experiment with related features
* (run ahead, rewind, etc) */
#define DEFAULT_CORE_INFO_SAVESTATE_BYPASS false
/* Specifies whether to 'reload' (fork and quit)
* RetroArch when launching content with the
* currently loaded core
* > Only relevant on platforms without dynamic core
* loading support
* > Setting this to 'false' will decrease loading
* times when required core is already running,
* but may cause stability issues (if core misbehaves) */
#ifndef HAVE_DYNAMIC
#define DEFAULT_ALWAYS_RELOAD_CORE_ON_RUN_CONTENT true
#endif
2014-09-08 11:12:37 -04:00
/* Forcibly disable composition.
* Only valid on Windows Vista/7/8 for now. */
#define DEFAULT_DISABLE_COMPOSITION false
2014-09-08 11:12:37 -04:00
/* Video VSYNC (recommended) */
2019-06-21 21:30:46 -04:00
#define DEFAULT_VSYNC true
2010-12-22 09:58:43 -05:00
/* Vulkan specific */
#define DEFAULT_MAX_SWAPCHAIN_IMAGES 3
/* D3D1x specific */
#if defined(__WINRT__) || defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
#define DEFAULT_WAITABLE_SWAPCHAINS false
#else
#define DEFAULT_WAITABLE_SWAPCHAINS true
#endif
#define DEFAULT_MAX_FRAME_LATENCY 1
#define MAXIMUM_MAX_FRAME_LATENCY 4
/* GL specific */
#define DEFAULT_ADAPTIVE_VSYNC false
2014-09-08 11:12:37 -04:00
/* Attempts to hard-synchronize CPU and GPU.
* Can reduce latency at cost of performance. */
#define DEFAULT_HARD_SYNC false
2014-09-08 11:12:37 -04:00
/* Configures how many frames the GPU can run ahead of CPU.
* 0: Syncs to GPU immediately.
* 1: Syncs to previous frame.
* 2: Etc ...
*/
#define DEFAULT_HARD_SYNC_FRAMES 0
2013-05-03 08:04:29 -04:00
2014-09-08 11:12:37 -04:00
/* Sets how many milliseconds to delay after VSync before running the core.
* Can reduce latency at cost of higher risk of stuttering.
*/
#define DEFAULT_FRAME_DELAY 0
#define MAXIMUM_FRAME_DELAY 19
#define DEFAULT_FRAME_DELAY_AUTO false
/* Try to sleep the spare time after frame is presented in order to reduce vsync CPU usage. */
#define DEFAULT_FRAME_REST false
/* Duplicates frames for the purposes of running Shaders at a higher framerate
* than content framerate. Requires running screen at multiple of 60hz, and
* don't combine with Swap_interval > 1, or BFI. (Though BFI can be done in a shader
* with multi-frame shaders.)
*/
#define DEFAULT_SHADER_SUBFRAMES 1
/* Divides implements basic rolling scanning of sub frames - does this simply by scrolling a
* a scissor rect down the screen according to how many sub frames there are
*/
#define DEFAULT_SCAN_SUBFRAMES false
/* Inserts black frame(s) inbetween frames.
* Useful for Higher Hz monitors (set to multiples of 60 Hz) who want to play 60 Hz
* material with CRT-like motion clarity.
2014-09-08 11:12:37 -04:00
*/
#define DEFAULT_BLACK_FRAME_INSERTION 0
/* Black Frame Insertion Dark Frames.
* Increase for more clarity at the cost of lower brightness. Adjusting can also eliminate
* any temporary image retention if noticed. Only useful at 180hz or higher 60hz multiples,
* as 120hz only has one total extra frame for BFI to work with.
*/
#define DEFAULT_BFI_DARK_FRAMES 1
2014-09-08 11:12:37 -04:00
/* Uses a custom swap interval for VSync.
* Set this to effectively halve monitor refresh rate.
*/
#define DEFAULT_SWAP_INTERVAL 1
2015-08-30 18:55:34 -04:00
/* Threaded video. Will possibly increase performance significantly
2014-09-08 11:12:37 -04:00
* at the cost of worse synchronization and latency.
*/
#if defined(HAVE_LIBNX)
#define DEFAULT_VIDEO_THREADED true
#else
#define DEFAULT_VIDEO_THREADED false
#endif
#if defined(HAVE_THREADS)
2018-09-18 02:08:06 -04:00
#if defined(GEKKO) || defined(PSP) || defined(PS2)
/* For single-core consoles right now it's best to have this be disabled. */
#define DEFAULT_THREADED_DATA_RUNLOOP_ENABLE false
#else
#define DEFAULT_THREADED_DATA_RUNLOOP_ENABLE true
#endif
#else
#define DEFAULT_THREADED_DATA_RUNLOOP_ENABLE false
#endif
2014-09-08 11:12:37 -04:00
/* Set to true if HW render cores should get their private context. */
#define DEFAULT_VIDEO_SHARED_CONTEXT false
2014-09-08 11:12:37 -04:00
/* Sets GC/Wii screen width. */
2019-06-02 15:02:59 -04:00
#define DEFAULT_VIDEO_VI_WIDTH 640
2014-08-10 16:39:08 -04:00
2016-09-07 07:53:46 -04:00
#ifdef GEKKO
2014-10-04 01:13:08 -04:00
/* Removes 480i flicker, smooths picture a little. */
2019-06-02 15:02:59 -04:00
#define DEFAULT_VIDEO_VFILTER true
/* Allow overscan to be corrected on displays that
* do not have proper 'pixel perfect' scaling */
#define DEFAULT_VIDEO_OVERSCAN_CORRECTION_TOP 0
#define DEFAULT_VIDEO_OVERSCAN_CORRECTION_BOTTOM 0
2016-09-07 07:53:46 -04:00
#endif
2014-10-04 01:13:08 -04:00
2014-09-08 11:12:37 -04:00
/* Smooths picture. */
#if defined(_3DS) || defined(GEKKO) || defined(HW_RVL) || defined(PSP) || defined(VITA) || defined(SN_TARGET_PSP2) || defined(PS2) || defined(_XBOX) || defined(DINGUX)
#define DEFAULT_VIDEO_SMOOTH true
#else
#define DEFAULT_VIDEO_SMOOTH false
#endif
2010-12-22 09:58:43 -05:00
/* Graphics context specific scaling */
#define DEFAULT_VIDEO_CTX_SCALING false
2014-09-08 11:12:37 -04:00
/* On resize and fullscreen, rendering area will stay 4:3 */
#define DEFAULT_FORCE_ASPECT true
2010-12-22 09:58:43 -05:00
/* Only applies to Android 9.0 (API 28) and up */
/* Choose if the screen will be able to write around the notch or not */
#define DEFAULT_NOTCH_WRITE_OVER_ENABLE false
2014-09-08 11:12:37 -04:00
/* Enable use of shaders. */
#ifdef RARCH_CONSOLE
#define DEFAULT_SHADER_ENABLE true
#else
#define DEFAULT_SHADER_ENABLE false
#endif
Add HDR support for D3D12 (rebased PR from MajorPainTheCactus) (#12917) * Add HDR support * Attempt to fix Mingw build and Metal builds * (D3D12) Fix relative header includes * Add missing hdr_sm5.hlsl.h * (d3d12_common.c) Some C89 build fixes * Fix MSVC build * - Attempt to fix build on mingw/msys unix with dirty hack - Fix shader compilation of hdr_sm5.hlsl.h on MSVC/Visual Studio - the define was seen as an error and was causing the first pipeline to error out - Make sure we manually set handle of backBuffer to NULL * Moving the release of the texture above the freeing of desc.srv_heap and desc.rtv_heap solves the hard crashes on teardown/setup in RA - it was crashing hard in d3d12_release_texture before * Add HAVE_D3D12_HDR ifdef - needs to be disabled for WinRT for now because of several things that are Windows desktop-specific right now (GetWindowRect) * Add dirty GUID hack - should work for both mingw/msys on Windows/Linux as well as MSVC/Visual Studio (hopefully) * Change HAVE_D3D12_HDR to HAVE_DXGI_HDR * Move away from camelcase named variables * Fix RARCH_ERR logs - they need a newline at the end * d3d12_check_display_hdr_support - make it return a bool on return and set d3d12->hdr.support and d3d12->hdr.enable outside of the function * (DXGI) Remove D3D12 dependencies from dxgi_check_display_hdr_support and move it to dxgi_common.c instead * (DXGI) move d3d12_swapchain_color_space over to dxgi_common.c and rename it dxgi_swapchain_color_space * (DXGI) move d3d12_set_hdr_metadata to dxgi_common.c and rename it dxgi_set_hdr_metadata * (DXGI) dxgi_check_display_hdr_support - better error handling? * Fix typo * Remove video_force_resolution * (D3D12) Address TODO/FIXME * (D3D12) Backport https://github.com/libretro/RetroArch/pull/12916/commits/c1b6c0bff2aa33cde035b43cb31ac7e78ff2a07a - Fixed resource transition for present when HDR is off Fixed cel shader displaying all black as blending was enabled when the hdr shader was being applied - turned off blending during this shader * Move d3d12_hdr_uniform_t to dxgi_common.h and rename it dxgi_hdr_uniform_t * (D3D11) Add HDR support * Add TODO/FIXME notes * Cache hdr_enable in video_frame_info_t * Update comment
2021-09-03 00:15:25 -04:00
/* Should we enable hdr when its supported*/
#define DEFAULT_VIDEO_HDR_ENABLE false
/* The maximum nunmber of nits the actual display can show - needs to be calibrated */
#define DEFAULT_VIDEO_HDR_MAX_NITS 1000.0f
Add HDR support for D3D12 (rebased PR from MajorPainTheCactus) (#12917) * Add HDR support * Attempt to fix Mingw build and Metal builds * (D3D12) Fix relative header includes * Add missing hdr_sm5.hlsl.h * (d3d12_common.c) Some C89 build fixes * Fix MSVC build * - Attempt to fix build on mingw/msys unix with dirty hack - Fix shader compilation of hdr_sm5.hlsl.h on MSVC/Visual Studio - the define was seen as an error and was causing the first pipeline to error out - Make sure we manually set handle of backBuffer to NULL * Moving the release of the texture above the freeing of desc.srv_heap and desc.rtv_heap solves the hard crashes on teardown/setup in RA - it was crashing hard in d3d12_release_texture before * Add HAVE_D3D12_HDR ifdef - needs to be disabled for WinRT for now because of several things that are Windows desktop-specific right now (GetWindowRect) * Add dirty GUID hack - should work for both mingw/msys on Windows/Linux as well as MSVC/Visual Studio (hopefully) * Change HAVE_D3D12_HDR to HAVE_DXGI_HDR * Move away from camelcase named variables * Fix RARCH_ERR logs - they need a newline at the end * d3d12_check_display_hdr_support - make it return a bool on return and set d3d12->hdr.support and d3d12->hdr.enable outside of the function * (DXGI) Remove D3D12 dependencies from dxgi_check_display_hdr_support and move it to dxgi_common.c instead * (DXGI) move d3d12_swapchain_color_space over to dxgi_common.c and rename it dxgi_swapchain_color_space * (DXGI) move d3d12_set_hdr_metadata to dxgi_common.c and rename it dxgi_set_hdr_metadata * (DXGI) dxgi_check_display_hdr_support - better error handling? * Fix typo * Remove video_force_resolution * (D3D12) Address TODO/FIXME * (D3D12) Backport https://github.com/libretro/RetroArch/pull/12916/commits/c1b6c0bff2aa33cde035b43cb31ac7e78ff2a07a - Fixed resource transition for present when HDR is off Fixed cel shader displaying all black as blending was enabled when the hdr shader was being applied - turned off blending during this shader * Move d3d12_hdr_uniform_t to dxgi_common.h and rename it dxgi_hdr_uniform_t * (D3D11) Add HDR support * Add TODO/FIXME notes * Cache hdr_enable in video_frame_info_t * Update comment
2021-09-03 00:15:25 -04:00
/* The number of nits that paper white is at */
#define DEFAULT_VIDEO_HDR_PAPER_WHITE_NITS 200.0f
Add HDR support for D3D12 (rebased PR from MajorPainTheCactus) (#12917) * Add HDR support * Attempt to fix Mingw build and Metal builds * (D3D12) Fix relative header includes * Add missing hdr_sm5.hlsl.h * (d3d12_common.c) Some C89 build fixes * Fix MSVC build * - Attempt to fix build on mingw/msys unix with dirty hack - Fix shader compilation of hdr_sm5.hlsl.h on MSVC/Visual Studio - the define was seen as an error and was causing the first pipeline to error out - Make sure we manually set handle of backBuffer to NULL * Moving the release of the texture above the freeing of desc.srv_heap and desc.rtv_heap solves the hard crashes on teardown/setup in RA - it was crashing hard in d3d12_release_texture before * Add HAVE_D3D12_HDR ifdef - needs to be disabled for WinRT for now because of several things that are Windows desktop-specific right now (GetWindowRect) * Add dirty GUID hack - should work for both mingw/msys on Windows/Linux as well as MSVC/Visual Studio (hopefully) * Change HAVE_D3D12_HDR to HAVE_DXGI_HDR * Move away from camelcase named variables * Fix RARCH_ERR logs - they need a newline at the end * d3d12_check_display_hdr_support - make it return a bool on return and set d3d12->hdr.support and d3d12->hdr.enable outside of the function * (DXGI) Remove D3D12 dependencies from dxgi_check_display_hdr_support and move it to dxgi_common.c instead * (DXGI) move d3d12_swapchain_color_space over to dxgi_common.c and rename it dxgi_swapchain_color_space * (DXGI) move d3d12_set_hdr_metadata to dxgi_common.c and rename it dxgi_set_hdr_metadata * (DXGI) dxgi_check_display_hdr_support - better error handling? * Fix typo * Remove video_force_resolution * (D3D12) Address TODO/FIXME * (D3D12) Backport https://github.com/libretro/RetroArch/pull/12916/commits/c1b6c0bff2aa33cde035b43cb31ac7e78ff2a07a - Fixed resource transition for present when HDR is off Fixed cel shader displaying all black as blending was enabled when the hdr shader was being applied - turned off blending during this shader * Move d3d12_hdr_uniform_t to dxgi_common.h and rename it dxgi_hdr_uniform_t * (D3D11) Add HDR support * Add TODO/FIXME notes * Cache hdr_enable in video_frame_info_t * Update comment
2021-09-03 00:15:25 -04:00
/* The contrast setting for hdr used to calculate the display gamma by dividing this value by gamma 2.2 */
#define DEFAULT_VIDEO_HDR_CONTRAST 5.0f
Add HDR support for D3D12 (rebased PR from MajorPainTheCactus) (#12917) * Add HDR support * Attempt to fix Mingw build and Metal builds * (D3D12) Fix relative header includes * Add missing hdr_sm5.hlsl.h * (d3d12_common.c) Some C89 build fixes * Fix MSVC build * - Attempt to fix build on mingw/msys unix with dirty hack - Fix shader compilation of hdr_sm5.hlsl.h on MSVC/Visual Studio - the define was seen as an error and was causing the first pipeline to error out - Make sure we manually set handle of backBuffer to NULL * Moving the release of the texture above the freeing of desc.srv_heap and desc.rtv_heap solves the hard crashes on teardown/setup in RA - it was crashing hard in d3d12_release_texture before * Add HAVE_D3D12_HDR ifdef - needs to be disabled for WinRT for now because of several things that are Windows desktop-specific right now (GetWindowRect) * Add dirty GUID hack - should work for both mingw/msys on Windows/Linux as well as MSVC/Visual Studio (hopefully) * Change HAVE_D3D12_HDR to HAVE_DXGI_HDR * Move away from camelcase named variables * Fix RARCH_ERR logs - they need a newline at the end * d3d12_check_display_hdr_support - make it return a bool on return and set d3d12->hdr.support and d3d12->hdr.enable outside of the function * (DXGI) Remove D3D12 dependencies from dxgi_check_display_hdr_support and move it to dxgi_common.c instead * (DXGI) move d3d12_swapchain_color_space over to dxgi_common.c and rename it dxgi_swapchain_color_space * (DXGI) move d3d12_set_hdr_metadata to dxgi_common.c and rename it dxgi_set_hdr_metadata * (DXGI) dxgi_check_display_hdr_support - better error handling? * Fix typo * Remove video_force_resolution * (D3D12) Address TODO/FIXME * (D3D12) Backport https://github.com/libretro/RetroArch/pull/12916/commits/c1b6c0bff2aa33cde035b43cb31ac7e78ff2a07a - Fixed resource transition for present when HDR is off Fixed cel shader displaying all black as blending was enabled when the hdr shader was being applied - turned off blending during this shader * Move d3d12_hdr_uniform_t to dxgi_common.h and rename it dxgi_hdr_uniform_t * (D3D11) Add HDR support * Add TODO/FIXME notes * Cache hdr_enable in video_frame_info_t * Update comment
2021-09-03 00:15:25 -04:00
/* Should we expand the colour gamut when using hdr */
#define DEFAULT_VIDEO_HDR_EXPAND_GAMUT true
/* When presets are saved they will be saved using the #reference
* directive by default */
#define DEFAULT_VIDEO_SHADER_PRESET_SAVE_REFERENCE_ENABLE true
#define DEFAULT_SHADER_DELAY 0
2014-09-08 11:12:37 -04:00
/* Only scale in integer steps.
* The base size depends on system-reported geometry and aspect ratio.
* If video_force_aspect is not set, X/Y will be integer scaled independently.
2021-06-23 17:56:52 -04:00
* Overscale rounds up instead of down, default is downscale.
2014-09-08 11:12:37 -04:00
*/
#define DEFAULT_SCALE_INTEGER false
2021-06-23 17:56:52 -04:00
#define DEFAULT_SCALE_INTEGER_OVERSCALE false
2013-01-29 13:28:33 -05:00
2014-09-08 11:12:37 -04:00
/* Controls aspect ratio handling. */
/* 1:1 PAR */
#define DEFAULT_ASPECT_RATIO_AUTO false
2012-04-15 11:36:09 -04:00
2021-03-03 06:02:32 -05:00
#if defined(_XBOX360) || defined(__PS3__)
#define DEFAULT_ASPECT_RATIO_IDX ASPECT_RATIO_16_9
#elif defined(PSP) || defined(_3DS) || defined(HAVE_LIBNX) || defined(VITA)
#define DEFAULT_ASPECT_RATIO_IDX ASPECT_RATIO_CORE
#elif defined(RARCH_CONSOLE)
#define DEFAULT_ASPECT_RATIO_IDX ASPECT_RATIO_4_3
#else
#define DEFAULT_ASPECT_RATIO_IDX ASPECT_RATIO_CORE
#endif
2020-10-01 10:54:11 -04:00
#if defined(DINGUX)
/* Enables aspect ratio correction (1:1 PAR) when
* using the IPU hardware scaler in Dingux devices */
#define DEFAULT_DINGUX_IPU_KEEP_ASPECT true
/* Sets image filtering method when using the
* IPU hardware scaler in Dingux devices */
2021-07-27 06:39:24 -04:00
#if defined(RETROFW)
#define DEFAULT_DINGUX_IPU_FILTER_TYPE DINGUX_IPU_FILTER_NEAREST
#else
#define DEFAULT_DINGUX_IPU_FILTER_TYPE DINGUX_IPU_FILTER_BICUBIC
2021-07-27 06:39:24 -04:00
#endif
2021-04-06 09:02:40 -04:00
#if defined(DINGUX_BETA)
/* Sets refresh rate of integral LCD panel
* in Dingux devices */
#define DEFAULT_DINGUX_REFRESH_RATE DINGUX_REFRESH_RATE_60HZ
#endif
#if defined(RS90) || defined(MIYOO)
/* Sets image filtering method on the RS90
* when integer scaling is disabled */
#define DEFAULT_DINGUX_RS90_SOFTFILTER_TYPE DINGUX_RS90_SOFTFILTER_POINT
#endif
2020-10-01 10:54:11 -04:00
#endif
2014-09-08 11:12:37 -04:00
/* Save configuration file on exit. */
2019-06-02 15:02:59 -04:00
#define DEFAULT_CONFIG_SAVE_ON_EXIT true
2013-05-22 09:35:28 -04:00
/* Save active input remap file on exit/close content */
#define DEFAULT_REMAP_SAVE_ON_EXIT true
2019-06-02 15:02:59 -04:00
#define DEFAULT_SHOW_HIDDEN_FILES false
/* Initialise file browser with the last used start directory */
#define DEFAULT_USE_LAST_START_DIRECTORY false
#define DEFAULT_OVERLAY_BEHIND_MENU false
2019-06-02 15:02:59 -04:00
#define DEFAULT_OVERLAY_HIDE_IN_MENU true
/* Automatically disable overlays when a
* controller is connected in port 1 */
#define DEFAULT_OVERLAY_HIDE_WHEN_GAMEPAD_CONNECTED false
#define DEFAULT_OVERLAY_SHOW_MOUSE_CURSOR true
2015-07-08 22:05:59 -04:00
2019-06-02 15:02:59 -04:00
#define DEFAULT_DISPLAY_KEYBOARD_OVERLAY false
2018-07-27 13:26:15 -04:00
#ifdef HAKCHI
2019-06-02 15:02:59 -04:00
#define DEFAULT_INPUT_OVERLAY_OPACITY 0.5f
2018-07-27 13:26:15 -04:00
#else
2019-06-02 15:02:59 -04:00
#define DEFAULT_INPUT_OVERLAY_OPACITY 0.7f
2018-07-27 13:26:15 -04:00
#endif
2020-09-08 08:36:45 -04:00
#define DEFAULT_INPUT_OVERLAY_SCALE_LANDSCAPE 1.0f
#define DEFAULT_INPUT_OVERLAY_ASPECT_ADJUST_LANDSCAPE 0.0f
#define DEFAULT_INPUT_OVERLAY_X_SEPARATION_LANDSCAPE 0.0f
#define DEFAULT_INPUT_OVERLAY_Y_SEPARATION_LANDSCAPE 0.0f
#define DEFAULT_INPUT_OVERLAY_X_OFFSET_LANDSCAPE 0.0f
#define DEFAULT_INPUT_OVERLAY_Y_OFFSET_LANDSCAPE 0.0f
#define DEFAULT_INPUT_OVERLAY_SCALE_PORTRAIT 1.0f
#define DEFAULT_INPUT_OVERLAY_ASPECT_ADJUST_PORTRAIT 0.0f
#define DEFAULT_INPUT_OVERLAY_X_SEPARATION_PORTRAIT 0.0f
#define DEFAULT_INPUT_OVERLAY_Y_SEPARATION_PORTRAIT 0.0f
2020-09-08 08:36:45 -04:00
#define DEFAULT_INPUT_OVERLAY_X_OFFSET_PORTRAIT 0.0f
#define DEFAULT_INPUT_OVERLAY_Y_OFFSET_PORTRAIT 0.0f
#if defined(RARCH_MOBILE)
#define DEFAULT_OVERLAY_AUTO_ROTATE true
#else
#define DEFAULT_OVERLAY_AUTO_ROTATE false
#endif
#if defined(RARCH_MOBILE)
#define DEFAULT_INPUT_OVERLAY_AUTO_SCALE true
#else
#define DEFAULT_INPUT_OVERLAY_AUTO_SCALE false
#endif
#if defined(RARCH_MOBILE)
#define DEFAULT_INPUT_OVERLAY_POINTER_ENABLE true
#else
#define DEFAULT_INPUT_OVERLAY_POINTER_ENABLE false
#endif
#define DEFAULT_INPUT_OVERLAY_LIGHTGUN_PORT -1
#define DEFAULT_INPUT_OVERLAY_LIGHTGUN_TRIGGER_ON_TOUCH true
#define DEFAULT_INPUT_OVERLAY_LIGHTGUN_TRIGGER_DELAY 1
#define DEFAULT_INPUT_OVERLAY_LIGHTGUN_MULTI_TOUCH_INPUT 0
#define DEFAULT_INPUT_OVERLAY_LIGHTGUN_ALLOW_OFFSCREEN true
#define DEFAULT_INPUT_OVERLAY_MOUSE_SPEED 1.0f
#define DEFAULT_INPUT_OVERLAY_MOUSE_HOLD_TO_DRAG true
#define DEFAULT_INPUT_OVERLAY_MOUSE_HOLD_MSEC 200
#define DEFAULT_INPUT_OVERLAY_MOUSE_DTAP_TO_DRAG false
#define DEFAULT_INPUT_OVERLAY_MOUSE_DTAP_MSEC 200
#define DEFAULT_INPUT_OVERLAY_MOUSE_SWIPE_THRESHOLD 1.0f
#ifdef UDEV_TOUCH_SUPPORT
#define DEFAULT_INPUT_TOUCH_VMOUSE_POINTER true
#define DEFAULT_INPUT_TOUCH_VMOUSE_MOUSE true
#define DEFAULT_INPUT_TOUCH_VMOUSE_TOUCHPAD true
#define DEFAULT_INPUT_TOUCH_VMOUSE_TRACKBALL false
#define DEFAULT_INPUT_TOUCH_VMOUSE_GESTURE true
#endif
#include "runtime_file_defines.h"
#ifdef HAVE_MENU
#include "menu/menu_defines.h"
2016-07-14 12:19:59 -04:00
#ifdef HAVE_LIBNX
2019-06-14 05:13:02 -04:00
#define DEFAULT_MENU_USE_PREFERRED_SYSTEM_COLOR_THEME true
#else
2019-06-14 05:13:02 -04:00
#define DEFAULT_MENU_USE_PREFERRED_SYSTEM_COLOR_THEME false
#endif
#ifdef HAVE_OZONE
/* Ozone colour theme: 1 == Basic Black */
#define DEFAULT_OZONE_COLOR_THEME 1
2019-06-14 05:13:02 -04:00
#define DEFAULT_OZONE_COLLAPSE_SIDEBAR false
#define DEFAULT_OZONE_SCROLL_CONTENT_METADATA false
#define DEFAULT_OZONE_THUMBNAIL_SCALE_FACTOR 1.0f
#endif
#if defined(HAVE_OZONE) || defined(HAVE_XMB)
#define DEFAULT_OZONE_TRUNCATE_PLAYLIST_NAME true
#define DEFAULT_OZONE_SORT_AFTER_TRUNCATE_PLAYLIST_NAME false
#endif
#define DEFAULT_SETTINGS_SHOW_DRIVERS true
#define DEFAULT_SETTINGS_SHOW_VIDEO true
#define DEFAULT_SETTINGS_SHOW_AUDIO true
2019-08-20 18:27:40 -04:00
#define DEFAULT_SETTINGS_SHOW_INPUT true
#define DEFAULT_SETTINGS_SHOW_LATENCY true
#define DEFAULT_SETTINGS_SHOW_CORE true
#define DEFAULT_SETTINGS_SHOW_CONFIGURATION true
#define DEFAULT_SETTINGS_SHOW_SAVING true
#define DEFAULT_SETTINGS_SHOW_LOGGING true
#define DEFAULT_SETTINGS_SHOW_FILE_BROWSER true
#define DEFAULT_SETTINGS_SHOW_FRAME_THROTTLE true
#define DEFAULT_SETTINGS_SHOW_RECORDING true
#define DEFAULT_SETTINGS_SHOW_ONSCREEN_DISPLAY true
#define DEFAULT_SETTINGS_SHOW_USER_INTERFACE true
#define DEFAULT_SETTINGS_SHOW_AI_SERVICE true
#define DEFAULT_SETTINGS_SHOW_ACCESSIBILITY true
#define DEFAULT_SETTINGS_SHOW_POWER_MANAGEMENT true
#define DEFAULT_SETTINGS_SHOW_ACHIEVEMENTS true
#define DEFAULT_SETTINGS_SHOW_NETWORK true
#define DEFAULT_SETTINGS_SHOW_PLAYLISTS true
#define DEFAULT_SETTINGS_SHOW_USER true
#define DEFAULT_SETTINGS_SHOW_DIRECTORY true
#define DEFAULT_SETTINGS_SHOW_STEAM true
#define DEFAULT_QUICK_MENU_SHOW_RESUME_CONTENT true
#define DEFAULT_QUICK_MENU_SHOW_RESTART_CONTENT true
#define DEFAULT_QUICK_MENU_SHOW_CLOSE_CONTENT true
2020-02-03 22:21:31 -05:00
#define DEFAULT_QUICK_MENU_SHOW_TAKE_SCREENSHOT true
2023-05-05 11:09:09 -04:00
#define DEFAULT_QUICK_MENU_SHOW_SAVESTATE_SUBMENU true
2020-02-03 22:21:31 -05:00
#define DEFAULT_QUICK_MENU_SHOW_SAVE_LOAD_STATE true
#define DEFAULT_QUICK_MENU_SHOW_UNDO_SAVE_LOAD_STATE true
2023-05-05 11:09:09 -04:00
#define DEFAULT_QUICK_MENU_SHOW_REPLAY false
#define DEFAULT_QUICK_MENU_SHOW_ADD_TO_FAVORITES true
2024-05-05 06:48:20 -04:00
#define DEFAULT_QUICK_MENU_SHOW_ADD_TO_PLAYLIST false
#define DEFAULT_QUICK_MENU_SHOW_START_RECORDING true
#define DEFAULT_QUICK_MENU_SHOW_START_STREAMING true
#define DEFAULT_QUICK_MENU_SHOW_SET_CORE_ASSOCIATION true
#define DEFAULT_QUICK_MENU_SHOW_RESET_CORE_ASSOCIATION true
#define DEFAULT_QUICK_MENU_SHOW_CORE_OPTIONS true
#define DEFAULT_QUICK_MENU_SHOW_CORE_OPTIONS_FLUSH false
#define DEFAULT_QUICK_MENU_SHOW_CONTROLS true
#define DEFAULT_QUICK_MENU_SHOW_LATENCY true
#define DEFAULT_QUICK_MENU_SHOW_REWIND true
#define DEFAULT_QUICK_MENU_SHOW_OVERLAYS true
#define DEFAULT_QUICK_MENU_SHOW_VIDEO_LAYOUT false
#define DEFAULT_QUICK_MENU_SHOW_CHEATS true
#define DEFAULT_QUICK_MENU_SHOW_SHADERS true
#define DEFAULT_QUICK_MENU_SHOW_INFORMATION true
#define DEFAULT_QUICK_MENU_SHOW_SAVE_CORE_OVERRIDES true
#define DEFAULT_QUICK_MENU_SHOW_SAVE_GAME_OVERRIDES true
#define DEFAULT_QUICK_MENU_SHOW_SAVE_CONTENT_DIR_OVERRIDES true
2020-01-10 22:27:38 -05:00
#ifdef HAVE_NETWORKING
#define DEFAULT_QUICK_MENU_SHOW_DOWNLOAD_THUMBNAILS true
2020-01-10 22:27:38 -05:00
#endif
#define DEFAULT_MENU_SHOW_ONLINE_UPDATER true
#if defined(HAVE_LAKKA) || defined(VITA)
#define DEFAULT_MENU_SHOW_CORE_UPDATER false
#else
#define DEFAULT_MENU_SHOW_CORE_UPDATER true
#endif
#define DEFAULT_MENU_SHOW_LOAD_CORE true
#define DEFAULT_MENU_SHOW_LOAD_CONTENT true
2019-07-21 06:16:16 -04:00
#ifdef HAVE_CDROM
#define DEFAULT_MENU_SHOW_LOAD_DISC true
#define DEFAULT_MENU_SHOW_DUMP_DISC true
#ifdef HAVE_LAKKA
#define DEFAULT_MENU_SHOW_EJECT_DISC true
#endif /* HAVE_LAKKA */
2020-02-03 22:21:31 -05:00
#endif
#define DEFAULT_MENU_SHOW_INFORMATION true
#define DEFAULT_MENU_SHOW_CONFIGURATIONS true
#define DEFAULT_MENU_SHOW_HELP true
#define DEFAULT_MENU_SHOW_QUIT true
#define DEFAULT_MENU_SHOW_RESTART true
#define DEFAULT_MENU_SHOW_REBOOT true
#define DEFAULT_MENU_SHOW_SHUTDOWN true
#ifdef HAVE_MIST
#define DEFAULT_MENU_SHOW_CORE_MANAGER_STEAM true
#endif
#if 0
/* Thumbnailpack removal */
#define DEFAULT_MENU_SHOW_LEGACY_THUMBNAIL_UPDATER false
#endif
#define DEFAULT_MENU_SHOW_SUBLABELS true
#define DEFAULT_MENU_DYNAMIC_WALLPAPER_ENABLE true
#define DEFAULT_MENU_SCROLL_FAST false
2021-03-25 21:06:56 -04:00
#define DEFAULT_MENU_SCROLL_DELAY 256
#define DEFAULT_KIOSK_MODE_ENABLE false
#define DEFAULT_MENU_HORIZONTAL_ANIMATION true
#define DEFAULT_MENU_TICKER_TYPE (TICKER_TYPE_LOOP)
#define DEFAULT_MENU_TICKER_SPEED 2.0f
2019-08-21 12:52:08 -04:00
#define DEFAULT_MENU_TICKER_SMOOTH true
#if defined(HAVE_THREADS)
#define DEFAULT_MENU_SAVESTATE_RESUME true
#else
#define DEFAULT_MENU_SAVESTATE_RESUME false
#endif
2020-01-14 07:28:10 -05:00
#define DEFAULT_MENU_INSERT_DISK_RESUME true
#define DEFAULT_QUIT_ON_CLOSE_CONTENT QUIT_ON_CLOSE_CONTENT_DISABLED
2021-04-01 12:25:45 -04:00
/* While the menu is active, supported drivers
* will display a screensaver after SCREENSAVER_TIMEOUT
* seconds of inactivity. A timeout of zero disables
* the screensaver */
#define DEFAULT_MENU_SCREENSAVER_TIMEOUT 0
#if defined(HAVE_MATERIALUI) || defined(HAVE_XMB) || defined(HAVE_OZONE)
/* When menu screensaver is enabled, specifies
* animation effect and animation speed */
#define DEFAULT_MENU_SCREENSAVER_ANIMATION MENU_SCREENSAVER_BLANK
#define DEFAULT_MENU_SCREENSAVER_ANIMATION_SPEED 1.0f
#endif
#define DEFAULT_CONTENT_SHOW_SETTINGS true
#define DEFAULT_CONTENT_SHOW_HISTORY true
#define DEFAULT_CONTENT_SHOW_FAVORITES true
#ifdef HAVE_IMAGEVIEWER
#define DEFAULT_CONTENT_SHOW_IMAGES true
#endif
#define DEFAULT_CONTENT_SHOW_MUSIC false
2018-06-19 22:50:58 -04:00
#if defined(HAVE_FFMPEG) || defined(HAVE_MPV)
#define DEFAULT_CONTENT_SHOW_VIDEO true
#endif
#if defined(HAVE_NETWORKING)
#if defined(_3DS)
#define DEFAULT_CONTENT_SHOW_NETPLAY false
#else
#define DEFAULT_CONTENT_SHOW_NETPLAY true
#endif
#endif
/* Specifies 'add content' visibility when using
* menus WITH a dedicated 'Import Content' tab */
#define DEFAULT_MENU_CONTENT_SHOW_ADD true
/* Specifies 'add content' visibility when using
* menus WITHOUT a dedicated 'Import Content' tab */
#define DEFAULT_MENU_CONTENT_SHOW_ADD_ENTRY MENU_ADD_CONTENT_ENTRY_DISPLAY_PLAYLISTS_TAB
#define DEFAULT_CONTENT_SHOW_PLAYLISTS true
#if defined(HAVE_LIBRETRODB)
#define DEFAULT_MENU_CONTENT_SHOW_EXPLORE true
#endif
2022-02-22 13:23:48 -05:00
#define DEFAULT_MENU_CONTENT_SHOW_CONTENTLESS_CORES MENU_CONTENTLESS_CORES_DISPLAY_SINGLE_PURPOSE
2016-07-24 05:32:45 -04:00
#ifdef HAVE_XMB
#define DEFAULT_XMB_ANIMATION 0
#define DEFAULT_XMB_VERTICAL_FADE_FACTOR 100
#define DEFAULT_XMB_SHOW_TITLE_HEADER true
2022-12-25 12:17:16 -05:00
#define DEFAULT_XMB_SWITCH_ICONS true
#define DEFAULT_XMB_TITLE_MARGIN 5
#define DEFAULT_XMB_TITLE_MARGIN_HORIZONTAL_OFFSET 0
#define MAXIMUM_XMB_TITLE_MARGIN 12
#define DEFAULT_XMB_ALPHA_FACTOR 90
#define DEFAULT_MENU_FONT_COLOR_RED 255
#define DEFAULT_MENU_FONT_COLOR_GREEN 255
#define DEFAULT_MENU_FONT_COLOR_BLUE 255
2020-03-11 21:15:05 -04:00
#ifdef HAVE_ODROIDGO2
#define DEFAULT_XMB_MENU_LAYOUT 2
2020-03-11 21:15:05 -04:00
#else
#define DEFAULT_XMB_MENU_LAYOUT 0
2020-03-11 21:15:05 -04:00
#endif
#define DEFAULT_XMB_ICON_THEME XMB_ICON_THEME_MONOCHROME
#define DEFAULT_XMB_THEME XMB_THEME_ELECTRIC_BLUE
2019-06-14 05:13:02 -04:00
#if defined(HAVE_LAKKA) || defined(__arm__) || defined(__PPC64__) || defined(__ppc64__) || defined(__powerpc64__) || defined(__powerpc__) || defined(__ppc__) || defined(__POWERPC__)
2019-06-14 05:13:02 -04:00
#define DEFAULT_XMB_SHADOWS_ENABLE false
#else
2019-06-14 05:13:02 -04:00
#define DEFAULT_XMB_SHADOWS_ENABLE true
#endif
2016-07-24 05:32:45 -04:00
#endif
2016-04-30 22:46:16 -04:00
#define DEFAULT_MENU_FRAMEBUFFER_OPACITY 0.900f
#define DEFAULT_MENU_WALLPAPER_OPACITY 0.900f
#define DEFAULT_MENU_FOOTER_OPACITY 1.000f
#define DEFAULT_MENU_HEADER_OPACITY 1.000f
2016-07-11 11:41:06 -04:00
#if defined(HAVE_OPENGLES2) || (defined(__MACH__) && defined(MAC_OS_X_VERSION_MAX_ALLOWED) && (MAC_OS_X_VERSION_MAX_ALLOWED < 101200))
2019-06-14 05:13:02 -04:00
#define DEFAULT_MENU_SHADER_PIPELINE 1
#else
2019-06-14 05:13:02 -04:00
#define DEFAULT_MENU_SHADER_PIPELINE 2
#endif
2016-02-08 00:34:13 -05:00
#define DEFAULT_SHOW_ADVANCED_SETTINGS true
2019-06-14 05:13:02 -04:00
#define DEFAULT_RGUI_COLOR_THEME RGUI_THEME_CLASSIC_GREEN
#define DEFAULT_RGUI_TRANSPARENCY true
2019-02-25 07:24:59 -05:00
#define DEFAULT_RGUI_INLINE_THUMBNAILS false
#define DEFAULT_RGUI_SWAP_THUMBNAILS false
#define DEFAULT_RGUI_THUMBNAIL_DOWNSCALER RGUI_THUMB_SCALE_POINT
#define DEFAULT_RGUI_THUMBNAIL_DELAY 0
#define DEFAULT_RGUI_INTERNAL_UPSCALE_LEVEL RGUI_UPSCALE_NONE
#define DEFAULT_RGUI_FULL_WIDTH_LAYOUT true
#define DEFAULT_RGUI_ASPECT RGUI_ASPECT_RATIO_4_3
#define DEFAULT_RGUI_ASPECT_LOCK RGUI_ASPECT_RATIO_LOCK_NONE
#define DEFAULT_RGUI_SHADOWS false
#define DEFAULT_RGUI_PARTICLE_EFFECT RGUI_PARTICLE_EFFECT_NONE
#define DEFAULT_RGUI_PARTICLE_EFFECT_SPEED 1.0f
2021-04-01 12:25:45 -04:00
#define DEFAULT_RGUI_PARTICLE_EFFECT_SCREENSAVER true
#define DEFAULT_RGUI_EXTENDED_ASCII false
#define DEFAULT_RGUI_SWITCH_ICONS true
#endif
2019-02-13 06:02:15 -05:00
#ifdef HAVE_MENU
#define DEFAULT_BLOCK_CONFIG_READ true
#else
2019-06-03 00:37:09 -04:00
#define DEFAULT_BLOCK_CONFIG_READ false
#endif
2019-10-23 20:45:05 -04:00
/* TODO/FIXME - this setting is thread-unsafe right now and can corrupt the stack - default to off */
#define DEFAULT_AUTOMATICALLY_ADD_CONTENT_TO_PLAYLIST false
2019-06-03 00:37:09 -04:00
#define DEFAULT_GAME_SPECIFIC_OPTIONS true
#define DEFAULT_AUTO_OVERRIDES_ENABLE true
#define DEFAULT_AUTO_REMAPS_ENABLE true
#define DEFAULT_INITIAL_DISK_CHANGE_ENABLE true
#define DEFAULT_GLOBAL_CORE_OPTIONS false
#define DEFAULT_AUTO_SHADERS_ENABLE true
2023-08-16 21:08:08 -04:00
#define DEFAULT_SORT_SAVEFILES_ENABLE true
#define DEFAULT_SORT_SAVESTATES_ENABLE true
#define DEFAULT_SORT_SAVEFILES_BY_CONTENT_ENABLE false
#define DEFAULT_SORT_SAVESTATES_BY_CONTENT_ENABLE false
#define DEFAULT_SORT_SCREENSHOTS_BY_CONTENT_ENABLE false
#define DEFAULT_SAVESTATES_IN_CONTENT_DIR false
#define DEFAULT_SAVEFILES_IN_CONTENT_DIR false
#define DEFAULT_SYSTEMFILES_IN_CONTENT_DIR false
#define DEFAULT_SCREENSHOTS_IN_CONTENT_DIR false
2017-08-05 13:31:58 -04:00
2023-08-27 18:48:39 -04:00
#if defined(RS90) || defined(RETROFW) || defined(MIYOO) || defined(SWITCH) || defined(ORBIS) || defined(__WINRT__)
#define DEFAULT_MENU_TOGGLE_GAMEPAD_COMBO INPUT_COMBO_START_SELECT
#elif defined(_XBOX1) || defined(__PS3__) || defined(_XBOX360) || defined(DINGUX)
#define DEFAULT_MENU_TOGGLE_GAMEPAD_COMBO INPUT_COMBO_L3_R3
#elif defined(PS2) || defined(PSP)
#define DEFAULT_MENU_TOGGLE_GAMEPAD_COMBO INPUT_COMBO_HOLD_START
#elif defined(VITA)
#define DEFAULT_MENU_TOGGLE_GAMEPAD_COMBO INPUT_COMBO_L1_R1_START_SELECT
#elif TARGET_OS_TV
#define DEFAULT_MENU_TOGGLE_GAMEPAD_COMBO INPUT_COMBO_DOWN_Y_L_R
2015-07-09 00:27:17 -04:00
#else
#define DEFAULT_MENU_TOGGLE_GAMEPAD_COMBO INPUT_COMBO_NONE
2015-07-09 00:27:17 -04:00
#endif
#define DEFAULT_QUIT_GAMEPAD_COMBO INPUT_COMBO_NONE
2016-10-14 15:57:18 -04:00
#if defined(VITA)
#define DEFAULT_INPUT_BACKTOUCH_ENABLE false
#define DEFAULT_INPUT_BACKTOUCH_TOGGLE false
2016-10-14 15:57:18 -04:00
#endif
#define DEFAULT_OVERLAY_ENABLE_AUTOPREFERRED true
#if defined(HAVE_OVERLAY)
#if defined(RARCH_MOBILE)
#define DEFAULT_OVERLAY_SHOW_INPUTS OVERLAY_SHOW_INPUT_TOUCHED
#else
#define DEFAULT_OVERLAY_SHOW_INPUTS OVERLAY_SHOW_INPUT_PHYSICAL
#endif
#endif
#define DEFAULT_OVERLAY_SHOW_INPUTS_PORT 0
2017-08-16 16:30:15 -04:00
#define DEFAULT_OVERLAY_DPAD_DIAGONAL_SENSITIVITY 80
#define DEFAULT_OVERLAY_ABXY_DIAGONAL_SENSITIVITY 50
#if defined(ANDROID) || defined(_WIN32) || defined(HAVE_STEAM) || TARGET_OS_TV
2019-07-19 07:30:11 -04:00
#define DEFAULT_MENU_SWAP_OK_CANCEL_BUTTONS true
#else
2019-07-19 07:30:11 -04:00
#define DEFAULT_MENU_SWAP_OK_CANCEL_BUTTONS false
#endif
#define DEFAULT_MENU_SWAP_SCROLL_BUTTONS false
#if defined(WIIU)
#define DEFAULT_ALL_USERS_CONTROL_MENU true
#else
#define DEFAULT_ALL_USERS_CONTROL_MENU false
#endif
2019-07-19 07:30:11 -04:00
#define DEFAULT_QUIT_PRESS_TWICE true
2019-02-25 13:12:50 -05:00
2019-07-19 07:30:11 -04:00
#define DEFAULT_LOG_TO_FILE false
#define DEFAULT_LOG_TO_FILE_TIMESTAMP false
2019-03-05 17:34:05 -05:00
2014-09-08 11:12:37 -04:00
/* Crop overscanned frames. */
#define DEFAULT_CROP_OVERSCAN true
2011-05-05 08:13:12 -04:00
2014-09-08 11:12:37 -04:00
/* Font size for on-screen messages. */
2019-12-28 21:21:57 -05:00
#if defined(DINGUX)
#define DEFAULT_FONT_SIZE 12
#elif defined(PS2)
#define DEFAULT_FONT_SIZE 16
2019-12-28 21:21:57 -05:00
#else
#define DEFAULT_FONT_SIZE 32
2019-12-28 21:21:57 -05:00
#endif
2015-08-30 18:55:34 -04:00
/* Offset for where messages will be placed on-screen.
2014-09-08 11:12:37 -04:00
* Values are in range [0.0, 1.0]. */
#define DEFAULT_MESSAGE_POS_OFFSET_X 0.05f
#define DEFAULT_MESSAGE_POS_OFFSET_Y 0.05f
2011-01-22 20:59:44 -05:00
2014-09-08 11:12:37 -04:00
/* Color of the message.
* RGB hex value. */
#define DEFAULT_MESSAGE_COLOR 0xffff00
2014-09-08 11:12:37 -04:00
#define DEFAULT_MESSAGE_BGCOLOR_ENABLE false
#define DEFAULT_MESSAGE_BGCOLOR_RED 0
#define DEFAULT_MESSAGE_BGCOLOR_GREEN 0
#define DEFAULT_MESSAGE_BGCOLOR_BLUE 0
#define DEFAULT_MESSAGE_BGCOLOR_OPACITY 1.0f
2014-09-08 11:12:37 -04:00
/* Record post-filtered (CPU filter) video,
* rather than raw game output. */
2019-06-14 05:13:02 -04:00
#define DEFAULT_POST_FILTER_RECORD false
2011-08-10 23:25:31 -04:00
2014-09-08 11:12:37 -04:00
/* Screenshots post-shaded GPU output if available. */
2019-06-14 05:13:02 -04:00
#define DEFAULT_GPU_SCREENSHOT true
/* Watch shader files for changes and auto-apply as necessary. */
2019-06-14 05:13:02 -04:00
#define DEFAULT_VIDEO_SHADER_WATCH_FILES false
/* Initialise file browser with last used directory
* when selecting shader presets/passes via the menu */
#define DEFAULT_VIDEO_SHADER_REMEMBER_LAST_DIR false
/* Screenshots named automatically. */
2019-06-14 05:13:02 -04:00
#define DEFAULT_AUTO_SCREENSHOT_FILENAME true
2014-09-08 11:12:37 -04:00
/* Record post-shaded GPU output instead of raw game footage if available. */
2019-06-14 05:13:02 -04:00
#define DEFAULT_GPU_RECORD false
2012-08-25 16:38:49 -04:00
2014-09-08 11:12:37 -04:00
/* OSD-messages. */
2019-06-14 05:13:02 -04:00
#define DEFAULT_FONT_ENABLE true
2011-11-09 18:15:41 -05:00
2014-09-08 11:12:37 -04:00
/* The accurate refresh rate of your monitor (Hz).
* This is used to calculate audio input rate with the formula:
2015-08-30 18:55:34 -04:00
* audio_input_rate = game_input_rate * display_refresh_rate /
2014-09-08 11:12:37 -04:00
* game_refresh_rate.
*
* If the implementation does not report any values,
* NTSC defaults will be assumed for compatibility.
* This value should stay close to 60Hz to avoid large pitch changes.
2015-08-30 18:55:34 -04:00
* If your monitor does not run at 60Hz, or something close to it,
2014-09-08 11:12:37 -04:00
* disable VSync, and leave this at its default. */
2015-09-28 15:09:07 -04:00
#ifdef _3DS
#define DEFAULT_REFRESH_RATE ((32730.0f * 8192.0f) / 4481134.0f)
2019-07-19 07:06:07 -04:00
#elif defined(RARCH_CONSOLE)
#define DEFAULT_REFRESH_RATE (60 / 1.001f)
2019-07-19 07:06:07 -04:00
#else
2019-07-19 07:14:29 -04:00
#define DEFAULT_REFRESH_RATE (60)
2011-12-02 09:59:07 -05:00
#endif
2019-07-19 07:14:29 -04:00
#define DEFAULT_CRT_REFRESH_RATE (DEFAULT_REFRESH_RATE)
2015-08-30 18:55:34 -04:00
/* Allow games to set rotation. If false, rotation requests are
2014-09-08 11:12:37 -04:00
* honored, but ignored.
* Used for setups where one manually rotates the monitor. */
2019-06-14 05:13:02 -04:00
#define DEFAULT_ALLOW_ROTATE true
2012-04-01 10:12:04 -04:00
2022-08-17 02:23:07 -04:00
#ifdef _3DS
/* Enable New3DS clock and L2 cache */
#define DEFAULT_NEW_3DS_SPEEDUP_ENABLE true
/* Enable bottom LCD screen */
#define DEFAULT_VIDEO_3DS_LCD_BOTTOM true
/* Sets video display mode (3D, 2D, etc.) */
#define DEFAULT_VIDEO_3DS_DISPLAY_MODE CTR_VIDEO_MODE_3D
2022-08-17 02:23:07 -04:00
#define DEFAULT_BOTTOM_FONT_ENABLE true
#define DEFAULT_BOTTOM_FONT_COLOR 255
#define DEFAULT_BOTTOM_FONT_SCALE 1.48f
#endif
#ifdef WIIU
/* On Wii U, whether to optimize for the native TV resolution
* or exactly 2x the Wii U GamePad resolution. */
#define DEFAULT_WIIU_PREFER_DRC false
#endif
2014-09-08 11:12:37 -04:00
/* AUDIO */
2010-12-22 09:58:43 -05:00
2014-09-08 11:12:37 -04:00
/* Will enable audio or not. */
#define DEFAULT_AUDIO_ENABLE true
2010-12-22 09:58:43 -05:00
2019-01-27 11:22:16 -05:00
/* Enable menu audio sounds. */
#define DEFAULT_AUDIO_ENABLE_MENU false
#define DEFAULT_AUDIO_ENABLE_MENU_OK false
#define DEFAULT_AUDIO_ENABLE_MENU_CANCEL false
#define DEFAULT_AUDIO_ENABLE_MENU_NOTICE false
#define DEFAULT_AUDIO_ENABLE_MENU_BGM false
#define DEFAULT_AUDIO_ENABLE_MENU_SCROLL false
#ifdef HAVE_GFX_WIDGETS
2019-06-14 05:13:02 -04:00
#define DEFAULT_MENU_ENABLE_WIDGETS true
#else
2019-06-14 05:13:02 -04:00
#define DEFAULT_MENU_ENABLE_WIDGETS false
#endif
2019-01-27 11:22:16 -05:00
/* Display an animation when loading content
* > Currently implemented only as a widget */
#define DEFAULT_MENU_SHOW_LOAD_CONTENT_ANIMATION DEFAULT_MENU_ENABLE_WIDGETS
2020-07-16 11:30:38 -04:00
/* Display a notification when successfully
* connecting/disconnecting an autoconfigured
* controller
* > Disabled by default on the Switch */
#if defined(HAVE_LIBNX) && defined(HAVE_GFX_WIDGETS)
#define DEFAULT_NOTIFICATION_SHOW_AUTOCONFIG false
#else
#define DEFAULT_NOTIFICATION_SHOW_AUTOCONFIG true
#endif
/* Display a notification when cheats are being
* applied */
#define DEFAULT_NOTIFICATION_SHOW_CHEATS_APPLIED true
/* Display a notification when applying an
XDelta patch support (Take 2) (#15915) * Add xdelta in deps * Include <assert.h> in xdelta3.h - Otherwise the static_assert calls can fail * Build xdelta3 in Makefile.common * Add xdelta support to the softpatching infrastructure - The patching itself isn't fully implemented yet * Adjust how xdelta3.h checks the sizes of some types - Now checks max values instead of relying on autotools * Add some enums that were excluded by the cherry-pick * Remove stray whitespace * Adjust SIZE macros in xdelta3.h - Move them outside the XD3_USE_LARGEFILE64 block - Add more SIZE declarations - Make SIZEOF_UNSIGNED_LONG_LONG contingent on the presence of ULLONG_MAX * Reintegrate xdelta support * Enable support for xdelta's secondary compressors - Necessary for some patches * Fix some format specifiers * Remove unnecessary files from xdelta * Include xdelta3.h with a relative path * Add xdelta3 headers to HEADERS variable * Gate Xdelta support behind HAVE_XDELTA - HAVE_XDELTA is on by default - HAVE_PATCH is still required for HAVE_XDELTA to be meaningful - Support is mostly contingent on the availability of LZMA - Anything modern should be okay - Legacy platforms (e.g. DOS) may need to have Xdelta support disabled - At least until some other solution can be found * Disable HAVE_XDELTA on platforms where the build recently failed - These come from looking at the failed builds on GitHub - These are guesses, and may turn out to be wrong * Fix a potential memory leak - Whoops, looks like I need to call two cleanup functions - xd3_close_stream exists separately from xd3_free_stream * Split the --help printout for --xdelta into its own strlcat call - GCC was complaining about #ifdefs within macro arguments being non-portable * Fix some incorrect printf format specifiers * Modify Xdelta to adhere to C89 - It's mostly using RetroArch's INLINE macro instead of the inline keyword * Slight cleanups * Remove a stray comma that was hindering C89 builds * Add XDelta support to CHANGES.md * Change how the xdelta patch's name is computed - To be in line with other recent refactoring * Fix an incorrect merge - Whoops, this part was from before I figured out how to get the size of a patched file * Explain the song-and-dance behind computing a patched file's size * Define some XDelta3-related constants to 0 on 32-bit platforms * Adjust some Xdelta-related macro definitions - Exclude the encoder, since we're not making patches - Move some #defines to after inclusion of <stdint.h>, to fix undefined behavior - Remove _WIN32_WINNT overrides, since they were for code that we're not using * Fix Xdelta support * Wrap an encoder-only function in `#if XD3_ENCODER`
2023-11-23 23:19:07 -05:00
* IPS/BPS/UPS/Xdelta patch file */
#define DEFAULT_NOTIFICATION_SHOW_PATCH_APPLIED true
2020-07-16 11:30:38 -04:00
/* Display a notification when loading an
* input remap file */
#define DEFAULT_NOTIFICATION_SHOW_REMAP_LOAD true
/* Display a notification when loading a
* configuration override file */
#define DEFAULT_NOTIFICATION_SHOW_CONFIG_OVERRIDE_LOAD true
/* Display a notification when automatically restoring
* at launch the last used disk of multi-disk content */
#define DEFAULT_NOTIFICATION_SHOW_SET_INITIAL_DISK true
/* Display disc control notifications */
#define DEFAULT_NOTIFICATION_SHOW_DISK_CONTROL true
/* Display save state notifications */
#define DEFAULT_NOTIFICATION_SHOW_SAVE_STATE true
2020-07-16 11:30:38 -04:00
/* Display a notification when fast forwarding
* content */
#define DEFAULT_NOTIFICATION_SHOW_FAST_FORWARD true
#if defined(HAVE_SCREENSHOTS)
/*Display a notification when taking a screenshot*/
#define DEFAULT_NOTIFICATION_SHOW_SCREENSHOT true
/*Desired duration of the screenshot notification*/
2020-07-19 19:58:49 -04:00
#define DEFAULT_NOTIFICATION_SHOW_SCREENSHOT_DURATION 0
/* Display a white flashing effect with the desired
* duration when taking a screenshot*/
#define DEFAULT_NOTIFICATION_SHOW_SCREENSHOT_FLASH 0
#endif
2021-04-06 09:02:40 -04:00
/* Display a notification when setting the refresh rate*/
#if defined(_3DS) || (defined(DINGUX) && defined(DINGUX_BETA))
/* 3DS and OpenDingux Beta devices set refresh rate
* on gfx driver init - set default notification
* state to 'false' in order to avoid OSD log spam */
#define DEFAULT_NOTIFICATION_SHOW_REFRESH_RATE false
#else
#define DEFAULT_NOTIFICATION_SHOW_REFRESH_RATE true
2021-04-06 09:02:40 -04:00
#endif
#ifdef HAVE_NETWORKING
#define DEFAULT_NOTIFICATION_SHOW_NETPLAY_EXTRA false
#endif
#ifdef HAVE_MENU
#define DEFAULT_NOTIFICATION_SHOW_WHEN_MENU_IS_ALIVE false
#endif
2014-09-08 11:12:37 -04:00
/* Output samplerate. */
#if defined(GEKKO) || defined(MIYOO)
#define DEFAULT_OUTPUT_RATE 32000
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
#define DEFAULT_INPUT_RATE 32000
#elif defined(_3DS) || defined(RETROFW)
#define DEFAULT_OUTPUT_RATE 32730
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
#define DEFAULT_INPUT_RATE 32730
#elif defined(EMSCRIPTEN)
#define DEFAULT_OUTPUT_RATE 44100
#define DEFAULT_INPUT_RATE 44100
2015-09-06 18:05:59 -04:00
#else
#define DEFAULT_OUTPUT_RATE 48000
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
#define DEFAULT_INPUT_RATE 48000
2015-09-06 18:05:59 -04:00
#endif
2010-12-22 09:58:43 -05:00
2014-09-08 11:12:37 -04:00
/* Audio device (e.g. hw:0,0 or /dev/audio). If NULL, will use defaults. */
2019-06-14 05:13:02 -04:00
#define DEFAULT_AUDIO_DEVICE NULL
2010-12-22 09:58:43 -05:00
2015-08-30 18:55:34 -04:00
/* Desired audio latency in milliseconds. Might not be honored
2014-09-08 11:12:37 -04:00
* if driver can't provide given latency. */
#if defined(ANDROID) || defined(EMSCRIPTEN) || defined(RETROFW) || defined(MIYOO)
/* For most Android devices, 64ms is way too low. */
#define DEFAULT_OUT_LATENCY 128
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
#define DEFAULT_IN_LATENCY 128
#else
#define DEFAULT_OUT_LATENCY 64
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
#define DEFAULT_IN_LATENCY 64
#endif
2010-12-22 09:58:43 -05:00
2014-09-08 11:12:37 -04:00
/* Will sync audio. (recommended) */
#ifdef IOS
/* FIXME: coreaudio will cause the main thread to hang on backgrounding, causing a crash */
#define DEFAULT_AUDIO_SYNC false
#else
#define DEFAULT_AUDIO_SYNC true
#endif
2010-12-22 09:58:43 -05:00
2014-09-08 11:12:37 -04:00
/* Audio rate control. */
#if !defined(RARCH_CONSOLE)
#define DEFAULT_RATE_CONTROL true
#else
#define DEFAULT_RATE_CONTROL false
#endif
2012-02-13 19:16:37 -05:00
2015-08-30 18:55:34 -04:00
/* Rate control delta. Defines how much rate_control
2014-09-08 11:12:37 -04:00
* is allowed to adjust input rate. */
#define DEFAULT_RATE_CONTROL_DELTA 0.005f
2012-02-13 19:16:37 -05:00
/* Maximum timing skew. Defines how much adjust_system_rates
* is allowed to adjust input rate. */
#define DEFAULT_MAX_TIMING_SKEW 0.05f
2014-09-08 11:12:37 -04:00
/* Default audio volume in dB. (0.0 dB == unity gain). */
#define DEFAULT_AUDIO_VOLUME 0.0f
2017-06-08 16:58:43 -04:00
/* Default audio volume of the audio mixer in dB. (0.0 dB == unity gain). */
#define DEFAULT_AUDIO_MIXER_VOLUME 0.0f
2017-06-08 16:58:43 -04:00
2017-04-28 22:40:24 -04:00
#ifdef HAVE_WASAPI
/* WASAPI defaults */
#define DEFAULT_WASAPI_EXCLUSIVE_MODE false
2020-02-03 22:21:31 -05:00
#define DEFAULT_WASAPI_FLOAT_FORMAT false
/* Automatic shared mode buffer */
#define DEFAULT_WASAPI_SH_BUFFER_LENGTH 0
2017-04-28 22:40:24 -04:00
#endif
#if TARGET_OS_IOS
/* Respect silent mode (false will render audio in silent mode) */
#define DEFAULT_AUDIO_RESPECT_SILENT_MODE true
#endif
/* Automatically mute audio when fast forward
* is enabled */
#define DEFAULT_AUDIO_FASTFORWARD_MUTE false
/* Speed up audio to match fast-forward speed up.
* Avoids crackling */
#define DEFAULT_AUDIO_FASTFORWARD_SPEEDUP 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
#ifdef HAVE_MICROPHONE
/* Microphone support */
#define DEFAULT_MICROPHONE_ENABLE true
#define DEFAULT_MICROPHONE_DEVICE NULL
#ifdef HAVE_WASAPI
#define DEFAULT_WASAPI_MICROPHONE_SH_BUFFER_LENGTH 0
#endif
#endif
2014-09-08 11:12:37 -04:00
/* MISC */
2012-02-13 19:16:37 -05:00
2014-09-08 11:12:37 -04:00
/* Enables displaying the current frames per second. */
#define DEFAULT_FPS_SHOW false
/* FPS display will be updated at the set interval (in frames) */
#define DEFAULT_FPS_UPDATE_INTERVAL 256
/* Memory status display will be updated at the set interval (in frames) */
#define DEFAULT_MEMORY_UPDATE_INTERVAL 256
/* Enables displaying the current frame count. */
#define DEFAULT_FRAMECOUNT_SHOW false
/* Includes displaying the current memory usage/total with FPS/Frames. */
#define DEFAULT_MEMORY_SHOW false
2019-02-13 17:41:13 -05:00
/* Enables displaying various timing statistics. */
#define DEFAULT_STATISTICS_SHOW false
2019-02-13 17:41:13 -05:00
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 10:58:01 -05:00
/* Enables displaying the current netplay room ping. */
#define DEFAULT_NETPLAY_PING_SHOW false
2015-08-30 18:55:34 -04:00
/* Enables use of rewind. This will incur some memory footprint
2014-09-08 11:12:37 -04:00
* depending on the save state buffer. */
#define DEFAULT_REWIND_ENABLE false
2011-01-31 12:06:57 -05:00
/* When set, any time a cheat is toggled it is immediately applied. */
#define DEFAULT_APPLY_CHEATS_AFTER_TOGGLE false
/* When set, all enabled cheats are auto-applied when a game is loaded. */
#define DEFAULT_APPLY_CHEATS_AFTER_LOAD false
2021-07-27 06:39:24 -04:00
#if defined(RETROFW) || defined(MIYOO)
2021-07-27 06:39:24 -04:00
/*RETROFW jz4760 has signficant slowdown with default settings */
#define DEFAULT_REWIND_BUFFER_SIZE (1 << 20)
#define DEFAULT_REWIND_BUFFER_SIZE_STEP 1
#define DEFAULT_REWIND_GRANULARITY 6
#else
2015-08-30 18:55:34 -04:00
/* The buffer size for the rewind buffer. This needs to be about
2014-09-08 11:12:37 -04:00
* 15-20MB per minute. Very game dependant. */
#define DEFAULT_REWIND_BUFFER_SIZE (20 << 20) /* 20MiB */
2011-01-31 12:06:57 -05:00
/* The amount of MB to increase/decrease the rewind_buffer_size when it is changed via the UI. */
#define DEFAULT_REWIND_BUFFER_SIZE_STEP 10 /* 10MB */
2014-09-08 11:12:37 -04:00
/* How many frames to rewind at a time. */
#define DEFAULT_REWIND_GRANULARITY 1
2021-07-27 06:39:24 -04:00
#endif
/* Pause gameplay when window loses focus. */
#if defined(EMSCRIPTEN)
#define DEFAULT_PAUSE_NONACTIVE false
#else
#define DEFAULT_PAUSE_NONACTIVE true
#endif
2010-12-22 09:58:43 -05:00
/* Pause gameplay when controller disconnects. */
#define DEFAULT_PAUSE_ON_DISCONNECT false
2014-09-08 11:12:37 -04:00
/* Saves non-volatile SRAM at a regular interval.
* It is measured in seconds. A value of 0 disables autosave. */
#if defined(__i386__) || defined(__i486__) || defined(__i686__) || defined(__x86_64__) || defined(_M_X64) || defined(_WIN32) || defined(OSX) || defined(ANDROID) || defined(IOS) || defined(DINGUX)
/* Flush to file every 10 seconds on modern platforms by default */
#define DEFAULT_AUTOSAVE_INTERVAL 10
#else
/* Default to disabled on I/O-constrained platforms */
#define DEFAULT_AUTOSAVE_INTERVAL 0
#endif
2011-02-10 15:16:59 -05:00
/* Netplay lobby filters */
#define DEFAULT_NETPLAY_SHOW_ONLY_CONNECTABLE true
#define DEFAULT_NETPLAY_SHOW_ONLY_INSTALLED_CORES false
#define DEFAULT_NETPLAY_SHOW_PASSWORDED true
/* Publicly announce netplay */
#define DEFAULT_NETPLAY_PUBLIC_ANNOUNCE true
/* Start netplay in spectator mode */
#define DEFAULT_NETPLAY_START_AS_SPECTATOR false
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 10:58:01 -05:00
/* Netplay chat fading toggle */
#define DEFAULT_NETPLAY_FADE_CHAT true
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 10:58:01 -05:00
/* Netplay chat colors */
#define DEFAULT_NETPLAY_CHAT_COLOR_NAME 0x008000
#define DEFAULT_NETPLAY_CHAT_COLOR_MSG 0xFFFFFF
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 10:58:01 -05:00
/* Allow players to pause */
#define DEFAULT_NETPLAY_ALLOW_PAUSING false
/* Allow connections in slave mode */
#define DEFAULT_NETPLAY_ALLOW_SLAVES true
/* Require connections only in slave mode */
#define DEFAULT_NETPLAY_REQUIRE_SLAVES false
2015-08-30 18:55:34 -04:00
/* When being client over netplay, use keybinds for
* user 1 rather than user 2. */
#define DEFAULT_NETPLAY_CLIENT_SWAP_INPUT true
2011-02-20 06:12:53 -05:00
#define DEFAULT_NETPLAY_NAT_TRAVERSAL false
2016-12-13 22:03:10 -05:00
#define DEFAULT_NETPLAY_DELAY_FRAMES 16
#define DEFAULT_NETPLAY_CHECK_FRAMES 600
#define DEFAULT_NETPLAY_USE_MITM_SERVER false
2020-02-10 05:49:50 -05:00
#define DEFAULT_NETPLAY_MITM_SERVER "nyc"
#ifdef HAVE_NETWORKING
#define DEFAULT_NETPLAY_MAX_CONNECTIONS 3
#define DEFAULT_NETPLAY_MAX_PING 0
2017-09-10 22:49:25 -04:00
#define DEFAULT_NETPLAY_SHARE_DIGITAL RARCH_NETPLAY_SHARE_DIGITAL_NO_SHARING
#define DEFAULT_NETPLAY_SHARE_ANALOG RARCH_NETPLAY_SHARE_ANALOG_NO_SHARING
#endif
2017-09-10 22:49:25 -04:00
2014-09-08 11:12:37 -04:00
/* On save state load, block SRAM from being overwritten.
* This could potentially lead to buggy games. */
2019-06-02 15:02:59 -04:00
#define DEFAULT_BLOCK_SRAM_OVERWRITE false
2015-08-30 18:55:34 -04:00
/* When saving savestates, state index is automatically
2014-09-08 11:12:37 -04:00
* incremented before saving.
2015-08-30 18:55:34 -04:00
* When the content is loaded, state index will be set
2014-09-08 11:12:37 -04:00
* to the highest existing value. */
#define DEFAULT_SAVESTATE_AUTO_INDEX false
2011-09-27 09:31:25 -04:00
/* Specifies the maximum number of savestates to keep
* when savestate auto index is enabled
* > When limit is exceeded, savestate with the lowest
* index will be deleted automatically when creating
* a new savestate
* > Setting value to zero disables the limit (no
* savestates will be deleted in this case) */
#define DEFAULT_SAVESTATE_MAX_KEEP 0
/* When recording replays, replay index is automatically
* incremented before recording starts.
* When the content is loaded, replay index will be set
* to the highest existing value. */
#define DEFAULT_REPLAY_AUTO_INDEX true
/* Specifies the maximum number of replays to keep
* when replay auto index is enabled
* > When limit is exceeded, replay with the lowest
* index will be deleted automatically when creating
* a new replay
* > Setting value to zero disables the limit (no
* replays will be deleted in this case) */
#define DEFAULT_REPLAY_MAX_KEEP 0
/* Specifies how often checkpoints will be saved to replay files during recording.
* > Setting value to zero disables recording checkpoints. */
#define DEFAULT_REPLAY_CHECKPOINT_INTERVAL 0
2014-09-08 11:12:37 -04:00
/* Automatically saves a savestate at the end of RetroArch's lifetime.
* The path is $SRAM_PATH.auto.
2015-08-30 18:55:34 -04:00
* RetroArch will automatically load any savestate with this path on
2014-09-08 11:12:37 -04:00
* startup if savestate_auto_load is set. */
#define DEFAULT_SAVESTATE_AUTO_SAVE false
#define DEFAULT_SAVESTATE_AUTO_LOAD false
2012-06-02 15:33:37 -04:00
#define DEFAULT_SAVESTATE_THUMBNAIL_ENABLE false
/* When creating save (srm) files, compress
* written data */
#define DEFAULT_SAVE_FILE_COMPRESSION false
2020-04-15 10:48:41 -04:00
/* When creating save state files, compress
* written data */
#if defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
#define DEFAULT_SAVESTATE_FILE_COMPRESSION false
#else
#define DEFAULT_SAVESTATE_FILE_COMPRESSION true
#endif
2020-04-15 10:48:41 -04:00
2014-09-08 11:12:37 -04:00
/* Slowmotion ratio. */
#define DEFAULT_SLOWMOTION_RATIO 3.0f
2012-03-04 06:01:07 -05:00
/* Maximum fast forward ratio. */
#define DEFAULT_FASTFORWARD_RATIO 0.0f
#define MAXIMUM_FASTFORWARD_RATIO 50.0f
/* Skip frames when fast forwarding. */
#define DEFAULT_FASTFORWARD_FRAMESKIP true
2018-08-04 18:34:10 -04:00
/* Enable runloop for variable refresh rate screens. Force x1 speed while handling fast forward too. */
#define DEFAULT_VRR_RUNLOOP_ENABLE false
2018-08-04 18:34:10 -04:00
2018-03-28 15:22:07 -04:00
/* Run core logic one or more frames ahead then load the state back to reduce perceived input lag. */
#define DEFAULT_RUN_AHEAD_FRAMES 1
2018-03-28 15:22:07 -04:00
/* When using the Run Ahead feature, use a secondary instance of the core. */
2020-02-03 22:21:31 -05:00
#define DEFAULT_RUN_AHEAD_SECONDARY_INSTANCE true
2018-03-28 15:22:07 -04:00
/* Hide warning messages when using the Run Ahead feature. */
2020-02-03 22:21:31 -05:00
#define DEFAULT_RUN_AHEAD_HIDE_WARNINGS false
/* Hide warning messages when using Preemptive Frames. */
#define DEFAULT_PREEMPT_HIDE_WARNINGS false
2014-09-08 11:12:37 -04:00
/* Enable stdin/network command interface. */
#define DEFAULT_NETWORK_CMD_ENABLE false
#define DEFAULT_NETWORK_CMD_PORT 55355
#define DEFAULT_NETWORK_REMOTE_BASE_PORT 55400
#define DEFAULT_STDIN_CMD_ENABLE false
2020-05-27 12:00:47 -04:00
#define DEFAULT_NETWORK_BUILDBOT_AUTO_EXTRACT_ARCHIVE true
#define DEFAULT_NETWORK_BUILDBOT_SHOW_EXPERIMENTAL_CORES false
/* Automatically create a backup whenever a core is
* updated via the online updater
* > Enable by default on all modern platforms with
* online updater support */
#if defined(HAVE_ONLINE_UPDATER) && (defined(__i386__) || defined(__i486__) || defined(__i686__) || defined(__x86_64__) || defined(_M_X64) || defined(_WIN32) || defined(OSX) || defined(ANDROID) || defined(IOS))
#define DEFAULT_CORE_UPDATER_AUTO_BACKUP true
#else
#define DEFAULT_CORE_UPDATER_AUTO_BACKUP false
#endif
/* Number of automatic core backups to retain
* (oldest backup will be deleted when creating
* a new one) */
#define DEFAULT_CORE_UPDATER_AUTO_BACKUP_HISTORY_SIZE 1
#if defined(ANDROID) || defined(__APPLE__)
2020-05-27 12:00:47 -04:00
#define DEFAULT_NETWORK_ON_DEMAND_THUMBNAILS true
#else
2020-05-27 12:00:47 -04:00
#define DEFAULT_NETWORK_ON_DEMAND_THUMBNAILS false
#endif
2014-09-08 11:12:37 -04:00
/* Number of entries that will be kept in content history playlist file. */
#define DEFAULT_CONTENT_HISTORY_SIZE 200
/* Number of entries that will be kept in content favorites playlist file.
* -1 == 'unlimited' (99999) */
#define DEFAULT_CONTENT_FAVORITES_SIZE 200
/* Sort all playlists (apart from histories) alphabetically */
#define DEFAULT_PLAYLIST_SORT_ALPHABETICAL true
2019-01-09 17:13:13 -05:00
/* File format to use when writing playlists to disk */
#define DEFAULT_PLAYLIST_USE_OLD_FORMAT false
2019-01-09 17:13:13 -05:00
2020-04-21 11:44:26 -04:00
/* When creating/updating playlists, compress written data */
#define DEFAULT_PLAYLIST_COMPRESSION false
2019-03-26 21:37:34 -04:00
#ifdef HAVE_MENU
/* Specify when to display 'core name' inline on playlist entries */
#define DEFAULT_PLAYLIST_SHOW_INLINE_CORE_NAME PLAYLIST_INLINE_CORE_DISPLAY_HIST_FAV
/* Specifies which runtime record to use on playlist sublabels */
#define DEFAULT_PLAYLIST_SUBLABEL_RUNTIME_TYPE PLAYLIST_RUNTIME_PER_CORE
/* Specifies time/date display format for runtime 'last played' data */
#define DEFAULT_PLAYLIST_SUBLABEL_LAST_PLAYED_STYLE PLAYLIST_LAST_PLAYED_STYLE_YMD_HM
#define DEFAULT_PLAYLIST_ENTRY_REMOVE_ENABLE PLAYLIST_ENTRY_REMOVE_ENABLE_ALL
2019-03-26 21:37:34 -04:00
#endif
2020-02-03 22:21:31 -05:00
#define DEFAULT_SCAN_WITHOUT_CORE_MATCH false
2019-05-05 15:54:49 -04:00
#define DEFAULT_SCAN_SERIAL_AND_CRC false
#ifdef __WINRT__
/* Be paranoid about WinRT file I/O performance, and leave this disabled by
* default */
#define DEFAULT_PLAYLIST_SHOW_SUBLABELS false
#else
#define DEFAULT_PLAYLIST_SHOW_SUBLABELS true
#endif
#define DEFAULT_PLAYLIST_SHOW_HISTORY_ICONS PLAYLIST_SHOW_HISTORY_ICONS_MAIN
/* Show the indices of playlist entries in
* a menu-driver-specific fashion */
#define DEFAULT_PLAYLIST_SHOW_ENTRY_IDX true
2020-02-03 22:21:31 -05:00
#define DEFAULT_PLAYLIST_FUZZY_ARCHIVE_MATCH false
#define DEFAULT_PLAYLIST_PORTABLE_PATHS false
#define DEFAULT_PLAYLIST_USE_FILENAME false
2014-09-08 11:12:37 -04:00
/* Show Menu start-up screen on boot. */
2020-02-03 22:21:31 -05:00
#define DEFAULT_MENU_SHOW_START_SCREEN true
2020-03-12 22:56:51 -04:00
/* Default scale factor for non-frambuffer-based display
* drivers and display widgets */
#if defined(VITA)
#define DEFAULT_MENU_SCALE_FACTOR 1.5f
2023-07-21 03:48:18 -04:00
#elif defined(__ANDROID__)
#define DEFAULT_MENU_SCALE_FACTOR 0.75f
#else
2019-10-09 06:33:02 -04:00
#define DEFAULT_MENU_SCALE_FACTOR 1.0f
#endif
2020-03-12 22:56:51 -04:00
/* Specifies whether display widgets should be scaled
* automatically using the default menu scale factor */
#define DEFAULT_MENU_WIDGET_SCALE_AUTO true
2020-03-12 22:56:51 -04:00
/* Default scale factor for display widgets when widget
* auto scaling is disabled (fullscreen mode) */
#define DEFAULT_MENU_WIDGET_SCALE_FACTOR 1.0f
2020-03-12 22:56:51 -04:00
/* Default scale factor for display widgets when widget
* auto scaling is disabled (windowed mode) */
#define DEFAULT_MENU_WIDGET_SCALE_FACTOR_WINDOWED 1.0f
2015-04-24 10:37:09 -04:00
2019-08-19 19:18:26 -04:00
/* Log level for the frontend */
#define DEFAULT_FRONTEND_LOG_LEVEL 1
2014-09-08 11:12:37 -04:00
/* Log level for libretro cores (GET_LOG_INTERFACE). */
2019-07-19 07:20:13 -04:00
#define DEFAULT_LIBRETRO_LOG_LEVEL 1
#ifndef RARCH_DEFAULT_PORT
#ifndef VITA
#define RARCH_DEFAULT_PORT 55435
#else
#define RARCH_DEFAULT_PORT 19492
#endif
#endif
2010-12-22 09:58:43 -05:00
#ifndef RARCH_STREAM_DEFAULT_PORT
#define RARCH_STREAM_DEFAULT_PORT 56400
#endif
2014-09-08 11:12:37 -04:00
/* KEYBINDS, JOYPAD */
2010-12-22 09:58:43 -05:00
2014-09-08 11:12:37 -04:00
/* Axis threshold (between 0.0 and 1.0)
* How far an axis must be tilted to result in a button press. */
2020-02-03 22:21:31 -05:00
#define DEFAULT_AXIS_THRESHOLD 0.5f
#define DEFAULT_ANALOG_DEADZONE 0.0f
#define DEFAULT_ANALOG_SENSITIVITY 1.0f
2010-12-22 09:58:43 -05:00
2014-09-08 11:12:37 -04:00
/* Describes speed of which turbo-enabled buttons toggle. */
#define DEFAULT_TURBO_PERIOD 6
#define DEFAULT_TURBO_DUTY_CYCLE 3
#define DEFAULT_TURBO_MODE 0
#define DEFAULT_TURBO_DEFAULT_BTN RETRO_DEVICE_ID_JOYPAD_B
#define DEFAULT_ALLOW_TURBO_DPAD false
2010-12-22 09:58:43 -05:00
/* Enable automatic mouse grab by default
* only on Android */
#if defined(ANDROID)
#define DEFAULT_INPUT_AUTO_MOUSE_GRAB true
#else
#define DEFAULT_INPUT_AUTO_MOUSE_GRAB false
#endif
#if TARGET_OS_IPHONE
#define DEFAULT_INPUT_KEYBOARD_GAMEPAD_ENABLE false
#else
#define DEFAULT_INPUT_KEYBOARD_GAMEPAD_ENABLE true
#endif
2014-09-08 11:12:37 -04:00
/* Enable input auto-detection. Will attempt to autoconfigure
* gamepads, plug-and-play style. */
#define DEFAULT_INPUT_AUTODETECT_ENABLE true
/* Enables accelerometer/gyroscope/illuminance
* sensor input, if supported */
#if defined(ANDROID)
/* Hardware sensors cause substantial battery
* drain on Android... */
#define DEFAULT_INPUT_SENSORS_ENABLE false
#else
#define DEFAULT_INPUT_SENSORS_ENABLE true
#endif
/* Automatically enable game focus when running or
* resuming content */
#define DEFAULT_INPUT_AUTO_GAME_FOCUS AUTO_GAME_FOCUS_OFF
2015-08-30 18:55:34 -04:00
/* Show the input descriptors set by the core instead
2014-12-04 07:26:27 -05:00
* of the default ones. */
#define DEFAULT_INPUT_DESCRIPTOR_LABEL_SHOW true
#define DEFAULT_INPUT_DESCRIPTOR_HIDE_UNBOUND false
2014-12-05 08:13:29 -05:00
#if defined(DINGUX)
#define DEFAULT_INPUT_MAX_USERS 1
#else
2023-04-09 13:08:33 -04:00
#define DEFAULT_INPUT_MAX_USERS 8
#endif
#define DEFAULT_INPUT_BIND_TIMEOUT 3
2023-11-15 16:18:57 -05:00
#define DEFAULT_INPUT_BIND_HOLD 0
#define DEFAULT_INPUT_POLL_TYPE_BEHAVIOR 2
#define DEFAULT_INPUT_HOTKEY_BLOCK_DELAY 5
#define DEFAULT_INPUT_HOTKEY_DEVICE_MERGE false
#define DEFAULT_GFX_THUMBNAILS_DEFAULT 3
2016-05-01 10:49:13 -04:00
#define DEFAULT_MENU_LEFT_THUMBNAILS_DEFAULT 0
#define DEFAULT_GFX_THUMBNAIL_UPSCALE_THRESHOLD 0
2019-09-09 10:15:28 -04:00
#ifdef HAVE_MENU
#if defined(RS90) || defined(MIYOO)
2021-07-14 10:27:07 -04:00
/* The RS-90 has a hardware clock that is neither
* configurable nor persistent, rendering it useless.
* We therefore hide it in the menu by default. */
#define DEFAULT_MENU_TIMEDATE_ENABLE false
#else
#define DEFAULT_MENU_TIMEDATE_ENABLE true
#endif
#define DEFAULT_MENU_TIMEDATE_STYLE MENU_TIMEDATE_STYLE_DDMM_HM
#define DEFAULT_MENU_TIMEDATE_DATE_SEPARATOR MENU_TIMEDATE_DATE_SEPARATOR_HYPHEN
#define DEFAULT_MENU_REMEMBER_SELECTION MENU_REMEMBER_SELECTION_ALWAYS
2019-09-09 10:15:28 -04:00
#endif
#define DEFAULT_XMB_VERTICAL_THUMBNAILS false
2018-04-04 18:52:46 -04:00
#define DEFAULT_XMB_THUMBNAIL_SCALE_FACTOR 100
2019-06-07 11:38:17 -04:00
#ifdef IOS
#define DEFAULT_UI_COMPANION_START_ON_BOOT false
#else
#define DEFAULT_UI_COMPANION_START_ON_BOOT true
#endif
#define DEFAULT_UI_COMPANION_ENABLE false
2018-04-30 14:33:05 -04:00
/* Currently only used to show the WIMP UI on startup */
#define DEFAULT_UI_COMPANION_TOGGLE false
2018-04-30 14:33:05 -04:00
/* Only init the WIMP UI for this session if this is enabled */
2020-02-03 22:21:31 -05:00
#define DEFAULT_DESKTOP_MENU_ENABLE true
/* Keep track of how long each core+content has been running for over time */
#ifdef __WINRT__
/* Be paranoid about WinRT file I/O performance, and leave this disabled by
* default */
#define DEFAULT_CONTENT_RUNTIME_LOG false
#else
2019-08-23 11:10:56 -04:00
#define DEFAULT_CONTENT_RUNTIME_LOG true
#endif
2020-02-03 22:21:31 -05:00
/* Keep track of how long each content has been running
* for over time (ignores core) */
#define DEFAULT_CONTENT_RUNTIME_LOG_AGGREGATE false
2019-07-19 14:00:31 -04:00
#define DEFAULT_UI_MENUBAR_ENABLE true
2021-03-03 06:02:32 -05:00
#if defined(__QNX__) || defined(_XBOX1) || defined(_XBOX360) || (defined(__MACH__) && defined(IOS)) || defined(ANDROID) || defined(WIIU) || defined(HAVE_NEON) || defined(GEKKO) || defined(__ARM_NEON__) || defined(__PS3__)
#define DEFAULT_AUDIO_RESAMPLER_QUALITY_LEVEL RESAMPLER_QUALITY_LOWER
#elif defined(PSP) || defined(_3DS) || defined(VITA) || defined(PS2) || defined(DINGUX) || defined(EMSCRIPTEN)
#define DEFAULT_AUDIO_RESAMPLER_QUALITY_LEVEL RESAMPLER_QUALITY_LOWEST
#else
#define DEFAULT_AUDIO_RESAMPLER_QUALITY_LEVEL RESAMPLER_QUALITY_NORMAL
#endif
2018-06-04 01:48:08 -04:00
/* MIDI */
#if defined(_WIN32) && !defined(_XBOX) && !defined(__WINRT__)
#define DEFAULT_MIDI_OUTPUT "Microsoft GS Wavetable Synth"
#else
2022-11-29 05:29:39 -05:00
#define DEFAULT_MIDI_OUTPUT "OFF"
#endif
#define DEFAULT_MIDI_INPUT "OFF"
#define DEFAULT_MIDI_VOLUME 100
2018-06-04 01:48:08 -04:00
#ifdef HAVE_MIST
/* Steam */
#define DEFAULT_STEAM_RICH_PRESENCE_FORMAT STEAM_RICH_PRESENCE_FORMAT_CONTENT_SYSTEM
#endif
/* Only applies to Android 7.0 (API 24) and up */
#define DEFAULT_SUSTAINED_PERFORMANCE_MODE false
#if defined(ANDROID)
#define DEFAULT_VIBRATE_ON_KEYPRESS true
#else
#define DEFAULT_VIBRATE_ON_KEYPRESS false
#endif
#define DEFAULT_ENABLE_DEVICE_VIBRATION false
2020-11-17 10:59:39 -05:00
/* Defines the strength of rumble effects
* on OpenDingux devices */
#if defined(DINGUX) && defined(HAVE_LIBSHAKE)
#define DEFAULT_RUMBLE_GAIN 50
#else
#define DEFAULT_RUMBLE_GAIN 100
2020-11-17 10:59:39 -05:00
#endif
#ifdef HAVE_VULKAN
2019-06-14 05:13:02 -04:00
#define DEFAULT_VULKAN_GPU_INDEX 0
#endif
2019-06-18 16:33:37 -04:00
#ifdef HAVE_D3D10
#define DEFAULT_D3D10_GPU_INDEX 0
#endif
#ifdef HAVE_D3D11
#define DEFAULT_D3D11_GPU_INDEX 0
#endif
#ifdef HAVE_D3D12
#define DEFAULT_D3D12_GPU_INDEX 0
#endif
2018-07-27 13:26:15 -04:00
#if defined(HAKCHI)
#define DEFAULT_BUILDBOT_SERVER_URL "http://hakchicloud.com/Libretro_Cores/"
#elif defined(WEBOS)
#define DEFAULT_BUILDBOT_SERVER_URL "http://retroarch-cores.webosbrew.org/armv7a/"
2018-07-27 13:26:15 -04:00
#elif defined(ANDROID)
#if defined(ANDROID_ARM_V7)
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/android/latest/armeabi-v7a/"
#elif defined(ANDROID_ARM)
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/android/latest/armeabi/"
2017-06-04 21:38:53 -04:00
#elif defined(ANDROID_AARCH64)
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/android/latest/arm64-v8a/"
#elif defined(ANDROID_X86)
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/android/latest/x86/"
#elif defined(ANDROID_X64)
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/android/latest/x86_64/"
2015-01-21 00:51:45 -05:00
#else
#define DEFAULT_BUILDBOT_SERVER_URL ""
#endif
#elif defined(__QNX__)
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/blackberry/latest/"
#elif defined(IOS)
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/apple/ios/latest/"
#elif defined(OSX)
#if defined(__x86_64__)
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/apple/osx/x86_64/latest/"
#elif defined(__i386__) || defined(__i486__) || defined(__i686__)
#define DEFAULT_BUILDBOT_SERVER_URL "http://bot.libretro.com/nightly/apple/osx/x86/latest/"
#elif defined(__aarch64__)
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/apple/osx/arm64/latest/"
2015-02-22 17:45:46 -05:00
#else
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/apple/osx/ppc/latest/"
#endif
#elif defined(_WIN32) && !defined(_XBOX)
2019-01-01 09:30:21 -05:00
#if _MSC_VER >= 1910
#ifndef __WINRT__
#if defined(__x86_64__) || defined(_M_X64)
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/windows/x86_64/latest/"
2019-01-01 09:30:21 -05:00
#elif defined(__i386__) || defined(__i486__) || defined(__i686__) || defined(_M_IX86) || defined(_M_IA64)
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/windows-msvc2017-desktop/x86/latest/"
2019-06-10 14:40:46 -04:00
#elif defined(__arm__) || defined(_M_ARM)
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/windows-msvc2017-desktop/arm/latest/"
2019-06-10 14:40:46 -04:00
#elif defined(__aarch64__) || defined(_M_ARM64)
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/windows-msvc2017-desktop/arm64/latest/"
2019-01-01 09:30:21 -05:00
#endif
#else
#if defined(__x86_64__) || defined(_M_X64)
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/windows/x86_64/latest/"
2019-01-01 09:30:21 -05:00
#elif defined(__i386__) || defined(__i486__) || defined(__i686__) || defined(_M_IX86) || defined(_M_IA64)
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/windows/x86/latest/"
2019-06-10 14:40:46 -04:00
#elif defined(__arm__) || defined(_M_ARM)
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/windows-msvc2017-uwp/arm/latest/"
2019-06-10 14:40:46 -04:00
#elif defined(__aarch64__) || defined(_M_ARM64)
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/windows-msvc2017-uwp/arm64/latest/"
2019-01-01 09:30:21 -05:00
#endif
#endif
#elif _MSC_VER == 1600
2018-01-20 14:05:32 -05:00
#if defined(__x86_64__) || defined(_M_X64)
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/windows-msvc2010/x86_64/latest/"
#elif defined(__i386__) || defined(__i486__) || defined(__i686__) || defined(_M_IX86) || defined(_M_IA64)
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/windows-msvc2010/x86/latest/"
#endif
#elif _MSC_VER == 1400
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/windows-msvc2005/x86/latest/"
#elif _MSC_VER == 1310
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/windows-msvc2003/x86/latest/"
#else
2018-01-20 14:05:32 -05:00
#if defined(__x86_64__) || defined(_M_X64)
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/windows/x86_64/latest/"
2006-05-18 07:17:58 -04:00
#elif defined(__i386__) || defined(__i486__) || defined(__i686__) || defined(_M_IX86) || defined(_M_IA64)
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/windows/x86/latest/"
#endif
#endif
#elif defined(__linux__)
#if defined(__x86_64__)
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/linux/x86_64/latest/"
2015-10-20 13:52:40 -04:00
#elif defined(__i386__) || defined(__i486__) || defined(__i686__)
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/linux/x86/latest/"
#elif defined(__arm__) && __ARM_ARCH == 7 && defined(__ARM_PCS_VFP)
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/linux/armhf/latest/"
#else
#define DEFAULT_BUILDBOT_SERVER_URL ""
#endif
2017-05-23 05:24:23 -04:00
#elif defined(WIIU)
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/nintendo/wiiu/latest/"
2018-09-28 16:47:27 -04:00
#elif defined(HAVE_LIBNX)
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/nintendo/switch/libnx/latest/"
2020-12-30 13:11:48 -05:00
#elif defined(_3DS)
2021-01-03 21:31:24 -05:00
#define DEFAULT_BUILDBOT_SERVER_URL envIsHomebrew() ? "http://buildbot.libretro.com/nightly/nintendo/3ds/latest/3dsx/" : "http://buildbot.libretro.com/nightly/nintendo/3ds/latest/cia/"
#else
#define DEFAULT_BUILDBOT_SERVER_URL ""
#endif
2020-02-03 22:21:31 -05:00
#define DEFAULT_BUILDBOT_ASSETS_SERVER_URL "http://buildbot.libretro.com/assets/"
2015-02-01 11:13:15 -05:00
2020-02-03 22:21:31 -05:00
#define DEFAULT_DISCORD_APP_ID "475456035851599874"
2018-10-13 19:17:17 -04:00
2019-08-22 13:39:00 -04:00
#define DEFAULT_AI_SERVICE_SOURCE_LANG 0
#define DEFAULT_AI_SERVICE_TARGET_LANG 0
2022-03-31 20:21:26 -04:00
#define DEFAULT_AI_SERVICE_ENABLE false
2019-08-22 01:07:07 -04:00
2019-10-19 14:53:17 -04:00
#define DEFAULT_AI_SERVICE_PAUSE false
2019-08-22 01:07:07 -04:00
#define DEFAULT_AI_SERVICE_MODE 1
#define DEFAULT_AI_SERVICE_URL "http://localhost:4404/"
#if defined(HAVE_FFMPEG) || defined(HAVE_MPV)
#define DEFAULT_BUILTIN_MEDIAPLAYER_ENABLE true
#else
#define DEFAULT_BUILTIN_MEDIAPLAYER_ENABLE false
#endif
#if defined(HAVE_IMAGEVIEWER)
#define DEFAULT_BUILTIN_IMAGEVIEWER_ENABLE true
#else
#define DEFAULT_BUILTIN_IMAGEVIEWER_ENABLE false
#endif
#define DEFAULT_FILTER_BY_CURRENT_CORE false
#endif