Hook up CIA to printer

This commit is contained in:
Matt Nadareski
2023-01-09 11:31:17 -08:00
parent 5e2185dffd
commit 6b7ed456ac
3 changed files with 38 additions and 0 deletions

View File

@@ -25,6 +25,11 @@
/// </summary>
BZip2,
/// <summary>
/// CTR Importable Archive
/// </summary>
CIA,
/// <summary>
/// Executable or library
/// </summary>

View File

@@ -43,6 +43,12 @@ namespace BurnOutSharp.Tools
#endregion
#region CIA
// No magic checks for CIA
#endregion
#region Executable
// DOS MZ executable file format (and descendants)
@@ -359,6 +365,13 @@ namespace BurnOutSharp.Tools
#endregion
#region CIA
if (extension.Equals("cia", StringComparison.OrdinalIgnoreCase))
return SupportedFileType.CIA;
#endregion
#region Executable
// DOS MZ executable file format (and descendants)
@@ -704,6 +717,7 @@ namespace BurnOutSharp.Tools
case SupportedFileType.BFPK: return new FileType.BFPK();
case SupportedFileType.BSP: return new FileType.BSP();
case SupportedFileType.BZip2: return new FileType.BZip2();
//case SupportedFileType.CIA: return new FileType.CIA();
case SupportedFileType.Executable: return new FileType.Executable();
case SupportedFileType.GCF: return new FileType.GCF();
case SupportedFileType.GZIP: return new FileType.GZIP();

View File

@@ -174,6 +174,25 @@ namespace Test
bsp.Print();
}
// CIA
else if (ft == SupportedFileType.CIA)
{
// Build the CIA information
Console.WriteLine("Creating CIA deserializer");
Console.WriteLine();
var cia = CIA.Create(stream);
if (cia == null)
{
Console.WriteLine("Something went wrong parsing CIA");
Console.WriteLine();
return;
}
// Print the CIA info to screen
cia.Print();
}
// GCF
else if (ft == SupportedFileType.GCF)
{