mirror of
https://github.com/libretro/RetroArch
synced 2025-03-21 22:20:59 +00:00
Fix some backwards implementation in reporting serialization quirks
This commit is contained in:
parent
07a4ad791d
commit
0d661ef6a2
4
core.h
4
core.h
@ -178,7 +178,9 @@ 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);
|
uint32_t core_serialization_quirks(void);
|
||||||
|
|
||||||
|
void core_set_serialization_quirks(uint32_t quirks);
|
||||||
|
|
||||||
bool core_serialize(retro_ctx_serialize_info_t *info);
|
bool core_serialize(retro_ctx_serialize_info_t *info);
|
||||||
|
|
||||||
|
12
core_impl.c
12
core_impl.c
@ -52,6 +52,7 @@ static bool core_game_loaded = false;
|
|||||||
static bool core_input_polled = false;
|
static bool core_input_polled = false;
|
||||||
static bool core_has_set_input_descriptors = false;
|
static bool core_has_set_input_descriptors = false;
|
||||||
static struct retro_callbacks retro_ctx;
|
static struct retro_callbacks retro_ctx;
|
||||||
|
static uint32_t core_serialization_quirks_v = 0;
|
||||||
|
|
||||||
static void core_input_state_poll_maybe(void)
|
static void core_input_state_poll_maybe(void)
|
||||||
{
|
{
|
||||||
@ -291,11 +292,14 @@ bool core_unserialize(retro_ctx_serialize_info_t *info)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t core_serialize_quirks(void)
|
uint32_t core_serialization_quirks(void)
|
||||||
{
|
{
|
||||||
uint32_t ret = 0;
|
return core_serialization_quirks_v;
|
||||||
rarch_environment_cb(RETRO_ENVIRONMENT_SET_SERIALIZATION_QUIRKS, &ret);
|
}
|
||||||
return ret;
|
|
||||||
|
void core_set_serialization_quirks(uint32_t quirks)
|
||||||
|
{
|
||||||
|
core_serialization_quirks_v = quirks;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool core_serialize(retro_ctx_serialize_info_t *info)
|
bool core_serialize(retro_ctx_serialize_info_t *info)
|
||||||
|
@ -1608,6 +1608,10 @@ bool rarch_environment_cb(unsigned cmd, void *data)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case RETRO_ENVIRONMENT_SET_SERIALIZATION_QUIRKS:
|
||||||
|
core_set_serialization_quirks(*((uint32_t *) data));
|
||||||
|
break;
|
||||||
|
|
||||||
/* Default */
|
/* Default */
|
||||||
default:
|
default:
|
||||||
RARCH_LOG("Environ UNSUPPORTED (#%u).\n", cmd);
|
RARCH_LOG("Environ UNSUPPORTED (#%u).\n", cmd);
|
||||||
|
@ -960,7 +960,7 @@ bool netplay_wait_and_init_serialization(netplay_t *netplay)
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
/* Wait maximally 60 frames, or until the core reports it's initialized */
|
/* Wait maximally 60 frames, or until the core reports it's initialized */
|
||||||
for (frames = 0; (core_serialize_quirks() & RETRO_SERIALIZATION_QUIRK_INITIALIZING) && frames < 60; frames++)
|
for (frames = 0; (core_serialization_quirks() & RETRO_SERIALIZATION_QUIRK_INITIALIZING) && frames < 60; frames++)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_THREADS)
|
#if defined(HAVE_THREADS)
|
||||||
autosave_lock();
|
autosave_lock();
|
||||||
@ -1390,7 +1390,7 @@ bool init_netplay(bool is_spectate, const char *server, unsigned port)
|
|||||||
core_set_default_callbacks(&cbs);
|
core_set_default_callbacks(&cbs);
|
||||||
|
|
||||||
/* Map the core's quirks to our quirks */
|
/* Map the core's quirks to our quirks */
|
||||||
serialization_quirks = core_serialize_quirks();
|
serialization_quirks = core_serialization_quirks();
|
||||||
if ((serialization_quirks & ~((uint32_t) NETPLAY_QUIRK_MAP_UNDERSTOOD)))
|
if ((serialization_quirks & ~((uint32_t) NETPLAY_QUIRK_MAP_UNDERSTOOD)))
|
||||||
{
|
{
|
||||||
/* Quirks we don't support! Just disable everything. */
|
/* Quirks we don't support! Just disable everything. */
|
||||||
|
@ -61,8 +61,7 @@ static bool netplay_net_pre_frame(netplay_t *netplay)
|
|||||||
{
|
{
|
||||||
retro_ctx_serialize_info_t serial_info;
|
retro_ctx_serialize_info_t serial_info;
|
||||||
|
|
||||||
if (netplay_delta_frame_ready(netplay, &netplay->buffer[netplay->self_ptr], netplay->self_frame_count) &&
|
if (netplay_delta_frame_ready(netplay, &netplay->buffer[netplay->self_ptr], netplay->self_frame_count))
|
||||||
netplay->self_frame_count > 0)
|
|
||||||
{
|
{
|
||||||
serial_info.data_const = NULL;
|
serial_info.data_const = NULL;
|
||||||
serial_info.data = netplay->buffer[netplay->self_ptr].state;
|
serial_info.data = netplay->buffer[netplay->self_ptr].state;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user