diff --git a/Source/Core/Core/Src/HW/SystemTimers.cpp b/Source/Core/Core/Src/HW/SystemTimers.cpp index 815aaafe37..bd67d8bb92 100644 --- a/Source/Core/Core/Src/HW/SystemTimers.cpp +++ b/Source/Core/Core/Src/HW/SystemTimers.cpp @@ -173,8 +173,10 @@ void AudioDMACallback(u64 userdata, int cyclesLate) void IPC_HLE_UpdateCallback(u64 userdata, int cyclesLate) { if (SConfig::GetInstance().m_LocalCoreStartupParameter.bWii) + { WII_IPC_HLE_Interface::Update(); - CoreTiming::ScheduleEvent(IPC_HLE_PERIOD - cyclesLate, et_IPC_HLE); + CoreTiming::ScheduleEvent(IPC_HLE_PERIOD - cyclesLate, et_IPC_HLE); + } } void VICallback(u64 userdata, int cyclesLate) @@ -255,12 +257,12 @@ void Init() DSP_PERIOD = (int)(GetTicksPerSecond() * 0.003f); // AyuanX: TO BE TWEAKED - // Now the 15000 is a pure assumption + // Now the 1500 is a pure assumption // We need to figure out the real frequency though // PS: When this period is tweaked, the FreqDividerMote // in WII_IPC_HLE_Device_usb.cpp should also be tweaked accordingly // to guarantee WiiMote updates at a fixed 100Hz - IPC_HLE_PERIOD = GetTicksPerSecond() / 15000; + IPC_HLE_PERIOD = GetTicksPerSecond() / 1500; } else { 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 f6fd6a51fd..d7fb08f5c6 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp @@ -137,6 +137,7 @@ void SetDefaultContentFile(const std::string& _rFilename) if (pDevice) pDevice->LoadWAD(_rFilename); } + void ES_DIVerify(u8 *_pTMD, u32 _sz) { CWII_IPC_HLE_Device_es* pDevice = (CWII_IPC_HLE_Device_es*)AccessDeviceByID(GetDeviceIDByName(std::string("/dev/es"))); @@ -448,14 +449,6 @@ void Update() UpdateDevices(); - if (reply_queue.size()) - { - WII_IPCInterface::GenerateReply(reply_queue.front()); - INFO_LOG(WII_IPC_HLE, "<<-- Reply to IPC Request @ 0x%08x", reply_queue.front()); - reply_queue.pop(); - return; - } - if (request_queue.size()) { WII_IPCInterface::GenerateAck(request_queue.front()); @@ -464,9 +457,16 @@ void Update() ExecuteCommand(request_queue.front()); request_queue.pop(); - #if MAX_LOGLEVEL >= DEBUG_LEVEL +#if MAX_LOGLEVEL >= DEBUG_LEVEL Dolphin_Debugger::PrintCallstack(LogTypes::WII_IPC_HLE, LogTypes::LDEBUG); - #endif +#endif + } + + if (reply_queue.size()) + { + WII_IPCInterface::GenerateReply(reply_queue.front()); + INFO_LOG(WII_IPC_HLE, "<<-- Reply to IPC Request @ 0x%08x", reply_queue.front()); + reply_queue.pop(); } } diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp index 65229d666c..b084efabef 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp @@ -437,13 +437,6 @@ bool CWII_IPC_HLE_Device_es::IOCtlV(u32 _CommandAddress) _dbg_assert_msg_(WII_IPC_ES, Buffer.NumberPayloadBuffer == 1, "IOCTL_ES_GETVIEWCNT no out buffer"); u64 TitleID = Memory::Read_U64(Buffer.InBuffer[0].m_Address); - if (TitleID != TITLEID_SYSMENU && (u32)(TitleID >> 32) == 0x00000001 && m_TitleID == TITLEID_SYSMENU) - { - // TODO: Check if any titles other than 1-2 call this for a ios tik - ERROR_LOG(WII_IPC_ES, "IOCTL_ES_GETVIEWCNT tik for IOS %x requested, returning System Menu tik", TitleID & 0xFFFFFFFF); - TitleID = TITLEID_SYSMENU; - } - std::string TicketFilename = Common::CreateTicketFileName(TitleID); u32 ViewCount = 0; @@ -482,13 +475,6 @@ bool CWII_IPC_HLE_Device_es::IOCtlV(u32 _CommandAddress) u64 TitleID = Memory::Read_U64(Buffer.InBuffer[0].m_Address); u32 maxViews = Memory::Read_U32(Buffer.InBuffer[1].m_Address); - if (TitleID != TITLEID_SYSMENU && (u32)(TitleID >> 32) == 0x00000001 && m_TitleID == TITLEID_SYSMENU) - { - // TODO: Check if any titles other than 1-2 call this for a ios tik - ERROR_LOG(WII_IPC_ES, "IOCTL_ES_GETVIEWS tik for IOS %x requested, returning System Menu tik", TitleID & 0xFFFFFFFF); - TitleID = TITLEID_SYSMENU; - } - std::string TicketFilename = Common::CreateTicketFileName(TitleID); if (File::Exists(TicketFilename.c_str())) { 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 0b88264052..7a2ac043e3 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 @@ -427,14 +427,14 @@ u32 CWII_IPC_HLE_Device_usb_oh1_57e_305::Update() // The Real Wiimote sends report at a fixed frequency of 100Hz // So let's make it also 100Hz here - // Calculation: 15000Hz (IPC_HLE) / 100Hz (WiiMote) = 150 + // Calculation: 1500Hz (IPC_HLE) / 100Hz (WiiMote) = 15 if (m_ACLEndpoint.IsValid()) { - if (++m_WiimoteUpdate_Freq > 150) + if (++m_WiimoteUpdate_Freq > 15) m_WiimoteUpdate_Freq = 0; for (unsigned int i = 0; i < m_WiiMotes.size(); i++) { - if (m_WiiMotes[i].IsConnected() && m_WiimoteUpdate_Freq == 150 / (i + 1)) + if (m_WiiMotes[i].IsConnected() && m_WiimoteUpdate_Freq == 15 / (i + 1)) { #if defined(HAVE_WX) && HAVE_WX NetPlay_WiimoteUpdate(i);