mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 09:09:52 -06:00
Core: Pass Netplay SRAM through boot process.
This removes the Netplay classes touching emulated hardware structures before emulation even starts.
This commit is contained in:
@ -1436,20 +1436,9 @@ bool NetPlayServer::StartGame()
|
||||
const std::string region = Config::GetDirectoryForRegion(
|
||||
Config::ToGameCubeRegion(m_dialog->FindGameFile(m_selected_game_identifier)->GetRegion()));
|
||||
|
||||
// sync GC SRAM with clients
|
||||
if (!g_SRAM_netplay_initialized)
|
||||
{
|
||||
SConfig::GetInstance().m_strSRAM = File::GetUserPath(F_GCSRAM_IDX);
|
||||
InitSRAM(&g_SRAM, SConfig::GetInstance().m_strSRAM);
|
||||
g_SRAM_netplay_initialized = true;
|
||||
}
|
||||
sf::Packet srampac;
|
||||
srampac << MessageID::SyncGCSRAM;
|
||||
for (size_t i = 0; i < sizeof(g_SRAM) - offsetof(Sram, settings); ++i)
|
||||
{
|
||||
srampac << g_SRAM[offsetof(Sram, settings) + i];
|
||||
}
|
||||
SendAsyncToClients(std::move(srampac), 1);
|
||||
// load host's GC SRAM
|
||||
SConfig::GetInstance().m_strSRAM = File::GetUserPath(F_GCSRAM_IDX);
|
||||
InitSRAM(&m_settings.sram, SConfig::GetInstance().m_strSRAM);
|
||||
|
||||
// tell clients to start game
|
||||
sf::Packet spac;
|
||||
@ -1544,6 +1533,9 @@ bool NetPlayServer::StartGame()
|
||||
spac << m_settings.use_fma;
|
||||
spac << m_settings.hide_remote_gbas;
|
||||
|
||||
for (size_t i = 0; i < sizeof(m_settings.sram); ++i)
|
||||
spac << m_settings.sram[i];
|
||||
|
||||
SendAsyncToClients(std::move(spac));
|
||||
|
||||
m_start_pending = false;
|
||||
|
Reference in New Issue
Block a user