Compliant with review.

This commit is contained in:
Starlet 2018-06-02 18:30:45 -04:00
parent 6656b6ebe1
commit 63c20f0ca3
9 changed files with 42 additions and 44 deletions

View file

@ -181,7 +181,7 @@ namespace Ryujinx.Core.OsHle.Ipc
return (PtrBuff[0].Position, PtrBuff[0].Size);
}
if (SendBuff.Count > 0)
if (SendBuff.Count > 0 && SendBuff[0].Position != 0 && SendBuff[0].Size != 0)
{
return (SendBuff[0].Position, SendBuff[0].Size);
}
@ -189,19 +189,19 @@ namespace Ryujinx.Core.OsHle.Ipc
return (0, 0);
}
public long GetBufferType0x22Position()
public (long Position, long Size) GetBufferType0x22()
{
if (RecvListBuff.Count > 0 && RecvListBuff[0].Position != 0)
if (RecvListBuff.Count > 0 && RecvListBuff[0].Position != 0 && RecvListBuff[0].Size != 0)
{
return RecvListBuff[0].Position;
return (RecvListBuff[0].Position, RecvListBuff[0].Size);
}
if (ReceiveBuff.Count > 0)
if (ReceiveBuff.Count > 0 && ReceiveBuff[0].Position != 0 && ReceiveBuff[0].Size != 0)
{
return ReceiveBuff[0].Position;
return (ReceiveBuff[0].Position, ReceiveBuff[0].Size);
}
return 0;
return (0, 0);
}
}
}

View file

@ -2,7 +2,6 @@
using Ryujinx.Core.OsHle.Handles;
using Ryujinx.Core.OsHle.Ipc;
using System.Collections.Generic;
using System.IO;
namespace Ryujinx.Core.OsHle.Services.Am
{

View file

@ -131,8 +131,7 @@ namespace Ryujinx.Core.OsHle.Services.Aud
Context.ResponseData.Write(DeviceNames.Length);
long Position = Context.Request.GetBufferType0x21().Position;
long Size = Context.Request.GetBufferType0x21().Size;
(long Position, long Size) = Context.Request.GetBufferType0x22();
long BasePosition = Position;

View file

@ -181,7 +181,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv
return NvResult.InvalidInput;
}
if (CmdOut(Cmd) && Context.Request.GetBufferType0x22Position() == 0)
if (CmdOut(Cmd) && Context.Request.GetBufferType0x22().Position == 0)
{
Context.Ns.Log.PrintError(LogClass.ServiceNv, "Output buffer is null!");

View file

@ -38,7 +38,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv.NvGpuAS
private static int BindChannel(ServiceCtx Context)
{
long InputPosition = Context.Request.GetBufferType0x21().Position;
long OutputPosition = Context.Request.GetBufferType0x22Position();
long OutputPosition = Context.Request.GetBufferType0x22().Position;
Context.Ns.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");
@ -48,7 +48,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv.NvGpuAS
private static int AllocSpace(ServiceCtx Context)
{
long InputPosition = Context.Request.GetBufferType0x21().Position;
long OutputPosition = Context.Request.GetBufferType0x22Position();
long OutputPosition = Context.Request.GetBufferType0x22().Position;
NvGpuASAllocSpace Args = AMemoryHelper.Read<NvGpuASAllocSpace>(Context.Memory, InputPosition);
@ -85,7 +85,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv.NvGpuAS
private static int FreeSpace(ServiceCtx Context)
{
long InputPosition = Context.Request.GetBufferType0x21().Position;
long OutputPosition = Context.Request.GetBufferType0x22Position();
long OutputPosition = Context.Request.GetBufferType0x22().Position;
NvGpuASAllocSpace Args = AMemoryHelper.Read<NvGpuASAllocSpace>(Context.Memory, InputPosition);
@ -102,7 +102,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv.NvGpuAS
private static int UnmapBuffer(ServiceCtx Context)
{
long InputPosition = Context.Request.GetBufferType0x21().Position;
long OutputPosition = Context.Request.GetBufferType0x22Position();
long OutputPosition = Context.Request.GetBufferType0x22().Position;
NvGpuASUnmapBuffer Args = AMemoryHelper.Read<NvGpuASUnmapBuffer>(Context.Memory, InputPosition);
@ -119,7 +119,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv.NvGpuAS
private static int MapBufferEx(ServiceCtx Context)
{
long InputPosition = Context.Request.GetBufferType0x21().Position;
long OutputPosition = Context.Request.GetBufferType0x22Position();
long OutputPosition = Context.Request.GetBufferType0x22().Position;
NvGpuASMapBufferEx Args = AMemoryHelper.Read<NvGpuASMapBufferEx>(Context.Memory, InputPosition);
@ -191,7 +191,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv.NvGpuAS
private static int GetVaRegions(ServiceCtx Context)
{
long InputPosition = Context.Request.GetBufferType0x21().Position;
long OutputPosition = Context.Request.GetBufferType0x22Position();
long OutputPosition = Context.Request.GetBufferType0x22().Position;
Context.Ns.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");
@ -201,7 +201,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv.NvGpuAS
private static int InitializeEx(ServiceCtx Context)
{
long InputPosition = Context.Request.GetBufferType0x21().Position;
long OutputPosition = Context.Request.GetBufferType0x22Position();
long OutputPosition = Context.Request.GetBufferType0x22().Position;
Context.Ns.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");

View file

@ -38,7 +38,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv.NvGpuGpu
private static int ZcullGetCtxSize(ServiceCtx Context)
{
long OutputPosition = Context.Request.GetBufferType0x22Position();
long OutputPosition = Context.Request.GetBufferType0x22().Position;
NvGpuGpuZcullGetCtxSize Args = new NvGpuGpuZcullGetCtxSize();
@ -53,7 +53,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv.NvGpuGpu
private static int ZcullGetInfo(ServiceCtx Context)
{
long OutputPosition = Context.Request.GetBufferType0x22Position();
long OutputPosition = Context.Request.GetBufferType0x22().Position;
NvGpuGpuZcullGetInfo Args = new NvGpuGpuZcullGetInfo();
@ -78,7 +78,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv.NvGpuGpu
private static int ZbcSetTable(ServiceCtx Context)
{
long InputPosition = Context.Request.GetBufferType0x21().Position;
long OutputPosition = Context.Request.GetBufferType0x22Position();
long OutputPosition = Context.Request.GetBufferType0x22().Position;
Context.Ns.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");
@ -88,7 +88,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv.NvGpuGpu
private static int GetCharacteristics(ServiceCtx Context)
{
long InputPosition = Context.Request.GetBufferType0x21().Position;
long OutputPosition = Context.Request.GetBufferType0x22Position();
long OutputPosition = Context.Request.GetBufferType0x22().Position;
NvGpuGpuGetCharacteristics Args = AMemoryHelper.Read<NvGpuGpuGetCharacteristics>(Context.Memory, InputPosition);
@ -138,7 +138,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv.NvGpuGpu
private static int GetTpcMasks(ServiceCtx Context)
{
long InputPosition = Context.Request.GetBufferType0x21().Position;
long OutputPosition = Context.Request.GetBufferType0x22Position();
long OutputPosition = Context.Request.GetBufferType0x22().Position;
NvGpuGpuGetTpcMasks Args = AMemoryHelper.Read<NvGpuGpuGetTpcMasks>(Context.Memory, InputPosition);
@ -154,7 +154,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv.NvGpuGpu
private static int GetActiveSlotMask(ServiceCtx Context)
{
long OutputPosition = Context.Request.GetBufferType0x22Position();
long OutputPosition = Context.Request.GetBufferType0x22().Position;
NvGpuGpuGetActiveSlotMask Args = new NvGpuGpuGetActiveSlotMask();
@ -170,7 +170,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv.NvGpuGpu
private static int GetGpuTime(ServiceCtx Context)
{
long OutputPosition = Context.Request.GetBufferType0x22Position();
long OutputPosition = Context.Request.GetBufferType0x22().Position;
Context.Memory.WriteInt64(OutputPosition, GetPTimerNanoSeconds());

View file

@ -28,7 +28,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv.NvHostChannel
private static int SetUserData(ServiceCtx Context)
{
long InputPosition = Context.Request.GetBufferType0x21().Position;
long OutputPosition = Context.Request.GetBufferType0x22Position();
long OutputPosition = Context.Request.GetBufferType0x22().Position;
Context.Ns.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");
@ -38,7 +38,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv.NvHostChannel
private static int SetNvMap(ServiceCtx Context)
{
long InputPosition = Context.Request.GetBufferType0x21().Position;
long OutputPosition = Context.Request.GetBufferType0x22Position();
long OutputPosition = Context.Request.GetBufferType0x22().Position;
Context.Ns.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");
@ -48,7 +48,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv.NvHostChannel
private static int SubmitGpfifo(ServiceCtx Context)
{
long InputPosition = Context.Request.GetBufferType0x21().Position;
long OutputPosition = Context.Request.GetBufferType0x22Position();
long OutputPosition = Context.Request.GetBufferType0x22().Position;
NvHostChannelSubmitGpfifo Args = AMemoryHelper.Read<NvHostChannelSubmitGpfifo>(Context.Memory, InputPosition);
@ -80,7 +80,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv.NvHostChannel
private static int AllocObjCtx(ServiceCtx Context)
{
long InputPosition = Context.Request.GetBufferType0x21().Position;
long OutputPosition = Context.Request.GetBufferType0x22Position();
long OutputPosition = Context.Request.GetBufferType0x22().Position;
Context.Ns.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");
@ -90,7 +90,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv.NvHostChannel
private static int ZcullBind(ServiceCtx Context)
{
long InputPosition = Context.Request.GetBufferType0x21().Position;
long OutputPosition = Context.Request.GetBufferType0x22Position();
long OutputPosition = Context.Request.GetBufferType0x22().Position;
Context.Ns.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");
@ -100,7 +100,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv.NvHostChannel
private static int SetErrorNotifier(ServiceCtx Context)
{
long InputPosition = Context.Request.GetBufferType0x21().Position;
long OutputPosition = Context.Request.GetBufferType0x22Position();
long OutputPosition = Context.Request.GetBufferType0x22().Position;
Context.Ns.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");
@ -110,7 +110,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv.NvHostChannel
private static int SetPriority(ServiceCtx Context)
{
long InputPosition = Context.Request.GetBufferType0x21().Position;
long OutputPosition = Context.Request.GetBufferType0x22Position();
long OutputPosition = Context.Request.GetBufferType0x22().Position;
Context.Ns.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");
@ -120,7 +120,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv.NvHostChannel
private static int AllocGpfifoEx2(ServiceCtx Context)
{
long InputPosition = Context.Request.GetBufferType0x21().Position;
long OutputPosition = Context.Request.GetBufferType0x22Position();
long OutputPosition = Context.Request.GetBufferType0x22().Position;
Context.Ns.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");

View file

@ -72,7 +72,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv.NvHostCtrl
private static int GetConfig(ServiceCtx Context)
{
long InputPosition = Context.Request.GetBufferType0x21().Position;
long OutputPosition = Context.Request.GetBufferType0x22Position();
long OutputPosition = Context.Request.GetBufferType0x22().Position;
string Nv = AMemoryHelper.ReadAsciiString(Context.Memory, InputPosition + 0, 0x41);
string Name = AMemoryHelper.ReadAsciiString(Context.Memory, InputPosition + 0x41, 0x41);
@ -97,7 +97,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv.NvHostCtrl
private static int EventRegister(ServiceCtx Context)
{
long InputPosition = Context.Request.GetBufferType0x21().Position;
long OutputPosition = Context.Request.GetBufferType0x22Position();
long OutputPosition = Context.Request.GetBufferType0x22().Position;
int EventId = Context.Memory.ReadInt32(InputPosition);
@ -109,7 +109,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv.NvHostCtrl
private static int SyncptReadMinOrMax(ServiceCtx Context, bool Max)
{
long InputPosition = Context.Request.GetBufferType0x21().Position;
long OutputPosition = Context.Request.GetBufferType0x22Position();
long OutputPosition = Context.Request.GetBufferType0x22().Position;
NvHostCtrlSyncptRead Args = AMemoryHelper.Read<NvHostCtrlSyncptRead>(Context.Memory, InputPosition);
@ -135,7 +135,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv.NvHostCtrl
private static int SyncptWait(ServiceCtx Context, bool Extended)
{
long InputPosition = Context.Request.GetBufferType0x21().Position;
long OutputPosition = Context.Request.GetBufferType0x22Position();
long OutputPosition = Context.Request.GetBufferType0x22().Position;
NvHostCtrlSyncptWait Args = AMemoryHelper.Read<NvHostCtrlSyncptWait>(Context.Memory, InputPosition);
@ -203,7 +203,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv.NvHostCtrl
private static int EventWait(ServiceCtx Context, bool Async)
{
long InputPosition = Context.Request.GetBufferType0x21().Position;
long OutputPosition = Context.Request.GetBufferType0x22Position();
long OutputPosition = Context.Request.GetBufferType0x22().Position;
NvHostCtrlSyncptWaitEx Args = AMemoryHelper.Read<NvHostCtrlSyncptWaitEx>(Context.Memory, InputPosition);

View file

@ -37,7 +37,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv.NvMap
private static int Create(ServiceCtx Context)
{
long InputPosition = Context.Request.GetBufferType0x21().Position;
long OutputPosition = Context.Request.GetBufferType0x22Position();
long OutputPosition = Context.Request.GetBufferType0x22().Position;
NvMapCreate Args = AMemoryHelper.Read<NvMapCreate>(Context.Memory, InputPosition);
@ -62,7 +62,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv.NvMap
private static int FromId(ServiceCtx Context)
{
long InputPosition = Context.Request.GetBufferType0x21().Position;
long OutputPosition = Context.Request.GetBufferType0x22Position();
long OutputPosition = Context.Request.GetBufferType0x22().Position;
NvMapFromId Args = AMemoryHelper.Read<NvMapFromId>(Context.Memory, InputPosition);
@ -87,7 +87,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv.NvMap
private static int Alloc(ServiceCtx Context)
{
long InputPosition = Context.Request.GetBufferType0x21().Position;
long OutputPosition = Context.Request.GetBufferType0x22Position();
long OutputPosition = Context.Request.GetBufferType0x22().Position;
NvMapAlloc Args = AMemoryHelper.Read<NvMapAlloc>(Context.Memory, InputPosition);
@ -150,7 +150,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv.NvMap
private static int Free(ServiceCtx Context)
{
long InputPosition = Context.Request.GetBufferType0x21().Position;
long OutputPosition = Context.Request.GetBufferType0x22Position();
long OutputPosition = Context.Request.GetBufferType0x22().Position;
NvMapFree Args = AMemoryHelper.Read<NvMapFree>(Context.Memory, InputPosition);
@ -189,7 +189,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv.NvMap
private static int Param(ServiceCtx Context)
{
long InputPosition = Context.Request.GetBufferType0x21().Position;
long OutputPosition = Context.Request.GetBufferType0x22Position();
long OutputPosition = Context.Request.GetBufferType0x22().Position;
NvMapParam Args = AMemoryHelper.Read<NvMapParam>(Context.Memory, InputPosition);
@ -223,7 +223,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv.NvMap
private static int GetId(ServiceCtx Context)
{
long InputPosition = Context.Request.GetBufferType0x21().Position;
long OutputPosition = Context.Request.GetBufferType0x22Position();
long OutputPosition = Context.Request.GetBufferType0x22().Position;
NvMapGetId Args = AMemoryHelper.Read<NvMapGetId>(Context.Memory, InputPosition);