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 5fe313991f..bb6cf3bd58 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp @@ -175,6 +175,10 @@ IWII_IPC_HLE_Device* CreateDevice(u32 _DeviceID, const std::string& _rDeviceName else if (_rDeviceName.find("/dev/usb/oh1/57e/305") != std::string::npos) { pDevice = new CWII_IPC_HLE_Device_usb_oh1_57e_305(_DeviceID, _rDeviceName); + } + else if (_rDeviceName.find("/dev/usb/oh0") != std::string::npos) + { + pDevice = new CWII_IPC_HLE_Device_usb_oh0(_DeviceID, _rDeviceName); } else if (_rDeviceName.find("/dev/sdio/slot0") != std::string::npos) { diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp index dba7cd9a87..3422f21f7d 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp @@ -1886,3 +1886,45 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::LOG_LinkKey(const u8* _pLinkKey) , _pLinkKey[8], _pLinkKey[9], _pLinkKey[10], _pLinkKey[11], _pLinkKey[12], _pLinkKey[13], _pLinkKey[14], _pLinkKey[15]); } + +CWII_IPC_HLE_Device_usb_oh0::CWII_IPC_HLE_Device_usb_oh0(u32 _DeviceID, const std::string& _rDeviceName) + : IWII_IPC_HLE_Device(_DeviceID, _rDeviceName) +{ +} + +CWII_IPC_HLE_Device_usb_oh0::~CWII_IPC_HLE_Device_usb_oh0() +{} +/////////////////////////// + + +// =================================================== +/* Open */ +// ---------------- +bool CWII_IPC_HLE_Device_usb_oh0::Open(u32 _CommandAddress, u32 _Mode) +{ + Memory::Write_U32(GetDeviceID(), _CommandAddress+4); + return true; +} + + +// =================================================== +/* IOCtl */ +// ---------------- +bool CWII_IPC_HLE_Device_usb_oh0::IOCtl(u32 _CommandAddress) +{ + return IOCtlV(_CommandAddress); //hack +} + + +// =================================================== +/* IOCtlV */ +// ---------------- +bool CWII_IPC_HLE_Device_usb_oh0::IOCtlV(u32 _CommandAddress) +{ + // write return value + Memory::Write_U32(0, _CommandAddress + 0x4); + + return true; +} +// ================ + diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.h b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.h index 88554684d0..822e868905 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.h +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.h @@ -216,5 +216,20 @@ private: void LOG_LinkKey(const u8* _pLinkKey); }; -#endif +class CWII_IPC_HLE_Device_usb_oh0 : public IWII_IPC_HLE_Device +{ +public: + + CWII_IPC_HLE_Device_usb_oh0(u32 _DeviceID, const std::string& _rDeviceName); + + virtual ~CWII_IPC_HLE_Device_usb_oh0(); + + virtual bool Open(u32 _CommandAddress, u32 _Mode); + + virtual bool IOCtlV(u32 _CommandAddress); + virtual bool IOCtl(u32 _CommandAddress); + +// virtual u32 Update(); +#endif +};