diff --git a/network/netplay/netplay.c b/network/netplay/netplay.c index bbf680b467..e797b02451 100644 --- a/network/netplay/netplay.c +++ b/network/netplay/netplay.c @@ -310,7 +310,7 @@ static bool netplay_get_cmd(netplay_t *netplay) } /* The data's good! */ - netplay->buffer[netplay->read_ptr].is_simulated = false; + netplay->buffer[netplay->read_ptr].have_remote = true; memcpy(netplay->buffer[netplay->read_ptr].real_input_state, buffer + 1, sizeof(buffer) - sizeof(uint32_t)); netplay->read_ptr = NEXT_PTR(netplay->read_ptr); netplay->read_frame_count++; @@ -498,7 +498,7 @@ static void simulate_input(netplay_t *netplay) netplay->buffer[prev].real_input_state, sizeof(netplay->buffer[prev].real_input_state)); - netplay->buffer[ptr].is_simulated = true; + netplay->buffer[ptr].have_remote = false; netplay->buffer[ptr].used_real = false; } @@ -529,7 +529,7 @@ static bool netplay_poll(netplay_t *netplay) if (netplay->self_frame_count == 0) { netplay->buffer[0].used_real = true; - netplay->buffer[0].is_simulated = false; + netplay->buffer[0].have_remote = true; memset(netplay->buffer[0].real_input_state, 0, sizeof(netplay->buffer[0].real_input_state)); @@ -667,10 +667,10 @@ static int16_t netplay_input_state(netplay_t *netplay, if (netplay->port == (netplay_flip_port(netplay, port) ? 1 : 0)) { - if (netplay->buffer[ptr].is_simulated) - curr_input_state = netplay->buffer[ptr].simulated_input_state; - else + if (netplay->buffer[ptr].have_remote) curr_input_state = netplay->buffer[ptr].real_input_state; + else + curr_input_state = netplay->buffer[ptr].simulated_input_state; } switch (device) diff --git a/network/netplay/netplay_net.c b/network/netplay/netplay_net.c index b234aa98a3..f02b79ce20 100644 --- a/network/netplay/netplay_net.c +++ b/network/netplay/netplay_net.c @@ -114,7 +114,6 @@ static void netplay_net_post_frame(netplay_t *netplay) /* For the remainder of the frames up to the read count, we can use the real data */ while (netplay->replay_frame_count < netplay->read_frame_count) { - netplay->buffer[netplay->replay_ptr].is_simulated = false; netplay->buffer[netplay->replay_ptr].used_real = true; netplay->replay_ptr = NEXT_PTR(netplay->replay_ptr); netplay->replay_frame_count++; @@ -205,8 +204,6 @@ static bool netplay_net_init_buffers(netplay_t *netplay) if (!netplay->buffer[i].state) return false; - - netplay->buffer[i].is_simulated = true; } return true; diff --git a/network/netplay/netplay_private.h b/network/netplay/netplay_private.h index 381c934aaf..66543e4265 100644 --- a/network/netplay/netplay_private.h +++ b/network/netplay/netplay_private.h @@ -52,10 +52,10 @@ struct delta_frame /* Have we read local input? */ bool have_local; - /* Badly named: This is !have_real(_remote) */ - bool is_simulated; + /* Have we read the real remote input? */ + bool have_remote; - /* Is the current state as of self_frame_count using the real data? */ + /* Is the current state as of self_frame_count using the real remote data? */ bool used_real; };