Delay IPC replies directly caused by requests by 150th of a second. Fixes everything.
This commit is contained in:
parent
039bf27767
commit
00a1f351e9
|
@ -58,6 +58,8 @@ They will also generate a true or false return for UpdateInterrupts() in WII_IPC
|
||||||
#include "../HW/WII_IPC.h"
|
#include "../HW/WII_IPC.h"
|
||||||
#include "../Debugger/Debugger_SymbolMap.h"
|
#include "../Debugger/Debugger_SymbolMap.h"
|
||||||
#include "../PowerPC/PowerPC.h"
|
#include "../PowerPC/PowerPC.h"
|
||||||
|
#include "../HW/SystemTimers.h"
|
||||||
|
#include "CoreTiming.h"
|
||||||
|
|
||||||
|
|
||||||
namespace WII_IPC_HLE_Interface
|
namespace WII_IPC_HLE_Interface
|
||||||
|
@ -80,8 +82,17 @@ typedef std::deque<u32> ipc_msg_queue;
|
||||||
static ipc_msg_queue request_queue; // ppc -> arm
|
static ipc_msg_queue request_queue; // ppc -> arm
|
||||||
static ipc_msg_queue reply_queue; // arm -> ppc
|
static ipc_msg_queue reply_queue; // arm -> ppc
|
||||||
|
|
||||||
|
static int enque_reply;
|
||||||
|
|
||||||
|
void EnqueReplyCallback(u64 userdata, int)
|
||||||
|
{
|
||||||
|
reply_queue.push_back(userdata);
|
||||||
|
}
|
||||||
|
|
||||||
void Init()
|
void Init()
|
||||||
{
|
{
|
||||||
|
enque_reply = CoreTiming::RegisterEvent("IPCReply", EnqueReplyCallback);
|
||||||
|
|
||||||
_dbg_assert_msg_(WII_IPC_HLE, g_DeviceMap.empty(), "DeviceMap isnt empty on init");
|
_dbg_assert_msg_(WII_IPC_HLE, g_DeviceMap.empty(), "DeviceMap isnt empty on init");
|
||||||
CWII_IPC_HLE_Device_es::m_ContentFile = "";
|
CWII_IPC_HLE_Device_es::m_ContentFile = "";
|
||||||
u32 i;
|
u32 i;
|
||||||
|
@ -504,7 +515,7 @@ void ExecuteCommand(u32 _Address)
|
||||||
if (CmdSuccess)
|
if (CmdSuccess)
|
||||||
{
|
{
|
||||||
// Generate a reply to the IPC command
|
// Generate a reply to the IPC command
|
||||||
EnqReply(_Address);
|
EnqReply(_Address, SystemTimers::GetTicksPerSecond() / 150);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -526,9 +537,9 @@ void EnqRequest(u32 _Address)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called when IOS module has some reply
|
// Called when IOS module has some reply
|
||||||
void EnqReply(u32 _Address)
|
void EnqReply(u32 _Address, int cycles_in_future)
|
||||||
{
|
{
|
||||||
reply_queue.push_back(_Address);
|
CoreTiming::ScheduleEvent(cycles_in_future, enque_reply, _Address);
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is called every IPC_HLE_PERIOD from SystemTimers.cpp
|
// This is called every IPC_HLE_PERIOD from SystemTimers.cpp
|
||||||
|
|
|
@ -62,7 +62,7 @@ void UpdateDevices();
|
||||||
void ExecuteCommand(u32 _Address);
|
void ExecuteCommand(u32 _Address);
|
||||||
|
|
||||||
void EnqRequest(u32 _Address);
|
void EnqRequest(u32 _Address);
|
||||||
void EnqReply(u32 _Address);
|
void EnqReply(u32 _Address, int cycles_in_future = 0);
|
||||||
|
|
||||||
enum ECommandType
|
enum ECommandType
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue