IOS HLE: Remove copy and pasted Open()/Close()

This removes Open() and Close() functions from devices whenever they
did nothing more than the base class (setting m_Active, returning a
default reply).

Also, since IOS close commands practically always return FS_SUCCESS,
writing the return code is moved to HandleCommand() in WII_IPC_HLE,
which has two benefits: it's not duplicated all over the place
(so people will not forget it) and it gets rid of having to check
the force parameter, since HandleCommand() is always called for
real IOS commands, so command_address is guaranteed to be valid.
This commit is contained in:
Léo Lam 2016-12-03 23:55:56 +01:00
parent 27e6363214
commit 3c50c61606
23 changed files with 8 additions and 225 deletions

View File

@ -426,6 +426,8 @@ static IPCCommandResult HandleCommand(const u32 address)
{ {
case IPC_CMD_CLOSE: case IPC_CMD_CLOSE:
s_fdmap[fd].reset(); s_fdmap[fd].reset();
// A close on a valid device returns FS_SUCCESS.
Memory::Write_U32(FS_SUCCESS, address + 4);
return device->Close(address); return device->Close(address);
case IPC_CMD_READ: case IPC_CMD_READ:
return device->Read(address); return device->Read(address);

View File

@ -68,17 +68,12 @@ void IWII_IPC_HLE_Device::DoStateShared(PointerWrap& p)
IPCCommandResult IWII_IPC_HLE_Device::Open(u32 command_address, u32 mode) 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; m_Active = true;
return GetDefaultReply(); return GetDefaultReply();
} }
IPCCommandResult IWII_IPC_HLE_Device::Close(u32 command_address, bool force) 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; m_Active = false;
return GetDefaultReply(); return GetDefaultReply();
} }

View File

@ -32,20 +32,6 @@ void CWII_IPC_HLE_Device_di::DoState(PointerWrap& p)
p.Do(m_commands_to_execute); p.Do(m_commands_to_execute);
} }
IPCCommandResult CWII_IPC_HLE_Device_di::Open(u32 _CommandAddress, u32 _Mode)
{
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) IPCCommandResult CWII_IPC_HLE_Device_di::IOCtl(u32 _CommandAddress)
{ {
// DI IOCtls are handled in a special way by Dolphin // DI IOCtls are handled in a special way by Dolphin

View File

@ -27,9 +27,6 @@ public:
void DoState(PointerWrap& p) override; 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 IOCtl(u32 _CommandAddress) override;
IPCCommandResult IOCtlV(u32 _CommandAddress) override; IPCCommandResult IOCtlV(u32 _CommandAddress) override;

View File

@ -84,17 +84,13 @@ IPCCommandResult CWII_IPC_HLE_Device_FileIO::Close(u32 _CommandAddress, bool _bF
// accessing it. // accessing it.
m_file.reset(); m_file.reset();
// Close always return 0 for success
if (_CommandAddress && !_bForce)
Memory::Write_U32(0, _CommandAddress + 4);
m_Active = false; m_Active = false;
return GetDefaultReply(); 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; m_Mode = mode;
u32 ReturnValue = 0;
static const char* const Modes[] = {"Unk Mode", "Read only", "Write only", "Read and Write"}; 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 // It should be created by ISFS_CreateFile, not here
if (File::Exists(m_filepath) && !File::IsDirectory(m_filepath)) 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(); OpenFile();
ReturnValue = m_DeviceID;
} }
else 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()); 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; m_Active = true;
return GetDefaultReply(); return GetDefaultReply();
} }

View File

@ -198,8 +198,6 @@ IPCCommandResult CWII_IPC_HLE_Device_es::Close(u32 _CommandAddress, bool _bForce
m_AccessIdentID = 0x6000000; m_AccessIdentID = 0x6000000;
INFO_LOG(WII_IPC_ES, "ES: Close"); INFO_LOG(WII_IPC_ES, "ES: Close");
if (!_bForce)
Memory::Write_U32(0, _CommandAddress + 4);
m_Active = false; m_Active = false;
// clear the NAND content cache to make sure nothing remains open. // clear the NAND content cache to make sure nothing remains open.
DiscIO::CNANDContentManager::Access().ClearCache(); DiscIO::CNANDContentManager::Access().ClearCache();

View File

@ -56,15 +56,6 @@ IPCCommandResult CWII_IPC_HLE_Device_fs::Open(u32 _CommandAddress, u32 _Mode)
return GetFSReply(); 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) // Get total filesize of contents of a directory (recursive)
// Only used for ES_GetUsage atm, could be useful elsewhere? // Only used for ES_GetUsage atm, could be useful elsewhere?
static u64 ComputeTotalFileSize(const File::FSTEntry& parentEntry) static u64 ComputeTotalFileSize(const File::FSTEntry& parentEntry)

View File

@ -44,7 +44,6 @@ public:
void DoState(PointerWrap& p) override; void DoState(PointerWrap& p) override;
IPCCommandResult Open(u32 _CommandAddress, u32 _Mode) override; IPCCommandResult Open(u32 _CommandAddress, u32 _Mode) override;
IPCCommandResult Close(u32 _CommandAddress, bool _bForce) override;
IPCCommandResult IOCtl(u32 _CommandAddress) override; IPCCommandResult IOCtl(u32 _CommandAddress) override;
IPCCommandResult IOCtlV(u32 _CommandAddress) override; IPCCommandResult IOCtlV(u32 _CommandAddress) override;

View File

@ -104,22 +104,6 @@ CWII_IPC_HLE_Device_hid::~CWII_IPC_HLE_Device_hid()
libusb_exit(nullptr); libusb_exit(nullptr);
} }
IPCCommandResult CWII_IPC_HLE_Device_hid::Open(u32 _CommandAddress, u32 _Mode)
{
INFO_LOG(WII_IPC_HID, "HID::Open");
m_Active = true;
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) IPCCommandResult CWII_IPC_HLE_Device_hid::IOCtl(u32 _CommandAddress)
{ {
if (Core::g_want_determinism) if (Core::g_want_determinism)

View File

@ -40,9 +40,6 @@ public:
virtual ~CWII_IPC_HLE_Device_hid(); 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 IOCtlV(u32 _CommandAddress) override;
IPCCommandResult IOCtl(u32 _CommandAddress) override; IPCCommandResult IOCtl(u32 _CommandAddress) override;

View File

@ -72,22 +72,6 @@ CWII_IPC_HLE_Device_net_kd_request::~CWII_IPC_HLE_Device_net_kd_request()
WiiSockMan::GetInstance().Clean(); 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");
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) IPCCommandResult CWII_IPC_HLE_Device_net_kd_request::IOCtl(u32 _CommandAddress)
{ {
u32 Parameter = Memory::Read_U32(_CommandAddress + 0xC); u32 Parameter = Memory::Read_U32(_CommandAddress + 0xC);
@ -353,22 +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");
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) IPCCommandResult CWII_IPC_HLE_Device_net_ncd_manage::IOCtlV(u32 _CommandAddress)
{ {
u32 return_value = 0; u32 return_value = 0;
@ -451,22 +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");
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. // This is just for debugging / playing around.
// There really is no reason to implement wd unless we can bend it such that // There really is no reason to implement wd unless we can bend it such that
// we can talk to the DS. // we can talk to the DS.
@ -579,22 +531,6 @@ CWII_IPC_HLE_Device_net_ip_top::~CWII_IPC_HLE_Device_net_ip_top()
#endif #endif
} }
IPCCommandResult CWII_IPC_HLE_Device_net_ip_top::Open(u32 _CommandAddress, u32 _Mode)
{
INFO_LOG(WII_IPC_NET, "NET_IP_TOP: Open");
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) static int inet_pton(const char* src, unsigned char* dst)
{ {
int saw_digit, octets; int saw_digit, octets;

View File

@ -30,8 +30,6 @@ public:
virtual ~CWII_IPC_HLE_Device_net_kd_request(); 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; IPCCommandResult IOCtl(u32 _CommandAddress) override;
private: private:
@ -88,20 +86,6 @@ public:
} }
virtual ~CWII_IPC_HLE_Device_net_kd_time() {} virtual ~CWII_IPC_HLE_Device_net_kd_time() {}
IPCCommandResult Open(u32 _CommandAddress, u32 _Mode) override
{
INFO_LOG(WII_IPC_NET, "NET_KD_TIME: Open");
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 IPCCommandResult IOCtl(u32 _CommandAddress) override
{ {
u32 Parameter = Memory::Read_U32(_CommandAddress + 0x0C); u32 Parameter = Memory::Read_U32(_CommandAddress + 0x0C);
@ -223,8 +207,6 @@ public:
virtual ~CWII_IPC_HLE_Device_net_ip_top(); 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 IOCtl(u32 _CommandAddress) override;
IPCCommandResult IOCtlV(u32 _CommandAddress) override; IPCCommandResult IOCtlV(u32 _CommandAddress) override;
@ -245,8 +227,6 @@ public:
virtual ~CWII_IPC_HLE_Device_net_ncd_manage(); 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; IPCCommandResult IOCtlV(u32 _CommandAddress) override;
private: private:
@ -273,8 +253,6 @@ public:
virtual ~CWII_IPC_HLE_Device_net_wd_command(); 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; IPCCommandResult IOCtlV(u32 CommandAddress) override;
private: private:

View File

@ -75,22 +75,6 @@ int CWII_IPC_HLE_Device_net_ssl::GetSSLFreeID() const
return 0; return 0;
} }
IPCCommandResult CWII_IPC_HLE_Device_net_ssl::Open(u32 _CommandAddress, u32 _Mode)
{
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) IPCCommandResult CWII_IPC_HLE_Device_net_ssl::IOCtl(u32 _CommandAddress)
{ {
u32 BufferIn = Memory::Read_U32(_CommandAddress + 0x10); u32 BufferIn = Memory::Read_U32(_CommandAddress + 0x10);

View File

@ -87,9 +87,6 @@ public:
virtual ~CWII_IPC_HLE_Device_net_ssl(); 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 IOCtl(u32 _CommandAddress) override;
IPCCommandResult IOCtlV(u32 _CommandAddress) override; IPCCommandResult IOCtlV(u32 _CommandAddress) override;

View File

@ -89,8 +89,6 @@ IPCCommandResult CWII_IPC_HLE_Device_sdio_slot0::Close(u32 _CommandAddress, bool
m_BlockLength = 0; m_BlockLength = 0;
m_BusWidth = 0; m_BusWidth = 0;
if (!_bForce)
Memory::Write_U32(0, _CommandAddress + 0x4);
m_Active = false; m_Active = false;
return GetDefaultReply(); return GetDefaultReply();
} }

View File

@ -18,22 +18,6 @@ void Stop();
static u32 s_event_hook_address = 0; 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");
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) IPCCommandResult CWII_IPC_HLE_Device_stm_immediate::IOCtl(u32 command_address)
{ {
u32 parameter = Memory::Read_U32(command_address + 0x0C); u32 parameter = Memory::Read_U32(command_address + 0x0C);
@ -104,19 +88,10 @@ IPCCommandResult CWII_IPC_HLE_Device_stm_immediate::IOCtl(u32 command_address)
return GetDefaultReply(); return GetDefaultReply();
} }
IPCCommandResult CWII_IPC_HLE_Device_stm_eventhook::Open(u32 command_address, u32 mode)
{
m_Active = true;
return GetDefaultReply();
}
IPCCommandResult CWII_IPC_HLE_Device_stm_eventhook::Close(u32 command_address, bool force) IPCCommandResult CWII_IPC_HLE_Device_stm_eventhook::Close(u32 command_address, bool force)
{ {
s_event_hook_address = 0; 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; m_Active = false;
return GetDefaultReply(); return GetDefaultReply();
} }

View File

@ -44,8 +44,6 @@ public:
} }
~CWII_IPC_HLE_Device_stm_immediate() override = default; ~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; IPCCommandResult IOCtl(u32 command_address) override;
}; };
@ -59,7 +57,6 @@ public:
} }
~CWII_IPC_HLE_Device_stm_eventhook() override = default; ~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 Close(u32 command_address, bool force) override;
IPCCommandResult IOCtl(u32 command_address) override; IPCCommandResult IOCtl(u32 command_address) override;

View File

@ -21,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) IPCCommandResult CWII_IPC_HLE_Device_stub::Close(u32 command_address, bool force)
{ {
WARN_LOG(WII_IPC_HLE, "%s faking Close()", m_Name.c_str()); 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; m_Active = false;
return GetDefaultReply(); return GetDefaultReply();
} }

View File

@ -168,8 +168,6 @@ IPCCommandResult CWII_IPC_HLE_Device_usb_oh1_57e_305_emu::Close(u32 _CommandAddr
m_HCIEndpoint.m_cmd_address = 0; m_HCIEndpoint.m_cmd_address = 0;
m_ACLEndpoint.m_cmd_address = 0; m_ACLEndpoint.m_cmd_address = 0;
if (!_bForce)
Memory::Write_U32(0, _CommandAddress + 4);
m_Active = false; m_Active = false;
return GetDefaultReply(); return GetDefaultReply();
} }

View File

@ -153,7 +153,6 @@ IPCCommandResult CWII_IPC_HLE_Device_usb_oh1_57e_305_real::Close(u32 command_add
StopTransferThread(); StopTransferThread();
libusb_unref_device(m_device); libusb_unref_device(m_device);
m_handle = nullptr; m_handle = nullptr;
Memory::Write_U32(0, command_address + 4);
} }
m_Active = false; m_Active = false;

View File

@ -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"); INFO_LOG(WII_IPC_HLE, "CWII_IPC_HLE_Device_usb_kbd: Close");
while (!m_MessageQueue.empty()) while (!m_MessageQueue.empty())
m_MessageQueue.pop(); m_MessageQueue.pop();
if (!_bForce)
Memory::Write_U32(0, _CommandAddress + 4);
m_Active = false; m_Active = false;
return GetDefaultReply(); return GetDefaultReply();
} }

View File

@ -16,21 +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)
{
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) IPCCommandResult CWII_IPC_HLE_Device_usb_ven::IOCtlV(u32 command_address)
{ {
SIOCtlVBuffer command_buffer(command_address); SIOCtlVBuffer command_buffer(command_address);

View File

@ -19,9 +19,6 @@ public:
~CWII_IPC_HLE_Device_usb_ven() override; ~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 IOCtlV(u32 command_address) override;
IPCCommandResult IOCtl(u32 command_address) override; IPCCommandResult IOCtl(u32 command_address) override;