mirror of
https://github.com/libretro/RetroArch
synced 2025-02-06 09:40:06 +00:00
Add a libretro environment for serialization quirks
The new environment RETRO_ENVIRONMENT_SET_SERIALIZATION_QUIRKS allows cores to communicate any quirks their implementation of serialization may exhibit. This is useful for distinguishing between serialization implementations that are sufficient for netplay, rewind, regular use, etc, as each of these have different requirements and it should be possible to support a "good enough" serialization without breaking frontend features.
This commit is contained in:
parent
cda0324627
commit
b974fa5718
2
core.h
2
core.h
@ -178,6 +178,8 @@ bool core_set_environment(retro_ctx_environ_info_t *info);
|
|||||||
|
|
||||||
bool core_serialize_size(retro_ctx_size_info_t *info);
|
bool core_serialize_size(retro_ctx_size_info_t *info);
|
||||||
|
|
||||||
|
uint32_t core_serialize_quirks(void);
|
||||||
|
|
||||||
bool core_serialize(retro_ctx_serialize_info_t *info);
|
bool core_serialize(retro_ctx_serialize_info_t *info);
|
||||||
|
|
||||||
bool core_unserialize(retro_ctx_serialize_info_t *info);
|
bool core_unserialize(retro_ctx_serialize_info_t *info);
|
||||||
|
@ -291,6 +291,13 @@ bool core_unserialize(retro_ctx_serialize_info_t *info)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t core_serialize_quirks(void)
|
||||||
|
{
|
||||||
|
uint32_t ret = 0;
|
||||||
|
rarch_environment_cb(RETRO_ENVIRONMENT_SET_SERIALIZATION_QUIRKS, &ret);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
bool core_serialize(retro_ctx_serialize_info_t *info)
|
bool core_serialize(retro_ctx_serialize_info_t *info)
|
||||||
{
|
{
|
||||||
if (!info)
|
if (!info)
|
||||||
|
@ -976,6 +976,31 @@ struct retro_hw_render_context_negotiation_interface
|
|||||||
* so it will be used after SET_HW_RENDER, but before the context_reset callback.
|
* so it will be used after SET_HW_RENDER, but before the context_reset callback.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define RETRO_SERIALIZATION_QUIRK_INCOMPLETE (1 << 0)
|
||||||
|
/* Serialized state is incomplete in some way. Set if serialization is
|
||||||
|
* usable in typical end-user cases but should not be relied upon to
|
||||||
|
* implement frame-sensitive frontend features such as netplay or
|
||||||
|
* rerecording. */
|
||||||
|
#define RETRO_SERIALIZATION_QUIRK_MUST_INITIALIZE (1 << 1)
|
||||||
|
/* The core must spend some time initializing before serialization is
|
||||||
|
* safe. */
|
||||||
|
#define RETRO_SERIALIZATION_QUIRK_INITIALIZING (1 << 2)
|
||||||
|
/* If MUST_INITIALIZE is set, this should also be set if initialization is
|
||||||
|
* in progress. */
|
||||||
|
#define RETRO_SERIALIZATION_QUIRK_VARIABLE_SIZE (1 << 3)
|
||||||
|
/* Serialization size may change within a session. */
|
||||||
|
#define RETRO_SERIALIZATION_QUIRK_SINGLE_SESSION (1 << 4)
|
||||||
|
/* Serialized state can only be loaded during the same session. */
|
||||||
|
#define RETRO_SERIALIZATION_QUIRK_ARCHITECTURE_DEPENDENT (1 << 5)
|
||||||
|
/* Serialized state cannot be loaded on a different architecture from the
|
||||||
|
* one it was saved on. */
|
||||||
|
|
||||||
|
#define RETRO_ENVIRONMENT_SET_SERIALIZATION_QUIRKS 44
|
||||||
|
/* uint32_t * --
|
||||||
|
* Sets quirk flags associated with serialization.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
#define RETRO_MEMDESC_CONST (1 << 0) /* The frontend will never change this memory area once retro_load_game has returned. */
|
#define RETRO_MEMDESC_CONST (1 << 0) /* The frontend will never change this memory area once retro_load_game has returned. */
|
||||||
#define RETRO_MEMDESC_BIGENDIAN (1 << 1) /* The memory area contains big endian data. Default is little endian. */
|
#define RETRO_MEMDESC_BIGENDIAN (1 << 1) /* The memory area contains big endian data. Default is little endian. */
|
||||||
#define RETRO_MEMDESC_ALIGN_2 (1 << 16) /* All memory access in this area is aligned to their own size, or 2, whichever is smaller. */
|
#define RETRO_MEMDESC_ALIGN_2 (1 << 16) /* All memory access in this area is aligned to their own size, or 2, whichever is smaller. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user