diff options
| author | Pokechu22 <Pokechu022@gmail.com> | 2022-01-12 21:15:06 -0800 |
|---|---|---|
| committer | Pokechu22 <Pokechu022@gmail.com> | 2022-01-13 11:11:08 -0800 |
| commit | 18cf8ac7670a9ed53cf3d78d55dbcdffcf0d9605 (patch) | |
| tree | 61418d4b982a8695f73c892a87cad76bcee56a1f /Source/Core | |
| parent | 1a9269945517b9c8ed327dc589a253ed24f4a144 (diff) | |
Create EnumFormatter for WD Command enums
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Core/IOS/Network/WD/Command.cpp | 2 | ||||
| -rw-r--r-- | Source/Core/Core/IOS/Network/WD/Command.h | 19 |
2 files changed, 20 insertions, 1 deletions
diff --git a/Source/Core/Core/IOS/Network/WD/Command.cpp b/Source/Core/Core/IOS/Network/WD/Command.cpp index b57dad4aa2..962877f7d1 100644 --- a/Source/Core/Core/IOS/Network/WD/Command.cpp +++ b/Source/Core/Core/IOS/Network/WD/Command.cpp @@ -241,8 +241,8 @@ IPCReply NetWDCommandDevice::SetLinkState(const IOCtlVRequest& request) if (!WD::IsValidMode(m_mode)) return IPCReply(u32(ResultCode::UnavailableCommand)); - INFO_LOG_FMT(IOS_NET, "WD_SetLinkState: setting target status to 1 (Idle)"); m_target_status = Status::Idle; + INFO_LOG_FMT(IOS_NET, "WD_SetLinkState: setting target status to {}", m_target_status); } else { diff --git a/Source/Core/Core/IOS/Network/WD/Command.h b/Source/Core/Core/IOS/Network/WD/Command.h index 2a56caea49..fba54b8693 100644 --- a/Source/Core/Core/IOS/Network/WD/Command.h +++ b/Source/Core/Core/IOS/Network/WD/Command.h @@ -7,6 +7,7 @@ #include <string> #include "Common/CommonTypes.h" +#include "Common/EnumFormatter.h" #include "Common/Flag.h" #include "Common/Network.h" #include "Common/Swap.h" @@ -147,6 +148,7 @@ private: ScanningForAOSSAccessPoint, ScanningForDS, }; + friend struct fmt::formatter<IOS::HLE::NetWDCommandDevice::Status>; void ProcessRecvRequests(); void HandleStateChange(); @@ -172,3 +174,20 @@ private: std::deque<u32> m_recv_notification_requests; }; } // namespace IOS::HLE + +template <> +struct fmt::formatter<IOS::HLE::WD::Mode> : EnumFormatter<IOS::HLE::WD::Mode::Unknown6> +{ + static constexpr array_type names{ + "Not initialized", "DS Communications", "Unknown 2", "AOSS Access Point Scan", + "Unknown 4", "Unknown 5", "Unknown 6", + }; + constexpr formatter() : EnumFormatter(names) {} +}; +template <> +struct fmt::formatter<IOS::HLE::NetWDCommandDevice::Status> + : EnumFormatter<IOS::HLE::NetWDCommandDevice::Status::ScanningForDS> +{ + static constexpr array_type names{"Idle", "Scanning for AOSS Access Point", "Scanning for DS"}; + constexpr formatter() : EnumFormatter(names) {} +}; |
