diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp index ee3d635097..d17a374bc5 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp @@ -93,6 +93,7 @@ void Init() g_DeviceMap[i] = new CWII_IPC_HLE_Device_net_ip_top(i, std::string("/dev/net/ip/top")); i++; g_DeviceMap[i] = new CWII_IPC_HLE_Device_usb_kbd(i, std::string("/dev/usb/kbd")); i++; g_DeviceMap[i] = new CWII_IPC_HLE_Device_sdio_slot0(i, std::string("/dev/sdio/slot0")); i++; + g_DeviceMap[i] = new CWII_IPC_HLE_Device_stub(i, std::string("/dev/usb/hid")); i++; g_DeviceMap[i] = new IWII_IPC_HLE_Device(i, std::string("_Unimplemented_Device_")); g_LastDeviceID = IPC_FIRST_FILEIO_ID; diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device.h b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device.h index c41c64fb12..7dd451be97 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device.h +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device.h @@ -217,4 +217,40 @@ protected: } }; +class CWII_IPC_HLE_Device_stub : public IWII_IPC_HLE_Device +{ +public: + CWII_IPC_HLE_Device_stub(u32 DeviceID, const std::string& Name) + : IWII_IPC_HLE_Device(DeviceID, Name) + {} + + bool Open(u32 CommandAddress, u32 Mode) { + (void)Mode; + WARN_LOG(WII_IPC_HLE, "%s faking Open()", m_Name.c_str()); + Memory::Write_U32(GetDeviceID(), CommandAddress + 4); + m_Active = true; + return true; + } + bool Close(u32 CommandAddress, bool bForce = false) { + WARN_LOG(WII_IPC_HLE, "%s faking Close()", m_Name.c_str()); + if (!bForce) + Memory::Write_U32(FS_SUCCESS, CommandAddress + 4); + m_Active = false; + return true; + } + + bool IOCtl(u32 CommandAddress) + { + WARN_LOG(WII_IPC_HLE, "%s faking IOCtl()", m_Name.c_str()); + Memory::Write_U32(FS_SUCCESS, CommandAddress + 4); + return true; + } + bool IOCtlV(u32 CommandAddress) + { + WARN_LOG(WII_IPC_HLE, "%s faking IOCtlV()", m_Name.c_str()); + Memory::Write_U32(FS_SUCCESS, CommandAddress + 4); + return true; + } +}; + #endif