mirror of
https://github.com/libretro/Play-.git
synced 2024-12-04 23:36:30 +00:00
Gracefully handle cases where GIF transfer doesn't complete.
This commit is contained in:
parent
72569d2cb3
commit
930e7357cf
@ -368,17 +368,19 @@ uint32 CGIF::ReceiveDMA(uint32 address, uint32 qwc, uint32 unused, bool tagInclu
|
|||||||
memory = m_ram;
|
memory = m_ram;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32 start = address;
|
||||||
|
uint32 end = address + size;
|
||||||
|
|
||||||
if(tagIncluded)
|
if(tagIncluded)
|
||||||
{
|
{
|
||||||
assert(qwc >= 0);
|
assert(qwc >= 0);
|
||||||
size -= 0x10;
|
|
||||||
address += 0x10;
|
address += 0x10;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 end = address + size;
|
address += ProcessMultiplePackets(memory, address, end, CGsPacketMetadata(3));
|
||||||
uint32 processed = ProcessMultiplePackets(memory, address, end, CGsPacketMetadata(3));
|
assert(address <= end);
|
||||||
assert(processed == size);
|
|
||||||
return qwc;
|
return (address - start) / 0x10;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 CGIF::GetRegister(uint32 address)
|
uint32 CGIF::GetRegister(uint32 address)
|
||||||
|
@ -164,8 +164,10 @@ void CVif1::Cmd_DIRECT(StreamType& stream, CODE nCommand)
|
|||||||
{
|
{
|
||||||
auto packet = stream.GetDirectPointer();
|
auto packet = stream.GetDirectPointer();
|
||||||
uint32 processed = m_gif.ProcessMultiplePackets(packet, 0, nSize, CGsPacketMetadata(2));
|
uint32 processed = m_gif.ProcessMultiplePackets(packet, 0, nSize, CGsPacketMetadata(2));
|
||||||
assert(processed == nSize);
|
assert(processed <= nSize);
|
||||||
stream.Advance(processed);
|
stream.Advance(processed);
|
||||||
|
//Adjust size in case not everything was processed by GIF
|
||||||
|
nSize = processed;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_CODE.nIMM -= (nSize / 0x10);
|
m_CODE.nIMM -= (nSize / 0x10);
|
||||||
|
Loading…
Reference in New Issue
Block a user