|
SDL_Libretro 0.1.0
SDL3-power libretro frontend.
|
Data Structures | |
| struct | SDL_LibretroCategory |
| A group of related core options. More... | |
| struct | SDL_LibretroOption |
| A core option and its current state. More... | |
| struct | SDL_LibretroOptionValue |
| One selectable value for a core option. More... | |
Macros | |
| #define | SDL_EVENT_LIBRETRO (SDL_EVENT_USER + 0x1000) |
| The base SDL event type for SDL_libretro events. | |
| #define | SDL_EVENT_LIBRETRO_CORE_LOADED (SDL_EVENT_LIBRETRO | 0xF00) |
| A core finished loading; data2 is the core name, valid until the next load or unload. | |
| #define | SDL_EVENT_LIBRETRO_CORE_UNLOADED (SDL_EVENT_LIBRETRO | 0xF04) |
| The core was unloaded, along with any game it ran. | |
| #define | SDL_EVENT_LIBRETRO_ENVIRONMENT(cmd) (SDL_EVENT_LIBRETRO | ((cmd) & 0x3FF) | (((cmd) >> 6) & 0xC00)) |
| The SDL event type a RETRO_ENVIRONMENT_* command arrives as, when SDL_libretro leaves the command to the application. | |
| #define | SDL_EVENT_LIBRETRO_ENVIRONMENT_LAST (SDL_EVENT_LIBRETRO | 0xBFF) |
| The last SDL event type an environment command can arrive as. | |
| #define | SDL_EVENT_LIBRETRO_GAME_LOADED (SDL_EVENT_LIBRETRO | 0xF01) |
| A game finished loading, whether directly or through the menu; data2 is the game name, valid until the next load or unload. | |
| #define | SDL_EVENT_LIBRETRO_GAME_UNLOADED (SDL_EVENT_LIBRETRO | 0xF05) |
| The game was unloaded, whether directly or through the core unloading. | |
| #define | SDL_EVENT_LIBRETRO_GEOMETRY_CHANGED (SDL_EVENT_LIBRETRO | 0xF07) |
| The video size, aspect ratio, or timing changed mid-game. | |
| #define | SDL_EVENT_LIBRETRO_LAST (SDL_EVENT_LIBRETRO | 0xFFF) |
| The last SDL event type in the SDL_libretro range. | |
| #define | SDL_EVENT_LIBRETRO_MENU_CLOSED (SDL_EVENT_LIBRETRO | 0xF03) |
| The menu was dismissed; the game resumes. | |
| #define | SDL_EVENT_LIBRETRO_MENU_OPENED (SDL_EVENT_LIBRETRO | 0xF02) |
| The menu became visible; the game pauses. | |
| #define | SDL_EVENT_LIBRETRO_SHUTDOWN (SDL_EVENT_LIBRETRO | 0xF06) |
| The core requested shutdown. | |
| #define | SDL_LIBRETRO_ENVIRONMENT_COMMAND(type) ((((type) - SDL_EVENT_LIBRETRO) & 0x3FF) | ((((type) - SDL_EVENT_LIBRETRO) & 0xC00) << 6)) |
| The RETRO_ENVIRONMENT_* command, flags included, that an environment event type stands for; the reverse of SDL_EVENT_LIBRETRO_ENVIRONMENT(). | |
| #define | SDL_LIBRETRO_MAJOR_VERSION 0 |
| The major version of SDL_Libretro. | |
| #define | SDL_LIBRETRO_MICRO_VERSION 0 |
| The micro/patch version of SDL_Libretro. | |
| #define | SDL_LIBRETRO_MINOR_VERSION 1 |
| The minor version of SDL_Libretro. | |
| #define | SDL_LIBRETRO_VERSION SDL_VERSIONNUM(SDL_LIBRETRO_MAJOR_VERSION, SDL_LIBRETRO_MINOR_VERSION, SDL_LIBRETRO_MICRO_VERSION) |
| Retrieves an integer representation of the of the SDL_Libretro version. | |
| #define | SDL_LIBRETRO_VERSION_ATLEAST(X, Y, Z) (SDL_LIBRETRO_VERSION >= SDL_VERSIONNUM(X, Y, Z)) |
| Checks if SDL_Libretro is at least the given version. | |
Typedefs | |
| typedef struct SDL_Libretro | SDL_Libretro |
| A libretro frontend context: one loaded core, its game, and the settings that carry across cores. | |
| typedef enum SDL_LibretroAnalogToDigital | SDL_LibretroAnalogToDigital |
| Which analog stick, if any, also registers D-Pad presses for a controller port. | |
| typedef struct SDL_LibretroCategory | SDL_LibretroCategory |
| A group of related core options. | |
| typedef enum SDL_LibretroFitMode | SDL_LibretroFitMode |
| When rendering the libretro context, determine how to display within the destination. | |
| typedef struct SDL_LibretroMenu | SDL_LibretroMenu |
| An in-app menu built on nuklear_console. | |
| typedef void(* | SDL_LibretroMenuCallback) (SDL_LibretroMenu *menu, void *userdata) |
| A callback for menu entries added by the application. | |
| typedef enum SDL_LibretroMenuStyle | SDL_LibretroMenuStyle |
| Color themes for the menu. | |
| typedef struct SDL_LibretroOption | SDL_LibretroOption |
| A core option and its current state. | |
| typedef struct SDL_LibretroOptionValue | SDL_LibretroOptionValue |
| One selectable value for a core option. | |
Enumerations | |
| enum | SDL_LibretroAnalogToDigital { SDL_LIBRETRO_ANALOG_TO_DIGITAL_NONE = 0 , SDL_LIBRETRO_ANALOG_TO_DIGITAL_LEFT = 1 , SDL_LIBRETRO_ANALOG_TO_DIGITAL_RIGHT = 2 , SDL_LIBRETRO_ANALOG_TO_DIGITAL_COUNT = 3 } |
| Which analog stick, if any, also registers D-Pad presses for a controller port. More... | |
| enum | SDL_LibretroFitMode { SDL_LIBRETRO_FIT_FIRST = 0 , SDL_LIBRETRO_FIT_ASPECT = 0 , SDL_LIBRETRO_FIT_INTEGER = 1 , SDL_LIBRETRO_FIT_STRETCH = 2 , SDL_LIBRETRO_FIT_COUNT = 3 } |
| When rendering the libretro context, determine how to display within the destination. More... | |
| enum | SDL_LibretroMenuStyle { SDL_LIBRETRO_MENU_STYLE_CATPPUCCIN_MOCHA = 0 , SDL_LIBRETRO_MENU_STYLE_CATPPUCCIN_LATTE , SDL_LIBRETRO_MENU_STYLE_CATPPUCCIN_FRAPPE , SDL_LIBRETRO_MENU_STYLE_CATPPUCCIN_MACCHIATO , SDL_LIBRETRO_MENU_STYLE_DRACULA , SDL_LIBRETRO_MENU_STYLE_DARK , SDL_LIBRETRO_MENU_STYLE_COUNT } |
| Color themes for the menu. More... | |
Functions | |
| bool | SDL_Libretro_AddDiskImage (SDL_Libretro *lr, const char *path) |
| Appends a new disk image from a file path. | |
| bool | SDL_Libretro_AddDiskImage_IO (SDL_Libretro *lr, SDL_IOStream *src, const char *path, bool closeio) |
| Appends a new disk image from an SDL_IOStream. | |
| bool | SDL_Libretro_AddMenuButton (SDL_LibretroMenu *menu, const char *label, SDL_LibretroMenuCallback callback, void *userdata) |
| Adds a button to the main menu, just above Quit. | |
| bool | SDL_Libretro_AddMenuCheckbox (SDL_LibretroMenu *menu, const char *label, bool *value, SDL_LibretroMenuCallback callback, void *userdata) |
| Adds a checkbox to the main menu, just above Quit. | |
| bool | SDL_Libretro_AreOptionsDirty (SDL_Libretro *lr) |
| Retrieves whether the options have been changed since the last time they were checked. | |
| SDL_Libretro * | SDL_Libretro_Create (void) |
| Creates a new libretro context. | |
| SDL_LibretroMenu * | SDL_Libretro_CreateMenu (SDL_Libretro *lr) |
| Creates the in-app menu for a libretro context. | |
| SDL_Surface * | SDL_Libretro_CreateSurface (const SDL_Libretro *lr) |
| Creates a new surface from the current libretro context. | |
| bool | SDL_Libretro_CycleOptionValue (SDL_Libretro *lr, const char *key, int direction) |
| Advance a core option to the next (+1) or previous (-1) value. | |
| void | SDL_Libretro_Destroy (SDL_Libretro *lr) |
| Destroys the given libretro context. | |
| void | SDL_Libretro_DestroyMenu (SDL_LibretroMenu *menu) |
| Destroys a menu created with SDL_Libretro_CreateMenu(). | |
| bool | SDL_Libretro_EjectDisk (SDL_Libretro *lr) |
| Ejects the disk tray, allowing the disk image to be changed. | |
| SDL_LibretroAnalogToDigital | SDL_Libretro_GetAnalogToDigital (const SDL_Libretro *lr, unsigned port) |
| Get the analog stick that also registers D-Pad presses on a controller port. | |
| float | SDL_Libretro_GetAspectRatio (const SDL_Libretro *lr) |
| Gets the aspect ratio for the libretro context. | |
| unsigned | SDL_Libretro_GetAudioLatency (const SDL_Libretro *lr) |
| Get the minimum audio latency for the audio stream. | |
| bool | SDL_Libretro_GetBlockExtract (const SDL_Libretro *lr) |
| Retrieves whether the core expects archives to be loaded directly. | |
| const SDL_LibretroCategory * | SDL_Libretro_GetCategory (const SDL_Libretro *lr, const char *key) |
| Retrieve an option category by key. | |
| const SDL_LibretroCategory * | SDL_Libretro_GetCategoryByIndex (const SDL_Libretro *lr, unsigned index) |
| Retrieve an option category by index. | |
| unsigned | SDL_Libretro_GetCategoryCount (const SDL_Libretro *lr) |
| Get the number of option categories registered by the core. | |
| const char * | SDL_Libretro_GetContentExtension (const SDL_Libretro *lr) |
| Get the extension of the loaded content, as it appears in the path. | |
| const char * | SDL_Libretro_GetCoreAssetsDirectory (SDL_Libretro *lr) |
| Get the core assets directory. | |
| const char * | SDL_Libretro_GetCoreDirectory (SDL_Libretro *lr) |
| Get the core directory. | |
| const char * | SDL_Libretro_GetCoreName (const SDL_Libretro *lr) |
| Retrieve the name of the libretro core that's actively loaded. | |
| const char * | SDL_Libretro_GetCoreVersion (const SDL_Libretro *lr) |
| Retrieves the version of the libretro core that's actively loaded. | |
| unsigned | SDL_Libretro_GetDiskCount (const SDL_Libretro *lr) |
| Returns the number of disk images available to the loaded core. | |
| unsigned | SDL_Libretro_GetDiskIndex (const SDL_Libretro *lr) |
| Returns the index of the currently inserted disk image. | |
| bool | SDL_Libretro_GetDiskLabel (const SDL_Libretro *lr, unsigned index, char *label, size_t len) |
| Retrieves the human-readable label of a disk image. | |
| size_t | SDL_Libretro_GetFileName (char *dst, size_t dstSize, const char *path, bool withExtension) |
| Copy the file name portion of a path into a caller-provided buffer. | |
| SDL_LibretroFitMode | SDL_Libretro_GetFitMode (const SDL_Libretro *lr) |
| Gets how the frame is fit into the destination rectangle when rendered. | |
| double | SDL_Libretro_GetFPS (const SDL_Libretro *lr) |
| Gets the frame rate the core expects to run at. | |
| const char * | SDL_Libretro_GetGameName (const SDL_Libretro *lr) |
| Retrieve the human-readable name of the loaded game. | |
| bool | SDL_Libretro_GetInputDescriptor (const SDL_Libretro *lr, unsigned index, unsigned *port, unsigned *device, unsigned *id, const char **description) |
| Retrieve an input descriptor by index. | |
| unsigned | SDL_Libretro_GetInputDescriptorCount (const SDL_Libretro *lr) |
| Retrieve the number of input descriptors provided by a Libretro core. | |
| int | SDL_Libretro_GetLanguage (const SDL_Libretro *lr) |
| Get the language reported to cores through RETRO_ENVIRONMENT_GET_LANGUAGE. | |
| SDL_LogPriority | SDL_Libretro_GetLogLevel (const SDL_Libretro *lr) |
| Retrieve the threshold for logs that will be posted. | |
| void * | SDL_Libretro_GetMapAddress (const SDL_Libretro *lr, size_t address, size_t *regionRemaining) |
| Translate an emulated (guest) address to a live host pointer via the memory map. | |
| void * | SDL_Libretro_GetMemoryData (const SDL_Libretro *lr, unsigned memoryType, size_t *size) |
| Get a pointer to a core memory region and its size. | |
| unsigned | SDL_Libretro_GetMemoryMapCount (const SDL_Libretro *lr) |
| Get the number of memory-map descriptors the core has published. | |
| bool | SDL_Libretro_GetMemoryMapDescriptor (const SDL_Libretro *lr, unsigned index, Uint64 *flags, void **ptr, size_t *offset, size_t *start, size_t *select, size_t *disconnect, size_t *len, const char **addrspace) |
| Retrieve one memory-map descriptor by index. | |
| SDL_Libretro * | SDL_Libretro_GetMenuLibretro (const SDL_LibretroMenu *menu) |
| Gets the libretro context the menu was created for. | |
| SDL_LibretroMenuStyle | SDL_Libretro_GetMenuStyle (const SDL_LibretroMenu *menu) |
| Gets the menu's active color theme. | |
| void * | SDL_Libretro_GetMenuUserData (const SDL_LibretroMenu *menu) |
| Gets the data attached with SDL_Libretro_SetMenuUserData(). | |
| const char * | SDL_Libretro_GetMessage (SDL_Libretro *lr) |
| Gets the most relevant libretro message to display from the queue. | |
| bool | SDL_Libretro_GetMessageByIndex (SDL_Libretro *lr, int index, const char **msg, int *progress, int *type) |
| Retrieves all message details for the given message index. | |
| unsigned | SDL_Libretro_GetMessageCount (SDL_Libretro *lr) |
| Gets the number of messages currently in the queue. | |
| int | SDL_Libretro_GetMessageProgress (SDL_Libretro *lr) |
| Gets the progress of the message returned by SDL_Libretro_GetMessage(). | |
| int | SDL_Libretro_GetMessageType (SDL_Libretro *lr) |
| Gets the type of the message returned by SDL_Libretro_GetMessage(). | |
| unsigned | SDL_Libretro_GetMousePort (const SDL_Libretro *lr) |
| Get the controller port that the mouse drives. | |
| const SDL_LibretroOption * | SDL_Libretro_GetOption (const SDL_Libretro *lr, const char *key) |
| Retrieve details about a given core option. | |
| const SDL_LibretroOption * | SDL_Libretro_GetOptionByIndex (const SDL_Libretro *lr, unsigned index) |
| Retrieve a core option by its registration index. | |
| unsigned | SDL_Libretro_GetOptionCount (const SDL_Libretro *lr) |
| Get the number of core options that have been set. | |
| const char * | SDL_Libretro_GetOptionValue (SDL_Libretro *lr, const char *key) |
| Get a core option's current value. | |
| const char * | SDL_Libretro_GetOptionValueLabel (SDL_Libretro *lr, const char *key) |
| Get the human-readable label for a core option's current value. | |
| unsigned | SDL_Libretro_GetPerformanceLevel (const SDL_Libretro *lr) |
| Get the performance level the core requested via SET_PERFORMANCE_LEVEL. | |
| unsigned | SDL_Libretro_GetPortDevice (const SDL_Libretro *lr, unsigned port) |
| Get the device type assigned to a controller port. | |
| SDL_Renderer * | SDL_Libretro_GetRenderer (const SDL_Libretro *lr) |
| Get the renderer the context draws into. | |
| bool | SDL_Libretro_GetRewindEnabled (const SDL_Libretro *lr) |
| Check whether the rewind system is enabled (independent of current direction). | |
| size_t | SDL_Libretro_GetRewindMemoryLimit (const SDL_Libretro *lr) |
| Get the current rewind memory budget in bytes (0 if unbounded). | |
| size_t | SDL_Libretro_GetRewindMemoryUsage (const SDL_Libretro *lr) |
| Get the approximate memory currently held by the rewind buffer, in bytes. | |
| double | SDL_Libretro_GetRewindRemaining (const SDL_Libretro *lr) |
| Calculates the amount of rewind time remaining in the buffer. | |
| int | SDL_Libretro_GetRotation (const SDL_Libretro *lr) |
| Gets the screen rotation requested by the core. | |
| double | SDL_Libretro_GetSampleRate (const SDL_Libretro *lr) |
| Get the audio sample rate the loaded core outputs at. | |
| const char * | SDL_Libretro_GetSaveDirectory (SDL_Libretro *lr) |
| Get the save directory. | |
| size_t | SDL_Libretro_GetSavePath (const SDL_Libretro *lr, const char *extension, char *dst, size_t dstSize) |
| Build a path in the save directory for the currently loaded content. | |
| enum retro_savestate_context | SDL_Libretro_GetSavestateContext (const SDL_Libretro *lr) |
| Get the savestate context reported to cores through RETRO_ENVIRONMENT_GET_SAVESTATE_CONTEXT. | |
| SDL_ScaleMode | SDL_Libretro_GetScaleMode (const SDL_Libretro *lr) |
| Gets the texture scale mode used when the libretro frame is scaled. | |
| void | SDL_Libretro_GetSize (const SDL_Libretro *lr, int *w, int *h) |
| Gets the width and height of the core's current video frame. | |
| float | SDL_Libretro_GetSpeed (const SDL_Libretro *lr) |
| Get how fast the game runs, as a multiple of its normal speed. | |
| bool | SDL_Libretro_GetSRAMAutoSave (const SDL_Libretro *lr) |
| Check whether SRAM is loaded and saved along with the game. | |
| size_t | SDL_Libretro_GetStateSize (const SDL_Libretro *lr) |
| Retrieves the size of serialized states. | |
| const char * | SDL_Libretro_GetSystemDirectory (SDL_Libretro *lr) |
| Get the system directory. | |
| SDL_Texture * | SDL_Libretro_GetTexture (const SDL_Libretro *lr) |
| Get the streaming texture that holds the core's most recent video frame. | |
| const char * | SDL_Libretro_GetUsername (SDL_Libretro *lr) |
| Get the username reported to cores. | |
| const char * | SDL_Libretro_GetValidExtensions (const SDL_Libretro *lr) |
| Gets the default set of valid extensions associated with the core, seperated by a "|". | |
| int | SDL_Libretro_GetVersion (void) |
| Get the version of SDL_libretro the implementation was compiled with. | |
| float | SDL_Libretro_GetVolume (const SDL_Libretro *lr) |
| Get the audio volume. | |
| void | SDL_Libretro_HandleEvent (SDL_Libretro *lr, const SDL_Event *event) |
| Call this function within the SDL_PollEvent() loop to ensure libretro knows of important events. | |
| bool | SDL_Libretro_HandleMenuEvent (SDL_LibretroMenu *menu, const SDL_Event *event) |
| Routes an event to the menu; call this for every event, before SDL_Libretro_HandleEvent(). | |
| bool | SDL_Libretro_InitConfig (SDL_Libretro *lr, const char *org, const char *app) |
| Sets up the config file to be the default path, accoring to the organization and app name. | |
| bool | SDL_Libretro_InitConfigFile (SDL_Libretro *lr, const char *file) |
| Initializes the config system based on the given file. | |
| bool | SDL_Libretro_InsertDisk (SDL_Libretro *lr) |
| Closes the disk tray after a disk change. | |
| bool | SDL_Libretro_IsCoreReady (const SDL_Libretro *lr) |
| Indicates whether a core is loaded. | |
| bool | SDL_Libretro_IsFastforwardOverrideActive (const SDL_Libretro *lr) |
| Indicates whether the core is forcing fast-forward through RETRO_ENVIRONMENT_SET_FASTFORWARDING_OVERRIDE. | |
| bool | SDL_Libretro_IsGameReady (const SDL_Libretro *lr) |
| Indicates whether a game is loaded and running. | |
| bool | SDL_Libretro_IsGameRequired (const SDL_Libretro *lr) |
| Indicates whether the loaded core needs content to run. | |
| bool | SDL_Libretro_IsMenuOpen (const SDL_LibretroMenu *menu) |
| Checks whether the menu is currently shown. | |
| bool | SDL_Libretro_LoadCore (SDL_Libretro *lr, const char *core) |
| Loads a libretro core. | |
| bool | SDL_Libretro_LoadGame (SDL_Libretro *lr, const char *gamePath) |
| Loads a game at the given path. | |
| bool | SDL_Libretro_LoadGame_IO (SDL_Libretro *lr, SDL_IOStream *src, const char *path, bool closeio) |
| Loads a game from an SDL_IOStream. | |
| bool | SDL_Libretro_LoadGameSpecial (SDL_Libretro *lr, const char *subsystem, const char **paths, unsigned numPaths) |
| Loads multi-ROM subsystem content (e.g. | |
| bool | SDL_Libretro_LoadGameSpecialById (SDL_Libretro *lr, unsigned subsystemId, const char **paths, unsigned numPaths) |
| Load multi-ROM subsystem content by its numeric subsystem id. | |
| bool | SDL_Libretro_LoadMemory (SDL_Libretro *lr, unsigned memoryType, const char *file) |
| Load a core memory region from a file. | |
| bool | SDL_Libretro_LoadMemory_IO (SDL_Libretro *lr, unsigned memoryType, SDL_IOStream *src, bool closeio) |
| Load a core memory region from a stream. | |
| bool | SDL_Libretro_LoadSRAM (SDL_Libretro *lr, const char *file) |
| Loads the SRAM from the given file. | |
| bool | SDL_Libretro_LoadSRAM_IO (SDL_Libretro *lr, SDL_IOStream *src, bool closeio) |
| Load the core's battery-backed save RAM from a stream. | |
| bool | SDL_Libretro_LoadState (SDL_Libretro *lr, const char *file) |
| Loads the libretro state from the given file. | |
| bool | SDL_Libretro_LoadState_IO (SDL_Libretro *lr, SDL_IOStream *src, bool closeio) |
| Load a libretro state from the given SDL_IOStream. | |
| void | SDL_Libretro_MenuScreenshotClicked (SDL_LibretroMenu *menu, void *userdata) |
| A ready-made menu callback that saves a PNG screenshot of the current frame, reporting the result in the menu. | |
| bool | SDL_Libretro_OpenMenuPath (SDL_LibretroMenu *menu, const char *path) |
| Opens the menu and navigates to a page by its slash-separated label path, e.g. | |
| bool | SDL_Libretro_PhysFS_Init (SDL_Libretro *lr) |
| Initialize PhysFS and route the libretro VFS through it. | |
| bool | SDL_Libretro_PhysFS_LoadGame (SDL_Libretro *lr, const char *gamePath) |
| Archive-aware replacement for SDL_Libretro_LoadGame(). | |
| void | SDL_Libretro_PhysFS_Quit (SDL_Libretro *lr) |
| Tear down PhysFS, unmounting any active archive and restoring the plain SDL VFS on the given context. | |
| bool | SDL_Libretro_Render (SDL_Libretro *lr, SDL_Renderer *renderer, const SDL_FRect *dstRect) |
| Render the libretro context in the given renderer. | |
| void | SDL_Libretro_RenderMenu (SDL_LibretroMenu *menu) |
| Draws the menu laid out by SDL_Libretro_UpdateMenu() to the renderer. | |
| bool | SDL_Libretro_Reset (SDL_Libretro *lr) |
| Resets the loaded game, like pressing the console's reset button. | |
| void | SDL_Libretro_ResetAllOptions (SDL_Libretro *lr) |
| Reset every core option to its default value. | |
| void | SDL_Libretro_ResetCheats (SDL_Libretro *lr) |
| Clears all cheats that were set on the core. | |
| bool | SDL_Libretro_ResetOption (SDL_Libretro *lr, const char *key) |
| Reset a core option to its default value. | |
| bool | SDL_Libretro_SaveMemory (SDL_Libretro *lr, unsigned memoryType, const char *file) |
| Write a core memory region to a file. | |
| bool | SDL_Libretro_SaveMemory_IO (SDL_Libretro *lr, unsigned memoryType, SDL_IOStream *dst, bool closeio) |
| Write a core memory region to a stream. | |
| bool | SDL_Libretro_SaveScreenshot (const SDL_Libretro *lr, const char *path) |
| Saves a PNG screenshot of the current frame. | |
| bool | SDL_Libretro_SaveSRAM (SDL_Libretro *lr, const char *file) |
| Saves the current SRAM to the given file. | |
| bool | SDL_Libretro_SaveSRAM_IO (SDL_Libretro *lr, SDL_IOStream *dst, bool closeio) |
| Write the core's battery-backed save RAM to a stream. | |
| bool | SDL_Libretro_SaveState (SDL_Libretro *lr, const char *file) |
| Saves the current libretro state to a file. | |
| bool | SDL_Libretro_SaveState_IO (SDL_Libretro *lr, SDL_IOStream *dst, bool closeio) |
| Save the current libretro state to the given SDL_IOStream. | |
| void | SDL_Libretro_SetAnalogToDigital (SDL_Libretro *lr, unsigned port, SDL_LibretroAnalogToDigital stick) |
| Selects which analog stick, if any, also registers D-Pad presses on the given controller port, alongside the physical D-Pad. | |
| void | SDL_Libretro_SetAudioLatency (SDL_Libretro *lr, unsigned latencyMs) |
| Set the desired minimum audio latency for the audio stream. | |
| bool | SDL_Libretro_SetCheat (SDL_Libretro *lr, unsigned index, bool enabled, const char *code) |
| Set a cheat code either enabled or disabled within the libretro context. | |
| bool | SDL_Libretro_SetCoreAssetsDirectory (SDL_Libretro *lr, const char *path) |
| Sets where cores look for their assets, reported through RETRO_ENVIRONMENT_GET_CORE_ASSETS_DIRECTORY. | |
| bool | SDL_Libretro_SetCoreDirectory (SDL_Libretro *lr, const char *path) |
| Sets the associated libretro core directory, where the default set of cores will be loaded from. | |
| bool | SDL_Libretro_SetDiskIndex (SDL_Libretro *lr, unsigned index) |
| Sets the disk image index to insert into the emulated drive. | |
| bool | SDL_Libretro_SetFitMode (SDL_Libretro *lr, SDL_LibretroFitMode mode) |
| Sets how the frame is fit into the destination rectangle when rendered. | |
| void | SDL_Libretro_SetGamepadMapping (SDL_Libretro *lr, unsigned port, int retroButton, SDL_GamepadButton button) |
| Maps an SDL gamepad button to a RETRO_DEVICE_ID_JOYPAD_* button on the given controller port. | |
| bool | SDL_Libretro_SetInitialDisk (SDL_Libretro *lr, unsigned index, const char *path) |
| Sets the disk image to insert once content is loaded. | |
| void | SDL_Libretro_SetKeyboardMapping (SDL_Libretro *lr, int retroButton, SDL_Scancode scancode) |
| Maps a keyboard key to a RETRO_DEVICE_ID_JOYPAD_* button for Player 1 (controller port 0). | |
| void | SDL_Libretro_SetLanguage (SDL_Libretro *lr, int language) |
| Override the language reported to cores through RETRO_ENVIRONMENT_GET_LANGUAGE. | |
| void | SDL_Libretro_SetLogLevel (SDL_Libretro *lr, SDL_LogPriority level) |
| Sets the threshold for logs to be posted. | |
| bool | SDL_Libretro_SetMemoryData (SDL_Libretro *lr, unsigned memoryType, const void *data, size_t size) |
| Overwrite a core memory region with caller-provided bytes. | |
| void | SDL_Libretro_SetMenuOpen (SDL_LibretroMenu *menu, bool open) |
| Opens or closes the menu. | |
| bool | SDL_Libretro_SetMenuStyle (SDL_LibretroMenu *menu, SDL_LibretroMenuStyle style) |
| Applies a color theme to the menu. | |
| void | SDL_Libretro_SetMenuUserData (SDL_LibretroMenu *menu, void *userData) |
| Attaches generic application data to the menu. | |
| void | SDL_Libretro_SetMessage (SDL_Libretro *lr, const char *msg, double duration) |
| Add a message to be displayed within the libretro context. | |
| void | SDL_Libretro_SetMousePort (SDL_Libretro *lr, unsigned port) |
| Selects the one controller port that the mouse drives. | |
| bool | SDL_Libretro_SetOptionValue (SDL_Libretro *lr, const char *key, const char *value) |
| Set a core option's value; fails if the value isn't one the core declared. | |
| bool | SDL_Libretro_SetPortDevice (SDL_Libretro *lr, unsigned port, unsigned device) |
| Assign a device type to a controller port. | |
| bool | SDL_Libretro_SetRenderer (SDL_Libretro *lr, SDL_Renderer *renderer) |
| Set the renderer the libretro context draws into. | |
| bool | SDL_Libretro_SetRewindEnabled (SDL_Libretro *lr, bool enabled, unsigned bufferFrames, unsigned captureInterval) |
| Enable or disable the rewind system. | |
| bool | SDL_Libretro_SetRewindMemoryDuration (SDL_Libretro *lr, double seconds) |
| Set the rewind memory budget by target duration instead of raw bytes. | |
| void | SDL_Libretro_SetRewindMemoryLimit (SDL_Libretro *lr, size_t maxBytes) |
| Set the maximum number of bytes of encoded delta history to retain. | |
| bool | SDL_Libretro_SetSaveDirectory (SDL_Libretro *lr, const char *path) |
| Sets where content will be saved. | |
| void | SDL_Libretro_SetSavestateContext (SDL_Libretro *lr, enum retro_savestate_context context) |
| Sets the savestate context reported to cores through RETRO_ENVIRONMENT_GET_SAVESTATE_CONTEXT. | |
| bool | SDL_Libretro_SetScaleMode (SDL_Libretro *lr, SDL_ScaleMode mode) |
| Sets the texture scale mode used when the libretro frame is scaled. | |
| void | SDL_Libretro_SetSpeed (SDL_Libretro *lr, float speed) |
| Sets how fast the game runs, as a multiple of its normal speed. | |
| void | SDL_Libretro_SetSRAMAutoSave (SDL_Libretro *lr, bool enabled) |
| Load and save the core's battery-backed save RAM along with the game. | |
| bool | SDL_Libretro_SetSystemDirectory (SDL_Libretro *lr, const char *path) |
| Sets where cores look for system files (BIOS, firmware, etc). | |
| bool | SDL_Libretro_SetUsername (SDL_Libretro *lr, const char *username) |
| Sets the username reported to cores through RETRO_ENVIRONMENT_GET_USERNAME. | |
| void | SDL_Libretro_SetVFS (SDL_Libretro *lr, void *vfs) |
| Set the Virtual File System the core uses for file access. | |
| void | SDL_Libretro_SetVirtualButton (SDL_Libretro *lr, unsigned port, int button, bool pressed) |
| Press or release a joypad button from code, such as from an on-screen touch control. | |
| void | SDL_Libretro_SetVolume (SDL_Libretro *lr, float volume) |
| Set the audio volume when playing sounds. | |
| bool | SDL_Libretro_ShouldQuit (const SDL_Libretro *lr) |
| Indicates whether or not the core has requested to shutdown. | |
| void | SDL_Libretro_ToggleMenu (SDL_LibretroMenu *menu) |
| Opens the menu when it is closed, or closes it when it is open. | |
| void | SDL_Libretro_UnloadCore (SDL_Libretro *lr) |
| Unloads the actively loaded core. | |
| void | SDL_Libretro_UnloadGame (SDL_Libretro *lr) |
| Unloads the actively loaded game. | |
| void | SDL_Libretro_Update (SDL_Libretro *lr) |
| Runs the loaded game; call it once per frame of the application's loop. | |
| void | SDL_Libretro_UpdateMenu (SDL_LibretroMenu *menu) |
| Processes input and lays out the menu for this frame. | |
| bool | SDL_Libretro_UpdateOptionVisibility (SDL_Libretro *lr) |
| Ask the core to refresh which of its options should be displayed. | |
| #define SDL_EVENT_LIBRETRO (SDL_EVENT_USER + 0x1000) |
The base SDL event type for SDL_libretro events.
SDL_libretro reports everything through the SDL event queue as SDL_UserEvent, with event->user.data1 the SDL_Libretro* that sent it.
Environment commands the library doesn't handle itself arrive as SDL_EVENT_LIBRETRO_ENVIRONMENT(RETRO_ENVIRONMENT_*), with the data pointer the core passed in event->user.data2.
The data pointer is only valid while the core waits inside the environment call, so to implement a command, handle the event from an SDL_AddEventWatch() callback — watches run synchronously during the push — and set event->user.code to a non-zero value there to tell the core the command succeeded. An SDL_SetEventFilter() filter can claim the same way, and may return false to drop the event. A claimed command is consumed and doesn't also reach the event queue; unclaimed commands arrive there once, with the data pointer already expired. user.reserved is used internally to tell queued copies of the same command apart.
The range is a fixed offset into the SDL user events, so the types work as case labels. The first SDL_Libretro_Create() in a process reserves SDL_EVENT_LIBRETRO through SDL_EVENT_LIBRETRO_LAST with SDL_RegisterEvents(), so events the application registers afterwards land past it. Applications registering events before then should keep below SDL_EVENT_LIBRETRO; a warning is logged when they've reached into it.
Definition at line 255 of file SDL_libretro.h.
| #define SDL_EVENT_LIBRETRO_CORE_LOADED (SDL_EVENT_LIBRETRO | 0xF00) |
A core finished loading; data2 is the core name, valid until the next load or unload.
Definition at line 300 of file SDL_libretro.h.
| #define SDL_EVENT_LIBRETRO_ENVIRONMENT | ( | cmd | ) | (SDL_EVENT_LIBRETRO | ((cmd) & 0x3FF) | (((cmd) >> 6) & 0xC00)) |
The SDL event type a RETRO_ENVIRONMENT_* command arrives as, when SDL_libretro leaves the command to the application.
The command number takes the low ten bits, and the RETRO_ENVIRONMENT_EXPERIMENTAL and RETRO_ENVIRONMENT_PRIVATE flags each get a bit of their own, so commands that share a number, like RETRO_ENVIRONMENT_SET_SERIALIZATION_QUIRKS and the experimental RETRO_ENVIRONMENT_SET_HW_SHARED_CONTEXT, stay apart. Plain commands come out as SDL_EVENT_LIBRETRO | RETRO_ENVIRONMENT_*. It's a constant expression, so it works as a case label:
case SDL_EVENT_LIBRETRO_ENVIRONMENT(RETRO_ENVIRONMENT_GET_CAMERA_INTERFACE):
Commands numbered 0x400 and up, or carrying both flags, aren't reported.
Definition at line 282 of file SDL_libretro.h.
| #define SDL_EVENT_LIBRETRO_ENVIRONMENT_LAST (SDL_EVENT_LIBRETRO | 0xBFF) |
The last SDL event type an environment command can arrive as.
Events from SDL_EVENT_LIBRETRO to here are environment commands.
Definition at line 290 of file SDL_libretro.h.
| #define SDL_EVENT_LIBRETRO_GAME_LOADED (SDL_EVENT_LIBRETRO | 0xF01) |
A game finished loading, whether directly or through the menu; data2 is the game name, valid until the next load or unload.
Definition at line 301 of file SDL_libretro.h.
| #define SDL_EVENT_LIBRETRO_GEOMETRY_CHANGED (SDL_EVENT_LIBRETRO | 0xF07) |
The video size, aspect ratio, or timing changed mid-game.
Definition at line 307 of file SDL_libretro.h.
| #define SDL_EVENT_LIBRETRO_LAST (SDL_EVENT_LIBRETRO | 0xFFF) |
The last SDL event type in the SDL_libretro range.
Every SDL_libretro event falls within SDL_EVENT_LIBRETRO to SDL_EVENT_LIBRETRO_LAST.
Definition at line 261 of file SDL_libretro.h.
| #define SDL_EVENT_LIBRETRO_MENU_CLOSED (SDL_EVENT_LIBRETRO | 0xF03) |
The menu was dismissed; the game resumes.
data2 is the SDL_LibretroMenu.
Definition at line 303 of file SDL_libretro.h.
| #define SDL_EVENT_LIBRETRO_MENU_OPENED (SDL_EVENT_LIBRETRO | 0xF02) |
The menu became visible; the game pauses.
data2 is the SDL_LibretroMenu.
Definition at line 302 of file SDL_libretro.h.
| #define SDL_EVENT_LIBRETRO_SHUTDOWN (SDL_EVENT_LIBRETRO | 0xF06) |
The core requested shutdown.
Definition at line 306 of file SDL_libretro.h.
| #define SDL_LIBRETRO_ENVIRONMENT_COMMAND | ( | type | ) | ((((type) - SDL_EVENT_LIBRETRO) & 0x3FF) | ((((type) - SDL_EVENT_LIBRETRO) & 0xC00) << 6)) |
The RETRO_ENVIRONMENT_* command, flags included, that an environment event type stands for; the reverse of SDL_EVENT_LIBRETRO_ENVIRONMENT().
Definition at line 298 of file SDL_libretro.h.
| #define SDL_LIBRETRO_MAJOR_VERSION 0 |
The major version of SDL_Libretro.
Definition at line 53 of file SDL_libretro.h.
| #define SDL_LIBRETRO_MICRO_VERSION 0 |
The micro/patch version of SDL_Libretro.
Definition at line 69 of file SDL_libretro.h.
| #define SDL_LIBRETRO_MINOR_VERSION 1 |
The minor version of SDL_Libretro.
Definition at line 61 of file SDL_libretro.h.
| typedef struct SDL_Libretro SDL_Libretro |
A libretro frontend context: one loaded core, its game, and the settings that carry across cores.
Treat it as an opaque handle. It is created with SDL_Libretro_Create() and freed with SDL_Libretro_Destroy(). Its fields are only visible in the translation unit that defines SDL_LIBRETRO_IMPLEMENTATION, and they are implementation details that may change at any time; applications should only use the SDL_Libretro_* functions to read or change its state.
Definition at line 93 of file SDL_libretro.h.
| typedef enum SDL_LibretroAnalogToDigital SDL_LibretroAnalogToDigital |
Which analog stick, if any, also registers D-Pad presses for a controller port.
| typedef struct SDL_LibretroMenu SDL_LibretroMenu |
An in-app menu built on nuklear_console.
Only available when the implementation is compiled with SDL_LIBRETRO_ENABLE_MENU.
Definition at line 468 of file SDL_libretro.h.
| typedef void(* SDL_LibretroMenuCallback) (SDL_LibretroMenu *menu, void *userdata) |
A callback for menu entries added by the application.
Definition at line 506 of file SDL_libretro.h.
| typedef enum SDL_LibretroMenuStyle SDL_LibretroMenuStyle |
Color themes for the menu.
Which analog stick, if any, also registers D-Pad presses for a controller port.
Definition at line 111 of file SDL_libretro.h.
| enum SDL_LibretroFitMode |
When rendering the libretro context, determine how to display within the destination.
Definition at line 98 of file SDL_libretro.h.
Color themes for the menu.
Definition at line 475 of file SDL_libretro.h.
| bool SDL_Libretro_AddDiskImage | ( | SDL_Libretro * | lr, |
| const char * | path | ||
| ) |
Appends a new disk image from a file path.
The disk tray must be ejected before calling this function. Like SDL_Libretro_LoadGame(), need_fullpath handling is picked by the path's extension: a core that needs a full path gets just path, otherwise the file is read and the core gets its bytes along with path. The buffer is kept until the game unloads. If the core rejects the image, the slot added for it is removed again.
| lr | The libretro instance. |
| path | File path to the disk image. |
Definition at line 237 of file SDL_libretro_serialize.h.
References SDL_Libretro_AddDiskImage_IO(), and SDL_Libretro_IsGameReady().
| bool SDL_Libretro_AddDiskImage_IO | ( | SDL_Libretro * | lr, |
| SDL_IOStream * | src, | ||
| const char * | path, | ||
| bool | closeio | ||
| ) |
Appends a new disk image from an SDL_IOStream.
The disk tray must be ejected before calling this function. The path is the path the image is known by (e.g. a virtual path inside an archive); it picks need_fullpath handling by its extension and is passed to the core. When the core needs a full path, the stream is spilled to the temp directory and that file is passed instead. Otherwise the bytes are passed along with path. Either way, the file or buffer is kept until the game unloads. If the core rejects the image, the slot added for it is removed again.
| lr | The libretro instance. |
| src | IOStream containing the disk image data. |
| path | The path the disk image is known by. |
| closeio | If true, close src before returning, even on failure. |
Definition at line 280 of file SDL_libretro_serialize.h.
References SDL_Libretro_IsGameReady().
Referenced by SDL_Libretro_AddDiskImage().
| bool SDL_Libretro_AddMenuButton | ( | SDL_LibretroMenu * | menu, |
| const char * | label, | ||
| SDL_LibretroMenuCallback | callback, | ||
| void * | userdata | ||
| ) |
Adds a button to the main menu, just above Quit.
The menu copies the label and frees the button in SDL_Libretro_DestroyMenu().
| menu | the menu to add to. |
| label | the button text. |
| callback | called when the button is clicked, or NULL. |
| userdata | passed to the callback. |
Definition at line 2894 of file SDL_libretro_menu.h.
| bool SDL_Libretro_AddMenuCheckbox | ( | SDL_LibretroMenu * | menu, |
| const char * | label, | ||
| bool * | value, | ||
| SDL_LibretroMenuCallback | callback, | ||
| void * | userdata | ||
| ) |
Adds a checkbox to the main menu, just above Quit.
The checkbox starts from the current value, and the value pointer is written on every toggle, so it must outlive the menu. The menu copies the label and frees the checkbox in SDL_Libretro_DestroyMenu().
| menu | the menu to add to. |
| label | the checkbox text. |
| value | the bool the checkbox mirrors, or NULL to keep the state internal. |
| callback | called after each toggle, once value is updated, or NULL. |
| userdata | passed to the callback. |
Definition at line 2921 of file SDL_libretro_menu.h.
| bool SDL_Libretro_AreOptionsDirty | ( | SDL_Libretro * | lr | ) |
Retrieves whether the options have been changed since the last time they were checked.
Checking clears the flag, so the next call returns false until an option changes again. Useful to know when to persist options.
| lr | the libretro context. |
Definition at line 469 of file SDL_libretro_options.h.
| SDL_Libretro * SDL_Libretro_Create | ( | void | ) |
Creates a new libretro context.
The context starts with default settings: full volume, normal speed, the default keyboard and gamepad mappings, and "SDL_libretro" as the username. The first call in a process also reserves the SDL_EVENT_LIBRETRO event range. Only one context can have a core loaded at a time.
Definition at line 95 of file SDL_libretro_core.h.
References SDL_LIBRETRO_MAX_USERS, SDL_LIBRETRO_REWIND_DEFAULT_MAX_BYTES, SDL_Libretro_SetLanguage(), SDL_Libretro_SetSpeed(), SDL_Libretro_SetUsername(), SDL_Libretro_SetVFS(), and SDL_Libretro_SetVolume().
| SDL_LibretroMenu * SDL_Libretro_CreateMenu | ( | SDL_Libretro * | lr | ) |
Creates the in-app menu for a libretro context.
Sets up Nuklear on the context's window and renderer, restores the menu's persisted settings (style, UI scale, volume, and the like) from the config, and builds the menu pages. The menu starts closed, but SDL_Libretro_UpdateMenu() opens it whenever no game is running.
Requires the implementation to be compiled with SDL_LIBRETRO_ENABLE_MENU. Each frame, route events through SDL_Libretro_HandleMenuEvent(), then call SDL_Libretro_UpdateMenu() and SDL_Libretro_RenderMenu() after rendering the game and before presenting.
| lr | the libretro context. SDL_Libretro_SetRenderer() must have been called on it first, and it must outlive the menu. |
Definition at line 2369 of file SDL_libretro_menu.h.
| SDL_Surface * SDL_Libretro_CreateSurface | ( | const SDL_Libretro * | lr | ) |
Creates a new surface from the current libretro context.
The frame is copied at its native size, unscaled and unrotated. The Surface must be destroyed after use with SDL_DestroySurface().
| lr | the libretro context. |
Definition at line 201 of file SDL_libretro_video.h.
Referenced by SDL_Libretro_SaveScreenshot().
| bool SDL_Libretro_CycleOptionValue | ( | SDL_Libretro * | lr, |
| const char * | key, | ||
| int | direction | ||
| ) |
Advance a core option to the next (+1) or previous (-1) value.
Wraps around at either end of the option's declared values.
| lr | the libretro context. |
| key | the option's key. |
| direction | a positive number for the next value, or a negative number for the previous value. |
direction is 0, there's no such option, or it has no declared values.Definition at line 388 of file SDL_libretro_options.h.
References SDL_Libretro_GetOption(), SDL_Libretro_SetOptionValue(), SDL_LibretroOptionValue::value, SDL_LibretroOption::value, SDL_LibretroOption::values, and SDL_LibretroOption::valuesCount.
| void SDL_Libretro_Destroy | ( | SDL_Libretro * | lr | ) |
Destroys the given libretro context.
Will also unload the active game and core if needed, save the config set up with SDL_Libretro_InitConfig(), and drop any SDL_libretro events still in the queue, since they point into the context.
| lr | the libretro context to destroy. NULL is ignored. |
Definition at line 150 of file SDL_libretro_core.h.
References SDL_EVENT_LIBRETRO, SDL_EVENT_LIBRETRO_LAST, SDL_LIBRETRO_MAX_USERS, SDL_Libretro_PhysFS_Quit(), SDL_Libretro_UnloadCore(), and SDL_Libretro_UnloadGame().
| void SDL_Libretro_DestroyMenu | ( | SDL_LibretroMenu * | menu | ) |
Destroys a menu created with SDL_Libretro_CreateMenu().
Writes any changed menu settings to the config, frees the Nuklear context and every widget, including the entries added with SDL_Libretro_AddMenuButton() and SDL_Libretro_AddMenuCheckbox(), and drops any queued SDL_EVENT_LIBRETRO_MENU_OPENED and SDL_EVENT_LIBRETRO_MENU_CLOSED events that still refer to it. The libretro context is left untouched; destroy the menu before destroying the context.
| menu | the menu to destroy. NULL is ignored. |
Definition at line 2431 of file SDL_libretro_menu.h.
References SDL_EVENT_LIBRETRO_MENU_CLOSED, and SDL_EVENT_LIBRETRO_MENU_OPENED.
| bool SDL_Libretro_EjectDisk | ( | SDL_Libretro * | lr | ) |
Ejects the disk tray, allowing the disk image to be changed.
| lr | The libretro instance. |
Definition at line 134 of file SDL_libretro_serialize.h.
References SDL_Libretro_IsGameReady().
| SDL_LibretroAnalogToDigital SDL_Libretro_GetAnalogToDigital | ( | const SDL_Libretro * | lr, |
| unsigned | port | ||
| ) |
Get the analog stick that also registers D-Pad presses on a controller port.
Invalid arguments return SDL_LIBRETRO_ANALOG_TO_DIGITAL_NONE.
| lr | the libretro context. |
| port | the controller port, at a max of SDL_LIBRETRO_MAX_USERS. |
Definition at line 853 of file SDL_libretro_input.h.
References SDL_LIBRETRO_ANALOG_TO_DIGITAL_NONE, and SDL_LIBRETRO_MAX_USERS.
| float SDL_Libretro_GetAspectRatio | ( | const SDL_Libretro * | lr | ) |
Gets the aspect ratio for the libretro context.
| lr | the libretro context. |
Definition at line 371 of file SDL_libretro_video.h.
| unsigned SDL_Libretro_GetAudioLatency | ( | const SDL_Libretro * | lr | ) |
Get the minimum audio latency for the audio stream.
| lr | the libretro context. |
Definition at line 332 of file SDL_libretro_audio.h.
References SDL_LIBRETRO_AUDIO_DEFAULT_LATENCY_MS.
Referenced by SDL_Libretro_InitConfigFile().
| bool SDL_Libretro_GetBlockExtract | ( | const SDL_Libretro * | lr | ) |
Retrieves whether the core expects archives to be loaded directly.
| lr | the libretro context. |
Definition at line 2292 of file SDL_libretro_core.h.
References SDL_Libretro_IsCoreReady().
| const SDL_LibretroCategory * SDL_Libretro_GetCategory | ( | const SDL_Libretro * | lr, |
| const char * | key | ||
| ) |
Retrieve an option category by key.
| lr | the libretro context. |
| key | the category's key, as found in SDL_LibretroOption's category. |
Definition at line 515 of file SDL_libretro_options.h.
| const SDL_LibretroCategory * SDL_Libretro_GetCategoryByIndex | ( | const SDL_Libretro * | lr, |
| unsigned | index | ||
| ) |
Retrieve an option category by index.
| lr | the libretro context. |
| index | the category index, from 0 to SDL_Libretro_GetCategoryCount() - 1. |
Definition at line 534 of file SDL_libretro_options.h.
| unsigned SDL_Libretro_GetCategoryCount | ( | const SDL_Libretro * | lr | ) |
Get the number of option categories registered by the core.
| lr | the libretro context. |
Definition at line 502 of file SDL_libretro_options.h.
| const char * SDL_Libretro_GetContentExtension | ( | const SDL_Libretro * | lr | ) |
Get the extension of the loaded content, as it appears in the path.
Returns the text after the last '.' of the content path, in its original case (e.g. "SFC" for "game.SFC"), or "" when no content is loaded or the file has no extension. Note this is the raw-case extension; the lower-cased form handed to cores via GET_GAME_INFO_EXT (gameInfoExt.ext) may differ.
| lr | the libretro context. |
Definition at line 2304 of file SDL_libretro_core.h.
| const char * SDL_Libretro_GetCoreAssetsDirectory | ( | SDL_Libretro * | lr | ) |
Get the core assets directory.
| lr | the libretro context. |
Definition at line 2021 of file SDL_libretro_core.h.
Referenced by SDL_Libretro_InitConfigFile().
| const char * SDL_Libretro_GetCoreDirectory | ( | SDL_Libretro * | lr | ) |
Get the core directory.
| lr | the libretro context. |
Definition at line 1982 of file SDL_libretro_core.h.
Referenced by SDL_Libretro_InitConfigFile().
| const char * SDL_Libretro_GetCoreName | ( | const SDL_Libretro * | lr | ) |
Retrieve the name of the libretro core that's actively loaded.
| lr | the libretro context. |
Definition at line 2206 of file SDL_libretro_core.h.
References SDL_Libretro_IsCoreReady().
| const char * SDL_Libretro_GetCoreVersion | ( | const SDL_Libretro * | lr | ) |
Retrieves the version of the libretro core that's actively loaded.
| lr | the libretro context. |
Definition at line 2229 of file SDL_libretro_core.h.
References SDL_Libretro_IsCoreReady().
| unsigned SDL_Libretro_GetDiskCount | ( | const SDL_Libretro * | lr | ) |
Returns the number of disk images available to the loaded core.
| lr | The libretro instance. |
Definition at line 91 of file SDL_libretro_serialize.h.
References SDL_Libretro_IsGameReady().
| unsigned SDL_Libretro_GetDiskIndex | ( | const SDL_Libretro * | lr | ) |
Returns the index of the currently inserted disk image.
| lr | The libretro instance. |
Definition at line 102 of file SDL_libretro_serialize.h.
References SDL_Libretro_IsGameReady().
| bool SDL_Libretro_GetDiskLabel | ( | const SDL_Libretro * | lr, |
| unsigned | index, | ||
| char * | label, | ||
| size_t | len | ||
| ) |
Retrieves the human-readable label of a disk image.
Requires a core that provides the extended disk control interface.
| lr | The libretro instance. |
| index | The zero-based disk image index. |
| label | Buffer to receive the null-terminated label. |
| len | Size of the label buffer in bytes. |
Definition at line 349 of file SDL_libretro_serialize.h.
References SDL_Libretro_IsGameReady().
| size_t SDL_Libretro_GetFileName | ( | char * | dst, |
| size_t | dstSize, | ||
| const char * | path, | ||
| bool | withExtension | ||
| ) |
Copy the file name portion of a path into a caller-provided buffer.
The leading directory components and (optionally) the trailing extension are stripped. Useful for deriving save/state file names from a content path.
| dst | the destination buffer to fill (always null-terminated). |
| dstSize | the size of dst in bytes. |
| path | the source path, may be NULL. |
| withExtension | if true, keep the file extension; if false, strip it. |
dst, excluding the null terminator (0 on invalid arguments). Definition at line 388 of file SDL_libretro_core.h.
| SDL_LibretroFitMode SDL_Libretro_GetFitMode | ( | const SDL_Libretro * | lr | ) |
Gets how the frame is fit into the destination rectangle when rendered.
| lr | the libretro context. |
lr is NULL.Definition at line 424 of file SDL_libretro_video.h.
References SDL_LIBRETRO_FIT_ASPECT.
Referenced by SDL_Libretro_InitConfigFile().
| double SDL_Libretro_GetFPS | ( | const SDL_Libretro * | lr | ) |
Gets the frame rate the core expects to run at.
| lr | the libretro context. |
Definition at line 381 of file SDL_libretro_video.h.
| const char * SDL_Libretro_GetGameName | ( | const SDL_Libretro * | lr | ) |
Retrieve the human-readable name of the loaded game.
This is the content file's base name without its extension. When the core runs without content, it falls back to the core's name.
| lr | the libretro context. |
Definition at line 2219 of file SDL_libretro_core.h.
References SDL_Libretro_IsGameReady().
| bool SDL_Libretro_GetInputDescriptor | ( | const SDL_Libretro * | lr, |
| unsigned | index, | ||
| unsigned * | port, | ||
| unsigned * | device, | ||
| unsigned * | id, | ||
| const char ** | description | ||
| ) |
Retrieve an input descriptor by index.
This function can be used to enumerate all available input descriptors by calling it with incrementing index values starting at 0 until no descriptor is returned or an error is indicated.
| lr | The libretro context. | |
| [in] | index | Zero-based index of the input descriptor to retrieve. The value should start at 0 and be incremented to enumerate successive descriptors. |
| [out] | port | Zero-based port number to query (e.g., controller port). |
| [out] | device | Device identifier within the port (if applicable). |
| [out] | id | The ID of the descriptor. |
| [out] | description | The description of the input device. |
description string is owned by the libretro context; do not modify or free it. It stays valid until the core sets new descriptors or is unloaded.Definition at line 941 of file SDL_libretro_input.h.
References SDL_Libretro_IsCoreReady().
| unsigned SDL_Libretro_GetInputDescriptorCount | ( | const SDL_Libretro * | lr | ) |
Retrieve the number of input descriptors provided by a Libretro core.
| lr | the libretro context. |
Definition at line 916 of file SDL_libretro_input.h.
References SDL_Libretro_IsCoreReady().
| int SDL_Libretro_GetLanguage | ( | const SDL_Libretro * | lr | ) |
Get the language reported to cores through RETRO_ENVIRONMENT_GET_LANGUAGE.
| lr | The SDL_Libretro context. |
Definition at line 323 of file SDL_libretro_env.h.
| SDL_LogPriority SDL_Libretro_GetLogLevel | ( | const SDL_Libretro * | lr | ) |
Retrieve the threshold for logs that will be posted.
| lr | the libretro context. |
Definition at line 2189 of file SDL_libretro_core.h.
| void * SDL_Libretro_GetMapAddress | ( | const SDL_Libretro * | lr, |
| size_t | address, | ||
| size_t * | regionRemaining | ||
| ) |
Translate an emulated (guest) address to a live host pointer via the memory map.
Walks the descriptors published by the core (RETRO_ENVIRONMENT_SET_MEMORY_MAPS) and returns a pointer into the core's live memory for address, so debuggers, cheat finders, and RAM watchers don't have to reimplement the descriptor math.
Resolves an address that lies within a descriptor's primary mapped range ([start, start + len), after folding out disconnect bits). Mirror/aliased addresses that rely on a descriptor's select mask to wrap back into the region may return NULL rather than a guess; the result is always either a correct pointer or NULL, never a wrong one.
| lr | the libretro context. |
| address | the emulated address to resolve. |
| regionRemaining | if non-NULL, receives the number of contiguous bytes from address to the end of the matched region (0 when unmatched). |
Definition at line 704 of file SDL_libretro_serialize.h.
References SDL_Libretro_IsGameReady().
| void * SDL_Libretro_GetMemoryData | ( | const SDL_Libretro * | lr, |
| unsigned | memoryType, | ||
| size_t * | size | ||
| ) |
Get a pointer to a core memory region and its size.
Returns the core's live buffer for the given RETRO_MEMORY_* type. The pointer is owned by the core: do not free it, it stays valid until the core is unloaded, and writing through it pokes the running game directly. Must not be called concurrently with SDL_Libretro_Update().
| lr | the libretro context. |
| memoryType | one of the RETRO_MEMORY_* constants. |
| size | receives the region size in bytes (set to 0 when unavailable), or NULL. |
Definition at line 573 of file SDL_libretro_serialize.h.
References SDL_Libretro_IsGameReady().
Referenced by SDL_Libretro_LoadMemory_IO(), SDL_Libretro_SaveMemory(), SDL_Libretro_SaveMemory_IO(), and SDL_Libretro_SetMemoryData().
| unsigned SDL_Libretro_GetMemoryMapCount | ( | const SDL_Libretro * | lr | ) |
Get the number of memory-map descriptors the core has published.
Cores describe their address space via RETRO_ENVIRONMENT_SET_MEMORY_MAPS for the benefit of debuggers, cheat finders, and achievement runtimes. Returns 0 if the core published no map.
| lr | the libretro context. |
Definition at line 641 of file SDL_libretro_serialize.h.
References SDL_Libretro_IsGameReady().
| bool SDL_Libretro_GetMemoryMapDescriptor | ( | const SDL_Libretro * | lr, |
| unsigned | index, | ||
| Uint64 * | flags, | ||
| void ** | ptr, | ||
| size_t * | offset, | ||
| size_t * | start, | ||
| size_t * | select, | ||
| size_t * | disconnect, | ||
| size_t * | len, | ||
| const char ** | addrspace | ||
| ) |
Retrieve one memory-map descriptor by index.
Maps a region of the emulated address space onto a host pointer. To translate a guest address that falls in this descriptor to a host pointer:
host = (Uint8*)ptr + offset + ((guest & ~disconnect) - start)
Any out-parameter may be NULL if not needed. The returned ptr and addrspace are owned by the context and remain valid until the core is unloaded; do not free them.
| lr | the libretro context. |
| index | the descriptor index, in [0, SDL_Libretro_GetMemoryMapCount()). |
| flags | receives the RETRO_MEMDESC_* flag bits, or NULL. |
| ptr | receives the host base pointer of the region, or NULL. |
| offset | receives the offset from ptr to the region start, or NULL. |
| start | receives the first emulated address mapped here, or NULL. |
| select | receives the address-decode select mask, or NULL. |
| disconnect | receives the disconnect (ignored-bits) mask, or NULL. |
| len | receives the region length in bytes, or NULL. |
| addrspace | receives the address-space label (may be NULL itself), or NULL. |
Definition at line 666 of file SDL_libretro_serialize.h.
References SDL_Libretro_IsGameReady().
| SDL_Libretro * SDL_Libretro_GetMenuLibretro | ( | const SDL_LibretroMenu * | menu | ) |
Gets the libretro context the menu was created for.
Handy inside an SDL_LibretroMenuCallback.
| menu | the menu to query. |
Definition at line 2485 of file SDL_libretro_menu.h.
| SDL_LibretroMenuStyle SDL_Libretro_GetMenuStyle | ( | const SDL_LibretroMenu * | menu | ) |
Gets the menu's active color theme.
| menu | the menu to query. |
Definition at line 2061 of file SDL_libretro_menu.h.
References SDL_LIBRETRO_MENU_DEFAULT_STYLE.
| void * SDL_Libretro_GetMenuUserData | ( | const SDL_LibretroMenu * | menu | ) |
Gets the data attached with SDL_Libretro_SetMenuUserData().
| menu | the menu to query. |
Definition at line 2513 of file SDL_libretro_menu.h.
| const char * SDL_Libretro_GetMessage | ( | SDL_Libretro * | lr | ) |
Gets the most relevant libretro message to display from the queue.
This is the highest priority message that has not yet expired. The string is owned by the context and stays valid until the message expires or is replaced.
| lr | the libretro context. |
Definition at line 153 of file SDL_libretro_messages.h.
Referenced by SDL_Libretro_UpdateMenu().
| bool SDL_Libretro_GetMessageByIndex | ( | SDL_Libretro * | lr, |
| int | index, | ||
| const char ** | msg, | ||
| int * | progress, | ||
| int * | type | ||
| ) |
Retrieves all message details for the given message index.
| lr | the libretro context. |
| index | the index of the message to retrieve, from 0 to SDL_Libretro_GetMessageCount() - 1. If negative, gets the most relevant message. |
| msg | a pointer filled in with the message string, owned by the context, or NULL. |
| progress | a pointer filled in with the progress percentage (0-100, or -1 for none), or NULL. |
| type | a pointer filled in with the message's enum retro_message_type, or NULL. |
Definition at line 221 of file SDL_libretro_messages.h.
| unsigned SDL_Libretro_GetMessageCount | ( | SDL_Libretro * | lr | ) |
Gets the number of messages currently in the queue.
Will expire any old messages to make sure the count is correct.
| lr | the libretro context. |
Definition at line 203 of file SDL_libretro_messages.h.
| int SDL_Libretro_GetMessageProgress | ( | SDL_Libretro * | lr | ) |
Gets the progress of the message returned by SDL_Libretro_GetMessage().
| lr | the libretro context. |
Definition at line 169 of file SDL_libretro_messages.h.
Referenced by SDL_Libretro_UpdateMenu().
| int SDL_Libretro_GetMessageType | ( | SDL_Libretro * | lr | ) |
Gets the type of the message returned by SDL_Libretro_GetMessage().
| lr | the libretro context. |
enum retro_message_type value, such as RETRO_MESSAGE_TYPE_NOTIFICATION or RETRO_MESSAGE_TYPE_PROGRESS; 0 (RETRO_MESSAGE_TYPE_NOTIFICATION) when there is no message.Definition at line 186 of file SDL_libretro_messages.h.
| unsigned SDL_Libretro_GetMousePort | ( | const SDL_Libretro * | lr | ) |
Get the controller port that the mouse drives.
NULL returns port 0.
| lr | the libretro context. |
Definition at line 881 of file SDL_libretro_input.h.
Referenced by SDL_Libretro_InitConfigFile().
| const SDL_LibretroOption * SDL_Libretro_GetOption | ( | const SDL_Libretro * | lr, |
| const char * | key | ||
| ) |
Retrieve details about a given core option.
The returned option is owned by the context and stays valid until the core is unloaded or registers more options.
| lr | the libretro context. |
| key | the option's key. |
Definition at line 265 of file SDL_libretro_options.h.
Referenced by SDL_Libretro_CycleOptionValue(), SDL_Libretro_GetOptionValue(), SDL_Libretro_GetOptionValueLabel(), SDL_Libretro_ResetOption(), and SDL_Libretro_SetOptionValue().
| const SDL_LibretroOption * SDL_Libretro_GetOptionByIndex | ( | const SDL_Libretro * | lr, |
| unsigned | index | ||
| ) |
Retrieve a core option by its registration index.
The returned option is owned by the context and stays valid until the core is unloaded or registers more options.
| lr | the libretro context. |
| index | the option index, from 0 to SDL_Libretro_GetOptionCount() - 1. |
Definition at line 287 of file SDL_libretro_options.h.
| unsigned SDL_Libretro_GetOptionCount | ( | const SDL_Libretro * | lr | ) |
Get the number of core options that have been set.
| lr | the libretro context. |
Definition at line 248 of file SDL_libretro_options.h.
| const char * SDL_Libretro_GetOptionValue | ( | SDL_Libretro * | lr, |
| const char * | key | ||
| ) |
Get a core option's current value.
The string is owned by the context and stays valid until the option's value changes.
| lr | the libretro context. |
| key | the option's key. |
Definition at line 347 of file SDL_libretro_options.h.
References SDL_Libretro_GetOption(), and SDL_LibretroOption::value.
| const char * SDL_Libretro_GetOptionValueLabel | ( | SDL_Libretro * | lr, |
| const char * | key | ||
| ) |
Get the human-readable label for a core option's current value.
Falls back to the raw value when the core supplied no label, like in core option variables API version 0 or 1.
| lr | the libretro context. |
| key | the option's key. |
Definition at line 365 of file SDL_libretro_options.h.
References SDL_LibretroOptionValue::label, SDL_Libretro_GetOption(), SDL_LibretroOptionValue::value, SDL_LibretroOption::value, SDL_LibretroOption::values, and SDL_LibretroOption::valuesCount.
| unsigned SDL_Libretro_GetPerformanceLevel | ( | const SDL_Libretro * | lr | ) |
Get the performance level the core requested via SET_PERFORMANCE_LEVEL.
| lr | the libretro context. |
Definition at line 2251 of file SDL_libretro_core.h.
| unsigned SDL_Libretro_GetPortDevice | ( | const SDL_Libretro * | lr, |
| unsigned | port | ||
| ) |
Get the device type assigned to a controller port.
Returns the RETRO_DEVICE_* type last set via SDL_Libretro_SetPortDevice(). Ports default to RETRO_DEVICE_JOYPAD, per libretro convention, until a device is explicitly assigned. Invalid arguments return RETRO_DEVICE_NONE.
| lr | the libretro context. |
| port | the controller port, at a max of SDL_LIBRETRO_MAX_USERS. |
Definition at line 784 of file SDL_libretro_input.h.
References SDL_LIBRETRO_MAX_USERS.
| SDL_Renderer * SDL_Libretro_GetRenderer | ( | const SDL_Libretro * | lr | ) |
Get the renderer the context draws into.
| lr | the libretro context. |
Definition at line 168 of file SDL_libretro_video.h.
| bool SDL_Libretro_GetRewindEnabled | ( | const SDL_Libretro * | lr | ) |
Check whether the rewind system is enabled (independent of current direction).
| lr | the libretro context. |
Definition at line 1265 of file SDL_libretro_serialize.h.
Referenced by SDL_Libretro_InitConfigFile().
| size_t SDL_Libretro_GetRewindMemoryLimit | ( | const SDL_Libretro * | lr | ) |
Get the current rewind memory budget in bytes (0 if unbounded).
| lr | the libretro context. |
Definition at line 1322 of file SDL_libretro_serialize.h.
Referenced by SDL_Libretro_InitConfigFile().
| size_t SDL_Libretro_GetRewindMemoryUsage | ( | const SDL_Libretro * | lr | ) |
Get the approximate memory currently held by the rewind buffer, in bytes.
Includes the encoded delta history plus the fixed reference/scratch buffers and the entry table. Useful for debug overlays and tuning the memory limit.
| lr | the libretro context. |
Definition at line 1290 of file SDL_libretro_serialize.h.
| double SDL_Libretro_GetRewindRemaining | ( | const SDL_Libretro * | lr | ) |
Calculates the amount of rewind time remaining in the buffer.
| lr | the libretro context. |
Definition at line 1275 of file SDL_libretro_serialize.h.
| int SDL_Libretro_GetRotation | ( | const SDL_Libretro * | lr | ) |
Gets the screen rotation requested by the core.
SDL_Libretro_Render() applies this rotation automatically.
| lr | the libretro context. |
Definition at line 393 of file SDL_libretro_video.h.
| double SDL_Libretro_GetSampleRate | ( | const SDL_Libretro * | lr | ) |
Get the audio sample rate the loaded core outputs at.
Reported by the core through retro_get_system_av_info() when the game loads, and updated by RETRO_ENVIRONMENT_SET_SYSTEM_AV_INFO.
| lr | the libretro context. |
Definition at line 346 of file SDL_libretro_audio.h.
References SDL_LIBRETRO_AUDIO_DEFAULT_SAMPLE_RATE.
| const char * SDL_Libretro_GetSaveDirectory | ( | SDL_Libretro * | lr | ) |
Get the save directory.
| lr | the libretro context. |
Definition at line 1995 of file SDL_libretro_core.h.
Referenced by SDL_Libretro_InitConfigFile().
| size_t SDL_Libretro_GetSavePath | ( | const SDL_Libretro * | lr, |
| const char * | extension, | ||
| char * | dst, | ||
| size_t | dstSize | ||
| ) |
Build a path in the save directory for the currently loaded content.
Produces "<saveDirectory>/<contentName><extension>" (or just "<contentName><extension>" when no save directory is set). Handy for deriving SRAM (".srm"), RTC (".rtc"), or save-state (".state") file names without hardcoding them.
| lr | the libretro context. |
| extension | the extension to append, including the dot (NULL or "" for none). |
| dst | the destination buffer (always null-terminated when dstSize > 0). |
| dstSize | the size of dst in bytes. |
Definition at line 428 of file SDL_libretro_core.h.
| enum retro_savestate_context SDL_Libretro_GetSavestateContext | ( | const SDL_Libretro * | lr | ) |
Get the savestate context reported to cores through RETRO_ENVIRONMENT_GET_SAVESTATE_CONTEXT.
| lr | the libretro context. |
Definition at line 2263 of file SDL_libretro_core.h.
| SDL_ScaleMode SDL_Libretro_GetScaleMode | ( | const SDL_Libretro * | lr | ) |
Gets the texture scale mode used when the libretro frame is scaled.
| lr | the libretro context. |
lr is NULL.Definition at line 462 of file SDL_libretro_video.h.
Referenced by SDL_Libretro_InitConfigFile().
| void SDL_Libretro_GetSize | ( | const SDL_Libretro * | lr, |
| int * | w, | ||
| int * | h | ||
| ) |
Gets the width and height of the core's current video frame.
| lr | the libretro context. |
| w | a pointer filled in with the frame width in pixels, or NULL; 0 when lr is NULL. |
| h | a pointer filled in with the frame height in pixels, or NULL; 0 when lr is NULL. |
Definition at line 358 of file SDL_libretro_video.h.
| float SDL_Libretro_GetSpeed | ( | const SDL_Libretro * | lr | ) |
Get how fast the game runs, as a multiple of its normal speed.
This includes a speed set by the core's fast-forward override.
| lr | the libretro context. |
Definition at line 2142 of file SDL_libretro_core.h.
| bool SDL_Libretro_GetSRAMAutoSave | ( | const SDL_Libretro * | lr | ) |
Check whether SRAM is loaded and saved along with the game.
| lr | the libretro context. |
Definition at line 905 of file SDL_libretro_serialize.h.
| size_t SDL_Libretro_GetStateSize | ( | const SDL_Libretro * | lr | ) |
Retrieves the size of serialized states.
| lr | the libretro context. |
Definition at line 431 of file SDL_libretro_serialize.h.
References SDL_Libretro_IsGameReady().
| const char * SDL_Libretro_GetSystemDirectory | ( | SDL_Libretro * | lr | ) |
Get the system directory.
| lr | the libretro context. |
Definition at line 2008 of file SDL_libretro_core.h.
Referenced by SDL_Libretro_InitConfigFile().
| SDL_Texture * SDL_Libretro_GetTexture | ( | const SDL_Libretro * | lr | ) |
Get the streaming texture that holds the core's most recent video frame.
The texture is owned by the libretro context; do not destroy it. It is recreated when the core's frame size changes, the renderer changes, or a new game is loaded, so fetch it again rather than caching the pointer.
| lr | the libretro context. |
Definition at line 185 of file SDL_libretro_video.h.
| const char * SDL_Libretro_GetUsername | ( | SDL_Libretro * | lr | ) |
Get the username reported to cores.
| lr | the libretro context. |
Definition at line 2051 of file SDL_libretro_core.h.
Referenced by SDL_Libretro_InitConfigFile().
| const char * SDL_Libretro_GetValidExtensions | ( | const SDL_Libretro * | lr | ) |
Gets the default set of valid extensions associated with the core, seperated by a "|".
| lr | the libretro context. |
Definition at line 2239 of file SDL_libretro_core.h.
References SDL_Libretro_IsCoreReady().
| int SDL_Libretro_GetVersion | ( | void | ) |
Get the version of SDL_libretro the implementation was compiled with.
Definition at line 1647 of file SDL_libretro_core.h.
References SDL_LIBRETRO_VERSION.
| float SDL_Libretro_GetVolume | ( | const SDL_Libretro * | lr | ) |
Get the audio volume.
| lr | the libretro context. |
Definition at line 2082 of file SDL_libretro_core.h.
Referenced by SDL_Libretro_InitConfigFile().
| void SDL_Libretro_HandleEvent | ( | SDL_Libretro * | lr, |
| const SDL_Event * | event | ||
| ) |
Call this function within the SDL_PollEvent() loop to ensure libretro knows of important events.
Tracks the mouse, opens and closes gamepads as they're connected, and forwards keyboard events to cores that listen for them.
| lr | the libretro context. |
| event | the event to handle. |
Definition at line 663 of file SDL_libretro_input.h.
References SDL_LIBRETRO_MAX_USERS.
| bool SDL_Libretro_HandleMenuEvent | ( | SDL_LibretroMenu * | menu, |
| const SDL_Event * | event | ||
| ) |
Routes an event to the menu; call this for every event, before SDL_Libretro_HandleEvent().
The toggle key (SDL_LIBRETRO_MENU_TOGGLE_KEY) and the gamepad Guide button flip the menu open or closed, and are always consumed. Gamepad connection changes are tracked even while the menu is closed.
| menu | the menu to feed. |
| event | the event to handle; it is not modified. |
Definition at line 2598 of file SDL_libretro_menu.h.
References SDL_LIBRETRO_MENU_TOGGLE_KEY, and SDL_Libretro_ToggleMenu().
| bool SDL_Libretro_InitConfig | ( | SDL_Libretro * | lr, |
| const char * | org, | ||
| const char * | app | ||
| ) |
Sets up the config file to be the default path, accoring to the organization and app name.
The file is "<app>.cfg" inside SDL_GetPrefPath(org, app). Any previously initialized config is discarded without being saved.
| lr | the libretro context. |
| org | the organization name, or NULL/empty for "SDL_libretro". |
| app | the application name, or NULL/empty for "SDL_libretro". |
Definition at line 168 of file SDL_libretro_config.h.
References SDL_Libretro_InitConfigFile().
| bool SDL_Libretro_InitConfigFile | ( | SDL_Libretro * | lr, |
| const char * | file | ||
| ) |
Initializes the config system based on the given file.
Will load the configuration from the file, and save it when destroying the instance. A missing file is not an error: it starts out empty and is created on save. A file that exists but can't be read or parsed is left untouched, and no config is set up, so it isn't overwritten with defaults. Any previously initialized config is discarded without being saved.
| lr | the libretro context. |
| file | the path of the .ini file to load from and save to. The string is copied. |
Definition at line 39 of file SDL_libretro_config.h.
References SDL_LIBRETRO_ANALOG_TO_DIGITAL_COUNT, SDL_Libretro_GetAudioLatency(), SDL_Libretro_GetCoreAssetsDirectory(), SDL_Libretro_GetCoreDirectory(), SDL_Libretro_GetFitMode(), SDL_Libretro_GetMousePort(), SDL_Libretro_GetRewindEnabled(), SDL_Libretro_GetRewindMemoryLimit(), SDL_Libretro_GetSaveDirectory(), SDL_Libretro_GetScaleMode(), SDL_Libretro_GetSystemDirectory(), SDL_Libretro_GetUsername(), SDL_Libretro_GetVolume(), SDL_LIBRETRO_MAX_USERS, SDL_Libretro_SetAnalogToDigital(), SDL_Libretro_SetAudioLatency(), SDL_Libretro_SetCoreAssetsDirectory(), SDL_Libretro_SetCoreDirectory(), SDL_Libretro_SetFitMode(), SDL_Libretro_SetGamepadMapping(), SDL_Libretro_SetKeyboardMapping(), SDL_Libretro_SetLanguage(), SDL_Libretro_SetMousePort(), SDL_Libretro_SetRewindEnabled(), SDL_Libretro_SetRewindMemoryLimit(), SDL_Libretro_SetSaveDirectory(), SDL_Libretro_SetScaleMode(), SDL_Libretro_SetSystemDirectory(), SDL_Libretro_SetUsername(), and SDL_Libretro_SetVolume().
Referenced by SDL_Libretro_InitConfig().
| bool SDL_Libretro_InsertDisk | ( | SDL_Libretro * | lr | ) |
Closes the disk tray after a disk change.
| lr | The libretro instance. |
Definition at line 148 of file SDL_libretro_serialize.h.
References SDL_Libretro_IsGameReady().
| bool SDL_Libretro_IsCoreReady | ( | const SDL_Libretro * | lr | ) |
Indicates whether a core is loaded.
| lr | the libretro context. |
Definition at line 373 of file SDL_libretro_core.h.
Referenced by SDL_Libretro_GetBlockExtract(), SDL_Libretro_GetCoreName(), SDL_Libretro_GetCoreVersion(), SDL_Libretro_GetInputDescriptor(), SDL_Libretro_GetInputDescriptorCount(), SDL_Libretro_GetValidExtensions(), SDL_Libretro_LoadGame_IO(), SDL_Libretro_LoadGameSpecialById(), SDL_Libretro_PhysFS_LoadGame(), SDL_Libretro_SetPortDevice(), SDL_Libretro_SetRewindMemoryDuration(), and SDL_Libretro_UnloadCore().
| bool SDL_Libretro_IsFastforwardOverrideActive | ( | const SDL_Libretro * | lr | ) |
Indicates whether the core is forcing fast-forward through RETRO_ENVIRONMENT_SET_FASTFORWARDING_OVERRIDE.
While active, the core controls the speed; if it also inhibits toggling, SDL_Libretro_SetSpeed() is ignored.
| lr | the libretro context. |
Definition at line 2157 of file SDL_libretro_core.h.
| bool SDL_Libretro_IsGameReady | ( | const SDL_Libretro * | lr | ) |
Indicates whether a game is loaded and running.
This is also true for a core started without content.
| lr | the libretro context. |
Definition at line 1383 of file SDL_libretro_core.h.
Referenced by SDL_Libretro_AddDiskImage(), SDL_Libretro_AddDiskImage_IO(), SDL_Libretro_EjectDisk(), SDL_Libretro_GetDiskCount(), SDL_Libretro_GetDiskIndex(), SDL_Libretro_GetDiskLabel(), SDL_Libretro_GetGameName(), SDL_Libretro_GetMapAddress(), SDL_Libretro_GetMemoryData(), SDL_Libretro_GetMemoryMapCount(), SDL_Libretro_GetMemoryMapDescriptor(), SDL_Libretro_GetStateSize(), SDL_Libretro_InsertDisk(), SDL_Libretro_LoadState(), SDL_Libretro_LoadState_IO(), SDL_Libretro_ResetCheats(), SDL_Libretro_SaveState(), SDL_Libretro_SaveState_IO(), SDL_Libretro_SetCheat(), SDL_Libretro_SetDiskIndex(), SDL_Libretro_SetRewindEnabled(), and SDL_Libretro_UpdateMenu().
| bool SDL_Libretro_IsGameRequired | ( | const SDL_Libretro * | lr | ) |
Indicates whether the loaded core needs content to run.
Cores opt into running without content with RETRO_ENVIRONMENT_SET_SUPPORT_NO_GAME, after which SDL_Libretro_LoadGame() accepts a NULL path. The core's own report is used rather than the supports_no_game flag in its .info file.
| lr | the libretro context. |
Definition at line 1400 of file SDL_libretro_core.h.
| bool SDL_Libretro_IsMenuOpen | ( | const SDL_LibretroMenu * | menu | ) |
Checks whether the menu is currently shown.
While it is open, the application should skip SDL_Libretro_Update() so the game stays paused.
| menu | the menu to query. |
Definition at line 2470 of file SDL_libretro_menu.h.
| bool SDL_Libretro_LoadCore | ( | SDL_Libretro * | lr, |
| const char * | core | ||
| ) |
Loads a libretro core.
Only one core may be loaded at a time, as the library keeps a single global active context, and the API is not thread-safe; call it from the main SDL thread.
| lr | the libretro context. |
| core | Either the path to the core to load, or a name of the core within the core directory. |
Definition at line 210 of file SDL_libretro_core.h.
References LOAD_SYM, SDL_EVENT_LIBRETRO_CORE_LOADED, and SDL_Libretro_UnloadCore().
Referenced by SDL_Libretro_PhysFS_LoadGame().
| bool SDL_Libretro_LoadGame | ( | SDL_Libretro * | lr, |
| const char * | gamePath | ||
| ) |
Loads a game at the given path.
When SDL_LIBRETRO_ENABLE_PHYSFS is enabled, a .zip path is routed through SDL_Libretro_PhysFS_LoadGame() automatically.
Pass a NULL gamePath to start the loaded core without content. This only works for cores that report RETRO_ENVIRONMENT_SET_SUPPORT_NO_GAME (see SDL_Libretro_IsGameRequired()); otherwise it fails and SDL_GetError() says the core requires content. A core must already be loaded, as there is no extension to pick one by.
| lr | the libretro context. |
| gamePath | the path of the content to load, or NULL for no content. |
Definition at line 987 of file SDL_libretro_core.h.
References SDL_Libretro_PhysFS_LoadGame().
| bool SDL_Libretro_LoadGame_IO | ( | SDL_Libretro * | lr, |
| SDL_IOStream * | src, | ||
| const char * | path, | ||
| bool | closeio | ||
| ) |
Loads a game from an SDL_IOStream.
Stream content into memory, and hand it to the core. The path only provides the content identity (name, extension, save path, etc). When the core requires a full path (need_fullpath), the stream is saved to a temp directory ("<save directory>/tmp") and loaded from there, while the content keeps the identity of path. The file is removed when the game unloads.
| lr | the libretro context. |
| src | the stream to read the content from. |
| path | the path the content is known by. Could be a virtual path if the loading from an archive. |
| closeio | if true, close src before returning, even on failure. |
Definition at line 1131 of file SDL_libretro_core.h.
References SDL_Libretro_IsCoreReady().
Referenced by SDL_Libretro_PhysFS_LoadGame().
| bool SDL_Libretro_LoadGameSpecial | ( | SDL_Libretro * | lr, |
| const char * | subsystem, | ||
| const char ** | paths, | ||
| unsigned | numPaths | ||
| ) |
Loads multi-ROM subsystem content (e.g.
Super Game Boy, Sufami Turbo).
The subsystem is chosen by matching subsystem against each registered subsystem's ident or human-readable description. The paths map positionally to that subsystem's ROMs; each ROM whose descriptor sets need_fullpath is passed by path, otherwise the file is read into memory and handed to the core.
| lr | the libretro instance. |
| subsystem | the subsystem ident or description to load. |
| paths | the content file paths, one per ROM the subsystem expects. |
| numPaths | the number of entries in paths; must be greater than 0. |
Definition at line 1330 of file SDL_libretro_core.h.
References SDL_Libretro_LoadGameSpecialById().
| bool SDL_Libretro_LoadGameSpecialById | ( | SDL_Libretro * | lr, |
| unsigned | subsystemId, | ||
| const char ** | paths, | ||
| unsigned | numPaths | ||
| ) |
Load multi-ROM subsystem content by its numeric subsystem id.
Equivalent to SDL_Libretro_LoadGameSpecial() but selects the subsystem by the id the core assigned it rather than by ident or description.
| lr | the libretro instance. |
| subsystemId | the id of the subsystem to load. |
| paths | the content file paths, one per ROM the subsystem expects. |
| numPaths | the number of entries in paths; must be greater than 0. |
Definition at line 1189 of file SDL_libretro_core.h.
References SDL_Libretro_IsCoreReady(), and SDL_Libretro_UnloadGame().
Referenced by SDL_Libretro_LoadGameSpecial().
| bool SDL_Libretro_LoadMemory | ( | SDL_Libretro * | lr, |
| unsigned | memoryType, | ||
| const char * | file | ||
| ) |
Load a core memory region from a file.
Convenience wrapper over SDL_Libretro_LoadMemory_IO().
| lr | the libretro context. |
| memoryType | one of the RETRO_MEMORY_* constants. |
| file | the source file path. |
Definition at line 862 of file SDL_libretro_serialize.h.
References SDL_Libretro_LoadMemory_IO().
Referenced by SDL_Libretro_LoadSRAM().
| bool SDL_Libretro_LoadMemory_IO | ( | SDL_Libretro * | lr, |
| unsigned | memoryType, | ||
| SDL_IOStream * | src, | ||
| bool | closeio | ||
| ) |
Load a core memory region from a stream.
Copies stream contents into the live memory region for the given type. When the stream and the region differ in size, only the overlapping bytes are copied, so a save from a slightly different revision still loads what it can.
| lr | the libretro context. |
| memoryType | one of the RETRO_MEMORY_* constants. |
| src | the source stream. |
| closeio | if true, close src before returning (even on failure). |
Definition at line 822 of file SDL_libretro_serialize.h.
References SDL_Libretro_GetMemoryData(), and SDL_Libretro_SetMemoryData().
Referenced by SDL_Libretro_LoadMemory(), and SDL_Libretro_LoadSRAM_IO().
| bool SDL_Libretro_LoadSRAM | ( | SDL_Libretro * | lr, |
| const char * | file | ||
| ) |
Loads the SRAM from the given file.
Shorthand for SDL_Libretro_LoadMemory() with RETRO_MEMORY_SAVE_RAM.
| lr | the libretro context. |
| file | the source file path. |
Definition at line 991 of file SDL_libretro_serialize.h.
References SDL_Libretro_LoadMemory().
| bool SDL_Libretro_LoadSRAM_IO | ( | SDL_Libretro * | lr, |
| SDL_IOStream * | src, | ||
| bool | closeio | ||
| ) |
Load the core's battery-backed save RAM from a stream.
Shorthand for SDL_Libretro_LoadMemory_IO() with RETRO_MEMORY_SAVE_RAM.
| lr | the libretro context. |
| src | the source stream. |
| closeio | if true, close src before returning (even on failure). |
Definition at line 976 of file SDL_libretro_serialize.h.
References SDL_Libretro_LoadMemory_IO().
| bool SDL_Libretro_LoadState | ( | SDL_Libretro * | lr, |
| const char * | file | ||
| ) |
Loads the libretro state from the given file.
| lr | the libretro context. |
| file | the source file path. |
Definition at line 549 of file SDL_libretro_serialize.h.
References SDL_Libretro_IsGameReady(), and SDL_Libretro_LoadState_IO().
| bool SDL_Libretro_LoadState_IO | ( | SDL_Libretro * | lr, |
| SDL_IOStream * | src, | ||
| bool | closeio | ||
| ) |
Load a libretro state from the given SDL_IOStream.
Reads the whole stream and hands it to the core. A successful load clears the rewind history, since it can't be rewound across.
| lr | the libretro context. |
| src | the source stream. |
| closeio | if true, close src before returning (even on failure). |
Definition at line 514 of file SDL_libretro_serialize.h.
References SDL_Libretro_IsGameReady().
Referenced by SDL_Libretro_LoadState().
| void SDL_Libretro_MenuScreenshotClicked | ( | SDL_LibretroMenu * | menu, |
| void * | userdata | ||
| ) |
A ready-made menu callback that saves a PNG screenshot of the current frame, reporting the result in the menu.
Pass it to SDL_Libretro_AddMenuButton(). The menu's own Screenshot entry uses it too.
| menu | the menu the callback fired for. NULL is ignored. |
| userdata | the destination path as a const char*, or NULL for "screenshot.png". |
Definition at line 462 of file SDL_libretro_menu.h.
References SDL_Libretro_SaveScreenshot().
| bool SDL_Libretro_OpenMenuPath | ( | SDL_LibretroMenu * | menu, |
| const char * | path | ||
| ) |
Opens the menu and navigates to a page by its slash-separated label path, e.g.
"Settings/Audio & Video", "Settings/Core Options" or "Disks".
The pages built from the loaded core are refreshed first, so their paths resolve before the next frame.
| menu | the menu to navigate. |
| path | the label path of the page to show. |
Definition at line 2725 of file SDL_libretro_menu.h.
References SDL_Libretro_SetMenuOpen().
| bool SDL_Libretro_PhysFS_Init | ( | SDL_Libretro * | lr | ) |
Initialize PhysFS and route the libretro VFS through it.
This will be called automatically in SDL_Libretro_PhysFS_LoadGame() if PhysFS was not initialized. Cores can then read content directly from the mounted archive through the VFS, with anything outside PhysFS falling through to the SDL VFS. Safe to call repeatedly.
Requires the implementation to be compiled with SDL_LIBRETRO_ENABLE_PHYSFS; otherwise it always fails.
| lr | the libretro context to install the VFS overrides on. |
Definition at line 178 of file SDL_libretro_physfs.h.
References SDL_Libretro_SetVFS().
Referenced by SDL_Libretro_PhysFS_LoadGame().
| bool SDL_Libretro_PhysFS_LoadGame | ( | SDL_Libretro * | lr, |
| const char * | gamePath | ||
| ) |
Archive-aware replacement for SDL_Libretro_LoadGame().
Content that isn't a .zip loads exactly like SDL_Libretro_LoadGame(). For a .zip, the archive is mounted with PhysFS and the content inside is handed to the core: as a data buffer for byte-oriented cores, or by its virtual path in a PhysFS-backed VFS for full-path cores that use the libretro VFS. Full-path cores that read files from the OS get the whole archive extracted to a temp directory instead, so content like a .cue sheet finds its tracks; it's removed when the game unloads.
The raw .zip is handed over unextracted instead when the loaded core reports block_extract or lists "zip" in its valid extensions, or, with no core loaded, when the first core in the library that lists "zip" sets block_extract in its .info file.
Any running game is unloaded and any previous archive unmounted first. PhysFS is initialized on demand; if that or mounting the archive fails, the .zip falls back to a plain SDL_Libretro_LoadGame()-style load. Without a loaded core, the core is picked from the library based on the chosen content file.
SDL_Libretro_LoadGame() will call this automatically when loading an archive, so there is no need to call it directly. Requires the implementation to be compiled with SDL_LIBRETRO_ENABLE_PHYSFS; otherwise it always fails.
| lr | the libretro context. |
| gamePath | the OS path of the content or archive. May be NULL for a content-less core load. |
Definition at line 470 of file SDL_libretro_physfs.h.
References SDL_Libretro_IsCoreReady(), SDL_Libretro_LoadCore(), SDL_Libretro_LoadGame_IO(), SDL_Libretro_PhysFS_Init(), SDL_LIBRETRO_PHYSFS_MOUNT_POINT, and SDL_Libretro_UnloadGame().
Referenced by SDL_Libretro_LoadGame().
| void SDL_Libretro_PhysFS_Quit | ( | SDL_Libretro * | lr | ) |
Tear down PhysFS, unmounting any active archive and restoring the plain SDL VFS on the given context.
Unload the game first, since a game loaded from an archive still reads from the mount. Safe to call when PhysFS was never initialized.
| lr | the libretro context. NULL is ignored. |
Definition at line 208 of file SDL_libretro_physfs.h.
References SDL_Libretro_SetVFS().
Referenced by SDL_Libretro_Destroy().
| bool SDL_Libretro_Render | ( | SDL_Libretro * | lr, |
| SDL_Renderer * | renderer, | ||
| const SDL_FRect * | dstRect | ||
| ) |
Render the libretro context in the given renderer.
| lr | the libretro context. |
| renderer | the renderer to draw into; must not be NULL. |
| dstRect | the destination rectangle, or NULL to fit within the renderer's logical size, or its current output size when logical presentation is disabled. |
Definition at line 304 of file SDL_libretro_video.h.
References SDL_Libretro_SetRenderer().
| void SDL_Libretro_RenderMenu | ( | SDL_LibretroMenu * | menu | ) |
Draws the menu laid out by SDL_Libretro_UpdateMenu() to the renderer.
Call once per frame, after SDL_Libretro_UpdateMenu() and before SDL_RenderPresent(). Draws nothing while the menu is closed, but must still be called every frame so input is collected for the next one.
| menu | the menu to draw. NULL is ignored. |
Definition at line 2848 of file SDL_libretro_menu.h.
| bool SDL_Libretro_Reset | ( | SDL_Libretro * | lr | ) |
Resets the loaded game, like pressing the console's reset button.
Also clears the rewind buffer and any queued audio.
| lr | the libretro context. |
Definition at line 1412 of file SDL_libretro_core.h.
| void SDL_Libretro_ResetAllOptions | ( | SDL_Libretro * | lr | ) |
Reset every core option to its default value.
| lr | the libretro context. |
Definition at line 447 of file SDL_libretro_options.h.
References SDL_LibretroOption::defaultValue, and SDL_LibretroOption::value.
| void SDL_Libretro_ResetCheats | ( | SDL_Libretro * | lr | ) |
Clears all cheats that were set on the core.
Does nothing when no game is loaded.
| lr | the libretro context. |
Definition at line 418 of file SDL_libretro_serialize.h.
References SDL_Libretro_IsGameReady().
| bool SDL_Libretro_ResetOption | ( | SDL_Libretro * | lr, |
| const char * | key | ||
| ) |
Reset a core option to its default value.
| lr | the libretro context. |
| key | the key to revert to the default value. |
Definition at line 424 of file SDL_libretro_options.h.
References SDL_LibretroOption::defaultValue, SDL_Libretro_GetOption(), and SDL_LibretroOption::value.
| bool SDL_Libretro_SaveMemory | ( | SDL_Libretro * | lr, |
| unsigned | memoryType, | ||
| const char * | file | ||
| ) |
Write a core memory region to a file.
Convenience wrapper over SDL_Libretro_SaveMemory_IO(). No file is created when the core exposes no such memory region.
| lr | the libretro context. |
| memoryType | one of the RETRO_MEMORY_* constants. |
| file | the destination file path. |
Definition at line 787 of file SDL_libretro_serialize.h.
References SDL_Libretro_GetMemoryData(), and SDL_Libretro_SaveMemory_IO().
Referenced by SDL_Libretro_SaveSRAM().
| bool SDL_Libretro_SaveMemory_IO | ( | SDL_Libretro * | lr, |
| unsigned | memoryType, | ||
| SDL_IOStream * | dst, | ||
| bool | closeio | ||
| ) |
Write a core memory region to a stream.
Persists the live contents of the given libretro memory type (e.g. RETRO_MEMORY_SAVE_RAM for battery saves, RETRO_MEMORY_RTC for a real-time clock). A core that exposes no such region is treated as success with nothing written, so callers don't have to special-case it.
| lr | the libretro context. |
| memoryType | one of the RETRO_MEMORY_* constants. |
| dst | the destination stream. |
| closeio | if true, close dst before returning (even on failure). |
Definition at line 757 of file SDL_libretro_serialize.h.
References SDL_Libretro_GetMemoryData().
Referenced by SDL_Libretro_SaveMemory(), and SDL_Libretro_SaveSRAM_IO().
| bool SDL_Libretro_SaveScreenshot | ( | const SDL_Libretro * | lr, |
| const char * | path | ||
| ) |
Saves a PNG screenshot of the current frame.
| lr | the libretro context. |
| path | the destination file, or NULL for "screenshot.png". |
Definition at line 236 of file SDL_libretro_video.h.
References SDL_Libretro_CreateSurface().
Referenced by SDL_Libretro_MenuScreenshotClicked().
| bool SDL_Libretro_SaveSRAM | ( | SDL_Libretro * | lr, |
| const char * | file | ||
| ) |
Saves the current SRAM to the given file.
Shorthand for SDL_Libretro_SaveMemory() with RETRO_MEMORY_SAVE_RAM. No file is created when the core has no save RAM.
| lr | the libretro context. |
| file | the destination file path. |
Definition at line 960 of file SDL_libretro_serialize.h.
References SDL_Libretro_SaveMemory().
| bool SDL_Libretro_SaveSRAM_IO | ( | SDL_Libretro * | lr, |
| SDL_IOStream * | dst, | ||
| bool | closeio | ||
| ) |
Write the core's battery-backed save RAM to a stream.
Shorthand for SDL_Libretro_SaveMemory_IO() with RETRO_MEMORY_SAVE_RAM.
| lr | the libretro context. |
| dst | the destination stream. |
| closeio | if true, close dst before returning (even on failure). |
Definition at line 945 of file SDL_libretro_serialize.h.
References SDL_Libretro_SaveMemory_IO().
| bool SDL_Libretro_SaveState | ( | SDL_Libretro * | lr, |
| const char * | file | ||
| ) |
Saves the current libretro state to a file.
| lr | the libretro context. |
| file | the destination file path. |
Definition at line 488 of file SDL_libretro_serialize.h.
References SDL_Libretro_IsGameReady(), and SDL_Libretro_SaveState_IO().
| bool SDL_Libretro_SaveState_IO | ( | SDL_Libretro * | lr, |
| SDL_IOStream * | dst, | ||
| bool | closeio | ||
| ) |
Save the current libretro state to the given SDL_IOStream.
| lr | the libretro context. |
| dst | the destination stream. |
| closeio | if true, close dst before returning (even on failure). |
Definition at line 447 of file SDL_libretro_serialize.h.
References SDL_Libretro_IsGameReady().
Referenced by SDL_Libretro_SaveState().
| void SDL_Libretro_SetAnalogToDigital | ( | SDL_Libretro * | lr, |
| unsigned | port, | ||
| SDL_LibretroAnalogToDigital | stick | ||
| ) |
Selects which analog stick, if any, also registers D-Pad presses on the given controller port, alongside the physical D-Pad.
| lr | the libretro context. |
| port | the controller port, at a max of SDL_LIBRETRO_MAX_USERS. |
| stick | the stick that drives the D-Pad, or SDL_LIBRETRO_ANALOG_TO_DIGITAL_NONE for the D-Pad alone. |
Definition at line 835 of file SDL_libretro_input.h.
References SDL_LIBRETRO_ANALOG_TO_DIGITAL_COUNT, and SDL_LIBRETRO_MAX_USERS.
Referenced by SDL_Libretro_InitConfigFile().
| void SDL_Libretro_SetAudioLatency | ( | SDL_Libretro * | lr, |
| unsigned | latencyMs | ||
| ) |
Set the desired minimum audio latency for the audio stream.
The setting carries across cores. A core asking for more latency through RETRO_ENVIRONMENT_SET_MINIMUM_AUDIO_LATENCY raises the latency in effect while it's loaded, without changing this setting.
| lr | the libretro context. |
| latencyMs | the minimum latency in milliseconds, or 0 for SDL_LIBRETRO_AUDIO_DEFAULT_LATENCY_MS. |
Definition at line 314 of file SDL_libretro_audio.h.
Referenced by SDL_Libretro_InitConfigFile().
| bool SDL_Libretro_SetCheat | ( | SDL_Libretro * | lr, |
| unsigned | index, | ||
| bool | enabled, | ||
| const char * | code | ||
| ) |
Set a cheat code either enabled or disabled within the libretro context.
Requires a loaded game. The code's format is specific to the core.
| lr | the libretro context. |
| index | the cheat slot to set. |
| enabled | true to enable the cheat, false to disable it. |
| code | the cheat code; must not be NULL. |
code is NULL.Definition at line 400 of file SDL_libretro_serialize.h.
References SDL_Libretro_IsGameReady().
| bool SDL_Libretro_SetCoreAssetsDirectory | ( | SDL_Libretro * | lr, |
| const char * | path | ||
| ) |
Sets where cores look for their assets, reported through RETRO_ENVIRONMENT_GET_CORE_ASSETS_DIRECTORY.
| lr | the libretro context. |
| path | the core assets directory, or NULL/empty for none. The string is copied. |
Definition at line 1968 of file SDL_libretro_core.h.
Referenced by SDL_Libretro_InitConfigFile().
| bool SDL_Libretro_SetCoreDirectory | ( | SDL_Libretro * | lr, |
| const char * | path | ||
| ) |
Sets the associated libretro core directory, where the default set of cores will be loaded from.
The discovered cores are sorted by case-insensitive core name, then by path, so lookups that take the first match (such as picking a core for a game's extension) behave the same on every machine.
The path is stored even when it can't be scanned, so it can still be shown or saved.
| lr | the libretro context. |
| path | the core directory, or NULL/empty to clear it. |
Definition at line 1844 of file SDL_libretro_core.h.
Referenced by SDL_Libretro_InitConfigFile().
| bool SDL_Libretro_SetDiskIndex | ( | SDL_Libretro * | lr, |
| unsigned | index | ||
| ) |
Sets the disk image index to insert into the emulated drive.
The disk tray must be ejected before calling this function.
| lr | The libretro instance. |
| index | The zero-based disk image index. |
Definition at line 116 of file SDL_libretro_serialize.h.
References SDL_Libretro_IsGameReady().
| bool SDL_Libretro_SetFitMode | ( | SDL_Libretro * | lr, |
| SDL_LibretroFitMode | mode | ||
| ) |
Sets how the frame is fit into the destination rectangle when rendered.
| lr | the libretro context. |
| mode | the fit mode to use. |
Definition at line 407 of file SDL_libretro_video.h.
References SDL_LIBRETRO_FIT_COUNT, and SDL_LIBRETRO_FIT_FIRST.
Referenced by SDL_Libretro_InitConfigFile().
| void SDL_Libretro_SetGamepadMapping | ( | SDL_Libretro * | lr, |
| unsigned | port, | ||
| int | retroButton, | ||
| SDL_GamepadButton | button | ||
| ) |
Maps an SDL gamepad button to a RETRO_DEVICE_ID_JOYPAD_* button on the given controller port.
The L2/R2 trigger axes keep working alongside any button bound to them.
| lr | the libretro context. |
| port | the controller port, at a max of SDL_LIBRETRO_MAX_USERS. |
| retroButton | the RETRO_DEVICE_ID_JOYPAD_* button to rebind. |
| button | the SDL button that presses it. |
Definition at line 816 of file SDL_libretro_input.h.
References SDL_LIBRETRO_MAX_USERS.
Referenced by SDL_Libretro_InitConfigFile().
| bool SDL_Libretro_SetInitialDisk | ( | SDL_Libretro * | lr, |
| unsigned | index, | ||
| const char * | path | ||
| ) |
Sets the disk image to insert once content is loaded.
This must be called before the game is loaded so the core can restore the correct disk, like a M3U playlist, or a save state.
| lr | The libretro instance. |
| index | The zero-based disk image index. |
| path | File path of the expected disk image, used by the core to verify the index. |
Definition at line 373 of file SDL_libretro_serialize.h.
| void SDL_Libretro_SetKeyboardMapping | ( | SDL_Libretro * | lr, |
| int | retroButton, | ||
| SDL_Scancode | scancode | ||
| ) |
Maps a keyboard key to a RETRO_DEVICE_ID_JOYPAD_* button for Player 1 (controller port 0).
The key works alongside any gamepad on that port. Invalid arguments are ignored.
| lr | the libretro context. |
| retroButton | the RETRO_DEVICE_ID_JOYPAD_* button to rebind, from RETRO_DEVICE_ID_JOYPAD_B to RETRO_DEVICE_ID_JOYPAD_R3. |
| scancode | the physical key that presses it, or SDL_SCANCODE_UNKNOWN to unbind the button. |
Definition at line 801 of file SDL_libretro_input.h.
Referenced by SDL_Libretro_InitConfigFile().
| void SDL_Libretro_SetLanguage | ( | SDL_Libretro * | lr, |
| int | language | ||
| ) |
Override the language reported to cores through RETRO_ENVIRONMENT_GET_LANGUAGE.
By default the language is detected from the first of SDL_GetPreferredLocales(), falling back to RETRO_LANGUAGE_ENGLISH. Cores usually query the language while loading, so set it before SDL_Libretro_LoadCore().
| lr | The SDL_Libretro context. |
| language | A RETRO_LANGUAGE_* value. A negative value, or RETRO_LANGUAGE_LAST and above, drops the override and goes back to detecting it from the system locale. |
Definition at line 318 of file SDL_libretro_env.h.
Referenced by SDL_Libretro_Create(), and SDL_Libretro_InitConfigFile().
| void SDL_Libretro_SetLogLevel | ( | SDL_Libretro * | lr, |
| SDL_LogPriority | level | ||
| ) |
Sets the threshold for logs to be posted.
| lr | the libretro context. |
| level | the minimum priority of core log messages to post. Priorities below SDL_LOG_PRIORITY_INFO (and unknown ones) post everything from debug up; SDL_LOG_PRIORITY_CRITICAL behaves like SDL_LOG_PRIORITY_ERROR. |
Definition at line 2170 of file SDL_libretro_core.h.
| bool SDL_Libretro_SetMemoryData | ( | SDL_Libretro * | lr, |
| unsigned | memoryType, | ||
| const void * | data, | ||
| size_t | size | ||
| ) |
Overwrite a core memory region with caller-provided bytes.
Copies up to the region's capacity; any extra bytes are ignored. Writes to the core's live memory, so it must not race SDL_Libretro_Update().
| lr | the libretro context. |
| memoryType | one of the RETRO_MEMORY_* constants. |
| data | the source bytes. |
| size | the number of bytes available in data. |
Definition at line 596 of file SDL_libretro_serialize.h.
References SDL_Libretro_GetMemoryData().
Referenced by SDL_Libretro_LoadMemory_IO().
| void SDL_Libretro_SetMenuOpen | ( | SDL_LibretroMenu * | menu, |
| bool | open | ||
| ) |
Opens or closes the menu.
When the state changes, pushes SDL_EVENT_LIBRETRO_MENU_OPENED or SDL_EVENT_LIBRETRO_MENU_CLOSED with the menu in data2, and closing stops text input on the window. Setting the current state again does nothing. Note that SDL_Libretro_UpdateMenu() reopens the menu while no game is running.
| menu | the menu to update. NULL is ignored. |
| open | true to show the menu, false to hide it. |
Definition at line 2532 of file SDL_libretro_menu.h.
References SDL_EVENT_LIBRETRO_MENU_CLOSED, and SDL_EVENT_LIBRETRO_MENU_OPENED.
Referenced by SDL_Libretro_OpenMenuPath(), SDL_Libretro_ToggleMenu(), and SDL_Libretro_UpdateMenu().
| bool SDL_Libretro_SetMenuStyle | ( | SDL_LibretroMenu * | menu, |
| SDL_LibretroMenuStyle | style | ||
| ) |
Applies a color theme to the menu.
The choice is saved to the config with the other menu settings, and restored by SDL_Libretro_CreateMenu(). The initial style is SDL_LIBRETRO_MENU_DEFAULT_STYLE.
| menu | the menu to style. |
| style | the theme; must be below SDL_LIBRETRO_MENU_STYLE_COUNT. |
Definition at line 2034 of file SDL_libretro_menu.h.
References SDL_LIBRETRO_MENU_STYLE_COUNT.
| void SDL_Libretro_SetMenuUserData | ( | SDL_LibretroMenu * | menu, |
| void * | userData | ||
| ) |
Attaches generic application data to the menu.
The menu never reads or frees it.
| menu | the menu to update. NULL is ignored. |
| userData | the data to store, or NULL to clear it. |
Definition at line 2499 of file SDL_libretro_menu.h.
| void SDL_Libretro_SetMessage | ( | SDL_Libretro * | lr, |
| const char * | msg, | ||
| double | duration | ||
| ) |
Add a message to be displayed within the libretro context.
The message is copied. Setting a message that is already queued refreshes its duration instead of adding a duplicate.
| lr | the libretro context. |
| msg | the message to display, or NULL or an empty string to clear all queued messages. |
| duration | the amount of time in seconds to display the message. |
Definition at line 129 of file SDL_libretro_messages.h.
| void SDL_Libretro_SetMousePort | ( | SDL_Libretro * | lr, |
| unsigned | port | ||
| ) |
Selects the one controller port that the mouse drives.
Only this port answers RETRO_DEVICE_MOUSE, RETRO_DEVICE_POINTER and RETRO_DEVICE_LIGHTGUN, so a single mouse doesn't act as every player at once. Defaults to port 0.
| lr | the libretro context. |
| port | the controller port, at a max of SDL_LIBRETRO_MAX_USERS. |
Definition at line 868 of file SDL_libretro_input.h.
References SDL_LIBRETRO_MAX_USERS.
Referenced by SDL_Libretro_InitConfigFile().
| bool SDL_Libretro_SetOptionValue | ( | SDL_Libretro * | lr, |
| const char * | key, | ||
| const char * | value | ||
| ) |
Set a core option's value; fails if the value isn't one the core declared.
Options that declare no values accept any value. The value is copied, and the core sees the change the next time it checks for updated variables.
| lr | the libretro context. |
| key | the option's key. |
| value | the new value. |
Definition at line 306 of file SDL_libretro_options.h.
References SDL_Libretro_GetOption(), and SDL_LibretroOption::value.
Referenced by SDL_Libretro_CycleOptionValue().
| bool SDL_Libretro_SetPortDevice | ( | SDL_Libretro * | lr, |
| unsigned | port, | ||
| unsigned | device | ||
| ) |
Assign a device type to a controller port.
The device is passed to the core right away when one is loaded, and applied again once a game finishes loading. Unloading the core resets every port back to RETRO_DEVICE_JOYPAD.
| lr | the libretro context. |
| port | the controller port, at a max of SDL_LIBRETRO_MAX_USERS. |
| device | the RETRO_DEVICE_* type, or a subclass from RETRO_DEVICE_SUBCLASS(), such as one reported by the core's controller info. |
Definition at line 762 of file SDL_libretro_input.h.
References SDL_Libretro_IsCoreReady(), and SDL_LIBRETRO_MAX_USERS.
| bool SDL_Libretro_SetRenderer | ( | SDL_Libretro * | lr, |
| SDL_Renderer * | renderer | ||
| ) |
Set the renderer the libretro context draws into.
If a game is already loaded, setting the renderer builds the video texture immediately.
| lr | the libretro context. |
| renderer | the renderer to draw into; must not be NULL. |
Definition at line 141 of file SDL_libretro_video.h.
Referenced by SDL_Libretro_Render().
| bool SDL_Libretro_SetRewindEnabled | ( | SDL_Libretro * | lr, |
| bool | enabled, | ||
| unsigned | bufferFrames, | ||
| unsigned | captureInterval | ||
| ) |
Enable or disable the rewind system.
When enabled, a circular buffer of serialized core states is maintained so that setting a negative speed (via SDL_Libretro_SetSpeed()) rewinds gameplay. The buffer is allocated lazily once a game is loaded and the core's serialize size is known. The setting itself carries across games and cores: a core that reports no state size yet (see RETRO_SERIALIZATION_QUIRK_MUST_INITIALIZE) gets its buffer once it does.
History is bounded by two independent limits: the snapshot count (bufferFrames) and the delta memory budget (see SDL_Libretro_SetRewindMemoryLimit(), which defaults to SDL_LIBRETRO_REWIND_DEFAULT_MAX_BYTES at context creation). Whichever is reached first caps the rewind depth. This call does not change the memory budget, a budget you set beforehand, including 0 (unbounded), is preserved.
Enable SDL_LIBRETRO_ENABLE_REWIND_DELTA to use the XOR compression between frames to reduce memory at the expense of performance.
| lr | the libretro context. |
| enabled | true to enable, false to disable. |
| bufferFrames | maximum number of state snapshots to keep (0 for a sensible default of 300, roughly 5 seconds at 60 fps). |
| captureInterval | capture a snapshot every N frames (0 for the default of 1, i.e. every frame). Provide a larger number in order to allow a longer rewind duration. |
Definition at line 1227 of file SDL_libretro_serialize.h.
References SDL_Libretro_IsGameReady(), and SDL_Libretro_SetSpeed().
Referenced by SDL_Libretro_InitConfigFile().
| bool SDL_Libretro_SetRewindMemoryDuration | ( | SDL_Libretro * | lr, |
| double | seconds | ||
| ) |
Set the rewind memory budget by target duration instead of raw bytes.
Computes the worst-case bytes needed to retain seconds of rewindable gameplay and forwards it to SDL_Libretro_SetRewindMemoryLimit(). The estimate is the number of snapshots that span the duration (the core's frame rate divided by the capture interval, times seconds) multiplied by the per-snapshot state size. With delta compression enabled (SDL_LIBRETRO_ENABLE_REWIND_DELTA) snapshots usually store far less than the full state, so this is a conservative upper bound that will typically hold longer than requested.
The snapshot count (bufferFrames in SDL_Libretro_SetRewindEnabled()) is an independent limit; if it is smaller than the duration requires, it, not the byte budget, will cap the achievable rewind depth.
Requires the core's serialize size to be known, so a core must be loaded (or rewind already enabled with a game loaded). Roughly the inverse of SDL_Libretro_GetRewindRemaining().
| lr | the libretro context. |
| seconds | the desired rewind duration in seconds (must be positive). |
lr or seconds is invalid or the core's serialize size is not yet available. Definition at line 1342 of file SDL_libretro_serialize.h.
References SDL_Libretro_IsCoreReady(), and SDL_Libretro_SetRewindMemoryLimit().
| void SDL_Libretro_SetRewindMemoryLimit | ( | SDL_Libretro * | lr, |
| size_t | maxBytes | ||
| ) |
Set the maximum number of bytes of encoded delta history to retain.
When the stored history exceeds this budget the oldest snapshots are dropped until it fits (the most recent snapshot is always kept), trading rewind duration for bounded memory. Applies immediately. Pass 0 to remove the byte limit and rely solely on the frame-count capacity.
The budget defaults to SDL_LIBRETRO_REWIND_DEFAULT_MAX_BYTES at context creation. Whatever value is set here, including 0 (unbounded), persists across SDL_Libretro_SetRewindEnabled() calls.
| lr | the libretro context. |
| maxBytes | the budget in bytes, or 0 for unbounded. |
Definition at line 1310 of file SDL_libretro_serialize.h.
Referenced by SDL_Libretro_InitConfigFile(), and SDL_Libretro_SetRewindMemoryDuration().
| bool SDL_Libretro_SetSaveDirectory | ( | SDL_Libretro * | lr, |
| const char * | path | ||
| ) |
Sets where content will be saved.
The directory is created when a core is loaded.
| lr | The libretro context. |
| path | The path to where save data should be placed, NULL for the default ("saves" inside the app's pref path), or "" for none. |
Definition at line 1910 of file SDL_libretro_core.h.
Referenced by SDL_Libretro_InitConfigFile().
| void SDL_Libretro_SetSavestateContext | ( | SDL_Libretro * | lr, |
| enum retro_savestate_context | context | ||
| ) |
Sets the savestate context reported to cores through RETRO_ENVIRONMENT_GET_SAVESTATE_CONTEXT.
Tells the core what upcoming save states are for, such as RETRO_SAVESTATE_CONTEXT_RUNAHEAD_SAME_INSTANCE for run-ahead or RETRO_SAVESTATE_CONTEXT_ROLLBACK_NETPLAY for netplay, so it can skip work that isn't needed. It stays set until changed, and resets to RETRO_SAVESTATE_CONTEXT_NORMAL when the core is unloaded.
| lr | the libretro context. NULL is ignored. |
| context | the savestate context. |
Definition at line 2282 of file SDL_libretro_core.h.
| bool SDL_Libretro_SetScaleMode | ( | SDL_Libretro * | lr, |
| SDL_ScaleMode | mode | ||
| ) |
Sets the texture scale mode used when the libretro frame is scaled.
Applied immediately when a texture exists, and remembered for the next one otherwise. The setting persists across core loads.
| lr | the libretro context. |
| mode | SDL_SCALEMODE_NEAREST, SDL_SCALEMODE_LINEAR, or SDL_SCALEMODE_PIXELART (SDL >= 3.4). |
Definition at line 438 of file SDL_libretro_video.h.
Referenced by SDL_Libretro_InitConfigFile().
| void SDL_Libretro_SetSpeed | ( | SDL_Libretro * | lr, |
| float | speed | ||
| ) |
Sets how fast the game runs, as a multiple of its normal speed.
1.0f is normal speed, values above it fast-forward (e.g. 2.0f), values between 0 and 1 run in slow motion, and 0.0f pauses. A negative value rewinds at that rate (-1.0f is real time) when rewind is enabled with SDL_Libretro_SetRewindEnabled() and the game's state can be captured; otherwise it is clamped to 0.0f (paused). Audio is pitched to match. The speed resets to 1.0f whenever a core is loaded, and the call is ignored while the core has a fast-forward override active that inhibits toggling.
| lr | the libretro context. |
| speed | the speed multiplier. |
Definition at line 2105 of file SDL_libretro_core.h.
Referenced by SDL_Libretro_Create(), and SDL_Libretro_SetRewindEnabled().
| void SDL_Libretro_SetSRAMAutoSave | ( | SDL_Libretro * | lr, |
| bool | enabled | ||
| ) |
Load and save the core's battery-backed save RAM along with the game.
When enabled, SRAM is loaded from "<save directory>/<content name>.srm" (see SDL_Libretro_GetSavePath()) once a game loads, before it first runs, and written back there before the game unloads: from SDL_Libretro_UnloadGame(), loading other content, unloading the core, or SDL_Libretro_Destroy(). Disabled by default.
| lr | the libretro context. |
| enabled | true to load and save SRAM automatically. |
Definition at line 893 of file SDL_libretro_serialize.h.
| bool SDL_Libretro_SetSystemDirectory | ( | SDL_Libretro * | lr, |
| const char * | path | ||
| ) |
Sets where cores look for system files (BIOS, firmware, etc).
The directory is created when a core is loaded.
| lr | The libretro context. |
| path | The system directory, NULL for the default ("system" inside the app's pref path), or "" for none. |
Definition at line 1940 of file SDL_libretro_core.h.
Referenced by SDL_Libretro_InitConfigFile().
| bool SDL_Libretro_SetUsername | ( | SDL_Libretro * | lr, |
| const char * | username | ||
| ) |
Sets the username reported to cores through RETRO_ENVIRONMENT_GET_USERNAME.
Defaults to "SDL_libretro". Names longer than 63 bytes are truncated.
| lr | the libretro context. |
| username | the username, or NULL for an empty one. The string is copied. |
Definition at line 2037 of file SDL_libretro_core.h.
Referenced by SDL_Libretro_Create(), and SDL_Libretro_InitConfigFile().
| void SDL_Libretro_SetVFS | ( | SDL_Libretro * | lr, |
| void * | vfs_interface | ||
| ) |
Set the Virtual File System the core uses for file access.
The interface is copied, so it doesn't need to outlive this call. With the built-in SDL VFS, any NULL member of the given interface falls back to the SDL3 implementation, and passing NULL restores the SDL3 VFS entirely. When built with SDL_LIBRETRO_DISABLE_VFS, the interface is used as-is and NULL leaves the core without a VFS.
Call this before loading a core, as cores request the VFS when loading.
| lr | the libretro context. |
| vfs_interface | a pointer to a struct retro_vfs_interface, or NULL for the default. |
Definition at line 562 of file SDL_libretro_vfs.h.
Referenced by SDL_Libretro_Create(), SDL_Libretro_PhysFS_Init(), and SDL_Libretro_PhysFS_Quit().
| void SDL_Libretro_SetVirtualButton | ( | SDL_Libretro * | lr, |
| unsigned | port, | ||
| int | button, | ||
| bool | pressed | ||
| ) |
Press or release a joypad button from code, such as from an on-screen touch control.
The button stays held until released with pressed set to false, and works alongside the keyboard and gamepad. All virtual buttons are released when the core is unloaded. Invalid arguments are ignored.
| lr | the libretro context. |
| port | the controller port, at a max of SDL_LIBRETRO_MAX_USERS. |
| button | the RETRO_DEVICE_ID_JOYPAD_* button, below SDL_LIBRETRO_MAX_JOYPAD_BUTTONS. |
| pressed | true to hold the button down, false to release it. |
Definition at line 898 of file SDL_libretro_input.h.
References SDL_LIBRETRO_MAX_USERS.
| void SDL_Libretro_SetVolume | ( | SDL_Libretro * | lr, |
| float | volume | ||
| ) |
Set the audio volume when playing sounds.
The volume is kept across core and game loads, and applied to the audio stream as soon as one is open.
| lr | the libretro context. NULL is ignored. |
| volume | the volume, from 0.0 (silent) to 1.0 (full); values outside that range are clamped. |
Definition at line 2066 of file SDL_libretro_core.h.
Referenced by SDL_Libretro_Create(), and SDL_Libretro_InitConfigFile().
| bool SDL_Libretro_ShouldQuit | ( | const SDL_Libretro * | lr | ) |
Indicates whether or not the core has requested to shutdown.
The request lasts until the game unloads, so loading another game clears it.
| lr | the libretro context. |
Definition at line 1636 of file SDL_libretro_core.h.
| void SDL_Libretro_ToggleMenu | ( | SDL_LibretroMenu * | menu | ) |
Opens the menu when it is closed, or closes it when it is open.
This is what the toggle key (SDL_LIBRETRO_MENU_TOGGLE_KEY) and the gamepad Guide button do in SDL_Libretro_HandleMenuEvent().
| menu | the menu to toggle. NULL is ignored. |
Definition at line 2569 of file SDL_libretro_menu.h.
References SDL_Libretro_SetMenuOpen().
Referenced by SDL_Libretro_HandleMenuEvent().
| void SDL_Libretro_UnloadCore | ( | SDL_Libretro * | lr | ) |
Unloads the actively loaded core.
Will also unload the game if it's still loaded.
| lr | the libretro context. NULL is ignored. |
Definition at line 326 of file SDL_libretro_core.h.
References SDL_EVENT_LIBRETRO_CORE_UNLOADED, SDL_Libretro_IsCoreReady(), and SDL_Libretro_UnloadGame().
Referenced by SDL_Libretro_Destroy(), and SDL_Libretro_LoadCore().
| void SDL_Libretro_UnloadGame | ( | SDL_Libretro * | lr | ) |
Unloads the actively loaded game.
The core stays loaded.
| lr | the libretro context. NULL, or no game loaded, is ignored. |
Definition at line 1349 of file SDL_libretro_core.h.
References SDL_EVENT_LIBRETRO_GAME_UNLOADED.
Referenced by SDL_Libretro_Destroy(), SDL_Libretro_LoadGameSpecialById(), SDL_Libretro_PhysFS_LoadGame(), and SDL_Libretro_UnloadCore().
| void SDL_Libretro_Update | ( | SDL_Libretro * | lr | ) |
Runs the loaded game; call it once per frame of the application's loop.
The core is paced to its own frame rate scaled by the speed, so this may run zero, one, or several core frames per call. Pending video and audio reinitializations happen here. Nothing runs while the speed is 0, or once the core has requested shutdown, and a negative speed steps backwards through the rewind buffer when rewind is enabled.
| lr | the libretro context. Does nothing when lr is NULL or no game is loaded. |
Definition at line 1501 of file SDL_libretro_core.h.
References SDL_LIBRETRO_GET_TICKS_NS, and SDL_LIBRETRO_MAX_USERS.
| void SDL_Libretro_UpdateMenu | ( | SDL_LibretroMenu * | menu | ) |
Processes input and lays out the menu for this frame.
Call once per frame, after the frame's events went through SDL_Libretro_HandleMenuEvent() and after SDL_Libretro_Render(), then follow it with SDL_Libretro_RenderMenu(). Opens the menu whenever no game is running. While open, it refreshes the pages that depend on the loaded core, shows or hides the game-only entries, and writes changed menu settings to the config. Does nothing else while the menu is closed.
| menu | the menu to update. NULL is ignored. |
Definition at line 2758 of file SDL_libretro_menu.h.
References SDL_Libretro_GetMessage(), SDL_Libretro_GetMessageProgress(), SDL_Libretro_IsGameReady(), and SDL_Libretro_SetMenuOpen().
| bool SDL_Libretro_UpdateOptionVisibility | ( | SDL_Libretro * | lr | ) |
Ask the core to refresh which of its options should be displayed.
Calls the core's update display callback, which may update each option's visible flag based on the current option values. Call this before showing an options menu, or after changing a value while one is shown.
| lr | the libretro context. |
Definition at line 489 of file SDL_libretro_options.h.