mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-12-30 20:43: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,
|
byte[] SentBuffer = Context.Memory.ReadBytes(Context.Request.SendBuff[0].Position,
|
||||||
Context.Request.SendBuff[0].Size);
|
Context.Request.SendBuff[0].Size);
|
||||||
|
|
||||||
byte[] AddressBuffer = Context.Memory.ReadBytes(Context.Request.SendBuff[1].Position,
|
byte[] AddressBuffer = ReadSmartBuffer(Context, 1);
|
||||||
Context.Request.SendBuff[1].Size);
|
|
||||||
|
|
||||||
if (!Sockets[SocketId].Handle.Connected)
|
if (!Sockets[SocketId].Handle.Connected)
|
||||||
{
|
{
|
||||||
|
@ -286,8 +285,7 @@ namespace Ryujinx.HLE.OsHle.Services.Bsd
|
||||||
{
|
{
|
||||||
int SocketId = Context.RequestData.ReadInt32();
|
int SocketId = Context.RequestData.ReadInt32();
|
||||||
|
|
||||||
byte[] AddressBuffer = Context.Memory.ReadBytes(Context.Request.SendBuff[0].Position,
|
byte[] AddressBuffer = ReadSmartBuffer(Context, 0);
|
||||||
Context.Request.SendBuff[0].Size);
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -310,8 +308,7 @@ namespace Ryujinx.HLE.OsHle.Services.Bsd
|
||||||
{
|
{
|
||||||
int SocketId = Context.RequestData.ReadInt32();
|
int SocketId = Context.RequestData.ReadInt32();
|
||||||
|
|
||||||
byte[] AddressBuffer = Context.Memory.ReadBytes(Context.Request.SendBuff[0].Position,
|
byte[] AddressBuffer = ReadSmartBuffer(Context, 0);
|
||||||
Context.Request.SendBuff[0].Size);
|
|
||||||
|
|
||||||
try
|
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)
|
private int Get16(byte[] Data, int Address)
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue