[Locus] Use new source generator based big endian marshaller

This commit is contained in:
2025-10-21 03:31:19 +01:00
parent cc3c1418e4
commit 82889ee735
2 changed files with 32 additions and 30 deletions

View File

@@ -66,7 +66,7 @@ public sealed partial class Locus
for(ulong location = 0; location <= 8; location++)
{
uint sbSize = (uint)(Marshal.SizeOf<Superblock>() / imagePlugin.Info.SectorSize);
var sbSize = (uint)(Marshal.SizeOf<Superblock>() / imagePlugin.Info.SectorSize);
if(Marshal.SizeOf<Superblock>() % imagePlugin.Info.SectorSize != 0) sbSize++;
@@ -103,7 +103,7 @@ public sealed partial class Locus
for(ulong location = 0; location <= 8; location++)
{
uint sbSize = (uint)(Marshal.SizeOf<Superblock>() / imagePlugin.Info.SectorSize);
var sbSize = (uint)(Marshal.SizeOf<Superblock>() / imagePlugin.Info.SectorSize);
if(Marshal.SizeOf<Superblock>() % imagePlugin.Info.SectorSize != 0) sbSize++;
@@ -128,7 +128,7 @@ public sealed partial class Locus
// Numerical arrays are not important for information so no need to swap them
if(locusSb.s_magic is LOCUS_CIGAM or LOCUS_CIGAM_OLD)
{
locusSb = Marshal.ByteArrayToStructureBigEndian<Superblock>(sector);
locusSb = Marshal.ByteArrayToStructureBigEndianGenerated<Superblock>(sector);
locusSb.s_flags = (Flags)Swapping.Swap((ushort)locusSb.s_flags);
}