diff --git a/Source/Core/Core/IOS/Network/KD/NWC24Config.cpp b/Source/Core/Core/IOS/Network/KD/NWC24Config.cpp index aa55f78b6d..56b1d747cd 100644 --- a/Source/Core/Core/IOS/Network/KD/NWC24Config.cpp +++ b/Source/Core/Core/IOS/Network/KD/NWC24Config.cpp @@ -40,20 +40,21 @@ void NWC24Config::ReadConfig() void NWC24Config::WriteCBK() const { - constexpr FS::Modes public_modes{FS::Mode::ReadWrite, FS::Mode::ReadWrite, FS::Mode::ReadWrite}; - m_fs->CreateFullPath(PID_KD, PID_KD, CBK_PATH, 0, public_modes); - const auto file = m_fs->CreateAndOpenFile(PID_KD, PID_KD, CBK_PATH, public_modes); - if (!file || !file->Write(&m_data, 1)) - ERROR_LOG_FMT(IOS_WC24, "Failed to open or write WC24 config file"); + WriteConfigToPath(CBK_PATH); } void NWC24Config::WriteConfig() const +{ + WriteConfigToPath(CONFIG_PATH); +} + +void NWC24Config::WriteConfigToPath(const std::string& path) const { constexpr FS::Modes public_modes{FS::Mode::ReadWrite, FS::Mode::ReadWrite, FS::Mode::ReadWrite}; - m_fs->CreateFullPath(PID_KD, PID_KD, CONFIG_PATH, 0, public_modes); - const auto file = m_fs->CreateAndOpenFile(PID_KD, PID_KD, CONFIG_PATH, public_modes); + m_fs->CreateFullPath(PID_KD, PID_KD, path, 0, public_modes); + const auto file = m_fs->CreateAndOpenFile(PID_KD, PID_KD, path, public_modes); if (!file || !file->Write(&m_data, 1)) - ERROR_LOG_FMT(IOS_WC24, "Failed to open or write WC24 config file"); + ERROR_LOG_FMT(IOS_WC24, "Failed to open or write WC24 config file at {}", path); } void NWC24Config::ResetConfig() diff --git a/Source/Core/Core/IOS/Network/KD/NWC24Config.h b/Source/Core/Core/IOS/Network/KD/NWC24Config.h index 430f59d2df..be8f4c9bc9 100644 --- a/Source/Core/Core/IOS/Network/KD/NWC24Config.h +++ b/Source/Core/Core/IOS/Network/KD/NWC24Config.h @@ -48,6 +48,7 @@ public: void ReadConfig(); void WriteCBK() const; void WriteConfig() const; + void WriteConfigToPath(const std::string& path) const; void ResetConfig(); u32 CalculateNwc24ConfigChecksum() const;