diff --git a/64Injector.cs b/64Injector.cs index 6a6d555..26d863c 100644 --- a/64Injector.cs +++ b/64Injector.cs @@ -507,6 +507,7 @@ public bool LoadBase(string path) Cll.Log.WriteLine("Previous base deleted."); } + Cll.Log.WriteLine("Validating input base..."); if (IsValidBase(path)) { Cll.Log.WriteLine("The \"" + path + "\" folder contains a valid base."); @@ -543,6 +544,7 @@ public bool LoadIni(string filename) private VCN64 GetLoadedBase() { + Cll.Log.WriteLine("Validating loaded base..."); if (IsValidBase("base")) { FileStream fs = File.Open("base\\code\\VESSEL.rpx", FileMode.Open); @@ -551,14 +553,22 @@ private VCN64 GetLoadedBase() if (hash == VCN64.DonkeyKong64.HashCRC32) return VCN64.DonkeyKong64; + else if (hash == VCN64.DonkeyKong64J.HashCRC32) + return VCN64.DonkeyKong64J; else if (hash == VCN64.Ocarina.HashCRC32) return VCN64.Ocarina; else if (hash == VCN64.PaperMario.HashCRC32) return VCN64.PaperMario; + else if (hash == VCN64.Kirby64J.HashCRC32) + return VCN64.Kirby64J; else if (hash == VCN64.Kirby64.HashCRC32) return VCN64.Kirby64; + else if (hash == VCN64.SnowJ.HashCRC32) + return VCN64.SnowJ; else if (hash == VCN64.MarioTennis.HashCRC32) return VCN64.MarioTennis; + else if (hash == VCN64.MarioGolfJ.HashCRC32) + return VCN64.MarioGolfJ; else if (hash == VCN64.MarioGolf.HashCRC32) return VCN64.MarioGolf; else if (hash == VCN64.StarFox64.HashCRC32) @@ -571,12 +581,16 @@ private VCN64 GetLoadedBase() return VCN64.YoshiStory; else if (hash == VCN64.WaveRace64.HashCRC32) return VCN64.WaveRace64; + else if (hash == VCN64.MajoraJ.HashCRC32) + return VCN64.MajoraJ; else if (hash == VCN64.Majora.HashCRC32) return VCN64.Majora; else if (hash == VCN64.PokemonSnap.HashCRC32) return VCN64.PokemonSnap; else if (hash == VCN64.MarioParty2.HashCRC32) return VCN64.MarioParty2; + else if (hash == VCN64.CustomRoboV2.HashCRC32) + return VCN64.CustomRoboV2; else if (hash == VCN64.OgreBattle64.HashCRC32) return VCN64.OgreBattle64; else if (hash == VCN64.Excitebike64.HashCRC32) @@ -592,44 +606,52 @@ private VCN64 GetLoadedBase() else return null; } - + #endregion #region Validations private bool IsValidBase(string path) { - if (File.Exists(path + "\\code\\app.xml") && - File.Exists(path + "\\code\\cos.xml") && - File.Exists(path + "\\code\\VESSEL.rpx") && - Directory.Exists(path + "\\content\\config") && - Directory.Exists(path + "\\content\\rom") && - File.Exists(path + "\\content\\BuildInfo.txt") && - File.Exists(path + "\\content\\config.ini") && - File.Exists(path + "\\content\\FrameLayout.arc") && - File.Exists(path + "\\meta\\iconTex.tga") && - File.Exists(path + "\\meta\\bootTvTex.tga") && - File.Exists(path + "\\meta\\bootDrcTex.tga") && - File.Exists(path + "\\meta\\meta.xml")) - return true; - else + bool validBase = true; + string[] contentFolders = new string[] + { + "\\content\\config", + "\\content\\rom" + }; + string[] contentFiles = new string[] + { + "\\code\\cos.xml", + "\\code\\VESSEL.rpx", + "\\content\\BuildInfo.txt", + "\\content\\config.ini", + "\\content\\FrameLayout.arc", + "\\meta\\iconTex.tga", + "\\meta\\bootTvTex.tga", + "\\meta\\bootDrcTex.tga", + "\\meta\\meta.xml" + }; + for (int i = 0; i < contentFiles.Length; i++) + { + if (!File.Exists(path + contentFiles[i])) + { + Cll.Log.WriteLine(string.Format("This file is missing: {0}", path + contentFiles[i])); + validBase = false; + } + } + for (int j = 0; j < contentFolders.Length; j++) + { + if (!Directory.Exists(path + contentFolders[j])) + { + Cll.Log.WriteLine(string.Format("This folder is missing: {0}", path + contentFolders[j])); + validBase = false; + } + } + if (!validBase) { Cll.Log.WriteLine("The base is invalid."); - Cll.Log.WriteLine("Some of the following files or folders are missing:"); - Cll.Log.WriteLine(path + "\\code\\app.xml"); - Cll.Log.WriteLine(path + "\\code\\cos.xml"); - Cll.Log.WriteLine(path + "\\code\\VESSEL.rpx"); - Cll.Log.WriteLine(path + "\\content\\config"); - Cll.Log.WriteLine(path + "\\content\\rom"); - Cll.Log.WriteLine(path + "\\content\\BuildInfo.txt"); - Cll.Log.WriteLine(path + "\\content\\config.ini"); - Cll.Log.WriteLine(path + "\\content\\FrameLayout.arc"); - Cll.Log.WriteLine(path + "\\meta\\iconTex.tga"); - Cll.Log.WriteLine(path + "\\meta\\bootTvTex.tga"); - Cll.Log.WriteLine(path + "\\meta\\bootDrcTex.tga"); - Cll.Log.WriteLine(path + "\\meta\\meta.xml"); - return false; } + return validBase; } private bool IsValidEncryptedBase(string path) diff --git a/VCN64.cs b/VCN64.cs index 0184504..cff2a68 100644 --- a/VCN64.cs +++ b/VCN64.cs @@ -18,21 +18,26 @@ public override string ToString() { return Title + "\nCRC32: " + HashCRC32.ToString("X8") + " " + Info; } - public static readonly VCN64 DonkeyKong64 = new VCN64(0xFB245F10, "SVN: 1680 TIME: 2015/01/20 14:12:06", "Donkey Kong 64 (NTSC-U)"); + public static readonly VCN64 DonkeyKong64J = new VCN64(0x8EF60284, "SVN: 1690 TIME: 2015/01/27 16:08:00", "Donkey Kong 64 (NTSC-J)"); public static readonly VCN64 Ocarina = new VCN64(0xF042E451, "SVN: 1696 TIME: 2015/01/30 10:49:22", "The Legend of Zelda: Ocarina of Time (NTSC-U)"); public static readonly VCN64 PaperMario = new VCN64(0xAE933905, "SVN: 1743 TIME: 2015/03/05 15:06:57", "Paper Mario (NTSC-U)"); + public static readonly VCN64 Kirby64J = new VCN64(0xCEB7A833, "SVN: 1778 TIME: 2015/03/19 16:15:32", "Hoshi no Kirby (NTSC-J)"); public static readonly VCN64 Kirby64 = new VCN64(0x7EB7B97D, "SVN: 1790 TIME: 2015/03/24 13:46:36", "Kirby 64: The Crystal Shards (NTSC-U)"); + public static readonly VCN64 SnowJ = new VCN64(0x17BCC968, "SVN: 1897 TIME: 2015/05/12 17:32:21", "1080° Snowboarding (NTSC-J)"); public static readonly VCN64 MarioTennis = new VCN64(0x05F20995, "SVN: 1918 TIME: 2015/05/20 14:34:00", "Mario Tennis (NTSC-U)"); + public static readonly VCN64 MarioGolfJ = new VCN64(0x8D3C196C, "SVN: 1946 TIME: 2015/06/09 11:00:28", "Mario Golf (NTSC-J)"); public static readonly VCN64 MarioGolf = new VCN64(0x307DCE21, "SVN: 1955 TIME: 2015/06/16 16:09:03", "Mario Golf (NTSC-U)"); public static readonly VCN64 StarFox64 = new VCN64(0xF41BC127, "SVN: 1970 TIME: 2015/06/30 14:07:35", "Star Fox 64 (NTSC-U)"); public static readonly VCN64 SinAndP = new VCN64(0x36C0456E, "SVN: 1991 TIME: 2015/07/16 09:20:39", "Sin and Punishment (NTSC-U)"); public static readonly VCN64 MarioKart64 = new VCN64(0x5559F831, "SVN: 2043 TIME: 2015/08/18 10:07:52", "Mario Kart 64 (NTSC-U)"); public static readonly VCN64 YoshiStory = new VCN64(0xD554D2E4, "SVN: 2079 TIME: 2015/09/15 16:19:11", "Yoshi's Story (NTSC-U)"); public static readonly VCN64 WaveRace64 = new VCN64(0xC376B949, "SVN: 2136 TIME: 2015/11/18 12:41:26", "Wave Race 64 (NTSC-U)"); + public static readonly VCN64 MajoraJ = new VCN64(0xEE8855FF, "SVN: 2170 TIME: 2015/12/16 16:01:23", "Zelda no Densetsu : Mujura no Kamen (NTSC-J)"); public static readonly VCN64 Majora = new VCN64(0x71FC1731, "SVN: 2190 TIME: 2016/01/05 16:50:14", "The Legend of Zelda: Majora's Mask (NTSC-U)"); public static readonly VCN64 PokemonSnap = new VCN64(0x967E7DF0, "SVN: 2195 TIME: 2016/01/08 09:42:51", "Pokémon Snap (NTSC-U)"); public static readonly VCN64 MarioParty2 = new VCN64(0xBE3CEC5F, "SVN: 2234 TIME: 2016/02/02 10:56:10", "Mario Party 2 (NTSC-U)"); + public static readonly VCN64 CustomRoboV2 = new VCN64(0x89F2BC09, "SVN: 2244 TIME: 2016/02/26 09:03:55", "Custom Robo V2 (NTSC-J)"); public static readonly VCN64 OgreBattle64 = new VCN64(0xFED1FB48, "SVN: 2395 TIME: 2016/08/30 13:57:02", "Ogre Battle 64: Person of Lordly Caliber (NTSC-U)"); public static readonly VCN64 Excitebike64 = new VCN64(0x724C4F5D, "SVN: 2404 TIME: 2016/09/14 13:42:00", "Excitebike 64 (NTSC-U)"); public static readonly VCN64 FZeroX = new VCN64(0x2AF3C23B, "SVN: 2428 TIME: 2016/11/18 11:44:39", "F-Zero X (NTSC-U)");