update structure (not compiling yet)

This commit is contained in:
2024-09-01 09:06:35 +02:00
parent 530bae8d57
commit 1c6a2f748c
18 changed files with 151 additions and 300 deletions

View File

@@ -1,16 +1,7 @@
namespace SM64Lib.LIBMIO0;
public struct MIO0_Header
{
public uint dest_size;
public uint comp_offset;
public uint uncomp_offset;
public bool big_endian;
};
public class MIO0
{
private const int MIO0_HEADER_LENGTH = 16;
private static int GET_BIT(byte[] buf, int offset, int bit)
@@ -49,7 +40,7 @@ public class MIO0
/// decode MIO0 header<para/>
/// returns true if valid header, false otherwise
///</summary>
public static bool decode_header(byte[] buf, ref MIO0_Header head)
public static bool decode_header(byte[] buf, ref MIO0Header head)
{
byte[] mio0_ascii_be = new byte[] { 0x4D, 0x49, 0x4F, 0x30 };
byte[] mio0_ascii_le = new byte[] { 0x49, 0x4D, 0x30, 0x4F };
@@ -77,7 +68,7 @@ public class MIO0
///<summary>
/// encode MIO0 header from struct
///</summary>
public static void encode_header(byte[] buf, ref MIO0_Header head)
public static void encode_header(byte[] buf, ref MIO0Header head)
{
write_u32_be(buf, 0x4D494F30, 0); // write "MIO0" at start of buffer
write_u32_be(buf, head.dest_size, 4);
@@ -93,7 +84,7 @@ public class MIO0
public static byte[] mio0_decode(byte[] mio0_buf)
{
MIO0_Header head = new();
MIO0Header head = new();
uint bytes_written = 0;
int bit_idx = 0;
int comp_idx = 0;
@@ -144,5 +135,4 @@ public class MIO0
}
return decoded;
}
}

View File

@@ -0,0 +1,9 @@
namespace SM64Lib.LIBMIO0;
public struct MIO0Header
{
public uint dest_size;
public uint comp_offset;
public uint uncomp_offset;
public bool big_endian;
};

View File

@@ -1,9 +0,0 @@
using System.Runtime.InteropServices;
// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
[assembly: ComVisible(false)]
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
[assembly: Guid("e4cec3b1-5778-4d63-8c97-c95153cdc052")]

View File

@@ -1,19 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Platforms>AnyCPU</Platforms>
<Configurations>Debug;Release;ReleaseBundle;ReleaseStandalone</Configurations>
<Nullable>annotations</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.VisualBasic" Version="10.3.0" />
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
</ItemGroup>
<ItemGroup>
<Compile Remove="obj\RelMono\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs" />
<Compile Remove="obj\RelMono\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs" />
<Compile Remove="obj\RelMono\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs" />
</ItemGroup>
</Project>