···283283 RETRO_LANGUAGE_HEBREW = 21,
284284 RETRO_LANGUAGE_ASTURIAN = 22,
285285 RETRO_LANGUAGE_FINNISH = 23,
286286+ RETRO_LANGUAGE_INDONESIAN = 24,
287287+ RETRO_LANGUAGE_SWEDISH = 25,
288288+ RETRO_LANGUAGE_UKRAINIAN = 26,
289289+ RETRO_LANGUAGE_CZECH = 27,
290290+ RETRO_LANGUAGE_CATALAN_VALENCIA = 28,
291291+ RETRO_LANGUAGE_CATALAN = 29,
292292+ RETRO_LANGUAGE_BRITISH_ENGLISH = 30,
293293+ RETRO_LANGUAGE_HUNGARIAN = 31,
294294+ RETRO_LANGUAGE_BELARUSIAN = 32,
286295 RETRO_LANGUAGE_LAST,
287296288297 /* Ensure sizeof(enum) == sizeof(int) */
···920929 * anything else.
921930 * It is recommended to expose all relevant pointers through
922931 * retro_get_memory_* as well.
923923- *
924924- * Can be called from retro_init and retro_load_game.
925932 */
926933#define RETRO_ENVIRONMENT_SET_GEOMETRY 37
927934 /* const struct retro_game_geometry * --
···11311138 * retro_core_option_definition structs to RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL.
11321139 * This allows the core to additionally set option sublabel information
11331140 * and/or provide localisation support.
11411141+ *
11421142+ * If version is >= 2, core options may instead be set by passing
11431143+ * a retro_core_options_v2 struct to RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2,
11441144+ * or an array of retro_core_options_v2 structs to
11451145+ * RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2_INTL. This allows the core
11461146+ * to additionally set optional core option category information
11471147+ * for frontends with core option category support.
11341148 */
1135114911361150#define RETRO_ENVIRONMENT_SET_CORE_OPTIONS 53
···11721186 * default value is NULL, the first entry in the
11731187 * retro_core_option_definition::values array is treated as the default.
11741188 *
11751175- * The number of possible options should be very limited,
11891189+ * The number of possible option values should be very limited,
11761190 * and must be less than RETRO_NUM_CORE_OPTION_VALUES_MAX.
11771191 * i.e. it should be feasible to cycle through options
11781192 * without a keyboard.
···12051219 * This should only be called if RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION
12061220 * returns an API version of >= 1.
12071221 * This should be called instead of RETRO_ENVIRONMENT_SET_VARIABLES.
12221222+ * This should be called instead of RETRO_ENVIRONMENT_SET_CORE_OPTIONS.
12081223 * This should be called the first time as early as
12091224 * possible (ideally in retro_set_environment).
12101225 * Afterwards it may be called again for the core to communicate
···13781393 * call will target the newly initialized driver.
13791394 */
1380139513961396+#define RETRO_ENVIRONMENT_SET_FASTFORWARDING_OVERRIDE 64
13971397+ /* const struct retro_fastforwarding_override * --
13981398+ * Used by a libretro core to override the current
13991399+ * fastforwarding mode of the frontend.
14001400+ * If NULL is passed to this function, the frontend
14011401+ * will return true if fastforwarding override
14021402+ * functionality is supported (no change in
14031403+ * fastforwarding state will occur in this case).
14041404+ */
14051405+14061406+#define RETRO_ENVIRONMENT_SET_CONTENT_INFO_OVERRIDE 65
14071407+ /* const struct retro_system_content_info_override * --
14081408+ * Allows an implementation to override 'global' content
14091409+ * info parameters reported by retro_get_system_info().
14101410+ * Overrides also affect subsystem content info parameters
14111411+ * set via RETRO_ENVIRONMENT_SET_SUBSYSTEM_INFO.
14121412+ * This function must be called inside retro_set_environment().
14131413+ * If callback returns false, content info overrides
14141414+ * are unsupported by the frontend, and will be ignored.
14151415+ * If callback returns true, extended game info may be
14161416+ * retrieved by calling RETRO_ENVIRONMENT_GET_GAME_INFO_EXT
14171417+ * in retro_load_game() or retro_load_game_special().
14181418+ *
14191419+ * 'data' points to an array of retro_system_content_info_override
14201420+ * structs terminated by a { NULL, false, false } element.
14211421+ * If 'data' is NULL, no changes will be made to the frontend;
14221422+ * a core may therefore pass NULL in order to test whether
14231423+ * the RETRO_ENVIRONMENT_SET_CONTENT_INFO_OVERRIDE and
14241424+ * RETRO_ENVIRONMENT_GET_GAME_INFO_EXT callbacks are supported
14251425+ * by the frontend.
14261426+ *
14271427+ * For struct member descriptions, see the definition of
14281428+ * struct retro_system_content_info_override.
14291429+ *
14301430+ * Example:
14311431+ *
14321432+ * - struct retro_system_info:
14331433+ * {
14341434+ * "My Core", // library_name
14351435+ * "v1.0", // library_version
14361436+ * "m3u|md|cue|iso|chd|sms|gg|sg", // valid_extensions
14371437+ * true, // need_fullpath
14381438+ * false // block_extract
14391439+ * }
14401440+ *
14411441+ * - Array of struct retro_system_content_info_override:
14421442+ * {
14431443+ * {
14441444+ * "md|sms|gg", // extensions
14451445+ * false, // need_fullpath
14461446+ * true // persistent_data
14471447+ * },
14481448+ * {
14491449+ * "sg", // extensions
14501450+ * false, // need_fullpath
14511451+ * false // persistent_data
14521452+ * },
14531453+ * { NULL, false, false }
14541454+ * }
14551455+ *
14561456+ * Result:
14571457+ * - Files of type m3u, cue, iso, chd will not be
14581458+ * loaded by the frontend. Frontend will pass a
14591459+ * valid path to the core, and core will handle
14601460+ * loading internally
14611461+ * - Files of type md, sms, gg will be loaded by
14621462+ * the frontend. A valid memory buffer will be
14631463+ * passed to the core. This memory buffer will
14641464+ * remain valid until retro_deinit() returns
14651465+ * - Files of type sg will be loaded by the frontend.
14661466+ * A valid memory buffer will be passed to the core.
14671467+ * This memory buffer will remain valid until
14681468+ * retro_load_game() (or retro_load_game_special())
14691469+ * returns
14701470+ *
14711471+ * NOTE: If an extension is listed multiple times in
14721472+ * an array of retro_system_content_info_override
14731473+ * structs, only the first instance will be registered
14741474+ */
14751475+14761476+#define RETRO_ENVIRONMENT_GET_GAME_INFO_EXT 66
14771477+ /* const struct retro_game_info_ext ** --
14781478+ * Allows an implementation to fetch extended game
14791479+ * information, providing additional content path
14801480+ * and memory buffer status details.
14811481+ * This function may only be called inside
14821482+ * retro_load_game() or retro_load_game_special().
14831483+ * If callback returns false, extended game information
14841484+ * is unsupported by the frontend. In this case, only
14851485+ * regular retro_game_info will be available.
14861486+ * RETRO_ENVIRONMENT_GET_GAME_INFO_EXT is guaranteed
14871487+ * to return true if RETRO_ENVIRONMENT_SET_CONTENT_INFO_OVERRIDE
14881488+ * returns true.
14891489+ *
14901490+ * 'data' points to an array of retro_game_info_ext structs.
14911491+ *
14921492+ * For struct member descriptions, see the definition of
14931493+ * struct retro_game_info_ext.
14941494+ *
14951495+ * - If function is called inside retro_load_game(),
14961496+ * the retro_game_info_ext array is guaranteed to
14971497+ * have a size of 1 - i.e. the returned pointer may
14981498+ * be used to access directly the members of the
14991499+ * first retro_game_info_ext struct, for example:
15001500+ *
15011501+ * struct retro_game_info_ext *game_info_ext;
15021502+ * if (environ_cb(RETRO_ENVIRONMENT_GET_GAME_INFO_EXT, &game_info_ext))
15031503+ * printf("Content Directory: %s\n", game_info_ext->dir);
15041504+ *
15051505+ * - If the function is called inside retro_load_game_special(),
15061506+ * the retro_game_info_ext array is guaranteed to have a
15071507+ * size equal to the num_info argument passed to
15081508+ * retro_load_game_special()
15091509+ */
15101510+15111511+#define RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2 67
15121512+ /* const struct retro_core_options_v2 * --
15131513+ * Allows an implementation to signal the environment
15141514+ * which variables it might want to check for later using
15151515+ * GET_VARIABLE.
15161516+ * This allows the frontend to present these variables to
15171517+ * a user dynamically.
15181518+ * This should only be called if RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION
15191519+ * returns an API version of >= 2.
15201520+ * This should be called instead of RETRO_ENVIRONMENT_SET_VARIABLES.
15211521+ * This should be called instead of RETRO_ENVIRONMENT_SET_CORE_OPTIONS.
15221522+ * This should be called the first time as early as
15231523+ * possible (ideally in retro_set_environment).
15241524+ * Afterwards it may be called again for the core to communicate
15251525+ * updated options to the frontend, but the number of core
15261526+ * options must not change from the number in the initial call.
15271527+ * If RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION returns an API
15281528+ * version of >= 2, this callback is guaranteed to succeed
15291529+ * (i.e. callback return value does not indicate success)
15301530+ * If callback returns true, frontend has core option category
15311531+ * support.
15321532+ * If callback returns false, frontend does not have core option
15331533+ * category support.
15341534+ *
15351535+ * 'data' points to a retro_core_options_v2 struct, containing
15361536+ * of two pointers:
15371537+ * - retro_core_options_v2::categories is an array of
15381538+ * retro_core_option_v2_category structs terminated by a
15391539+ * { NULL, NULL, NULL } element. If retro_core_options_v2::categories
15401540+ * is NULL, all core options will have no category and will be shown
15411541+ * at the top level of the frontend core option interface. If frontend
15421542+ * does not have core option category support, categories array will
15431543+ * be ignored.
15441544+ * - retro_core_options_v2::definitions is an array of
15451545+ * retro_core_option_v2_definition structs terminated by a
15461546+ * { NULL, NULL, NULL, NULL, NULL, NULL, {{0}}, NULL }
15471547+ * element.
15481548+ *
15491549+ * >> retro_core_option_v2_category notes:
15501550+ *
15511551+ * - retro_core_option_v2_category::key should contain string
15521552+ * that uniquely identifies the core option category. Valid
15531553+ * key characters are [a-z, A-Z, 0-9, _, -]
15541554+ * Namespace collisions with other implementations' category
15551555+ * keys are permitted.
15561556+ * - retro_core_option_v2_category::desc should contain a human
15571557+ * readable description of the category key.
15581558+ * - retro_core_option_v2_category::info should contain any
15591559+ * additional human readable information text that a typical
15601560+ * user may need to understand the nature of the core option
15611561+ * category.
15621562+ *
15631563+ * Example entry:
15641564+ * {
15651565+ * "advanced_settings",
15661566+ * "Advanced",
15671567+ * "Options affecting low-level emulation performance and accuracy."
15681568+ * }
15691569+ *
15701570+ * >> retro_core_option_v2_definition notes:
15711571+ *
15721572+ * - retro_core_option_v2_definition::key should be namespaced to not
15731573+ * collide with other implementations' keys. e.g. A core called
15741574+ * 'foo' should use keys named as 'foo_option'. Valid key characters
15751575+ * are [a-z, A-Z, 0-9, _, -].
15761576+ * - retro_core_option_v2_definition::desc should contain a human readable
15771577+ * description of the key. Will be used when the frontend does not
15781578+ * have core option category support. Examples: "Aspect Ratio" or
15791579+ * "Video > Aspect Ratio".
15801580+ * - retro_core_option_v2_definition::desc_categorized should contain a
15811581+ * human readable description of the key, which will be used when
15821582+ * frontend has core option category support. Example: "Aspect Ratio",
15831583+ * where associated retro_core_option_v2_category::desc is "Video".
15841584+ * If empty or NULL, the string specified by
15851585+ * retro_core_option_v2_definition::desc will be used instead.
15861586+ * retro_core_option_v2_definition::desc_categorized will be ignored
15871587+ * if retro_core_option_v2_definition::category_key is empty or NULL.
15881588+ * - retro_core_option_v2_definition::info should contain any additional
15891589+ * human readable information text that a typical user may need to
15901590+ * understand the functionality of the option.
15911591+ * - retro_core_option_v2_definition::info_categorized should contain
15921592+ * any additional human readable information text that a typical user
15931593+ * may need to understand the functionality of the option, and will be
15941594+ * used when frontend has core option category support. This is provided
15951595+ * to accommodate the case where info text references an option by
15961596+ * name/desc, and the desc/desc_categorized text for that option differ.
15971597+ * If empty or NULL, the string specified by
15981598+ * retro_core_option_v2_definition::info will be used instead.
15991599+ * retro_core_option_v2_definition::info_categorized will be ignored
16001600+ * if retro_core_option_v2_definition::category_key is empty or NULL.
16011601+ * - retro_core_option_v2_definition::category_key should contain a
16021602+ * category identifier (e.g. "video" or "audio") that will be
16031603+ * assigned to the core option if frontend has core option category
16041604+ * support. A categorized option will be shown in a subsection/
16051605+ * submenu of the frontend core option interface. If key is empty
16061606+ * or NULL, or if key does not match one of the
16071607+ * retro_core_option_v2_category::key values in the associated
16081608+ * retro_core_option_v2_category array, option will have no category
16091609+ * and will be shown at the top level of the frontend core option
16101610+ * interface.
16111611+ * - retro_core_option_v2_definition::values is an array of
16121612+ * retro_core_option_value structs terminated by a { NULL, NULL }
16131613+ * element.
16141614+ * --> retro_core_option_v2_definition::values[index].value is an
16151615+ * expected option value.
16161616+ * --> retro_core_option_v2_definition::values[index].label is a
16171617+ * human readable label used when displaying the value on screen.
16181618+ * If NULL, the value itself is used.
16191619+ * - retro_core_option_v2_definition::default_value is the default
16201620+ * core option setting. It must match one of the expected option
16211621+ * values in the retro_core_option_v2_definition::values array. If
16221622+ * it does not, or the default value is NULL, the first entry in the
16231623+ * retro_core_option_v2_definition::values array is treated as the
16241624+ * default.
16251625+ *
16261626+ * The number of possible option values should be very limited,
16271627+ * and must be less than RETRO_NUM_CORE_OPTION_VALUES_MAX.
16281628+ * i.e. it should be feasible to cycle through options
16291629+ * without a keyboard.
16301630+ *
16311631+ * Example entries:
16321632+ *
16331633+ * - Uncategorized:
16341634+ *
16351635+ * {
16361636+ * "foo_option",
16371637+ * "Speed hack coprocessor X",
16381638+ * NULL,
16391639+ * "Provides increased performance at the expense of reduced accuracy.",
16401640+ * NULL,
16411641+ * NULL,
16421642+ * {
16431643+ * { "false", NULL },
16441644+ * { "true", NULL },
16451645+ * { "unstable", "Turbo (Unstable)" },
16461646+ * { NULL, NULL },
16471647+ * },
16481648+ * "false"
16491649+ * }
16501650+ *
16511651+ * - Categorized:
16521652+ *
16531653+ * {
16541654+ * "foo_option",
16551655+ * "Advanced > Speed hack coprocessor X",
16561656+ * "Speed hack coprocessor X",
16571657+ * "Setting 'Advanced > Speed hack coprocessor X' to 'true' or 'Turbo' provides increased performance at the expense of reduced accuracy",
16581658+ * "Setting 'Speed hack coprocessor X' to 'true' or 'Turbo' provides increased performance at the expense of reduced accuracy",
16591659+ * "advanced_settings",
16601660+ * {
16611661+ * { "false", NULL },
16621662+ * { "true", NULL },
16631663+ * { "unstable", "Turbo (Unstable)" },
16641664+ * { NULL, NULL },
16651665+ * },
16661666+ * "false"
16671667+ * }
16681668+ *
16691669+ * Only strings are operated on. The possible values will
16701670+ * generally be displayed and stored as-is by the frontend.
16711671+ */
16721672+16731673+#define RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2_INTL 68
16741674+ /* const struct retro_core_options_v2_intl * --
16751675+ * Allows an implementation to signal the environment
16761676+ * which variables it might want to check for later using
16771677+ * GET_VARIABLE.
16781678+ * This allows the frontend to present these variables to
16791679+ * a user dynamically.
16801680+ * This should only be called if RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION
16811681+ * returns an API version of >= 2.
16821682+ * This should be called instead of RETRO_ENVIRONMENT_SET_VARIABLES.
16831683+ * This should be called instead of RETRO_ENVIRONMENT_SET_CORE_OPTIONS.
16841684+ * This should be called instead of RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL.
16851685+ * This should be called instead of RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2.
16861686+ * This should be called the first time as early as
16871687+ * possible (ideally in retro_set_environment).
16881688+ * Afterwards it may be called again for the core to communicate
16891689+ * updated options to the frontend, but the number of core
16901690+ * options must not change from the number in the initial call.
16911691+ * If RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION returns an API
16921692+ * version of >= 2, this callback is guaranteed to succeed
16931693+ * (i.e. callback return value does not indicate success)
16941694+ * If callback returns true, frontend has core option category
16951695+ * support.
16961696+ * If callback returns false, frontend does not have core option
16971697+ * category support.
16981698+ *
16991699+ * This is fundamentally the same as RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2,
17001700+ * with the addition of localisation support. The description of the
17011701+ * RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2 callback should be consulted
17021702+ * for further details.
17031703+ *
17041704+ * 'data' points to a retro_core_options_v2_intl struct.
17051705+ *
17061706+ * - retro_core_options_v2_intl::us is a pointer to a
17071707+ * retro_core_options_v2 struct defining the US English
17081708+ * core options implementation. It must point to a valid struct.
17091709+ *
17101710+ * - retro_core_options_v2_intl::local is a pointer to a
17111711+ * retro_core_options_v2 struct defining core options for
17121712+ * the current frontend language. It may be NULL (in which case
17131713+ * retro_core_options_v2_intl::us is used by the frontend). Any items
17141714+ * missing from this struct will be read from
17151715+ * retro_core_options_v2_intl::us instead.
17161716+ *
17171717+ * NOTE: Default core option values are always taken from the
17181718+ * retro_core_options_v2_intl::us struct. Any default values in
17191719+ * the retro_core_options_v2_intl::local struct will be ignored.
17201720+ */
17211721+17221722+#define RETRO_ENVIRONMENT_SET_CORE_OPTIONS_UPDATE_DISPLAY_CALLBACK 69
17231723+ /* const struct retro_core_options_update_display_callback * --
17241724+ * Allows a frontend to signal that a core must update
17251725+ * the visibility of any dynamically hidden core options,
17261726+ * and enables the frontend to detect visibility changes.
17271727+ * Used by the frontend to update the menu display status
17281728+ * of core options without requiring a call of retro_run().
17291729+ * Must be called in retro_set_environment().
17301730+ */
17311731+17321732+#define RETRO_ENVIRONMENT_SET_VARIABLE 70
17331733+ /* const struct retro_variable * --
17341734+ * Allows an implementation to notify the frontend
17351735+ * that a core option value has changed.
17361736+ *
17371737+ * retro_variable::key and retro_variable::value
17381738+ * must match strings that have been set previously
17391739+ * via one of the following:
17401740+ *
17411741+ * - RETRO_ENVIRONMENT_SET_VARIABLES
17421742+ * - RETRO_ENVIRONMENT_SET_CORE_OPTIONS
17431743+ * - RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL
17441744+ * - RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2
17451745+ * - RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2_INTL
17461746+ *
17471747+ * After changing a core option value via this
17481748+ * callback, RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE
17491749+ * will return true.
17501750+ *
17511751+ * If data is NULL, no changes will be registered
17521752+ * and the callback will return true; an
17531753+ * implementation may therefore pass NULL in order
17541754+ * to test whether the callback is supported.
17551755+ */
17561756+17571757+#define RETRO_ENVIRONMENT_GET_THROTTLE_STATE (71 | RETRO_ENVIRONMENT_EXPERIMENTAL)
17581758+ /* struct retro_throttle_state * --
17591759+ * Allows an implementation to get details on the actual rate
17601760+ * the frontend is attempting to call retro_run().
17611761+ */
17621762+17631763+#define RETRO_ENVIRONMENT_GET_SAVESTATE_CONTEXT (72 | RETRO_ENVIRONMENT_EXPERIMENTAL)
17641764+ /* int * --
17651765+ * Tells the core about the context the frontend is asking for savestate.
17661766+ * (see enum retro_savestate_context)
17671767+ */
17681768+17691769+#define RETRO_ENVIRONMENT_GET_HW_RENDER_CONTEXT_NEGOTIATION_INTERFACE_SUPPORT (73 | RETRO_ENVIRONMENT_EXPERIMENTAL)
17701770+ /* struct retro_hw_render_context_negotiation_interface * --
17711771+ * Before calling SET_HW_RNEDER_CONTEXT_NEGOTIATION_INTERFACE, a core can query
17721772+ * which version of the interface is supported.
17731773+ *
17741774+ * Frontend looks at interface_type and returns the maximum supported
17751775+ * context negotiation interface version.
17761776+ * If the interface_type is not supported or recognized by the frontend, a version of 0
17771777+ * must be returned in interface_version and true is returned by frontend.
17781778+ *
17791779+ * If this environment call returns true with interface_version greater than 0,
17801780+ * a core can always use a negotiation interface version larger than what the frontend returns, but only
17811781+ * earlier versions of the interface will be used by the frontend.
17821782+ * A frontend must not reject a negotiation interface version that is larger than
17831783+ * what the frontend supports. Instead, the frontend will use the older entry points that it recognizes.
17841784+ * If this is incompatible with a particular core's requirements, it can error out early.
17851785+ *
17861786+ * Backwards compatibility note:
17871787+ * This environment call was introduced after Vulkan v1 context negotiation.
17881788+ * If this environment call is not supported by frontend - i.e. the environment call returns false -
17891789+ * only Vulkan v1 context negotiation is supported (if Vulkan HW rendering is supported at all).
17901790+ * If a core uses Vulkan negotiation interface with version > 1, negotiation may fail unexpectedly.
17911791+ * All future updates to the context negotiation interface implies that frontend must support
17921792+ * this environment call to query support.
17931793+ */
17941794+17951795+#define RETRO_ENVIRONMENT_GET_JIT_CAPABLE 74
17961796+ /* bool * --
17971797+ * Result is set to true if the frontend has already verified JIT can be
17981798+ * used, mainly for use iOS/tvOS. On other platforms the result is true.
17991799+ */
18001800+18011801+#define RETRO_ENVIRONMENT_GET_MICROPHONE_INTERFACE (75 | RETRO_ENVIRONMENT_EXPERIMENTAL)
18021802+ /* struct retro_microphone_interface * --
18031803+ * Returns an interface that can be used to receive input from the microphone driver.
18041804+ *
18051805+ * Returns true if microphone support is available,
18061806+ * even if no microphones are plugged in.
18071807+ * Returns false if mic support is disabled or unavailable.
18081808+ *
18091809+ * This callback can be invoked at any time,
18101810+ * even before the microphone driver is ready.
18111811+ */
18121812+18131813+#define RETRO_ENVIRONMENT_SET_NETPACKET_INTERFACE 76
18141814+ /* const struct retro_netpacket_callback * --
18151815+ * When set, a core gains control over network packets sent and
18161816+ * received during a multiplayer session. This can be used to
18171817+ * emulate multiplayer games that were originally played on two
18181818+ * or more separate consoles or computers connected together.
18191819+ *
18201820+ * The frontend will take care of connecting players together,
18211821+ * and the core only needs to send the actual data as needed for
18221822+ * the emulation, while handshake and connection management happen
18231823+ * in the background.
18241824+ *
18251825+ * When two or more players are connected and this interface has
18261826+ * been set, time manipulation features (such as pausing, slow motion,
18271827+ * fast forward, rewinding, save state loading, etc.) are disabled to
18281828+ * avoid interrupting communication.
18291829+ *
18301830+ * Should be set in either retro_init or retro_load_game, but not both.
18311831+ *
18321832+ * When not set, a frontend may use state serialization-based
18331833+ * multiplayer, where a deterministic core supporting multiple
18341834+ * input devices does not need to take any action on its own.
18351835+ */
18361836+18371837+#define RETRO_ENVIRONMENT_GET_DEVICE_POWER (77 | RETRO_ENVIRONMENT_EXPERIMENTAL)
18381838+ /* struct retro_device_power * --
18391839+ * Returns the device's current power state as reported by the frontend.
18401840+ * This is useful for emulating the battery level in handheld consoles,
18411841+ * or for reducing power consumption when on battery power.
18421842+ *
18431843+ * The return value indicates whether the frontend can provide this information,
18441844+ * even if the parameter is NULL.
18451845+ *
18461846+ * If the frontend does not support this functionality,
18471847+ * then the provided argument will remain unchanged.
18481848+ *
18491849+ * Note that this environment call describes the power state for the entire device,
18501850+ * not for individual peripherals like controllers.
18511851+ */
18521852+13811853/* VFS functionality */
1382185413831855/* File paths:
···1552202415532025enum retro_hw_render_interface_type
15542026{
15551555- RETRO_HW_RENDER_INTERFACE_VULKAN = 0,
15561556- RETRO_HW_RENDER_INTERFACE_D3D9 = 1,
15571557- RETRO_HW_RENDER_INTERFACE_D3D10 = 2,
15581558- RETRO_HW_RENDER_INTERFACE_D3D11 = 3,
15591559- RETRO_HW_RENDER_INTERFACE_D3D12 = 4,
20272027+ RETRO_HW_RENDER_INTERFACE_VULKAN = 0,
20282028+ RETRO_HW_RENDER_INTERFACE_D3D9 = 1,
20292029+ RETRO_HW_RENDER_INTERFACE_D3D10 = 2,
20302030+ RETRO_HW_RENDER_INTERFACE_D3D11 = 3,
20312031+ RETRO_HW_RENDER_INTERFACE_D3D12 = 4,
15602032 RETRO_HW_RENDER_INTERFACE_GSKIT_PS2 = 5,
15611561- RETRO_HW_RENDER_INTERFACE_DUMMY = INT_MAX
20332033+ RETRO_HW_RENDER_INTERFACE_DUMMY = INT_MAX
15622034};
1563203515642036/* Base struct. All retro_hw_render_interface_* types
···23342806 /* Vulkan, see RETRO_ENVIRONMENT_GET_HW_RENDER_INTERFACE. */
23352807 RETRO_HW_CONTEXT_VULKAN = 6,
2336280823372337- /* Direct3D, set version_major to select the type of interface
23382338- * returned by RETRO_ENVIRONMENT_GET_HW_RENDER_INTERFACE */
23392339- RETRO_HW_CONTEXT_DIRECT3D = 7,
28092809+ /* Direct3D11, see RETRO_ENVIRONMENT_GET_HW_RENDER_INTERFACE */
28102810+ RETRO_HW_CONTEXT_D3D11 = 7,
28112811+28122812+ /* Direct3D10, see RETRO_ENVIRONMENT_GET_HW_RENDER_INTERFACE */
28132813+ RETRO_HW_CONTEXT_D3D10 = 8,
28142814+28152815+ /* Direct3D12, see RETRO_ENVIRONMENT_GET_HW_RENDER_INTERFACE */
28162816+ RETRO_HW_CONTEXT_D3D12 = 9,
28172817+28182818+ /* Direct3D9, see RETRO_ENVIRONMENT_GET_HW_RENDER_INTERFACE */
28192819+ RETRO_HW_CONTEXT_D3D9 = 10,
2340282023412821 RETRO_HW_CONTEXT_DUMMY = INT_MAX
23422822};
···25913071 retro_get_image_label_t get_image_label; /* Optional - may be NULL */
25923072};
2593307330743074+/* Definitions for RETRO_ENVIRONMENT_SET_NETPACKET_INTERFACE.
30753075+ * A core can set it if sending and receiving custom network packets
30763076+ * during a multiplayer session is desired.
30773077+ */
30783078+30793079+/* Netpacket flags for retro_netpacket_send_t */
30803080+#define RETRO_NETPACKET_UNRELIABLE 0 /* Packet to be sent unreliable, depending on network quality it might not arrive. */
30813081+#define RETRO_NETPACKET_RELIABLE (1 << 0) /* Reliable packets are guaranteed to arrive at the target in the order they were send. */
30823082+#define RETRO_NETPACKET_UNSEQUENCED (1 << 1) /* Packet will not be sequenced with other packets and may arrive out of order. Cannot be set on reliable packets. */
30833083+30843084+/* Used by the core to send a packet to one or more connected players.
30853085+ * A single packet sent via this interface can contain up to 64 KB of data.
30863086+ *
30873087+ * The broadcast flag can be set to true to send to multiple connected clients.
30883088+ * In a broadcast, the client_id argument indicates 1 client NOT to send the
30893089+ * packet to (pass 0xFFFF to send to everyone). Otherwise, the client_id
30903090+ * argument indicates a single client to send the packet to.
30913091+ *
30923092+ * A frontend must support sending reliable packets (RETRO_NETPACKET_RELIABLE).
30933093+ * Unreliable packets might not be supported by the frontend, but the flags can
30943094+ * still be specified. Reliable transmission will be used instead.
30953095+ *
30963096+ * If this function is called passing NULL for buf, it will instead flush all
30973097+ * previously buffered outgoing packets and instantly read any incoming packets.
30983098+ * During such a call, retro_netpacket_receive_t and retro_netpacket_stop_t can
30993099+ * be called. The core can perform this in a loop to do a blocking read, i.e.,
31003100+ * wait for incoming data, but needs to handle stop getting called and also
31013101+ * give up after a short while to avoid freezing on a connection problem.
31023102+ *
31033103+ * This function is not guaranteed to be thread-safe and must be called during
31043104+ * retro_run or any of the netpacket callbacks passed with this interface.
31053105+ */
31063106+typedef void (RETRO_CALLCONV *retro_netpacket_send_t)(int flags, const void* buf, size_t len, uint16_t client_id, bool broadcast);
31073107+31083108+/* Called by the frontend to signify that a multiplayer session has started.
31093109+ * If client_id is 0 the local player is the host of the session and at this
31103110+ * point no other player has connected yet.
31113111+ *
31123112+ * If client_id is > 0 the local player is a client connected to a host and
31133113+ * at this point is already fully connected to the host.
31143114+ *
31153115+ * The core must store the retro_netpacket_send_t function pointer provided
31163116+ * here and use it whenever it wants to send a packet. This function pointer
31173117+ * remains valid until the frontend calls retro_netpacket_stop_t.
31183118+ */
31193119+typedef void (RETRO_CALLCONV *retro_netpacket_start_t)(uint16_t client_id, retro_netpacket_send_t send_fn);
31203120+31213121+/* Called by the frontend when a new packet arrives which has been sent from
31223122+ * another player with retro_netpacket_send_t. The client_id argument indicates
31233123+ * who has sent the packet.
31243124+ */
31253125+typedef void (RETRO_CALLCONV *retro_netpacket_receive_t)(const void* buf, size_t len, uint16_t client_id);
31263126+31273127+/* Called by the frontend when the multiplayer session has ended.
31283128+ * Once this gets called the retro_netpacket_send_t function pointer passed
31293129+ * to retro_netpacket_start_t will not be valid anymore.
31303130+ */
31313131+typedef void (RETRO_CALLCONV *retro_netpacket_stop_t)(void);
31323132+31333133+/* Called by the frontend every frame (between calls to retro_run while
31343134+ * updating the state of the multiplayer session.
31353135+ * This is a good place for the core to call retro_netpacket_send_t from.
31363136+ */
31373137+typedef void (RETRO_CALLCONV *retro_netpacket_poll_t)(void);
31383138+31393139+/* Called by the frontend when a new player connects to the hosted session.
31403140+ * This is only called on the host side, not for clients connected to the host.
31413141+ * If this function returns false, the newly connected player gets dropped.
31423142+ * This can be used for example to limit the number of players.
31433143+ */
31443144+typedef bool (RETRO_CALLCONV *retro_netpacket_connected_t)(uint16_t client_id);
31453145+31463146+/* Called by the frontend when a player leaves or disconnects from the hosted session.
31473147+ * This is only called on the host side, not for clients connected to the host.
31483148+ */
31493149+typedef void (RETRO_CALLCONV *retro_netpacket_disconnected_t)(uint16_t client_id);
31503150+31513151+/**
31523152+ * A callback interface for giving a core the ability to send and receive custom
31533153+ * network packets during a multiplayer session between two or more instances
31543154+ * of a libretro frontend.
31553155+ *
31563156+ * @see RETRO_ENVIRONMENT_SET_NETPACKET_INTERFACE
31573157+ */
31583158+struct retro_netpacket_callback
31593159+{
31603160+ retro_netpacket_start_t start;
31613161+ retro_netpacket_receive_t receive;
31623162+ retro_netpacket_stop_t stop; /* Optional - may be NULL */
31633163+ retro_netpacket_poll_t poll; /* Optional - may be NULL */
31643164+ retro_netpacket_connected_t connected; /* Optional - may be NULL */
31653165+ retro_netpacket_disconnected_t disconnected; /* Optional - may be NULL */
31663166+};
31673167+25943168enum retro_pixel_format
25953169{
25963170 /* 0RGB1555, native endian.
···2613318726143188 /* Ensure sizeof() == sizeof(int). */
26153189 RETRO_PIXEL_FORMAT_UNKNOWN = INT_MAX
31903190+};
31913191+31923192+enum retro_savestate_context
31933193+{
31943194+ /* Standard savestate written to disk. */
31953195+ RETRO_SAVESTATE_CONTEXT_NORMAL = 0,
31963196+31973197+ /* Savestate where you are guaranteed that the same instance will load the save state.
31983198+ * You can store internal pointers to code or data.
31993199+ * It's still a full serialization and deserialization, and could be loaded or saved at any time.
32003200+ * It won't be written to disk or sent over the network.
32013201+ */
32023202+ RETRO_SAVESTATE_CONTEXT_RUNAHEAD_SAME_INSTANCE = 1,
32033203+32043204+ /* Savestate where you are guaranteed that the same emulator binary will load that savestate.
32053205+ * You can skip anything that would slow down saving or loading state but you can not store internal pointers.
32063206+ * It won't be written to disk or sent over the network.
32073207+ * Example: "Second Instance" runahead
32083208+ */
32093209+ RETRO_SAVESTATE_CONTEXT_RUNAHEAD_SAME_BINARY = 2,
32103210+32113211+ /* Savestate used within a rollback netplay feature.
32123212+ * You should skip anything that would unnecessarily increase bandwidth usage.
32133213+ * It won't be written to disk but it will be sent over the network.
32143214+ */
32153215+ RETRO_SAVESTATE_CONTEXT_ROLLBACK_NETPLAY = 3,
32163216+32173217+ /* Ensure sizeof() == sizeof(int). */
32183218+ RETRO_SAVESTATE_CONTEXT_UNKNOWN = INT_MAX
26163219};
2617322026183221struct retro_message
···27813384 bool block_extract;
27823385};
2783338633873387+/* Defines overrides which modify frontend handling of
33883388+ * specific content file types.
33893389+ * An array of retro_system_content_info_override is
33903390+ * passed to RETRO_ENVIRONMENT_SET_CONTENT_INFO_OVERRIDE
33913391+ * NOTE: In the following descriptions, references to
33923392+ * retro_load_game() may be replaced with
33933393+ * retro_load_game_special() */
33943394+struct retro_system_content_info_override
33953395+{
33963396+ /* A list of file extensions for which the override
33973397+ * should apply, delimited by a 'pipe' character
33983398+ * (e.g. "md|sms|gg")
33993399+ * Permitted file extensions are limited to those
34003400+ * included in retro_system_info::valid_extensions
34013401+ * and/or retro_subsystem_rom_info::valid_extensions */
34023402+ const char *extensions;
34033403+34043404+ /* Overrides the need_fullpath value set in
34053405+ * retro_system_info and/or retro_subsystem_rom_info.
34063406+ * To reiterate:
34073407+ *
34083408+ * If need_fullpath is true and retro_load_game() is called:
34093409+ * - retro_game_info::path is guaranteed to contain a valid
34103410+ * path to an existent file
34113411+ * - retro_game_info::data and retro_game_info::size are invalid
34123412+ *
34133413+ * If need_fullpath is false and retro_load_game() is called:
34143414+ * - retro_game_info::path may be NULL
34153415+ * - retro_game_info::data and retro_game_info::size are guaranteed
34163416+ * to be valid
34173417+ *
34183418+ * In addition:
34193419+ *
34203420+ * If need_fullpath is true and retro_load_game() is called:
34213421+ * - retro_game_info_ext::full_path is guaranteed to contain a valid
34223422+ * path to an existent file
34233423+ * - retro_game_info_ext::archive_path may be NULL
34243424+ * - retro_game_info_ext::archive_file may be NULL
34253425+ * - retro_game_info_ext::dir is guaranteed to contain a valid path
34263426+ * to the directory in which the content file exists
34273427+ * - retro_game_info_ext::name is guaranteed to contain the
34283428+ * basename of the content file, without extension
34293429+ * - retro_game_info_ext::ext is guaranteed to contain the
34303430+ * extension of the content file in lower case format
34313431+ * - retro_game_info_ext::data and retro_game_info_ext::size
34323432+ * are invalid
34333433+ *
34343434+ * If need_fullpath is false and retro_load_game() is called:
34353435+ * - If retro_game_info_ext::file_in_archive is false:
34363436+ * - retro_game_info_ext::full_path is guaranteed to contain
34373437+ * a valid path to an existent file
34383438+ * - retro_game_info_ext::archive_path may be NULL
34393439+ * - retro_game_info_ext::archive_file may be NULL
34403440+ * - retro_game_info_ext::dir is guaranteed to contain a
34413441+ * valid path to the directory in which the content file exists
34423442+ * - retro_game_info_ext::name is guaranteed to contain the
34433443+ * basename of the content file, without extension
34443444+ * - retro_game_info_ext::ext is guaranteed to contain the
34453445+ * extension of the content file in lower case format
34463446+ * - If retro_game_info_ext::file_in_archive is true:
34473447+ * - retro_game_info_ext::full_path may be NULL
34483448+ * - retro_game_info_ext::archive_path is guaranteed to
34493449+ * contain a valid path to an existent compressed file
34503450+ * inside which the content file is located
34513451+ * - retro_game_info_ext::archive_file is guaranteed to
34523452+ * contain a valid path to an existent content file
34533453+ * inside the compressed file referred to by
34543454+ * retro_game_info_ext::archive_path
34553455+ * e.g. for a compressed file '/path/to/foo.zip'
34563456+ * containing 'bar.sfc'
34573457+ * > retro_game_info_ext::archive_path will be '/path/to/foo.zip'
34583458+ * > retro_game_info_ext::archive_file will be 'bar.sfc'
34593459+ * - retro_game_info_ext::dir is guaranteed to contain a
34603460+ * valid path to the directory in which the compressed file
34613461+ * (containing the content file) exists
34623462+ * - retro_game_info_ext::name is guaranteed to contain
34633463+ * EITHER
34643464+ * 1) the basename of the compressed file (containing
34653465+ * the content file), without extension
34663466+ * OR
34673467+ * 2) the basename of the content file inside the
34683468+ * compressed file, without extension
34693469+ * In either case, a core should consider 'name' to
34703470+ * be the canonical name/ID of the the content file
34713471+ * - retro_game_info_ext::ext is guaranteed to contain the
34723472+ * extension of the content file inside the compressed file,
34733473+ * in lower case format
34743474+ * - retro_game_info_ext::data and retro_game_info_ext::size are
34753475+ * guaranteed to be valid */
34763476+ bool need_fullpath;
34773477+34783478+ /* If need_fullpath is false, specifies whether the content
34793479+ * data buffer available in retro_load_game() is 'persistent'
34803480+ *
34813481+ * If persistent_data is false and retro_load_game() is called:
34823482+ * - retro_game_info::data and retro_game_info::size
34833483+ * are valid only until retro_load_game() returns
34843484+ * - retro_game_info_ext::data and retro_game_info_ext::size
34853485+ * are valid only until retro_load_game() returns
34863486+ *
34873487+ * If persistent_data is true and retro_load_game() is called:
34883488+ * - retro_game_info::data and retro_game_info::size
34893489+ * are valid until retro_deinit() returns
34903490+ * - retro_game_info_ext::data and retro_game_info_ext::size
34913491+ * are valid until retro_deinit() returns */
34923492+ bool persistent_data;
34933493+};
34943494+34953495+/* Similar to retro_game_info, but provides extended
34963496+ * information about the source content file and
34973497+ * game memory buffer status.
34983498+ * And array of retro_game_info_ext is returned by
34993499+ * RETRO_ENVIRONMENT_GET_GAME_INFO_EXT
35003500+ * NOTE: In the following descriptions, references to
35013501+ * retro_load_game() may be replaced with
35023502+ * retro_load_game_special() */
35033503+struct retro_game_info_ext
35043504+{
35053505+ /* - If file_in_archive is false, contains a valid
35063506+ * path to an existent content file (UTF-8 encoded)
35073507+ * - If file_in_archive is true, may be NULL */
35083508+ const char *full_path;
35093509+35103510+ /* - If file_in_archive is false, may be NULL
35113511+ * - If file_in_archive is true, contains a valid path
35123512+ * to an existent compressed file inside which the
35133513+ * content file is located (UTF-8 encoded) */
35143514+ const char *archive_path;
35153515+35163516+ /* - If file_in_archive is false, may be NULL
35173517+ * - If file_in_archive is true, contain a valid path
35183518+ * to an existent content file inside the compressed
35193519+ * file referred to by archive_path (UTF-8 encoded)
35203520+ * e.g. for a compressed file '/path/to/foo.zip'
35213521+ * containing 'bar.sfc'
35223522+ * > archive_path will be '/path/to/foo.zip'
35233523+ * > archive_file will be 'bar.sfc' */
35243524+ const char *archive_file;
35253525+35263526+ /* - If file_in_archive is false, contains a valid path
35273527+ * to the directory in which the content file exists
35283528+ * (UTF-8 encoded)
35293529+ * - If file_in_archive is true, contains a valid path
35303530+ * to the directory in which the compressed file
35313531+ * (containing the content file) exists (UTF-8 encoded) */
35323532+ const char *dir;
35333533+35343534+ /* Contains the canonical name/ID of the content file
35353535+ * (UTF-8 encoded). Intended for use when identifying
35363536+ * 'complementary' content named after the loaded file -
35373537+ * i.e. companion data of a different format (a CD image
35383538+ * required by a ROM), texture packs, internally handled
35393539+ * save files, etc.
35403540+ * - If file_in_archive is false, contains the basename
35413541+ * of the content file, without extension
35423542+ * - If file_in_archive is true, then string is
35433543+ * implementation specific. A frontend may choose to
35443544+ * set a name value of:
35453545+ * EITHER
35463546+ * 1) the basename of the compressed file (containing
35473547+ * the content file), without extension
35483548+ * OR
35493549+ * 2) the basename of the content file inside the
35503550+ * compressed file, without extension
35513551+ * RetroArch sets the 'name' value according to (1).
35523552+ * A frontend that supports routine loading of
35533553+ * content from archives containing multiple unrelated
35543554+ * content files may set the 'name' value according
35553555+ * to (2). */
35563556+ const char *name;
35573557+35583558+ /* - If file_in_archive is false, contains the extension
35593559+ * of the content file in lower case format
35603560+ * - If file_in_archive is true, contains the extension
35613561+ * of the content file inside the compressed file,
35623562+ * in lower case format */
35633563+ const char *ext;
35643564+35653565+ /* String of implementation specific meta-data. */
35663566+ const char *meta;
35673567+35683568+ /* Memory buffer of loaded game content. Will be NULL:
35693569+ * IF
35703570+ * - retro_system_info::need_fullpath is true and
35713571+ * retro_system_content_info_override::need_fullpath
35723572+ * is unset
35733573+ * OR
35743574+ * - retro_system_content_info_override::need_fullpath
35753575+ * is true */
35763576+ const void *data;
35773577+35783578+ /* Size of game content memory buffer, in bytes */
35793579+ size_t size;
35803580+35813581+ /* True if loaded content file is inside a compressed
35823582+ * archive */
35833583+ bool file_in_archive;
35843584+35853585+ /* - If data is NULL, value is unset/ignored
35863586+ * - If data is non-NULL:
35873587+ * - If persistent_data is false, data and size are
35883588+ * valid only until retro_load_game() returns
35893589+ * - If persistent_data is true, data and size are
35903590+ * are valid until retro_deinit() returns */
35913591+ bool persistent_data;
35923592+};
35933593+27843594struct retro_game_geometry
27853595{
27863596 unsigned base_width; /* Nominal video width of game. */
···28793689 const char *default_value;
28803690};
2881369136923692+#ifdef __PS3__
36933693+#undef local
36943694+#endif
36953695+28823696struct retro_core_options_intl
28833697{
28843698 /* Pointer to an array of retro_core_option_definition structs
···28923706 struct retro_core_option_definition *local;
28933707};
2894370837093709+struct retro_core_option_v2_category
37103710+{
37113711+ /* Variable uniquely identifying the
37123712+ * option category. Valid key characters
37133713+ * are [a-z, A-Z, 0-9, _, -] */
37143714+ const char *key;
37153715+37163716+ /* Human-readable category description
37173717+ * > Used as category menu label when
37183718+ * frontend has core option category
37193719+ * support */
37203720+ const char *desc;
37213721+37223722+ /* Human-readable category information
37233723+ * > Used as category menu sublabel when
37243724+ * frontend has core option category
37253725+ * support
37263726+ * > Optional (may be NULL or an empty
37273727+ * string) */
37283728+ const char *info;
37293729+};
37303730+37313731+struct retro_core_option_v2_definition
37323732+{
37333733+ /* Variable to query in RETRO_ENVIRONMENT_GET_VARIABLE.
37343734+ * Valid key characters are [a-z, A-Z, 0-9, _, -] */
37353735+ const char *key;
37363736+37373737+ /* Human-readable core option description
37383738+ * > Used as menu label when frontend does
37393739+ * not have core option category support
37403740+ * e.g. "Video > Aspect Ratio" */
37413741+ const char *desc;
37423742+37433743+ /* Human-readable core option description
37443744+ * > Used as menu label when frontend has
37453745+ * core option category support
37463746+ * e.g. "Aspect Ratio", where associated
37473747+ * retro_core_option_v2_category::desc
37483748+ * is "Video"
37493749+ * > If empty or NULL, the string specified by
37503750+ * desc will be used as the menu label
37513751+ * > Will be ignored (and may be set to NULL)
37523752+ * if category_key is empty or NULL */
37533753+ const char *desc_categorized;
37543754+37553755+ /* Human-readable core option information
37563756+ * > Used as menu sublabel */
37573757+ const char *info;
37583758+37593759+ /* Human-readable core option information
37603760+ * > Used as menu sublabel when frontend
37613761+ * has core option category support
37623762+ * (e.g. may be required when info text
37633763+ * references an option by name/desc,
37643764+ * and the desc/desc_categorized text
37653765+ * for that option differ)
37663766+ * > If empty or NULL, the string specified by
37673767+ * info will be used as the menu sublabel
37683768+ * > Will be ignored (and may be set to NULL)
37693769+ * if category_key is empty or NULL */
37703770+ const char *info_categorized;
37713771+37723772+ /* Variable specifying category (e.g. "video",
37733773+ * "audio") that will be assigned to the option
37743774+ * if frontend has core option category support.
37753775+ * > Categorized options will be displayed in a
37763776+ * subsection/submenu of the frontend core
37773777+ * option interface
37783778+ * > Specified string must match one of the
37793779+ * retro_core_option_v2_category::key values
37803780+ * in the associated retro_core_option_v2_category
37813781+ * array; If no match is not found, specified
37823782+ * string will be considered as NULL
37833783+ * > If specified string is empty or NULL, option will
37843784+ * have no category and will be shown at the top
37853785+ * level of the frontend core option interface */
37863786+ const char *category_key;
37873787+37883788+ /* Array of retro_core_option_value structs, terminated by NULL */
37893789+ struct retro_core_option_value values[RETRO_NUM_CORE_OPTION_VALUES_MAX];
37903790+37913791+ /* Default core option value. Must match one of the values
37923792+ * in the retro_core_option_value array, otherwise will be
37933793+ * ignored */
37943794+ const char *default_value;
37953795+};
37963796+37973797+struct retro_core_options_v2
37983798+{
37993799+ /* Array of retro_core_option_v2_category structs,
38003800+ * terminated by NULL
38013801+ * > If NULL, all entries in definitions array
38023802+ * will have no category and will be shown at
38033803+ * the top level of the frontend core option
38043804+ * interface
38053805+ * > Will be ignored if frontend does not have
38063806+ * core option category support */
38073807+ struct retro_core_option_v2_category *categories;
38083808+38093809+ /* Array of retro_core_option_v2_definition structs,
38103810+ * terminated by NULL */
38113811+ struct retro_core_option_v2_definition *definitions;
38123812+};
38133813+38143814+struct retro_core_options_v2_intl
38153815+{
38163816+ /* Pointer to a retro_core_options_v2 struct
38173817+ * > US English implementation
38183818+ * > Must point to a valid struct */
38193819+ struct retro_core_options_v2 *us;
38203820+38213821+ /* Pointer to a retro_core_options_v2 struct
38223822+ * - Implementation for current frontend language
38233823+ * - May be NULL */
38243824+ struct retro_core_options_v2 *local;
38253825+};
38263826+38273827+/* Used by the frontend to monitor changes in core option
38283828+ * visibility. May be called each time any core option
38293829+ * value is set via the frontend.
38303830+ * - On each invocation, the core must update the visibility
38313831+ * of any dynamically hidden options using the
38323832+ * RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY environment
38333833+ * callback.
38343834+ * - On the first invocation, returns 'true' if the visibility
38353835+ * of any core option has changed since the last call of
38363836+ * retro_load_game() or retro_load_game_special().
38373837+ * - On each subsequent invocation, returns 'true' if the
38383838+ * visibility of any core option has changed since the last
38393839+ * time the function was called. */
38403840+typedef bool (RETRO_CALLCONV *retro_core_options_update_display_callback_t)(void);
38413841+struct retro_core_options_update_display_callback
38423842+{
38433843+ retro_core_options_update_display_callback_t callback;
38443844+};
38453845+28953846struct retro_game_info
28963847{
28973848 const char *path; /* Path to game, UTF-8 encoded.
···29383889 Set by frontend in GET_CURRENT_SOFTWARE_FRAMEBUFFER. */
29393890};
2940389138923892+/* Used by a libretro core to override the current
38933893+ * fastforwarding mode of the frontend */
38943894+struct retro_fastforwarding_override
38953895+{
38963896+ /* Specifies the runtime speed multiplier that
38973897+ * will be applied when 'fastforward' is true.
38983898+ * For example, a value of 5.0 when running 60 FPS
38993899+ * content will cap the fast-forward rate at 300 FPS.
39003900+ * Note that the target multiplier may not be achieved
39013901+ * if the host hardware has insufficient processing
39023902+ * power.
39033903+ * Setting a value of 0.0 (or greater than 0.0 but
39043904+ * less than 1.0) will result in an uncapped
39053905+ * fast-forward rate (limited only by hardware
39063906+ * capacity).
39073907+ * If the value is negative, it will be ignored
39083908+ * (i.e. the frontend will use a runtime speed
39093909+ * multiplier of its own choosing) */
39103910+ float ratio;
39113911+39123912+ /* If true, fastforwarding mode will be enabled.
39133913+ * If false, fastforwarding mode will be disabled. */
39143914+ bool fastforward;
39153915+39163916+ /* If true, and if supported by the frontend, an
39173917+ * on-screen notification will be displayed while
39183918+ * 'fastforward' is true.
39193919+ * If false, and if supported by the frontend, any
39203920+ * on-screen fast-forward notifications will be
39213921+ * suppressed */
39223922+ bool notification;
39233923+39243924+ /* If true, the core will have sole control over
39253925+ * when fastforwarding mode is enabled/disabled;
39263926+ * the frontend will not be able to change the
39273927+ * state set by 'fastforward' until either
39283928+ * 'inhibit_toggle' is set to false, or the core
39293929+ * is unloaded */
39303930+ bool inhibit_toggle;
39313931+};
39323932+39333933+/* During normal operation. Rate will be equal to the core's internal FPS. */
39343934+#define RETRO_THROTTLE_NONE 0
39353935+39363936+/* While paused or stepping single frames. Rate will be 0. */
39373937+#define RETRO_THROTTLE_FRAME_STEPPING 1
39383938+39393939+/* During fast forwarding.
39403940+ * Rate will be 0 if not specifically limited to a maximum speed. */
39413941+#define RETRO_THROTTLE_FAST_FORWARD 2
39423942+39433943+/* During slow motion. Rate will be less than the core's internal FPS. */
39443944+#define RETRO_THROTTLE_SLOW_MOTION 3
39453945+39463946+/* While rewinding recorded save states. Rate can vary depending on the rewind
39473947+ * speed or be 0 if the frontend is not aiming for a specific rate. */
39483948+#define RETRO_THROTTLE_REWINDING 4
39493949+39503950+/* While vsync is active in the video driver and the target refresh rate is
39513951+ * lower than the core's internal FPS. Rate is the target refresh rate. */
39523952+#define RETRO_THROTTLE_VSYNC 5
39533953+39543954+/* When the frontend does not throttle in any way. Rate will be 0.
39553955+ * An example could be if no vsync or audio output is active. */
39563956+#define RETRO_THROTTLE_UNBLOCKED 6
39573957+39583958+struct retro_throttle_state
39593959+{
39603960+ /* The current throttling mode. Should be one of the values above. */
39613961+ unsigned mode;
39623962+39633963+ /* How many times per second the frontend aims to call retro_run.
39643964+ * Depending on the mode, it can be 0 if there is no known fixed rate.
39653965+ * This won't be accurate if the total processing time of the core and
39663966+ * the frontend is longer than what is available for one frame. */
39673967+ float rate;
39683968+};
39693969+39703970+/**
39713971+ * Opaque handle to a microphone that's been opened for use.
39723972+ * The underlying object is accessed or created with \c retro_microphone_interface_t.
39733973+ */
39743974+typedef struct retro_microphone retro_microphone_t;
39753975+39763976+/**
39773977+ * Parameters for configuring a microphone.
39783978+ * Some of these might not be honored,
39793979+ * depending on the available hardware and driver configuration.
39803980+ */
39813981+typedef struct retro_microphone_params
39823982+{
39833983+ /**
39843984+ * The desired sample rate of the microphone's input, in Hz.
39853985+ * The microphone's input will be resampled,
39863986+ * so cores can ask for whichever frequency they need.
39873987+ *
39883988+ * If zero, some reasonable default will be provided by the frontend
39893989+ * (usually from its config file).
39903990+ *
39913991+ * @see retro_get_mic_rate_t
39923992+ */
39933993+ unsigned rate;
39943994+} retro_microphone_params_t;
39953995+39963996+/**
39973997+ * @copydoc retro_microphone_interface::open_mic
39983998+ */
39993999+typedef retro_microphone_t *(RETRO_CALLCONV *retro_open_mic_t)(const retro_microphone_params_t *params);
40004000+40014001+/**
40024002+ * @copydoc retro_microphone_interface::close_mic
40034003+ */
40044004+typedef void (RETRO_CALLCONV *retro_close_mic_t)(retro_microphone_t *microphone);
40054005+40064006+/**
40074007+ * @copydoc retro_microphone_interface::get_params
40084008+ */
40094009+typedef bool (RETRO_CALLCONV *retro_get_mic_params_t)(const retro_microphone_t *microphone, retro_microphone_params_t *params);
40104010+40114011+/**
40124012+ * @copydoc retro_microphone_interface::set_mic_state
40134013+ */
40144014+typedef bool (RETRO_CALLCONV *retro_set_mic_state_t)(retro_microphone_t *microphone, bool state);
40154015+40164016+/**
40174017+ * @copydoc retro_microphone_interface::get_mic_state
40184018+ */
40194019+typedef bool (RETRO_CALLCONV *retro_get_mic_state_t)(const retro_microphone_t *microphone);
40204020+40214021+/**
40224022+ * @copydoc retro_microphone_interface::read_mic
40234023+ */
40244024+typedef int (RETRO_CALLCONV *retro_read_mic_t)(retro_microphone_t *microphone, int16_t* samples, size_t num_samples);
40254025+40264026+/**
40274027+ * The current version of the microphone interface.
40284028+ * Will be incremented whenever \c retro_microphone_interface or \c retro_microphone_params_t
40294029+ * receive new fields.
40304030+ *
40314031+ * Frontends using cores built against older mic interface versions
40324032+ * should not access fields introduced in newer versions.
40334033+ */
40344034+#define RETRO_MICROPHONE_INTERFACE_VERSION 1
40354035+40364036+/**
40374037+ * An interface for querying the microphone and accessing data read from it.
40384038+ *
40394039+ * @see RETRO_ENVIRONMENT_GET_MICROPHONE_INTERFACE
40404040+ */
40414041+struct retro_microphone_interface
40424042+{
40434043+ /**
40444044+ * The version of this microphone interface.
40454045+ * Set by the core to request a particular version,
40464046+ * and set by the frontend to indicate the returned version.
40474047+ * 0 indicates that the interface is invalid or uninitialized.
40484048+ */
40494049+ unsigned interface_version;
40504050+40514051+ /**
40524052+ * Initializes a new microphone.
40534053+ * Assuming that microphone support is enabled and provided by the frontend,
40544054+ * cores may call this function whenever necessary.
40554055+ * A microphone could be opened throughout a core's lifetime,
40564056+ * or it could wait until a microphone is plugged in to the emulated device.
40574057+ *
40584058+ * The returned handle will be valid until it's freed,
40594059+ * even if the audio driver is reinitialized.
40604060+ *
40614061+ * This function is not guaranteed to be thread-safe.
40624062+ *
40634063+ * @param args[in] Parameters used to create the microphone.
40644064+ * May be \c NULL, in which case the default value of each parameter will be used.
40654065+ *
40664066+ * @returns Pointer to the newly-opened microphone,
40674067+ * or \c NULL if one couldn't be opened.
40684068+ * This likely means that no microphone is plugged in and recognized,
40694069+ * or the maximum number of supported microphones has been reached.
40704070+ *
40714071+ * @note Microphones are \em inactive by default;
40724072+ * to begin capturing audio, call \c set_mic_state.
40734073+ * @see retro_microphone_params_t
40744074+ */
40754075+ retro_open_mic_t open_mic;
40764076+40774077+ /**
40784078+ * Closes a microphone that was initialized with \c open_mic.
40794079+ * Calling this function will stop all microphone activity
40804080+ * and free up the resources that it allocated.
40814081+ * Afterwards, the handle is invalid and must not be used.
40824082+ *
40834083+ * A frontend may close opened microphones when unloading content,
40844084+ * but this behavior is not guaranteed.
40854085+ * Cores should close their microphones when exiting, just to be safe.
40864086+ *
40874087+ * @param microphone Pointer to the microphone that was allocated by \c open_mic.
40884088+ * If \c NULL, this function does nothing.
40894089+ *
40904090+ * @note The handle might be reused if another microphone is opened later.
40914091+ */
40924092+ retro_close_mic_t close_mic;
40934093+40944094+ /**
40954095+ * Returns the configured parameters of this microphone.
40964096+ * These may differ from what was requested depending on
40974097+ * the driver and device configuration.
40984098+ *
40994099+ * Cores should check these values before they start fetching samples.
41004100+ *
41014101+ * Will not change after the mic was opened.
41024102+ *
41034103+ * @param microphone[in] Opaque handle to the microphone
41044104+ * whose parameters will be retrieved.
41054105+ * @param params[out] The parameters object that the
41064106+ * microphone's parameters will be copied to.
41074107+ *
41084108+ * @return \c true if the parameters were retrieved,
41094109+ * \c false if there was an error.
41104110+ */
41114111+ retro_get_mic_params_t get_params;
41124112+41134113+ /**
41144114+ * Enables or disables the given microphone.
41154115+ * Microphones are disabled by default
41164116+ * and must be explicitly enabled before they can be used.
41174117+ * Disabled microphones will not process incoming audio samples,
41184118+ * and will therefore have minimal impact on overall performance.
41194119+ * Cores may enable microphones throughout their lifetime,
41204120+ * or only for periods where they're needed.
41214121+ *
41224122+ * Cores that accept microphone input should be able to operate without it;
41234123+ * we suggest substituting silence in this case.
41244124+ *
41254125+ * @param microphone Opaque handle to the microphone
41264126+ * whose state will be adjusted.
41274127+ * This will have been provided by \c open_mic.
41284128+ * @param state \c true if the microphone should receive audio input,
41294129+ * \c false if it should be idle.
41304130+ * @returns \c true if the microphone's state was successfully set,
41314131+ * \c false if \c microphone is invalid
41324132+ * or if there was an error.
41334133+ */
41344134+ retro_set_mic_state_t set_mic_state;
41354135+41364136+ /**
41374137+ * Queries the active state of a microphone at the given index.
41384138+ * Will return whether the microphone is enabled,
41394139+ * even if the driver is paused.
41404140+ *
41414141+ * @param microphone Opaque handle to the microphone
41424142+ * whose state will be queried.
41434143+ * @return \c true if the provided \c microphone is valid and active,
41444144+ * \c false if not or if there was an error.
41454145+ */
41464146+ retro_get_mic_state_t get_mic_state;
41474147+41484148+ /**
41494149+ * Retrieves the input processed by the microphone since the last call.
41504150+ * \em Must be called every frame unless \c microphone is disabled,
41514151+ * similar to how \c retro_audio_sample_batch_t works.
41524152+ *
41534153+ * @param[in] microphone Opaque handle to the microphone
41544154+ * whose recent input will be retrieved.
41554155+ * @param[out] samples The buffer that will be used to store the microphone's data.
41564156+ * Microphone input is in mono (i.e. one number per sample).
41574157+ * Should be large enough to accommodate the expected number of samples per frame;
41584158+ * for example, a 44.1kHz sample rate at 60 FPS would require space for 735 samples.
41594159+ * @param[in] num_samples The size of the data buffer in samples (\em not bytes).
41604160+ * Microphone input is in mono, so a "frame" and a "sample" are equivalent in length here.
41614161+ *
41624162+ * @return The number of samples that were copied into \c samples.
41634163+ * If \c microphone is pending driver initialization,
41644164+ * this function will copy silence of the requested length into \c samples.
41654165+ *
41664166+ * Will return -1 if the microphone is disabled,
41674167+ * the audio driver is paused,
41684168+ * or there was an error.
41694169+ */
41704170+ retro_read_mic_t read_mic;
41714171+};
41724172+41734173+/**
41744174+ * Describes how a device is being powered.
41754175+ * @see RETRO_ENVIRONMENT_GET_DEVICE_POWER
41764176+ */
41774177+enum retro_power_state
41784178+{
41794179+ /**
41804180+ * Indicates that the frontend cannot report its power state at this time,
41814181+ * most likely due to a lack of support.
41824182+ *
41834183+ * \c RETRO_ENVIRONMENT_GET_DEVICE_POWER will not return this value;
41844184+ * instead, the environment callback will return \c false.
41854185+ */
41864186+ RETRO_POWERSTATE_UNKNOWN = 0,
41874187+41884188+ /**
41894189+ * Indicates that the device is running on its battery.
41904190+ * Usually applies to portable devices such as handhelds, laptops, and smartphones.
41914191+ */
41924192+ RETRO_POWERSTATE_DISCHARGING,
41934193+41944194+ /**
41954195+ * Indicates that the device's battery is currently charging.
41964196+ */
41974197+ RETRO_POWERSTATE_CHARGING,
41984198+41994199+ /**
42004200+ * Indicates that the device is connected to a power source
42014201+ * and that its battery has finished charging.
42024202+ */
42034203+ RETRO_POWERSTATE_CHARGED,
42044204+42054205+ /**
42064206+ * Indicates that the device is connected to a power source
42074207+ * and that it does not have a battery.
42084208+ * This usually suggests a desktop computer or a non-portable game console.
42094209+ */
42104210+ RETRO_POWERSTATE_PLUGGED_IN
42114211+};
42124212+42134213+/**
42144214+ * Indicates that an estimate is not available for the battery level or time remaining,
42154215+ * even if the actual power state is known.
42164216+ */
42174217+#define RETRO_POWERSTATE_NO_ESTIMATE (-1)
42184218+42194219+/**
42204220+ * Describes the power state of the device running the frontend.
42214221+ * @see RETRO_ENVIRONMENT_GET_DEVICE_POWER
42224222+ */
42234223+struct retro_device_power
42244224+{
42254225+ /**
42264226+ * The current state of the frontend's power usage.
42274227+ */
42284228+ enum retro_power_state state;
42294229+42304230+ /**
42314231+ * A rough estimate of the amount of time remaining (in seconds)
42324232+ * before the device powers off.
42334233+ * This value depends on a variety of factors,
42344234+ * so it is not guaranteed to be accurate.
42354235+ *
42364236+ * Will be set to \c RETRO_POWERSTATE_NO_ESTIMATE if \c state does not equal \c RETRO_POWERSTATE_DISCHARGING.
42374237+ * May still be set to \c RETRO_POWERSTATE_NO_ESTIMATE if the frontend is unable to provide an estimate.
42384238+ */
42394239+ int seconds;
42404240+42414241+ /**
42424242+ * The approximate percentage of battery charge,
42434243+ * ranging from 0 to 100 (inclusive).
42444244+ * The device may power off before this reaches 0.
42454245+ *
42464246+ * The user might have configured their device
42474247+ * to stop charging before the battery is full,
42484248+ * so do not assume that this will be 100 in the \c RETRO_POWERSTATE_CHARGED state.
42494249+ */
42504250+ int8_t percent;
42514251+};
42524252+29414253/* Callbacks */
2942425429434255/* Environment callback. Gives implementations a way of performing
···30904402}
30914403#endif
3092440430933093-#endif
44054405+#endif