mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-07-25 01:57:11 +02:00
language feature: Extension Members: HLE
This commit is contained in:
parent
2075c1a543
commit
bb1ab14214
6 changed files with 20 additions and 20 deletions
|
@ -33,7 +33,7 @@ namespace Ryujinx.HLE.HOS
|
|||
|
||||
public Result GetFileSize(out long size, FileHandle handle)
|
||||
{
|
||||
return _fsClient.GetFileSize(out size, (LibHac.Fs.FileHandle)handle.Value).ToHorizonResult();
|
||||
return _fsClient.GetFileSize(out size, (LibHac.Fs.FileHandle)handle.Value).Horizon;
|
||||
}
|
||||
|
||||
public Result MountSystemData(string mountName, ulong dataId)
|
||||
|
@ -58,7 +58,7 @@ namespace Ryujinx.HLE.HOS
|
|||
using IFileSystem ncaFileSystem = nca.OpenFileSystem(NcaSectionType.Data, _system.FsIntegrityCheckLevel);
|
||||
using UniqueRef<IFileSystem> ncaFsRef = new(ncaFileSystem);
|
||||
|
||||
Result result = _fsClient.Register(mountName.ToU8Span(), ref ncaFsRef.Ref).ToHorizonResult();
|
||||
Result result = _fsClient.Register(mountName.ToU8Span(), ref ncaFsRef.Ref).Horizon;
|
||||
if (result.IsFailure)
|
||||
{
|
||||
ncaStorage.Dispose();
|
||||
|
@ -74,14 +74,14 @@ namespace Ryujinx.HLE.HOS
|
|||
{
|
||||
ncaStorage?.Dispose();
|
||||
|
||||
return ex.ResultValue.ToHorizonResult();
|
||||
return ex.ResultValue.Horizon;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Return correct result here, this is likely wrong.
|
||||
|
||||
return LibHac.Fs.ResultFs.TargetNotFound.Handle().ToHorizonResult();
|
||||
return LibHac.Fs.ResultFs.TargetNotFound.Handle().Horizon;
|
||||
}
|
||||
|
||||
public Result OpenFile(out FileHandle handle, string path, OpenMode openMode)
|
||||
|
@ -89,7 +89,7 @@ namespace Ryujinx.HLE.HOS
|
|||
LibHac.Result result = _fsClient.OpenFile(out LibHac.Fs.FileHandle libhacHandle, path.ToU8Span(), (LibHac.Fs.OpenMode)openMode);
|
||||
handle = new(libhacHandle);
|
||||
|
||||
return result.ToHorizonResult();
|
||||
return result.Horizon;
|
||||
}
|
||||
|
||||
public Result QueryMountSystemDataCacheSize(out long size, ulong dataId)
|
||||
|
@ -103,7 +103,7 @@ namespace Ryujinx.HLE.HOS
|
|||
|
||||
public Result ReadFile(FileHandle handle, long offset, Span<byte> destination)
|
||||
{
|
||||
return _fsClient.ReadFile((LibHac.Fs.FileHandle)handle.Value, offset, destination).ToHorizonResult();
|
||||
return _fsClient.ReadFile((LibHac.Fs.FileHandle)handle.Value, offset, destination).Horizon;
|
||||
}
|
||||
|
||||
public void Unmount(string mountName)
|
||||
|
|
|
@ -52,7 +52,7 @@ namespace Ryujinx.Horizon.Bcat.Ipc
|
|||
service = null;
|
||||
}
|
||||
|
||||
return resultCode.ToHorizonResult();
|
||||
return resultCode.Horizon;
|
||||
}
|
||||
|
||||
[CmifCommand(2)]
|
||||
|
@ -71,7 +71,7 @@ namespace Ryujinx.Horizon.Bcat.Ipc
|
|||
service = null;
|
||||
}
|
||||
|
||||
return resultCode.ToHorizonResult();
|
||||
return resultCode.Horizon;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
|
|
|
@ -22,19 +22,19 @@ namespace Ryujinx.Horizon.Bcat.Ipc
|
|||
[CmifCommand(0)]
|
||||
public Result Open(DirectoryName directoryName)
|
||||
{
|
||||
return _libHacService.Get.Open(ref directoryName).ToHorizonResult();
|
||||
return _libHacService.Get.Open(ref directoryName).Horizon;
|
||||
}
|
||||
|
||||
[CmifCommand(1)]
|
||||
public Result Read(out int entriesRead, [Buffer(HipcBufferFlags.Out | HipcBufferFlags.MapAlias)] Span<DeliveryCacheDirectoryEntry> entriesBuffer)
|
||||
{
|
||||
return _libHacService.Get.Read(out entriesRead, entriesBuffer).ToHorizonResult();
|
||||
return _libHacService.Get.Read(out entriesRead, entriesBuffer).Horizon;
|
||||
}
|
||||
|
||||
[CmifCommand(2)]
|
||||
public Result GetCount(out int count)
|
||||
{
|
||||
return _libHacService.Get.GetCount(out count).ToHorizonResult();
|
||||
return _libHacService.Get.GetCount(out count).Horizon;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
|
|
|
@ -22,25 +22,25 @@ namespace Ryujinx.Horizon.Bcat.Ipc
|
|||
[CmifCommand(0)]
|
||||
public Result Open(DirectoryName directoryName, FileName fileName)
|
||||
{
|
||||
return _libHacService.Get.Open(ref directoryName, ref fileName).ToHorizonResult();
|
||||
return _libHacService.Get.Open(ref directoryName, ref fileName).Horizon;
|
||||
}
|
||||
|
||||
[CmifCommand(1)]
|
||||
public Result Read(long offset, out long bytesRead, [Buffer(HipcBufferFlags.Out | HipcBufferFlags.MapAlias)] Span<byte> data)
|
||||
{
|
||||
return _libHacService.Get.Read(out bytesRead, offset, data).ToHorizonResult();
|
||||
return _libHacService.Get.Read(out bytesRead, offset, data).Horizon;
|
||||
}
|
||||
|
||||
[CmifCommand(2)]
|
||||
public Result GetSize(out long size)
|
||||
{
|
||||
return _libHacService.Get.GetSize(out size).ToHorizonResult();
|
||||
return _libHacService.Get.GetSize(out size).Horizon;
|
||||
}
|
||||
|
||||
[CmifCommand(3)]
|
||||
public Result GetDigest(out Digest digest)
|
||||
{
|
||||
return _libHacService.Get.GetDigest(out digest).ToHorizonResult();
|
||||
return _libHacService.Get.GetDigest(out digest).Horizon;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace Ryujinx.Horizon.Bcat.Ipc
|
|||
service = null;
|
||||
}
|
||||
|
||||
return resultCode.ToHorizonResult();
|
||||
return resultCode.Horizon;
|
||||
}
|
||||
|
||||
[CmifCommand(1)]
|
||||
|
@ -54,13 +54,13 @@ namespace Ryujinx.Horizon.Bcat.Ipc
|
|||
service = null;
|
||||
}
|
||||
|
||||
return resultCode.ToHorizonResult();
|
||||
return resultCode.Horizon;
|
||||
}
|
||||
|
||||
[CmifCommand(10)]
|
||||
public Result EnumerateDeliveryCacheDirectory(out int count, [Buffer(HipcBufferFlags.Out | HipcBufferFlags.MapAlias)] Span<DirectoryName> directoryNames)
|
||||
{
|
||||
return _libHacService.Get.EnumerateDeliveryCacheDirectory(out count, directoryNames).ToHorizonResult();
|
||||
return _libHacService.Get.EnumerateDeliveryCacheDirectory(out count, directoryNames).Horizon;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
|
|
|
@ -4,9 +4,9 @@ namespace Ryujinx.Horizon
|
|||
{
|
||||
public static class LibHacResultExtensions
|
||||
{
|
||||
public static Result ToHorizonResult(this LibHac.Result result)
|
||||
extension(LibHac.Result libHacResult)
|
||||
{
|
||||
return new Result((int)result.Module, (int)result.Description);
|
||||
public Result Horizon => new((int)libHacResult.Module, (int)libHacResult.Description);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue