Skip to content

Commit

Permalink
Send more than 1 reply back to EE.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpd002 committed Nov 24, 2023
1 parent e0d67d8 commit 799f5f7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Source/iop/namco_sys147/Iop_NamcoSys147.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,17 +150,17 @@ bool CSys147::Invoke99(uint32 method, uint32* args, uint32 argsSize, uint32* ret
CLog::GetInstance().Warn(LOG_NAME, "LINK_02000000();\r\n");
//Receive Responses?
{
if(!m_pendingReplies.empty())
uint16 maxPackets = reinterpret_cast<uint16*>(args)[0];
assert(m_pendingReplies.size() < 0x10000);
uint16 xferPackets = std::min(maxPackets, static_cast<uint16>(m_pendingReplies.size()));
auto outputPacket = reinterpret_cast<MODULE_99_PACKET*>(ret + 1);
for(int i = 0; i < xferPackets; i++)
{
auto outputPacket = reinterpret_cast<MODULE_99_PACKET*>(ret + 1);
memcpy(outputPacket, &m_pendingReplies.front(), sizeof(MODULE_99_PACKET));
m_pendingReplies.erase(m_pendingReplies.begin());
reinterpret_cast<uint16*>(ret)[0] = 1;
}
else
{
reinterpret_cast<uint16*>(ret)[0] = 0;
outputPacket++;
}
reinterpret_cast<uint16*>(ret)[0] = xferPackets;
}
break;
case 0x03004002:
Expand Down

0 comments on commit 799f5f7

Please sign in to comment.