mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-12-29 03:53:05 +00:00
Update BSD service to handle libnx's 'smart IPC buffers' for address info
This commit is contained in:
parent
e581abb2f5
commit
fa2cf7f89c
1 changed files with 18 additions and 6 deletions
|
@ -180,8 +180,7 @@ namespace Ryujinx.HLE.OsHle.Services.Bsd
|
|||
byte[] SentBuffer = Context.Memory.ReadBytes(Context.Request.SendBuff[0].Position,
|
||||
Context.Request.SendBuff[0].Size);
|
||||
|
||||
byte[] AddressBuffer = Context.Memory.ReadBytes(Context.Request.SendBuff[1].Position,
|
||||
Context.Request.SendBuff[1].Size);
|
||||
byte[] AddressBuffer = ReadSmartBuffer(Context, 1);
|
||||
|
||||
if (!Sockets[SocketId].Handle.Connected)
|
||||
{
|
||||
|
@ -286,8 +285,7 @@ namespace Ryujinx.HLE.OsHle.Services.Bsd
|
|||
{
|
||||
int SocketId = Context.RequestData.ReadInt32();
|
||||
|
||||
byte[] AddressBuffer = Context.Memory.ReadBytes(Context.Request.SendBuff[0].Position,
|
||||
Context.Request.SendBuff[0].Size);
|
||||
byte[] AddressBuffer = ReadSmartBuffer(Context, 0);
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -310,8 +308,7 @@ namespace Ryujinx.HLE.OsHle.Services.Bsd
|
|||
{
|
||||
int SocketId = Context.RequestData.ReadInt32();
|
||||
|
||||
byte[] AddressBuffer = Context.Memory.ReadBytes(Context.Request.SendBuff[0].Position,
|
||||
Context.Request.SendBuff[0].Size);
|
||||
byte[] AddressBuffer = ReadSmartBuffer(Context, 0);
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -426,6 +423,21 @@ namespace Ryujinx.HLE.OsHle.Services.Bsd
|
|||
}
|
||||
}
|
||||
|
||||
private byte[] ReadSmartBuffer(ServiceCtx Context, int Index)
|
||||
{
|
||||
if (Context.Request.SendBuff[Index].Position != 0 &&
|
||||
Context.Request.SendBuff[Index].Size != 0)
|
||||
{
|
||||
return Context.Memory.ReadBytes(Context.Request.SendBuff[Index].Position,
|
||||
Context.Request.SendBuff[Index].Size);
|
||||
}
|
||||
else
|
||||
{
|
||||
return Context.Memory.ReadBytes(Context.Request.PtrBuff[Index].Position,
|
||||
Context.Request.PtrBuff[Index].Size);
|
||||
}
|
||||
}
|
||||
|
||||
private int Get16(byte[] Data, int Address)
|
||||
{
|
||||
return
|
||||
|
|
Loading…
Reference in a new issue