From 722162b54afe37110e22df70cdb11f816c6eb3f2 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 17 Jan 2017 15:01:30 -0500 Subject: [PATCH] IPC_HLE: Namespace IOS HLE Gets all of the IOS HLE code out of the global scope. --- Source/Core/Core/Boot/Boot.cpp | 2 +- Source/Core/Core/Boot/Boot_WiiWAD.cpp | 4 ++-- Source/Core/Core/ConfigManager.cpp | 2 +- Source/Core/Core/Core.cpp | 4 ++-- Source/Core/Core/HW/DVDInterface.cpp | 4 ++-- Source/Core/Core/HW/HW.cpp | 16 ++++++------- Source/Core/Core/HW/Memmap.cpp | 2 +- Source/Core/Core/HW/ProcessorInterface.cpp | 12 +++++----- Source/Core/Core/HW/SystemTimers.cpp | 8 +++---- Source/Core/Core/HW/WII_IPC.cpp | 14 +++++------ Source/Core/Core/HW/WII_IPC.h | 4 ++-- Source/Core/Core/IPC_HLE/ESFormats.cpp | 6 +++++ Source/Core/Core/IPC_HLE/ESFormats.h | 6 +++++ Source/Core/Core/IPC_HLE/NWC24Config.cpp | 6 +++++ Source/Core/Core/IPC_HLE/NWC24Config.h | 6 +++++ Source/Core/Core/IPC_HLE/WII_IPC_HLE.cpp | 16 +++++++------ Source/Core/Core/IPC_HLE/WII_IPC_HLE.h | 15 +++++++----- .../Core/Core/IPC_HLE/WII_IPC_HLE_Device.cpp | 6 +++++ Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device.h | 6 +++++ .../Core/IPC_HLE/WII_IPC_HLE_Device_DI.cpp | 10 ++++++-- .../Core/Core/IPC_HLE/WII_IPC_HLE_Device_DI.h | 6 +++++ .../IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp | 6 +++++ .../Core/IPC_HLE/WII_IPC_HLE_Device_FileIO.h | 6 +++++ .../Core/IPC_HLE/WII_IPC_HLE_Device_es.cpp | 14 +++++++---- .../Core/Core/IPC_HLE/WII_IPC_HLE_Device_es.h | 6 +++++ .../Core/IPC_HLE/WII_IPC_HLE_Device_fs.cpp | 6 +++++ .../Core/Core/IPC_HLE/WII_IPC_HLE_Device_fs.h | 6 +++++ .../Core/IPC_HLE/WII_IPC_HLE_Device_hid.cpp | 13 +++++++---- .../Core/IPC_HLE/WII_IPC_HLE_Device_hid.h | 6 +++++ .../Core/IPC_HLE/WII_IPC_HLE_Device_net.cpp | 6 +++++ .../Core/IPC_HLE/WII_IPC_HLE_Device_net.h | 6 +++++ .../IPC_HLE/WII_IPC_HLE_Device_net_ssl.cpp | 6 +++++ .../Core/IPC_HLE/WII_IPC_HLE_Device_net_ssl.h | 6 +++++ .../IPC_HLE/WII_IPC_HLE_Device_sdio_slot0.cpp | 10 ++++++-- .../IPC_HLE/WII_IPC_HLE_Device_sdio_slot0.h | 6 +++++ .../Core/IPC_HLE/WII_IPC_HLE_Device_stm.cpp | 10 ++++++-- .../Core/IPC_HLE/WII_IPC_HLE_Device_stm.h | 6 +++++ .../Core/IPC_HLE/WII_IPC_HLE_Device_stub.cpp | 6 +++++ .../Core/IPC_HLE/WII_IPC_HLE_Device_stub.h | 6 +++++ .../WII_IPC_HLE_Device_usb_bt_base.cpp | 6 +++++ .../IPC_HLE/WII_IPC_HLE_Device_usb_bt_base.h | 6 +++++ .../IPC_HLE/WII_IPC_HLE_Device_usb_bt_emu.cpp | 22 ++++++++++++------ .../IPC_HLE/WII_IPC_HLE_Device_usb_bt_emu.h | 9 +++++++- .../WII_IPC_HLE_Device_usb_bt_real.cpp | 23 +++++++++++-------- .../IPC_HLE/WII_IPC_HLE_Device_usb_bt_real.h | 12 ++++++++++ .../WII_IPC_HLE_Device_usb_bt_stub.cpp | 6 +++++ .../IPC_HLE/WII_IPC_HLE_Device_usb_bt_stub.h | 6 +++++ .../IPC_HLE/WII_IPC_HLE_Device_usb_kbd.cpp | 6 +++++ .../Core/IPC_HLE/WII_IPC_HLE_Device_usb_kbd.h | 6 +++++ .../IPC_HLE/WII_IPC_HLE_Device_usb_ven.cpp | 6 +++++ .../Core/IPC_HLE/WII_IPC_HLE_Device_usb_ven.h | 6 +++++ .../IPC_HLE/WII_IPC_HLE_Device_usb_wfssrv.cpp | 8 ++++++- .../IPC_HLE/WII_IPC_HLE_Device_usb_wfssrv.h | 6 +++++ .../Core/IPC_HLE/WII_IPC_HLE_Device_wfsi.cpp | 6 +++++ .../Core/IPC_HLE/WII_IPC_HLE_Device_wfsi.h | 6 +++++ .../Core/Core/IPC_HLE/WII_IPC_HLE_WiiMote.cpp | 8 ++++++- .../Core/Core/IPC_HLE/WII_IPC_HLE_WiiMote.h | 9 +++++++- Source/Core/Core/IPC_HLE/WII_Socket.cpp | 9 +++++++- Source/Core/Core/IPC_HLE/WII_Socket.h | 8 ++++++- Source/Core/Core/IPC_HLE/WiiMote_HID_Attr.cpp | 6 +++++ Source/Core/Core/IPC_HLE/WiiMote_HID_Attr.h | 6 +++++ Source/Core/Core/IPC_HLE/WiiNetConfig.cpp | 6 +++++ Source/Core/Core/IPC_HLE/WiiNetConfig.h | 6 +++++ Source/Core/Core/Movie.cpp | 2 +- Source/Core/Core/State.cpp | 2 +- .../Core/DolphinWX/Config/WiiConfigPane.cpp | 2 +- .../Core/DolphinWX/ControllerConfigDiag.cpp | 8 +++---- Source/Core/DolphinWX/Frame.cpp | 4 ++-- Source/Core/DolphinWX/FrameTools.cpp | 22 ++++++++++-------- Source/Core/DolphinWX/MainNoGUI.cpp | 7 +++--- 70 files changed, 423 insertions(+), 108 deletions(-) diff --git a/Source/Core/Core/Boot/Boot.cpp b/Source/Core/Core/Boot/Boot.cpp index a85b62fc34..7bf221273a 100644 --- a/Source/Core/Core/Boot/Boot.cpp +++ b/Source/Core/Core/Boot/Boot.cpp @@ -282,7 +282,7 @@ bool CBoot::BootUp() std::vector tmd_buffer = pVolume.GetTMD(); if (!tmd_buffer.empty()) { - WII_IPC_HLE_Interface::ES_DIVerify(tmd_buffer); + IOS::HLE::ES_DIVerify(tmd_buffer); } _StartupPara.bWii = pVolume.GetVolumeType() == DiscIO::Platform::WII_DISC; diff --git a/Source/Core/Core/Boot/Boot_WiiWAD.cpp b/Source/Core/Core/Boot/Boot_WiiWAD.cpp index f94780024b..366f89e439 100644 --- a/Source/Core/Core/Boot/Boot_WiiWAD.cpp +++ b/Source/Core/Core/Boot/Boot_WiiWAD.cpp @@ -87,7 +87,7 @@ bool CBoot::Boot_WiiWAD(const std::string& _pFilename) File::CreateFullPath(Common::GetTitleDataPath(titleID, Common::FROM_SESSION_ROOT)); if (titleID == TITLEID_SYSMENU) - HLE_IPC_CreateVirtualFATFilesystem(); + IOS::HLE::HLE_IPC_CreateVirtualFATFilesystem(); // setup Wii memory if (!SetupWiiMemory()) return false; @@ -97,7 +97,7 @@ bool CBoot::Boot_WiiWAD(const std::string& _pFilename) if (pContent == nullptr) return false; - WII_IPC_HLE_Interface::SetDefaultContentFile(_pFilename); + IOS::HLE::SetDefaultContentFile(_pFilename); std::unique_ptr pDolLoader = std::make_unique(pContent->m_Data->Get()); if (!pDolLoader->IsValid()) diff --git a/Source/Core/Core/ConfigManager.cpp b/Source/Core/Core/ConfigManager.cpp index a6a8c3e3b1..cf89127184 100644 --- a/Source/Core/Core/ConfigManager.cpp +++ b/Source/Core/Core/ConfigManager.cpp @@ -375,7 +375,7 @@ void SConfig::SaveSettingsToSysconf() sysconf.SetData("IPL.IDL", 0x00); NOTICE_LOG(COMMON, "Disabling WC24 'standby' (shutdown to idle) to avoid hanging on shutdown"); - RestoreBTInfoSection(&sysconf); + IOS::HLE::RestoreBTInfoSection(&sysconf); sysconf.Save(); } diff --git a/Source/Core/Core/Core.cpp b/Source/Core/Core/Core.cpp index 992bc87b6d..fbe872c534 100644 --- a/Source/Core/Core/Core.cpp +++ b/Source/Core/Core/Core.cpp @@ -544,7 +544,7 @@ void EmuThread() // Activate Wiimotes which don't have source set to "None" for (unsigned int i = 0; i != MAX_BBMOTES; ++i) if (g_wiimote_sources[i]) - GetUsbPointer()->AccessWiiMote(i | 0x100)->Activate(true); + IOS::HLE::GetUsbPointer()->AccessWiiMote(i | 0x100)->Activate(true); } AudioCommon::InitSoundStream(); @@ -985,7 +985,7 @@ void UpdateWantDeterminism(bool initial) bool was_unpaused = Core::PauseAndLock(true); g_want_determinism = new_want_determinism; - WiiSockMan::GetInstance().UpdateWantDeterminism(new_want_determinism); + IOS::HLE::WiiSockMan::GetInstance().UpdateWantDeterminism(new_want_determinism); Fifo::UpdateWantDeterminism(new_want_determinism); // We need to clear the cache because some parts of the JIT depend on want_determinism, e.g. use // of FMA. diff --git a/Source/Core/Core/HW/DVDInterface.cpp b/Source/Core/Core/HW/DVDInterface.cpp index f1f149fefa..c56c9e7a0d 100644 --- a/Source/Core/Core/HW/DVDInterface.cpp +++ b/Source/Core/Core/HW/DVDInterface.cpp @@ -1155,9 +1155,9 @@ void FinishExecutingCommand(ReplyType reply_type, DIInterruptType interrupt_type case ReplyType::IOS_HLE: { - std::shared_ptr di = WII_IPC_HLE_Interface::GetDeviceByName("/dev/di"); + std::shared_ptr di = IOS::HLE::GetDeviceByName("/dev/di"); if (di) - std::static_pointer_cast(di)->FinishIOCtl(interrupt_type); + std::static_pointer_cast(di)->FinishIOCtl(interrupt_type); break; } diff --git a/Source/Core/Core/HW/HW.cpp b/Source/Core/Core/HW/HW.cpp index 732009258b..bfc4856320 100644 --- a/Source/Core/Core/HW/HW.cpp +++ b/Source/Core/Core/HW/HW.cpp @@ -53,8 +53,8 @@ void Init() Core::InitializeWiiRoot(Core::g_want_determinism); DiscIO::cUIDsys::AccessInstance().UpdateLocation(); DiscIO::CSharedContent::AccessInstance().UpdateLocation(); - WII_IPCInterface::Init(); - WII_IPC_HLE_Interface::Init(); // Depends on Memory + IOS::Init(); + IOS::HLE::Init(); // Depends on Memory } } @@ -62,8 +62,8 @@ void Shutdown() { if (SConfig::GetInstance().bWii) { - WII_IPC_HLE_Interface::Shutdown(); // Depends on Memory - WII_IPCInterface::Shutdown(); + IOS::HLE::Shutdown(); // Depends on Memory + IOS::Shutdown(); Core::ShutdownWiiRoot(); } @@ -103,10 +103,10 @@ void DoState(PointerWrap& p) if (SConfig::GetInstance().bWii) { - WII_IPCInterface::DoState(p); - p.DoMarker("WII_IPCInterface"); - WII_IPC_HLE_Interface::DoState(p); - p.DoMarker("WII_IPC_HLE_Interface"); + IOS::DoState(p); + p.DoMarker("IOS"); + IOS::HLE::DoState(p); + p.DoMarker("IOS::HLE"); } p.DoMarker("WIIHW"); diff --git a/Source/Core/Core/HW/Memmap.cpp b/Source/Core/Core/HW/Memmap.cpp index c82380b903..393b88c7bd 100644 --- a/Source/Core/Core/HW/Memmap.cpp +++ b/Source/Core/Core/HW/Memmap.cpp @@ -79,7 +79,7 @@ static std::unique_ptr InitMMIOWii() { auto mmio = InitMMIO(); - WII_IPCInterface::RegisterMMIO(mmio.get(), 0x0D000000); + IOS::RegisterMMIO(mmio.get(), 0x0D000000); DVDInterface::RegisterMMIO(mmio.get(), 0x0D006000); SerialInterface::RegisterMMIO(mmio.get(), 0x0D006400); ExpansionInterface::RegisterMMIO(mmio.get(), 0x0D006800); diff --git a/Source/Core/Core/HW/ProcessorInterface.cpp b/Source/Core/Core/HW/ProcessorInterface.cpp index a24f5529b6..c5bf1ba412 100644 --- a/Source/Core/Core/HW/ProcessorInterface.cpp +++ b/Source/Core/Core/HW/ProcessorInterface.cpp @@ -212,10 +212,10 @@ static void IOSNotifyResetButtonCallback(u64 userdata, s64 cyclesLate) { if (SConfig::GetInstance().bWii) { - std::shared_ptr stm = - WII_IPC_HLE_Interface::GetDeviceByName("/dev/stm/eventhook"); + std::shared_ptr stm = + IOS::HLE::GetDeviceByName("/dev/stm/eventhook"); if (stm) - std::static_pointer_cast(stm)->ResetButton(); + std::static_pointer_cast(stm)->ResetButton(); } } @@ -223,10 +223,10 @@ static void IOSNotifyPowerButtonCallback(u64 userdata, s64 cyclesLate) { if (SConfig::GetInstance().bWii) { - std::shared_ptr stm = - WII_IPC_HLE_Interface::GetDeviceByName("/dev/stm/eventhook"); + std::shared_ptr stm = + IOS::HLE::GetDeviceByName("/dev/stm/eventhook"); if (stm) - std::static_pointer_cast(stm)->PowerButton(); + std::static_pointer_cast(stm)->PowerButton(); } } diff --git a/Source/Core/Core/HW/SystemTimers.cpp b/Source/Core/Core/HW/SystemTimers.cpp index a740a2eef1..45ffa2f9f7 100644 --- a/Source/Core/Core/HW/SystemTimers.cpp +++ b/Source/Core/Core/HW/SystemTimers.cpp @@ -29,7 +29,7 @@ IPC_HLE_PERIOD: For the Wii Remote this is the call schedule: IPC_HLE_UpdateCallback() // In this file // This function seems to call all devices' Update() function four times per frame - WII_IPC_HLE_Interface::Update() + IOS::HLE::Update() // If the AclFrameQue is empty this will call Wiimote_Update() and make it send the current input status to the game. I'm not sure if this occurs approximately @@ -37,7 +37,7 @@ IPC_HLE_PERIOD: For the Wii Remote this is the call schedule: CWII_IPC_HLE_Device_usb_oh1_57e_305::Update() PluginWiimote::Wiimote_Update() - // This is also a device updated by WII_IPC_HLE_Interface::Update() but it doesn't + // This is also a device updated by IOS::HLE::Update() but it doesn't seem to ultimately call PluginWiimote::Wiimote_Update(). However it can be called by the /dev/usb/oh1 device if the AclFrameQue is empty. CWII_IPC_HLE_WiiMote::Update() @@ -112,7 +112,7 @@ static void IPC_HLE_UpdateCallback(u64 userdata, s64 cyclesLate) { if (SConfig::GetInstance().bWii) { - WII_IPC_HLE_Interface::UpdateDevices(); + IOS::HLE::UpdateDevices(); CoreTiming::ScheduleEvent(s_ipc_hle_period - cyclesLate, et_IPC_HLE); } } @@ -236,8 +236,6 @@ void Init() // AyuanX: TO BE TWEAKED // Now the 1500 is a pure assumption // We need to figure out the real frequency though - - // FYI, WII_IPC_HLE_Interface::Update is also called in WII_IPCInterface::Write32 const int freq = 1500; s_ipc_hle_period = GetTicksPerSecond() / freq; } diff --git a/Source/Core/Core/HW/WII_IPC.cpp b/Source/Core/Core/HW/WII_IPC.cpp index 3b30dd0852..c98775a0b5 100644 --- a/Source/Core/Core/HW/WII_IPC.cpp +++ b/Source/Core/Core/HW/WII_IPC.cpp @@ -21,7 +21,7 @@ // ppc_msg is a pointer to 0x40byte command structure // arm_msg is, similarly, starlet's response buffer* -namespace WII_IPCInterface +namespace IOS { enum { @@ -139,7 +139,7 @@ void Reset() { INFO_LOG(WII_IPC, "Resetting ..."); InitState(); - WII_IPC_HLE_Interface::Reset(); + HLE::Reset(); } void Shutdown() @@ -154,8 +154,8 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base) MMIO::ComplexWrite([](u32, u32 val) { ctrl.ppc(val); if (ctrl.X1) - WII_IPC_HLE_Interface::EnqueueRequest(ppc_msg); - WII_IPC_HLE_Interface::Update(); + HLE::EnqueueRequest(ppc_msg); + HLE::Update(); CoreTiming::ScheduleEvent(0, updateInterrupts, 0); })); @@ -164,7 +164,7 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base) mmio->Register(base | PPC_IRQFLAG, MMIO::InvalidRead(), MMIO::ComplexWrite([](u32, u32 val) { ppc_irq_flags &= ~val; - WII_IPC_HLE_Interface::Update(); + HLE::Update(); CoreTiming::ScheduleEvent(0, updateInterrupts, 0); })); @@ -173,7 +173,7 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base) ppc_irq_masks = val; if (ppc_irq_masks & INT_CAUSE_IPC_BROADWAY) // wtf? Reset(); - WII_IPC_HLE_Interface::Update(); + HLE::Update(); CoreTiming::ScheduleEvent(0, updateInterrupts, 0); })); @@ -229,4 +229,4 @@ bool IsReady() { return ((ctrl.Y1 == 0) && (ctrl.Y2 == 0) && ((ppc_irq_flags & INT_CAUSE_IPC_BROADWAY) == 0)); } -} +} // namespace IOS diff --git a/Source/Core/Core/HW/WII_IPC.h b/Source/Core/Core/HW/WII_IPC.h index 99db2597fc..d97e7eab0c 100644 --- a/Source/Core/Core/HW/WII_IPC.h +++ b/Source/Core/Core/HW/WII_IPC.h @@ -12,7 +12,7 @@ namespace MMIO class Mapping; } -namespace WII_IPCInterface +namespace IOS { enum StarletInterruptCause { @@ -46,4 +46,4 @@ void GenerateAck(u32 _Address); void GenerateReply(u32 _Address); bool IsReady(); -} +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/ESFormats.cpp b/Source/Core/Core/IPC_HLE/ESFormats.cpp index 7cd56c14c4..a2e24d755a 100644 --- a/Source/Core/Core/IPC_HLE/ESFormats.cpp +++ b/Source/Core/Core/IPC_HLE/ESFormats.cpp @@ -12,6 +12,10 @@ #include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" +namespace IOS +{ +namespace HLE +{ TMDReader::TMDReader(const std::vector& bytes) : m_bytes(bytes) { } @@ -94,3 +98,5 @@ void TMDReader::DoState(PointerWrap& p) { p.Do(m_bytes); } +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/ESFormats.h b/Source/Core/Core/IPC_HLE/ESFormats.h index 74f023244b..33171b8aec 100644 --- a/Source/Core/Core/IPC_HLE/ESFormats.h +++ b/Source/Core/Core/IPC_HLE/ESFormats.h @@ -13,6 +13,10 @@ #include "Common/ChunkFile.h" #include "Common/CommonTypes.h" +namespace IOS +{ +namespace HLE +{ class TMDReader final { public: @@ -44,3 +48,5 @@ public: private: std::vector m_bytes; }; +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/NWC24Config.cpp b/Source/Core/Core/IPC_HLE/NWC24Config.cpp index c8090bcd58..7aa5c3fb18 100644 --- a/Source/Core/Core/IPC_HLE/NWC24Config.cpp +++ b/Source/Core/Core/IPC_HLE/NWC24Config.cpp @@ -12,6 +12,10 @@ #include "Common/FileUtil.h" #include "Common/Logging/Log.h" +namespace IOS +{ +namespace HLE +{ namespace NWC24 { NWC24Config::NWC24Config() @@ -215,3 +219,5 @@ void NWC24Config::SetEmail(const char* email) m_data.email[MAX_EMAIL_LENGTH - 1] = '\0'; } } // namespace NWC24 +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/NWC24Config.h b/Source/Core/Core/IPC_HLE/NWC24Config.h index fd7d0007b7..8aa07fc979 100644 --- a/Source/Core/Core/IPC_HLE/NWC24Config.h +++ b/Source/Core/Core/IPC_HLE/NWC24Config.h @@ -7,6 +7,10 @@ #include #include "Common/CommonTypes.h" +namespace IOS +{ +namespace HLE +{ namespace NWC24 { enum ErrorCode : int @@ -94,3 +98,5 @@ private: ConfigData m_data; }; } // namespace NWC24 +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE.cpp index 3b2e33e06e..b0ab9610ec 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE.cpp @@ -60,7 +60,9 @@ struct EventType; #include "Core/IPC_HLE/WII_IPC_HLE_Device_hid.h" #endif -namespace WII_IPC_HLE_Interface +namespace IOS +{ +namespace HLE { static std::map> s_device_map; static std::mutex s_device_map_mutex; @@ -465,12 +467,12 @@ void EnqueueCommandAcknowledgement(u32 address, int cycles_in_future) // Takes care of routing ipc <-> ipc HLE void Update() { - if (!WII_IPCInterface::IsReady()) + if (!IsReady()) return; if (s_request_queue.size()) { - WII_IPCInterface::GenerateAck(s_request_queue.front()); + GenerateAck(s_request_queue.front()); DEBUG_LOG(WII_IPC_HLE, "||-- Acknowledge IPC Request @ 0x%08x", s_request_queue.front()); u32 command = s_request_queue.front(); s_request_queue.pop_front(); @@ -480,7 +482,7 @@ void Update() if (s_reply_queue.size()) { - WII_IPCInterface::GenerateReply(s_reply_queue.front()); + GenerateReply(s_reply_queue.front()); DEBUG_LOG(WII_IPC_HLE, "<<-- Reply to IPC Request @ 0x%08x", s_reply_queue.front()); s_reply_queue.pop_front(); return; @@ -488,7 +490,7 @@ void Update() if (s_ack_queue.size()) { - WII_IPCInterface::GenerateAck(s_ack_queue.front()); + GenerateAck(s_ack_queue.front()); WARN_LOG(WII_IPC_HLE, "<<-- Double-ack to IPC Request @ 0x%08x", s_ack_queue.front()); s_ack_queue.pop_front(); return; @@ -506,5 +508,5 @@ void UpdateDevices() } } } - -} // end of namespace WII_IPC_HLE_Interface +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE.h b/Source/Core/Core/IPC_HLE/WII_IPC_HLE.h index 11e9abb2a1..c18ab49189 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE.h +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE.h @@ -12,10 +12,15 @@ #include "Core/CoreTiming.h" #include "Core/HW/SystemTimers.h" -struct IOSRequest; -class IWII_IPC_HLE_Device; class PointerWrap; +namespace IOS +{ +namespace HLE +{ +class IWII_IPC_HLE_Device; +struct IOSRequest; + struct IPCCommandResult { s32 return_value; @@ -36,8 +41,6 @@ enum IPCCommandType : u32 IPC_REPLY = 8, }; -namespace WII_IPC_HLE_Interface -{ // Init void Init(); @@ -74,5 +77,5 @@ void EnqueueRequest(u32 address); void EnqueueReply(const IOSRequest& request, s32 return_value, int cycles_in_future = 0, CoreTiming::FromThread from = CoreTiming::FromThread::CPU); void EnqueueCommandAcknowledgement(u32 address, int cycles_in_future = 0); - -} // end of namespace WII_IPC_HLE_Interface +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device.cpp index 59d0b1191c..c852bc3263 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device.cpp @@ -12,6 +12,10 @@ #include "Core/IPC_HLE/WII_IPC_HLE.h" #include "Core/IPC_HLE/WII_IPC_HLE_Device.h" +namespace IOS +{ +namespace HLE +{ IOSRequest::IOSRequest(const u32 address_) : address(address_) { command = static_cast(Memory::Read_U32(address)); @@ -171,3 +175,5 @@ IPCCommandResult IWII_IPC_HLE_Device::GetNoReply() { return {IPC_SUCCESS, false, 0}; } +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device.h b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device.h index 0112163594..fe7983b536 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device.h +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device.h @@ -13,6 +13,10 @@ #include "Common/Logging/Log.h" #include "Core/IPC_HLE/WII_IPC_HLE.h" +namespace IOS +{ +namespace HLE +{ enum IOSReturnCode : s32 { IPC_SUCCESS = 0, // Success @@ -168,3 +172,5 @@ protected: private: IPCCommandResult Unsupported(const IOSRequest& request); }; +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_DI.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_DI.cpp index 9f207b4b97..3940f1d800 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_DI.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_DI.cpp @@ -17,6 +17,10 @@ #include "Core/IPC_HLE/WII_IPC_HLE_Device_DI.h" #include "DiscIO/Volume.h" +namespace IOS +{ +namespace HLE +{ CWII_IPC_HLE_Device_di::CWII_IPC_HLE_Device_di(u32 _DeviceID, const std::string& _rDeviceName) : IWII_IPC_HLE_Device(_DeviceID, _rDeviceName) { @@ -74,7 +78,7 @@ void CWII_IPC_HLE_Device_di::FinishIOCtl(DVDInterface::DIInterruptType interrupt // This command has been executed, so it's removed from the queue u32 command_address = m_commands_to_execute.front(); m_commands_to_execute.pop_front(); - WII_IPC_HLE_Interface::EnqueueReply(IOSIOCtlRequest{command_address}, interrupt_type); + EnqueueReply(IOSIOCtlRequest{command_address}, interrupt_type); // DVDInterface is now ready to execute another command, // so we start executing a command from the queue if there is one @@ -107,7 +111,7 @@ IPCCommandResult CWII_IPC_HLE_Device_di::IOCtlV(const IOSIOCtlVRequest& request) // Read TMD to the buffer std::vector tmd_buffer = DVDInterface::GetVolume().GetTMD(); Memory::CopyToEmu(request.io_vectors[0].address, tmd_buffer.data(), tmd_buffer.size()); - WII_IPC_HLE_Interface::ES_DIVerify(tmd_buffer); + ES_DIVerify(tmd_buffer); return_value = 1; break; @@ -117,3 +121,5 @@ IPCCommandResult CWII_IPC_HLE_Device_di::IOCtlV(const IOSIOCtlVRequest& request) } return GetDefaultReply(return_value); } +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_DI.h b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_DI.h index 2e72c59c68..abc537f37c 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_DI.h +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_DI.h @@ -18,6 +18,10 @@ namespace DVDInterface enum DIInterruptType : int; } +namespace IOS +{ +namespace HLE +{ class CWII_IPC_HLE_Device_di : public IWII_IPC_HLE_Device { public: @@ -37,3 +41,5 @@ private: std::deque m_commands_to_execute; }; +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp index bf76810a96..6d428c594d 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp @@ -17,6 +17,10 @@ #include "Core/IPC_HLE/WII_IPC_HLE.h" #include "Core/IPC_HLE/WII_IPC_HLE_Device_FileIO.h" +namespace IOS +{ +namespace HLE +{ static std::map> openFiles; // This is used by several of the FileIO and /dev/fs functions @@ -334,3 +338,5 @@ void CWII_IPC_HLE_Device_FileIO::DoState(PointerWrap& p) // Open it again OpenFile(); } +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_FileIO.h b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_FileIO.h index 84cd6d5a66..b5039c031a 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_FileIO.h +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_FileIO.h @@ -18,6 +18,10 @@ namespace File class IOFile; } +namespace IOS +{ +namespace HLE +{ std::string HLE_IPC_BuildFilename(const std::string& wii_path); void HLE_IPC_CreateVirtualFATFilesystem(); @@ -70,3 +74,5 @@ private: std::string m_filepath; std::shared_ptr m_file; }; +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_es.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_es.cpp index 3a8bfde24f..1c04f7357d 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_es.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_es.cpp @@ -67,6 +67,10 @@ #include #endif +namespace IOS +{ +namespace HLE +{ std::string CWII_IPC_HLE_Device_es::m_ContentFile; CWII_IPC_HLE_Device_es::CWII_IPC_HLE_Device_es(u32 device_id, const std::string& device_name) @@ -1114,8 +1118,8 @@ IPCCommandResult CWII_IPC_HLE_Device_es::IOCtlV(const IOSIOCtlVRequest& request) wiiMoteConnected[i] = s_Usb->m_WiiMotes[i].IsConnected(); } - WII_IPC_HLE_Interface::Reset(true); - WII_IPC_HLE_Interface::Reinit(); + Reset(true); + Reinit(); if (!SConfig::GetInstance().m_bt_passthrough_enabled) { @@ -1134,7 +1138,7 @@ IPCCommandResult CWII_IPC_HLE_Device_es::IOCtlV(const IOSIOCtlVRequest& request) } } delete[] wiiMoteConnected; - WII_IPC_HLE_Interface::SetDefaultContentFile(tContentFile); + SetDefaultContentFile(tContentFile); } // Pass the "#002 check" // Apploader should write the IOS version and revision to 0x3140, and compare it @@ -1167,7 +1171,7 @@ IPCCommandResult CWII_IPC_HLE_Device_es::IOCtlV(const IOSIOCtlVRequest& request) // Generate a "reply" to the IPC command. ES_LAUNCH is unique because it // involves restarting IOS; IOS generates two acknowledgements in a row. - WII_IPC_HLE_Interface::EnqueueCommandAcknowledgement(request.address, 0); + EnqueueCommandAcknowledgement(request.address, 0); return GetNoReply(); } break; @@ -1319,3 +1323,5 @@ u32 CWII_IPC_HLE_Device_es::ES_DIVerify(const std::vector& tmd) DiscIO::CNANDContentManager::Access().ClearCache(); return 0; } +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_es.h b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_es.h index 9f4afe4c91..61fedff948 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_es.h +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_es.h @@ -22,6 +22,10 @@ class CNANDContentLoader; struct SNANDContent; } +namespace IOS +{ +namespace HLE +{ class CWII_IPC_HLE_Device_es : public IWII_IPC_HLE_Device { public: @@ -162,3 +166,5 @@ private: u8 padding[0x3c]; }; }; +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_fs.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_fs.cpp index 66397e9edb..79e9fdd4e1 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_fs.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_fs.cpp @@ -22,6 +22,10 @@ #include "Core/IPC_HLE/WII_IPC_HLE_Device_FileIO.h" #include "Core/IPC_HLE/WII_IPC_HLE_Device_fs.h" +namespace IOS +{ +namespace HLE +{ static bool IsValidWiiPath(const std::string& path) { return path.compare(0, 1, "/") == 0; @@ -634,3 +638,5 @@ void CWII_IPC_HLE_Device_fs::DoState(PointerWrap& p) p.Do(type); } } +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_fs.h b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_fs.h index 5dd540033e..0b25f85f7a 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_fs.h +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_fs.h @@ -12,6 +12,10 @@ class PointerWrap; +namespace IOS +{ +namespace HLE +{ struct NANDStat { u32 BlockSize; @@ -52,3 +56,5 @@ private: IPCCommandResult GetFSReply(s32 return_value) const; s32 ExecuteCommand(const IOSIOCtlRequest& request); }; +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_hid.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_hid.cpp index 6945583f24..aa1f6206c3 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_hid.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_hid.cpp @@ -20,6 +20,10 @@ #include "Core/IPC_HLE/WII_IPC_HLE.h" #include "Core/IPC_HLE/WII_IPC_HLE_Device_hid.h" +namespace IOS +{ +namespace HLE +{ #define MAX_DEVICE_DEVNUM 256 static u64 hidDeviceAliases[MAX_DEVICE_DEVNUM]; @@ -39,8 +43,7 @@ void CWII_IPC_HLE_Device_hid::checkUsbUpdates(CWII_IPC_HLE_Device_hid* hid) { IOSIOCtlRequest request{hid->deviceCommandAddress}; hid->FillOutDevices(request); - WII_IPC_HLE_Interface::EnqueueReply(request, IPC_SUCCESS, 0, - CoreTiming::FromThread::NON_CPU); + EnqueueReply(request, IPC_SUCCESS, 0, CoreTiming::FromThread::NON_CPU); hid->deviceCommandAddress = 0; } } @@ -61,7 +64,7 @@ void CWII_IPC_HLE_Device_hid::handleUsbUpdates(struct libusb_transfer* transfer) } IOSIOCtlRequest request{replyAddress}; - WII_IPC_HLE_Interface::EnqueueReply(request, ret, 0, CoreTiming::FromThread::NON_CPU); + EnqueueReply(request, ret, 0, CoreTiming::FromThread::NON_CPU); } CWII_IPC_HLE_Device_hid::CWII_IPC_HLE_Device_hid(u32 _DeviceID, const std::string& _rDeviceName) @@ -211,7 +214,7 @@ IPCCommandResult CWII_IPC_HLE_Device_hid::IOCtl(const IOSIOCtlRequest& request) { IOSIOCtlRequest pending_request{deviceCommandAddress}; Memory::Write_U32(0xFFFFFFFF, pending_request.buffer_out); - WII_IPC_HLE_Interface::EnqueueReply(pending_request, -1); + EnqueueReply(pending_request, -1); deviceCommandAddress = 0; } INFO_LOG(WII_IPC_HID, "HID::IOCtl(Shutdown) (BufferIn: (%08x, %i), BufferOut: (%08x, %i)", @@ -570,3 +573,5 @@ int CWII_IPC_HLE_Device_hid::GetAvailableDevNum(u16 idVendor, u16 idProduct, u8 return -1; } +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_hid.h b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_hid.h index f88a42f4d0..3b74d7b55f 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_hid.h +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_hid.h @@ -28,6 +28,10 @@ struct libusb_endpoint_descriptor; struct libusb_interface_descriptor; struct libusb_transfer; +namespace IOS +{ +namespace HLE +{ #define HID_ID_MASK 0x0000FFFFFFFFFFFF #define MAX_HID_INTERFACES 1 @@ -136,3 +140,5 @@ private: std::thread usb_thread; bool usb_thread_running; }; +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net.cpp index 9ad7da68ee..7c0c954b5f 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net.cpp @@ -59,6 +59,10 @@ typedef struct pollfd pollfd_t; #define UNSUPPORTED_WSAPOLL 0 #endif +namespace IOS +{ +namespace HLE +{ // ********************************************************************************** // Handle /dev/net/kd/request requests CWII_IPC_HLE_Device_net_kd_request::CWII_IPC_HLE_Device_net_kd_request( @@ -1373,3 +1377,5 @@ void CWII_IPC_HLE_Device_net_ip_top::Update() { WiiSockMan::GetInstance().Update(); } +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net.h b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net.h index 2e82d20956..9472aa048b 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net.h +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net.h @@ -19,6 +19,10 @@ #include #endif +namespace IOS +{ +namespace HLE +{ ////////////////////////////////////////////////////////////////////////// // KD is the IOS module responsible for implementing WiiConnect24 functionality. // It can perform HTTPS downloads, send and receive mail via SMTP, and execute a @@ -331,3 +335,5 @@ private: }; #pragma pack(pop) }; +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net_ssl.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net_ssl.cpp index 32d6129f7a..ba6642aa04 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net_ssl.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net_ssl.cpp @@ -16,6 +16,10 @@ #include "Core/IPC_HLE/WII_IPC_HLE_Device_net_ssl.h" #include "Core/IPC_HLE/WII_Socket.h" +namespace IOS +{ +namespace HLE +{ WII_SSL CWII_IPC_HLE_Device_net_ssl::_SSL[NET_SSL_MAXINSTANCES]; static constexpr mbedtls_x509_crt_profile mbedtls_x509_crt_profile_wii = { @@ -494,3 +498,5 @@ IPCCommandResult CWII_IPC_HLE_Device_net_ssl::IOCtlV(const IOSIOCtlVRequest& req // SSL return codes are written to BufferIn return GetDefaultReply(IPC_SUCCESS); } +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net_ssl.h b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net_ssl.h index cdb689163b..136569cb0b 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net_ssl.h +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net_ssl.h @@ -22,6 +22,10 @@ #include "Core/IPC_HLE/WII_IPC_HLE.h" #include "Core/IPC_HLE/WII_IPC_HLE_Device.h" +namespace IOS +{ +namespace HLE +{ #define NET_SSL_MAXINSTANCES 4 #define SSLID_VALID(x) \ @@ -94,3 +98,5 @@ public: static WII_SSL _SSL[NET_SSL_MAXINSTANCES]; }; +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_sdio_slot0.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_sdio_slot0.cpp index da985a72e6..a33afc4703 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_sdio_slot0.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_sdio_slot0.cpp @@ -17,6 +17,10 @@ #include "Core/IPC_HLE/WII_IPC_HLE.h" #include "Core/IPC_HLE/WII_IPC_HLE_Device_sdio_slot0.h" +namespace IOS +{ +namespace HLE +{ CWII_IPC_HLE_Device_sdio_slot0::CWII_IPC_HLE_Device_sdio_slot0(const u32 device_id, const std::string& device_name) : IWII_IPC_HLE_Device(device_id, device_name) @@ -45,7 +49,7 @@ void CWII_IPC_HLE_Device_sdio_slot0::EventNotify() if ((SConfig::GetInstance().m_WiiSDCard && m_event->type == EVENT_INSERT) || (!SConfig::GetInstance().m_WiiSDCard && m_event->type == EVENT_REMOVE)) { - WII_IPC_HLE_Interface::EnqueueReply(m_event->request, m_event->type); + EnqueueReply(m_event->request, m_event->type); m_event.reset(); } } @@ -391,7 +395,7 @@ u32 CWII_IPC_HLE_Device_sdio_slot0::ExecuteCommand(const IOSRequest& request, u3 // release returns 0 // unknown sd int // technically we do it out of order, oh well - WII_IPC_HLE_Interface::EnqueueReply(m_event->request, EVENT_INVALID); + EnqueueReply(m_event->request, EVENT_INVALID); m_event.reset(); break; } @@ -403,3 +407,5 @@ u32 CWII_IPC_HLE_Device_sdio_slot0::ExecuteCommand(const IOSRequest& request, u3 return ret; } +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_sdio_slot0.h b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_sdio_slot0.h index d8d409322c..2c349546fe 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_sdio_slot0.h +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_sdio_slot0.h @@ -16,6 +16,10 @@ class PointerWrap; +namespace IOS +{ +namespace HLE +{ class CWII_IPC_HLE_Device_sdio_slot0 : public IWII_IPC_HLE_Device { public: @@ -125,3 +129,5 @@ private: u32 BufferInSize2, u32 _BufferOut, u32 BufferOutSize); void OpenInternal(); }; +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_stm.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_stm.cpp index 7a57814b15..5a6af84273 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_stm.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_stm.cpp @@ -17,6 +17,10 @@ void QueueHostJob(std::function job, bool run_during_stop); void Stop(); } +namespace IOS +{ +namespace HLE +{ static std::unique_ptr s_event_hook_request; IPCCommandResult CWII_IPC_HLE_Device_stm_immediate::IOCtl(const IOSIOCtlRequest& request) @@ -37,7 +41,7 @@ IPCCommandResult CWII_IPC_HLE_Device_stm_immediate::IOCtl(const IOSIOCtlRequest& break; } Memory::Write_U32(0, s_event_hook_request->buffer_out); - WII_IPC_HLE_Interface::EnqueueReply(*s_event_hook_request, IPC_SUCCESS); + EnqueueReply(*s_event_hook_request, IPC_SUCCESS); s_event_hook_request.reset(); break; @@ -99,7 +103,7 @@ void CWII_IPC_HLE_Device_stm_eventhook::TriggerEvent(const u32 event) const return; Memory::Write_U32(event, s_event_hook_request->buffer_out); - WII_IPC_HLE_Interface::EnqueueReply(*s_event_hook_request, IPC_SUCCESS); + EnqueueReply(*s_event_hook_request, IPC_SUCCESS); s_event_hook_request.reset(); } @@ -113,3 +117,5 @@ void CWII_IPC_HLE_Device_stm_eventhook::PowerButton() const { TriggerEvent(STM_EVENT_POWER); } +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_stm.h b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_stm.h index b83a8dc4a3..4ba8e29672 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_stm.h +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_stm.h @@ -10,6 +10,10 @@ #include "Core/IPC_HLE/WII_IPC_HLE.h" #include "Core/IPC_HLE/WII_IPC_HLE_Device.h" +namespace IOS +{ +namespace HLE +{ enum { IOCTL_STM_EVENTHOOK = 0x1000, @@ -65,3 +69,5 @@ public: private: void TriggerEvent(u32 event) const; }; +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_stub.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_stub.cpp index 690182ab52..63cdec4c9d 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_stub.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_stub.cpp @@ -5,6 +5,10 @@ #include "Core/IPC_HLE/WII_IPC_HLE_Device_stub.h" #include "Common/Logging/Log.h" +namespace IOS +{ +namespace HLE +{ CWII_IPC_HLE_Device_stub::CWII_IPC_HLE_Device_stub(u32 device_id, const std::string& device_name) : IWII_IPC_HLE_Device(device_id, device_name) { @@ -34,3 +38,5 @@ IPCCommandResult CWII_IPC_HLE_Device_stub::IOCtlV(const IOSIOCtlVRequest& reques WARN_LOG(WII_IPC_HLE, "%s faking IOCtlV()", m_name.c_str()); return GetDefaultReply(IPC_SUCCESS); } +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_stub.h b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_stub.h index 8dd7c72eab..a4c641ad77 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_stub.h +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_stub.h @@ -10,6 +10,10 @@ #include "Core/IPC_HLE/WII_IPC_HLE.h" #include "Core/IPC_HLE/WII_IPC_HLE_Device.h" +namespace IOS +{ +namespace HLE +{ class CWII_IPC_HLE_Device_stub : public IWII_IPC_HLE_Device { public: @@ -20,3 +24,5 @@ public: IPCCommandResult IOCtl(const IOSIOCtlRequest& request) override; IPCCommandResult IOCtlV(const IOSIOCtlVRequest& request) override; }; +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_base.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_base.cpp index 26a182d8ed..a9148d8752 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_base.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_base.cpp @@ -16,6 +16,10 @@ #include "Core/HW/Memmap.h" #include "Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_base.h" +namespace IOS +{ +namespace HLE +{ constexpr u16 BT_INFO_SECTION_LENGTH = 0x460; void BackUpBTInfoSection(SysConf* sysconf) @@ -76,3 +80,5 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305_base::CtrlBuffer::FillBuffer(const u8* m_length); Memory::CopyToEmu(m_payload_addr, src, size); } +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_base.h b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_base.h index d5580299c3..c6889dcf5b 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_base.h +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_base.h @@ -14,6 +14,10 @@ class PointerWrap; class SysConf; +namespace IOS +{ +namespace HLE +{ void BackUpBTInfoSection(SysConf* sysconf); void RestoreBTInfoSection(SysConf* sysconf); @@ -71,3 +75,5 @@ protected: u32 m_payload_addr = 0; }; }; +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_emu.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_emu.cpp index 11d5371b55..568a51e079 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_emu.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_emu.cpp @@ -28,6 +28,10 @@ #include "Core/IPC_HLE/WII_IPC_HLE_WiiMote.h" #include "InputCommon/ControllerInterface/ControllerInterface.h" +namespace IOS +{ +namespace HLE +{ SQueuedEvent::SQueuedEvent(u32 size, u16 handle) : m_size(size), m_connectionHandle(handle) { if (m_size > 1024) @@ -267,8 +271,7 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305_emu::SendACLPacket(u16 connection_handl // Write the packet to the buffer memcpy(reinterpret_cast(header) + sizeof(hci_acldata_hdr_t), data, header->length); - WII_IPC_HLE_Interface::EnqueueReply(m_ACLEndpoint->ios_request, - sizeof(hci_acldata_hdr_t) + size); + EnqueueReply(m_ACLEndpoint->ios_request, sizeof(hci_acldata_hdr_t) + size); m_ACLEndpoint.reset(); } else @@ -295,8 +298,9 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305_emu::AddEventToQueue(const SQueuedEvent DEBUG_LOG(WII_IPC_WIIMOTE, "HCI endpoint valid, sending packet to %08x", m_HCIEndpoint->ios_request.address); m_HCIEndpoint->FillBuffer(_event.m_buffer, _event.m_size); + // Send a reply to indicate HCI buffer is filled - WII_IPC_HLE_Interface::EnqueueReply(m_HCIEndpoint->ios_request, _event.m_size); + EnqueueReply(m_HCIEndpoint->ios_request, _event.m_size); m_HCIEndpoint.reset(); } else // push new one, pop oldest @@ -310,8 +314,9 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305_emu::AddEventToQueue(const SQueuedEvent ((hci_event_hdr_t*)event.m_buffer)->event, m_EventQueue.size() - 1, m_HCIEndpoint->ios_request.address); m_HCIEndpoint->FillBuffer(event.m_buffer, event.m_size); + // Send a reply to indicate HCI buffer is filled - WII_IPC_HLE_Interface::EnqueueReply(m_HCIEndpoint->ios_request, event.m_size); + EnqueueReply(m_HCIEndpoint->ios_request, event.m_size); m_HCIEndpoint.reset(); m_EventQueue.pop_front(); } @@ -335,8 +340,9 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305_emu::Update() ((hci_event_hdr_t*)event.m_buffer)->event, m_EventQueue.size() - 1, m_HCIEndpoint->ios_request.address); m_HCIEndpoint->FillBuffer(event.m_buffer, event.m_size); + // Send a reply to indicate HCI buffer is filled - WII_IPC_HLE_Interface::EnqueueReply(m_HCIEndpoint->ios_request, event.m_size); + EnqueueReply(m_HCIEndpoint->ios_request, event.m_size); m_HCIEndpoint.reset(); m_EventQueue.pop_front(); } @@ -432,7 +438,7 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305_emu::ACLPool::WriteToEndpoint(CtrlBuffe m_queue.pop_front(); - WII_IPC_HLE_Interface::EnqueueReply(endpoint.ios_request, sizeof(hci_acldata_hdr_t) + size); + EnqueueReply(endpoint.ios_request, sizeof(hci_acldata_hdr_t) + size); } bool CWII_IPC_HLE_Device_usb_oh1_57e_305_emu::SendEventInquiryComplete() @@ -1152,7 +1158,7 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305_emu::ExecuteHCICommandMessage( } // HCI command is finished, send a reply to command - WII_IPC_HLE_Interface::EnqueueReply(ctrl_message.ios_request, ctrl_message.length); + EnqueueReply(ctrl_message.ios_request, ctrl_message.length); } // @@ -1806,3 +1812,5 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305_emu::DisplayDisconnectMessage(const int Core::DisplayMessage( StringFromFormat("Wii Remote %i disconnected by emulated software", wiimoteNumber), 3000); } +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_emu.h b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_emu.h index c3b6ad2cc0..bbd06fdadb 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_emu.h +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_emu.h @@ -19,9 +19,14 @@ #include "Core/IPC_HLE/WII_IPC_HLE_WiiMote.h" #include "Core/IPC_HLE/hci.h" -class CWII_IPC_HLE_WiiMote; class PointerWrap; +namespace IOS +{ +namespace HLE +{ +class CWII_IPC_HLE_WiiMote; + struct SQueuedEvent { u8 m_buffer[1024] = {0}; @@ -189,3 +194,5 @@ private: }; #pragma pack(pop) }; +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_real.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_real.cpp index a439f7c594..7f93b65cbe 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_real.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_real.cpp @@ -31,6 +31,10 @@ #include "Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_real.h" #include "Core/IPC_HLE/hci.h" +namespace IOS +{ +namespace HLE +{ // This stores the address of paired devices and associated link keys. // It is needed because some adapters forget all stored link keys when they are reset, // which breaks pairings because the Wii relies on the Bluetooth module to remember them. @@ -393,7 +397,8 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305_real::FakeVendorCommandReply(CtrlBuffer hci_event->PayloadLength = sizeof(SHCIEventCommand) - 2; hci_event->PacketIndicator = 0x01; hci_event->Opcode = m_fake_vendor_command_reply_opcode; - WII_IPC_HLE_Interface::EnqueueReply(ctrl.ios_request, static_cast(sizeof(SHCIEventCommand))); + + EnqueueReply(ctrl.ios_request, static_cast(sizeof(SHCIEventCommand))); } // Due to how the widcomm stack which Nintendo uses is coded, we must never @@ -418,9 +423,8 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305_real::FakeReadBufferSizeReply(CtrlBuffe reply.num_sco_pkts = SCO_PKT_NUM; memcpy(packet + sizeof(SHCIEventCommand), &reply, sizeof(hci_read_buffer_size_rp)); - WII_IPC_HLE_Interface::EnqueueReply( - ctrl.ios_request, - static_cast(sizeof(SHCIEventCommand) + sizeof(hci_read_buffer_size_rp))); + EnqueueReply(ctrl.ios_request, + static_cast(sizeof(SHCIEventCommand) + sizeof(hci_read_buffer_size_rp))); } void CWII_IPC_HLE_Device_usb_oh1_57e_305_real::FakeSyncButtonEvent(CtrlBuffer& ctrl, @@ -431,8 +435,7 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305_real::FakeSyncButtonEvent(CtrlBuffer& c hci_event->event = HCI_EVENT_VENDOR; hci_event->length = size; memcpy(packet + sizeof(hci_event_hdr_t), payload, size); - WII_IPC_HLE_Interface::EnqueueReply(ctrl.ios_request, - static_cast(sizeof(hci_event_hdr_t) + size)); + EnqueueReply(ctrl.ios_request, static_cast(sizeof(hci_event_hdr_t) + size)); } // When the red sync button is pressed, a HCI event is generated: @@ -578,8 +581,7 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305_real::CommandCallback(libusb_transfer* s_showed_failed_transfer.Clear(); } - WII_IPC_HLE_Interface::EnqueueReply(cmd->ios_request, tr->actual_length, 0, - CoreTiming::FromThread::NON_CPU); + EnqueueReply(cmd->ios_request, tr->actual_length, 0, CoreTiming::FromThread::NON_CPU); } void CWII_IPC_HLE_Device_usb_oh1_57e_305_real::TransferCallback(libusb_transfer* tr) @@ -623,6 +625,7 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305_real::TransferCallback(libusb_transfer* } } - WII_IPC_HLE_Interface::EnqueueReply(ctrl->ios_request, tr->actual_length, 0, - CoreTiming::FromThread::NON_CPU); + EnqueueReply(ctrl->ios_request, tr->actual_length, 0, CoreTiming::FromThread::NON_CPU); } +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_real.h b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_real.h index 6c267264cb..a87b9cc4b6 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_real.h +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_real.h @@ -22,6 +22,10 @@ struct libusb_device; struct libusb_device_handle; struct libusb_transfer; +namespace IOS +{ +namespace HLE +{ enum class SyncButtonState { Unpressed, @@ -96,9 +100,17 @@ private: static void CommandCallback(libusb_transfer* transfer); static void TransferCallback(libusb_transfer* transfer); }; +} // namespace HLE +} // namespace IOS #else #include "Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_stub.h" +namespace IOS +{ +namespace HLE +{ using CWII_IPC_HLE_Device_usb_oh1_57e_305_real = CWII_IPC_HLE_Device_usb_oh1_57e_305_stub; +} // namespace HLE +} // namespace IOS #endif diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_stub.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_stub.cpp index 252cefadf7..074404e40e 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_stub.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_stub.cpp @@ -12,6 +12,10 @@ namespace Core void DisplayMessage(const std::string& message, int time_in_ms); } +namespace IOS +{ +namespace HLE +{ IOSReturnCode CWII_IPC_HLE_Device_usb_oh1_57e_305_stub::Open(const IOSOpenRequest& request) { PanicAlertT("Bluetooth passthrough mode is enabled, but Dolphin was built without libusb." @@ -24,3 +28,5 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305_stub::DoState(PointerWrap& p) Core::DisplayMessage("The current IPC_HLE_Device_usb is a stub. Aborting load.", 4000); p.SetMode(PointerWrap::MODE_VERIFY); } +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_stub.h b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_stub.h index efb149496e..e811b8eb0e 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_stub.h +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_stub.h @@ -12,6 +12,10 @@ class PointerWrap; +namespace IOS +{ +namespace HLE +{ class CWII_IPC_HLE_Device_usb_oh1_57e_305_stub final : public CWII_IPC_HLE_Device_usb_oh1_57e_305_base { @@ -23,3 +27,5 @@ public: IOSReturnCode Open(const IOSOpenRequest& request) override; void DoState(PointerWrap& p) override; }; +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_kbd.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_kbd.cpp index c5da572139..69d377fb65 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_kbd.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_kbd.cpp @@ -17,6 +17,10 @@ #include #endif +namespace IOS +{ +namespace HLE +{ CWII_IPC_HLE_Device_usb_kbd::SMessageData::SMessageData(u32 type, u8 modifiers, u8* pressed_keys) { MsgType = Common::swap32(type); @@ -313,3 +317,5 @@ u8 CWII_IPC_HLE_Device_usb_kbd::m_KeyCodesQWERTY[256] = {0}; u8 CWII_IPC_HLE_Device_usb_kbd::m_KeyCodesAZERTY[256] = {0}; #endif +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_kbd.h b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_kbd.h index 18b3efade0..76ad64a260 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_kbd.h +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_kbd.h @@ -11,6 +11,10 @@ #include "Core/IPC_HLE/WII_IPC_HLE.h" #include "Core/IPC_HLE/WII_IPC_HLE_Device.h" +namespace IOS +{ +namespace HLE +{ class CWII_IPC_HLE_Device_usb_kbd : public IWII_IPC_HLE_Device { public: @@ -57,3 +61,5 @@ private: static u8 m_KeyCodesQWERTY[256]; static u8 m_KeyCodesAZERTY[256]; }; +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_ven.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_ven.cpp index 384e2d0154..ec41fa8c35 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_ven.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_ven.cpp @@ -6,6 +6,10 @@ #include "Common/Logging/Log.h" #include "Core/HW/Memmap.h" +namespace IOS +{ +namespace HLE +{ CWII_IPC_HLE_Device_usb_ven::CWII_IPC_HLE_Device_usb_ven(const u32 device_id, const std::string& device_name) : IWII_IPC_HLE_Device(device_id, device_name) @@ -74,3 +78,5 @@ IPCCommandResult CWII_IPC_HLE_Device_usb_ven::IOCtl(const IOSIOCtlRequest& reque } return reply; } +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_ven.h b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_ven.h index 7cb5406483..e74554e328 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_ven.h +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_ven.h @@ -10,6 +10,10 @@ #include "Core/IPC_HLE/WII_IPC_HLE.h" #include "Core/IPC_HLE/WII_IPC_HLE_Device.h" +namespace IOS +{ +namespace HLE +{ class CWII_IPC_HLE_Device_usb_ven final : public IWII_IPC_HLE_Device { public: @@ -35,3 +39,5 @@ private: USBV5_IOCTL_BULKMSG = 21 }; }; +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_wfssrv.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_wfssrv.cpp index 2d178db263..ab19a718d1 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_wfssrv.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_wfssrv.cpp @@ -14,13 +14,17 @@ #include "Core/HW/DVDInterface.h" #include "Core/HW/Memmap.h" +namespace IOS +{ +namespace HLE +{ namespace WFS { std::string NativePath(const std::string& wfs_path) { return File::GetUserPath(D_WFSROOT_IDX) + Common::EscapePath(wfs_path); } -} +} // namespace WFS CWII_IPC_HLE_Device_usb_wfssrv::CWII_IPC_HLE_Device_usb_wfssrv(u32 device_id, const std::string& device_name) @@ -223,3 +227,5 @@ bool CWII_IPC_HLE_Device_usb_wfssrv::FileDescriptor::Open() return file.Open(WFS::NativePath(path), mode_string); } +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_wfssrv.h b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_wfssrv.h index 5616424bd8..a26a8bf74a 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_wfssrv.h +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_wfssrv.h @@ -13,6 +13,10 @@ #include "Core/IPC_HLE/WII_IPC_HLE_Device.h" #include "DiscIO/Volume.h" +namespace IOS +{ +namespace HLE +{ namespace WFS { std::string NativePath(const std::string& wfs_path); @@ -73,3 +77,5 @@ private: u16 GetNewFileDescriptor(); void ReleaseFileDescriptor(u16 fd); }; +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_wfsi.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_wfsi.cpp index b2497ee723..22b563cf38 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_wfsi.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_wfsi.cpp @@ -18,6 +18,10 @@ #include "Core/IPC_HLE/WII_IPC_HLE_Device_usb_wfssrv.h" #include "DiscIO/NANDContentLoader.h" +namespace IOS +{ +namespace HLE +{ void ARCUnpacker::Reset() { m_whole_file.clear(); @@ -240,3 +244,5 @@ IPCCommandResult CWII_IPC_HLE_Device_wfsi::IOCtl(const IOSIOCtlRequest& request) return GetDefaultReply(return_error_code); } +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_wfsi.h b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_wfsi.h index 68cffd0eee..baf44d809f 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_wfsi.h +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_wfsi.h @@ -14,6 +14,10 @@ #include "Core/IPC_HLE/WII_IPC_HLE.h" #include "Core/IPC_HLE/WII_IPC_HLE_Device.h" +namespace IOS +{ +namespace HLE +{ class ARCUnpacker { public: @@ -69,3 +73,5 @@ private: IOCTL_WFSI_APPLY_TITLE_PROFILE = 0x89, }; }; +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_WiiMote.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_WiiMote.cpp index 2af575eaeb..0b13fac48c 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_WiiMote.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_WiiMote.cpp @@ -21,6 +21,10 @@ #include "Core/IPC_HLE/WiiMote_HID_Attr.h" #include "Core/IPC_HLE/l2cap.h" +namespace IOS +{ +namespace HLE +{ static CWII_IPC_HLE_Device_usb_oh1_57e_305_emu* s_Usb = nullptr; CWII_IPC_HLE_Device_usb_oh1_57e_305_emu* GetUsbPointer() @@ -927,6 +931,8 @@ void CWII_IPC_HLE_WiiMote::ReceiveL2capData(u16 scid, const void* _pData, u32 _S // Send the report m_pHost->SendACLPacket(GetConnectionHandle(), DataFrame, Offset); } +} // namespace HLE +} // namespace IOS namespace Core { @@ -941,6 +947,6 @@ void Callback_WiimoteInterruptChannel(int _number, u16 _channelID, const void* _ DEBUG_LOG(WIIMOTE, " Data: %s", ArrayToString(pData, _Size, 50).c_str()); DEBUG_LOG(WIIMOTE, " Channel: %x", _channelID); - s_Usb->m_WiiMotes[_number].ReceiveL2capData(_channelID, _pData, _Size); + IOS::HLE::s_Usb->m_WiiMotes[_number].ReceiveL2capData(_channelID, _pData, _Size); } } diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_WiiMote.h b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_WiiMote.h index 6cad26047c..66e5d46428 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_WiiMote.h +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_WiiMote.h @@ -12,9 +12,14 @@ #include "Common/CommonTypes.h" #include "Core/IPC_HLE/hci.h" -class CWII_IPC_HLE_Device_usb_oh1_57e_305_emu; class PointerWrap; +namespace IOS +{ +namespace HLE +{ +class CWII_IPC_HLE_Device_usb_oh1_57e_305_emu; + CWII_IPC_HLE_Device_usb_oh1_57e_305_emu* GetUsbPointer(); void SetUsbPointer(CWII_IPC_HLE_Device_usb_oh1_57e_305_emu* ptr); @@ -134,3 +139,5 @@ private: u16 _StartAttrID, u16 _EndAttrID, u16 _MaximumAttributeByteCount, u8* _pContinuationState); }; +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_Socket.cpp b/Source/Core/Core/IPC_HLE/WII_Socket.cpp index 233b39d6d9..53812b4d8f 100644 --- a/Source/Core/Core/IPC_HLE/WII_Socket.cpp +++ b/Source/Core/Core/IPC_HLE/WII_Socket.cpp @@ -24,6 +24,10 @@ #define EITHER(win32, posix) posix #endif +namespace IOS +{ +namespace HLE +{ char* WiiSockMan::DecodeError(s32 ErrorCode) { #ifdef _WIN32 @@ -567,7 +571,8 @@ void WiiSocket::Update(bool read, bool write, bool except) "IOCTL(V) Sock: %08x ioctl/v: %d returned: %d nonBlock: %d forceNonBlock: %d", fd, it->is_ssl ? (int)it->ssl_type : (int)it->net_type, ReturnValue, nonBlock, forceNonBlock); - WII_IPC_HLE_Interface::EnqueueReply(it->request, ReturnValue); + + EnqueueReply(it->request, ReturnValue); it = pending_sockops.erase(it); } else @@ -692,3 +697,5 @@ void WiiSockMan::UpdateWantDeterminism(bool want) #undef ERRORCODE #undef EITHER +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WII_Socket.h b/Source/Core/Core/IPC_HLE/WII_Socket.h index 793c02d1f2..6736fe4899 100644 --- a/Source/Core/Core/IPC_HLE/WII_Socket.h +++ b/Source/Core/Core/IPC_HLE/WII_Socket.h @@ -56,6 +56,10 @@ typedef struct pollfd pollfd_t; #include "Core/IPC_HLE/WII_IPC_HLE_Device_net.h" #include "Core/IPC_HLE/WII_IPC_HLE_Device_net_ssl.h" +namespace IOS +{ +namespace HLE +{ enum { SO_MSG_OOB = 0x01, @@ -230,7 +234,7 @@ public: { ERROR_LOG(WII_IPC_NET, "DoSock: Error, fd not found (%08x, %08X, %08X)", sock, request.address, type); - WII_IPC_HLE_Interface::EnqueueReply(request, -SO_EBADF); + EnqueueReply(request, -SO_EBADF); } else { @@ -246,3 +250,5 @@ private: std::unordered_map WiiSockets; s32 errno_last; }; +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WiiMote_HID_Attr.cpp b/Source/Core/Core/IPC_HLE/WiiMote_HID_Attr.cpp index f8f7241b79..f210cda351 100644 --- a/Source/Core/Core/IPC_HLE/WiiMote_HID_Attr.cpp +++ b/Source/Core/Core/IPC_HLE/WiiMote_HID_Attr.cpp @@ -6,6 +6,10 @@ #include "Common/Assert.h" #include "Common/CommonTypes.h" +namespace IOS +{ +namespace HLE +{ static u8 packet1[] = { 0x00, 0x7b, 0x00, 0x76, 0x36, 0x01, 0xcc, 0x09, 0x00, 0x00, 0x0a, 0x00, 0x01, 0x00, 0x00, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11, 0x24, 0x09, 0x00, 0x04, 0x35, 0x0d, 0x35, 0x06, 0x19, 0x01, @@ -96,3 +100,5 @@ const u8* GetAttribPacket(u32 serviceHandle, u32 cont, u32& _size) return nullptr; } +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WiiMote_HID_Attr.h b/Source/Core/Core/IPC_HLE/WiiMote_HID_Attr.h index c0d899a66d..175896bc71 100644 --- a/Source/Core/Core/IPC_HLE/WiiMote_HID_Attr.h +++ b/Source/Core/Core/IPC_HLE/WiiMote_HID_Attr.h @@ -6,4 +6,10 @@ #include "Common/CommonTypes.h" +namespace IOS +{ +namespace HLE +{ const u8* GetAttribPacket(u32 serviceHandle, u32 cont, u32& _size); +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WiiNetConfig.cpp b/Source/Core/Core/IPC_HLE/WiiNetConfig.cpp index 37d2d43b75..0d79ed2e63 100644 --- a/Source/Core/Core/IPC_HLE/WiiNetConfig.cpp +++ b/Source/Core/Core/IPC_HLE/WiiNetConfig.cpp @@ -12,6 +12,10 @@ #include "Common/Logging/Log.h" #include "Core/HW/Memmap.h" +namespace IOS +{ +namespace HLE +{ namespace Net { WiiNetConfig::WiiNetConfig() @@ -71,3 +75,5 @@ void WiiNetConfig::ReadFromMem(const u32 address) Memory::CopyFromEmu(&m_data, address, sizeof(m_data)); } } // namespace Net +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/IPC_HLE/WiiNetConfig.h b/Source/Core/Core/IPC_HLE/WiiNetConfig.h index db85e724e1..c1d8619991 100644 --- a/Source/Core/Core/IPC_HLE/WiiNetConfig.h +++ b/Source/Core/Core/IPC_HLE/WiiNetConfig.h @@ -7,6 +7,10 @@ #include #include "Common/CommonTypes.h" +namespace IOS +{ +namespace HLE +{ namespace Net { #pragma pack(push, 1) @@ -135,3 +139,5 @@ private: ConfigData m_data; }; } // namespace Net +} // namespace HLE +} // namespace IOS diff --git a/Source/Core/Core/Movie.cpp b/Source/Core/Core/Movie.cpp index 840a3f8255..b1338db740 100644 --- a/Source/Core/Core/Movie.cpp +++ b/Source/Core/Core/Movie.cpp @@ -531,7 +531,7 @@ void ChangeWiiPads(bool instantly) { g_wiimote_sources[i] = IsUsingWiimote(i) ? WIIMOTE_SRC_EMU : WIIMOTE_SRC_NONE; if (!SConfig::GetInstance().m_bt_passthrough_enabled) - GetUsbPointer()->AccessWiiMote(i | 0x100)->Activate(IsUsingWiimote(i)); + IOS::HLE::GetUsbPointer()->AccessWiiMote(i | 0x100)->Activate(IsUsingWiimote(i)); } } diff --git a/Source/Core/Core/State.cpp b/Source/Core/Core/State.cpp index 428ccb339e..a50e3983e0 100644 --- a/Source/Core/Core/State.cpp +++ b/Source/Core/Core/State.cpp @@ -71,7 +71,7 @@ static Common::Event g_compressAndDumpStateSyncEvent; static std::thread g_save_thread; // Don't forget to increase this after doing changes on the savestate system -static const u32 STATE_VERSION = 69; // Last changed in PR 4661 +static const u32 STATE_VERSION = 70; // Last changed in PR 4679 // Maps savestate versions to Dolphin versions. // Versions after 42 don't need to be added to this list, diff --git a/Source/Core/DolphinWX/Config/WiiConfigPane.cpp b/Source/Core/DolphinWX/Config/WiiConfigPane.cpp index 40f72fe471..168e29a1c7 100644 --- a/Source/Core/DolphinWX/Config/WiiConfigPane.cpp +++ b/Source/Core/DolphinWX/Config/WiiConfigPane.cpp @@ -201,7 +201,7 @@ void WiiConfigPane::OnPAL60CheckBoxChanged(wxCommandEvent& event) void WiiConfigPane::OnSDCardCheckBoxChanged(wxCommandEvent& event) { SConfig::GetInstance().m_WiiSDCard = m_sd_card_checkbox->IsChecked(); - WII_IPC_HLE_Interface::SDIO_EventNotify(); + IOS::HLE::SDIO_EventNotify(); } void WiiConfigPane::OnConnectKeyboardCheckBoxChanged(wxCommandEvent& event) diff --git a/Source/Core/DolphinWX/ControllerConfigDiag.cpp b/Source/Core/DolphinWX/ControllerConfigDiag.cpp index 30c6be8f77..2c0a8646bd 100644 --- a/Source/Core/DolphinWX/ControllerConfigDiag.cpp +++ b/Source/Core/DolphinWX/ControllerConfigDiag.cpp @@ -527,9 +527,9 @@ void ControllerConfigDiag::OnPassthroughScanButton(wxCommandEvent& event) _("Sync Wii Remotes"), wxICON_WARNING); return; } - auto device = WII_IPC_HLE_Interface::GetDeviceByName("/dev/usb/oh1/57e/305"); + auto device = IOS::HLE::GetDeviceByName("/dev/usb/oh1/57e/305"); if (device != nullptr) - std::static_pointer_cast(device) + std::static_pointer_cast(device) ->TriggerSyncButtonPressedEvent(); } @@ -541,9 +541,9 @@ void ControllerConfigDiag::OnPassthroughResetButton(wxCommandEvent& event) _("Reset Wii Remote pairings"), wxICON_WARNING); return; } - auto device = WII_IPC_HLE_Interface::GetDeviceByName("/dev/usb/oh1/57e/305"); + auto device = IOS::HLE::GetDeviceByName("/dev/usb/oh1/57e/305"); if (device != nullptr) - std::static_pointer_cast(device) + std::static_pointer_cast(device) ->TriggerSyncButtonHeldEvent(); } diff --git a/Source/Core/DolphinWX/Frame.cpp b/Source/Core/DolphinWX/Frame.cpp index 8b688f7e90..cd334b54d2 100644 --- a/Source/Core/DolphinWX/Frame.cpp +++ b/Source/Core/DolphinWX/Frame.cpp @@ -1277,9 +1277,9 @@ void CFrame::ParseHotkeys() if (SConfig::GetInstance().m_bt_passthrough_enabled) { - auto device = WII_IPC_HLE_Interface::GetDeviceByName("/dev/usb/oh1/57e/305"); + auto device = IOS::HLE::GetDeviceByName("/dev/usb/oh1/57e/305"); if (device != nullptr) - std::static_pointer_cast(device) + std::static_pointer_cast(device) ->UpdateSyncButtonState(IsHotkey(HK_TRIGGER_SYNC_BUTTON, true)); } diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp index 9e1b12e358..243f217690 100644 --- a/Source/Core/DolphinWX/FrameTools.cpp +++ b/Source/Core/DolphinWX/FrameTools.cpp @@ -860,9 +860,13 @@ void CFrame::DoStop() bool CFrame::TriggerSTMPowerEvent() { - const auto stm = WII_IPC_HLE_Interface::GetDeviceByName("/dev/stm/eventhook"); - if (!stm || !std::static_pointer_cast(stm)->HasHookInstalled()) + const auto stm = IOS::HLE::GetDeviceByName("/dev/stm/eventhook"); + if (!stm || + !std::static_pointer_cast(stm) + ->HasHookInstalled()) + { return false; + } Core::DisplayMessage("Shutting down", 30000); // Unpause because gracefully shutting down needs the game to actually request a shutdown @@ -1245,7 +1249,7 @@ void CFrame::ConnectWiimote(int wm_idx, bool connect) !SConfig::GetInstance().m_bt_passthrough_enabled) { bool was_unpaused = Core::PauseAndLock(true); - GetUsbPointer()->AccessWiiMote(wm_idx | 0x100)->Activate(connect); + IOS::HLE::GetUsbPointer()->AccessWiiMote(wm_idx | 0x100)->Activate(connect); const char* message = connect ? "Wii Remote %i connected" : "Wii Remote %i disconnected"; Core::DisplayMessage(StringFromFormat(message, wm_idx + 1), 3000); Host_UpdateMainFrame(); @@ -1259,7 +1263,7 @@ void CFrame::OnConnectWiimote(wxCommandEvent& event) return; bool was_unpaused = Core::PauseAndLock(true); ConnectWiimote(event.GetId() - IDM_CONNECT_WIIMOTE1, - !GetUsbPointer() + !IOS::HLE::GetUsbPointer() ->AccessWiiMote((event.GetId() - IDM_CONNECT_WIIMOTE1) | 0x100) ->IsConnected()); Core::PauseAndLock(false, was_unpaused); @@ -1428,19 +1432,19 @@ void CFrame::UpdateGUI() bool was_unpaused = Core::PauseAndLock(true); GetMenuBar() ->FindItem(IDM_CONNECT_WIIMOTE1) - ->Check(GetUsbPointer()->AccessWiiMote(0x0100)->IsConnected()); + ->Check(IOS::HLE::GetUsbPointer()->AccessWiiMote(0x0100)->IsConnected()); GetMenuBar() ->FindItem(IDM_CONNECT_WIIMOTE2) - ->Check(GetUsbPointer()->AccessWiiMote(0x0101)->IsConnected()); + ->Check(IOS::HLE::GetUsbPointer()->AccessWiiMote(0x0101)->IsConnected()); GetMenuBar() ->FindItem(IDM_CONNECT_WIIMOTE3) - ->Check(GetUsbPointer()->AccessWiiMote(0x0102)->IsConnected()); + ->Check(IOS::HLE::GetUsbPointer()->AccessWiiMote(0x0102)->IsConnected()); GetMenuBar() ->FindItem(IDM_CONNECT_WIIMOTE4) - ->Check(GetUsbPointer()->AccessWiiMote(0x0103)->IsConnected()); + ->Check(IOS::HLE::GetUsbPointer()->AccessWiiMote(0x0103)->IsConnected()); GetMenuBar() ->FindItem(IDM_CONNECT_BALANCEBOARD) - ->Check(GetUsbPointer()->AccessWiiMote(0x0104)->IsConnected()); + ->Check(IOS::HLE::GetUsbPointer()->AccessWiiMote(0x0104)->IsConnected()); Core::PauseAndLock(false, was_unpaused); } diff --git a/Source/Core/DolphinWX/MainNoGUI.cpp b/Source/Core/DolphinWX/MainNoGUI.cpp index fee6e316c1..e60b246605 100644 --- a/Source/Core/DolphinWX/MainNoGUI.cpp +++ b/Source/Core/DolphinWX/MainNoGUI.cpp @@ -143,7 +143,7 @@ void Host_ConnectWiimote(int wm_idx, bool connect) { Core::QueueHostJob([=] { bool was_unpaused = Core::PauseAndLock(true); - GetUsbPointer()->AccessWiiMote(wm_idx | 0x100)->Activate(connect); + IOS::HLE::GetUsbPointer()->AccessWiiMote(wm_idx | 0x100)->Activate(connect); Host_UpdateMainFrame(); Core::PauseAndLock(false, was_unpaused); }); @@ -237,9 +237,10 @@ class PlatformX11 : public Platform { if (s_shutdown_requested.TestAndClear()) { - const auto& stm = WII_IPC_HLE_Interface::GetDeviceByName("/dev/stm/eventhook"); + const auto stm = IOS::HLE::GetDeviceByName("/dev/stm/eventhook"); if (!s_tried_graceful_shutdown.IsSet() && stm && - std::static_pointer_cast(stm)->HasHookInstalled()) + std::static_pointer_cast(stm) + ->HasHookInstalled()) { ProcessorInterface::PowerButton_Tap(); s_tried_graceful_shutdown.Set();