diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE.cpp index b011f51d4e..461db5ac73 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE.cpp @@ -426,6 +426,8 @@ static IPCCommandResult HandleCommand(const u32 address) { case IPC_CMD_CLOSE: s_fdmap[fd].reset(); + // A close on a valid device returns FS_SUCCESS. + Memory::Write_U32(FS_SUCCESS, address + 4); return device->Close(address); case IPC_CMD_READ: return device->Read(address); 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 d2a8e11490..6542d47534 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device.cpp @@ -68,17 +68,12 @@ void IWII_IPC_HLE_Device::DoStateShared(PointerWrap& p) IPCCommandResult IWII_IPC_HLE_Device::Open(u32 command_address, u32 mode) { - WARN_LOG(WII_IPC_HLE, "%s does not support Open()", m_Name.c_str()); - Memory::Write_U32(FS_ENOENT, command_address + 4); m_Active = true; return GetDefaultReply(); } IPCCommandResult IWII_IPC_HLE_Device::Close(u32 command_address, bool force) { - WARN_LOG(WII_IPC_HLE, "%s does not support Close()", m_Name.c_str()); - if (!force) - Memory::Write_U32(FS_EINVAL, command_address + 4); m_Active = false; return GetDefaultReply(); } 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 53454c70bf..98673c4905 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 @@ -32,21 +32,6 @@ void CWII_IPC_HLE_Device_di::DoState(PointerWrap& p) p.Do(m_commands_to_execute); } -IPCCommandResult CWII_IPC_HLE_Device_di::Open(u32 _CommandAddress, u32 _Mode) -{ - Memory::Write_U32(GetDeviceID(), _CommandAddress + 4); - m_Active = true; - return GetDefaultReply(); -} - -IPCCommandResult CWII_IPC_HLE_Device_di::Close(u32 _CommandAddress, bool _bForce) -{ - if (!_bForce) - Memory::Write_U32(0, _CommandAddress + 4); - m_Active = false; - return GetDefaultReply(); -} - IPCCommandResult CWII_IPC_HLE_Device_di::IOCtl(u32 _CommandAddress) { // DI IOCtls are handled in a special way by Dolphin 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 0e8ed43485..f7af22998b 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 @@ -27,9 +27,6 @@ public: void DoState(PointerWrap& p) override; - IPCCommandResult Open(u32 _CommandAddress, u32 _Mode) override; - IPCCommandResult Close(u32 _CommandAddress, bool _bForce) override; - IPCCommandResult IOCtl(u32 _CommandAddress) override; IPCCommandResult IOCtlV(u32 _CommandAddress) override; 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 3616bd39d1..3e25865646 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 @@ -84,17 +84,13 @@ IPCCommandResult CWII_IPC_HLE_Device_FileIO::Close(u32 _CommandAddress, bool _bF // accessing it. m_file.reset(); - // Close always return 0 for success - if (_CommandAddress && !_bForce) - Memory::Write_U32(0, _CommandAddress + 4); m_Active = false; return GetDefaultReply(); } -IPCCommandResult CWII_IPC_HLE_Device_FileIO::Open(u32 _CommandAddress, u32 _Mode) +IPCCommandResult CWII_IPC_HLE_Device_FileIO::Open(u32 command_address, u32 mode) { - m_Mode = _Mode; - u32 ReturnValue = 0; + m_Mode = mode; static const char* const Modes[] = {"Unk Mode", "Read only", "Write only", "Read and Write"}; @@ -104,19 +100,17 @@ IPCCommandResult CWII_IPC_HLE_Device_FileIO::Open(u32 _CommandAddress, u32 _Mode // It should be created by ISFS_CreateFile, not here if (File::Exists(m_filepath) && !File::IsDirectory(m_filepath)) { - INFO_LOG(WII_IPC_FILEIO, "FileIO: Open %s (%s == %08X)", m_Name.c_str(), Modes[_Mode], _Mode); + INFO_LOG(WII_IPC_FILEIO, "FileIO: Open %s (%s == %08X)", m_Name.c_str(), Modes[mode], mode); OpenFile(); - ReturnValue = m_DeviceID; } else { - WARN_LOG(WII_IPC_FILEIO, "FileIO: Open (%s) failed - File doesn't exist %s", Modes[_Mode], + WARN_LOG(WII_IPC_FILEIO, "FileIO: Open (%s) failed - File doesn't exist %s", Modes[mode], m_filepath.c_str()); - ReturnValue = FS_FILE_NOT_EXIST; + if (command_address) + Memory::Write_U32(FS_FILE_NOT_EXIST, command_address + 4); } - if (_CommandAddress) - Memory::Write_U32(ReturnValue, _CommandAddress + 4); m_Active = true; return GetDefaultReply(); } 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 2c514aecd8..3621928537 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 @@ -184,7 +184,6 @@ IPCCommandResult CWII_IPC_HLE_Device_es::Open(u32 _CommandAddress, u32 _Mode) { OpenInternal(); - Memory::Write_U32(GetDeviceID(), _CommandAddress + 4); if (m_Active) INFO_LOG(WII_IPC_ES, "Device was re-opened."); m_Active = true; @@ -199,8 +198,6 @@ IPCCommandResult CWII_IPC_HLE_Device_es::Close(u32 _CommandAddress, bool _bForce m_AccessIdentID = 0x6000000; INFO_LOG(WII_IPC_ES, "ES: Close"); - if (!_bForce) - Memory::Write_U32(0, _CommandAddress + 4); m_Active = false; // clear the NAND content cache to make sure nothing remains open. DiscIO::CNANDContentManager::Access().ClearCache(); 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 102912c307..b8e2ec9c49 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 @@ -52,20 +52,10 @@ IPCCommandResult CWII_IPC_HLE_Device_fs::Open(u32 _CommandAddress, u32 _Mode) File::CreateDir(Path); } - Memory::Write_U32(GetDeviceID(), _CommandAddress + 4); m_Active = true; return GetFSReply(); } -IPCCommandResult CWII_IPC_HLE_Device_fs::Close(u32 _CommandAddress, bool _bForce) -{ - INFO_LOG(WII_IPC_FILEIO, "Close"); - if (!_bForce) - Memory::Write_U32(0, _CommandAddress + 4); - m_Active = false; - return GetFSReply(); -} - // Get total filesize of contents of a directory (recursive) // Only used for ES_GetUsage atm, could be useful elsewhere? static u64 ComputeTotalFileSize(const File::FSTEntry& parentEntry) 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 4d4933d164..b943f205dc 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 @@ -44,7 +44,6 @@ public: void DoState(PointerWrap& p) override; IPCCommandResult Open(u32 _CommandAddress, u32 _Mode) override; - IPCCommandResult Close(u32 _CommandAddress, bool _bForce) override; IPCCommandResult IOCtl(u32 _CommandAddress) override; IPCCommandResult IOCtlV(u32 _CommandAddress) override; 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 efe3a60660..bdd3219768 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 @@ -10,6 +10,7 @@ #include +#include "Common/Align.h" #include "Common/CommonFuncs.h" #include "Common/Logging/Log.h" #include "Core/Core.h" @@ -104,23 +105,6 @@ CWII_IPC_HLE_Device_hid::~CWII_IPC_HLE_Device_hid() libusb_exit(nullptr); } -IPCCommandResult CWII_IPC_HLE_Device_hid::Open(u32 _CommandAddress, u32 _Mode) -{ - INFO_LOG(WII_IPC_HID, "HID::Open"); - m_Active = true; - Memory::Write_U32(GetDeviceID(), _CommandAddress + 4); - return GetDefaultReply(); -} - -IPCCommandResult CWII_IPC_HLE_Device_hid::Close(u32 _CommandAddress, bool _bForce) -{ - INFO_LOG(WII_IPC_HID, "HID::Close"); - m_Active = false; - if (!_bForce) - Memory::Write_U32(0, _CommandAddress + 4); - return GetDefaultReply(); -} - IPCCommandResult CWII_IPC_HLE_Device_hid::IOCtl(u32 _CommandAddress) { if (Core::g_want_determinism) @@ -390,8 +374,8 @@ void CWII_IPC_HLE_Device_hid::FillOutDevices(u32 BufferOut, u32 BufferOutSize) WiiHIDDeviceDescriptor wii_device; ConvertDeviceToWii(&wii_device, &desc); - Memory::CopyToEmu(OffsetBuffer, &wii_device, Align(wii_device.bLength, 4)); - OffsetBuffer += Align(wii_device.bLength, 4); + Memory::CopyToEmu(OffsetBuffer, &wii_device, wii_device.bLength); + OffsetBuffer += Common::AlignUp(wii_device.bLength, 4); bool deviceValid = true; bool isHID = false; @@ -404,8 +388,8 @@ void CWII_IPC_HLE_Device_hid::FillOutDevices(u32 BufferOut, u32 BufferOutSize) { WiiHIDConfigDescriptor wii_config; ConvertConfigToWii(&wii_config, config); - Memory::CopyToEmu(OffsetBuffer, &wii_config, Align(wii_config.bLength, 4)); - OffsetBuffer += Align(wii_config.bLength, 4); + Memory::CopyToEmu(OffsetBuffer, &wii_config, wii_config.bLength); + OffsetBuffer += Common::AlignUp(wii_config.bLength, 4); for (ic = 0; ic < config->bNumInterfaces; ic++) { @@ -421,8 +405,8 @@ void CWII_IPC_HLE_Device_hid::FillOutDevices(u32 BufferOut, u32 BufferOutSize) WiiHIDInterfaceDescriptor wii_interface; ConvertInterfaceToWii(&wii_interface, interface); - Memory::CopyToEmu(OffsetBuffer, &wii_interface, Align(wii_interface.bLength, 4)); - OffsetBuffer += Align(wii_interface.bLength, 4); + Memory::CopyToEmu(OffsetBuffer, &wii_interface, wii_interface.bLength); + OffsetBuffer += Common::AlignUp(wii_interface.bLength, 4); for (e = 0; e < interface->bNumEndpoints; e++) { @@ -430,8 +414,8 @@ void CWII_IPC_HLE_Device_hid::FillOutDevices(u32 BufferOut, u32 BufferOutSize) WiiHIDEndpointDescriptor wii_endpoint; ConvertEndpointToWii(&wii_endpoint, endpoint); - Memory::CopyToEmu(OffsetBuffer, &wii_endpoint, Align(wii_endpoint.bLength, 4)); - OffsetBuffer += Align(wii_endpoint.bLength, 4); + Memory::CopyToEmu(OffsetBuffer, &wii_endpoint, wii_endpoint.bLength); + OffsetBuffer += Common::AlignUp(wii_endpoint.bLength, 4); } // endpoints } // interfaces @@ -500,11 +484,6 @@ void CWII_IPC_HLE_Device_hid::FillOutDevices(u32 BufferOut, u32 BufferOutSize) Memory::Write_U32(0xFFFFFFFF, OffsetBuffer); // no more devices } -int CWII_IPC_HLE_Device_hid::Align(int num, int alignment) -{ - return (num + (alignment - 1)) & ~(alignment - 1); -} - libusb_device_handle* CWII_IPC_HLE_Device_hid::GetDeviceByDevNum(u32 devNum) { libusb_device** list; 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 9ff0feda28..c4fa695c70 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 @@ -40,9 +40,6 @@ public: virtual ~CWII_IPC_HLE_Device_hid(); - IPCCommandResult Open(u32 _CommandAddress, u32 _Mode) override; - IPCCommandResult Close(u32 _CommandAddress, bool _bForce) override; - IPCCommandResult IOCtlV(u32 _CommandAddress) override; IPCCommandResult IOCtl(u32 _CommandAddress) override; @@ -130,7 +127,6 @@ private: const libusb_interface_descriptor* src); void ConvertEndpointToWii(WiiHIDEndpointDescriptor* dest, const libusb_endpoint_descriptor* src); - int Align(int num, int alignment); static void checkUsbUpdates(CWII_IPC_HLE_Device_hid* hid); static void LIBUSB_CALL handleUsbUpdates(libusb_transfer* transfer); 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 efdef61030..d708d64c1b 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 @@ -72,23 +72,6 @@ CWII_IPC_HLE_Device_net_kd_request::~CWII_IPC_HLE_Device_net_kd_request() WiiSockMan::GetInstance().Clean(); } -IPCCommandResult CWII_IPC_HLE_Device_net_kd_request::Open(u32 _CommandAddress, u32 _Mode) -{ - INFO_LOG(WII_IPC_WC24, "NET_KD_REQ: Open"); - Memory::Write_U32(GetDeviceID(), _CommandAddress + 4); - m_Active = true; - return GetDefaultReply(); -} - -IPCCommandResult CWII_IPC_HLE_Device_net_kd_request::Close(u32 _CommandAddress, bool _bForce) -{ - INFO_LOG(WII_IPC_WC24, "NET_KD_REQ: Close"); - if (!_bForce) - Memory::Write_U32(0, _CommandAddress + 4); - m_Active = false; - return GetDefaultReply(); -} - IPCCommandResult CWII_IPC_HLE_Device_net_kd_request::IOCtl(u32 _CommandAddress) { u32 Parameter = Memory::Read_U32(_CommandAddress + 0xC); @@ -354,23 +337,6 @@ CWII_IPC_HLE_Device_net_ncd_manage::~CWII_IPC_HLE_Device_net_ncd_manage() { } -IPCCommandResult CWII_IPC_HLE_Device_net_ncd_manage::Open(u32 _CommandAddress, u32 _Mode) -{ - INFO_LOG(WII_IPC_NET, "NET_NCD_MANAGE: Open"); - Memory::Write_U32(GetDeviceID(), _CommandAddress + 4); - m_Active = true; - return GetDefaultReply(); -} - -IPCCommandResult CWII_IPC_HLE_Device_net_ncd_manage::Close(u32 _CommandAddress, bool _bForce) -{ - INFO_LOG(WII_IPC_NET, "NET_NCD_MANAGE: Close"); - if (!_bForce) - Memory::Write_U32(0, _CommandAddress + 4); - m_Active = false; - return GetDefaultReply(); -} - IPCCommandResult CWII_IPC_HLE_Device_net_ncd_manage::IOCtlV(u32 _CommandAddress) { u32 return_value = 0; @@ -453,23 +419,6 @@ CWII_IPC_HLE_Device_net_wd_command::~CWII_IPC_HLE_Device_net_wd_command() { } -IPCCommandResult CWII_IPC_HLE_Device_net_wd_command::Open(u32 CommandAddress, u32 Mode) -{ - INFO_LOG(WII_IPC_NET, "NET_WD_COMMAND: Open"); - Memory::Write_U32(GetDeviceID(), CommandAddress + 4); - m_Active = true; - return GetDefaultReply(); -} - -IPCCommandResult CWII_IPC_HLE_Device_net_wd_command::Close(u32 CommandAddress, bool Force) -{ - INFO_LOG(WII_IPC_NET, "NET_WD_COMMAND: Close"); - if (!Force) - Memory::Write_U32(0, CommandAddress + 4); - m_Active = false; - return GetDefaultReply(); -} - // This is just for debugging / playing around. // There really is no reason to implement wd unless we can bend it such that // we can talk to the DS. @@ -582,23 +531,6 @@ CWII_IPC_HLE_Device_net_ip_top::~CWII_IPC_HLE_Device_net_ip_top() #endif } -IPCCommandResult CWII_IPC_HLE_Device_net_ip_top::Open(u32 _CommandAddress, u32 _Mode) -{ - INFO_LOG(WII_IPC_NET, "NET_IP_TOP: Open"); - Memory::Write_U32(GetDeviceID(), _CommandAddress + 4); - m_Active = true; - return GetDefaultReply(); -} - -IPCCommandResult CWII_IPC_HLE_Device_net_ip_top::Close(u32 _CommandAddress, bool _bForce) -{ - INFO_LOG(WII_IPC_NET, "NET_IP_TOP: Close"); - if (!_bForce) - Memory::Write_U32(0, _CommandAddress + 4); - m_Active = false; - return GetDefaultReply(); -} - static int inet_pton(const char* src, unsigned char* dst) { int saw_digit, octets; 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 ace3d41e9b..1db4319582 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 @@ -30,8 +30,6 @@ public: virtual ~CWII_IPC_HLE_Device_net_kd_request(); - IPCCommandResult Open(u32 _CommandAddress, u32 _Mode) override; - IPCCommandResult Close(u32 _CommandAddress, bool _bForce) override; IPCCommandResult IOCtl(u32 _CommandAddress) override; private: @@ -88,21 +86,6 @@ public: } virtual ~CWII_IPC_HLE_Device_net_kd_time() {} - IPCCommandResult Open(u32 _CommandAddress, u32 _Mode) override - { - INFO_LOG(WII_IPC_NET, "NET_KD_TIME: Open"); - Memory::Write_U32(GetDeviceID(), _CommandAddress + 4); - return GetDefaultReply(); - } - - IPCCommandResult Close(u32 _CommandAddress, bool _bForce) override - { - INFO_LOG(WII_IPC_NET, "NET_KD_TIME: Close"); - if (!_bForce) - Memory::Write_U32(0, _CommandAddress + 4); - return GetDefaultReply(); - } - IPCCommandResult IOCtl(u32 _CommandAddress) override { u32 Parameter = Memory::Read_U32(_CommandAddress + 0x0C); @@ -224,8 +207,6 @@ public: virtual ~CWII_IPC_HLE_Device_net_ip_top(); - IPCCommandResult Open(u32 _CommandAddress, u32 _Mode) override; - IPCCommandResult Close(u32 _CommandAddress, bool _bForce) override; IPCCommandResult IOCtl(u32 _CommandAddress) override; IPCCommandResult IOCtlV(u32 _CommandAddress) override; @@ -246,8 +227,6 @@ public: virtual ~CWII_IPC_HLE_Device_net_ncd_manage(); - IPCCommandResult Open(u32 _CommandAddress, u32 _Mode) override; - IPCCommandResult Close(u32 _CommandAddress, bool _bForce) override; IPCCommandResult IOCtlV(u32 _CommandAddress) override; private: @@ -274,8 +253,6 @@ public: virtual ~CWII_IPC_HLE_Device_net_wd_command(); - IPCCommandResult Open(u32 CommandAddress, u32 Mode) override; - IPCCommandResult Close(u32 CommandAddress, bool Force) override; IPCCommandResult IOCtlV(u32 CommandAddress) override; private: 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 9e093bf4ae..ab77ef1596 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 @@ -75,23 +75,6 @@ int CWII_IPC_HLE_Device_net_ssl::GetSSLFreeID() const return 0; } -IPCCommandResult CWII_IPC_HLE_Device_net_ssl::Open(u32 _CommandAddress, u32 _Mode) -{ - Memory::Write_U32(GetDeviceID(), _CommandAddress + 4); - m_Active = true; - return GetDefaultReply(); -} - -IPCCommandResult CWII_IPC_HLE_Device_net_ssl::Close(u32 _CommandAddress, bool _bForce) -{ - if (!_bForce) - { - Memory::Write_U32(0, _CommandAddress + 4); - } - m_Active = false; - return GetDefaultReply(); -} - IPCCommandResult CWII_IPC_HLE_Device_net_ssl::IOCtl(u32 _CommandAddress) { u32 BufferIn = Memory::Read_U32(_CommandAddress + 0x10); 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 07ae9ce81a..b8ec088776 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 @@ -87,9 +87,6 @@ public: virtual ~CWII_IPC_HLE_Device_net_ssl(); - IPCCommandResult Open(u32 _CommandAddress, u32 _Mode) override; - IPCCommandResult Close(u32 _CommandAddress, bool _bForce) override; - IPCCommandResult IOCtl(u32 _CommandAddress) override; IPCCommandResult IOCtlV(u32 _CommandAddress) override; 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 92dce77723..74e5c45754 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 @@ -76,7 +76,6 @@ IPCCommandResult CWII_IPC_HLE_Device_sdio_slot0::Open(u32 _CommandAddress, u32 _ OpenInternal(); - Memory::Write_U32(GetDeviceID(), _CommandAddress + 0x4); m_registers.fill(0); m_Active = true; return GetDefaultReply(); @@ -90,8 +89,6 @@ IPCCommandResult CWII_IPC_HLE_Device_sdio_slot0::Close(u32 _CommandAddress, bool m_BlockLength = 0; m_BusWidth = 0; - if (!_bForce) - Memory::Write_U32(0, _CommandAddress + 0x4); m_Active = false; return GetDefaultReply(); } 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 d772868154..1b51ac690c 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 @@ -18,23 +18,6 @@ void Stop(); static u32 s_event_hook_address = 0; -IPCCommandResult CWII_IPC_HLE_Device_stm_immediate::Open(u32 command_address, u32 mode) -{ - INFO_LOG(WII_IPC_STM, "STM immediate: Open"); - Memory::Write_U32(GetDeviceID(), command_address + 4); - m_Active = true; - return GetDefaultReply(); -} - -IPCCommandResult CWII_IPC_HLE_Device_stm_immediate::Close(u32 command_address, bool force) -{ - INFO_LOG(WII_IPC_STM, "STM immediate: Close"); - if (!force) - Memory::Write_U32(0, command_address + 4); - m_Active = false; - return GetDefaultReply(); -} - IPCCommandResult CWII_IPC_HLE_Device_stm_immediate::IOCtl(u32 command_address) { u32 parameter = Memory::Read_U32(command_address + 0x0C); @@ -105,20 +88,10 @@ IPCCommandResult CWII_IPC_HLE_Device_stm_immediate::IOCtl(u32 command_address) return GetDefaultReply(); } -IPCCommandResult CWII_IPC_HLE_Device_stm_eventhook::Open(u32 command_address, u32 mode) -{ - Memory::Write_U32(GetDeviceID(), command_address + 4); - m_Active = true; - return GetDefaultReply(); -} - IPCCommandResult CWII_IPC_HLE_Device_stm_eventhook::Close(u32 command_address, bool force) { s_event_hook_address = 0; - INFO_LOG(WII_IPC_STM, "STM eventhook: Close"); - if (!force) - Memory::Write_U32(0, command_address + 4); m_Active = false; return GetDefaultReply(); } 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 85cfe85ce2..879568ea15 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 @@ -44,8 +44,6 @@ public: } ~CWII_IPC_HLE_Device_stm_immediate() override = default; - IPCCommandResult Open(u32 command_address, u32 mode) override; - IPCCommandResult Close(u32 command_address, bool force) override; IPCCommandResult IOCtl(u32 command_address) override; }; @@ -59,7 +57,6 @@ public: } ~CWII_IPC_HLE_Device_stm_eventhook() override = default; - IPCCommandResult Open(u32 command_address, u32 mode) override; IPCCommandResult Close(u32 command_address, bool force) override; IPCCommandResult IOCtl(u32 command_address) override; 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 2782f4a745..9a18f52f3a 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 @@ -14,7 +14,6 @@ CWII_IPC_HLE_Device_stub::CWII_IPC_HLE_Device_stub(u32 device_id, const std::str IPCCommandResult CWII_IPC_HLE_Device_stub::Open(u32 command_address, u32 mode) { WARN_LOG(WII_IPC_HLE, "%s faking Open()", m_Name.c_str()); - Memory::Write_U32(GetDeviceID(), command_address + 4); m_Active = true; return GetDefaultReply(); } @@ -22,8 +21,6 @@ IPCCommandResult CWII_IPC_HLE_Device_stub::Open(u32 command_address, u32 mode) IPCCommandResult CWII_IPC_HLE_Device_stub::Close(u32 command_address, bool force) { WARN_LOG(WII_IPC_HLE, "%s faking Close()", m_Name.c_str()); - if (!force) - Memory::Write_U32(FS_SUCCESS, command_address + 4); m_Active = false; return GetDefaultReply(); } 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 cdf8d3deca..c4f89c1643 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 @@ -154,7 +154,6 @@ IPCCommandResult CWII_IPC_HLE_Device_usb_oh1_57e_305_emu::Open(u32 _CommandAddre m_HCIEndpoint.m_cmd_address = 0; m_ACLEndpoint.m_cmd_address = 0; - Memory::Write_U32(GetDeviceID(), _CommandAddress + 4); m_Active = true; return GetDefaultReply(); } @@ -169,8 +168,6 @@ IPCCommandResult CWII_IPC_HLE_Device_usb_oh1_57e_305_emu::Close(u32 _CommandAddr m_HCIEndpoint.m_cmd_address = 0; m_ACLEndpoint.m_cmd_address = 0; - if (!_bForce) - Memory::Write_U32(0, _CommandAddress + 4); m_Active = false; return GetDefaultReply(); } 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 12e38b9a84..61b8992863 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 @@ -141,7 +141,6 @@ IPCCommandResult CWII_IPC_HLE_Device_usb_oh1_57e_305_real::Open(u32 command_addr StartTransferThread(); - Memory::Write_U32(GetDeviceID(), command_address + 4); m_Active = true; return GetDefaultReply(); } @@ -154,7 +153,6 @@ IPCCommandResult CWII_IPC_HLE_Device_usb_oh1_57e_305_real::Close(u32 command_add StopTransferThread(); libusb_unref_device(m_device); m_handle = nullptr; - Memory::Write_U32(0, command_address + 4); } m_Active = false; 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 0a3df8dab3..0932a7473a 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 @@ -67,8 +67,6 @@ IPCCommandResult CWII_IPC_HLE_Device_usb_kbd::Close(u32 _CommandAddress, bool _b INFO_LOG(WII_IPC_HLE, "CWII_IPC_HLE_Device_usb_kbd: Close"); while (!m_MessageQueue.empty()) m_MessageQueue.pop(); - if (!_bForce) - Memory::Write_U32(0, _CommandAddress + 4); m_Active = false; return GetDefaultReply(); } 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 87f9cecedd..a613e39242 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 @@ -16,22 +16,6 @@ CWII_IPC_HLE_Device_usb_ven::~CWII_IPC_HLE_Device_usb_ven() { } -IPCCommandResult CWII_IPC_HLE_Device_usb_ven::Open(u32 command_address, u32 mode) -{ - Memory::Write_U32(GetDeviceID(), command_address + 4); - m_Active = true; - return GetDefaultReply(); -} - -IPCCommandResult CWII_IPC_HLE_Device_usb_ven::Close(u32 command_address, bool force) -{ - if (!force) - Memory::Write_U32(0, command_address + 4); - - m_Active = false; - return GetDefaultReply(); -} - IPCCommandResult CWII_IPC_HLE_Device_usb_ven::IOCtlV(u32 command_address) { SIOCtlVBuffer command_buffer(command_address); 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 667dcab8be..612400f1e0 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 @@ -19,9 +19,6 @@ public: ~CWII_IPC_HLE_Device_usb_ven() override; - IPCCommandResult Open(u32 command_address, u32 mode) override; - IPCCommandResult Close(u32 command_address, bool force) override; - IPCCommandResult IOCtlV(u32 command_address) override; IPCCommandResult IOCtl(u32 command_address) override;