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
This commit is contained in:
Shawn Hoffman 2010-09-03 17:03:06 +00:00
parent c92ae1c915
commit 9935fe2546
2 changed files with 37 additions and 0 deletions

View File

@ -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_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_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_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_DeviceMap[i] = new IWII_IPC_HLE_Device(i, std::string("_Unimplemented_Device_"));
g_LastDeviceID = IPC_FIRST_FILEIO_ID; g_LastDeviceID = IPC_FIRST_FILEIO_ID;

View File

@ -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 #endif