diff --git a/BurnOutSharp/Enums.cs b/BurnOutSharp/Enums.cs index 39c9d1f8..637a052e 100644 --- a/BurnOutSharp/Enums.cs +++ b/BurnOutSharp/Enums.cs @@ -80,11 +80,21 @@ /// MSI, + /// + /// Nintendo 3DS cart image + /// + N3DS, + /// /// Half-Life No Cache File /// NCF, + /// + /// Nintendo DS/DSi cart image + /// + Nitro, + /// /// Half-Life Package File /// diff --git a/BurnOutSharp/Tools/Utilities.cs b/BurnOutSharp/Tools/Utilities.cs index b487d339..7b677f21 100644 --- a/BurnOutSharp/Tools/Utilities.cs +++ b/BurnOutSharp/Tools/Utilities.cs @@ -151,6 +151,12 @@ namespace BurnOutSharp.Tools #endregion + #region N3DS + + // No magic checks for N3DS + + #endregion + #region NCF if (magic.StartsWith(new byte?[] { 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00 })) @@ -158,6 +164,12 @@ namespace BurnOutSharp.Tools #endregion + #region Nitro + + // No magic checks for Nitro + + #endregion + #region PAK if (magic.StartsWith(new byte?[] { 0x50, 0x41, 0x43, 0x4B })) @@ -199,7 +211,7 @@ namespace BurnOutSharp.Tools return SupportedFileType.Quantum; #endregion - + #region RAR // RAR archive version 1.50 onwards @@ -415,6 +427,18 @@ namespace BurnOutSharp.Tools #endregion + #region N3DS + + // 3DS cart image + if (extension.Equals("3ds", StringComparison.OrdinalIgnoreCase)) + return SupportedFileType.N3DS; + + // CIA package -- Not currently supported + // else if (extension.Equals(value: "cia", StringComparison.OrdinalIgnoreCase)) + // return SupportedFileType.N3DS; + + #endregion + #region NCF if (extension.Equals("ncf", StringComparison.OrdinalIgnoreCase)) @@ -422,6 +446,26 @@ namespace BurnOutSharp.Tools #endregion + #region Nitro + + // DS cart image + if (extension.Equals("nds", StringComparison.OrdinalIgnoreCase)) + return SupportedFileType.Nitro; + + // DS development cart image + else if (extension.Equals("srl", StringComparison.OrdinalIgnoreCase)) + return SupportedFileType.Nitro; + + // DSi cart image + else if (extension.Equals("dsi", StringComparison.OrdinalIgnoreCase)) + return SupportedFileType.Nitro; + + // iQue DS cart image + else if (extension.Equals("ids", StringComparison.OrdinalIgnoreCase)) + return SupportedFileType.Nitro; + + #endregion + #region PAK // No extensions registered for PAK @@ -537,7 +581,7 @@ namespace BurnOutSharp.Tools // return SupportedFileType.Quantum; #endregion - + #region RAR if (extension.Equals("rar", StringComparison.OrdinalIgnoreCase)) @@ -714,7 +758,7 @@ namespace BurnOutSharp.Tools return string.Empty; } } - + /// /// Get the internal version as reported by the resources /// diff --git a/Test/Printer.cs b/Test/Printer.cs index 35973d7c..e989cd2a 100644 --- a/Test/Printer.cs +++ b/Test/Printer.cs @@ -50,6 +50,8 @@ namespace Test // Get the file type SupportedFileType ft = BurnOutSharp.Tools.Utilities.GetFileType(magic); + if (ft == SupportedFileType.UNKNOWN) + ft = BurnOutSharp.Tools.Utilities.GetFileType(Path.GetExtension(file).TrimStart('.')); // MS-DOS executable and decendents if (ft == SupportedFileType.Executable)