private static int SyncptReadMinOrMax(ServiceCtx Context, bool Max) { long InputPosition = Context.Request.GetBufferType0x21().Position; long OutputPosition = Context.Request.GetBufferType0x22().Position; NvHostCtrlSyncptRead Args = MemoryHelper.Read <NvHostCtrlSyncptRead>(Context.Memory, InputPosition); if ((uint)Args.Id >= NvHostSyncpt.SyncptsCount) { return(NvResult.InvalidInput); } if (Max) { Args.Value = GetUserCtx(Context).Syncpt.GetMax(Args.Id); } else { Args.Value = GetUserCtx(Context).Syncpt.GetMin(Args.Id); } MemoryHelper.Write(Context.Memory, OutputPosition, Args); return(NvResult.Success); }
private static int SyncptReadMinOrMax(ServiceCtx context, bool max) { long inputPosition = context.Request.GetBufferType0x21().Position; long outputPosition = context.Request.GetBufferType0x22().Position; NvHostCtrlSyncptRead args = MemoryHelper.Read <NvHostCtrlSyncptRead>(context.Memory, inputPosition); if ((uint)args.Id >= NvHostSyncpt.SyncptsCount) { return(NvResult.InvalidInput); } if (max) { args.Value = GetUserCtx(context).Syncpt.GetMax(args.Id); } else { args.Value = GetUserCtx(context).Syncpt.GetMin(args.Id); } MemoryHelper.Write(context.Memory, outputPosition, args); return(NvResult.Success); }