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 2dad1b089d..648b5e17e6 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp @@ -470,26 +470,18 @@ void Update() void UpdateDevices() { - // This is called frequently so better make this route simple - // currently we only have one device: USB that needs update and its ID is fixed to IPC_FIRST_HARDWARE_ID - // So let's skip the query and call it directly, which will speed up a lot - // - IWII_IPC_HLE_Device* pDevice = g_DeviceMap[IPC_FIRST_HARDWARE_ID]; - if (pDevice->IsOpened()) - pDevice->Update(); - /* // check if a device must be updated TDeviceMap::const_iterator itr = g_DeviceMap.begin(); - while(itr != g_DeviceMap.end()) + while(itr != g_DeviceMap.find(IPC_FIRST_FILEIO_ID)) { - if (itr->second->Update()) + if (itr->second->IsOpened()) { - break; + if (itr->second->Update()) + break; } ++itr; } - */ } diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_sdio_slot0.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_sdio_slot0.cpp index ed11bdc68d..7954d78f7d 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_sdio_slot0.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_sdio_slot0.cpp @@ -76,7 +76,6 @@ bool CWII_IPC_HLE_Device_sdio_slot0::Close(u32 _CommandAddress, bool _bForce) fclose(m_Card); m_Card = NULL; } - m_Status = CARD_INSERTED; m_BlockLength = 0; m_BusWidth = 0; @@ -167,7 +166,7 @@ bool CWII_IPC_HLE_Device_sdio_slot0::IOCtl(u32 _CommandAddress) case IOCTL_GETSTATUS: INFO_LOG(WII_IPC_SD, "IOCTL_GETSTATUS. Replying that SD card is %s%s", - (m_Status & CARD_INSERTED) ? "inserted" : "", + (m_Status & CARD_INSERTED) ? "inserted" : "not exitsting", (m_Status & CARD_INITIALIZED) ? " and initialized" : ""); Memory::Write_U32(m_Status, BufferOut); break; @@ -407,9 +406,12 @@ u32 CWII_IPC_HLE_Device_sdio_slot0::ExecuteCommand(u32 _BufferIn, u32 _BufferInS DEBUG_LOG(WII_IPC_SD, "SDHC_CAPABILITIES"); // SDHC 1.0 supports only 10-63 MHz. // So of course we reply 63MHz :) - u8 mhz_units = 1 << 7; - u16 freq = 63 << 8; - u32 caps = freq | mhz_units; + u32 freq = (63 << 8) + (1 << 7) + 63; + // Only support 3.3V + u32 voltage = 1 << 24; + // High Speed support + u32 speed = 1 << 21; + u32 caps = freq | voltage | speed; Memory::Write_U32(caps, _BufferOut); break; } diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_sdio_slot0.h b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_sdio_slot0.h index 051e20495c..a6e20086cb 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_sdio_slot0.h +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_sdio_slot0.h @@ -70,6 +70,7 @@ private: // Status enum { + CARD_NOT_EXIST = 0, CARD_INSERTED = 1, CARD_INITIALIZED = 0x10000, }; 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 f468d5c805..c70ca6f5aa 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 @@ -472,10 +472,10 @@ u32 CWII_IPC_HLE_Device_usb_oh1_57e_305::Update() // or CPU will disconnect WiiMote automatically // but don't send too many or it will jam the bus and cost extra CPU time // - if (m_HCIBuffer.m_address && !WII_IPCInterface::GetAddress() && m_WiiMotes[0].IsConnected()) + if (m_HCIBuffer.m_address && m_WiiMotes[0].IsConnected()) { m_FreqDividerSync++; - if ((m_PacketCount > 0) || (m_FreqDividerSync > 30)) // Feel free to tweak it + if ((m_PacketCount > 0) || (m_FreqDividerSync > 60)) // Feel free to tweak it { m_FreqDividerSync = 0; SendEventNumberOfCompletedPackets(m_WiiMotes[0].GetConnectionHandle(), m_PacketCount); @@ -490,7 +490,7 @@ u32 CWII_IPC_HLE_Device_usb_oh1_57e_305::Update() // Besides, decreasing its reporting frequency also brings us great FPS boost // Now I am making it running at 1/100 frequency of IPC which is already fast enough for human input // - if (m_ACLBuffer.m_address && !WII_IPCInterface::GetAddress() && !m_LastCmd && m_WiiMotes[0].IsLinked()) + if (m_ACLBuffer.m_address && !m_LastCmd && m_WiiMotes[0].IsLinked()) { m_FreqDividerMote++; if(m_FreqDividerMote > 99) // Feel free to tweak it diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb_kbd.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb_kbd.cpp index c2f33a5ccc..3409ae49fa 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb_kbd.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb_kbd.cpp @@ -46,7 +46,7 @@ bool CWII_IPC_HLE_Device_usb_kbd::Open(u32 _CommandAddress, u32 _Mode) bool CWII_IPC_HLE_Device_usb_kbd::Close(u32 _CommandAddress, bool _bForce) { - INFO_LOG(WII_IPC_NET, "USB_KBD: Close"); + INFO_LOG(WII_IPC_STM, "CWII_IPC_HLE_Device_usb_kbd: Close"); if (!_bForce) Memory::Write_U32(0, _CommandAddress + 4); m_Active = false;