mirror of
https://github.com/ryujinx-mirror/ryujinx.git
synced 2024-10-21 05:01:40 +00:00
9426ef3f06
* Start rewriting nvservices internals TODO: - nvgpu device interface - nvhost generic device interface * Some clean up and fixes - Make sure to remove the fd of a closed channel. - NvFileDevice now doesn't implement Disposable as it was never used. - Rename NvHostCtrlGetConfigurationArgument to GetConfigurationArguments to follow calling convention. - Make sure to check every ioctls magic. * Finalize migration for ioctl standard variant TODO: ioctl2 migration * Implement SubmitGpfifoEx and fix nvdec * Implement Ioctl3 * Implement some ioctl3 required by recent games * Remove unused code and outdated comments * Return valid event handles with QueryEvent Also add an exception for unimplemented event ids. This commit doesn't implement accurately the events, this only define different events for different event ids. * Rename all occurance of FileDevice to DeviceFile * Restub SetClientPid to not cause regressions * Address comments * Remove GlobalStateTable * Address comments * Align variables in ioctl3 * Some missing alignments * GetVaRegionsArguments realign * Make Owner public in NvDeviceFile * Address LDj3SNuD's comments
34 lines
1.1 KiB
C#
34 lines
1.1 KiB
C#
using System;
|
|
using System.Text;
|
|
|
|
namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostCtrl.Types
|
|
{
|
|
class GetConfigurationArguments
|
|
{
|
|
public string Domain;
|
|
public string Parameter;
|
|
public byte[] Configuration;
|
|
|
|
public static GetConfigurationArguments FromSpan(Span<byte> span)
|
|
{
|
|
string domain = Encoding.ASCII.GetString(span.Slice(0, 0x41));
|
|
string parameter = Encoding.ASCII.GetString(span.Slice(0x41, 0x41));
|
|
|
|
GetConfigurationArguments result = new GetConfigurationArguments
|
|
{
|
|
Domain = domain.Substring(0, domain.IndexOf('\0')),
|
|
Parameter = parameter.Substring(0, parameter.IndexOf('\0')),
|
|
Configuration = span.Slice(0x82, 0x101).ToArray()
|
|
};
|
|
|
|
return result;
|
|
}
|
|
|
|
public void CopyTo(Span<byte> span)
|
|
{
|
|
Encoding.ASCII.GetBytes(Domain + '\0').CopyTo(span.Slice(0, 0x41));
|
|
Encoding.ASCII.GetBytes(Parameter + '\0').CopyTo(span.Slice(0x41, 0x41));
|
|
Configuration.CopyTo(span.Slice(0x82, 0x101));
|
|
}
|
|
}
|
|
}
|