@@ -1722,6 +1722,37 @@ enum retro_mod
17221722 * Must be called in retro_set_environment().
17231723 */
17241724
1725+ #define RETRO_ENVIRONMENT_SET_VARIABLE 70
1726+ /* const struct retro_variable * --
1727+ * Allows an implementation to notify the frontend
1728+ * that a core option value has changed.
1729+ *
1730+ * retro_variable::key and retro_variable::value
1731+ * must match strings that have been set previously
1732+ * via one of the following:
1733+ *
1734+ * - RETRO_ENVIRONMENT_SET_VARIABLES
1735+ * - RETRO_ENVIRONMENT_SET_CORE_OPTIONS
1736+ * - RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL
1737+ * - RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2
1738+ * - RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2_INTL
1739+ *
1740+ * After changing a core option value via this
1741+ * callback, RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE
1742+ * will return true.
1743+ *
1744+ * If data is NULL, no changes will be registered
1745+ * and the callback will return true; an
1746+ * implementation may therefore pass NULL in order
1747+ * to test whether the callback is supported.
1748+ */
1749+
1750+ #define RETRO_ENVIRONMENT_GET_THROTTLE_STATE (71 | RETRO_ENVIRONMENT_EXPERIMENTAL)
1751+ /* struct retro_throttle_state * --
1752+ * Allows an implementation to get details on the actual rate
1753+ * the frontend is attempting to call retro_run().
1754+ */
1755+
17251756/* VFS functionality */
17261757
17271758/* File paths:
@@ -3667,6 +3698,43 @@ struct retro_fastforwarding_override
36673698 bool inhibit_toggle ;
36683699};
36693700
3701+ /* During normal operation. Rate will be equal to the core's internal FPS. */
3702+ #define RETRO_THROTTLE_NONE 0
3703+
3704+ /* While paused or stepping single frames. Rate will be 0. */
3705+ #define RETRO_THROTTLE_FRAME_STEPPING 1
3706+
3707+ /* During fast forwarding.
3708+ * Rate will be 0 if not specifically limited to a maximum speed. */
3709+ #define RETRO_THROTTLE_FAST_FORWARD 2
3710+
3711+ /* During slow motion. Rate will be less than the core's internal FPS. */
3712+ #define RETRO_THROTTLE_SLOW_MOTION 3
3713+
3714+ /* While rewinding recorded save states. Rate can vary depending on the rewind
3715+ * speed or be 0 if the frontend is not aiming for a specific rate. */
3716+ #define RETRO_THROTTLE_REWINDING 4
3717+
3718+ /* While vsync is active in the video driver and the target refresh rate is
3719+ * lower than the core's internal FPS. Rate is the target refresh rate. */
3720+ #define RETRO_THROTTLE_VSYNC 5
3721+
3722+ /* When the frontend does not throttle in any way. Rate will be 0.
3723+ * An example could be if no vsync or audio output is active. */
3724+ #define RETRO_THROTTLE_UNBLOCKED 6
3725+
3726+ struct retro_throttle_state
3727+ {
3728+ /* The current throttling mode. Should be one of the values above. */
3729+ unsigned mode ;
3730+
3731+ /* How many times per second the frontend aims to call retro_run.
3732+ * Depending on the mode, it can be 0 if there is no known fixed rate.
3733+ * This won't be accurate if the total processing time of the core and
3734+ * the frontend is longer than what is available for one frame. */
3735+ float rate ;
3736+ };
3737+
36703738/* Callbacks */
36713739
36723740/* Environment callback. Gives implementations a way of performing
0 commit comments