diff --git a/src/LibHac/Ns/ApplicationControlProperty.cs b/src/LibHac/Ns/ApplicationControlProperty.cs index 47a377c4..d1de76d8 100644 --- a/src/LibHac/Ns/ApplicationControlProperty.cs +++ b/src/LibHac/Ns/ApplicationControlProperty.cs @@ -71,18 +71,18 @@ public struct ApplicationControlProperty public AccessibleLaunchRequiredVersionValue AccessibleLaunchRequiredVersion; public Array3000 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 readonly U8Span IsbnString => new U8Span(Isbn.ItemsRo); + public readonly U8Span DisplayVersionString => new U8Span(DisplayVersion.ItemsRo); + public readonly U8Span ApplicationErrorCodeCategoryString => new U8Span(ApplicationErrorCodeCategory.ItemsRo); + public readonly U8Span BcatPassphraseString => new U8Span(BcatPassphrase.ItemsRo); public struct ApplicationTitle { - private Array512 _name; - private Array256 _publisher; + public Array512 Name; + public Array256 Publisher; - public U8SpanMutable Name => new U8SpanMutable(_name.Items); - public U8SpanMutable Publisher => new U8SpanMutable(_publisher.Items); + public readonly U8Span NameString => new U8Span(Name.ItemsRo); + public readonly U8Span PublisherString => new U8Span(Publisher.ItemsRo); } public struct ApplicationNeighborDetectionClientConfiguration diff --git a/src/LibHac/Tools/Fs/SwitchFs.cs b/src/LibHac/Tools/Fs/SwitchFs.cs index b0ec3e71..be307a04 100644 --- a/src/LibHac/Tools/Fs/SwitchFs.cs +++ b/src/LibHac/Tools/Fs/SwitchFs.cs @@ -231,9 +231,9 @@ private void ReadControls() foreach (ref readonly ApplicationControlProperty.ApplicationTitle desc in title.Control.Value.Title.ItemsRo) { - if (!desc.Name.IsEmpty()) + if (!desc.NameString.IsEmpty()) { - title.Name = desc.Name.ToString(); + title.Name = desc.NameString.ToString(); break; } } diff --git a/tests/LibHac.Tests/Ns/TypeLayoutTests.cs b/tests/LibHac.Tests/Ns/TypeLayoutTests.cs index 88fc2df1..09b64418 100644 --- a/tests/LibHac.Tests/Ns/TypeLayoutTests.cs +++ b/tests/LibHac.Tests/Ns/TypeLayoutTests.cs @@ -15,8 +15,11 @@ public static void ApplicationTitle_Layout() Assert.Equal(0x300, Unsafe.SizeOf()); - Assert.Equal(0x000, GetOffset(in s, in s.Name.Value[0])); - Assert.Equal(0x200, GetOffset(in s, in s.Publisher.Value[0])); + Assert.Equal(0x000, GetOffset(in s, in s.Name)); + Assert.Equal(0x200, GetOffset(in s, in s.Publisher)); + + Assert.Equal(0x000, GetOffset(in s, in s.NameString.Value[0])); + Assert.Equal(0x200, GetOffset(in s, in s.PublisherString.Value[0])); } [Fact]