mirror of
https://github.com/Thealexbarney/LibHac.git
synced 2025-02-09 13:14:46 +01:00
Merge pull request #117 from Thealexbarney/result-codegen
- Define Results in a .csv file and generate C# code from that. - Add a default Result name resolver to get a name from a Result value. - Generate XML doc summaries for Results.
This commit is contained in:
commit
88acededb1
2
.gitignore
vendored
2
.gitignore
vendored
@ -266,3 +266,5 @@ global.json
|
||||
|
||||
!tests/LibHac.Tests/CryptoTests/TestVectors/*
|
||||
**/DisasmoBin/
|
||||
|
||||
ResultNameResolver.Generated.cs
|
@ -8,6 +8,7 @@ using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using ICSharpCode.SharpZipLib.Zip;
|
||||
using LibHacBuild.CodeGen;
|
||||
using Nuke.Common;
|
||||
using Nuke.Common.CI.AppVeyor;
|
||||
using Nuke.Common.Git;
|
||||
@ -181,8 +182,14 @@ namespace LibHacBuild
|
||||
DotNetRestore(s => settings);
|
||||
});
|
||||
|
||||
Target Codegen => _ => _
|
||||
.Executes(() =>
|
||||
{
|
||||
ResultCodeGen.Run();
|
||||
});
|
||||
|
||||
Target Compile => _ => _
|
||||
.DependsOn(Restore, SetVersion)
|
||||
.DependsOn(Restore, SetVersion, Codegen)
|
||||
.Executes(() =>
|
||||
{
|
||||
DotNetBuildSettings buildSettings = new DotNetBuildSettings()
|
||||
|
89
build/CodeGen/IndentingStringBuilder.cs
Normal file
89
build/CodeGen/IndentingStringBuilder.cs
Normal file
@ -0,0 +1,89 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
namespace LibHacBuild.CodeGen
|
||||
{
|
||||
public class IndentingStringBuilder
|
||||
{
|
||||
public int LevelSize { get; set; } = 4;
|
||||
public int Level { get; private set; }
|
||||
|
||||
private StringBuilder _sb = new StringBuilder();
|
||||
private string _indentation = string.Empty;
|
||||
private bool _hasIndentedCurrentLine;
|
||||
private bool _lastLineWasEmpty;
|
||||
|
||||
public IndentingStringBuilder() { }
|
||||
public IndentingStringBuilder(int levelSize) => LevelSize = levelSize;
|
||||
|
||||
public void SetLevel(int level)
|
||||
{
|
||||
Level = Math.Max(level, 0);
|
||||
_indentation = new string(' ', Level * LevelSize);
|
||||
}
|
||||
|
||||
public void IncreaseLevel() => SetLevel(Level + 1);
|
||||
public void DecreaseLevel() => SetLevel(Level - 1);
|
||||
|
||||
public IndentingStringBuilder AppendLine()
|
||||
{
|
||||
_sb.AppendLine();
|
||||
_hasIndentedCurrentLine = false;
|
||||
_lastLineWasEmpty = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IndentingStringBuilder AppendSpacerLine()
|
||||
{
|
||||
if (!_lastLineWasEmpty)
|
||||
{
|
||||
_sb.AppendLine();
|
||||
_hasIndentedCurrentLine = false;
|
||||
_lastLineWasEmpty = true;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public IndentingStringBuilder AppendLine(string value)
|
||||
{
|
||||
IndentIfNeeded();
|
||||
_sb.AppendLine(value);
|
||||
_hasIndentedCurrentLine = false;
|
||||
_lastLineWasEmpty = string.IsNullOrWhiteSpace(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public IndentingStringBuilder Append(string value)
|
||||
{
|
||||
IndentIfNeeded();
|
||||
_sb.Append(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public IndentingStringBuilder AppendLineAndIncrease(string value)
|
||||
{
|
||||
AppendLine(value);
|
||||
IncreaseLevel();
|
||||
return this;
|
||||
}
|
||||
|
||||
public IndentingStringBuilder DecreaseAndAppendLine(string value)
|
||||
{
|
||||
DecreaseLevel();
|
||||
AppendLine(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
private void IndentIfNeeded()
|
||||
{
|
||||
if (!_hasIndentedCurrentLine)
|
||||
{
|
||||
_sb.Append(_indentation);
|
||||
_hasIndentedCurrentLine = true;
|
||||
}
|
||||
}
|
||||
|
||||
public override string ToString() => _sb.ToString();
|
||||
}
|
||||
}
|
584
build/CodeGen/ResultCodegen.cs
Normal file
584
build/CodeGen/ResultCodegen.cs
Normal file
@ -0,0 +1,584 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using CsvHelper;
|
||||
using CsvHelper.Configuration;
|
||||
using Nuke.Common;
|
||||
|
||||
namespace LibHacBuild.CodeGen
|
||||
{
|
||||
public static class ResultCodeGen
|
||||
{
|
||||
// RyuJIT will always be inlined a function if its CIL size is <= 0x10 bytes
|
||||
private const int InlineThreshold = 0x10;
|
||||
|
||||
public static void Run()
|
||||
{
|
||||
ModuleInfo[] modules = ReadResults();
|
||||
|
||||
SetEmptyResultValues(modules);
|
||||
ValidateResults(modules);
|
||||
ValidateHierarchy(modules);
|
||||
CheckIfAggressiveInliningNeeded(modules);
|
||||
|
||||
foreach (ModuleInfo module in modules)
|
||||
{
|
||||
string moduleResultFile = PrintModule(module);
|
||||
|
||||
WriteOutput(module.Path, moduleResultFile);
|
||||
}
|
||||
|
||||
byte[] archive = BuildArchive(modules);
|
||||
string archiveStr = PrintArchive(archive);
|
||||
WriteOutput("LibHac/ResultNameResolver.Generated.cs", archiveStr);
|
||||
}
|
||||
|
||||
private static ModuleInfo[] ReadResults()
|
||||
{
|
||||
ModuleIndex[] moduleNames = ReadCsv<ModuleIndex>("result_modules.csv");
|
||||
ModulePath[] modulePaths = ReadCsv<ModulePath>("result_paths.csv");
|
||||
ResultInfo[] results = ReadCsv<ResultInfo>("results.csv");
|
||||
|
||||
var modules = new Dictionary<string, ModuleInfo>();
|
||||
|
||||
foreach (ModuleIndex name in moduleNames)
|
||||
{
|
||||
var module = new ModuleInfo();
|
||||
module.Name = name.Name;
|
||||
module.Index = name.Index;
|
||||
|
||||
modules.Add(name.Name, module);
|
||||
}
|
||||
|
||||
foreach (ModulePath path in modulePaths)
|
||||
{
|
||||
ModuleInfo module = modules[path.Name];
|
||||
module.Namespace = path.Namespace;
|
||||
module.Path = path.Path;
|
||||
}
|
||||
|
||||
foreach (ModuleInfo module in modules.Values)
|
||||
{
|
||||
module.Results = results.Where(x => x.Module == module.Index).OrderBy(x => x.DescriptionStart)
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
return modules.Values.ToArray();
|
||||
}
|
||||
|
||||
private static void SetEmptyResultValues(ModuleInfo[] modules)
|
||||
{
|
||||
foreach (ModuleInfo module in modules)
|
||||
{
|
||||
foreach (ResultInfo result in module.Results)
|
||||
{
|
||||
result.FullName = $"Result{module.Name}{result.Name}";
|
||||
|
||||
if (string.IsNullOrWhiteSpace(result.Name))
|
||||
{
|
||||
if (result.IsRange)
|
||||
{
|
||||
result.Name += $"Range{result.DescriptionStart}To{result.DescriptionEnd}";
|
||||
}
|
||||
else
|
||||
{
|
||||
result.Name = $"Result{result.DescriptionStart}";
|
||||
result.DescriptionEnd = result.DescriptionStart;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void ValidateResults(ModuleInfo[] modules)
|
||||
{
|
||||
foreach (ModuleInfo module in modules)
|
||||
{
|
||||
foreach (ResultInfo result in module.Results)
|
||||
{
|
||||
// Logic should match Result.Base.ctor
|
||||
Assert(1 <= result.Module && result.Module < 512, "Invalid Module");
|
||||
Assert(0 <= result.DescriptionStart && result.DescriptionStart < 8192, "Invalid Description Start");
|
||||
Assert(0 <= result.DescriptionEnd && result.DescriptionEnd < 8192, "Invalid Description End");
|
||||
Assert(result.DescriptionStart <= result.DescriptionEnd, "descriptionStart must be <= descriptionEnd");
|
||||
|
||||
// ReSharper disable once ParameterOnlyUsedForPreconditionCheck.Local
|
||||
void Assert(bool condition, string message)
|
||||
{
|
||||
if (!condition)
|
||||
throw new InvalidDataException($"Result {result.Module}-{result.DescriptionStart}: {message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void ValidateHierarchy(ModuleInfo[] modules)
|
||||
{
|
||||
foreach (ModuleInfo module in modules)
|
||||
{
|
||||
var hierarchy = new Stack<ResultInfo>();
|
||||
|
||||
foreach (ResultInfo result in module.Results)
|
||||
{
|
||||
while (hierarchy.Count > 0 && hierarchy.Peek().DescriptionEnd < result.DescriptionStart)
|
||||
{
|
||||
hierarchy.Pop();
|
||||
}
|
||||
|
||||
if (result.IsRange)
|
||||
{
|
||||
if (hierarchy.Count > 0 && result.DescriptionEnd > hierarchy.Peek().DescriptionEnd)
|
||||
{
|
||||
throw new InvalidDataException($"Result {result.Module}-{result.DescriptionStart} is not nested properly.");
|
||||
}
|
||||
|
||||
hierarchy.Push(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void CheckIfAggressiveInliningNeeded(ModuleInfo[] modules)
|
||||
{
|
||||
foreach (ModuleInfo module in modules)
|
||||
{
|
||||
module.NeedsAggressiveInlining = module.Results.Any(x => EstimateCilSize(x) > InlineThreshold);
|
||||
}
|
||||
}
|
||||
|
||||
private static string PrintModule(ModuleInfo module)
|
||||
{
|
||||
var sb = new IndentingStringBuilder();
|
||||
|
||||
sb.AppendLine(GetHeader());
|
||||
sb.AppendLine();
|
||||
|
||||
if (module.NeedsAggressiveInlining)
|
||||
{
|
||||
sb.AppendLine("using System.Runtime.CompilerServices;");
|
||||
sb.AppendLine();
|
||||
}
|
||||
|
||||
sb.AppendLine($"namespace {module.Namespace}");
|
||||
sb.AppendLineAndIncrease("{");
|
||||
|
||||
sb.AppendLine($"public static class Result{module.Name}");
|
||||
sb.AppendLineAndIncrease("{");
|
||||
|
||||
sb.AppendLine($"public const int Module{module.Name} = {module.Index};");
|
||||
sb.AppendLine();
|
||||
|
||||
var hierarchy = new Stack<ResultInfo>();
|
||||
bool justIndented = false;
|
||||
|
||||
foreach (ResultInfo result in module.Results)
|
||||
{
|
||||
while (hierarchy.Count > 0 && hierarchy.Peek().DescriptionEnd < result.DescriptionStart)
|
||||
{
|
||||
hierarchy.Pop();
|
||||
sb.DecreaseLevel();
|
||||
sb.AppendSpacerLine();
|
||||
}
|
||||
|
||||
if (!justIndented && result.IsRange)
|
||||
{
|
||||
sb.AppendSpacerLine();
|
||||
}
|
||||
|
||||
PrintResult(sb, module.Name, result);
|
||||
|
||||
if (result.IsRange)
|
||||
{
|
||||
hierarchy.Push(result);
|
||||
sb.IncreaseLevel();
|
||||
}
|
||||
|
||||
justIndented = result.IsRange;
|
||||
}
|
||||
|
||||
while (hierarchy.Count > 0)
|
||||
{
|
||||
hierarchy.Pop();
|
||||
sb.DecreaseLevel();
|
||||
}
|
||||
|
||||
sb.DecreaseAndAppendLine("}");
|
||||
sb.DecreaseAndAppendLine("}");
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
private static void PrintResult(IndentingStringBuilder sb, string moduleName, ResultInfo result)
|
||||
{
|
||||
string descriptionArgs;
|
||||
|
||||
if (result.IsRange)
|
||||
{
|
||||
descriptionArgs = $"{result.DescriptionStart}, {result.DescriptionEnd}";
|
||||
}
|
||||
else
|
||||
{
|
||||
descriptionArgs = $"{result.DescriptionStart}";
|
||||
}
|
||||
|
||||
sb.AppendLine(GetXmlDoc(result));
|
||||
|
||||
string resultCtor = $"new Result.Base(Module{moduleName}, {descriptionArgs});";
|
||||
sb.Append($"public static Result.Base {result.Name} ");
|
||||
|
||||
if (EstimateCilSize(result) > InlineThreshold)
|
||||
{
|
||||
sb.AppendLine($"{{ [MethodImpl(MethodImplOptions.AggressiveInlining)] get => {resultCtor} }}");
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.AppendLine($"=> {resultCtor}");
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetXmlDoc(ResultInfo result)
|
||||
{
|
||||
string doc = "/// <summary>";
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(result.Summary))
|
||||
{
|
||||
doc += $"{result.Summary}<br/>";
|
||||
}
|
||||
|
||||
doc += $"Error code: {result.ErrorCode}";
|
||||
|
||||
if (result.IsRange)
|
||||
{
|
||||
doc += $"; Range: {result.DescriptionStart}-{result.DescriptionEnd}";
|
||||
}
|
||||
|
||||
doc += $"; Inner value: 0x{result.InnerValue:x}";
|
||||
doc += "</summary>";
|
||||
|
||||
return doc;
|
||||
}
|
||||
|
||||
private static string GetHeader()
|
||||
{
|
||||
string nl = Environment.NewLine;
|
||||
return
|
||||
"//-----------------------------------------------------------------------------" + nl +
|
||||
"// This file was automatically generated." + nl +
|
||||
"// Changes to this file will be lost when the file is regenerated." + nl +
|
||||
"//" + nl +
|
||||
"// To change this file, modify /build/CodeGen/results.csv at the root of this" + nl +
|
||||
"// repo and run the build script." + nl +
|
||||
"//" + nl +
|
||||
"// The script can be run with the \"codegen\" option to run only the" + nl +
|
||||
"// code generation portion of the build." + nl +
|
||||
"//-----------------------------------------------------------------------------";
|
||||
}
|
||||
|
||||
// Write the file only if it has changed
|
||||
// Preserve the UTF-8 BOM usage if the file already exists
|
||||
private static void WriteOutput(string relativePath, string text)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(relativePath))
|
||||
return;
|
||||
|
||||
string rootPath = FindProjectDirectory();
|
||||
string fullPath = Path.Combine(rootPath, relativePath);
|
||||
|
||||
// Default is true because Visual Studio saves .cs files with the BOM by default
|
||||
bool hasBom = true;
|
||||
byte[] bom = Encoding.UTF8.GetPreamble();
|
||||
byte[] oldFile = null;
|
||||
|
||||
if (File.Exists(fullPath))
|
||||
{
|
||||
oldFile = File.ReadAllBytes(fullPath);
|
||||
|
||||
if (oldFile.Length >= 3)
|
||||
hasBom = oldFile.AsSpan(0, 3).SequenceEqual(bom);
|
||||
}
|
||||
|
||||
byte[] newFile = (hasBom ? bom : new byte[0]).Concat(Encoding.UTF8.GetBytes(text)).ToArray();
|
||||
|
||||
if (oldFile?.SequenceEqual(newFile) == true)
|
||||
{
|
||||
Logger.Normal($"{relativePath} is already up-to-date");
|
||||
return;
|
||||
}
|
||||
|
||||
Logger.Normal($"Generated file {relativePath}");
|
||||
File.WriteAllBytes(fullPath, newFile);
|
||||
}
|
||||
|
||||
private static byte[] BuildArchive(ModuleInfo[] modules)
|
||||
{
|
||||
var builder = new ResultArchiveBuilder();
|
||||
|
||||
foreach (ModuleInfo module in modules.OrderBy(x => x.Index))
|
||||
{
|
||||
foreach (ResultInfo result in module.Results.OrderBy(x => x.DescriptionStart))
|
||||
{
|
||||
builder.Add(result);
|
||||
}
|
||||
}
|
||||
|
||||
return builder.Build();
|
||||
}
|
||||
|
||||
private static string PrintArchive(ReadOnlySpan<byte> data)
|
||||
{
|
||||
var sb = new IndentingStringBuilder();
|
||||
|
||||
sb.AppendLine(GetHeader());
|
||||
sb.AppendLine();
|
||||
|
||||
sb.AppendLine("using System;");
|
||||
sb.AppendLine();
|
||||
|
||||
sb.AppendLine("namespace LibHac");
|
||||
sb.AppendLineAndIncrease("{");
|
||||
|
||||
sb.AppendLine("internal partial class ResultNameResolver");
|
||||
sb.AppendLineAndIncrease("{");
|
||||
|
||||
sb.AppendLine("private static ReadOnlySpan<byte> ArchiveData => new byte[]");
|
||||
sb.AppendLineAndIncrease("{");
|
||||
|
||||
for (int i = 0; i < data.Length; i++)
|
||||
{
|
||||
if (i % 16 != 0) sb.Append(" ");
|
||||
sb.Append($"0x{data[i]:x2}");
|
||||
|
||||
if (i != data.Length - 1)
|
||||
{
|
||||
sb.Append(",");
|
||||
if (i % 16 == 15) sb.AppendLine();
|
||||
}
|
||||
}
|
||||
|
||||
sb.AppendLine();
|
||||
sb.DecreaseAndAppendLine("};");
|
||||
sb.DecreaseAndAppendLine("}");
|
||||
sb.DecreaseAndAppendLine("}");
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
private static T[] ReadCsv<T>(string name)
|
||||
{
|
||||
using (var csv = new CsvReader(new StreamReader(GetResource(name)), CultureInfo.InvariantCulture))
|
||||
{
|
||||
csv.Configuration.AllowComments = true;
|
||||
|
||||
if (typeof(T) == typeof(ResultInfo))
|
||||
{
|
||||
csv.Configuration.RegisterClassMap<ResultMap>();
|
||||
}
|
||||
|
||||
return csv.GetRecords<T>().ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
private static Stream GetResource(string name)
|
||||
{
|
||||
var assembly = Assembly.GetExecutingAssembly();
|
||||
string path = $"LibHacBuild.CodeGen.{name}";
|
||||
|
||||
Stream stream = assembly.GetManifestResourceStream(path);
|
||||
if (stream == null) throw new FileNotFoundException($"Resource {path} was not found.");
|
||||
|
||||
return stream;
|
||||
}
|
||||
|
||||
private static string FindProjectDirectory()
|
||||
{
|
||||
string currentDir = Environment.CurrentDirectory;
|
||||
|
||||
while (currentDir != null)
|
||||
{
|
||||
if (File.Exists(Path.Combine(currentDir, "LibHac.sln")))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
currentDir = Path.GetDirectoryName(currentDir);
|
||||
}
|
||||
|
||||
if (currentDir == null)
|
||||
throw new DirectoryNotFoundException("Unable to find project directory.");
|
||||
|
||||
return Path.Combine(currentDir, "src");
|
||||
}
|
||||
|
||||
private static int EstimateCilSize(ResultInfo result)
|
||||
{
|
||||
int size = 0;
|
||||
|
||||
size += GetLoadSize(result.Module);
|
||||
size += GetLoadSize(result.DescriptionStart);
|
||||
|
||||
if (result.IsRange)
|
||||
size += GetLoadSize(result.DescriptionEnd);
|
||||
|
||||
size += 5; // newobj
|
||||
size += 1; // ret
|
||||
|
||||
return size;
|
||||
|
||||
static int GetLoadSize(int value)
|
||||
{
|
||||
if (value >= -1 && value <= 8)
|
||||
return 1; // ldc.i4.X
|
||||
|
||||
if (value >= sbyte.MinValue && value <= sbyte.MaxValue)
|
||||
return 2; // ldc.i4.s XX
|
||||
|
||||
return 5; // ldc.i4 XXXXXXXX
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ResultArchiveBuilder
|
||||
{
|
||||
private List<ResultInfo> Results = new List<ResultInfo>();
|
||||
|
||||
public void Add(ResultInfo result)
|
||||
{
|
||||
Results.Add(result);
|
||||
}
|
||||
|
||||
public byte[] Build()
|
||||
{
|
||||
int tableOffset = CalculateNameTableOffset();
|
||||
var archive = new byte[tableOffset + CalculateNameTableSize()];
|
||||
|
||||
ref HeaderStruct header = ref Unsafe.As<byte, HeaderStruct>(ref archive[0]);
|
||||
Span<Element> elements = MemoryMarshal.Cast<byte, Element>(
|
||||
archive.AsSpan(Unsafe.SizeOf<HeaderStruct>(), Results.Count * Unsafe.SizeOf<Element>()));
|
||||
Span<byte> nameTable = archive.AsSpan(tableOffset);
|
||||
|
||||
header.ElementCount = Results.Count;
|
||||
header.NameTableOffset = tableOffset;
|
||||
|
||||
int curNameOffset = 0;
|
||||
|
||||
for (int i = 0; i < Results.Count; i++)
|
||||
{
|
||||
ResultInfo result = Results[i];
|
||||
ref Element element = ref elements[i];
|
||||
|
||||
element.NameOffset = curNameOffset;
|
||||
element.Module = (short)result.Module;
|
||||
element.DescriptionStart = (short)result.DescriptionStart;
|
||||
element.DescriptionEnd = (short)result.DescriptionEnd;
|
||||
|
||||
Span<byte> utf8Name = Encoding.UTF8.GetBytes(result.FullName);
|
||||
utf8Name.CopyTo(nameTable.Slice(curNameOffset));
|
||||
nameTable[curNameOffset + utf8Name.Length] = 0;
|
||||
|
||||
curNameOffset += utf8Name.Length + 1;
|
||||
}
|
||||
|
||||
return archive;
|
||||
}
|
||||
|
||||
private int CalculateNameTableOffset()
|
||||
{
|
||||
return Unsafe.SizeOf<HeaderStruct>() + Unsafe.SizeOf<Element>() * Results.Count;
|
||||
}
|
||||
|
||||
private int CalculateNameTableSize()
|
||||
{
|
||||
int size = 0;
|
||||
Encoding encoding = Encoding.UTF8;
|
||||
|
||||
foreach (ResultInfo result in Results)
|
||||
{
|
||||
size += encoding.GetByteCount(result.FullName) + 1;
|
||||
}
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
// ReSharper disable NotAccessedField.Local
|
||||
private struct HeaderStruct
|
||||
{
|
||||
public int ElementCount;
|
||||
public int NameTableOffset;
|
||||
}
|
||||
|
||||
private struct Element
|
||||
{
|
||||
public int NameOffset;
|
||||
public short Module;
|
||||
public short DescriptionStart;
|
||||
public short DescriptionEnd;
|
||||
}
|
||||
// ReSharper restore NotAccessedField.Local
|
||||
}
|
||||
|
||||
public class ModuleIndex
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public int Index { get; set; }
|
||||
}
|
||||
|
||||
public class ModulePath
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string Namespace { get; set; }
|
||||
public string Path { get; set; }
|
||||
}
|
||||
|
||||
[DebuggerDisplay("{" + nameof(Name) + ",nq}")]
|
||||
public class ModuleInfo
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public int Index { get; set; }
|
||||
public string Namespace { get; set; }
|
||||
public string Path { get; set; }
|
||||
|
||||
public bool NeedsAggressiveInlining { get; set; }
|
||||
public ResultInfo[] Results { get; set; }
|
||||
}
|
||||
|
||||
[DebuggerDisplay("{" + nameof(Name) + ",nq}")]
|
||||
public class ResultInfo
|
||||
{
|
||||
public int Module { get; set; }
|
||||
public int DescriptionStart { get; set; }
|
||||
public int DescriptionEnd { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string FullName { get; set; }
|
||||
public string Summary { get; set; }
|
||||
|
||||
public bool IsRange => DescriptionStart != DescriptionEnd;
|
||||
public string ErrorCode => $"{2000 + Module:d4}-{DescriptionStart:d4}";
|
||||
public int InnerValue => Module & 0x1ff | ((DescriptionStart & 0x7ffff) << 9);
|
||||
}
|
||||
|
||||
public sealed class ResultMap : ClassMap<ResultInfo>
|
||||
{
|
||||
public ResultMap()
|
||||
{
|
||||
Map(m => m.Module);
|
||||
Map(m => m.Name);
|
||||
Map(m => m.Summary);
|
||||
Map(m => m.DescriptionStart);
|
||||
Map(m => m.DescriptionEnd).ConvertUsing(row =>
|
||||
{
|
||||
string field = row.GetField("DescriptionEnd");
|
||||
if (string.IsNullOrWhiteSpace(field))
|
||||
field = row.GetField("DescriptionStart");
|
||||
|
||||
return int.Parse(field);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
4
build/CodeGen/result_modules.csv
Normal file
4
build/CodeGen/result_modules.csv
Normal file
@ -0,0 +1,4 @@
|
||||
Name,Index
|
||||
Fs,2
|
||||
Kvdb,20
|
||||
Sdmmc,24
|
|
4
build/CodeGen/result_paths.csv
Normal file
4
build/CodeGen/result_paths.csv
Normal file
@ -0,0 +1,4 @@
|
||||
Name,Namespace,Path
|
||||
Fs,LibHac.Fs,LibHac/Fs/ResultFs.cs
|
||||
Kvdb,LibHac.Kvdb,LibHac/Kvdb/ResultKvdb.cs
|
||||
Sdmmc,LibHac.FsService,LibHac/FsService/ResultSdmmc.cs
|
|
247
build/CodeGen/results.csv
Normal file
247
build/CodeGen/results.csv
Normal file
@ -0,0 +1,247 @@
|
||||
Module,DescriptionStart,DescriptionEnd,Name,Summary
|
||||
2,0,999,HandledByAllProcess,
|
||||
2,1,,PathNotFound,Specified path does not exist
|
||||
2,2,,PathAlreadyExists,Specified path already exists
|
||||
2,7,,TargetLocked,Resource already in use (file already opened, savedata filesystem already mounted)
|
||||
2,8,,DirectoryNotEmpty,Specified directory is not empty when trying to delete it
|
||||
2,13,,DirectoryStatusChanged,
|
||||
|
||||
2,30,45,InsufficientFreeSpace,
|
||||
2,31,,UsableSpaceNotEnoughForSaveData,
|
||||
2,34,38,InsufficientFreeSpaceBis,
|
||||
2,35,,InsufficientFreeSpaceBisCalibration,
|
||||
2,36,,InsufficientFreeSpaceBisSafe,
|
||||
2,37,,InsufficientFreeSpaceBisUser,
|
||||
2,38,,InsufficientFreeSpaceBisSystem,
|
||||
2,39,,InsufficientFreeSpaceSdCard,
|
||||
2,50,,UnsupportedSdkVersion,
|
||||
2,60,,MountNameAlreadyExists,
|
||||
|
||||
2,1001,,PartitionNotFound,
|
||||
2,1002,,TargetNotFound,
|
||||
2,1004,,ExternalKeyNotFound,The requested external key was not found
|
||||
|
||||
2,2000,2499,SdCardAccessFailed,
|
||||
2,2001,,SdCardNotFound,
|
||||
2,2004,,SdCardAsleep,
|
||||
|
||||
2,2500,2999,GameCardAccessFailed,
|
||||
2,2503,,InvalidBufferForGameCard,
|
||||
2,2520,,GameCardNotInserted,
|
||||
2,2951,,GameCardNotInsertedOnGetHandle,
|
||||
2,2952,,InvalidGameCardHandleOnRead,
|
||||
2,2954,,InvalidGameCardHandleOnGetCardInfo,
|
||||
2,2960,,InvalidGameCardHandleOnOpenNormalPartition,
|
||||
2,2961,,InvalidGameCardHandleOnOpenSecurePartition,
|
||||
|
||||
2,3001,,NotImplemented,
|
||||
2,3002,,UnsupportedVersion,
|
||||
2,3003,,SaveDataPathAlreadyExists,
|
||||
2,3005,,OutOfRange,
|
||||
|
||||
2,3200,3499,AllocationMemoryFailed,
|
||||
2,3312,,AesXtsFileFileStorageAllocationError,
|
||||
2,3313,,AesXtsFileXtsStorageAllocationError,
|
||||
2,3314,,AesXtsFileAlignmentStorageAllocationError,
|
||||
2,3315,,AesXtsFileStorageFileAllocationError,
|
||||
2,3383,,AesXtsFileSubStorageAllocationError,
|
||||
|
||||
2,3500,3999,MmcAccessFailed,
|
||||
|
||||
2,4000,4999,DataCorrupted,
|
||||
2,4001,4299,RomCorrupted,
|
||||
2,4023,,InvalidIndirectStorageSource,
|
||||
|
||||
2,4241,4259,RomHostFileSystemCorrupted,
|
||||
2,4242,,RomHostEntryCorrupted,
|
||||
2,4243,,RomHostFileDataCorrupted,
|
||||
2,4244,,RomHostFileCorrupted,
|
||||
2,4245,,InvalidRomHostHandle,
|
||||
|
||||
2,4301,4499,SaveDataCorrupted,
|
||||
2,4302,,UnsupportedSaveVersion,
|
||||
2,4303,,InvalidSaveDataEntryType,
|
||||
2,4315,,InvalidSaveDataHeader,
|
||||
2,4362,,InvalidSaveDataIvfcMagic,
|
||||
2,4363,,InvalidSaveDataIvfcHashValidationBit,
|
||||
2,4364,,InvalidSaveDataIvfcHash,
|
||||
2,4372,,EmptySaveDataIvfcHash,
|
||||
2,4373,,InvalidSaveDataHashInIvfcTopLayer,
|
||||
|
||||
2,4402,,SaveDataInvalidGptPartitionSignature,
|
||||
2,4427,,IncompleteBlockInZeroBitmapHashStorageFileSaveData,
|
||||
2,4441,4459,SaveDataHostFileSystemCorrupted,
|
||||
2,4442,,SaveDataHostEntryCorrupted,
|
||||
2,4443,,SaveDataHostFileDataCorrupted,
|
||||
2,4444,,SaveDataHostFileCorrupted,
|
||||
2,4445,,InvalidSaveDataHostHandle,
|
||||
|
||||
2,4462,,SaveDataAllocationTableCorrupted,
|
||||
2,4463,,SaveDataFileTableCorrupted,
|
||||
2,4464,,AllocationTableIteratedRangeEntry,
|
||||
|
||||
2,4501,4599,NcaCorrupted,
|
||||
|
||||
2,4601,4639,IntegrityVerificationStorageCorrupted,
|
||||
2,4602,,InvalidIvfcMagic,
|
||||
2,4603,,InvalidIvfcHashValidationBit,
|
||||
2,4604,,InvalidIvfcHash,
|
||||
2,4612,,EmptyIvfcHash,
|
||||
2,4613,,InvalidHashInIvfcTopLayer,
|
||||
|
||||
2,4641,4659,PartitionFileSystemCorrupted,
|
||||
2,4642,,InvalidPartitionFileSystemHashOffset,
|
||||
2,4643,,InvalidPartitionFileSystemHash,
|
||||
2,4644,,InvalidPartitionFileSystemMagic,
|
||||
2,4645,,InvalidHashedPartitionFileSystemMagic,
|
||||
2,4646,,InvalidPartitionFileSystemEntryNameOffset,
|
||||
|
||||
2,4661,4679,BuiltInStorageCorrupted,
|
||||
2,4662,,InvalidGptPartitionSignature,
|
||||
|
||||
2,4681,4699,FatFileSystemCorrupted,
|
||||
|
||||
2,4701,4719,HostFileSystemCorrupted,
|
||||
2,4702,,HostEntryCorrupted,
|
||||
2,4703,,HostFileDataCorrupted,
|
||||
2,4704,,HostFileCorrupted,
|
||||
2,4705,,InvalidHostHandle,
|
||||
|
||||
2,4721,4739,DatabaseCorrupted,
|
||||
2,4722,,SaveDataAllocationTableCorruptedInternal,
|
||||
2,4723,,SaveDataFileTableCorruptedInternal,
|
||||
2,4724,,AllocationTableIteratedRangeEntryInternal,
|
||||
|
||||
2,4741,4759,AesXtsFileSystemCorrupted,
|
||||
2,4742,,AesXtsFileHeaderTooShort,
|
||||
2,4743,,AesXtsFileHeaderInvalidKeys,
|
||||
2,4744,,AesXtsFileHeaderInvalidMagic,
|
||||
2,4745,,AesXtsFileTooShort,
|
||||
2,4746,,AesXtsFileHeaderTooShortInSetSize,
|
||||
2,4747,,AesXtsFileHeaderInvalidKeysInRenameFile,
|
||||
2,4748,,AesXtsFileHeaderInvalidKeysInSetSize,
|
||||
|
||||
2,4761,4769,SaveDataTransferDataCorrupted,
|
||||
2,4771,4779,SignedSystemPartitionDataCorrupted,
|
||||
2,4781,,GameCardLogoDataCorrupted,
|
||||
|
||||
# The range name is a guess. 4812 is currently the only result in it
|
||||
2,4811,4819,ZeroBitmapFileCorrupted,
|
||||
2,4812,,IncompleteBlockInZeroBitmapHashStorageFile,
|
||||
|
||||
2,5000,5999,Unexpected,
|
||||
2,5307,,UnexpectedErrorInHostFileFlush,
|
||||
2,5308,,UnexpectedErrorInHostFileGetSize,
|
||||
2,5309,,UnknownHostFileSystemError,
|
||||
2,5320,,InvalidNcaMountPoint,
|
||||
|
||||
2,6000,6499,PreconditionViolation,
|
||||
2,6001,6199,InvalidArgument,
|
||||
2,6002,6029,InvalidPath,
|
||||
2,6003,,TooLongPath,
|
||||
2,6004,,InvalidCharacter,
|
||||
2,6005,,InvalidPathFormat,
|
||||
2,6006,,DirectoryUnobtainable,
|
||||
2,6007,,NotNormalized,
|
||||
|
||||
2,6030,6059,InvalidPathForOperation,
|
||||
2,6031,,DirectoryNotDeletable,
|
||||
2,6032,,DestinationIsSubPathOfSource,
|
||||
2,6033,,PathNotFoundInSaveDataFileTable,
|
||||
2,6034,,DifferentDestFileSystem,
|
||||
|
||||
2,6061,,InvalidOffset,
|
||||
2,6062,,InvalidSize,
|
||||
2,6063,,NullArgument,
|
||||
2,6065,,InvalidMountName,
|
||||
2,6066,,ExtensionSizeTooLarge,
|
||||
2,6067,,ExtensionSizeInvalid,
|
||||
2,6068,,ReadOldSaveDataInfoReader,
|
||||
|
||||
2,6080,6099,InvalidEnumValue,
|
||||
2,6081,,InvalidSaveDataState,
|
||||
2,6082,,InvalidSaveDataSpaceId,
|
||||
|
||||
2,6200,6299,InvalidOperationForOpenMode,
|
||||
2,6201,,FileExtensionWithoutOpenModeAllowAppend,
|
||||
2,6202,,InvalidOpenModeForRead,
|
||||
2,6203,,InvalidOpenModeForWrite,
|
||||
|
||||
2,6300,6399,UnsupportedOperation,
|
||||
2,6302,,SubStorageNotResizable,
|
||||
2,6303,,SubStorageNotResizableMiddleOfFile,
|
||||
2,6304,,UnsupportedOperationInMemoryStorageSetSize,
|
||||
2,6306,,UnsupportedOperationInFileStorageOperateRange,
|
||||
2,6310,,UnsupportedOperationInAesCtrExStorageWrite,
|
||||
2,6316,,UnsupportedOperationInHierarchicalIvfcStorageSetSize,
|
||||
2,6324,,UnsupportedOperationInIndirectStorageWrite,
|
||||
2,6325,,UnsupportedOperationInIndirectStorageSetSize,
|
||||
2,6350,,UnsupportedOperationInRoGameCardStorageWrite,
|
||||
2,6351,,UnsupportedOperationInRoGameCardStorageSetSize,
|
||||
2,6359,,UnsupportedOperationInConcatFsQueryEntry,
|
||||
2,6364,,UnsupportedOperationModifyRomFsFileSystem,
|
||||
2,6366,,UnsupportedOperationRomFsFileSystemGetSpace,
|
||||
2,6367,,UnsupportedOperationModifyRomFsFile,
|
||||
2,6369,,UnsupportedOperationModifyReadOnlyFileSystem,
|
||||
2,6371,,UnsupportedOperationReadOnlyFileSystemGetSpace,
|
||||
2,6372,,UnsupportedOperationModifyReadOnlyFile,
|
||||
2,6374,,UnsupportedOperationModifyPartitionFileSystem,
|
||||
2,6376,,UnsupportedOperationInPartitionFileSetSize,
|
||||
2,6377,,UnsupportedOperationIdInPartitionFileSystem,
|
||||
|
||||
2,6400,6449,PermissionDenied,
|
||||
|
||||
2,6452,,ExternalKeyAlreadyRegistered,
|
||||
2,6454,,WriteStateUnflushed,
|
||||
2,6457,,WriteModeFileNotClosed,
|
||||
2,6461,,AllocatorAlignmentViolation,
|
||||
2,6465,,UserNotExist,
|
||||
|
||||
2,6600,6699,EntryNotFound,
|
||||
2,6606,,TargetProgramIndexNotFound,Specified program index is not found
|
||||
2,6700,6799,OutOfResource,
|
||||
2,6706,,MappingTableFull,
|
||||
2,6707,,AllocationTableInsufficientFreeBlocks,
|
||||
2,6709,,OpenCountLimit,
|
||||
|
||||
2,6800,6899,MappingFailed,
|
||||
2,6811,,RemapStorageMapFull,
|
||||
|
||||
2,6900,6999,BadState,
|
||||
2,6902,,SubStorageNotInitialized,
|
||||
2,6905,,NotMounted,
|
||||
2,6906,,SaveDataIsExtending,
|
||||
|
||||
20,1,,TooLargeKeyOrDbFull,
|
||||
20,2,,KeyNotFound,
|
||||
20,4,,AllocationFailed,
|
||||
20,5,,InvalidKeyValue,
|
||||
20,6,,BufferInsufficient,
|
||||
|
||||
24,1,,DeviceNotFound,
|
||||
24,4,,DeviceAsleep,
|
||||
|
||||
123,0,4999,SslService,
|
||||
|
||||
124,0,,Cancelled,
|
||||
124,1,,CancelledByUser,
|
||||
124,100,,UserNotExist,
|
||||
124,200,269,NetworkServiceAccountUnavailable,
|
||||
124,430,499,TokenCacheUnavailable,
|
||||
124,3000,8191,NetworkCommunicationError,
|
||||
|
||||
202,140,149,Invalid,
|
||||
202,601,,DualConnected,
|
||||
202,602,,SameJoyTypeConnected,
|
||||
202,603,,ColorNotAvailable,
|
||||
202,604,,ControllerNotConnected,
|
||||
202,3101,,Canceled,
|
||||
202,3102,,NotSupportedNpadStyle,
|
||||
202,3200,3209,ControllerFirmwareUpdateError,
|
||||
202,3201,,ControllerFirmwareUpdateFailed,
|
||||
|
||||
205,110,119,IrsensorUnavailable,
|
||||
205,110,,IrsensorUnconnected,
|
||||
205,111,,IrsensorUnsupported,
|
||||
205,120,,IrsensorNotReady,
|
||||
205,122,139,IrsensorDeviceError,
|
|
@ -11,6 +11,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageDownload Include="GitVersion.Tool" Version="[5.1.3]" />
|
||||
<PackageReference Include="CsvHelper" Version="15.0.0" />
|
||||
<PackageReference Include="NuGet.CommandLine" Version="5.4.0" />
|
||||
<PackageReference Include="Nuke.Common" Version="0.23.4" />
|
||||
<PackageReference Include="SharpZipLib" Version="1.2.0" />
|
||||
@ -20,6 +21,7 @@
|
||||
<NukeMetadata Include="**\*.json" Exclude="bin\**;obj\**" />
|
||||
<NukeExternalFiles Include="**\*.*.ext" Exclude="bin\**;obj\**" />
|
||||
<None Remove="*.csproj.DotSettings;*.ref.*.txt" />
|
||||
<EmbeddedResource Include="CodeGen\*.csv" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@ -138,7 +138,7 @@ namespace LibHac.Fs.Accessors
|
||||
{
|
||||
if (OpenFiles.Any(x => (x.OpenMode & OpenMode.Write) != 0))
|
||||
{
|
||||
return ResultFs.WritableFileOpen.Log();
|
||||
return ResultFs.WriteModeFileNotClosed.Log();
|
||||
}
|
||||
|
||||
return FileSystem.Commit();
|
||||
|
@ -1,4 +1,15 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
//-----------------------------------------------------------------------------
|
||||
// This file was automatically generated.
|
||||
// Changes to this file will be lost when the file is regenerated.
|
||||
//
|
||||
// To change this file, modify /build/CodeGen/results.csv at the root of this
|
||||
// repo and run the build script.
|
||||
//
|
||||
// The script can be run with the "codegen" option to run only the
|
||||
// code generation portion of the build.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace LibHac.Fs
|
||||
{
|
||||
@ -6,198 +17,399 @@ namespace LibHac.Fs
|
||||
{
|
||||
public const int ModuleFs = 2;
|
||||
|
||||
public static Result.Base PathNotFound => new Result.Base(ModuleFs, 1);
|
||||
public static Result.Base PathAlreadyExists => new Result.Base(ModuleFs, 2);
|
||||
public static Result.Base TargetLocked => new Result.Base(ModuleFs, 7);
|
||||
public static Result.Base DirectoryNotEmpty => new Result.Base(ModuleFs, 8);
|
||||
public static Result.Base InsufficientFreeSpace => new Result.Base(ModuleFs, 30, 45);
|
||||
public static Result.Base InsufficientFreeSpaceBis => new Result.Base(ModuleFs, 34, 38);
|
||||
public static Result.Base InsufficientFreeSpaceBisCalibration => new Result.Base(ModuleFs, 35);
|
||||
public static Result.Base InsufficientFreeSpaceBisSafe => new Result.Base(ModuleFs, 36);
|
||||
public static Result.Base InsufficientFreeSpaceBisUser => new Result.Base(ModuleFs, 37);
|
||||
public static Result.Base InsufficientFreeSpaceBisSystem => new Result.Base(ModuleFs, 38);
|
||||
public static Result.Base InsufficientFreeSpaceSdCard => new Result.Base(ModuleFs, 38);
|
||||
public static Result.Base MountNameAlreadyExists => new Result.Base(ModuleFs, 60);
|
||||
/// <summary>Error code: 2002-0000; Range: 0-999; Inner value: 0x2</summary>
|
||||
public static Result.Base HandledByAllProcess => new Result.Base(ModuleFs, 0, 999);
|
||||
/// <summary>Specified path does not exist<br/>Error code: 2002-0001; Inner value: 0x202</summary>
|
||||
public static Result.Base PathNotFound => new Result.Base(ModuleFs, 1);
|
||||
/// <summary>Specified path already exists<br/>Error code: 2002-0002; Inner value: 0x402</summary>
|
||||
public static Result.Base PathAlreadyExists => new Result.Base(ModuleFs, 2);
|
||||
/// <summary>Resource already in use (file already opened<br/>Error code: 2002-0007; Inner value: 0xe02</summary>
|
||||
public static Result.Base TargetLocked => new Result.Base(ModuleFs, 7);
|
||||
/// <summary>Specified directory is not empty when trying to delete it<br/>Error code: 2002-0008; Inner value: 0x1002</summary>
|
||||
public static Result.Base DirectoryNotEmpty => new Result.Base(ModuleFs, 8);
|
||||
/// <summary>Error code: 2002-0013; Inner value: 0x1a02</summary>
|
||||
public static Result.Base DirectoryStatusChanged => new Result.Base(ModuleFs, 13);
|
||||
|
||||
/// <summary>Error code: 2002-0030; Range: 30-45; Inner value: 0x3c02</summary>
|
||||
public static Result.Base InsufficientFreeSpace => new Result.Base(ModuleFs, 30, 45);
|
||||
/// <summary>Error code: 2002-0031; Inner value: 0x3e02</summary>
|
||||
public static Result.Base UsableSpaceNotEnoughForSaveData => new Result.Base(ModuleFs, 31);
|
||||
|
||||
/// <summary>Error code: 2002-0034; Range: 34-38; Inner value: 0x4402</summary>
|
||||
public static Result.Base InsufficientFreeSpaceBis => new Result.Base(ModuleFs, 34, 38);
|
||||
/// <summary>Error code: 2002-0035; Inner value: 0x4602</summary>
|
||||
public static Result.Base InsufficientFreeSpaceBisCalibration => new Result.Base(ModuleFs, 35);
|
||||
/// <summary>Error code: 2002-0036; Inner value: 0x4802</summary>
|
||||
public static Result.Base InsufficientFreeSpaceBisSafe => new Result.Base(ModuleFs, 36);
|
||||
/// <summary>Error code: 2002-0037; Inner value: 0x4a02</summary>
|
||||
public static Result.Base InsufficientFreeSpaceBisUser => new Result.Base(ModuleFs, 37);
|
||||
/// <summary>Error code: 2002-0038; Inner value: 0x4c02</summary>
|
||||
public static Result.Base InsufficientFreeSpaceBisSystem => new Result.Base(ModuleFs, 38);
|
||||
|
||||
/// <summary>Error code: 2002-0039; Inner value: 0x4e02</summary>
|
||||
public static Result.Base InsufficientFreeSpaceSdCard => new Result.Base(ModuleFs, 39);
|
||||
|
||||
/// <summary>Error code: 2002-0050; Inner value: 0x6402</summary>
|
||||
public static Result.Base UnsupportedSdkVersion => new Result.Base(ModuleFs, 50);
|
||||
/// <summary>Error code: 2002-0060; Inner value: 0x7802</summary>
|
||||
public static Result.Base MountNameAlreadyExists => new Result.Base(ModuleFs, 60);
|
||||
|
||||
/// <summary>Error code: 2002-1001; Inner value: 0x7d202</summary>
|
||||
public static Result.Base PartitionNotFound => new Result.Base(ModuleFs, 1001);
|
||||
/// <summary>Error code: 2002-1002; Inner value: 0x7d402</summary>
|
||||
public static Result.Base TargetNotFound => new Result.Base(ModuleFs, 1002);
|
||||
/// <summary>The requested external key was not found<br/>Error code: 2002-1004; Inner value: 0x7d802</summary>
|
||||
public static Result.Base ExternalKeyNotFound => new Result.Base(ModuleFs, 1004);
|
||||
|
||||
/// <summary>Error code: 2002-2000; Range: 2000-2499; Inner value: 0xfa002</summary>
|
||||
public static Result.Base SdCardAccessFailed { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 2000, 2499); }
|
||||
public static Result.Base SdCardNotFound => new Result.Base(ModuleFs, 2001);
|
||||
public static Result.Base SdCardAsleep => new Result.Base(ModuleFs, 2004);
|
||||
/// <summary>Error code: 2002-2001; Inner value: 0xfa202</summary>
|
||||
public static Result.Base SdCardNotFound => new Result.Base(ModuleFs, 2001);
|
||||
/// <summary>Error code: 2002-2004; Inner value: 0xfa802</summary>
|
||||
public static Result.Base SdCardAsleep => new Result.Base(ModuleFs, 2004);
|
||||
|
||||
/// <summary>Error code: 2002-2500; Range: 2500-2999; Inner value: 0x138802</summary>
|
||||
public static Result.Base GameCardAccessFailed { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 2500, 2999); }
|
||||
public static Result.Base InvalidBufferForGameCard => new Result.Base(ModuleFs, 2503);
|
||||
public static Result.Base GameCardNotInserted => new Result.Base(ModuleFs, 2520);
|
||||
|
||||
public static Result.Base GameCardNotInsertedOnGetHandle => new Result.Base(ModuleFs, 2951);
|
||||
public static Result.Base InvalidGameCardHandleOnRead => new Result.Base(ModuleFs, 2952);
|
||||
public static Result.Base InvalidGameCardHandleOnGetCardInfo => new Result.Base(ModuleFs, 2954);
|
||||
public static Result.Base InvalidGameCardHandleOnOpenNormalPartition => new Result.Base(ModuleFs, 2960);
|
||||
public static Result.Base InvalidGameCardHandleOnOpenSecurePartition => new Result.Base(ModuleFs, 2961);
|
||||
/// <summary>Error code: 2002-2503; Inner value: 0x138e02</summary>
|
||||
public static Result.Base InvalidBufferForGameCard => new Result.Base(ModuleFs, 2503);
|
||||
/// <summary>Error code: 2002-2520; Inner value: 0x13b002</summary>
|
||||
public static Result.Base GameCardNotInserted => new Result.Base(ModuleFs, 2520);
|
||||
/// <summary>Error code: 2002-2951; Inner value: 0x170e02</summary>
|
||||
public static Result.Base GameCardNotInsertedOnGetHandle => new Result.Base(ModuleFs, 2951);
|
||||
/// <summary>Error code: 2002-2952; Inner value: 0x171002</summary>
|
||||
public static Result.Base InvalidGameCardHandleOnRead => new Result.Base(ModuleFs, 2952);
|
||||
/// <summary>Error code: 2002-2954; Inner value: 0x171402</summary>
|
||||
public static Result.Base InvalidGameCardHandleOnGetCardInfo => new Result.Base(ModuleFs, 2954);
|
||||
/// <summary>Error code: 2002-2960; Inner value: 0x172002</summary>
|
||||
public static Result.Base InvalidGameCardHandleOnOpenNormalPartition => new Result.Base(ModuleFs, 2960);
|
||||
/// <summary>Error code: 2002-2961; Inner value: 0x172202</summary>
|
||||
public static Result.Base InvalidGameCardHandleOnOpenSecurePartition => new Result.Base(ModuleFs, 2961);
|
||||
|
||||
/// <summary>Error code: 2002-3001; Inner value: 0x177202</summary>
|
||||
public static Result.Base NotImplemented => new Result.Base(ModuleFs, 3001);
|
||||
public static Result.Base Result3002 => new Result.Base(ModuleFs, 3002);
|
||||
/// <summary>Error code: 2002-3002; Inner value: 0x177402</summary>
|
||||
public static Result.Base UnsupportedVersion => new Result.Base(ModuleFs, 3002);
|
||||
/// <summary>Error code: 2002-3003; Inner value: 0x177602</summary>
|
||||
public static Result.Base SaveDataPathAlreadyExists => new Result.Base(ModuleFs, 3003);
|
||||
/// <summary>Error code: 2002-3005; Inner value: 0x177a02</summary>
|
||||
public static Result.Base OutOfRange => new Result.Base(ModuleFs, 3005);
|
||||
|
||||
/// <summary>Error code: 2002-3200; Range: 3200-3499; Inner value: 0x190002</summary>
|
||||
public static Result.Base AllocationMemoryFailed { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 3200, 3499); }
|
||||
public static Result.Base AesXtsFileFileStorageAllocationError => new Result.Base(ModuleFs, 3312);
|
||||
public static Result.Base AesXtsFileXtsStorageAllocationError => new Result.Base(ModuleFs, 3313);
|
||||
public static Result.Base AesXtsFileAlignmentStorageAllocationError => new Result.Base(ModuleFs, 3314);
|
||||
public static Result.Base AesXtsFileStorageFileAllocationError => new Result.Base(ModuleFs, 3315);
|
||||
public static Result.Base AesXtsFileSubStorageAllocationError => new Result.Base(ModuleFs, 3383);
|
||||
/// <summary>Error code: 2002-3312; Inner value: 0x19e002</summary>
|
||||
public static Result.Base AesXtsFileFileStorageAllocationError => new Result.Base(ModuleFs, 3312);
|
||||
/// <summary>Error code: 2002-3313; Inner value: 0x19e202</summary>
|
||||
public static Result.Base AesXtsFileXtsStorageAllocationError => new Result.Base(ModuleFs, 3313);
|
||||
/// <summary>Error code: 2002-3314; Inner value: 0x19e402</summary>
|
||||
public static Result.Base AesXtsFileAlignmentStorageAllocationError => new Result.Base(ModuleFs, 3314);
|
||||
/// <summary>Error code: 2002-3315; Inner value: 0x19e602</summary>
|
||||
public static Result.Base AesXtsFileStorageFileAllocationError => new Result.Base(ModuleFs, 3315);
|
||||
/// <summary>Error code: 2002-3383; Inner value: 0x1a6e02</summary>
|
||||
public static Result.Base AesXtsFileSubStorageAllocationError => new Result.Base(ModuleFs, 3383);
|
||||
|
||||
/// <summary>Error code: 2002-3500; Range: 3500-3999; Inner value: 0x1b5802</summary>
|
||||
public static Result.Base MmcAccessFailed { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 3500, 3999); }
|
||||
|
||||
/// <summary>Error code: 2002-4000; Range: 4000-4999; Inner value: 0x1f4002</summary>
|
||||
public static Result.Base DataCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4000, 4999); }
|
||||
public static Result.Base RomCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4001, 4299); }
|
||||
public static Result.Base InvalidIndirectStorageSource => new Result.Base(ModuleFs, 4023);
|
||||
/// <summary>Error code: 2002-4001; Range: 4001-4299; Inner value: 0x1f4202</summary>
|
||||
public static Result.Base RomCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4001, 4299); }
|
||||
/// <summary>Error code: 2002-4023; Inner value: 0x1f6e02</summary>
|
||||
public static Result.Base InvalidIndirectStorageSource => new Result.Base(ModuleFs, 4023);
|
||||
|
||||
public static Result.Base SaveDataCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4301, 4499); }
|
||||
public static Result.Base Result4302 => new Result.Base(ModuleFs, 4302);
|
||||
public static Result.Base InvalidSaveDataEntryType => new Result.Base(ModuleFs, 4303);
|
||||
public static Result.Base InvalidSaveDataHeader => new Result.Base(ModuleFs, 4315);
|
||||
public static Result.Base Result4362 => new Result.Base(ModuleFs, 4362);
|
||||
public static Result.Base Result4363 => new Result.Base(ModuleFs, 4363);
|
||||
public static Result.Base InvalidHashInSaveIvfc => new Result.Base(ModuleFs, 4364);
|
||||
public static Result.Base SaveIvfcHashIsEmpty => new Result.Base(ModuleFs, 4372);
|
||||
public static Result.Base InvalidHashInSaveIvfcTopLayer => new Result.Base(ModuleFs, 4373);
|
||||
/// <summary>Error code: 2002-4241; Range: 4241-4259; Inner value: 0x212202</summary>
|
||||
public static Result.Base RomHostFileSystemCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4241, 4259); }
|
||||
/// <summary>Error code: 2002-4242; Inner value: 0x212402</summary>
|
||||
public static Result.Base RomHostEntryCorrupted => new Result.Base(ModuleFs, 4242);
|
||||
/// <summary>Error code: 2002-4243; Inner value: 0x212602</summary>
|
||||
public static Result.Base RomHostFileDataCorrupted => new Result.Base(ModuleFs, 4243);
|
||||
/// <summary>Error code: 2002-4244; Inner value: 0x212802</summary>
|
||||
public static Result.Base RomHostFileCorrupted => new Result.Base(ModuleFs, 4244);
|
||||
/// <summary>Error code: 2002-4245; Inner value: 0x212a02</summary>
|
||||
public static Result.Base InvalidRomHostHandle => new Result.Base(ModuleFs, 4245);
|
||||
|
||||
public static Result.Base Result4402 => new Result.Base(ModuleFs, 4402);
|
||||
public static Result.Base Result4427 => new Result.Base(ModuleFs, 4427);
|
||||
public static Result.Base SaveDataAllocationTableCorrupted => new Result.Base(ModuleFs, 4462);
|
||||
public static Result.Base SaveDataFileTableCorrupted => new Result.Base(ModuleFs, 4463);
|
||||
public static Result.Base AllocationTableIteratedRangeEntry => new Result.Base(ModuleFs, 4464);
|
||||
/// <summary>Error code: 2002-4301; Range: 4301-4499; Inner value: 0x219a02</summary>
|
||||
public static Result.Base SaveDataCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4301, 4499); }
|
||||
/// <summary>Error code: 2002-4302; Inner value: 0x219c02</summary>
|
||||
public static Result.Base UnsupportedSaveVersion => new Result.Base(ModuleFs, 4302);
|
||||
/// <summary>Error code: 2002-4303; Inner value: 0x219e02</summary>
|
||||
public static Result.Base InvalidSaveDataEntryType => new Result.Base(ModuleFs, 4303);
|
||||
/// <summary>Error code: 2002-4315; Inner value: 0x21b602</summary>
|
||||
public static Result.Base InvalidSaveDataHeader => new Result.Base(ModuleFs, 4315);
|
||||
/// <summary>Error code: 2002-4362; Inner value: 0x221402</summary>
|
||||
public static Result.Base InvalidSaveDataIvfcMagic => new Result.Base(ModuleFs, 4362);
|
||||
/// <summary>Error code: 2002-4363; Inner value: 0x221602</summary>
|
||||
public static Result.Base InvalidSaveDataIvfcHashValidationBit => new Result.Base(ModuleFs, 4363);
|
||||
/// <summary>Error code: 2002-4364; Inner value: 0x221802</summary>
|
||||
public static Result.Base InvalidSaveDataIvfcHash => new Result.Base(ModuleFs, 4364);
|
||||
/// <summary>Error code: 2002-4372; Inner value: 0x222802</summary>
|
||||
public static Result.Base EmptySaveDataIvfcHash => new Result.Base(ModuleFs, 4372);
|
||||
/// <summary>Error code: 2002-4373; Inner value: 0x222a02</summary>
|
||||
public static Result.Base InvalidSaveDataHashInIvfcTopLayer => new Result.Base(ModuleFs, 4373);
|
||||
/// <summary>Error code: 2002-4402; Inner value: 0x226402</summary>
|
||||
public static Result.Base SaveDataInvalidGptPartitionSignature => new Result.Base(ModuleFs, 4402);
|
||||
/// <summary>Error code: 2002-4427; Inner value: 0x229602</summary>
|
||||
public static Result.Base IncompleteBlockInZeroBitmapHashStorageFileSaveData => new Result.Base(ModuleFs, 4427);
|
||||
|
||||
public static Result.Base NcaCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4501, 4599); }
|
||||
/// <summary>Error code: 2002-4441; Range: 4441-4459; Inner value: 0x22b202</summary>
|
||||
public static Result.Base SaveDataHostFileSystemCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4441, 4459); }
|
||||
/// <summary>Error code: 2002-4442; Inner value: 0x22b402</summary>
|
||||
public static Result.Base SaveDataHostEntryCorrupted => new Result.Base(ModuleFs, 4442);
|
||||
/// <summary>Error code: 2002-4443; Inner value: 0x22b602</summary>
|
||||
public static Result.Base SaveDataHostFileDataCorrupted => new Result.Base(ModuleFs, 4443);
|
||||
/// <summary>Error code: 2002-4444; Inner value: 0x22b802</summary>
|
||||
public static Result.Base SaveDataHostFileCorrupted => new Result.Base(ModuleFs, 4444);
|
||||
/// <summary>Error code: 2002-4445; Inner value: 0x22ba02</summary>
|
||||
public static Result.Base InvalidSaveDataHostHandle => new Result.Base(ModuleFs, 4445);
|
||||
|
||||
public static Result.Base IntegrityVerificationStorageCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4601, 4639); }
|
||||
public static Result.Base Result4602 => new Result.Base(ModuleFs, 4602);
|
||||
public static Result.Base Result4603 => new Result.Base(ModuleFs, 4603);
|
||||
public static Result.Base InvalidHashInIvfc => new Result.Base(ModuleFs, 4604);
|
||||
public static Result.Base IvfcHashIsEmpty => new Result.Base(ModuleFs, 4612);
|
||||
public static Result.Base InvalidHashInIvfcTopLayer => new Result.Base(ModuleFs, 4613);
|
||||
/// <summary>Error code: 2002-4462; Inner value: 0x22dc02</summary>
|
||||
public static Result.Base SaveDataAllocationTableCorrupted => new Result.Base(ModuleFs, 4462);
|
||||
/// <summary>Error code: 2002-4463; Inner value: 0x22de02</summary>
|
||||
public static Result.Base SaveDataFileTableCorrupted => new Result.Base(ModuleFs, 4463);
|
||||
/// <summary>Error code: 2002-4464; Inner value: 0x22e002</summary>
|
||||
public static Result.Base AllocationTableIteratedRangeEntry => new Result.Base(ModuleFs, 4464);
|
||||
|
||||
public static Result.Base PartitionFileSystemCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4641, 4659); }
|
||||
public static Result.Base InvalidPartitionFileSystemHashOffset => new Result.Base(ModuleFs, 4642);
|
||||
public static Result.Base InvalidPartitionFileSystemHash => new Result.Base(ModuleFs, 4643);
|
||||
public static Result.Base InvalidPartitionFileSystemMagic => new Result.Base(ModuleFs, 4644);
|
||||
public static Result.Base InvalidHashedPartitionFileSystemMagic => new Result.Base(ModuleFs, 4645);
|
||||
public static Result.Base InvalidPartitionFileSystemEntryNameOffset => new Result.Base(ModuleFs, 4646);
|
||||
/// <summary>Error code: 2002-4501; Range: 4501-4599; Inner value: 0x232a02</summary>
|
||||
public static Result.Base NcaCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4501, 4599); }
|
||||
|
||||
public static Result.Base BuiltInStorageCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4661, 4679); }
|
||||
public static Result.Base Result4662 => new Result.Base(ModuleFs, 4662);
|
||||
/// <summary>Error code: 2002-4601; Range: 4601-4639; Inner value: 0x23f202</summary>
|
||||
public static Result.Base IntegrityVerificationStorageCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4601, 4639); }
|
||||
/// <summary>Error code: 2002-4602; Inner value: 0x23f402</summary>
|
||||
public static Result.Base InvalidIvfcMagic => new Result.Base(ModuleFs, 4602);
|
||||
/// <summary>Error code: 2002-4603; Inner value: 0x23f602</summary>
|
||||
public static Result.Base InvalidIvfcHashValidationBit => new Result.Base(ModuleFs, 4603);
|
||||
/// <summary>Error code: 2002-4604; Inner value: 0x23f802</summary>
|
||||
public static Result.Base InvalidIvfcHash => new Result.Base(ModuleFs, 4604);
|
||||
/// <summary>Error code: 2002-4612; Inner value: 0x240802</summary>
|
||||
public static Result.Base EmptyIvfcHash => new Result.Base(ModuleFs, 4612);
|
||||
/// <summary>Error code: 2002-4613; Inner value: 0x240a02</summary>
|
||||
public static Result.Base InvalidHashInIvfcTopLayer => new Result.Base(ModuleFs, 4613);
|
||||
|
||||
public static Result.Base FatFileSystemCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4681, 4699); }
|
||||
public static Result.Base HostFileSystemCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4701, 4719); }
|
||||
/// <summary>Error code: 2002-4641; Range: 4641-4659; Inner value: 0x244202</summary>
|
||||
public static Result.Base PartitionFileSystemCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4641, 4659); }
|
||||
/// <summary>Error code: 2002-4642; Inner value: 0x244402</summary>
|
||||
public static Result.Base InvalidPartitionFileSystemHashOffset => new Result.Base(ModuleFs, 4642);
|
||||
/// <summary>Error code: 2002-4643; Inner value: 0x244602</summary>
|
||||
public static Result.Base InvalidPartitionFileSystemHash => new Result.Base(ModuleFs, 4643);
|
||||
/// <summary>Error code: 2002-4644; Inner value: 0x244802</summary>
|
||||
public static Result.Base InvalidPartitionFileSystemMagic => new Result.Base(ModuleFs, 4644);
|
||||
/// <summary>Error code: 2002-4645; Inner value: 0x244a02</summary>
|
||||
public static Result.Base InvalidHashedPartitionFileSystemMagic => new Result.Base(ModuleFs, 4645);
|
||||
/// <summary>Error code: 2002-4646; Inner value: 0x244c02</summary>
|
||||
public static Result.Base InvalidPartitionFileSystemEntryNameOffset => new Result.Base(ModuleFs, 4646);
|
||||
|
||||
public static Result.Base DatabaseCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4721, 4739); }
|
||||
public static Result.Base SaveDataAllocationTableCorruptedInternal => new Result.Base(ModuleFs, 4722);
|
||||
public static Result.Base SaveDataFileTableCorruptedInternal => new Result.Base(ModuleFs, 4723);
|
||||
public static Result.Base AllocationTableIteratedRangeEntryInternal => new Result.Base(ModuleFs, 4724);
|
||||
/// <summary>Error code: 2002-4661; Range: 4661-4679; Inner value: 0x246a02</summary>
|
||||
public static Result.Base BuiltInStorageCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4661, 4679); }
|
||||
/// <summary>Error code: 2002-4662; Inner value: 0x246c02</summary>
|
||||
public static Result.Base InvalidGptPartitionSignature => new Result.Base(ModuleFs, 4662);
|
||||
|
||||
public static Result.Base AesXtsFileSystemCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4741, 4759); }
|
||||
public static Result.Base AesXtsFileHeaderTooShort => new Result.Base(ModuleFs, 4742);
|
||||
public static Result.Base AesXtsFileHeaderInvalidKeys => new Result.Base(ModuleFs, 4743);
|
||||
public static Result.Base AesXtsFileHeaderInvalidMagic => new Result.Base(ModuleFs, 4744);
|
||||
public static Result.Base AesXtsFileTooShort => new Result.Base(ModuleFs, 4745);
|
||||
public static Result.Base AesXtsFileHeaderTooShortInSetSize => new Result.Base(ModuleFs, 4746);
|
||||
public static Result.Base AesXtsFileHeaderInvalidKeysInRenameFile => new Result.Base(ModuleFs, 4747);
|
||||
public static Result.Base AesXtsFileHeaderInvalidKeysInSetSize => new Result.Base(ModuleFs, 4748);
|
||||
/// <summary>Error code: 2002-4681; Range: 4681-4699; Inner value: 0x249202</summary>
|
||||
public static Result.Base FatFileSystemCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4681, 4699); }
|
||||
|
||||
public static Result.Base SaveDataTransferDataCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4761, 4769); }
|
||||
public static Result.Base SignedSystemPartitionDataCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4771, 4779); }
|
||||
/// <summary>Error code: 2002-4701; Range: 4701-4719; Inner value: 0x24ba02</summary>
|
||||
public static Result.Base HostFileSystemCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4701, 4719); }
|
||||
/// <summary>Error code: 2002-4702; Inner value: 0x24bc02</summary>
|
||||
public static Result.Base HostEntryCorrupted => new Result.Base(ModuleFs, 4702);
|
||||
/// <summary>Error code: 2002-4703; Inner value: 0x24be02</summary>
|
||||
public static Result.Base HostFileDataCorrupted => new Result.Base(ModuleFs, 4703);
|
||||
/// <summary>Error code: 2002-4704; Inner value: 0x24c002</summary>
|
||||
public static Result.Base HostFileCorrupted => new Result.Base(ModuleFs, 4704);
|
||||
/// <summary>Error code: 2002-4705; Inner value: 0x24c202</summary>
|
||||
public static Result.Base InvalidHostHandle => new Result.Base(ModuleFs, 4705);
|
||||
|
||||
public static Result.Base GameCardLogoDataCorrupted => new Result.Base(ModuleFs, 4781);
|
||||
/// <summary>Error code: 2002-4721; Range: 4721-4739; Inner value: 0x24e202</summary>
|
||||
public static Result.Base DatabaseCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4721, 4739); }
|
||||
/// <summary>Error code: 2002-4722; Inner value: 0x24e402</summary>
|
||||
public static Result.Base SaveDataAllocationTableCorruptedInternal => new Result.Base(ModuleFs, 4722);
|
||||
/// <summary>Error code: 2002-4723; Inner value: 0x24e602</summary>
|
||||
public static Result.Base SaveDataFileTableCorruptedInternal => new Result.Base(ModuleFs, 4723);
|
||||
/// <summary>Error code: 2002-4724; Inner value: 0x24e802</summary>
|
||||
public static Result.Base AllocationTableIteratedRangeEntryInternal => new Result.Base(ModuleFs, 4724);
|
||||
|
||||
public static Result.Base Range4811To4819 { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4811, 4819); }
|
||||
public static Result.Base Result4812 => new Result.Base(ModuleFs, 4812);
|
||||
/// <summary>Error code: 2002-4741; Range: 4741-4759; Inner value: 0x250a02</summary>
|
||||
public static Result.Base AesXtsFileSystemCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4741, 4759); }
|
||||
/// <summary>Error code: 2002-4742; Inner value: 0x250c02</summary>
|
||||
public static Result.Base AesXtsFileHeaderTooShort => new Result.Base(ModuleFs, 4742);
|
||||
/// <summary>Error code: 2002-4743; Inner value: 0x250e02</summary>
|
||||
public static Result.Base AesXtsFileHeaderInvalidKeys => new Result.Base(ModuleFs, 4743);
|
||||
/// <summary>Error code: 2002-4744; Inner value: 0x251002</summary>
|
||||
public static Result.Base AesXtsFileHeaderInvalidMagic => new Result.Base(ModuleFs, 4744);
|
||||
/// <summary>Error code: 2002-4745; Inner value: 0x251202</summary>
|
||||
public static Result.Base AesXtsFileTooShort => new Result.Base(ModuleFs, 4745);
|
||||
/// <summary>Error code: 2002-4746; Inner value: 0x251402</summary>
|
||||
public static Result.Base AesXtsFileHeaderTooShortInSetSize => new Result.Base(ModuleFs, 4746);
|
||||
/// <summary>Error code: 2002-4747; Inner value: 0x251602</summary>
|
||||
public static Result.Base AesXtsFileHeaderInvalidKeysInRenameFile => new Result.Base(ModuleFs, 4747);
|
||||
/// <summary>Error code: 2002-4748; Inner value: 0x251802</summary>
|
||||
public static Result.Base AesXtsFileHeaderInvalidKeysInSetSize => new Result.Base(ModuleFs, 4748);
|
||||
|
||||
/// <summary>Error code: 2002-4761; Range: 4761-4769; Inner value: 0x253202</summary>
|
||||
public static Result.Base SaveDataTransferDataCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4761, 4769); }
|
||||
|
||||
/// <summary>Error code: 2002-4771; Range: 4771-4779; Inner value: 0x254602</summary>
|
||||
public static Result.Base SignedSystemPartitionDataCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4771, 4779); }
|
||||
|
||||
/// <summary>Error code: 2002-4781; Inner value: 0x255a02</summary>
|
||||
public static Result.Base GameCardLogoDataCorrupted => new Result.Base(ModuleFs, 4781);
|
||||
|
||||
/// <summary>Error code: 2002-4811; Range: 4811-4819; Inner value: 0x259602</summary>
|
||||
public static Result.Base ZeroBitmapFileCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4811, 4819); }
|
||||
/// <summary>Error code: 2002-4812; Inner value: 0x259802</summary>
|
||||
public static Result.Base IncompleteBlockInZeroBitmapHashStorageFile => new Result.Base(ModuleFs, 4812);
|
||||
|
||||
/// <summary>Error code: 2002-5000; Range: 5000-5999; Inner value: 0x271002</summary>
|
||||
public static Result.Base Unexpected { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 5000, 5999); }
|
||||
/// <summary>Error code: 2002-5307; Inner value: 0x297602</summary>
|
||||
public static Result.Base UnexpectedErrorInHostFileFlush => new Result.Base(ModuleFs, 5307);
|
||||
/// <summary>Error code: 2002-5308; Inner value: 0x297802</summary>
|
||||
public static Result.Base UnexpectedErrorInHostFileGetSize => new Result.Base(ModuleFs, 5308);
|
||||
/// <summary>Error code: 2002-5309; Inner value: 0x297a02</summary>
|
||||
public static Result.Base UnknownHostFileSystemError => new Result.Base(ModuleFs, 5309);
|
||||
/// <summary>Error code: 2002-5320; Inner value: 0x299002</summary>
|
||||
public static Result.Base InvalidNcaMountPoint => new Result.Base(ModuleFs, 5320);
|
||||
|
||||
public static Result.Base UnexpectedErrorInHostFileFlush => new Result.Base(ModuleFs, 5307);
|
||||
public static Result.Base UnexpectedErrorInHostFileGetSize => new Result.Base(ModuleFs, 5308);
|
||||
public static Result.Base UnknownHostFileSystemError => new Result.Base(ModuleFs, 5309);
|
||||
/// <summary>Error code: 2002-6000; Range: 6000-6499; Inner value: 0x2ee002</summary>
|
||||
public static Result.Base PreconditionViolation { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 6000, 6499); }
|
||||
/// <summary>Error code: 2002-6001; Range: 6001-6199; Inner value: 0x2ee202</summary>
|
||||
public static Result.Base InvalidArgument { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 6001, 6199); }
|
||||
/// <summary>Error code: 2002-6002; Range: 6002-6029; Inner value: 0x2ee402</summary>
|
||||
public static Result.Base InvalidPath { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 6002, 6029); }
|
||||
/// <summary>Error code: 2002-6003; Inner value: 0x2ee602</summary>
|
||||
public static Result.Base TooLongPath => new Result.Base(ModuleFs, 6003);
|
||||
/// <summary>Error code: 2002-6004; Inner value: 0x2ee802</summary>
|
||||
public static Result.Base InvalidCharacter => new Result.Base(ModuleFs, 6004);
|
||||
/// <summary>Error code: 2002-6005; Inner value: 0x2eea02</summary>
|
||||
public static Result.Base InvalidPathFormat => new Result.Base(ModuleFs, 6005);
|
||||
/// <summary>Error code: 2002-6006; Inner value: 0x2eec02</summary>
|
||||
public static Result.Base DirectoryUnobtainable => new Result.Base(ModuleFs, 6006);
|
||||
/// <summary>Error code: 2002-6007; Inner value: 0x2eee02</summary>
|
||||
public static Result.Base NotNormalized => new Result.Base(ModuleFs, 6007);
|
||||
|
||||
public static Result.Base InvalidNcaMountPoint => new Result.Base(ModuleFs, 5320);
|
||||
/// <summary>Error code: 2002-6030; Range: 6030-6059; Inner value: 0x2f1c02</summary>
|
||||
public static Result.Base InvalidPathForOperation { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 6030, 6059); }
|
||||
/// <summary>Error code: 2002-6031; Inner value: 0x2f1e02</summary>
|
||||
public static Result.Base DirectoryNotDeletable => new Result.Base(ModuleFs, 6031);
|
||||
/// <summary>Error code: 2002-6032; Inner value: 0x2f2002</summary>
|
||||
public static Result.Base DestinationIsSubPathOfSource => new Result.Base(ModuleFs, 6032);
|
||||
/// <summary>Error code: 2002-6033; Inner value: 0x2f2202</summary>
|
||||
public static Result.Base PathNotFoundInSaveDataFileTable => new Result.Base(ModuleFs, 6033);
|
||||
/// <summary>Error code: 2002-6034; Inner value: 0x2f2402</summary>
|
||||
public static Result.Base DifferentDestFileSystem => new Result.Base(ModuleFs, 6034);
|
||||
|
||||
public static Result.Base PreconditionViolation => new Result.Base(ModuleFs, 6000);
|
||||
public static Result.Base InvalidArgument => new Result.Base(ModuleFs, 6001);
|
||||
public static Result.Base InvalidPath => new Result.Base(ModuleFs, 6002);
|
||||
public static Result.Base TooLongPath => new Result.Base(ModuleFs, 6003);
|
||||
public static Result.Base InvalidCharacter => new Result.Base(ModuleFs, 6004);
|
||||
public static Result.Base InvalidPathFormat => new Result.Base(ModuleFs, 6005);
|
||||
public static Result.Base DirectoryUnobtainable => new Result.Base(ModuleFs, 6006);
|
||||
public static Result.Base NotNormalized => new Result.Base(ModuleFs, 6007);
|
||||
/// <summary>Error code: 2002-6061; Inner value: 0x2f5a02</summary>
|
||||
public static Result.Base InvalidOffset => new Result.Base(ModuleFs, 6061);
|
||||
/// <summary>Error code: 2002-6062; Inner value: 0x2f5c02</summary>
|
||||
public static Result.Base InvalidSize => new Result.Base(ModuleFs, 6062);
|
||||
/// <summary>Error code: 2002-6063; Inner value: 0x2f5e02</summary>
|
||||
public static Result.Base NullArgument => new Result.Base(ModuleFs, 6063);
|
||||
/// <summary>Error code: 2002-6065; Inner value: 0x2f6202</summary>
|
||||
public static Result.Base InvalidMountName => new Result.Base(ModuleFs, 6065);
|
||||
/// <summary>Error code: 2002-6066; Inner value: 0x2f6402</summary>
|
||||
public static Result.Base ExtensionSizeTooLarge => new Result.Base(ModuleFs, 6066);
|
||||
/// <summary>Error code: 2002-6067; Inner value: 0x2f6602</summary>
|
||||
public static Result.Base ExtensionSizeInvalid => new Result.Base(ModuleFs, 6067);
|
||||
/// <summary>Error code: 2002-6068; Inner value: 0x2f6802</summary>
|
||||
public static Result.Base ReadOldSaveDataInfoReader => new Result.Base(ModuleFs, 6068);
|
||||
|
||||
public static Result.Base InvalidPathForOperation { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 6030, 6059); }
|
||||
public static Result.Base DirectoryNotDeletable => new Result.Base(ModuleFs, 6031);
|
||||
public static Result.Base DestinationIsSubPathOfSource => new Result.Base(ModuleFs, 6032);
|
||||
public static Result.Base PathNotFoundInSaveDataFileTable => new Result.Base(ModuleFs, 6033);
|
||||
public static Result.Base DifferentDestFileSystem => new Result.Base(ModuleFs, 6034);
|
||||
/// <summary>Error code: 2002-6080; Range: 6080-6099; Inner value: 0x2f8002</summary>
|
||||
public static Result.Base InvalidEnumValue { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 6080, 6099); }
|
||||
/// <summary>Error code: 2002-6081; Inner value: 0x2f8202</summary>
|
||||
public static Result.Base InvalidSaveDataState => new Result.Base(ModuleFs, 6081);
|
||||
/// <summary>Error code: 2002-6082; Inner value: 0x2f8402</summary>
|
||||
public static Result.Base InvalidSaveDataSpaceId => new Result.Base(ModuleFs, 6082);
|
||||
|
||||
public static Result.Base InvalidOffset => new Result.Base(ModuleFs, 6061);
|
||||
public static Result.Base InvalidSize => new Result.Base(ModuleFs, 6062);
|
||||
public static Result.Base NullArgument => new Result.Base(ModuleFs, 6063);
|
||||
public static Result.Base InvalidMountName => new Result.Base(ModuleFs, 6065);
|
||||
public static Result.Base ExtensionSizeTooLarge => new Result.Base(ModuleFs, 6066);
|
||||
public static Result.Base ExtensionSizeInvalid => new Result.Base(ModuleFs, 6067);
|
||||
public static Result.Base ReadOldSaveDataInfoReader => new Result.Base(ModuleFs, 6068);
|
||||
/// <summary>Error code: 2002-6200; Range: 6200-6299; Inner value: 0x307002</summary>
|
||||
public static Result.Base InvalidOperationForOpenMode { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 6200, 6299); }
|
||||
/// <summary>Error code: 2002-6201; Inner value: 0x307202</summary>
|
||||
public static Result.Base FileExtensionWithoutOpenModeAllowAppend => new Result.Base(ModuleFs, 6201);
|
||||
/// <summary>Error code: 2002-6202; Inner value: 0x307402</summary>
|
||||
public static Result.Base InvalidOpenModeForRead => new Result.Base(ModuleFs, 6202);
|
||||
/// <summary>Error code: 2002-6203; Inner value: 0x307602</summary>
|
||||
public static Result.Base InvalidOpenModeForWrite => new Result.Base(ModuleFs, 6203);
|
||||
|
||||
public static Result.Base InvalidEnumValue { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 6080, 6099); }
|
||||
public static Result.Base InvalidSaveDataState => new Result.Base(ModuleFs, 6081);
|
||||
public static Result.Base InvalidSaveDataSpaceId => new Result.Base(ModuleFs, 6082);
|
||||
/// <summary>Error code: 2002-6300; Range: 6300-6399; Inner value: 0x313802</summary>
|
||||
public static Result.Base UnsupportedOperation { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 6300, 6399); }
|
||||
/// <summary>Error code: 2002-6302; Inner value: 0x313c02</summary>
|
||||
public static Result.Base SubStorageNotResizable => new Result.Base(ModuleFs, 6302);
|
||||
/// <summary>Error code: 2002-6303; Inner value: 0x313e02</summary>
|
||||
public static Result.Base SubStorageNotResizableMiddleOfFile => new Result.Base(ModuleFs, 6303);
|
||||
/// <summary>Error code: 2002-6304; Inner value: 0x314002</summary>
|
||||
public static Result.Base UnsupportedOperationInMemoryStorageSetSize => new Result.Base(ModuleFs, 6304);
|
||||
/// <summary>Error code: 2002-6306; Inner value: 0x314402</summary>
|
||||
public static Result.Base UnsupportedOperationInFileStorageOperateRange => new Result.Base(ModuleFs, 6306);
|
||||
/// <summary>Error code: 2002-6310; Inner value: 0x314c02</summary>
|
||||
public static Result.Base UnsupportedOperationInAesCtrExStorageWrite => new Result.Base(ModuleFs, 6310);
|
||||
/// <summary>Error code: 2002-6316; Inner value: 0x315802</summary>
|
||||
public static Result.Base UnsupportedOperationInHierarchicalIvfcStorageSetSize => new Result.Base(ModuleFs, 6316);
|
||||
/// <summary>Error code: 2002-6324; Inner value: 0x316802</summary>
|
||||
public static Result.Base UnsupportedOperationInIndirectStorageWrite => new Result.Base(ModuleFs, 6324);
|
||||
/// <summary>Error code: 2002-6325; Inner value: 0x316a02</summary>
|
||||
public static Result.Base UnsupportedOperationInIndirectStorageSetSize => new Result.Base(ModuleFs, 6325);
|
||||
/// <summary>Error code: 2002-6350; Inner value: 0x319c02</summary>
|
||||
public static Result.Base UnsupportedOperationInRoGameCardStorageWrite => new Result.Base(ModuleFs, 6350);
|
||||
/// <summary>Error code: 2002-6351; Inner value: 0x319e02</summary>
|
||||
public static Result.Base UnsupportedOperationInRoGameCardStorageSetSize => new Result.Base(ModuleFs, 6351);
|
||||
/// <summary>Error code: 2002-6359; Inner value: 0x31ae02</summary>
|
||||
public static Result.Base UnsupportedOperationInConcatFsQueryEntry => new Result.Base(ModuleFs, 6359);
|
||||
/// <summary>Error code: 2002-6364; Inner value: 0x31b802</summary>
|
||||
public static Result.Base UnsupportedOperationModifyRomFsFileSystem => new Result.Base(ModuleFs, 6364);
|
||||
/// <summary>Error code: 2002-6366; Inner value: 0x31bc02</summary>
|
||||
public static Result.Base UnsupportedOperationRomFsFileSystemGetSpace => new Result.Base(ModuleFs, 6366);
|
||||
/// <summary>Error code: 2002-6367; Inner value: 0x31be02</summary>
|
||||
public static Result.Base UnsupportedOperationModifyRomFsFile => new Result.Base(ModuleFs, 6367);
|
||||
/// <summary>Error code: 2002-6369; Inner value: 0x31c202</summary>
|
||||
public static Result.Base UnsupportedOperationModifyReadOnlyFileSystem => new Result.Base(ModuleFs, 6369);
|
||||
/// <summary>Error code: 2002-6371; Inner value: 0x31c602</summary>
|
||||
public static Result.Base UnsupportedOperationReadOnlyFileSystemGetSpace => new Result.Base(ModuleFs, 6371);
|
||||
/// <summary>Error code: 2002-6372; Inner value: 0x31c802</summary>
|
||||
public static Result.Base UnsupportedOperationModifyReadOnlyFile => new Result.Base(ModuleFs, 6372);
|
||||
/// <summary>Error code: 2002-6374; Inner value: 0x31cc02</summary>
|
||||
public static Result.Base UnsupportedOperationModifyPartitionFileSystem => new Result.Base(ModuleFs, 6374);
|
||||
/// <summary>Error code: 2002-6376; Inner value: 0x31d002</summary>
|
||||
public static Result.Base UnsupportedOperationInPartitionFileSetSize => new Result.Base(ModuleFs, 6376);
|
||||
/// <summary>Error code: 2002-6377; Inner value: 0x31d202</summary>
|
||||
public static Result.Base UnsupportedOperationIdInPartitionFileSystem => new Result.Base(ModuleFs, 6377);
|
||||
|
||||
public static Result.Base InvalidOperationForOpenMode { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 6200, 6299); }
|
||||
public static Result.Base FileExtensionWithoutOpenModeAllowAppend => new Result.Base(ModuleFs, 6201);
|
||||
public static Result.Base InvalidOpenModeForRead => new Result.Base(ModuleFs, 6202);
|
||||
public static Result.Base InvalidOpenModeForWrite => new Result.Base(ModuleFs, 6203);
|
||||
/// <summary>Error code: 2002-6400; Range: 6400-6449; Inner value: 0x320002</summary>
|
||||
public static Result.Base PermissionDenied { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 6400, 6449); }
|
||||
|
||||
public static Result.Base UnsupportedOperation { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 6300, 6399); }
|
||||
public static Result.Base SubStorageNotResizable => new Result.Base(ModuleFs, 6302);
|
||||
public static Result.Base SubStorageNotResizableMiddleOfFile => new Result.Base(ModuleFs, 6303);
|
||||
public static Result.Base UnsupportedOperationInMemoryStorageSetSize => new Result.Base(ModuleFs, 6304);
|
||||
public static Result.Base UnsupportedOperationInFileStorageOperateRange => new Result.Base(ModuleFs, 6306);
|
||||
public static Result.Base UnsupportedOperationInAesCtrExStorageWrite => new Result.Base(ModuleFs, 6310);
|
||||
public static Result.Base UnsupportedOperationInHierarchicalIvfcStorageSetSize => new Result.Base(ModuleFs, 6316);
|
||||
public static Result.Base UnsupportedOperationInIndirectStorageWrite => new Result.Base(ModuleFs, 6324);
|
||||
public static Result.Base UnsupportedOperationInIndirectStorageSetSize => new Result.Base(ModuleFs, 6325);
|
||||
public static Result.Base UnsupportedOperationInRoGameCardStorageWrite => new Result.Base(ModuleFs, 6350);
|
||||
public static Result.Base UnsupportedOperationInRoGameCardStorageSetSize => new Result.Base(ModuleFs, 6351);
|
||||
public static Result.Base UnsupportedOperationInConcatFsQueryEntry => new Result.Base(ModuleFs, 6359);
|
||||
public static Result.Base UnsupportedOperationModifyRomFsFileSystem => new Result.Base(ModuleFs, 6364);
|
||||
public static Result.Base UnsupportedOperationRomFsFileSystemGetSpace => new Result.Base(ModuleFs, 6366);
|
||||
public static Result.Base UnsupportedOperationModifyRomFsFile => new Result.Base(ModuleFs, 6367);
|
||||
public static Result.Base UnsupportedOperationModifyReadOnlyFileSystem => new Result.Base(ModuleFs, 6369);
|
||||
public static Result.Base UnsupportedOperationReadOnlyFileSystemGetSpace => new Result.Base(ModuleFs, 6371);
|
||||
public static Result.Base UnsupportedOperationModifyReadOnlyFile => new Result.Base(ModuleFs, 6372);
|
||||
public static Result.Base UnsupportedOperationModifyPartitionFileSystem => new Result.Base(ModuleFs, 6374);
|
||||
public static Result.Base UnsupportedOperationInPartitionFileSetSize => new Result.Base(ModuleFs, 6376);
|
||||
public static Result.Base UnsupportedOperationIdInPartitionFileSystem => new Result.Base(ModuleFs, 6377);
|
||||
|
||||
public static Result.Base PermissionDenied { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 6400, 6449); }
|
||||
|
||||
public static Result.Base ExternalKeyAlreadyRegistered => new Result.Base(ModuleFs, 6452);
|
||||
public static Result.Base WriteStateUnflushed => new Result.Base(ModuleFs, 6454);
|
||||
public static Result.Base WritableFileOpen => new Result.Base(ModuleFs, 6457);
|
||||
public static Result.Base AllocatorAlignmentViolation => new Result.Base(ModuleFs, 6461);
|
||||
public static Result.Base UserNotExist => new Result.Base(ModuleFs, 6465);
|
||||
/// <summary>Error code: 2002-6452; Inner value: 0x326802</summary>
|
||||
public static Result.Base ExternalKeyAlreadyRegistered => new Result.Base(ModuleFs, 6452);
|
||||
/// <summary>Error code: 2002-6454; Inner value: 0x326c02</summary>
|
||||
public static Result.Base WriteStateUnflushed => new Result.Base(ModuleFs, 6454);
|
||||
/// <summary>Error code: 2002-6457; Inner value: 0x327202</summary>
|
||||
public static Result.Base WriteModeFileNotClosed => new Result.Base(ModuleFs, 6457);
|
||||
/// <summary>Error code: 2002-6461; Inner value: 0x327a02</summary>
|
||||
public static Result.Base AllocatorAlignmentViolation => new Result.Base(ModuleFs, 6461);
|
||||
/// <summary>Error code: 2002-6465; Inner value: 0x328202</summary>
|
||||
public static Result.Base UserNotExist => new Result.Base(ModuleFs, 6465);
|
||||
|
||||
/// <summary>Error code: 2002-6600; Range: 6600-6699; Inner value: 0x339002</summary>
|
||||
public static Result.Base EntryNotFound { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 6600, 6699); }
|
||||
/// <summary>Specified program index is not found<br/>Error code: 2002-6606; Inner value: 0x339c02</summary>
|
||||
public static Result.Base TargetProgramIndexNotFound => new Result.Base(ModuleFs, 6606);
|
||||
|
||||
/// <summary>Error code: 2002-6700; Range: 6700-6799; Inner value: 0x345802</summary>
|
||||
public static Result.Base OutOfResource { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 6700, 6799); }
|
||||
public static Result.Base MappingTableFull => new Result.Base(ModuleFs, 6706);
|
||||
public static Result.Base AllocationTableInsufficientFreeBlocks => new Result.Base(ModuleFs, 6707);
|
||||
public static Result.Base OpenCountLimit => new Result.Base(ModuleFs, 6709);
|
||||
/// <summary>Error code: 2002-6706; Inner value: 0x346402</summary>
|
||||
public static Result.Base MappingTableFull => new Result.Base(ModuleFs, 6706);
|
||||
/// <summary>Error code: 2002-6707; Inner value: 0x346602</summary>
|
||||
public static Result.Base AllocationTableInsufficientFreeBlocks => new Result.Base(ModuleFs, 6707);
|
||||
/// <summary>Error code: 2002-6709; Inner value: 0x346a02</summary>
|
||||
public static Result.Base OpenCountLimit => new Result.Base(ModuleFs, 6709);
|
||||
|
||||
/// <summary>Error code: 2002-6800; Range: 6800-6899; Inner value: 0x352002</summary>
|
||||
public static Result.Base MappingFailed { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 6800, 6899); }
|
||||
public static Result.Base RemapStorageMapFull => new Result.Base(ModuleFs, 6811);
|
||||
/// <summary>Error code: 2002-6811; Inner value: 0x353602</summary>
|
||||
public static Result.Base RemapStorageMapFull => new Result.Base(ModuleFs, 6811);
|
||||
|
||||
/// <summary>Error code: 2002-6900; Range: 6900-6999; Inner value: 0x35e802</summary>
|
||||
public static Result.Base BadState { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 6900, 6999); }
|
||||
public static Result.Base SubStorageNotInitialized => new Result.Base(ModuleFs, 6902);
|
||||
public static Result.Base NotMounted => new Result.Base(ModuleFs, 6905);
|
||||
public static Result.Base SaveDataIsExtending => new Result.Base(ModuleFs, 6906);
|
||||
/// <summary>Error code: 2002-6902; Inner value: 0x35ec02</summary>
|
||||
public static Result.Base SubStorageNotInitialized => new Result.Base(ModuleFs, 6902);
|
||||
/// <summary>Error code: 2002-6905; Inner value: 0x35f202</summary>
|
||||
public static Result.Base NotMounted => new Result.Base(ModuleFs, 6905);
|
||||
/// <summary>Error code: 2002-6906; Inner value: 0x35f402</summary>
|
||||
public static Result.Base SaveDataIsExtending => new Result.Base(ModuleFs, 6906);
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,23 @@
|
||||
namespace LibHac.FsService
|
||||
//-----------------------------------------------------------------------------
|
||||
// This file was automatically generated.
|
||||
// Changes to this file will be lost when the file is regenerated.
|
||||
//
|
||||
// To change this file, modify /build/CodeGen/results.csv at the root of this
|
||||
// repo and run the build script.
|
||||
//
|
||||
// The script can be run with the "codegen" option to run only the
|
||||
// code generation portion of the build.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
namespace LibHac.FsService
|
||||
{
|
||||
public static class ResultSdmmc
|
||||
{
|
||||
public const int ModuleSdmmc = 24;
|
||||
|
||||
/// <summary>Error code: 2024-0001; Inner value: 0x218</summary>
|
||||
public static Result.Base DeviceNotFound => new Result.Base(ModuleSdmmc, 1);
|
||||
/// <summary>Error code: 2024-0004; Inner value: 0x818</summary>
|
||||
public static Result.Base DeviceAsleep => new Result.Base(ModuleSdmmc, 4);
|
||||
}
|
||||
}
|
||||
|
@ -215,7 +215,7 @@ namespace LibHac.FsSystem
|
||||
if (OpenWritableFileCount > 0)
|
||||
{
|
||||
// All files must be closed before commiting save data.
|
||||
return ResultFs.WritableFileOpen.Log();
|
||||
return ResultFs.WriteModeFileNotClosed.Log();
|
||||
}
|
||||
|
||||
// Get rid of the previous commit by renaming the folder
|
||||
|
@ -45,7 +45,7 @@ namespace LibHac.FsSystem
|
||||
if (BlockValidities[blockIndex] == Validity.Invalid && integrityCheckLevel == IntegrityCheckLevel.ErrorOnInvalid)
|
||||
{
|
||||
// Todo: Differentiate between the top and lower layers
|
||||
ThrowHelper.ThrowResult(ResultFs.InvalidHashInIvfc.Value, "Hash error!");
|
||||
ThrowHelper.ThrowResult(ResultFs.InvalidIvfcHash.Value, "Hash error!");
|
||||
}
|
||||
|
||||
bool needsHashCheck = integrityCheckLevel != IntegrityCheckLevel.None &&
|
||||
@ -106,7 +106,7 @@ namespace LibHac.FsSystem
|
||||
|
||||
if (validity == Validity.Invalid && integrityCheckLevel == IntegrityCheckLevel.ErrorOnInvalid)
|
||||
{
|
||||
ThrowHelper.ThrowResult(ResultFs.InvalidHashInIvfc.Value, "Hash error!");
|
||||
ThrowHelper.ThrowResult(ResultFs.InvalidIvfcHash.Value, "Hash error!");
|
||||
}
|
||||
}
|
||||
finally
|
||||
|
@ -18,36 +18,36 @@ namespace LibHac.FsSystem.Save
|
||||
return result;
|
||||
}
|
||||
|
||||
if (ResultFs.Result3002.Includes(result))
|
||||
if (ResultFs.UnsupportedVersion.Includes(result))
|
||||
{
|
||||
return ResultFs.Result4302.Value;
|
||||
return ResultFs.UnsupportedSaveVersion.Value;
|
||||
}
|
||||
|
||||
if (ResultFs.IntegrityVerificationStorageCorrupted.Includes(result))
|
||||
{
|
||||
if (ResultFs.Result4602.Includes(result))
|
||||
if (ResultFs.InvalidIvfcMagic.Includes(result))
|
||||
{
|
||||
return ResultFs.Result4362.Value;
|
||||
return ResultFs.InvalidSaveDataIvfcMagic.Value;
|
||||
}
|
||||
|
||||
if (ResultFs.Result4603.Includes(result))
|
||||
if (ResultFs.InvalidIvfcHashValidationBit.Includes(result))
|
||||
{
|
||||
return ResultFs.Result4363.Value;
|
||||
return ResultFs.InvalidSaveDataIvfcHashValidationBit.Value;
|
||||
}
|
||||
|
||||
if (ResultFs.InvalidHashInIvfc.Includes(result))
|
||||
if (ResultFs.InvalidIvfcHash.Includes(result))
|
||||
{
|
||||
return ResultFs.InvalidHashInSaveIvfc.Value;
|
||||
return ResultFs.InvalidSaveDataIvfcHash.Value;
|
||||
}
|
||||
|
||||
if (ResultFs.IvfcHashIsEmpty.Includes(result))
|
||||
if (ResultFs.EmptyIvfcHash.Includes(result))
|
||||
{
|
||||
return ResultFs.SaveIvfcHashIsEmpty.Value;
|
||||
return ResultFs.EmptySaveDataIvfcHash.Value;
|
||||
}
|
||||
|
||||
if (ResultFs.InvalidHashInIvfcTopLayer.Includes(result))
|
||||
{
|
||||
return ResultFs.InvalidHashInSaveIvfcTopLayer.Value;
|
||||
return ResultFs.InvalidSaveDataHashInIvfcTopLayer.Value;
|
||||
}
|
||||
|
||||
return result;
|
||||
@ -55,9 +55,9 @@ namespace LibHac.FsSystem.Save
|
||||
|
||||
if (ResultFs.BuiltInStorageCorrupted.Includes(result))
|
||||
{
|
||||
if (ResultFs.Result4662.Includes(result))
|
||||
if (ResultFs.InvalidGptPartitionSignature.Includes(result))
|
||||
{
|
||||
return ResultFs.Result4402.Value;
|
||||
return ResultFs.SaveDataInvalidGptPartitionSignature.Value;
|
||||
}
|
||||
|
||||
return result;
|
||||
@ -73,11 +73,11 @@ namespace LibHac.FsSystem.Save
|
||||
return result;
|
||||
}
|
||||
|
||||
if (ResultFs.Range4811To4819.Includes(result))
|
||||
if (ResultFs.ZeroBitmapFileCorrupted.Includes(result))
|
||||
{
|
||||
if (ResultFs.Result4812.Includes(result))
|
||||
if (ResultFs.IncompleteBlockInZeroBitmapHashStorageFile.Includes(result))
|
||||
{
|
||||
return ResultFs.Result4427.Value;
|
||||
return ResultFs.IncompleteBlockInZeroBitmapHashStorageFileSaveData.Value;
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@ -1,13 +1,29 @@
|
||||
namespace LibHac.Kvdb
|
||||
//-----------------------------------------------------------------------------
|
||||
// This file was automatically generated.
|
||||
// Changes to this file will be lost when the file is regenerated.
|
||||
//
|
||||
// To change this file, modify /build/CodeGen/results.csv at the root of this
|
||||
// repo and run the build script.
|
||||
//
|
||||
// The script can be run with the "codegen" option to run only the
|
||||
// code generation portion of the build.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
namespace LibHac.Kvdb
|
||||
{
|
||||
public static class ResultKvdb
|
||||
{
|
||||
public const int ModuleKvdb = 20;
|
||||
|
||||
/// <summary>Error code: 2020-0001; Inner value: 0x214</summary>
|
||||
public static Result.Base TooLargeKeyOrDbFull => new Result.Base(ModuleKvdb, 1);
|
||||
/// <summary>Error code: 2020-0002; Inner value: 0x414</summary>
|
||||
public static Result.Base KeyNotFound => new Result.Base(ModuleKvdb, 2);
|
||||
/// <summary>Error code: 2020-0004; Inner value: 0x814</summary>
|
||||
public static Result.Base AllocationFailed => new Result.Base(ModuleKvdb, 4);
|
||||
/// <summary>Error code: 2020-0005; Inner value: 0xa14</summary>
|
||||
public static Result.Base InvalidKeyValue => new Result.Base(ModuleKvdb, 5);
|
||||
/// <summary>Error code: 2020-0006; Inner value: 0xc14</summary>
|
||||
public static Result.Base BufferInsufficient => new Result.Base(ModuleKvdb, 6);
|
||||
}
|
||||
}
|
||||
|
@ -37,6 +37,10 @@
|
||||
<PackageReference Include="System.Memory" Version="4.5.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Condition="Exists('ResultNameResolver.Generated.cs')" Remove="ResultNameResolver.Archive.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
|
||||
</ItemGroup>
|
||||
|
@ -20,7 +20,7 @@ namespace LibHac
|
||||
public static Result Success => new Result(SuccessValue);
|
||||
|
||||
private static IResultLogger Logger { get; set; }
|
||||
private static IResultNameResolver NameResolver { get; set; }
|
||||
private static IResultNameResolver NameResolver { get; set; } = new ResultNameResolver();
|
||||
|
||||
private const int ModuleBitsOffset = 0;
|
||||
private const int ModuleBitsCount = 9;
|
||||
@ -233,8 +233,8 @@ namespace LibHac
|
||||
public Base(int module, int descriptionStart, int descriptionEnd)
|
||||
{
|
||||
Debug.Assert(ModuleBegin <= module && module < ModuleEnd, "Invalid Module");
|
||||
Debug.Assert(DescriptionBegin <= descriptionStart && descriptionStart < DescriptionEnd, "Invalid Description");
|
||||
Debug.Assert(DescriptionBegin <= descriptionEnd && descriptionEnd < DescriptionEnd, "Invalid Description");
|
||||
Debug.Assert(DescriptionBegin <= descriptionStart && descriptionStart < DescriptionEnd, "Invalid Description Start");
|
||||
Debug.Assert(DescriptionBegin <= descriptionEnd && descriptionEnd < DescriptionEnd, "Invalid Description End");
|
||||
Debug.Assert(descriptionStart <= descriptionEnd, "descriptionStart must be <= descriptionEnd");
|
||||
|
||||
_value = SetBitsValueLong(module, ModuleBitsOffset, ModuleBitsCount) |
|
||||
|
15
src/LibHac/ResultNameResolver.Archive.cs
Normal file
15
src/LibHac/ResultNameResolver.Archive.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System;
|
||||
|
||||
namespace LibHac
|
||||
{
|
||||
internal partial class ResultNameResolver
|
||||
{
|
||||
private static ReadOnlySpan<byte> ArchiveData => new byte[]
|
||||
{
|
||||
// This array will be populated when the build script is run.
|
||||
|
||||
// The script can be run with the "codegen" option to run only the
|
||||
// code generation portion of the build.
|
||||
};
|
||||
}
|
||||
}
|
81
src/LibHac/ResultNameResolver.cs
Normal file
81
src/LibHac/ResultNameResolver.cs
Normal file
@ -0,0 +1,81 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using LibHac.Common;
|
||||
|
||||
namespace LibHac
|
||||
{
|
||||
internal partial class ResultNameResolver : Result.IResultNameResolver
|
||||
{
|
||||
private Lazy<Dictionary<Result, string>> ResultNames { get; } = new Lazy<Dictionary<Result, string>>(GetResultNames);
|
||||
|
||||
public bool TryResolveName(Result result, out string name)
|
||||
{
|
||||
return ResultNames.Value.TryGetValue(result, out name);
|
||||
}
|
||||
|
||||
private static Dictionary<Result, string> GetResultNames()
|
||||
{
|
||||
var archiveReader = new ResultArchiveReader(ArchiveData);
|
||||
return archiveReader.GetDictionary();
|
||||
}
|
||||
|
||||
// To save a bunch of space in the assembly, Results with their names are packed into
|
||||
// an archive and unpacked at runtime.
|
||||
private readonly ref struct ResultArchiveReader
|
||||
{
|
||||
private readonly ReadOnlySpan<byte> _data;
|
||||
|
||||
private ref HeaderStruct Header => ref Unsafe.As<byte, HeaderStruct>(ref MemoryMarshal.GetReference(_data));
|
||||
private ReadOnlySpan<byte> NameTable => _data.Slice(Header.NameTableOffset);
|
||||
private ReadOnlySpan<Element> Elements => MemoryMarshal.Cast<byte, Element>(
|
||||
_data.Slice(Unsafe.SizeOf<HeaderStruct>(), Header.ElementCount * Unsafe.SizeOf<Element>()));
|
||||
|
||||
public ResultArchiveReader(ReadOnlySpan<byte> archive)
|
||||
{
|
||||
_data = archive;
|
||||
}
|
||||
|
||||
public Dictionary<Result, string> GetDictionary()
|
||||
{
|
||||
var dict = new Dictionary<Result, string>();
|
||||
if (_data.Length < 8) return dict;
|
||||
|
||||
ReadOnlySpan<Element> elements = Elements;
|
||||
|
||||
foreach (ref readonly Element element in elements)
|
||||
{
|
||||
var result = new Result(element.Module, element.DescriptionStart);
|
||||
dict.Add(result, GetName(element.NameOffset).ToString());
|
||||
}
|
||||
|
||||
return dict;
|
||||
}
|
||||
|
||||
private U8Span GetName(int offset)
|
||||
{
|
||||
ReadOnlySpan<byte> untrimmed = NameTable.Slice(offset);
|
||||
int len = StringUtils.GetLength(untrimmed);
|
||||
|
||||
return new U8Span(untrimmed.Slice(0, len));
|
||||
}
|
||||
|
||||
#pragma warning disable 649
|
||||
private struct HeaderStruct
|
||||
{
|
||||
public int ElementCount;
|
||||
public int NameTableOffset;
|
||||
}
|
||||
|
||||
private struct Element
|
||||
{
|
||||
public int NameOffset;
|
||||
public short Module;
|
||||
public short DescriptionStart;
|
||||
public short DescriptionEnd;
|
||||
}
|
||||
#pragma warning restore 649
|
||||
}
|
||||
}
|
||||
}
|
@ -56,8 +56,6 @@ namespace hactoolnet
|
||||
|
||||
try
|
||||
{
|
||||
Result.SetNameResolver(new ResultNameResolver());
|
||||
|
||||
using (var logger = new ProgressBar())
|
||||
{
|
||||
ctx.Logger = logger;
|
||||
|
Loading…
x
Reference in New Issue
Block a user