public void D64_SingleFile() { var image = CreateD64Image( "CBM.COM", 18, 1, new Dictionary <int, byte[]> { { SectorRef(18, 1), Sector( DirEntry( 0, 0xFF, FileType.PRG | FileType.Locked, 19, 0, "FOO", 1)) }, { SectorRef(19, 0), Sector( new byte[] { 0, 0xD }, Encoding.ASCII.GetBytes("Hello world")) } }); var loader = new D64Loader(sc, "CBM.COM", image); var items = loader.LoadDiskDirectory(); Assert.AreEqual(1, items.Count); var file = (ArchivedFile)items[0]; Assert.AreEqual("Hello world", Encoding.ASCII.GetString(file.GetBytes())); }
public void D64_EmptyImage() { var image = CreateD64Image( "CBM.COM", 0, 0, new Dictionary <int, byte[]>()); var loader = new D64Loader(sc, "CBM.COM", image); var items = loader.LoadDiskDirectory(); Assert.AreEqual(0, items.Count); }
public void D64_EmptyImage() { var image = CreateD64Image( "CBM.COM", 0, 0, new Dictionary <int, byte[]>()); var loader = new D64Loader(sc, ImageLocation.FromUri("file:CBM.COM"), image); var archive = loader.LoadDiskDirectory(); Assert.AreEqual(0, archive.RootEntries.Count); }
private int SectorRef(byte track, byte sector) { return(D64Loader.SectorOffset(track, sector)); }