From 3d9527a30ff1b63ad23f45aba53c7f30d94ac80e Mon Sep 17 00:00:00 2001 From: Sketch <75850871+SketchMaster2001@users.noreply.github.com> Date: Wed, 7 Jun 2023 21:11:05 -0400 Subject: [PATCH] Add default support for WiiLink + configuration --- Data/Sys/GameSettings/HAF.ini | 5 + Data/Sys/GameSettings/HAT.ini | 20 --- Data/Sys/GameSettings/HATE01.ini | 38 +++++ Source/Core/Common/StringUtil.h | 33 ++++- Source/Core/Core/CMakeLists.txt | 2 + Source/Core/Core/CommonTitles.h | 24 ++++ Source/Core/Core/Config/MainSettings.cpp | 1 + Source/Core/Core/Config/MainSettings.h | 1 + Source/Core/Core/ConfigManager.cpp | 2 + Source/Core/Core/IOS/Network/IP/Top.cpp | 6 + Source/Core/Core/IOS/Network/KD/NWC24DL.cpp | 5 + Source/Core/Core/IOS/Network/KD/NWC24DL.h | 1 + .../Core/Core/IOS/Network/KD/NetKDRequest.cpp | 18 ++- Source/Core/Core/IOS/Network/Socket.cpp | 7 + Source/Core/Core/WC24PatchEngine.cpp | 136 ++++++++++++++++++ Source/Core/Core/WC24PatchEngine.h | 30 ++++ Source/Core/DolphinLib.props | 2 + Source/Core/DolphinQt/Settings/WiiPane.cpp | 10 ++ Source/Core/DolphinQt/Settings/WiiPane.h | 1 + 19 files changed, 319 insertions(+), 23 deletions(-) create mode 100644 Data/Sys/GameSettings/HAF.ini delete mode 100644 Data/Sys/GameSettings/HAT.ini create mode 100644 Data/Sys/GameSettings/HATE01.ini create mode 100644 Source/Core/Core/WC24PatchEngine.cpp create mode 100644 Source/Core/Core/WC24PatchEngine.h diff --git a/Data/Sys/GameSettings/HAF.ini b/Data/Sys/GameSettings/HAF.ini new file mode 100644 index 000000000000..68679160a538 --- /dev/null +++ b/Data/Sys/GameSettings/HAF.ini @@ -0,0 +1,5 @@ +# HAFE01 - Forecast Channel + +[WC24Patch] +$Main +weather.wapp.wii.com:fore.wiilink24.com:1 \ No newline at end of file diff --git a/Data/Sys/GameSettings/HAT.ini b/Data/Sys/GameSettings/HAT.ini deleted file mode 100644 index 770b296d0995..000000000000 --- a/Data/Sys/GameSettings/HAT.ini +++ /dev/null @@ -1,20 +0,0 @@ -# HATE01 - Nintendo Channel - -[Core] -# Values set here will override the main Dolphin settings. - -[OnLoad] -# Add memory patches to be loaded once on boot here. - -[OnFrame] -# Add memory patches to be applied every frame here. - -[ActionReplay] -# Add action replay cheats here. - -[Video] - -[Video_Settings] - -[Video_Hacks] -ImmediateXFBEnable = False diff --git a/Data/Sys/GameSettings/HATE01.ini b/Data/Sys/GameSettings/HATE01.ini new file mode 100644 index 000000000000..fd9cecded63a --- /dev/null +++ b/Data/Sys/GameSettings/HATE01.ini @@ -0,0 +1,38 @@ +# HATE01 - Nintendo Channel (NTSC-U) + +[Core] +# Values set here will override the main Dolphin settings. + +[OnLoad] +# Add memory patches to be loaded once on boot here. + +[OnFrame] +# Add memory patches to be applied every frame here. + +[ActionReplay] +# Add action replay cheats here. + +[Video] + +[Video_Settings] + +[Video_Hacks] +ImmediateXFBEnable = False + +[Gecko] +$SSL Patch [Papelli] +2A35AB5C 00003A2F +80010000 0035AA4D +8A00570F 0035AA4C +80010000 0035AACD +8A00380F 0035AACC +80010000 0035AB0D +8A004A0F 0035AB0C +80010000 0035AB5D +8A00390F 0035AB5C +E2000001 00000000 + +[WC24Patch] +$Main +a248.e.akamai.net:nc.wiinoma.com:0 +entu.wapp.wii.com:ncc.wiilink24.com:1 \ No newline at end of file diff --git a/Source/Core/Common/StringUtil.h b/Source/Core/Common/StringUtil.h index 262af614b777..128f6dded24b 100644 --- a/Source/Core/Common/StringUtil.h +++ b/Source/Core/Common/StringUtil.h @@ -17,6 +17,22 @@ #include "Common/CommonTypes.h" +namespace detail +{ +template +constexpr bool IsBooleanEnum() +{ + if constexpr (std::is_enum_v) + { + return std::is_same_v, bool>; + } + else + { + return false; + } +} +} // namespace detail + std::string StringFromFormatV(const char* format, va_list args); std::string StringFromFormat(const char* format, ...) @@ -54,8 +70,10 @@ void TruncateToCString(std::string* s); bool TryParse(const std::string& str, bool* output); -template || std::is_enum_v>* = nullptr> -bool TryParse(const std::string& str, T* output, int base = 0) +template +requires(std::is_integral_v || + (std::is_enum_v && !detail::IsBooleanEnum())) bool TryParse(const std::string& str, + T* output, int base = 0) { char* end_ptr = nullptr; @@ -92,6 +110,17 @@ bool TryParse(const std::string& str, T* output, int base = 0) return true; } +template +requires(detail::IsBooleanEnum()) bool TryParse(const std::string& str, T* output) +{ + bool value; + if (!TryParse(str, &value)) + return false; + + *output = static_cast(value); + return true; +} + template >* = nullptr> bool TryParse(std::string str, T* const output) { diff --git a/Source/Core/Core/CMakeLists.txt b/Source/Core/Core/CMakeLists.txt index f6fb444118cc..709feba8eaa8 100644 --- a/Source/Core/Core/CMakeLists.txt +++ b/Source/Core/Core/CMakeLists.txt @@ -516,6 +516,8 @@ add_library(core System.h TitleDatabase.cpp TitleDatabase.h + WC24PatchEngine.cpp + WC24PatchEngine.h WiiRoot.cpp WiiRoot.h WiiUtils.cpp diff --git a/Source/Core/Core/CommonTitles.h b/Source/Core/Core/CommonTitles.h index e9aefc919e1b..50c8b4d742ca 100644 --- a/Source/Core/Core/CommonTitles.h +++ b/Source/Core/Core/CommonTitles.h @@ -15,6 +15,30 @@ constexpr u64 SHOP = 0x0001000248414241; constexpr u64 KOREAN_SHOP = 0x000100024841424b; +constexpr u64 FORECAST_CHANNEL_NTSC_U = 0x0001000248414645; + +constexpr u64 FORECAST_CHANNEL_NTSC_J = 0x000100024841464a; + +constexpr u64 FORECAST_CHANNEL_PAL = 0x0001000248414650; + +constexpr u64 NINTENDO_CHANNEL_NTSC_U = 0x0001000148415445; + +constexpr u64 NINTENDO_CHANNEL_NTSC_J = 0x000100014841544a; + +constexpr u64 NINTENDO_CHANNEL_PAL = 0x0001000148415450; + +constexpr u64 NEWS_CHANNEL_NTSC_U = 0x0001000248414745; + +constexpr u64 NEWS_CHANNEL_NTSC_J = 0x000100024841474a; + +constexpr u64 NEWS_CHANNEL_PAL = 0x0001000248414750; + +constexpr u64 EVERYBODY_VOTES_CHANNEL_NTSC_U = 0x0001000148414a45; + +constexpr u64 EVERYBODY_VOTES_CHANNEL_NTSC_J = 0x0001000148414a4a; + +constexpr u64 EVERYBODY_VOTES_CHANNEL_PAL = 0x0001000148414a50; + constexpr u64 IOS(u32 major_version) { return 0x0000000100000000 | major_version; diff --git a/Source/Core/Core/Config/MainSettings.cpp b/Source/Core/Core/Config/MainSettings.cpp index 97b1c2e91669..318b543154c6 100644 --- a/Source/Core/Core/Config/MainSettings.cpp +++ b/Source/Core/Core/Config/MainSettings.cpp @@ -241,6 +241,7 @@ const Info MAIN_ALLOW_SD_WRITES{{System::Main, "Core", "WiiSDCardAllowWrit const Info MAIN_ENABLE_SAVESTATES{{System::Main, "Core", "EnableSaveStates"}, false}; const Info MAIN_REAL_WII_REMOTE_REPEAT_REPORTS{ {System::Main, "Core", "RealWiiRemoteRepeatReports"}, true}; +const Info MAIN_WII_WIILINK_ENABLE{{System::Main, "Core", "EnableWiiLink"}, true}; // Empty means use the Dolphin default URL const Info MAIN_WII_NUS_SHOP_URL{{System::Main, "Core", "WiiNusShopUrl"}, ""}; diff --git a/Source/Core/Core/Config/MainSettings.h b/Source/Core/Core/Config/MainSettings.h index bb9db9322807..0d591ee5db37 100644 --- a/Source/Core/Core/Config/MainSettings.h +++ b/Source/Core/Core/Config/MainSettings.h @@ -150,6 +150,7 @@ extern const Info MAIN_FALLBACK_REGION; extern const Info MAIN_REAL_WII_REMOTE_REPEAT_REPORTS; extern const Info MAIN_OVERRIDE_BOOT_IOS; extern const Info MAIN_WII_NUS_SHOP_URL; +extern const Info MAIN_WII_WIILINK_ENABLE; // Main.DSP diff --git a/Source/Core/Core/ConfigManager.cpp b/Source/Core/Core/ConfigManager.cpp index 64aa1e1b47e9..5d247f980cac 100644 --- a/Source/Core/Core/ConfigManager.cpp +++ b/Source/Core/Core/ConfigManager.cpp @@ -54,6 +54,7 @@ #include "Core/TitleDatabase.h" #include "VideoCommon/HiresTextures.h" +#include "Core/WC24PatchEngine.h" #include "DiscIO/Enums.h" #include "DiscIO/Volume.h" #include "DiscIO/VolumeWad.h" @@ -206,6 +207,7 @@ void SConfig::OnNewTitleLoad(const Core::CPUThreadGuard& guard) HLE::Reload(system); PatchEngine::Reload(); HiresTexture::Update(); + WC24PatchEngine::Reload(); } void SConfig::LoadDefaults() diff --git a/Source/Core/Core/IOS/Network/IP/Top.cpp b/Source/Core/Core/IOS/Network/IP/Top.cpp index 7da4ddfdf954..12a6cda53b59 100644 --- a/Source/Core/Core/IOS/Network/IP/Top.cpp +++ b/Source/Core/Core/IOS/Network/IP/Top.cpp @@ -32,6 +32,7 @@ #include "Core/IOS/Network/MACUtils.h" #include "Core/IOS/Network/Socket.h" #include "Core/System.h" +#include "Core/WC24PatchEngine.h" #ifdef _WIN32 #include @@ -1056,6 +1057,11 @@ IPCReply NetIPTopDevice::HandleGetAddressInfoRequest(const IOCtlVRequest& reques if (!request.in_vectors.empty() && request.in_vectors[0].size > 0) { nodeNameStr = memory.GetString(request.in_vectors[0].address, request.in_vectors[0].size); + if (std::optional patch = + WC24PatchEngine::GetNetworkPatch(nodeNameStr, WC24PatchEngine::IsKD{false})) + { + nodeNameStr = patch.value(); + } pNodeName = nodeNameStr.c_str(); } diff --git a/Source/Core/Core/IOS/Network/KD/NWC24DL.cpp b/Source/Core/Core/IOS/Network/KD/NWC24DL.cpp index 99073e9b72a4..df4fb0fb5862 100644 --- a/Source/Core/Core/IOS/Network/KD/NWC24DL.cpp +++ b/Source/Core/Core/IOS/Network/KD/NWC24DL.cpp @@ -140,4 +140,9 @@ void NWC24Dl::SetVersion(u32 version) m_data.header.version = Common::swap32(version); } +u32 NWC24Dl::GetHighTitleID(u16 entry_index) const +{ + return Common::swap32(m_data.entries[entry_index].high_title_id); +} + } // namespace IOS::HLE::NWC24 diff --git a/Source/Core/Core/IOS/Network/KD/NWC24DL.h b/Source/Core/Core/IOS/Network/KD/NWC24DL.h index 1704d15223c0..24dca4a4aef4 100644 --- a/Source/Core/Core/IOS/Network/KD/NWC24DL.h +++ b/Source/Core/Core/IOS/Network/KD/NWC24DL.h @@ -33,6 +33,7 @@ class NWC24Dl final std::string GetDownloadURL(u16 entry_index, std::optional subtask_id) const; std::string GetVFFPath(u16 entry_index) const; WC24PubkMod GetWC24PubkMod(u16 entry_index) const; + u32 GetHighTitleID(u16 entry_index) const; u32 Magic() const; void SetMagic(u32 magic); diff --git a/Source/Core/Core/IOS/Network/KD/NetKDRequest.cpp b/Source/Core/Core/IOS/Network/KD/NetKDRequest.cpp index 66fb23193d9c..363754eb3255 100644 --- a/Source/Core/Core/IOS/Network/KD/NetKDRequest.cpp +++ b/Source/Core/Core/IOS/Network/KD/NetKDRequest.cpp @@ -24,6 +24,7 @@ #include "Core/IOS/Network/Socket.h" #include "Core/IOS/Uids.h" #include "Core/System.h" +#include "Core/WC24PatchEngine.h" namespace IOS::HLE { @@ -217,7 +218,22 @@ NWC24::ErrorCode NetKDRequestDevice::KDDownload(const u16 entry_index, // Content metadata const std::string content_name = m_dl_list.GetVFFContentName(entry_index, subtask_id); - const std::string url = m_dl_list.GetDownloadURL(entry_index, subtask_id); + std::string url = m_dl_list.GetDownloadURL(entry_index, subtask_id); + + // Reroute to custom server if enabled. + const std::vector parts = SplitString(url, '/'); + if (parts.size() < 3) + { + // Invalid URL + LogError(ErrorType::KD_Download, NWC24::WC24_ERR_SERVER); + return NWC24::WC24_ERR_SERVER; + } + + if (std::optional patch = + WC24PatchEngine::GetNetworkPatch(parts[2], WC24PatchEngine::IsKD{true})) + { + url = ReplaceAll(url, parts[2], patch.value()); + } INFO_LOG_FMT(IOS_WC24, "NET_KD_REQ: IOCTL_NWC24_DOWNLOAD_NOW_EX - NI - URL: {}", url); diff --git a/Source/Core/Core/IOS/Network/Socket.cpp b/Source/Core/Core/IOS/Network/Socket.cpp index 56d300526e7e..984394f8cba5 100644 --- a/Source/Core/Core/IOS/Network/Socket.cpp +++ b/Source/Core/Core/IOS/Network/Socket.cpp @@ -27,6 +27,7 @@ #include "Core/IOS/IOS.h" #include "Core/PowerPC/PowerPC.h" #include "Core/System.h" +#include "Core/WC24PatchEngine.h" #ifdef _WIN32 #define ERRORCODE(name) WSA##name @@ -581,6 +582,12 @@ void WiiSocket::Update(bool read, bool write, bool except) // Not a string, Windows requires a const char* for sendto const char* data = (const char*)memory.GetPointer(BufferIn); + const std::optional patch = WC24PatchEngine::GetNetworkPatchByPayload(data); + if (patch) + { + data = patch->c_str(); + BufferInSize = static_cast(patch->size()); + } // Act as non blocking when SO_MSG_NONBLOCK is specified forceNonBlock = ((flags & SO_MSG_NONBLOCK) == SO_MSG_NONBLOCK); diff --git a/Source/Core/Core/WC24PatchEngine.cpp b/Source/Core/Core/WC24PatchEngine.cpp new file mode 100644 index 000000000000..5deae1cca238 --- /dev/null +++ b/Source/Core/Core/WC24PatchEngine.cpp @@ -0,0 +1,136 @@ +// Copyright 2023 Dolphin Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +// WC24PatchEngine +// Allows for replacing URLs used in WC24 requests + +#include "Core/WC24PatchEngine.h" +#include +#include +#include "Common/StringUtil.h" +#include "Core/CheatCodes.h" +#include "Core/CommonTitles.h" +#include "Core/Config/MainSettings.h" +#include "Core/ConfigManager.h" + +namespace WC24PatchEngine +{ +static std::array s_wc24_channels{ + // Nintendo Channel + Titles::NINTENDO_CHANNEL_NTSC_U, + Titles::NINTENDO_CHANNEL_NTSC_J, + Titles::NINTENDO_CHANNEL_PAL, + Titles::FORECAST_CHANNEL_NTSC_U, + Titles::FORECAST_CHANNEL_NTSC_J, + Titles::FORECAST_CHANNEL_PAL, + Titles::NEWS_CHANNEL_NTSC_U, + Titles::NEWS_CHANNEL_NTSC_J, + Titles::NEWS_CHANNEL_PAL, + Titles::EVERYBODY_VOTES_CHANNEL_NTSC_U, + Titles::EVERYBODY_VOTES_CHANNEL_NTSC_J, + Titles::EVERYBODY_VOTES_CHANNEL_PAL, +}; + +static std::vector s_patches; + +bool DeserializeLine(const std::string& line, NetworkPatch* patch) +{ + const std::vector items = SplitString(line, ':'); + + if (items.size() != 3) + return false; + + patch->source = items[0]; + patch->replacement = items[1]; + + if (!TryParse(items[2], &patch->is_kd)) + return false; + + return patch; +} + +void LoadPatchSection(const Common::IniFile& ini) +{ + std::vector lines; + NetworkPatch patch; + ini.GetLines("WC24Patch", &lines); + + for (std::string& line : lines) + { + if (line.empty()) + continue; + + if (line[0] == '$') + { + patch.name = line.substr(1, line.size() - 1); + } + else + { + if (DeserializeLine(line, &patch)) + { + s_patches.push_back(patch); + } + } + } + + ReadEnabledAndDisabled(ini, "WC24Patch", &s_patches); +} + +void LoadPatches() +{ + const auto& sconfig = SConfig::GetInstance(); + // We can only load WC24 Channels. + if (!IsWC24Channel()) + return; + + Common::IniFile ini; + // If WiiLink is enabled then we load the Default Ini as that has the WiiLink URLs. + if (Config::Get(Config::MAIN_WII_WIILINK_ENABLE)) + ini = sconfig.LoadDefaultGameIni(); + else + ini = sconfig.LoadLocalGameIni(); + + LoadPatchSection(ini); +} + +bool IsWC24Channel() +{ + const auto& sconfig = SConfig::GetInstance(); + const auto found = + std::find(s_wc24_channels.begin(), s_wc24_channels.end(), sconfig.GetTitleID()); + + return found != s_wc24_channels.end(); +} + +void Reload() +{ + s_patches.clear(); + LoadPatches(); +} + +std::optional GetNetworkPatch(const std::string& source, IsKD is_kd) +{ + const auto patch = + std::find_if(s_patches.begin(), s_patches.end(), [&source, &is_kd](NetworkPatch& patch) { + return patch.source == source && patch.is_kd == is_kd; + }); + if (patch == s_patches.end()) + return std::nullopt; + + return patch->replacement; +} + +// When we patch for the Socket, we aren't given the URL. Instead, it is in a Host header +// in the payload that the socket is going to send. We need to manually find which patch to apply. +std::optional GetNetworkPatchByPayload(std::string_view source) +{ + for (const NetworkPatch& patch : s_patches) + { + if (source.find(patch.source) != std::string::npos && patch.is_kd != IsKD{true}) + // We found the correct patch, return it! + return ReplaceAll(std::string{source}, patch.source, patch.replacement); + } + + return std::nullopt; +} +} // namespace WC24PatchEngine diff --git a/Source/Core/Core/WC24PatchEngine.h b/Source/Core/Core/WC24PatchEngine.h new file mode 100644 index 000000000000..abbfcc0d585f --- /dev/null +++ b/Source/Core/Core/WC24PatchEngine.h @@ -0,0 +1,30 @@ +// Copyright 2023 Dolphin Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include +#include + +#include "Common/IniFile.h" + +namespace WC24PatchEngine +{ +enum class IsKD : bool; + +struct NetworkPatch final +{ + std::string name; + std::string source; + std::string replacement; + bool enabled = false; + IsKD is_kd = IsKD{false}; +}; + +void Reload(); +bool DeserializeLine(const std::string& line, NetworkPatch* patch); +bool IsWC24Channel(); +void LoadPatchSection(const Common::IniFile& ini); +std::optional GetNetworkPatch(const std::string& source, IsKD is_kd); +std::optional GetNetworkPatchByPayload(std::string_view source); +} // namespace WC24PatchEngine diff --git a/Source/Core/DolphinLib.props b/Source/Core/DolphinLib.props index 5549e775f3f5..93d5a592bf7b 100644 --- a/Source/Core/DolphinLib.props +++ b/Source/Core/DolphinLib.props @@ -435,6 +435,7 @@ + @@ -1070,6 +1071,7 @@ + diff --git a/Source/Core/DolphinQt/Settings/WiiPane.cpp b/Source/Core/DolphinQt/Settings/WiiPane.cpp index 959a4aa1fc7c..9cb9677e201d 100644 --- a/Source/Core/DolphinQt/Settings/WiiPane.cpp +++ b/Source/Core/DolphinQt/Settings/WiiPane.cpp @@ -121,6 +121,7 @@ void WiiPane::ConnectLayout() &QCheckBox::setChecked); connect(&Settings::Instance(), &Settings::USBKeyboardConnectionChanged, m_connect_keyboard_checkbox, &QCheckBox::setChecked); + connect(m_wiilink_checkbox, &QCheckBox::toggled, this, &WiiPane::OnSaveConfig); // SD Card Settings connect(m_sd_card_checkbox, &QCheckBox::toggled, this, &WiiPane::OnSaveConfig); @@ -157,6 +158,7 @@ void WiiPane::CreateMisc() m_main_layout->addWidget(misc_settings_group); m_pal60_mode_checkbox = new QCheckBox(tr("Use PAL60 Mode (EuRGB60)")); m_screensaver_checkbox = new QCheckBox(tr("Enable Screen Saver")); + m_wiilink_checkbox = new QCheckBox(tr("Enable WiiConnect24 via WiiLink")); m_connect_keyboard_checkbox = new QCheckBox(tr("Connect USB Keyboard")); m_aspect_ratio_choice_label = new QLabel(tr("Aspect Ratio:")); @@ -187,12 +189,17 @@ void WiiPane::CreateMisc() m_pal60_mode_checkbox->setToolTip(tr("Sets the Wii display mode to 60Hz (480i) instead of 50Hz " "(576i) for PAL games.\nMay not work for all games.")); m_screensaver_checkbox->setToolTip(tr("Dims the screen after five minutes of inactivity.")); + m_wiilink_checkbox->setToolTip(tr( + "Enables the WiiLink service for WiiConnect24 channels.\nWiiLink is an alternate provider " + "for the discontinued WiiConnect24 Channels such as the Forecast and Nintendo Channels\nRead " + "the Terms of Service at: https://www.wiilink24.com/tos")); m_system_language_choice->setToolTip(tr("Sets the Wii system language.")); m_connect_keyboard_checkbox->setToolTip(tr("May cause slow down in Wii Menu and some games.")); misc_settings_group_layout->addWidget(m_pal60_mode_checkbox, 0, 0, 1, 1); misc_settings_group_layout->addWidget(m_connect_keyboard_checkbox, 0, 1, 1, 1); misc_settings_group_layout->addWidget(m_screensaver_checkbox, 1, 0, 1, 1); + misc_settings_group_layout->addWidget(m_wiilink_checkbox, 1, 1, 1, 1); misc_settings_group_layout->addWidget(m_aspect_ratio_choice_label, 2, 0, 1, 1); misc_settings_group_layout->addWidget(m_aspect_ratio_choice, 2, 1, 1, 1); misc_settings_group_layout->addWidget(m_system_language_choice_label, 3, 0, 1, 1); @@ -386,6 +393,7 @@ void WiiPane::OnEmulationStateChanged(bool running) m_wiimote_speaker_volume->setEnabled(!running); m_wiimote_ir_sensitivity->setEnabled(!running); m_wiimote_ir_sensor_position->setEnabled(!running); + m_wiilink_checkbox->setEnabled(!running); } void WiiPane::LoadConfig() @@ -396,6 +404,7 @@ void WiiPane::LoadConfig() m_aspect_ratio_choice->setCurrentIndex(Config::Get(Config::SYSCONF_WIDESCREEN)); m_system_language_choice->setCurrentIndex(Config::Get(Config::SYSCONF_LANGUAGE)); m_sound_mode_choice->setCurrentIndex(Config::Get(Config::SYSCONF_SOUND_MODE)); + m_wiilink_checkbox->setChecked(Config::Get(Config::MAIN_WII_WIILINK_ENABLE)); m_sd_card_checkbox->setChecked(Settings::Instance().IsSDCardInserted()); m_allow_sd_writes_checkbox->setChecked(Config::Get(Config::MAIN_ALLOW_SD_WRITES)); @@ -433,6 +442,7 @@ void WiiPane::OnSaveConfig() Config::SetBase(Config::SYSCONF_WIDESCREEN, m_aspect_ratio_choice->currentIndex()); Config::SetBase(Config::SYSCONF_SOUND_MODE, m_sound_mode_choice->currentIndex()); Config::SetBase(Config::SYSCONF_WIIMOTE_MOTOR, m_wiimote_motor->isChecked()); + Config::SetBase(Config::MAIN_WII_WIILINK_ENABLE, m_wiilink_checkbox->isChecked()); Settings::Instance().SetSDCardInserted(m_sd_card_checkbox->isChecked()); Config::SetBase(Config::MAIN_ALLOW_SD_WRITES, m_allow_sd_writes_checkbox->isChecked()); diff --git a/Source/Core/DolphinQt/Settings/WiiPane.h b/Source/Core/DolphinQt/Settings/WiiPane.h index 6f4b3fe8de35..206ec1f731a4 100644 --- a/Source/Core/DolphinQt/Settings/WiiPane.h +++ b/Source/Core/DolphinQt/Settings/WiiPane.h @@ -51,6 +51,7 @@ class WiiPane : public QWidget QCheckBox* m_screensaver_checkbox; QCheckBox* m_pal60_mode_checkbox; QCheckBox* m_connect_keyboard_checkbox; + QCheckBox* m_wiilink_checkbox; QComboBox* m_system_language_choice; QLabel* m_system_language_choice_label; QComboBox* m_aspect_ratio_choice;