Add nacp U8Span properties for convenience

Adds U8Span properties for the fields in ApplicationControlProperty that contain strings. Makes it easier to know what these fields contain.
This commit is contained in:
Alex Barney 2022-02-19 19:48:03 -07:00
parent 19dc9ebe9f
commit d6bfecb63f
3 changed files with 8 additions and 3 deletions

View file

@ -71,6 +71,11 @@ public struct ApplicationControlProperty
public AccessibleLaunchRequiredVersionValue AccessibleLaunchRequiredVersion;
public Array3000<byte> Reserved3448;
public U8Span IsbnString => new U8Span(Isbn.ItemsRo);
public U8Span DisplayVersionString => new U8Span(DisplayVersion.ItemsRo);
public U8Span ApplicationErrorCodeCategoryString => new U8Span(ApplicationErrorCodeCategory.ItemsRo);
public U8Span BcatPassphraseString => new U8Span(BcatPassphrase.ItemsRo);
public struct ApplicationTitle
{
private Array512<byte> _name;

View file

@ -406,14 +406,14 @@ public class Application
{
Name = Patch.Name;
Version = Patch.Version;
DisplayVersion = Patch.Control.Value.DisplayVersion.ToString();
DisplayVersion = Patch.Control.Value.DisplayVersionString.ToString();
Nacp = Patch.Control;
}
else if (Main != null)
{
Name = Main.Name;
Version = Main.Version;
DisplayVersion = Main.Control.Value.DisplayVersion.ToString();
DisplayVersion = Main.Control.Value.DisplayVersionString.ToString();
Nacp = Main.Control;
}
else

View file

@ -245,7 +245,7 @@ internal static class ProcessSwitchFs
title.Version?.ToString(),
title.Metadata?.Type.Print(),
Utilities.GetBytesReadable(title.GetSize()),
title.Control.Value.DisplayVersion.ToString(),
title.Control.Value.DisplayVersionString.ToString(),
title.Name);
}