ipc: Remove size checks for buffer type 0x21/0x22 (#2387)

* ipc: Remove size checks for buffer type 0x21/0x22

Since original IPC implementation doesn't check the buffers size, there is no reason to check them so I've removed it. Checking the buffers addresses could prevent to unexpected behaviors.

That's fix a bsd service issue with some homebrew and some games like Knockout City (https://github.com/Ryujinx/Ryujinx-Games-List/issues/3622) which is now bootable:

* addresses gdkchan's review
This commit is contained in:
Ac_K 2021-06-22 19:32:22 +02:00 committed by GitHub
parent 992ab77f1f
commit 50ba233ac6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -246,16 +246,12 @@ namespace Ryujinx.HLE.HOS.Ipc
// ReSharper disable once InconsistentNaming
public (ulong Position, ulong Size) GetBufferType0x21(int index = 0)
{
if (PtrBuff.Count > index &&
PtrBuff[index].Position != 0 &&
PtrBuff[index].Size != 0)
if (PtrBuff.Count > index && PtrBuff[index].Position != 0)
{
return (PtrBuff[index].Position, PtrBuff[index].Size);
}
if (SendBuff.Count > index &&
SendBuff[index].Position != 0 &&
SendBuff[index].Size != 0)
if (SendBuff.Count > index)
{
return (SendBuff[index].Position, SendBuff[index].Size);
}
@ -266,16 +262,12 @@ namespace Ryujinx.HLE.HOS.Ipc
// ReSharper disable once InconsistentNaming
public (ulong Position, ulong Size) GetBufferType0x22(int index = 0)
{
if (RecvListBuff.Count > index &&
RecvListBuff[index].Position != 0 &&
RecvListBuff[index].Size != 0)
if (RecvListBuff.Count > index && RecvListBuff[index].Position != 0)
{
return (RecvListBuff[index].Position, RecvListBuff[index].Size);
}
if (ReceiveBuff.Count > index &&
ReceiveBuff[index].Position != 0 &&
ReceiveBuff[index].Size != 0)
if (ReceiveBuff.Count > index)
{
return (ReceiveBuff[index].Position, ReceiveBuff[index].Size);
}