Merge pull request #11071 from AdmiralCurtiss/netplay-settings-style

Netplay: Rename variable names in NetSettings to match style guide.
This commit is contained in:
JosJuice 2022-09-19 17:55:36 +02:00 committed by GitHub
commit 720b3f5519
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 372 additions and 375 deletions

View File

@ -91,7 +91,7 @@ bool BootCore(std::unique_ptr<BootParameters> boot, const WindowSystemInfo& wsi)
return false; return false;
Config::AddLayer(ConfigLoaders::GenerateNetPlayConfigLoader(*netplay_settings)); Config::AddLayer(ConfigLoaders::GenerateNetPlayConfigLoader(*netplay_settings));
StartUp.bCopyWiiSaveNetplay = netplay_settings->m_CopyWiiSave; StartUp.bCopyWiiSaveNetplay = netplay_settings->copy_wii_save;
} }
else else
{ {

View File

@ -30,99 +30,99 @@ public:
void Load(Config::Layer* layer) override void Load(Config::Layer* layer) override
{ {
layer->Set(Config::MAIN_CPU_THREAD, m_settings.m_CPUthread); layer->Set(Config::MAIN_CPU_THREAD, m_settings.cpu_thread);
layer->Set(Config::MAIN_CPU_CORE, m_settings.m_CPUcore); layer->Set(Config::MAIN_CPU_CORE, m_settings.cpu_core);
layer->Set(Config::MAIN_ENABLE_CHEATS, m_settings.m_EnableCheats); layer->Set(Config::MAIN_ENABLE_CHEATS, m_settings.enable_cheats);
layer->Set(Config::MAIN_GC_LANGUAGE, m_settings.m_SelectedLanguage); layer->Set(Config::MAIN_GC_LANGUAGE, m_settings.selected_language);
layer->Set(Config::MAIN_OVERRIDE_REGION_SETTINGS, m_settings.m_OverrideRegionSettings); layer->Set(Config::MAIN_OVERRIDE_REGION_SETTINGS, m_settings.override_region_settings);
layer->Set(Config::MAIN_DSP_HLE, m_settings.m_DSPHLE); layer->Set(Config::MAIN_DSP_HLE, m_settings.dsp_hle);
layer->Set(Config::MAIN_OVERCLOCK_ENABLE, m_settings.m_OCEnable); layer->Set(Config::MAIN_OVERCLOCK_ENABLE, m_settings.oc_enable);
layer->Set(Config::MAIN_OVERCLOCK, m_settings.m_OCFactor); layer->Set(Config::MAIN_OVERCLOCK, m_settings.oc_factor);
for (ExpansionInterface::Slot slot : ExpansionInterface::SLOTS) for (ExpansionInterface::Slot slot : ExpansionInterface::SLOTS)
layer->Set(Config::GetInfoForEXIDevice(slot), m_settings.m_EXIDevice[slot]); layer->Set(Config::GetInfoForEXIDevice(slot), m_settings.exi_device[slot]);
layer->Set(Config::MAIN_MEMORY_CARD_SIZE, m_settings.m_MemcardSizeOverride); layer->Set(Config::MAIN_MEMORY_CARD_SIZE, m_settings.memcard_size_override);
layer->Set(Config::SESSION_SAVE_DATA_WRITABLE, m_settings.m_WriteToMemcard); layer->Set(Config::SESSION_SAVE_DATA_WRITABLE, m_settings.write_to_memcard);
layer->Set(Config::MAIN_RAM_OVERRIDE_ENABLE, m_settings.m_RAMOverrideEnable); layer->Set(Config::MAIN_RAM_OVERRIDE_ENABLE, m_settings.ram_override_enable);
layer->Set(Config::MAIN_MEM1_SIZE, m_settings.m_Mem1Size); layer->Set(Config::MAIN_MEM1_SIZE, m_settings.mem1_size);
layer->Set(Config::MAIN_MEM2_SIZE, m_settings.m_Mem2Size); layer->Set(Config::MAIN_MEM2_SIZE, m_settings.mem2_size);
layer->Set(Config::MAIN_FALLBACK_REGION, m_settings.m_FallbackRegion); layer->Set(Config::MAIN_FALLBACK_REGION, m_settings.fallback_region);
layer->Set(Config::MAIN_ALLOW_SD_WRITES, m_settings.m_AllowSDWrites); layer->Set(Config::MAIN_ALLOW_SD_WRITES, m_settings.allow_sd_writes);
layer->Set(Config::MAIN_DSP_JIT, m_settings.m_DSPEnableJIT); layer->Set(Config::MAIN_DSP_JIT, m_settings.dsp_enable_jit);
for (size_t i = 0; i < Config::SYSCONF_SETTINGS.size(); ++i) for (size_t i = 0; i < Config::SYSCONF_SETTINGS.size(); ++i)
{ {
std::visit( std::visit(
[&](auto* info) { [&](auto* info) {
layer->Set(*info, static_cast<decltype(info->GetDefaultValue())>( layer->Set(*info, static_cast<decltype(info->GetDefaultValue())>(
m_settings.m_SYSCONFSettings[i])); m_settings.sysconf_settings[i]));
}, },
Config::SYSCONF_SETTINGS[i].config_info); Config::SYSCONF_SETTINGS[i].config_info);
} }
layer->Set(Config::GFX_HACK_EFB_ACCESS_ENABLE, m_settings.m_EFBAccessEnable); layer->Set(Config::GFX_HACK_EFB_ACCESS_ENABLE, m_settings.efb_access_enable);
layer->Set(Config::GFX_HACK_BBOX_ENABLE, m_settings.m_BBoxEnable); layer->Set(Config::GFX_HACK_BBOX_ENABLE, m_settings.bbox_enable);
layer->Set(Config::GFX_HACK_FORCE_PROGRESSIVE, m_settings.m_ForceProgressive); layer->Set(Config::GFX_HACK_FORCE_PROGRESSIVE, m_settings.force_progressive);
layer->Set(Config::GFX_HACK_SKIP_EFB_COPY_TO_RAM, m_settings.m_EFBToTextureEnable); layer->Set(Config::GFX_HACK_SKIP_EFB_COPY_TO_RAM, m_settings.efb_to_texture_enable);
layer->Set(Config::GFX_HACK_SKIP_XFB_COPY_TO_RAM, m_settings.m_XFBToTextureEnable); layer->Set(Config::GFX_HACK_SKIP_XFB_COPY_TO_RAM, m_settings.xfb_to_texture_enable);
layer->Set(Config::GFX_HACK_DISABLE_COPY_TO_VRAM, m_settings.m_DisableCopyToVRAM); layer->Set(Config::GFX_HACK_DISABLE_COPY_TO_VRAM, m_settings.disable_copy_to_vram);
layer->Set(Config::GFX_HACK_IMMEDIATE_XFB, m_settings.m_ImmediateXFBEnable); layer->Set(Config::GFX_HACK_IMMEDIATE_XFB, m_settings.immediate_xfb_enable);
layer->Set(Config::GFX_HACK_EFB_EMULATE_FORMAT_CHANGES, m_settings.m_EFBEmulateFormatChanges); layer->Set(Config::GFX_HACK_EFB_EMULATE_FORMAT_CHANGES, m_settings.efb_emulate_format_changes);
layer->Set(Config::GFX_SAFE_TEXTURE_CACHE_COLOR_SAMPLES, layer->Set(Config::GFX_SAFE_TEXTURE_CACHE_COLOR_SAMPLES,
m_settings.m_SafeTextureCacheColorSamples); m_settings.safe_texture_cache_color_samples);
layer->Set(Config::GFX_PERF_QUERIES_ENABLE, m_settings.m_PerfQueriesEnable); layer->Set(Config::GFX_PERF_QUERIES_ENABLE, m_settings.perf_queries_enable);
layer->Set(Config::MAIN_FLOAT_EXCEPTIONS, m_settings.m_FloatExceptions); layer->Set(Config::MAIN_FLOAT_EXCEPTIONS, m_settings.float_exceptions);
layer->Set(Config::MAIN_DIVIDE_BY_ZERO_EXCEPTIONS, m_settings.m_DivideByZeroExceptions); layer->Set(Config::MAIN_DIVIDE_BY_ZERO_EXCEPTIONS, m_settings.divide_by_zero_exceptions);
layer->Set(Config::MAIN_FPRF, m_settings.m_FPRF); layer->Set(Config::MAIN_FPRF, m_settings.fprf);
layer->Set(Config::MAIN_ACCURATE_NANS, m_settings.m_AccurateNaNs); layer->Set(Config::MAIN_ACCURATE_NANS, m_settings.accurate_nans);
layer->Set(Config::MAIN_DISABLE_ICACHE, m_settings.m_DisableICache); layer->Set(Config::MAIN_DISABLE_ICACHE, m_settings.disable_icache);
layer->Set(Config::MAIN_SYNC_ON_SKIP_IDLE, m_settings.m_SyncOnSkipIdle); layer->Set(Config::MAIN_SYNC_ON_SKIP_IDLE, m_settings.sync_on_skip_idle);
layer->Set(Config::MAIN_SYNC_GPU, m_settings.m_SyncGPU); layer->Set(Config::MAIN_SYNC_GPU, m_settings.sync_gpu);
layer->Set(Config::MAIN_SYNC_GPU_MAX_DISTANCE, m_settings.m_SyncGpuMaxDistance); layer->Set(Config::MAIN_SYNC_GPU_MAX_DISTANCE, m_settings.sync_gpu_max_distance);
layer->Set(Config::MAIN_SYNC_GPU_MIN_DISTANCE, m_settings.m_SyncGpuMinDistance); layer->Set(Config::MAIN_SYNC_GPU_MIN_DISTANCE, m_settings.sync_gpu_min_distance);
layer->Set(Config::MAIN_SYNC_GPU_OVERCLOCK, m_settings.m_SyncGpuOverclock); layer->Set(Config::MAIN_SYNC_GPU_OVERCLOCK, m_settings.sync_gpu_overclock);
layer->Set(Config::MAIN_JIT_FOLLOW_BRANCH, m_settings.m_JITFollowBranch); layer->Set(Config::MAIN_JIT_FOLLOW_BRANCH, m_settings.jit_follow_branch);
layer->Set(Config::MAIN_FAST_DISC_SPEED, m_settings.m_FastDiscSpeed); layer->Set(Config::MAIN_FAST_DISC_SPEED, m_settings.fast_disc_speed);
layer->Set(Config::MAIN_MMU, m_settings.m_MMU); layer->Set(Config::MAIN_MMU, m_settings.mmu);
layer->Set(Config::MAIN_FASTMEM, m_settings.m_Fastmem); layer->Set(Config::MAIN_FASTMEM, m_settings.fastmem);
layer->Set(Config::MAIN_SKIP_IPL, m_settings.m_SkipIPL); layer->Set(Config::MAIN_SKIP_IPL, m_settings.skip_ipl);
layer->Set(Config::SESSION_LOAD_IPL_DUMP, m_settings.m_LoadIPLDump); layer->Set(Config::SESSION_LOAD_IPL_DUMP, m_settings.load_ipl_dump);
layer->Set(Config::GFX_HACK_DEFER_EFB_COPIES, m_settings.m_DeferEFBCopies); layer->Set(Config::GFX_HACK_DEFER_EFB_COPIES, m_settings.defer_efb_copies);
layer->Set(Config::GFX_HACK_EFB_ACCESS_TILE_SIZE, m_settings.m_EFBAccessTileSize); layer->Set(Config::GFX_HACK_EFB_ACCESS_TILE_SIZE, m_settings.efb_access_tile_size);
layer->Set(Config::GFX_HACK_EFB_DEFER_INVALIDATION, m_settings.m_EFBAccessDeferInvalidation); layer->Set(Config::GFX_HACK_EFB_DEFER_INVALIDATION, m_settings.efb_access_defer_invalidation);
layer->Set(Config::SESSION_USE_FMA, m_settings.m_UseFMA); layer->Set(Config::SESSION_USE_FMA, m_settings.use_fma);
layer->Set(Config::MAIN_BLUETOOTH_PASSTHROUGH_ENABLED, false); layer->Set(Config::MAIN_BLUETOOTH_PASSTHROUGH_ENABLED, false);
if (m_settings.m_StrictSettingsSync) if (m_settings.strict_settings_sync)
{ {
layer->Set(Config::GFX_HACK_VERTEX_ROUNDING, m_settings.m_VertexRounding); layer->Set(Config::GFX_HACK_VERTEX_ROUNDING, m_settings.vertex_rounding);
layer->Set(Config::GFX_EFB_SCALE, m_settings.m_InternalResolution); layer->Set(Config::GFX_EFB_SCALE, m_settings.internal_resolution);
layer->Set(Config::GFX_HACK_COPY_EFB_SCALED, m_settings.m_EFBScaledCopy); layer->Set(Config::GFX_HACK_COPY_EFB_SCALED, m_settings.efb_scaled_copy);
layer->Set(Config::GFX_FAST_DEPTH_CALC, m_settings.m_FastDepthCalc); layer->Set(Config::GFX_FAST_DEPTH_CALC, m_settings.fast_depth_calc);
layer->Set(Config::GFX_ENABLE_PIXEL_LIGHTING, m_settings.m_EnablePixelLighting); layer->Set(Config::GFX_ENABLE_PIXEL_LIGHTING, m_settings.enable_pixel_lighting);
layer->Set(Config::GFX_WIDESCREEN_HACK, m_settings.m_WidescreenHack); layer->Set(Config::GFX_WIDESCREEN_HACK, m_settings.widescreen_hack);
layer->Set(Config::GFX_ENHANCE_FORCE_FILTERING, m_settings.m_ForceFiltering); layer->Set(Config::GFX_ENHANCE_FORCE_FILTERING, m_settings.force_filtering);
layer->Set(Config::GFX_ENHANCE_MAX_ANISOTROPY, m_settings.m_MaxAnisotropy); layer->Set(Config::GFX_ENHANCE_MAX_ANISOTROPY, m_settings.max_anisotropy);
layer->Set(Config::GFX_ENHANCE_FORCE_TRUE_COLOR, m_settings.m_ForceTrueColor); layer->Set(Config::GFX_ENHANCE_FORCE_TRUE_COLOR, m_settings.force_true_color);
layer->Set(Config::GFX_ENHANCE_DISABLE_COPY_FILTER, m_settings.m_DisableCopyFilter); layer->Set(Config::GFX_ENHANCE_DISABLE_COPY_FILTER, m_settings.disable_copy_filter);
layer->Set(Config::GFX_DISABLE_FOG, m_settings.m_DisableFog); layer->Set(Config::GFX_DISABLE_FOG, m_settings.disable_fog);
layer->Set(Config::GFX_ENHANCE_ARBITRARY_MIPMAP_DETECTION, layer->Set(Config::GFX_ENHANCE_ARBITRARY_MIPMAP_DETECTION,
m_settings.m_ArbitraryMipmapDetection); m_settings.arbitrary_mipmap_detection);
layer->Set(Config::GFX_ENHANCE_ARBITRARY_MIPMAP_DETECTION_THRESHOLD, layer->Set(Config::GFX_ENHANCE_ARBITRARY_MIPMAP_DETECTION_THRESHOLD,
m_settings.m_ArbitraryMipmapDetectionThreshold); m_settings.arbitrary_mipmap_detection_threshold);
layer->Set(Config::GFX_ENABLE_GPU_TEXTURE_DECODING, m_settings.m_EnableGPUTextureDecoding); layer->Set(Config::GFX_ENABLE_GPU_TEXTURE_DECODING, m_settings.enable_gpu_texture_decoding);
// Disable AA as it isn't deterministic across GPUs // Disable AA as it isn't deterministic across GPUs
layer->Set(Config::GFX_MSAA, 1); layer->Set(Config::GFX_MSAA, 1);
layer->Set(Config::GFX_SSAA, false); layer->Set(Config::GFX_SSAA, false);
} }
if (m_settings.m_SyncSaveData) if (m_settings.sync_save_data)
{ {
if (!m_settings.m_IsHosting) if (!m_settings.is_hosting)
{ {
const std::string path = File::GetUserPath(D_GCUSER_IDX) + GC_MEMCARD_NETPLAY DIR_SEP; const std::string path = File::GetUserPath(D_GCUSER_IDX) + GC_MEMCARD_NETPLAY DIR_SEP;
layer->Set(Config::MAIN_GCI_FOLDER_A_PATH_OVERRIDE, path + "Card A"); layer->Set(Config::MAIN_GCI_FOLDER_A_PATH_OVERRIDE, path + "Card A");
@ -130,7 +130,7 @@ public:
const auto make_memcard_path = [this](char letter) { const auto make_memcard_path = [this](char letter) {
return fmt::format("{}{}{}.{}.raw", File::GetUserPath(D_GCUSER_IDX), GC_MEMCARD_NETPLAY, return fmt::format("{}{}{}.{}.raw", File::GetUserPath(D_GCUSER_IDX), GC_MEMCARD_NETPLAY,
letter, m_settings.m_SaveDataRegion); letter, m_settings.save_data_region);
}; };
layer->Set(Config::MAIN_MEMCARD_A_PATH, make_memcard_path('A')); layer->Set(Config::MAIN_MEMCARD_A_PATH, make_memcard_path('A'));
layer->Set(Config::MAIN_MEMCARD_B_PATH, make_memcard_path('B')); layer->Set(Config::MAIN_MEMCARD_B_PATH, make_memcard_path('B'));
@ -140,14 +140,14 @@ public:
} }
#ifdef HAS_LIBMGBA #ifdef HAS_LIBMGBA
for (size_t i = 0; i < m_settings.m_GBARomPaths.size(); ++i) for (size_t i = 0; i < m_settings.gba_rom_paths.size(); ++i)
{ {
layer->Set(Config::MAIN_GBA_ROM_PATHS[i], m_settings.m_GBARomPaths[i]); layer->Set(Config::MAIN_GBA_ROM_PATHS[i], m_settings.gba_rom_paths[i]);
} }
#endif #endif
// Check To Override Client's Cheat Codes // Check To Override Client's Cheat Codes
if (m_settings.m_SyncCodes && !m_settings.m_IsHosting) if (m_settings.sync_codes && !m_settings.is_hosting)
{ {
// Raise flag to use host's codes // Raise flag to use host's codes
layer->Set(Config::SESSION_CODE_SYNC_OVERRIDE, true); layer->Set(Config::SESSION_CODE_SYNC_OVERRIDE, true);

View File

@ -635,7 +635,7 @@ void NetPlayClient::OnGBAConfig(sf::Packet& packet)
std::tie(old_config.has_rom, old_config.title, old_config.hash)) std::tie(old_config.has_rom, old_config.title, old_config.hash))
{ {
m_dialog->OnMsgChangeGBARom(static_cast<int>(i), config); m_dialog->OnMsgChangeGBARom(static_cast<int>(i), config);
m_net_settings.m_GBARomPaths[i] = m_net_settings.gba_rom_paths[i] =
config.has_rom ? config.has_rom ?
m_dialog->FindGBARomPath(config.hash, config.title, static_cast<int>(i)) : m_dialog->FindGBARomPath(config.hash, config.title, static_cast<int>(i)) :
""; "";
@ -809,92 +809,91 @@ void NetPlayClient::OnStartGame(sf::Packet& packet)
INFO_LOG_FMT(NETPLAY, "Start of game {}", m_selected_game.game_id); INFO_LOG_FMT(NETPLAY, "Start of game {}", m_selected_game.game_id);
packet >> m_current_game; packet >> m_current_game;
packet >> m_net_settings.m_CPUthread; packet >> m_net_settings.cpu_thread;
packet >> m_net_settings.m_CPUcore; packet >> m_net_settings.cpu_core;
packet >> m_net_settings.m_EnableCheats; packet >> m_net_settings.enable_cheats;
packet >> m_net_settings.m_SelectedLanguage; packet >> m_net_settings.selected_language;
packet >> m_net_settings.m_OverrideRegionSettings; packet >> m_net_settings.override_region_settings;
packet >> m_net_settings.m_DSPEnableJIT; packet >> m_net_settings.dsp_enable_jit;
packet >> m_net_settings.m_DSPHLE; packet >> m_net_settings.dsp_hle;
packet >> m_net_settings.m_WriteToMemcard; packet >> m_net_settings.write_to_memcard;
packet >> m_net_settings.m_RAMOverrideEnable; packet >> m_net_settings.ram_override_enable;
packet >> m_net_settings.m_Mem1Size; packet >> m_net_settings.mem1_size;
packet >> m_net_settings.m_Mem2Size; packet >> m_net_settings.mem2_size;
packet >> m_net_settings.m_FallbackRegion; packet >> m_net_settings.fallback_region;
packet >> m_net_settings.m_AllowSDWrites; packet >> m_net_settings.allow_sd_writes;
packet >> m_net_settings.m_CopyWiiSave; packet >> m_net_settings.copy_wii_save;
packet >> m_net_settings.m_OCEnable; packet >> m_net_settings.oc_enable;
packet >> m_net_settings.m_OCFactor; packet >> m_net_settings.oc_factor;
for (auto slot : ExpansionInterface::SLOTS) for (auto slot : ExpansionInterface::SLOTS)
packet >> m_net_settings.m_EXIDevice[slot]; packet >> m_net_settings.exi_device[slot];
packet >> m_net_settings.m_MemcardSizeOverride; packet >> m_net_settings.memcard_size_override;
for (u32& value : m_net_settings.m_SYSCONFSettings) for (u32& value : m_net_settings.sysconf_settings)
packet >> value; packet >> value;
packet >> m_net_settings.m_EFBAccessEnable; packet >> m_net_settings.efb_access_enable;
packet >> m_net_settings.m_BBoxEnable; packet >> m_net_settings.bbox_enable;
packet >> m_net_settings.m_ForceProgressive; packet >> m_net_settings.force_progressive;
packet >> m_net_settings.m_EFBToTextureEnable; packet >> m_net_settings.efb_to_texture_enable;
packet >> m_net_settings.m_XFBToTextureEnable; packet >> m_net_settings.xfb_to_texture_enable;
packet >> m_net_settings.m_DisableCopyToVRAM; packet >> m_net_settings.disable_copy_to_vram;
packet >> m_net_settings.m_ImmediateXFBEnable; packet >> m_net_settings.immediate_xfb_enable;
packet >> m_net_settings.m_EFBEmulateFormatChanges; packet >> m_net_settings.efb_emulate_format_changes;
packet >> m_net_settings.m_SafeTextureCacheColorSamples; packet >> m_net_settings.safe_texture_cache_color_samples;
packet >> m_net_settings.m_PerfQueriesEnable; packet >> m_net_settings.perf_queries_enable;
packet >> m_net_settings.m_FloatExceptions; packet >> m_net_settings.float_exceptions;
packet >> m_net_settings.m_DivideByZeroExceptions; packet >> m_net_settings.divide_by_zero_exceptions;
packet >> m_net_settings.m_FPRF; packet >> m_net_settings.fprf;
packet >> m_net_settings.m_AccurateNaNs; packet >> m_net_settings.accurate_nans;
packet >> m_net_settings.m_DisableICache; packet >> m_net_settings.disable_icache;
packet >> m_net_settings.m_SyncOnSkipIdle; packet >> m_net_settings.sync_on_skip_idle;
packet >> m_net_settings.m_SyncGPU; packet >> m_net_settings.sync_gpu;
packet >> m_net_settings.m_SyncGpuMaxDistance; packet >> m_net_settings.sync_gpu_max_distance;
packet >> m_net_settings.m_SyncGpuMinDistance; packet >> m_net_settings.sync_gpu_min_distance;
packet >> m_net_settings.m_SyncGpuOverclock; packet >> m_net_settings.sync_gpu_overclock;
packet >> m_net_settings.m_JITFollowBranch; packet >> m_net_settings.jit_follow_branch;
packet >> m_net_settings.m_FastDiscSpeed; packet >> m_net_settings.fast_disc_speed;
packet >> m_net_settings.m_MMU; packet >> m_net_settings.mmu;
packet >> m_net_settings.m_Fastmem; packet >> m_net_settings.fastmem;
packet >> m_net_settings.m_SkipIPL; packet >> m_net_settings.skip_ipl;
packet >> m_net_settings.m_LoadIPLDump; packet >> m_net_settings.load_ipl_dump;
packet >> m_net_settings.m_VertexRounding; packet >> m_net_settings.vertex_rounding;
packet >> m_net_settings.m_InternalResolution; packet >> m_net_settings.internal_resolution;
packet >> m_net_settings.m_EFBScaledCopy; packet >> m_net_settings.efb_scaled_copy;
packet >> m_net_settings.m_FastDepthCalc; packet >> m_net_settings.fast_depth_calc;
packet >> m_net_settings.m_EnablePixelLighting; packet >> m_net_settings.enable_pixel_lighting;
packet >> m_net_settings.m_WidescreenHack; packet >> m_net_settings.widescreen_hack;
packet >> m_net_settings.m_ForceFiltering; packet >> m_net_settings.force_filtering;
packet >> m_net_settings.m_MaxAnisotropy; packet >> m_net_settings.max_anisotropy;
packet >> m_net_settings.m_ForceTrueColor; packet >> m_net_settings.force_true_color;
packet >> m_net_settings.m_DisableCopyFilter; packet >> m_net_settings.disable_copy_filter;
packet >> m_net_settings.m_DisableFog; packet >> m_net_settings.disable_fog;
packet >> m_net_settings.m_ArbitraryMipmapDetection; packet >> m_net_settings.arbitrary_mipmap_detection;
packet >> m_net_settings.m_ArbitraryMipmapDetectionThreshold; packet >> m_net_settings.arbitrary_mipmap_detection_threshold;
packet >> m_net_settings.m_EnableGPUTextureDecoding; packet >> m_net_settings.enable_gpu_texture_decoding;
packet >> m_net_settings.m_DeferEFBCopies; packet >> m_net_settings.defer_efb_copies;
packet >> m_net_settings.m_EFBAccessTileSize; packet >> m_net_settings.efb_access_tile_size;
packet >> m_net_settings.m_EFBAccessDeferInvalidation; packet >> m_net_settings.efb_access_defer_invalidation;
packet >> m_net_settings.m_StrictSettingsSync; packet >> m_net_settings.strict_settings_sync;
m_initial_rtc = Common::PacketReadU64(packet); m_initial_rtc = Common::PacketReadU64(packet);
packet >> m_net_settings.m_SyncSaveData; packet >> m_net_settings.sync_save_data;
packet >> m_net_settings.m_SaveDataRegion; packet >> m_net_settings.save_data_region;
packet >> m_net_settings.m_SyncCodes; packet >> m_net_settings.sync_codes;
packet >> m_net_settings.m_SyncAllWiiSaves; packet >> m_net_settings.sync_all_wii_saves;
for (int& extension : m_net_settings.m_WiimoteExtension) for (int& extension : m_net_settings.wiimote_extension)
packet >> extension; packet >> extension;
packet >> m_net_settings.m_GolfMode; packet >> m_net_settings.golf_mode;
packet >> m_net_settings.m_UseFMA; packet >> m_net_settings.use_fma;
packet >> m_net_settings.m_HideRemoteGBAs; packet >> m_net_settings.hide_remote_gbas;
m_net_settings.m_IsHosting = m_local_player->IsHost(); m_net_settings.is_hosting = m_local_player->IsHost();
m_net_settings.m_HostInputAuthority = m_host_input_authority;
} }
m_dialog->OnMsgStartGame(); m_dialog->OnMsgStartGame();
@ -2300,7 +2299,7 @@ void NetPlayClient::SendPowerButtonEvent()
void NetPlayClient::RequestGolfControl(const PlayerId pid) void NetPlayClient::RequestGolfControl(const PlayerId pid)
{ {
if (!m_host_input_authority || !m_net_settings.m_GolfMode) if (!m_host_input_authority || !m_net_settings.golf_mode)
return; return;
sf::Packet packet; sf::Packet packet;
@ -2402,7 +2401,7 @@ void NetPlayClient::SendGameStatus()
for (size_t i = 0; i < 4; ++i) for (size_t i = 0; i < 4; ++i)
{ {
if (m_gba_config[i].enabled && m_gba_config[i].has_rom && if (m_gba_config[i].enabled && m_gba_config[i].has_rom &&
m_net_settings.m_GBARomPaths[i].empty()) m_net_settings.gba_rom_paths[i].empty())
{ {
result = SyncIdentifierComparison::DifferentGame; result = SyncIdentifierComparison::DifferentGame;
} }
@ -2592,7 +2591,7 @@ bool IsSyncingAllWiiSaves()
std::lock_guard lk(crit_netplay_client); std::lock_guard lk(crit_netplay_client);
if (netplay_client) if (netplay_client)
return netplay_client->GetNetSettings().m_SyncAllWiiSaves; return netplay_client->GetNetSettings().sync_all_wii_saves;
return false; return false;
} }
@ -2602,14 +2601,14 @@ void SetupWiimotes()
ASSERT(IsNetPlayRunning()); ASSERT(IsNetPlayRunning());
const NetSettings& netplay_settings = netplay_client->GetNetSettings(); const NetSettings& netplay_settings = netplay_client->GetNetSettings();
const PadMappingArray& wiimote_map = netplay_client->GetWiimoteMapping(); const PadMappingArray& wiimote_map = netplay_client->GetWiimoteMapping();
for (size_t i = 0; i < netplay_settings.m_WiimoteExtension.size(); i++) for (size_t i = 0; i < netplay_settings.wiimote_extension.size(); i++)
{ {
if (wiimote_map[i] > 0) if (wiimote_map[i] > 0)
{ {
static_cast<ControllerEmu::Attachments*>( static_cast<ControllerEmu::Attachments*>(
static_cast<WiimoteEmu::Wiimote*>(Wiimote::GetConfig()->GetController(int(i))) static_cast<WiimoteEmu::Wiimote*>(Wiimote::GetConfig()->GetController(int(i)))
->GetWiimoteGroup(WiimoteEmu::WiimoteGroup::Attachments)) ->GetWiimoteGroup(WiimoteEmu::WiimoteGroup::Attachments))
->SetSelectedAttachment(netplay_settings.m_WiimoteExtension[i]); ->SetSelectedAttachment(netplay_settings.wiimote_extension[i]);
} }
} }
} }
@ -2618,7 +2617,7 @@ std::string GetGBASavePath(int pad_num)
{ {
std::lock_guard lk(crit_netplay_client); std::lock_guard lk(crit_netplay_client);
if (!netplay_client || netplay_client->GetNetSettings().m_IsHosting) if (!netplay_client || netplay_client->GetNetSettings().is_hosting)
{ {
#ifdef HAS_LIBMGBA #ifdef HAS_LIBMGBA
std::string rom_path = Config::Get(Config::MAIN_GBA_ROM_PATHS[pad_num]); std::string rom_path = Config::Get(Config::MAIN_GBA_ROM_PATHS[pad_num]);
@ -2628,7 +2627,7 @@ std::string GetGBASavePath(int pad_num)
#endif #endif
} }
if (!netplay_client->GetNetSettings().m_SyncSaveData) if (!netplay_client->GetNetSettings().sync_save_data)
return {}; return {};
return fmt::format("{}{}{}.sav", File::GetUserPath(D_GBAUSER_IDX), GBA_SAVE_NETPLAY, pad_num + 1); return fmt::format("{}{}{}.sav", File::GetUserPath(D_GBAUSER_IDX), GBA_SAVE_NETPLAY, pad_num + 1);
@ -2664,7 +2663,7 @@ PadDetails GetPadDetails(int pad_num)
} }
res.is_local = netplay_client->IsLocalPlayer(pad_map[pad_num]); res.is_local = netplay_client->IsLocalPlayer(pad_map[pad_num]);
res.local_pad = res.is_local ? local_pad : netplay_client->NumLocalPads() + non_local_pad; res.local_pad = res.is_local ? local_pad : netplay_client->NumLocalPads() + non_local_pad;
res.hide_gba = !res.is_local && netplay_client->GetNetSettings().m_HideRemoteGBAs && res.hide_gba = !res.is_local && netplay_client->GetNetSettings().hide_remote_gbas &&
netplay_client->LocalPlayerHasControllerMapped(); netplay_client->LocalPlayerHasControllerMapped();
return res; return res;
} }

View File

@ -30,85 +30,84 @@ namespace NetPlay
{ {
struct NetSettings struct NetSettings
{ {
bool m_CPUthread = false; bool cpu_thread = false;
PowerPC::CPUCore m_CPUcore{}; PowerPC::CPUCore cpu_core{};
bool m_EnableCheats = false; bool enable_cheats = false;
int m_SelectedLanguage = 0; int selected_language = 0;
bool m_OverrideRegionSettings = false; bool override_region_settings = false;
bool m_DSPHLE = false; bool dsp_hle = false;
bool m_DSPEnableJIT = false; bool dsp_enable_jit = false;
bool m_WriteToMemcard = false; bool write_to_memcard = false;
bool m_RAMOverrideEnable = false; bool ram_override_enable = false;
u32 m_Mem1Size = 0; u32 mem1_size = 0;
u32 m_Mem2Size = 0; u32 mem2_size = 0;
DiscIO::Region m_FallbackRegion{}; DiscIO::Region fallback_region{};
bool m_AllowSDWrites = false; bool allow_sd_writes = false;
bool m_CopyWiiSave = false; bool copy_wii_save = false;
bool m_OCEnable = false; bool oc_enable = false;
float m_OCFactor = 0; float oc_factor = 0;
Common::EnumMap<ExpansionInterface::EXIDeviceType, ExpansionInterface::MAX_SLOT> m_EXIDevice{}; Common::EnumMap<ExpansionInterface::EXIDeviceType, ExpansionInterface::MAX_SLOT> exi_device{};
int m_MemcardSizeOverride = -1; int memcard_size_override = -1;
std::array<u32, Config::SYSCONF_SETTINGS.size()> m_SYSCONFSettings{}; std::array<u32, Config::SYSCONF_SETTINGS.size()> sysconf_settings{};
bool m_EFBAccessEnable = false; bool efb_access_enable = false;
bool m_BBoxEnable = false; bool bbox_enable = false;
bool m_ForceProgressive = false; bool force_progressive = false;
bool m_EFBToTextureEnable = false; bool efb_to_texture_enable = false;
bool m_XFBToTextureEnable = false; bool xfb_to_texture_enable = false;
bool m_DisableCopyToVRAM = false; bool disable_copy_to_vram = false;
bool m_ImmediateXFBEnable = false; bool immediate_xfb_enable = false;
bool m_EFBEmulateFormatChanges = false; bool efb_emulate_format_changes = false;
int m_SafeTextureCacheColorSamples = 0; int safe_texture_cache_color_samples = 0;
bool m_PerfQueriesEnable = false; bool perf_queries_enable = false;
bool m_FloatExceptions = false; bool float_exceptions = false;
bool m_DivideByZeroExceptions = false; bool divide_by_zero_exceptions = false;
bool m_FPRF = false; bool fprf = false;
bool m_AccurateNaNs = false; bool accurate_nans = false;
bool m_DisableICache = false; bool disable_icache = false;
bool m_SyncOnSkipIdle = false; bool sync_on_skip_idle = false;
bool m_SyncGPU = false; bool sync_gpu = false;
int m_SyncGpuMaxDistance = 0; int sync_gpu_max_distance = 0;
int m_SyncGpuMinDistance = 0; int sync_gpu_min_distance = 0;
float m_SyncGpuOverclock = 0; float sync_gpu_overclock = 0;
bool m_JITFollowBranch = false; bool jit_follow_branch = false;
bool m_FastDiscSpeed = false; bool fast_disc_speed = false;
bool m_MMU = false; bool mmu = false;
bool m_Fastmem = false; bool fastmem = false;
bool m_SkipIPL = false; bool skip_ipl = false;
bool m_LoadIPLDump = false; bool load_ipl_dump = false;
bool m_VertexRounding = false; bool vertex_rounding = false;
int m_InternalResolution = 0; int internal_resolution = 0;
bool m_EFBScaledCopy = false; bool efb_scaled_copy = false;
bool m_FastDepthCalc = false; bool fast_depth_calc = false;
bool m_EnablePixelLighting = false; bool enable_pixel_lighting = false;
bool m_WidescreenHack = false; bool widescreen_hack = false;
bool m_ForceFiltering = false; bool force_filtering = false;
int m_MaxAnisotropy = 0; int max_anisotropy = 0;
bool m_ForceTrueColor = false; bool force_true_color = false;
bool m_DisableCopyFilter = false; bool disable_copy_filter = false;
bool m_DisableFog = false; bool disable_fog = false;
bool m_ArbitraryMipmapDetection = false; bool arbitrary_mipmap_detection = false;
float m_ArbitraryMipmapDetectionThreshold = 0; float arbitrary_mipmap_detection_threshold = 0;
bool m_EnableGPUTextureDecoding = false; bool enable_gpu_texture_decoding = false;
bool m_DeferEFBCopies = false; bool defer_efb_copies = false;
int m_EFBAccessTileSize = 0; int efb_access_tile_size = 0;
bool m_EFBAccessDeferInvalidation = false; bool efb_access_defer_invalidation = false;
bool m_StrictSettingsSync = false; bool strict_settings_sync = false;
bool m_SyncSaveData = false; bool sync_save_data = false;
bool m_SyncCodes = false; bool sync_codes = false;
std::string m_SaveDataRegion; std::string save_data_region;
bool m_SyncAllWiiSaves = false; bool sync_all_wii_saves = false;
std::array<int, 4> m_WiimoteExtension{}; std::array<int, 4> wiimote_extension{};
bool m_GolfMode = false; bool golf_mode = false;
bool m_UseFMA = false; bool use_fma = false;
bool m_HideRemoteGBAs = false; bool hide_remote_gbas = false;
// These aren't sent over the network directly // These aren't sent over the network directly
bool m_IsHosting = false; bool is_hosting = false;
bool m_HostInputAuthority = false; std::array<std::string, 4> gba_rom_paths{};
std::array<std::string, 4> m_GBARomPaths{};
}; };
struct NetTraversalConfig struct NetTraversalConfig

View File

@ -862,7 +862,7 @@ unsigned int NetPlayServer::OnData(sf::Packet& packet, Client& player)
if (!m_players.count(pid) || !PlayerHasControllerMapped(player.pid)) if (!m_players.count(pid) || !PlayerHasControllerMapped(player.pid))
break; break;
if (m_host_input_authority && m_settings.m_GolfMode && m_pending_golfer == 0 && if (m_host_input_authority && m_settings.golf_mode && m_pending_golfer == 0 &&
m_current_golfer != pid && PlayerHasControllerMapped(pid)) m_current_golfer != pid && PlayerHasControllerMapped(pid))
{ {
m_pending_golfer = pid; m_pending_golfer = pid;
@ -1254,22 +1254,22 @@ bool NetPlayServer::SetupNetSettings()
ConfigLoaders::GenerateLocalGameConfigLoader(game->GetGameID(), game->GetRevision())); ConfigLoaders::GenerateLocalGameConfigLoader(game->GetGameID(), game->GetRevision()));
// Copy all relevant settings // Copy all relevant settings
settings.m_CPUthread = Config::Get(Config::MAIN_CPU_THREAD); settings.cpu_thread = Config::Get(Config::MAIN_CPU_THREAD);
settings.m_CPUcore = Config::Get(Config::MAIN_CPU_CORE); settings.cpu_core = Config::Get(Config::MAIN_CPU_CORE);
settings.m_EnableCheats = Config::Get(Config::MAIN_ENABLE_CHEATS); settings.enable_cheats = Config::Get(Config::MAIN_ENABLE_CHEATS);
settings.m_SelectedLanguage = Config::Get(Config::MAIN_GC_LANGUAGE); settings.selected_language = Config::Get(Config::MAIN_GC_LANGUAGE);
settings.m_OverrideRegionSettings = Config::Get(Config::MAIN_OVERRIDE_REGION_SETTINGS); settings.override_region_settings = Config::Get(Config::MAIN_OVERRIDE_REGION_SETTINGS);
settings.m_DSPHLE = Config::Get(Config::MAIN_DSP_HLE); settings.dsp_hle = Config::Get(Config::MAIN_DSP_HLE);
settings.m_DSPEnableJIT = Config::Get(Config::MAIN_DSP_JIT); settings.dsp_enable_jit = Config::Get(Config::MAIN_DSP_JIT);
settings.m_WriteToMemcard = Config::Get(Config::NETPLAY_WRITE_SAVE_DATA); settings.write_to_memcard = Config::Get(Config::NETPLAY_WRITE_SAVE_DATA);
settings.m_RAMOverrideEnable = Config::Get(Config::MAIN_RAM_OVERRIDE_ENABLE); settings.ram_override_enable = Config::Get(Config::MAIN_RAM_OVERRIDE_ENABLE);
settings.m_Mem1Size = Config::Get(Config::MAIN_MEM1_SIZE); settings.mem1_size = Config::Get(Config::MAIN_MEM1_SIZE);
settings.m_Mem2Size = Config::Get(Config::MAIN_MEM2_SIZE); settings.mem2_size = Config::Get(Config::MAIN_MEM2_SIZE);
settings.m_FallbackRegion = Config::Get(Config::MAIN_FALLBACK_REGION); settings.fallback_region = Config::Get(Config::MAIN_FALLBACK_REGION);
settings.m_AllowSDWrites = Config::Get(Config::MAIN_ALLOW_SD_WRITES); settings.allow_sd_writes = Config::Get(Config::MAIN_ALLOW_SD_WRITES);
settings.m_CopyWiiSave = Config::Get(Config::NETPLAY_LOAD_WII_SAVE); settings.copy_wii_save = Config::Get(Config::NETPLAY_LOAD_WII_SAVE);
settings.m_OCEnable = Config::Get(Config::MAIN_OVERCLOCK_ENABLE); settings.oc_enable = Config::Get(Config::MAIN_OVERCLOCK_ENABLE);
settings.m_OCFactor = Config::Get(Config::MAIN_OVERCLOCK); settings.oc_factor = Config::Get(Config::MAIN_OVERCLOCK);
for (ExpansionInterface::Slot slot : ExpansionInterface::SLOTS) for (ExpansionInterface::Slot slot : ExpansionInterface::SLOTS)
{ {
@ -1283,75 +1283,75 @@ bool NetPlayServer::SetupNetSettings()
{ {
device = Config::Get(Config::GetInfoForEXIDevice(slot)); device = Config::Get(Config::GetInfoForEXIDevice(slot));
} }
settings.m_EXIDevice[slot] = device; settings.exi_device[slot] = device;
} }
settings.m_MemcardSizeOverride = Config::Get(Config::MAIN_MEMORY_CARD_SIZE); settings.memcard_size_override = Config::Get(Config::MAIN_MEMORY_CARD_SIZE);
for (size_t i = 0; i < Config::SYSCONF_SETTINGS.size(); ++i) for (size_t i = 0; i < Config::SYSCONF_SETTINGS.size(); ++i)
{ {
std::visit( std::visit(
[&](auto* info) { [&](auto* info) {
static_assert(sizeof(info->GetDefaultValue()) <= sizeof(u32)); static_assert(sizeof(info->GetDefaultValue()) <= sizeof(u32));
settings.m_SYSCONFSettings[i] = static_cast<u32>(Config::Get(*info)); settings.sysconf_settings[i] = static_cast<u32>(Config::Get(*info));
}, },
Config::SYSCONF_SETTINGS[i].config_info); Config::SYSCONF_SETTINGS[i].config_info);
} }
settings.m_EFBAccessEnable = Config::Get(Config::GFX_HACK_EFB_ACCESS_ENABLE); settings.efb_access_enable = Config::Get(Config::GFX_HACK_EFB_ACCESS_ENABLE);
settings.m_BBoxEnable = Config::Get(Config::GFX_HACK_BBOX_ENABLE); settings.bbox_enable = Config::Get(Config::GFX_HACK_BBOX_ENABLE);
settings.m_ForceProgressive = Config::Get(Config::GFX_HACK_FORCE_PROGRESSIVE); settings.force_progressive = Config::Get(Config::GFX_HACK_FORCE_PROGRESSIVE);
settings.m_EFBToTextureEnable = Config::Get(Config::GFX_HACK_SKIP_EFB_COPY_TO_RAM); settings.efb_to_texture_enable = Config::Get(Config::GFX_HACK_SKIP_EFB_COPY_TO_RAM);
settings.m_XFBToTextureEnable = Config::Get(Config::GFX_HACK_SKIP_XFB_COPY_TO_RAM); settings.xfb_to_texture_enable = Config::Get(Config::GFX_HACK_SKIP_XFB_COPY_TO_RAM);
settings.m_DisableCopyToVRAM = Config::Get(Config::GFX_HACK_DISABLE_COPY_TO_VRAM); settings.disable_copy_to_vram = Config::Get(Config::GFX_HACK_DISABLE_COPY_TO_VRAM);
settings.m_ImmediateXFBEnable = Config::Get(Config::GFX_HACK_IMMEDIATE_XFB); settings.immediate_xfb_enable = Config::Get(Config::GFX_HACK_IMMEDIATE_XFB);
settings.m_EFBEmulateFormatChanges = Config::Get(Config::GFX_HACK_EFB_EMULATE_FORMAT_CHANGES); settings.efb_emulate_format_changes = Config::Get(Config::GFX_HACK_EFB_EMULATE_FORMAT_CHANGES);
settings.m_SafeTextureCacheColorSamples = settings.safe_texture_cache_color_samples =
Config::Get(Config::GFX_SAFE_TEXTURE_CACHE_COLOR_SAMPLES); Config::Get(Config::GFX_SAFE_TEXTURE_CACHE_COLOR_SAMPLES);
settings.m_PerfQueriesEnable = Config::Get(Config::GFX_PERF_QUERIES_ENABLE); settings.perf_queries_enable = Config::Get(Config::GFX_PERF_QUERIES_ENABLE);
settings.m_FloatExceptions = Config::Get(Config::MAIN_FLOAT_EXCEPTIONS); settings.float_exceptions = Config::Get(Config::MAIN_FLOAT_EXCEPTIONS);
settings.m_DivideByZeroExceptions = Config::Get(Config::MAIN_DIVIDE_BY_ZERO_EXCEPTIONS); settings.divide_by_zero_exceptions = Config::Get(Config::MAIN_DIVIDE_BY_ZERO_EXCEPTIONS);
settings.m_FPRF = Config::Get(Config::MAIN_FPRF); settings.fprf = Config::Get(Config::MAIN_FPRF);
settings.m_AccurateNaNs = Config::Get(Config::MAIN_ACCURATE_NANS); settings.accurate_nans = Config::Get(Config::MAIN_ACCURATE_NANS);
settings.m_DisableICache = Config::Get(Config::MAIN_DISABLE_ICACHE); settings.disable_icache = Config::Get(Config::MAIN_DISABLE_ICACHE);
settings.m_SyncOnSkipIdle = Config::Get(Config::MAIN_SYNC_ON_SKIP_IDLE); settings.sync_on_skip_idle = Config::Get(Config::MAIN_SYNC_ON_SKIP_IDLE);
settings.m_SyncGPU = Config::Get(Config::MAIN_SYNC_GPU); settings.sync_gpu = Config::Get(Config::MAIN_SYNC_GPU);
settings.m_SyncGpuMaxDistance = Config::Get(Config::MAIN_SYNC_GPU_MAX_DISTANCE); settings.sync_gpu_max_distance = Config::Get(Config::MAIN_SYNC_GPU_MAX_DISTANCE);
settings.m_SyncGpuMinDistance = Config::Get(Config::MAIN_SYNC_GPU_MIN_DISTANCE); settings.sync_gpu_min_distance = Config::Get(Config::MAIN_SYNC_GPU_MIN_DISTANCE);
settings.m_SyncGpuOverclock = Config::Get(Config::MAIN_SYNC_GPU_OVERCLOCK); settings.sync_gpu_overclock = Config::Get(Config::MAIN_SYNC_GPU_OVERCLOCK);
settings.m_JITFollowBranch = Config::Get(Config::MAIN_JIT_FOLLOW_BRANCH); settings.jit_follow_branch = Config::Get(Config::MAIN_JIT_FOLLOW_BRANCH);
settings.m_FastDiscSpeed = Config::Get(Config::MAIN_FAST_DISC_SPEED); settings.fast_disc_speed = Config::Get(Config::MAIN_FAST_DISC_SPEED);
settings.m_MMU = Config::Get(Config::MAIN_MMU); settings.mmu = Config::Get(Config::MAIN_MMU);
settings.m_Fastmem = Config::Get(Config::MAIN_FASTMEM); settings.fastmem = Config::Get(Config::MAIN_FASTMEM);
settings.m_SkipIPL = Config::Get(Config::MAIN_SKIP_IPL) || !DoAllPlayersHaveIPLDump(); settings.skip_ipl = Config::Get(Config::MAIN_SKIP_IPL) || !DoAllPlayersHaveIPLDump();
settings.m_LoadIPLDump = Config::Get(Config::SESSION_LOAD_IPL_DUMP) && DoAllPlayersHaveIPLDump(); settings.load_ipl_dump = Config::Get(Config::SESSION_LOAD_IPL_DUMP) && DoAllPlayersHaveIPLDump();
settings.m_VertexRounding = Config::Get(Config::GFX_HACK_VERTEX_ROUNDING); settings.vertex_rounding = Config::Get(Config::GFX_HACK_VERTEX_ROUNDING);
settings.m_InternalResolution = Config::Get(Config::GFX_EFB_SCALE); settings.internal_resolution = Config::Get(Config::GFX_EFB_SCALE);
settings.m_EFBScaledCopy = Config::Get(Config::GFX_HACK_COPY_EFB_SCALED); settings.efb_scaled_copy = Config::Get(Config::GFX_HACK_COPY_EFB_SCALED);
settings.m_FastDepthCalc = Config::Get(Config::GFX_FAST_DEPTH_CALC); settings.fast_depth_calc = Config::Get(Config::GFX_FAST_DEPTH_CALC);
settings.m_EnablePixelLighting = Config::Get(Config::GFX_ENABLE_PIXEL_LIGHTING); settings.enable_pixel_lighting = Config::Get(Config::GFX_ENABLE_PIXEL_LIGHTING);
settings.m_WidescreenHack = Config::Get(Config::GFX_WIDESCREEN_HACK); settings.widescreen_hack = Config::Get(Config::GFX_WIDESCREEN_HACK);
settings.m_ForceFiltering = Config::Get(Config::GFX_ENHANCE_FORCE_FILTERING); settings.force_filtering = Config::Get(Config::GFX_ENHANCE_FORCE_FILTERING);
settings.m_MaxAnisotropy = Config::Get(Config::GFX_ENHANCE_MAX_ANISOTROPY); settings.max_anisotropy = Config::Get(Config::GFX_ENHANCE_MAX_ANISOTROPY);
settings.m_ForceTrueColor = Config::Get(Config::GFX_ENHANCE_FORCE_TRUE_COLOR); settings.force_true_color = Config::Get(Config::GFX_ENHANCE_FORCE_TRUE_COLOR);
settings.m_DisableCopyFilter = Config::Get(Config::GFX_ENHANCE_DISABLE_COPY_FILTER); settings.disable_copy_filter = Config::Get(Config::GFX_ENHANCE_DISABLE_COPY_FILTER);
settings.m_DisableFog = Config::Get(Config::GFX_DISABLE_FOG); settings.disable_fog = Config::Get(Config::GFX_DISABLE_FOG);
settings.m_ArbitraryMipmapDetection = Config::Get(Config::GFX_ENHANCE_ARBITRARY_MIPMAP_DETECTION); settings.arbitrary_mipmap_detection = Config::Get(Config::GFX_ENHANCE_ARBITRARY_MIPMAP_DETECTION);
settings.m_ArbitraryMipmapDetectionThreshold = settings.arbitrary_mipmap_detection_threshold =
Config::Get(Config::GFX_ENHANCE_ARBITRARY_MIPMAP_DETECTION_THRESHOLD); Config::Get(Config::GFX_ENHANCE_ARBITRARY_MIPMAP_DETECTION_THRESHOLD);
settings.m_EnableGPUTextureDecoding = Config::Get(Config::GFX_ENABLE_GPU_TEXTURE_DECODING); settings.enable_gpu_texture_decoding = Config::Get(Config::GFX_ENABLE_GPU_TEXTURE_DECODING);
settings.m_DeferEFBCopies = Config::Get(Config::GFX_HACK_DEFER_EFB_COPIES); settings.defer_efb_copies = Config::Get(Config::GFX_HACK_DEFER_EFB_COPIES);
settings.m_EFBAccessTileSize = Config::Get(Config::GFX_HACK_EFB_ACCESS_TILE_SIZE); settings.efb_access_tile_size = Config::Get(Config::GFX_HACK_EFB_ACCESS_TILE_SIZE);
settings.m_EFBAccessDeferInvalidation = Config::Get(Config::GFX_HACK_EFB_DEFER_INVALIDATION); settings.efb_access_defer_invalidation = Config::Get(Config::GFX_HACK_EFB_DEFER_INVALIDATION);
settings.m_StrictSettingsSync = Config::Get(Config::NETPLAY_STRICT_SETTINGS_SYNC); settings.strict_settings_sync = Config::Get(Config::NETPLAY_STRICT_SETTINGS_SYNC);
settings.m_SyncSaveData = Config::Get(Config::NETPLAY_SYNC_SAVES); settings.sync_save_data = Config::Get(Config::NETPLAY_SYNC_SAVES);
settings.m_SyncCodes = Config::Get(Config::NETPLAY_SYNC_CODES); settings.sync_codes = Config::Get(Config::NETPLAY_SYNC_CODES);
settings.m_SyncAllWiiSaves = settings.sync_all_wii_saves =
Config::Get(Config::NETPLAY_SYNC_ALL_WII_SAVES) && Config::Get(Config::NETPLAY_SYNC_SAVES); Config::Get(Config::NETPLAY_SYNC_ALL_WII_SAVES) && Config::Get(Config::NETPLAY_SYNC_SAVES);
settings.m_GolfMode = Config::Get(Config::NETPLAY_NETWORK_MODE) == "golf"; settings.golf_mode = Config::Get(Config::NETPLAY_NETWORK_MODE) == "golf";
settings.m_UseFMA = DoAllPlayersHaveHardwareFMA(); settings.use_fma = DoAllPlayersHaveHardwareFMA();
settings.m_HideRemoteGBAs = Config::Get(Config::NETPLAY_HIDE_REMOTE_GBAS); settings.hide_remote_gbas = Config::Get(Config::NETPLAY_HIDE_REMOTE_GBAS);
// Unload GameINI to restore things to normal // Unload GameINI to restore things to normal
Config::RemoveLayer(Config::LayerType::GlobalGame); Config::RemoveLayer(Config::LayerType::GlobalGame);
@ -1382,7 +1382,7 @@ bool NetPlayServer::RequestStartGame()
bool start_now = true; bool start_now = true;
if (m_settings.m_SyncSaveData && m_players.size() > 1) if (m_settings.sync_save_data && m_players.size() > 1)
{ {
start_now = false; start_now = false;
m_start_pending = true; m_start_pending = true;
@ -1395,7 +1395,7 @@ bool NetPlayServer::RequestStartGame()
} }
// Check To Send Codes to Clients // Check To Send Codes to Clients
if (m_settings.m_SyncCodes && m_players.size() > 1) if (m_settings.sync_codes && m_players.size() > 1)
{ {
start_now = false; start_now = false;
m_start_pending = true; m_start_pending = true;
@ -1455,82 +1455,82 @@ bool NetPlayServer::StartGame()
sf::Packet spac; sf::Packet spac;
spac << MessageID::StartGame; spac << MessageID::StartGame;
spac << m_current_game; spac << m_current_game;
spac << m_settings.m_CPUthread; spac << m_settings.cpu_thread;
spac << m_settings.m_CPUcore; spac << m_settings.cpu_core;
spac << m_settings.m_EnableCheats; spac << m_settings.enable_cheats;
spac << m_settings.m_SelectedLanguage; spac << m_settings.selected_language;
spac << m_settings.m_OverrideRegionSettings; spac << m_settings.override_region_settings;
spac << m_settings.m_DSPEnableJIT; spac << m_settings.dsp_enable_jit;
spac << m_settings.m_DSPHLE; spac << m_settings.dsp_hle;
spac << m_settings.m_WriteToMemcard; spac << m_settings.write_to_memcard;
spac << m_settings.m_RAMOverrideEnable; spac << m_settings.ram_override_enable;
spac << m_settings.m_Mem1Size; spac << m_settings.mem1_size;
spac << m_settings.m_Mem2Size; spac << m_settings.mem2_size;
spac << m_settings.m_FallbackRegion; spac << m_settings.fallback_region;
spac << m_settings.m_AllowSDWrites; spac << m_settings.allow_sd_writes;
spac << m_settings.m_CopyWiiSave; spac << m_settings.copy_wii_save;
spac << m_settings.m_OCEnable; spac << m_settings.oc_enable;
spac << m_settings.m_OCFactor; spac << m_settings.oc_factor;
for (auto slot : ExpansionInterface::SLOTS) for (auto slot : ExpansionInterface::SLOTS)
spac << static_cast<int>(m_settings.m_EXIDevice[slot]); spac << static_cast<int>(m_settings.exi_device[slot]);
spac << m_settings.m_MemcardSizeOverride; spac << m_settings.memcard_size_override;
for (u32 value : m_settings.m_SYSCONFSettings) for (u32 value : m_settings.sysconf_settings)
spac << value; spac << value;
spac << m_settings.m_EFBAccessEnable; spac << m_settings.efb_access_enable;
spac << m_settings.m_BBoxEnable; spac << m_settings.bbox_enable;
spac << m_settings.m_ForceProgressive; spac << m_settings.force_progressive;
spac << m_settings.m_EFBToTextureEnable; spac << m_settings.efb_to_texture_enable;
spac << m_settings.m_XFBToTextureEnable; spac << m_settings.xfb_to_texture_enable;
spac << m_settings.m_DisableCopyToVRAM; spac << m_settings.disable_copy_to_vram;
spac << m_settings.m_ImmediateXFBEnable; spac << m_settings.immediate_xfb_enable;
spac << m_settings.m_EFBEmulateFormatChanges; spac << m_settings.efb_emulate_format_changes;
spac << m_settings.m_SafeTextureCacheColorSamples; spac << m_settings.safe_texture_cache_color_samples;
spac << m_settings.m_PerfQueriesEnable; spac << m_settings.perf_queries_enable;
spac << m_settings.m_FloatExceptions; spac << m_settings.float_exceptions;
spac << m_settings.m_DivideByZeroExceptions; spac << m_settings.divide_by_zero_exceptions;
spac << m_settings.m_FPRF; spac << m_settings.fprf;
spac << m_settings.m_AccurateNaNs; spac << m_settings.accurate_nans;
spac << m_settings.m_DisableICache; spac << m_settings.disable_icache;
spac << m_settings.m_SyncOnSkipIdle; spac << m_settings.sync_on_skip_idle;
spac << m_settings.m_SyncGPU; spac << m_settings.sync_gpu;
spac << m_settings.m_SyncGpuMaxDistance; spac << m_settings.sync_gpu_max_distance;
spac << m_settings.m_SyncGpuMinDistance; spac << m_settings.sync_gpu_min_distance;
spac << m_settings.m_SyncGpuOverclock; spac << m_settings.sync_gpu_overclock;
spac << m_settings.m_JITFollowBranch; spac << m_settings.jit_follow_branch;
spac << m_settings.m_FastDiscSpeed; spac << m_settings.fast_disc_speed;
spac << m_settings.m_MMU; spac << m_settings.mmu;
spac << m_settings.m_Fastmem; spac << m_settings.fastmem;
spac << m_settings.m_SkipIPL; spac << m_settings.skip_ipl;
spac << m_settings.m_LoadIPLDump; spac << m_settings.load_ipl_dump;
spac << m_settings.m_VertexRounding; spac << m_settings.vertex_rounding;
spac << m_settings.m_InternalResolution; spac << m_settings.internal_resolution;
spac << m_settings.m_EFBScaledCopy; spac << m_settings.efb_scaled_copy;
spac << m_settings.m_FastDepthCalc; spac << m_settings.fast_depth_calc;
spac << m_settings.m_EnablePixelLighting; spac << m_settings.enable_pixel_lighting;
spac << m_settings.m_WidescreenHack; spac << m_settings.widescreen_hack;
spac << m_settings.m_ForceFiltering; spac << m_settings.force_filtering;
spac << m_settings.m_MaxAnisotropy; spac << m_settings.max_anisotropy;
spac << m_settings.m_ForceTrueColor; spac << m_settings.force_true_color;
spac << m_settings.m_DisableCopyFilter; spac << m_settings.disable_copy_filter;
spac << m_settings.m_DisableFog; spac << m_settings.disable_fog;
spac << m_settings.m_ArbitraryMipmapDetection; spac << m_settings.arbitrary_mipmap_detection;
spac << m_settings.m_ArbitraryMipmapDetectionThreshold; spac << m_settings.arbitrary_mipmap_detection_threshold;
spac << m_settings.m_EnableGPUTextureDecoding; spac << m_settings.enable_gpu_texture_decoding;
spac << m_settings.m_DeferEFBCopies; spac << m_settings.defer_efb_copies;
spac << m_settings.m_EFBAccessTileSize; spac << m_settings.efb_access_tile_size;
spac << m_settings.m_EFBAccessDeferInvalidation; spac << m_settings.efb_access_defer_invalidation;
spac << m_settings.m_StrictSettingsSync; spac << m_settings.strict_settings_sync;
spac << initial_rtc; spac << initial_rtc;
spac << m_settings.m_SyncSaveData; spac << m_settings.sync_save_data;
spac << region; spac << region;
spac << m_settings.m_SyncCodes; spac << m_settings.sync_codes;
spac << m_settings.m_SyncAllWiiSaves; spac << m_settings.sync_all_wii_saves;
for (size_t i = 0; i < m_settings.m_WiimoteExtension.size(); i++) for (size_t i = 0; i < m_settings.wiimote_extension.size(); i++)
{ {
const int extension = const int extension =
static_cast<ControllerEmu::Attachments*>( static_cast<ControllerEmu::Attachments*>(
@ -1540,9 +1540,9 @@ bool NetPlayServer::StartGame()
spac << extension; spac << extension;
} }
spac << m_settings.m_GolfMode; spac << m_settings.golf_mode;
spac << m_settings.m_UseFMA; spac << m_settings.use_fma;
spac << m_settings.m_HideRemoteGBAs; spac << m_settings.hide_remote_gbas;
SendAsyncToClients(std::move(spac)); SendAsyncToClients(std::move(spac));
@ -1574,7 +1574,7 @@ bool NetPlayServer::SyncSaveData()
for (ExpansionInterface::Slot slot : ExpansionInterface::MEMCARD_SLOTS) for (ExpansionInterface::Slot slot : ExpansionInterface::MEMCARD_SLOTS)
{ {
if (m_settings.m_EXIDevice[slot] == ExpansionInterface::EXIDeviceType::MemoryCard || if (m_settings.exi_device[slot] == ExpansionInterface::EXIDeviceType::MemoryCard ||
Config::Get(Config::GetInfoForEXIDevice(slot)) == Config::Get(Config::GetInfoForEXIDevice(slot)) ==
ExpansionInterface::EXIDeviceType::MemoryCardFolder) ExpansionInterface::EXIDeviceType::MemoryCardFolder)
{ {
@ -1590,7 +1590,7 @@ bool NetPlayServer::SyncSaveData()
} }
bool wii_save = false; bool wii_save = false;
if (m_settings.m_CopyWiiSave && (game->GetPlatform() == DiscIO::Platform::WiiDisc || if (m_settings.copy_wii_save && (game->GetPlatform() == DiscIO::Platform::WiiDisc ||
game->GetPlatform() == DiscIO::Platform::WiiWAD || game->GetPlatform() == DiscIO::Platform::WiiWAD ||
game->GetPlatform() == DiscIO::Platform::ELFOrDOL)) game->GetPlatform() == DiscIO::Platform::ELFOrDOL))
{ {
@ -1635,9 +1635,9 @@ bool NetPlayServer::SyncSaveData()
{ {
const bool is_slot_a = slot == ExpansionInterface::Slot::A; const bool is_slot_a = slot == ExpansionInterface::Slot::A;
if (m_settings.m_EXIDevice[slot] == ExpansionInterface::EXIDeviceType::MemoryCard) if (m_settings.exi_device[slot] == ExpansionInterface::EXIDeviceType::MemoryCard)
{ {
const int size_override = m_settings.m_MemcardSizeOverride; const int size_override = m_settings.memcard_size_override;
const u16 card_size_mbits = const u16 card_size_mbits =
size_override >= 0 && size_override <= 4 ? size_override >= 0 && size_override <= 4 ?
static_cast<u16>(Memcard::MBIT_SIZE_MEMORY_CARD_59 << size_override) : static_cast<u16>(Memcard::MBIT_SIZE_MEMORY_CARD_59 << size_override) :
@ -1703,7 +1703,7 @@ bool NetPlayServer::SyncSaveData()
const auto configured_fs = IOS::HLE::FS::MakeFileSystem(IOS::HLE::FS::Location::Configured); const auto configured_fs = IOS::HLE::FS::MakeFileSystem(IOS::HLE::FS::Location::Configured);
std::vector<std::pair<u64, WiiSave::StoragePointer>> saves; std::vector<std::pair<u64, WiiSave::StoragePointer>> saves;
if (m_settings.m_SyncAllWiiSaves) if (m_settings.sync_all_wii_saves)
{ {
IOS::HLE::Kernel ios; IOS::HLE::Kernel ios;
for (const u64 title : ios.GetES()->GetInstalledTitles()) for (const u64 title : ios.GetES()->GetInstalledTitles())

View File

@ -850,8 +850,7 @@ void NetPlayDialog::OnMsgStartGame()
g_netplay_chat_ui = g_netplay_chat_ui =
std::make_unique<NetPlayChatUI>([this](const std::string& message) { SendMessage(message); }); std::make_unique<NetPlayChatUI>([this](const std::string& message) { SendMessage(message); });
if (m_host_input_authority && if (m_host_input_authority && Settings::Instance().GetNetPlayClient()->GetNetSettings().golf_mode)
Settings::Instance().GetNetPlayClient()->GetNetSettings().m_GolfMode)
{ {
g_netplay_golf_ui = std::make_unique<NetPlayGolfUI>(Settings::Instance().GetNetPlayClient()); g_netplay_golf_ui = std::make_unique<NetPlayGolfUI>(Settings::Instance().GetNetPlayClient());
} }