mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 13:20:30 +00:00
commit
591579e868
@ -1839,7 +1839,7 @@ static bool config_load_file(const char *path, bool set_defaults,
|
||||
if (!retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_NETPLAY_DELAY_FRAMES))
|
||||
CONFIG_GET_INT_BASE(conf, global, netplay.sync_frames, "netplay_delay_frames");
|
||||
if (!retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_NETPLAY_CHECK_FRAMES))
|
||||
CONFIG_GET_INT_BASE(conf, global, netplay.sync_frames, "netplay_check_frames");
|
||||
CONFIG_GET_INT_BASE(conf, global, netplay.check_frames, "netplay_check_frames");
|
||||
if (!retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_NETPLAY_IP_PORT))
|
||||
CONFIG_GET_INT_BASE(conf, global, netplay.port, "netplay_ip_port");
|
||||
#endif
|
||||
|
@ -82,6 +82,7 @@ static void hangup(netplay_t *netplay)
|
||||
netplay->remote_paused = false;
|
||||
netplay->flip = false;
|
||||
netplay->flip_frame = 0;
|
||||
netplay->stall = 0;
|
||||
|
||||
}
|
||||
}
|
||||
@ -380,7 +381,7 @@ static bool netplay_get_cmd(netplay_t *netplay)
|
||||
* arithmetic. */
|
||||
do
|
||||
{
|
||||
if (netplay->buffer[tmp_ptr].frame == buffer[0])
|
||||
if (netplay->buffer[tmp_ptr].used && netplay->buffer[tmp_ptr].frame == buffer[0])
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
|
@ -280,9 +280,10 @@ bool netplay_get_info(netplay_t *netplay)
|
||||
netplay->self_frame_count = netplay->read_frame_count = netplay->other_frame_count = 0;
|
||||
for (i = 0; i < netplay->buffer_size; i++)
|
||||
{
|
||||
netplay->buffer[i].used = false;
|
||||
if (i == netplay->self_ptr)
|
||||
{
|
||||
netplay->buffer[i].frame = 0;
|
||||
netplay_delta_frame_ready(netplay, &netplay->buffer[i], 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -124,17 +124,15 @@ static bool netplay_net_pre_frame(netplay_t *netplay)
|
||||
{
|
||||
netplay->has_connection = true;
|
||||
|
||||
/* If we're not at frame 0, send them the savestate */
|
||||
if (netplay->self_frame_count != 0 && netplay->savestates_work)
|
||||
/* Send them the savestate */
|
||||
if (netplay->savestates_work)
|
||||
{
|
||||
serial_info.size = netplay->state_size;
|
||||
serial_info.data_const = netplay->buffer[netplay->self_ptr].state;
|
||||
netplay_load_savestate(netplay, &serial_info, false);
|
||||
netplay_load_savestate(netplay, NULL, true);
|
||||
}
|
||||
|
||||
/* And expect the current frame from the other side */
|
||||
netplay->read_frame_count = netplay->other_frame_count = netplay->self_frame_count;
|
||||
netplay->read_ptr = netplay->other_ptr = netplay->read_ptr;
|
||||
netplay->read_ptr = netplay->other_ptr = netplay->self_ptr;
|
||||
|
||||
/* Unstall if we were waiting for this */
|
||||
if (netplay->stall == RARCH_NETPLAY_STALL_NO_CONNECTION)
|
||||
|
Loading…
x
Reference in New Issue
Block a user