this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

libretro: Update libretro.h header files (#2588)

authored by

Rob Loach and committed by
GitHub
41fa7e18 48005e65

+1352 -13
+1325 -13
src/system/libretro/libretro-common/include/libretro.h
··· 283 283 RETRO_LANGUAGE_HEBREW = 21, 284 284 RETRO_LANGUAGE_ASTURIAN = 22, 285 285 RETRO_LANGUAGE_FINNISH = 23, 286 + RETRO_LANGUAGE_INDONESIAN = 24, 287 + RETRO_LANGUAGE_SWEDISH = 25, 288 + RETRO_LANGUAGE_UKRAINIAN = 26, 289 + RETRO_LANGUAGE_CZECH = 27, 290 + RETRO_LANGUAGE_CATALAN_VALENCIA = 28, 291 + RETRO_LANGUAGE_CATALAN = 29, 292 + RETRO_LANGUAGE_BRITISH_ENGLISH = 30, 293 + RETRO_LANGUAGE_HUNGARIAN = 31, 294 + RETRO_LANGUAGE_BELARUSIAN = 32, 286 295 RETRO_LANGUAGE_LAST, 287 296 288 297 /* Ensure sizeof(enum) == sizeof(int) */ ··· 920 929 * anything else. 921 930 * It is recommended to expose all relevant pointers through 922 931 * retro_get_memory_* as well. 923 - * 924 - * Can be called from retro_init and retro_load_game. 925 932 */ 926 933 #define RETRO_ENVIRONMENT_SET_GEOMETRY 37 927 934 /* const struct retro_game_geometry * -- ··· 1131 1138 * retro_core_option_definition structs to RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL. 1132 1139 * This allows the core to additionally set option sublabel information 1133 1140 * and/or provide localisation support. 1141 + * 1142 + * If version is >= 2, core options may instead be set by passing 1143 + * a retro_core_options_v2 struct to RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2, 1144 + * or an array of retro_core_options_v2 structs to 1145 + * RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2_INTL. This allows the core 1146 + * to additionally set optional core option category information 1147 + * for frontends with core option category support. 1134 1148 */ 1135 1149 1136 1150 #define RETRO_ENVIRONMENT_SET_CORE_OPTIONS 53 ··· 1172 1186 * default value is NULL, the first entry in the 1173 1187 * retro_core_option_definition::values array is treated as the default. 1174 1188 * 1175 - * The number of possible options should be very limited, 1189 + * The number of possible option values should be very limited, 1176 1190 * and must be less than RETRO_NUM_CORE_OPTION_VALUES_MAX. 1177 1191 * i.e. it should be feasible to cycle through options 1178 1192 * without a keyboard. ··· 1205 1219 * This should only be called if RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION 1206 1220 * returns an API version of >= 1. 1207 1221 * This should be called instead of RETRO_ENVIRONMENT_SET_VARIABLES. 1222 + * This should be called instead of RETRO_ENVIRONMENT_SET_CORE_OPTIONS. 1208 1223 * This should be called the first time as early as 1209 1224 * possible (ideally in retro_set_environment). 1210 1225 * Afterwards it may be called again for the core to communicate ··· 1378 1393 * call will target the newly initialized driver. 1379 1394 */ 1380 1395 1396 + #define RETRO_ENVIRONMENT_SET_FASTFORWARDING_OVERRIDE 64 1397 + /* const struct retro_fastforwarding_override * -- 1398 + * Used by a libretro core to override the current 1399 + * fastforwarding mode of the frontend. 1400 + * If NULL is passed to this function, the frontend 1401 + * will return true if fastforwarding override 1402 + * functionality is supported (no change in 1403 + * fastforwarding state will occur in this case). 1404 + */ 1405 + 1406 + #define RETRO_ENVIRONMENT_SET_CONTENT_INFO_OVERRIDE 65 1407 + /* const struct retro_system_content_info_override * -- 1408 + * Allows an implementation to override 'global' content 1409 + * info parameters reported by retro_get_system_info(). 1410 + * Overrides also affect subsystem content info parameters 1411 + * set via RETRO_ENVIRONMENT_SET_SUBSYSTEM_INFO. 1412 + * This function must be called inside retro_set_environment(). 1413 + * If callback returns false, content info overrides 1414 + * are unsupported by the frontend, and will be ignored. 1415 + * If callback returns true, extended game info may be 1416 + * retrieved by calling RETRO_ENVIRONMENT_GET_GAME_INFO_EXT 1417 + * in retro_load_game() or retro_load_game_special(). 1418 + * 1419 + * 'data' points to an array of retro_system_content_info_override 1420 + * structs terminated by a { NULL, false, false } element. 1421 + * If 'data' is NULL, no changes will be made to the frontend; 1422 + * a core may therefore pass NULL in order to test whether 1423 + * the RETRO_ENVIRONMENT_SET_CONTENT_INFO_OVERRIDE and 1424 + * RETRO_ENVIRONMENT_GET_GAME_INFO_EXT callbacks are supported 1425 + * by the frontend. 1426 + * 1427 + * For struct member descriptions, see the definition of 1428 + * struct retro_system_content_info_override. 1429 + * 1430 + * Example: 1431 + * 1432 + * - struct retro_system_info: 1433 + * { 1434 + * "My Core", // library_name 1435 + * "v1.0", // library_version 1436 + * "m3u|md|cue|iso|chd|sms|gg|sg", // valid_extensions 1437 + * true, // need_fullpath 1438 + * false // block_extract 1439 + * } 1440 + * 1441 + * - Array of struct retro_system_content_info_override: 1442 + * { 1443 + * { 1444 + * "md|sms|gg", // extensions 1445 + * false, // need_fullpath 1446 + * true // persistent_data 1447 + * }, 1448 + * { 1449 + * "sg", // extensions 1450 + * false, // need_fullpath 1451 + * false // persistent_data 1452 + * }, 1453 + * { NULL, false, false } 1454 + * } 1455 + * 1456 + * Result: 1457 + * - Files of type m3u, cue, iso, chd will not be 1458 + * loaded by the frontend. Frontend will pass a 1459 + * valid path to the core, and core will handle 1460 + * loading internally 1461 + * - Files of type md, sms, gg will be loaded by 1462 + * the frontend. A valid memory buffer will be 1463 + * passed to the core. This memory buffer will 1464 + * remain valid until retro_deinit() returns 1465 + * - Files of type sg will be loaded by the frontend. 1466 + * A valid memory buffer will be passed to the core. 1467 + * This memory buffer will remain valid until 1468 + * retro_load_game() (or retro_load_game_special()) 1469 + * returns 1470 + * 1471 + * NOTE: If an extension is listed multiple times in 1472 + * an array of retro_system_content_info_override 1473 + * structs, only the first instance will be registered 1474 + */ 1475 + 1476 + #define RETRO_ENVIRONMENT_GET_GAME_INFO_EXT 66 1477 + /* const struct retro_game_info_ext ** -- 1478 + * Allows an implementation to fetch extended game 1479 + * information, providing additional content path 1480 + * and memory buffer status details. 1481 + * This function may only be called inside 1482 + * retro_load_game() or retro_load_game_special(). 1483 + * If callback returns false, extended game information 1484 + * is unsupported by the frontend. In this case, only 1485 + * regular retro_game_info will be available. 1486 + * RETRO_ENVIRONMENT_GET_GAME_INFO_EXT is guaranteed 1487 + * to return true if RETRO_ENVIRONMENT_SET_CONTENT_INFO_OVERRIDE 1488 + * returns true. 1489 + * 1490 + * 'data' points to an array of retro_game_info_ext structs. 1491 + * 1492 + * For struct member descriptions, see the definition of 1493 + * struct retro_game_info_ext. 1494 + * 1495 + * - If function is called inside retro_load_game(), 1496 + * the retro_game_info_ext array is guaranteed to 1497 + * have a size of 1 - i.e. the returned pointer may 1498 + * be used to access directly the members of the 1499 + * first retro_game_info_ext struct, for example: 1500 + * 1501 + * struct retro_game_info_ext *game_info_ext; 1502 + * if (environ_cb(RETRO_ENVIRONMENT_GET_GAME_INFO_EXT, &game_info_ext)) 1503 + * printf("Content Directory: %s\n", game_info_ext->dir); 1504 + * 1505 + * - If the function is called inside retro_load_game_special(), 1506 + * the retro_game_info_ext array is guaranteed to have a 1507 + * size equal to the num_info argument passed to 1508 + * retro_load_game_special() 1509 + */ 1510 + 1511 + #define RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2 67 1512 + /* const struct retro_core_options_v2 * -- 1513 + * Allows an implementation to signal the environment 1514 + * which variables it might want to check for later using 1515 + * GET_VARIABLE. 1516 + * This allows the frontend to present these variables to 1517 + * a user dynamically. 1518 + * This should only be called if RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION 1519 + * returns an API version of >= 2. 1520 + * This should be called instead of RETRO_ENVIRONMENT_SET_VARIABLES. 1521 + * This should be called instead of RETRO_ENVIRONMENT_SET_CORE_OPTIONS. 1522 + * This should be called the first time as early as 1523 + * possible (ideally in retro_set_environment). 1524 + * Afterwards it may be called again for the core to communicate 1525 + * updated options to the frontend, but the number of core 1526 + * options must not change from the number in the initial call. 1527 + * If RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION returns an API 1528 + * version of >= 2, this callback is guaranteed to succeed 1529 + * (i.e. callback return value does not indicate success) 1530 + * If callback returns true, frontend has core option category 1531 + * support. 1532 + * If callback returns false, frontend does not have core option 1533 + * category support. 1534 + * 1535 + * 'data' points to a retro_core_options_v2 struct, containing 1536 + * of two pointers: 1537 + * - retro_core_options_v2::categories is an array of 1538 + * retro_core_option_v2_category structs terminated by a 1539 + * { NULL, NULL, NULL } element. If retro_core_options_v2::categories 1540 + * is NULL, all core options will have no category and will be shown 1541 + * at the top level of the frontend core option interface. If frontend 1542 + * does not have core option category support, categories array will 1543 + * be ignored. 1544 + * - retro_core_options_v2::definitions is an array of 1545 + * retro_core_option_v2_definition structs terminated by a 1546 + * { NULL, NULL, NULL, NULL, NULL, NULL, {{0}}, NULL } 1547 + * element. 1548 + * 1549 + * >> retro_core_option_v2_category notes: 1550 + * 1551 + * - retro_core_option_v2_category::key should contain string 1552 + * that uniquely identifies the core option category. Valid 1553 + * key characters are [a-z, A-Z, 0-9, _, -] 1554 + * Namespace collisions with other implementations' category 1555 + * keys are permitted. 1556 + * - retro_core_option_v2_category::desc should contain a human 1557 + * readable description of the category key. 1558 + * - retro_core_option_v2_category::info should contain any 1559 + * additional human readable information text that a typical 1560 + * user may need to understand the nature of the core option 1561 + * category. 1562 + * 1563 + * Example entry: 1564 + * { 1565 + * "advanced_settings", 1566 + * "Advanced", 1567 + * "Options affecting low-level emulation performance and accuracy." 1568 + * } 1569 + * 1570 + * >> retro_core_option_v2_definition notes: 1571 + * 1572 + * - retro_core_option_v2_definition::key should be namespaced to not 1573 + * collide with other implementations' keys. e.g. A core called 1574 + * 'foo' should use keys named as 'foo_option'. Valid key characters 1575 + * are [a-z, A-Z, 0-9, _, -]. 1576 + * - retro_core_option_v2_definition::desc should contain a human readable 1577 + * description of the key. Will be used when the frontend does not 1578 + * have core option category support. Examples: "Aspect Ratio" or 1579 + * "Video > Aspect Ratio". 1580 + * - retro_core_option_v2_definition::desc_categorized should contain a 1581 + * human readable description of the key, which will be used when 1582 + * frontend has core option category support. Example: "Aspect Ratio", 1583 + * where associated retro_core_option_v2_category::desc is "Video". 1584 + * If empty or NULL, the string specified by 1585 + * retro_core_option_v2_definition::desc will be used instead. 1586 + * retro_core_option_v2_definition::desc_categorized will be ignored 1587 + * if retro_core_option_v2_definition::category_key is empty or NULL. 1588 + * - retro_core_option_v2_definition::info should contain any additional 1589 + * human readable information text that a typical user may need to 1590 + * understand the functionality of the option. 1591 + * - retro_core_option_v2_definition::info_categorized should contain 1592 + * any additional human readable information text that a typical user 1593 + * may need to understand the functionality of the option, and will be 1594 + * used when frontend has core option category support. This is provided 1595 + * to accommodate the case where info text references an option by 1596 + * name/desc, and the desc/desc_categorized text for that option differ. 1597 + * If empty or NULL, the string specified by 1598 + * retro_core_option_v2_definition::info will be used instead. 1599 + * retro_core_option_v2_definition::info_categorized will be ignored 1600 + * if retro_core_option_v2_definition::category_key is empty or NULL. 1601 + * - retro_core_option_v2_definition::category_key should contain a 1602 + * category identifier (e.g. "video" or "audio") that will be 1603 + * assigned to the core option if frontend has core option category 1604 + * support. A categorized option will be shown in a subsection/ 1605 + * submenu of the frontend core option interface. If key is empty 1606 + * or NULL, or if key does not match one of the 1607 + * retro_core_option_v2_category::key values in the associated 1608 + * retro_core_option_v2_category array, option will have no category 1609 + * and will be shown at the top level of the frontend core option 1610 + * interface. 1611 + * - retro_core_option_v2_definition::values is an array of 1612 + * retro_core_option_value structs terminated by a { NULL, NULL } 1613 + * element. 1614 + * --> retro_core_option_v2_definition::values[index].value is an 1615 + * expected option value. 1616 + * --> retro_core_option_v2_definition::values[index].label is a 1617 + * human readable label used when displaying the value on screen. 1618 + * If NULL, the value itself is used. 1619 + * - retro_core_option_v2_definition::default_value is the default 1620 + * core option setting. It must match one of the expected option 1621 + * values in the retro_core_option_v2_definition::values array. If 1622 + * it does not, or the default value is NULL, the first entry in the 1623 + * retro_core_option_v2_definition::values array is treated as the 1624 + * default. 1625 + * 1626 + * The number of possible option values should be very limited, 1627 + * and must be less than RETRO_NUM_CORE_OPTION_VALUES_MAX. 1628 + * i.e. it should be feasible to cycle through options 1629 + * without a keyboard. 1630 + * 1631 + * Example entries: 1632 + * 1633 + * - Uncategorized: 1634 + * 1635 + * { 1636 + * "foo_option", 1637 + * "Speed hack coprocessor X", 1638 + * NULL, 1639 + * "Provides increased performance at the expense of reduced accuracy.", 1640 + * NULL, 1641 + * NULL, 1642 + * { 1643 + * { "false", NULL }, 1644 + * { "true", NULL }, 1645 + * { "unstable", "Turbo (Unstable)" }, 1646 + * { NULL, NULL }, 1647 + * }, 1648 + * "false" 1649 + * } 1650 + * 1651 + * - Categorized: 1652 + * 1653 + * { 1654 + * "foo_option", 1655 + * "Advanced > Speed hack coprocessor X", 1656 + * "Speed hack coprocessor X", 1657 + * "Setting 'Advanced > Speed hack coprocessor X' to 'true' or 'Turbo' provides increased performance at the expense of reduced accuracy", 1658 + * "Setting 'Speed hack coprocessor X' to 'true' or 'Turbo' provides increased performance at the expense of reduced accuracy", 1659 + * "advanced_settings", 1660 + * { 1661 + * { "false", NULL }, 1662 + * { "true", NULL }, 1663 + * { "unstable", "Turbo (Unstable)" }, 1664 + * { NULL, NULL }, 1665 + * }, 1666 + * "false" 1667 + * } 1668 + * 1669 + * Only strings are operated on. The possible values will 1670 + * generally be displayed and stored as-is by the frontend. 1671 + */ 1672 + 1673 + #define RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2_INTL 68 1674 + /* const struct retro_core_options_v2_intl * -- 1675 + * Allows an implementation to signal the environment 1676 + * which variables it might want to check for later using 1677 + * GET_VARIABLE. 1678 + * This allows the frontend to present these variables to 1679 + * a user dynamically. 1680 + * This should only be called if RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION 1681 + * returns an API version of >= 2. 1682 + * This should be called instead of RETRO_ENVIRONMENT_SET_VARIABLES. 1683 + * This should be called instead of RETRO_ENVIRONMENT_SET_CORE_OPTIONS. 1684 + * This should be called instead of RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL. 1685 + * This should be called instead of RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2. 1686 + * This should be called the first time as early as 1687 + * possible (ideally in retro_set_environment). 1688 + * Afterwards it may be called again for the core to communicate 1689 + * updated options to the frontend, but the number of core 1690 + * options must not change from the number in the initial call. 1691 + * If RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION returns an API 1692 + * version of >= 2, this callback is guaranteed to succeed 1693 + * (i.e. callback return value does not indicate success) 1694 + * If callback returns true, frontend has core option category 1695 + * support. 1696 + * If callback returns false, frontend does not have core option 1697 + * category support. 1698 + * 1699 + * This is fundamentally the same as RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2, 1700 + * with the addition of localisation support. The description of the 1701 + * RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2 callback should be consulted 1702 + * for further details. 1703 + * 1704 + * 'data' points to a retro_core_options_v2_intl struct. 1705 + * 1706 + * - retro_core_options_v2_intl::us is a pointer to a 1707 + * retro_core_options_v2 struct defining the US English 1708 + * core options implementation. It must point to a valid struct. 1709 + * 1710 + * - retro_core_options_v2_intl::local is a pointer to a 1711 + * retro_core_options_v2 struct defining core options for 1712 + * the current frontend language. It may be NULL (in which case 1713 + * retro_core_options_v2_intl::us is used by the frontend). Any items 1714 + * missing from this struct will be read from 1715 + * retro_core_options_v2_intl::us instead. 1716 + * 1717 + * NOTE: Default core option values are always taken from the 1718 + * retro_core_options_v2_intl::us struct. Any default values in 1719 + * the retro_core_options_v2_intl::local struct will be ignored. 1720 + */ 1721 + 1722 + #define RETRO_ENVIRONMENT_SET_CORE_OPTIONS_UPDATE_DISPLAY_CALLBACK 69 1723 + /* const struct retro_core_options_update_display_callback * -- 1724 + * Allows a frontend to signal that a core must update 1725 + * the visibility of any dynamically hidden core options, 1726 + * and enables the frontend to detect visibility changes. 1727 + * Used by the frontend to update the menu display status 1728 + * of core options without requiring a call of retro_run(). 1729 + * Must be called in retro_set_environment(). 1730 + */ 1731 + 1732 + #define RETRO_ENVIRONMENT_SET_VARIABLE 70 1733 + /* const struct retro_variable * -- 1734 + * Allows an implementation to notify the frontend 1735 + * that a core option value has changed. 1736 + * 1737 + * retro_variable::key and retro_variable::value 1738 + * must match strings that have been set previously 1739 + * via one of the following: 1740 + * 1741 + * - RETRO_ENVIRONMENT_SET_VARIABLES 1742 + * - RETRO_ENVIRONMENT_SET_CORE_OPTIONS 1743 + * - RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL 1744 + * - RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2 1745 + * - RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2_INTL 1746 + * 1747 + * After changing a core option value via this 1748 + * callback, RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE 1749 + * will return true. 1750 + * 1751 + * If data is NULL, no changes will be registered 1752 + * and the callback will return true; an 1753 + * implementation may therefore pass NULL in order 1754 + * to test whether the callback is supported. 1755 + */ 1756 + 1757 + #define RETRO_ENVIRONMENT_GET_THROTTLE_STATE (71 | RETRO_ENVIRONMENT_EXPERIMENTAL) 1758 + /* struct retro_throttle_state * -- 1759 + * Allows an implementation to get details on the actual rate 1760 + * the frontend is attempting to call retro_run(). 1761 + */ 1762 + 1763 + #define RETRO_ENVIRONMENT_GET_SAVESTATE_CONTEXT (72 | RETRO_ENVIRONMENT_EXPERIMENTAL) 1764 + /* int * -- 1765 + * Tells the core about the context the frontend is asking for savestate. 1766 + * (see enum retro_savestate_context) 1767 + */ 1768 + 1769 + #define RETRO_ENVIRONMENT_GET_HW_RENDER_CONTEXT_NEGOTIATION_INTERFACE_SUPPORT (73 | RETRO_ENVIRONMENT_EXPERIMENTAL) 1770 + /* struct retro_hw_render_context_negotiation_interface * -- 1771 + * Before calling SET_HW_RNEDER_CONTEXT_NEGOTIATION_INTERFACE, a core can query 1772 + * which version of the interface is supported. 1773 + * 1774 + * Frontend looks at interface_type and returns the maximum supported 1775 + * context negotiation interface version. 1776 + * If the interface_type is not supported or recognized by the frontend, a version of 0 1777 + * must be returned in interface_version and true is returned by frontend. 1778 + * 1779 + * If this environment call returns true with interface_version greater than 0, 1780 + * a core can always use a negotiation interface version larger than what the frontend returns, but only 1781 + * earlier versions of the interface will be used by the frontend. 1782 + * A frontend must not reject a negotiation interface version that is larger than 1783 + * what the frontend supports. Instead, the frontend will use the older entry points that it recognizes. 1784 + * If this is incompatible with a particular core's requirements, it can error out early. 1785 + * 1786 + * Backwards compatibility note: 1787 + * This environment call was introduced after Vulkan v1 context negotiation. 1788 + * If this environment call is not supported by frontend - i.e. the environment call returns false - 1789 + * only Vulkan v1 context negotiation is supported (if Vulkan HW rendering is supported at all). 1790 + * If a core uses Vulkan negotiation interface with version > 1, negotiation may fail unexpectedly. 1791 + * All future updates to the context negotiation interface implies that frontend must support 1792 + * this environment call to query support. 1793 + */ 1794 + 1795 + #define RETRO_ENVIRONMENT_GET_JIT_CAPABLE 74 1796 + /* bool * -- 1797 + * Result is set to true if the frontend has already verified JIT can be 1798 + * used, mainly for use iOS/tvOS. On other platforms the result is true. 1799 + */ 1800 + 1801 + #define RETRO_ENVIRONMENT_GET_MICROPHONE_INTERFACE (75 | RETRO_ENVIRONMENT_EXPERIMENTAL) 1802 + /* struct retro_microphone_interface * -- 1803 + * Returns an interface that can be used to receive input from the microphone driver. 1804 + * 1805 + * Returns true if microphone support is available, 1806 + * even if no microphones are plugged in. 1807 + * Returns false if mic support is disabled or unavailable. 1808 + * 1809 + * This callback can be invoked at any time, 1810 + * even before the microphone driver is ready. 1811 + */ 1812 + 1813 + #define RETRO_ENVIRONMENT_SET_NETPACKET_INTERFACE 76 1814 + /* const struct retro_netpacket_callback * -- 1815 + * When set, a core gains control over network packets sent and 1816 + * received during a multiplayer session. This can be used to 1817 + * emulate multiplayer games that were originally played on two 1818 + * or more separate consoles or computers connected together. 1819 + * 1820 + * The frontend will take care of connecting players together, 1821 + * and the core only needs to send the actual data as needed for 1822 + * the emulation, while handshake and connection management happen 1823 + * in the background. 1824 + * 1825 + * When two or more players are connected and this interface has 1826 + * been set, time manipulation features (such as pausing, slow motion, 1827 + * fast forward, rewinding, save state loading, etc.) are disabled to 1828 + * avoid interrupting communication. 1829 + * 1830 + * Should be set in either retro_init or retro_load_game, but not both. 1831 + * 1832 + * When not set, a frontend may use state serialization-based 1833 + * multiplayer, where a deterministic core supporting multiple 1834 + * input devices does not need to take any action on its own. 1835 + */ 1836 + 1837 + #define RETRO_ENVIRONMENT_GET_DEVICE_POWER (77 | RETRO_ENVIRONMENT_EXPERIMENTAL) 1838 + /* struct retro_device_power * -- 1839 + * Returns the device's current power state as reported by the frontend. 1840 + * This is useful for emulating the battery level in handheld consoles, 1841 + * or for reducing power consumption when on battery power. 1842 + * 1843 + * The return value indicates whether the frontend can provide this information, 1844 + * even if the parameter is NULL. 1845 + * 1846 + * If the frontend does not support this functionality, 1847 + * then the provided argument will remain unchanged. 1848 + * 1849 + * Note that this environment call describes the power state for the entire device, 1850 + * not for individual peripherals like controllers. 1851 + */ 1852 + 1381 1853 /* VFS functionality */ 1382 1854 1383 1855 /* File paths: ··· 1552 2024 1553 2025 enum retro_hw_render_interface_type 1554 2026 { 1555 - RETRO_HW_RENDER_INTERFACE_VULKAN = 0, 1556 - RETRO_HW_RENDER_INTERFACE_D3D9 = 1, 1557 - RETRO_HW_RENDER_INTERFACE_D3D10 = 2, 1558 - RETRO_HW_RENDER_INTERFACE_D3D11 = 3, 1559 - RETRO_HW_RENDER_INTERFACE_D3D12 = 4, 2027 + RETRO_HW_RENDER_INTERFACE_VULKAN = 0, 2028 + RETRO_HW_RENDER_INTERFACE_D3D9 = 1, 2029 + RETRO_HW_RENDER_INTERFACE_D3D10 = 2, 2030 + RETRO_HW_RENDER_INTERFACE_D3D11 = 3, 2031 + RETRO_HW_RENDER_INTERFACE_D3D12 = 4, 1560 2032 RETRO_HW_RENDER_INTERFACE_GSKIT_PS2 = 5, 1561 - RETRO_HW_RENDER_INTERFACE_DUMMY = INT_MAX 2033 + RETRO_HW_RENDER_INTERFACE_DUMMY = INT_MAX 1562 2034 }; 1563 2035 1564 2036 /* Base struct. All retro_hw_render_interface_* types ··· 2334 2806 /* Vulkan, see RETRO_ENVIRONMENT_GET_HW_RENDER_INTERFACE. */ 2335 2807 RETRO_HW_CONTEXT_VULKAN = 6, 2336 2808 2337 - /* Direct3D, set version_major to select the type of interface 2338 - * returned by RETRO_ENVIRONMENT_GET_HW_RENDER_INTERFACE */ 2339 - RETRO_HW_CONTEXT_DIRECT3D = 7, 2809 + /* Direct3D11, see RETRO_ENVIRONMENT_GET_HW_RENDER_INTERFACE */ 2810 + RETRO_HW_CONTEXT_D3D11 = 7, 2811 + 2812 + /* Direct3D10, see RETRO_ENVIRONMENT_GET_HW_RENDER_INTERFACE */ 2813 + RETRO_HW_CONTEXT_D3D10 = 8, 2814 + 2815 + /* Direct3D12, see RETRO_ENVIRONMENT_GET_HW_RENDER_INTERFACE */ 2816 + RETRO_HW_CONTEXT_D3D12 = 9, 2817 + 2818 + /* Direct3D9, see RETRO_ENVIRONMENT_GET_HW_RENDER_INTERFACE */ 2819 + RETRO_HW_CONTEXT_D3D9 = 10, 2340 2820 2341 2821 RETRO_HW_CONTEXT_DUMMY = INT_MAX 2342 2822 }; ··· 2591 3071 retro_get_image_label_t get_image_label; /* Optional - may be NULL */ 2592 3072 }; 2593 3073 3074 + /* Definitions for RETRO_ENVIRONMENT_SET_NETPACKET_INTERFACE. 3075 + * A core can set it if sending and receiving custom network packets 3076 + * during a multiplayer session is desired. 3077 + */ 3078 + 3079 + /* Netpacket flags for retro_netpacket_send_t */ 3080 + #define RETRO_NETPACKET_UNRELIABLE 0 /* Packet to be sent unreliable, depending on network quality it might not arrive. */ 3081 + #define RETRO_NETPACKET_RELIABLE (1 << 0) /* Reliable packets are guaranteed to arrive at the target in the order they were send. */ 3082 + #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. */ 3083 + 3084 + /* Used by the core to send a packet to one or more connected players. 3085 + * A single packet sent via this interface can contain up to 64 KB of data. 3086 + * 3087 + * The broadcast flag can be set to true to send to multiple connected clients. 3088 + * In a broadcast, the client_id argument indicates 1 client NOT to send the 3089 + * packet to (pass 0xFFFF to send to everyone). Otherwise, the client_id 3090 + * argument indicates a single client to send the packet to. 3091 + * 3092 + * A frontend must support sending reliable packets (RETRO_NETPACKET_RELIABLE). 3093 + * Unreliable packets might not be supported by the frontend, but the flags can 3094 + * still be specified. Reliable transmission will be used instead. 3095 + * 3096 + * If this function is called passing NULL for buf, it will instead flush all 3097 + * previously buffered outgoing packets and instantly read any incoming packets. 3098 + * During such a call, retro_netpacket_receive_t and retro_netpacket_stop_t can 3099 + * be called. The core can perform this in a loop to do a blocking read, i.e., 3100 + * wait for incoming data, but needs to handle stop getting called and also 3101 + * give up after a short while to avoid freezing on a connection problem. 3102 + * 3103 + * This function is not guaranteed to be thread-safe and must be called during 3104 + * retro_run or any of the netpacket callbacks passed with this interface. 3105 + */ 3106 + typedef void (RETRO_CALLCONV *retro_netpacket_send_t)(int flags, const void* buf, size_t len, uint16_t client_id, bool broadcast); 3107 + 3108 + /* Called by the frontend to signify that a multiplayer session has started. 3109 + * If client_id is 0 the local player is the host of the session and at this 3110 + * point no other player has connected yet. 3111 + * 3112 + * If client_id is > 0 the local player is a client connected to a host and 3113 + * at this point is already fully connected to the host. 3114 + * 3115 + * The core must store the retro_netpacket_send_t function pointer provided 3116 + * here and use it whenever it wants to send a packet. This function pointer 3117 + * remains valid until the frontend calls retro_netpacket_stop_t. 3118 + */ 3119 + typedef void (RETRO_CALLCONV *retro_netpacket_start_t)(uint16_t client_id, retro_netpacket_send_t send_fn); 3120 + 3121 + /* Called by the frontend when a new packet arrives which has been sent from 3122 + * another player with retro_netpacket_send_t. The client_id argument indicates 3123 + * who has sent the packet. 3124 + */ 3125 + typedef void (RETRO_CALLCONV *retro_netpacket_receive_t)(const void* buf, size_t len, uint16_t client_id); 3126 + 3127 + /* Called by the frontend when the multiplayer session has ended. 3128 + * Once this gets called the retro_netpacket_send_t function pointer passed 3129 + * to retro_netpacket_start_t will not be valid anymore. 3130 + */ 3131 + typedef void (RETRO_CALLCONV *retro_netpacket_stop_t)(void); 3132 + 3133 + /* Called by the frontend every frame (between calls to retro_run while 3134 + * updating the state of the multiplayer session. 3135 + * This is a good place for the core to call retro_netpacket_send_t from. 3136 + */ 3137 + typedef void (RETRO_CALLCONV *retro_netpacket_poll_t)(void); 3138 + 3139 + /* Called by the frontend when a new player connects to the hosted session. 3140 + * This is only called on the host side, not for clients connected to the host. 3141 + * If this function returns false, the newly connected player gets dropped. 3142 + * This can be used for example to limit the number of players. 3143 + */ 3144 + typedef bool (RETRO_CALLCONV *retro_netpacket_connected_t)(uint16_t client_id); 3145 + 3146 + /* Called by the frontend when a player leaves or disconnects from the hosted session. 3147 + * This is only called on the host side, not for clients connected to the host. 3148 + */ 3149 + typedef void (RETRO_CALLCONV *retro_netpacket_disconnected_t)(uint16_t client_id); 3150 + 3151 + /** 3152 + * A callback interface for giving a core the ability to send and receive custom 3153 + * network packets during a multiplayer session between two or more instances 3154 + * of a libretro frontend. 3155 + * 3156 + * @see RETRO_ENVIRONMENT_SET_NETPACKET_INTERFACE 3157 + */ 3158 + struct retro_netpacket_callback 3159 + { 3160 + retro_netpacket_start_t start; 3161 + retro_netpacket_receive_t receive; 3162 + retro_netpacket_stop_t stop; /* Optional - may be NULL */ 3163 + retro_netpacket_poll_t poll; /* Optional - may be NULL */ 3164 + retro_netpacket_connected_t connected; /* Optional - may be NULL */ 3165 + retro_netpacket_disconnected_t disconnected; /* Optional - may be NULL */ 3166 + }; 3167 + 2594 3168 enum retro_pixel_format 2595 3169 { 2596 3170 /* 0RGB1555, native endian. ··· 2613 3187 2614 3188 /* Ensure sizeof() == sizeof(int). */ 2615 3189 RETRO_PIXEL_FORMAT_UNKNOWN = INT_MAX 3190 + }; 3191 + 3192 + enum retro_savestate_context 3193 + { 3194 + /* Standard savestate written to disk. */ 3195 + RETRO_SAVESTATE_CONTEXT_NORMAL = 0, 3196 + 3197 + /* Savestate where you are guaranteed that the same instance will load the save state. 3198 + * You can store internal pointers to code or data. 3199 + * It's still a full serialization and deserialization, and could be loaded or saved at any time. 3200 + * It won't be written to disk or sent over the network. 3201 + */ 3202 + RETRO_SAVESTATE_CONTEXT_RUNAHEAD_SAME_INSTANCE = 1, 3203 + 3204 + /* Savestate where you are guaranteed that the same emulator binary will load that savestate. 3205 + * You can skip anything that would slow down saving or loading state but you can not store internal pointers. 3206 + * It won't be written to disk or sent over the network. 3207 + * Example: "Second Instance" runahead 3208 + */ 3209 + RETRO_SAVESTATE_CONTEXT_RUNAHEAD_SAME_BINARY = 2, 3210 + 3211 + /* Savestate used within a rollback netplay feature. 3212 + * You should skip anything that would unnecessarily increase bandwidth usage. 3213 + * It won't be written to disk but it will be sent over the network. 3214 + */ 3215 + RETRO_SAVESTATE_CONTEXT_ROLLBACK_NETPLAY = 3, 3216 + 3217 + /* Ensure sizeof() == sizeof(int). */ 3218 + RETRO_SAVESTATE_CONTEXT_UNKNOWN = INT_MAX 2616 3219 }; 2617 3220 2618 3221 struct retro_message ··· 2781 3384 bool block_extract; 2782 3385 }; 2783 3386 3387 + /* Defines overrides which modify frontend handling of 3388 + * specific content file types. 3389 + * An array of retro_system_content_info_override is 3390 + * passed to RETRO_ENVIRONMENT_SET_CONTENT_INFO_OVERRIDE 3391 + * NOTE: In the following descriptions, references to 3392 + * retro_load_game() may be replaced with 3393 + * retro_load_game_special() */ 3394 + struct retro_system_content_info_override 3395 + { 3396 + /* A list of file extensions for which the override 3397 + * should apply, delimited by a 'pipe' character 3398 + * (e.g. "md|sms|gg") 3399 + * Permitted file extensions are limited to those 3400 + * included in retro_system_info::valid_extensions 3401 + * and/or retro_subsystem_rom_info::valid_extensions */ 3402 + const char *extensions; 3403 + 3404 + /* Overrides the need_fullpath value set in 3405 + * retro_system_info and/or retro_subsystem_rom_info. 3406 + * To reiterate: 3407 + * 3408 + * If need_fullpath is true and retro_load_game() is called: 3409 + * - retro_game_info::path is guaranteed to contain a valid 3410 + * path to an existent file 3411 + * - retro_game_info::data and retro_game_info::size are invalid 3412 + * 3413 + * If need_fullpath is false and retro_load_game() is called: 3414 + * - retro_game_info::path may be NULL 3415 + * - retro_game_info::data and retro_game_info::size are guaranteed 3416 + * to be valid 3417 + * 3418 + * In addition: 3419 + * 3420 + * If need_fullpath is true and retro_load_game() is called: 3421 + * - retro_game_info_ext::full_path is guaranteed to contain a valid 3422 + * path to an existent file 3423 + * - retro_game_info_ext::archive_path may be NULL 3424 + * - retro_game_info_ext::archive_file may be NULL 3425 + * - retro_game_info_ext::dir is guaranteed to contain a valid path 3426 + * to the directory in which the content file exists 3427 + * - retro_game_info_ext::name is guaranteed to contain the 3428 + * basename of the content file, without extension 3429 + * - retro_game_info_ext::ext is guaranteed to contain the 3430 + * extension of the content file in lower case format 3431 + * - retro_game_info_ext::data and retro_game_info_ext::size 3432 + * are invalid 3433 + * 3434 + * If need_fullpath is false and retro_load_game() is called: 3435 + * - If retro_game_info_ext::file_in_archive is false: 3436 + * - retro_game_info_ext::full_path is guaranteed to contain 3437 + * a valid path to an existent file 3438 + * - retro_game_info_ext::archive_path may be NULL 3439 + * - retro_game_info_ext::archive_file may be NULL 3440 + * - retro_game_info_ext::dir is guaranteed to contain a 3441 + * valid path to the directory in which the content file exists 3442 + * - retro_game_info_ext::name is guaranteed to contain the 3443 + * basename of the content file, without extension 3444 + * - retro_game_info_ext::ext is guaranteed to contain the 3445 + * extension of the content file in lower case format 3446 + * - If retro_game_info_ext::file_in_archive is true: 3447 + * - retro_game_info_ext::full_path may be NULL 3448 + * - retro_game_info_ext::archive_path is guaranteed to 3449 + * contain a valid path to an existent compressed file 3450 + * inside which the content file is located 3451 + * - retro_game_info_ext::archive_file is guaranteed to 3452 + * contain a valid path to an existent content file 3453 + * inside the compressed file referred to by 3454 + * retro_game_info_ext::archive_path 3455 + * e.g. for a compressed file '/path/to/foo.zip' 3456 + * containing 'bar.sfc' 3457 + * > retro_game_info_ext::archive_path will be '/path/to/foo.zip' 3458 + * > retro_game_info_ext::archive_file will be 'bar.sfc' 3459 + * - retro_game_info_ext::dir is guaranteed to contain a 3460 + * valid path to the directory in which the compressed file 3461 + * (containing the content file) exists 3462 + * - retro_game_info_ext::name is guaranteed to contain 3463 + * EITHER 3464 + * 1) the basename of the compressed file (containing 3465 + * the content file), without extension 3466 + * OR 3467 + * 2) the basename of the content file inside the 3468 + * compressed file, without extension 3469 + * In either case, a core should consider 'name' to 3470 + * be the canonical name/ID of the the content file 3471 + * - retro_game_info_ext::ext is guaranteed to contain the 3472 + * extension of the content file inside the compressed file, 3473 + * in lower case format 3474 + * - retro_game_info_ext::data and retro_game_info_ext::size are 3475 + * guaranteed to be valid */ 3476 + bool need_fullpath; 3477 + 3478 + /* If need_fullpath is false, specifies whether the content 3479 + * data buffer available in retro_load_game() is 'persistent' 3480 + * 3481 + * If persistent_data is false and retro_load_game() is called: 3482 + * - retro_game_info::data and retro_game_info::size 3483 + * are valid only until retro_load_game() returns 3484 + * - retro_game_info_ext::data and retro_game_info_ext::size 3485 + * are valid only until retro_load_game() returns 3486 + * 3487 + * If persistent_data is true and retro_load_game() is called: 3488 + * - retro_game_info::data and retro_game_info::size 3489 + * are valid until retro_deinit() returns 3490 + * - retro_game_info_ext::data and retro_game_info_ext::size 3491 + * are valid until retro_deinit() returns */ 3492 + bool persistent_data; 3493 + }; 3494 + 3495 + /* Similar to retro_game_info, but provides extended 3496 + * information about the source content file and 3497 + * game memory buffer status. 3498 + * And array of retro_game_info_ext is returned by 3499 + * RETRO_ENVIRONMENT_GET_GAME_INFO_EXT 3500 + * NOTE: In the following descriptions, references to 3501 + * retro_load_game() may be replaced with 3502 + * retro_load_game_special() */ 3503 + struct retro_game_info_ext 3504 + { 3505 + /* - If file_in_archive is false, contains a valid 3506 + * path to an existent content file (UTF-8 encoded) 3507 + * - If file_in_archive is true, may be NULL */ 3508 + const char *full_path; 3509 + 3510 + /* - If file_in_archive is false, may be NULL 3511 + * - If file_in_archive is true, contains a valid path 3512 + * to an existent compressed file inside which the 3513 + * content file is located (UTF-8 encoded) */ 3514 + const char *archive_path; 3515 + 3516 + /* - If file_in_archive is false, may be NULL 3517 + * - If file_in_archive is true, contain a valid path 3518 + * to an existent content file inside the compressed 3519 + * file referred to by archive_path (UTF-8 encoded) 3520 + * e.g. for a compressed file '/path/to/foo.zip' 3521 + * containing 'bar.sfc' 3522 + * > archive_path will be '/path/to/foo.zip' 3523 + * > archive_file will be 'bar.sfc' */ 3524 + const char *archive_file; 3525 + 3526 + /* - If file_in_archive is false, contains a valid path 3527 + * to the directory in which the content file exists 3528 + * (UTF-8 encoded) 3529 + * - If file_in_archive is true, contains a valid path 3530 + * to the directory in which the compressed file 3531 + * (containing the content file) exists (UTF-8 encoded) */ 3532 + const char *dir; 3533 + 3534 + /* Contains the canonical name/ID of the content file 3535 + * (UTF-8 encoded). Intended for use when identifying 3536 + * 'complementary' content named after the loaded file - 3537 + * i.e. companion data of a different format (a CD image 3538 + * required by a ROM), texture packs, internally handled 3539 + * save files, etc. 3540 + * - If file_in_archive is false, contains the basename 3541 + * of the content file, without extension 3542 + * - If file_in_archive is true, then string is 3543 + * implementation specific. A frontend may choose to 3544 + * set a name value of: 3545 + * EITHER 3546 + * 1) the basename of the compressed file (containing 3547 + * the content file), without extension 3548 + * OR 3549 + * 2) the basename of the content file inside the 3550 + * compressed file, without extension 3551 + * RetroArch sets the 'name' value according to (1). 3552 + * A frontend that supports routine loading of 3553 + * content from archives containing multiple unrelated 3554 + * content files may set the 'name' value according 3555 + * to (2). */ 3556 + const char *name; 3557 + 3558 + /* - If file_in_archive is false, contains the extension 3559 + * of the content file in lower case format 3560 + * - If file_in_archive is true, contains the extension 3561 + * of the content file inside the compressed file, 3562 + * in lower case format */ 3563 + const char *ext; 3564 + 3565 + /* String of implementation specific meta-data. */ 3566 + const char *meta; 3567 + 3568 + /* Memory buffer of loaded game content. Will be NULL: 3569 + * IF 3570 + * - retro_system_info::need_fullpath is true and 3571 + * retro_system_content_info_override::need_fullpath 3572 + * is unset 3573 + * OR 3574 + * - retro_system_content_info_override::need_fullpath 3575 + * is true */ 3576 + const void *data; 3577 + 3578 + /* Size of game content memory buffer, in bytes */ 3579 + size_t size; 3580 + 3581 + /* True if loaded content file is inside a compressed 3582 + * archive */ 3583 + bool file_in_archive; 3584 + 3585 + /* - If data is NULL, value is unset/ignored 3586 + * - If data is non-NULL: 3587 + * - If persistent_data is false, data and size are 3588 + * valid only until retro_load_game() returns 3589 + * - If persistent_data is true, data and size are 3590 + * are valid until retro_deinit() returns */ 3591 + bool persistent_data; 3592 + }; 3593 + 2784 3594 struct retro_game_geometry 2785 3595 { 2786 3596 unsigned base_width; /* Nominal video width of game. */ ··· 2879 3689 const char *default_value; 2880 3690 }; 2881 3691 3692 + #ifdef __PS3__ 3693 + #undef local 3694 + #endif 3695 + 2882 3696 struct retro_core_options_intl 2883 3697 { 2884 3698 /* Pointer to an array of retro_core_option_definition structs ··· 2892 3706 struct retro_core_option_definition *local; 2893 3707 }; 2894 3708 3709 + struct retro_core_option_v2_category 3710 + { 3711 + /* Variable uniquely identifying the 3712 + * option category. Valid key characters 3713 + * are [a-z, A-Z, 0-9, _, -] */ 3714 + const char *key; 3715 + 3716 + /* Human-readable category description 3717 + * > Used as category menu label when 3718 + * frontend has core option category 3719 + * support */ 3720 + const char *desc; 3721 + 3722 + /* Human-readable category information 3723 + * > Used as category menu sublabel when 3724 + * frontend has core option category 3725 + * support 3726 + * > Optional (may be NULL or an empty 3727 + * string) */ 3728 + const char *info; 3729 + }; 3730 + 3731 + struct retro_core_option_v2_definition 3732 + { 3733 + /* Variable to query in RETRO_ENVIRONMENT_GET_VARIABLE. 3734 + * Valid key characters are [a-z, A-Z, 0-9, _, -] */ 3735 + const char *key; 3736 + 3737 + /* Human-readable core option description 3738 + * > Used as menu label when frontend does 3739 + * not have core option category support 3740 + * e.g. "Video > Aspect Ratio" */ 3741 + const char *desc; 3742 + 3743 + /* Human-readable core option description 3744 + * > Used as menu label when frontend has 3745 + * core option category support 3746 + * e.g. "Aspect Ratio", where associated 3747 + * retro_core_option_v2_category::desc 3748 + * is "Video" 3749 + * > If empty or NULL, the string specified by 3750 + * desc will be used as the menu label 3751 + * > Will be ignored (and may be set to NULL) 3752 + * if category_key is empty or NULL */ 3753 + const char *desc_categorized; 3754 + 3755 + /* Human-readable core option information 3756 + * > Used as menu sublabel */ 3757 + const char *info; 3758 + 3759 + /* Human-readable core option information 3760 + * > Used as menu sublabel when frontend 3761 + * has core option category support 3762 + * (e.g. may be required when info text 3763 + * references an option by name/desc, 3764 + * and the desc/desc_categorized text 3765 + * for that option differ) 3766 + * > If empty or NULL, the string specified by 3767 + * info will be used as the menu sublabel 3768 + * > Will be ignored (and may be set to NULL) 3769 + * if category_key is empty or NULL */ 3770 + const char *info_categorized; 3771 + 3772 + /* Variable specifying category (e.g. "video", 3773 + * "audio") that will be assigned to the option 3774 + * if frontend has core option category support. 3775 + * > Categorized options will be displayed in a 3776 + * subsection/submenu of the frontend core 3777 + * option interface 3778 + * > Specified string must match one of the 3779 + * retro_core_option_v2_category::key values 3780 + * in the associated retro_core_option_v2_category 3781 + * array; If no match is not found, specified 3782 + * string will be considered as NULL 3783 + * > If specified string is empty or NULL, option will 3784 + * have no category and will be shown at the top 3785 + * level of the frontend core option interface */ 3786 + const char *category_key; 3787 + 3788 + /* Array of retro_core_option_value structs, terminated by NULL */ 3789 + struct retro_core_option_value values[RETRO_NUM_CORE_OPTION_VALUES_MAX]; 3790 + 3791 + /* Default core option value. Must match one of the values 3792 + * in the retro_core_option_value array, otherwise will be 3793 + * ignored */ 3794 + const char *default_value; 3795 + }; 3796 + 3797 + struct retro_core_options_v2 3798 + { 3799 + /* Array of retro_core_option_v2_category structs, 3800 + * terminated by NULL 3801 + * > If NULL, all entries in definitions array 3802 + * will have no category and will be shown at 3803 + * the top level of the frontend core option 3804 + * interface 3805 + * > Will be ignored if frontend does not have 3806 + * core option category support */ 3807 + struct retro_core_option_v2_category *categories; 3808 + 3809 + /* Array of retro_core_option_v2_definition structs, 3810 + * terminated by NULL */ 3811 + struct retro_core_option_v2_definition *definitions; 3812 + }; 3813 + 3814 + struct retro_core_options_v2_intl 3815 + { 3816 + /* Pointer to a retro_core_options_v2 struct 3817 + * > US English implementation 3818 + * > Must point to a valid struct */ 3819 + struct retro_core_options_v2 *us; 3820 + 3821 + /* Pointer to a retro_core_options_v2 struct 3822 + * - Implementation for current frontend language 3823 + * - May be NULL */ 3824 + struct retro_core_options_v2 *local; 3825 + }; 3826 + 3827 + /* Used by the frontend to monitor changes in core option 3828 + * visibility. May be called each time any core option 3829 + * value is set via the frontend. 3830 + * - On each invocation, the core must update the visibility 3831 + * of any dynamically hidden options using the 3832 + * RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY environment 3833 + * callback. 3834 + * - On the first invocation, returns 'true' if the visibility 3835 + * of any core option has changed since the last call of 3836 + * retro_load_game() or retro_load_game_special(). 3837 + * - On each subsequent invocation, returns 'true' if the 3838 + * visibility of any core option has changed since the last 3839 + * time the function was called. */ 3840 + typedef bool (RETRO_CALLCONV *retro_core_options_update_display_callback_t)(void); 3841 + struct retro_core_options_update_display_callback 3842 + { 3843 + retro_core_options_update_display_callback_t callback; 3844 + }; 3845 + 2895 3846 struct retro_game_info 2896 3847 { 2897 3848 const char *path; /* Path to game, UTF-8 encoded. ··· 2938 3889 Set by frontend in GET_CURRENT_SOFTWARE_FRAMEBUFFER. */ 2939 3890 }; 2940 3891 3892 + /* Used by a libretro core to override the current 3893 + * fastforwarding mode of the frontend */ 3894 + struct retro_fastforwarding_override 3895 + { 3896 + /* Specifies the runtime speed multiplier that 3897 + * will be applied when 'fastforward' is true. 3898 + * For example, a value of 5.0 when running 60 FPS 3899 + * content will cap the fast-forward rate at 300 FPS. 3900 + * Note that the target multiplier may not be achieved 3901 + * if the host hardware has insufficient processing 3902 + * power. 3903 + * Setting a value of 0.0 (or greater than 0.0 but 3904 + * less than 1.0) will result in an uncapped 3905 + * fast-forward rate (limited only by hardware 3906 + * capacity). 3907 + * If the value is negative, it will be ignored 3908 + * (i.e. the frontend will use a runtime speed 3909 + * multiplier of its own choosing) */ 3910 + float ratio; 3911 + 3912 + /* If true, fastforwarding mode will be enabled. 3913 + * If false, fastforwarding mode will be disabled. */ 3914 + bool fastforward; 3915 + 3916 + /* If true, and if supported by the frontend, an 3917 + * on-screen notification will be displayed while 3918 + * 'fastforward' is true. 3919 + * If false, and if supported by the frontend, any 3920 + * on-screen fast-forward notifications will be 3921 + * suppressed */ 3922 + bool notification; 3923 + 3924 + /* If true, the core will have sole control over 3925 + * when fastforwarding mode is enabled/disabled; 3926 + * the frontend will not be able to change the 3927 + * state set by 'fastforward' until either 3928 + * 'inhibit_toggle' is set to false, or the core 3929 + * is unloaded */ 3930 + bool inhibit_toggle; 3931 + }; 3932 + 3933 + /* During normal operation. Rate will be equal to the core's internal FPS. */ 3934 + #define RETRO_THROTTLE_NONE 0 3935 + 3936 + /* While paused or stepping single frames. Rate will be 0. */ 3937 + #define RETRO_THROTTLE_FRAME_STEPPING 1 3938 + 3939 + /* During fast forwarding. 3940 + * Rate will be 0 if not specifically limited to a maximum speed. */ 3941 + #define RETRO_THROTTLE_FAST_FORWARD 2 3942 + 3943 + /* During slow motion. Rate will be less than the core's internal FPS. */ 3944 + #define RETRO_THROTTLE_SLOW_MOTION 3 3945 + 3946 + /* While rewinding recorded save states. Rate can vary depending on the rewind 3947 + * speed or be 0 if the frontend is not aiming for a specific rate. */ 3948 + #define RETRO_THROTTLE_REWINDING 4 3949 + 3950 + /* While vsync is active in the video driver and the target refresh rate is 3951 + * lower than the core's internal FPS. Rate is the target refresh rate. */ 3952 + #define RETRO_THROTTLE_VSYNC 5 3953 + 3954 + /* When the frontend does not throttle in any way. Rate will be 0. 3955 + * An example could be if no vsync or audio output is active. */ 3956 + #define RETRO_THROTTLE_UNBLOCKED 6 3957 + 3958 + struct retro_throttle_state 3959 + { 3960 + /* The current throttling mode. Should be one of the values above. */ 3961 + unsigned mode; 3962 + 3963 + /* How many times per second the frontend aims to call retro_run. 3964 + * Depending on the mode, it can be 0 if there is no known fixed rate. 3965 + * This won't be accurate if the total processing time of the core and 3966 + * the frontend is longer than what is available for one frame. */ 3967 + float rate; 3968 + }; 3969 + 3970 + /** 3971 + * Opaque handle to a microphone that's been opened for use. 3972 + * The underlying object is accessed or created with \c retro_microphone_interface_t. 3973 + */ 3974 + typedef struct retro_microphone retro_microphone_t; 3975 + 3976 + /** 3977 + * Parameters for configuring a microphone. 3978 + * Some of these might not be honored, 3979 + * depending on the available hardware and driver configuration. 3980 + */ 3981 + typedef struct retro_microphone_params 3982 + { 3983 + /** 3984 + * The desired sample rate of the microphone's input, in Hz. 3985 + * The microphone's input will be resampled, 3986 + * so cores can ask for whichever frequency they need. 3987 + * 3988 + * If zero, some reasonable default will be provided by the frontend 3989 + * (usually from its config file). 3990 + * 3991 + * @see retro_get_mic_rate_t 3992 + */ 3993 + unsigned rate; 3994 + } retro_microphone_params_t; 3995 + 3996 + /** 3997 + * @copydoc retro_microphone_interface::open_mic 3998 + */ 3999 + typedef retro_microphone_t *(RETRO_CALLCONV *retro_open_mic_t)(const retro_microphone_params_t *params); 4000 + 4001 + /** 4002 + * @copydoc retro_microphone_interface::close_mic 4003 + */ 4004 + typedef void (RETRO_CALLCONV *retro_close_mic_t)(retro_microphone_t *microphone); 4005 + 4006 + /** 4007 + * @copydoc retro_microphone_interface::get_params 4008 + */ 4009 + typedef bool (RETRO_CALLCONV *retro_get_mic_params_t)(const retro_microphone_t *microphone, retro_microphone_params_t *params); 4010 + 4011 + /** 4012 + * @copydoc retro_microphone_interface::set_mic_state 4013 + */ 4014 + typedef bool (RETRO_CALLCONV *retro_set_mic_state_t)(retro_microphone_t *microphone, bool state); 4015 + 4016 + /** 4017 + * @copydoc retro_microphone_interface::get_mic_state 4018 + */ 4019 + typedef bool (RETRO_CALLCONV *retro_get_mic_state_t)(const retro_microphone_t *microphone); 4020 + 4021 + /** 4022 + * @copydoc retro_microphone_interface::read_mic 4023 + */ 4024 + typedef int (RETRO_CALLCONV *retro_read_mic_t)(retro_microphone_t *microphone, int16_t* samples, size_t num_samples); 4025 + 4026 + /** 4027 + * The current version of the microphone interface. 4028 + * Will be incremented whenever \c retro_microphone_interface or \c retro_microphone_params_t 4029 + * receive new fields. 4030 + * 4031 + * Frontends using cores built against older mic interface versions 4032 + * should not access fields introduced in newer versions. 4033 + */ 4034 + #define RETRO_MICROPHONE_INTERFACE_VERSION 1 4035 + 4036 + /** 4037 + * An interface for querying the microphone and accessing data read from it. 4038 + * 4039 + * @see RETRO_ENVIRONMENT_GET_MICROPHONE_INTERFACE 4040 + */ 4041 + struct retro_microphone_interface 4042 + { 4043 + /** 4044 + * The version of this microphone interface. 4045 + * Set by the core to request a particular version, 4046 + * and set by the frontend to indicate the returned version. 4047 + * 0 indicates that the interface is invalid or uninitialized. 4048 + */ 4049 + unsigned interface_version; 4050 + 4051 + /** 4052 + * Initializes a new microphone. 4053 + * Assuming that microphone support is enabled and provided by the frontend, 4054 + * cores may call this function whenever necessary. 4055 + * A microphone could be opened throughout a core's lifetime, 4056 + * or it could wait until a microphone is plugged in to the emulated device. 4057 + * 4058 + * The returned handle will be valid until it's freed, 4059 + * even if the audio driver is reinitialized. 4060 + * 4061 + * This function is not guaranteed to be thread-safe. 4062 + * 4063 + * @param args[in] Parameters used to create the microphone. 4064 + * May be \c NULL, in which case the default value of each parameter will be used. 4065 + * 4066 + * @returns Pointer to the newly-opened microphone, 4067 + * or \c NULL if one couldn't be opened. 4068 + * This likely means that no microphone is plugged in and recognized, 4069 + * or the maximum number of supported microphones has been reached. 4070 + * 4071 + * @note Microphones are \em inactive by default; 4072 + * to begin capturing audio, call \c set_mic_state. 4073 + * @see retro_microphone_params_t 4074 + */ 4075 + retro_open_mic_t open_mic; 4076 + 4077 + /** 4078 + * Closes a microphone that was initialized with \c open_mic. 4079 + * Calling this function will stop all microphone activity 4080 + * and free up the resources that it allocated. 4081 + * Afterwards, the handle is invalid and must not be used. 4082 + * 4083 + * A frontend may close opened microphones when unloading content, 4084 + * but this behavior is not guaranteed. 4085 + * Cores should close their microphones when exiting, just to be safe. 4086 + * 4087 + * @param microphone Pointer to the microphone that was allocated by \c open_mic. 4088 + * If \c NULL, this function does nothing. 4089 + * 4090 + * @note The handle might be reused if another microphone is opened later. 4091 + */ 4092 + retro_close_mic_t close_mic; 4093 + 4094 + /** 4095 + * Returns the configured parameters of this microphone. 4096 + * These may differ from what was requested depending on 4097 + * the driver and device configuration. 4098 + * 4099 + * Cores should check these values before they start fetching samples. 4100 + * 4101 + * Will not change after the mic was opened. 4102 + * 4103 + * @param microphone[in] Opaque handle to the microphone 4104 + * whose parameters will be retrieved. 4105 + * @param params[out] The parameters object that the 4106 + * microphone's parameters will be copied to. 4107 + * 4108 + * @return \c true if the parameters were retrieved, 4109 + * \c false if there was an error. 4110 + */ 4111 + retro_get_mic_params_t get_params; 4112 + 4113 + /** 4114 + * Enables or disables the given microphone. 4115 + * Microphones are disabled by default 4116 + * and must be explicitly enabled before they can be used. 4117 + * Disabled microphones will not process incoming audio samples, 4118 + * and will therefore have minimal impact on overall performance. 4119 + * Cores may enable microphones throughout their lifetime, 4120 + * or only for periods where they're needed. 4121 + * 4122 + * Cores that accept microphone input should be able to operate without it; 4123 + * we suggest substituting silence in this case. 4124 + * 4125 + * @param microphone Opaque handle to the microphone 4126 + * whose state will be adjusted. 4127 + * This will have been provided by \c open_mic. 4128 + * @param state \c true if the microphone should receive audio input, 4129 + * \c false if it should be idle. 4130 + * @returns \c true if the microphone's state was successfully set, 4131 + * \c false if \c microphone is invalid 4132 + * or if there was an error. 4133 + */ 4134 + retro_set_mic_state_t set_mic_state; 4135 + 4136 + /** 4137 + * Queries the active state of a microphone at the given index. 4138 + * Will return whether the microphone is enabled, 4139 + * even if the driver is paused. 4140 + * 4141 + * @param microphone Opaque handle to the microphone 4142 + * whose state will be queried. 4143 + * @return \c true if the provided \c microphone is valid and active, 4144 + * \c false if not or if there was an error. 4145 + */ 4146 + retro_get_mic_state_t get_mic_state; 4147 + 4148 + /** 4149 + * Retrieves the input processed by the microphone since the last call. 4150 + * \em Must be called every frame unless \c microphone is disabled, 4151 + * similar to how \c retro_audio_sample_batch_t works. 4152 + * 4153 + * @param[in] microphone Opaque handle to the microphone 4154 + * whose recent input will be retrieved. 4155 + * @param[out] samples The buffer that will be used to store the microphone's data. 4156 + * Microphone input is in mono (i.e. one number per sample). 4157 + * Should be large enough to accommodate the expected number of samples per frame; 4158 + * for example, a 44.1kHz sample rate at 60 FPS would require space for 735 samples. 4159 + * @param[in] num_samples The size of the data buffer in samples (\em not bytes). 4160 + * Microphone input is in mono, so a "frame" and a "sample" are equivalent in length here. 4161 + * 4162 + * @return The number of samples that were copied into \c samples. 4163 + * If \c microphone is pending driver initialization, 4164 + * this function will copy silence of the requested length into \c samples. 4165 + * 4166 + * Will return -1 if the microphone is disabled, 4167 + * the audio driver is paused, 4168 + * or there was an error. 4169 + */ 4170 + retro_read_mic_t read_mic; 4171 + }; 4172 + 4173 + /** 4174 + * Describes how a device is being powered. 4175 + * @see RETRO_ENVIRONMENT_GET_DEVICE_POWER 4176 + */ 4177 + enum retro_power_state 4178 + { 4179 + /** 4180 + * Indicates that the frontend cannot report its power state at this time, 4181 + * most likely due to a lack of support. 4182 + * 4183 + * \c RETRO_ENVIRONMENT_GET_DEVICE_POWER will not return this value; 4184 + * instead, the environment callback will return \c false. 4185 + */ 4186 + RETRO_POWERSTATE_UNKNOWN = 0, 4187 + 4188 + /** 4189 + * Indicates that the device is running on its battery. 4190 + * Usually applies to portable devices such as handhelds, laptops, and smartphones. 4191 + */ 4192 + RETRO_POWERSTATE_DISCHARGING, 4193 + 4194 + /** 4195 + * Indicates that the device's battery is currently charging. 4196 + */ 4197 + RETRO_POWERSTATE_CHARGING, 4198 + 4199 + /** 4200 + * Indicates that the device is connected to a power source 4201 + * and that its battery has finished charging. 4202 + */ 4203 + RETRO_POWERSTATE_CHARGED, 4204 + 4205 + /** 4206 + * Indicates that the device is connected to a power source 4207 + * and that it does not have a battery. 4208 + * This usually suggests a desktop computer or a non-portable game console. 4209 + */ 4210 + RETRO_POWERSTATE_PLUGGED_IN 4211 + }; 4212 + 4213 + /** 4214 + * Indicates that an estimate is not available for the battery level or time remaining, 4215 + * even if the actual power state is known. 4216 + */ 4217 + #define RETRO_POWERSTATE_NO_ESTIMATE (-1) 4218 + 4219 + /** 4220 + * Describes the power state of the device running the frontend. 4221 + * @see RETRO_ENVIRONMENT_GET_DEVICE_POWER 4222 + */ 4223 + struct retro_device_power 4224 + { 4225 + /** 4226 + * The current state of the frontend's power usage. 4227 + */ 4228 + enum retro_power_state state; 4229 + 4230 + /** 4231 + * A rough estimate of the amount of time remaining (in seconds) 4232 + * before the device powers off. 4233 + * This value depends on a variety of factors, 4234 + * so it is not guaranteed to be accurate. 4235 + * 4236 + * Will be set to \c RETRO_POWERSTATE_NO_ESTIMATE if \c state does not equal \c RETRO_POWERSTATE_DISCHARGING. 4237 + * May still be set to \c RETRO_POWERSTATE_NO_ESTIMATE if the frontend is unable to provide an estimate. 4238 + */ 4239 + int seconds; 4240 + 4241 + /** 4242 + * The approximate percentage of battery charge, 4243 + * ranging from 0 to 100 (inclusive). 4244 + * The device may power off before this reaches 0. 4245 + * 4246 + * The user might have configured their device 4247 + * to stop charging before the battery is full, 4248 + * so do not assume that this will be 100 in the \c RETRO_POWERSTATE_CHARGED state. 4249 + */ 4250 + int8_t percent; 4251 + }; 4252 + 2941 4253 /* Callbacks */ 2942 4254 2943 4255 /* Environment callback. Gives implementations a way of performing ··· 3090 4402 } 3091 4403 #endif 3092 4404 3093 - #endif 4405 + #endif
+9
src/system/libretro/libretro_core_options.h
··· 227 227 NULL, /* RETRO_LANGUAGE_HEBREW */ 228 228 NULL, /* RETRO_LANGUAGE_ASTURIAN */ 229 229 NULL, /* RETRO_LANGUAGE_FINNISH */ 230 + NULL, /* RETRO_LANGUAGE_INDONESIAN */ 231 + NULL, /* RETRO_LANGUAGE_SWEDISH */ 232 + NULL, /* RETRO_LANGUAGE_UKRAINIAN */ 233 + NULL, /* RETRO_LANGUAGE_CZECH */ 234 + NULL, /* RETRO_LANGUAGE_CATALAN_VALENCIA */ 235 + NULL, /* RETRO_LANGUAGE_CATALAN */ 236 + NULL, /* RETRO_LANGUAGE_BRITISH_ENGLISH */ 237 + NULL, /* RETRO_LANGUAGE_HUNGARIAN */ 238 + NULL, /* RETRO_LANGUAGE_BELARUSIAN */ 230 239 231 240 }; 232 241 #endif
+18
src/system/libretro/libretro_core_options_intl.h
··· 83 83 84 84 /* RETRO_LANGUAGE_FINNISH */ 85 85 86 + /* RETRO_LANGUAGE_INDONESIAN */ 87 + 88 + /* RETRO_LANGUAGE_SWEDISH */ 89 + 90 + /* RETRO_LANGUAGE_UKRAINIAN */ 91 + 92 + /* RETRO_LANGUAGE_CZECH */ 93 + 94 + /* RETRO_LANGUAGE_CATALAN_VALENCIA */ 95 + 96 + /* RETRO_LANGUAGE_CATALAN */ 97 + 98 + /* RETRO_LANGUAGE_BRITISH_ENGLISH */ 99 + 100 + /* RETRO_LANGUAGE_HUNGARIAN */ 101 + 102 + /* RETRO_LANGUAGE_BELARUSIAN */ 103 + 86 104 #ifdef __cplusplus 87 105 } 88 106 #endif