public async Task OpenFile(BinaryFile file) { // Clear virtual path if it exists if (!string.IsNullOrEmpty(VirtualPath) && CurrentFileSystem.DirectoryExists(VirtualPath)) { CurrentFileSystem.DeleteDirectory(VirtualPath); } VirtualPath = CurrentFileSystem.GetTempDirectory(); if (await NcsdFile.IsNcsd(file)) { Container = await NcsdFile.Load(file); } else if (await CiaFile.IsCia(file)) { Container = await CiaFile.Load(file); } else if (await NcchPartition.IsNcch(file)) { Container = new SingleNcchPartitionContainer(await NcchPartition.Load(file)); } else if (await RomFs.IsRomFs(file)) { Container = new SingleNcchPartitionContainer(new NcchPartition(romfs: await RomFs.Load(file))); } else if (await ExeFs.IsExeFs(file)) { Container = new SingleNcchPartitionContainer(new NcchPartition(exefs: await ExeFs.Load(file))); } else { throw new BadImageFormatException(Properties.Resources.ThreeDsRom_UnsupportedFileFormat); } }
public ThreeDsRom(NcchPartition ncch, int partitionIndex = 0) { Container = new SingleNcchPartitionContainer(ncch, partitionIndex); }
public ThreeDsRom(ExeFs exefs, int partitionIndex = 0) { Container = new SingleNcchPartitionContainer(new NcchPartition(exefs: exefs), partitionIndex); }
public ThreeDsRom(RomFs romFs, int partitionIndex = 0) { Container = new SingleNcchPartitionContainer(new NcchPartition(romFs), partitionIndex); }
public ThreeDsRom(RomFs romFs) { Container = new SingleNcchPartitionContainer(new NcchPartition(romFs)); }