(WiiU) Attempt to fix build

This commit is contained in:
twinaphex 2019-08-11 23:39:26 +02:00
parent 35732f9a8c
commit 0552c64161
2 changed files with 26 additions and 0 deletions

View File

@ -563,10 +563,14 @@ bool netplay_handshake_sync(netplay_t *netplay,
size_t nicklen, nickmangle = 0; size_t nicklen, nickmangle = 0;
bool nick_matched = false; bool nick_matched = false;
#ifdef HAVE_THREADS
autosave_lock(); autosave_lock();
#endif
mem_info.id = RETRO_MEMORY_SAVE_RAM; mem_info.id = RETRO_MEMORY_SAVE_RAM;
core_get_memory(&mem_info); core_get_memory(&mem_info);
#ifdef HAVE_THREADS
autosave_unlock(); autosave_unlock();
#endif
/* Send basic sync info */ /* Send basic sync info */
cmd[0] = htonl(NETPLAY_CMD_SYNC); cmd[0] = htonl(NETPLAY_CMD_SYNC);
@ -661,16 +665,22 @@ bool netplay_handshake_sync(netplay_t *netplay,
return false; return false;
/* And finally, the SRAM */ /* And finally, the SRAM */
#ifdef HAVE_THREADS
autosave_lock(); autosave_lock();
#endif
if (!netplay_send(&connection->send_packet_buffer, connection->fd, if (!netplay_send(&connection->send_packet_buffer, connection->fd,
mem_info.data, mem_info.size) || mem_info.data, mem_info.size) ||
!netplay_send_flush(&connection->send_packet_buffer, connection->fd, !netplay_send_flush(&connection->send_packet_buffer, connection->fd,
false)) false))
{ {
#ifdef HAVE_THREADS
autosave_unlock(); autosave_unlock();
#endif
return false; return false;
} }
#ifdef HAVE_THREADS
autosave_unlock(); autosave_unlock();
#endif
/* Now we're ready! */ /* Now we're ready! */
connection->mode = NETPLAY_CONNECTION_SPECTATING; connection->mode = NETPLAY_CONNECTION_SPECTATING;
@ -1071,7 +1081,9 @@ bool netplay_handshake_pre_sync(netplay_t *netplay,
} }
/* Now check the SRAM */ /* Now check the SRAM */
#ifdef HAVE_THREADS
autosave_lock(); autosave_lock();
#endif
mem_info.id = RETRO_MEMORY_SAVE_RAM; mem_info.id = RETRO_MEMORY_SAVE_RAM;
core_get_memory(&mem_info); core_get_memory(&mem_info);
@ -1085,7 +1097,9 @@ bool netplay_handshake_pre_sync(netplay_t *netplay,
{ {
RARCH_ERR("%s\n", RARCH_ERR("%s\n",
msg_hash_to_str(MSG_FAILED_TO_RECEIVE_SRAM_DATA_FROM_HOST)); msg_hash_to_str(MSG_FAILED_TO_RECEIVE_SRAM_DATA_FROM_HOST));
#ifdef HAVE_THREADS
autosave_unlock(); autosave_unlock();
#endif
return false; return false;
} }
@ -1100,7 +1114,9 @@ bool netplay_handshake_pre_sync(netplay_t *netplay,
{ {
RARCH_ERR("%s\n", RARCH_ERR("%s\n",
msg_hash_to_str(MSG_FAILED_TO_RECEIVE_SRAM_DATA_FROM_HOST)); msg_hash_to_str(MSG_FAILED_TO_RECEIVE_SRAM_DATA_FROM_HOST));
#ifdef HAVE_THREADS
autosave_unlock(); autosave_unlock();
#endif
return false; return false;
} }
if (remote_sram_size > sizeof(uint32_t)) if (remote_sram_size > sizeof(uint32_t))
@ -1110,7 +1126,9 @@ bool netplay_handshake_pre_sync(netplay_t *netplay,
} }
} }
#ifdef HAVE_THREADS
autosave_unlock(); autosave_unlock();
#endif
/* We're ready! */ /* We're ready! */
*had_input = true; *had_input = true;

View File

@ -848,9 +848,13 @@ void netplay_sync_post_frame(netplay_t *netplay, bool stalled)
{ {
netplay->replay_ptr = PREV_PTR(netplay->replay_ptr); netplay->replay_ptr = PREV_PTR(netplay->replay_ptr);
netplay->replay_frame_count--; netplay->replay_frame_count--;
#ifdef HAVE_THREADS
autosave_lock(); autosave_lock();
#endif
core_run(); core_run();
#ifdef HAVE_THREADS
autosave_unlock(); autosave_unlock();
#endif
netplay->replay_ptr = NEXT_PTR(netplay->replay_ptr); netplay->replay_ptr = NEXT_PTR(netplay->replay_ptr);
netplay->replay_frame_count++; netplay->replay_frame_count++;
} }
@ -888,9 +892,13 @@ void netplay_sync_post_frame(netplay_t *netplay, bool stalled)
/* Re-simulate this frame's input */ /* Re-simulate this frame's input */
netplay_resolve_input(netplay, netplay->replay_ptr, true); netplay_resolve_input(netplay, netplay->replay_ptr, true);
#ifdef HAVE_THREADS
autosave_lock(); autosave_lock();
#endif
core_run(); core_run();
#ifdef HAVE_THREADS
autosave_unlock(); autosave_unlock();
#endif
netplay->replay_ptr = NEXT_PTR(netplay->replay_ptr); netplay->replay_ptr = NEXT_PTR(netplay->replay_ptr);
netplay->replay_frame_count++; netplay->replay_frame_count++;