summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorShawn Hoffman <godisgovernment@gmail.com>2010-09-03 17:03:06 +0000
committerShawn Hoffman <godisgovernment@gmail.com>2010-09-03 17:03:06 +0000
commit9935fe254662b8fc3c9449e2db29fbf4fa33a851 (patch)
tree9ad67e4906214b5d5af496e0e23279f6e74b14c1 /Source/Core
parentc92ae1c9158d62019a47a65e9e58e8645a0ecf59 (diff)
Create a stub device for ios hle, and use it for /dev/usb/hid. "Fixes" monster hunter tri, which was broken by r6164
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6170 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp1
-rw-r--r--Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device.h36
2 files changed, 37 insertions, 0 deletions
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