/// <summary> /// Read the file system of the ROM and create the folder tree. /// </summary> /// <param name="str">Stream to read the file system.</param> public override void Read(DataStream str) { // Read File Allocation Table // I'm creating a new DataStream variable because Fat class needs to know its length. DataStream fatStr = new DataStream(str, this.header.FatOffset, this.header.FatSize); Fat fat = new Fat(); fat.Read(fatStr); fatStr.Dispose(); // Read File Name Table str.Seek(header.FntOffset, SeekMode.Origin); Fnt fnt = new Fnt(); fnt.Read(str); // Get root folder this.root = fnt.CreateTree(fat.GetFiles()); // Get ARM and Overlay files this.sysFolder = new GameFolder("System"); this.sysFolder.AddFile(ArmFile.FromStream(str, this.header, true)); this.sysFolder.AddFolder(OverlayFolder.FromTable(str, this.header, true, fat.GetFiles())); this.sysFolder.AddFile(ArmFile.FromStream(str, this.header, false)); this.sysFolder.AddFolder(OverlayFolder.FromTable(str, this.header, false, fat.GetFiles())); }