static void Main(string[] args) { if (args.Length < 2) { PrintUsage(); return; } var filename = args[0]; var dir = args[1]; string dataOverride = null; if (!Path.IsPathRooted(filename)) { filename = Path.Combine(Directory.GetCurrentDirectory(), filename); } if (!Path.IsPathRooted(dir)) { dir = Path.Combine(Directory.GetCurrentDirectory(), dir); } for (int i = 2; i < args.Length; i += 1) { switch (args[i]) { case "--datapath": if (i < args.Length - 1) { dataOverride = args[i + 1]; } break; } } using (var file = new NdsRom()) { if (!string.IsNullOrEmpty(dataOverride)) { file.DataPath = dataOverride; } file.OpenFile(filename, new PhysicalFileSystem()).Wait(); if (File.Exists(filename)) { file.Unpack(dir, new PhysicalFileSystem()).Wait(); } else if (Directory.Exists(filename)) { file.Save(dir, new PhysicalFileSystem()).Wait(); } } }
public async Task TestPackBRT() { using (var eosUS = new NdsRom()) { await eosUS.OpenFile(BrtUsPath, SourceProvider); await eosUS.Save("brt-repack.nds", OutputProvider); } // Cleanup OutputProvider.DeleteFile("eos-repack.nds"); }
public async Task TestPackEOS() { using (var eosUS = new NdsRom()) { await eosUS.OpenFile(EosUsPath, SourceProvider); await eosUS.Unpack(EosUsUnpackDir, OutputProvider); await eosUS.Save("eos-repack.nds", OutputProvider); using (var eosRepack = new NdsRom()) { await eosRepack.OpenFile("eos-repack.nds", OutputProvider); await eosUS.Unpack(EosUsUnpackDir + "-Reunpack", OutputProvider); } } // Cleanup OutputProvider.DeleteFile("eos-repack.nds"); OutputProvider.DeleteDirectory(EosUsUnpackDir + "-Reunpack"); }