public void RomSizeDictionary_WhenCSVFileExists_ContructsRomNameDictionary() { var expected = typeof(RomSizeDictionary); var result = new RomSizeDictionary(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "snesromsizes.csv")); Assert.IsType(expected, result); }
public void GetRomName_WhenRomNameDoesNotExist_ReturnsMaxRomSize() { var dictionary = new RomSizeDictionary(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "snesromsizes.csv")); var result = dictionary.GetRomSize("WUP-JUNKANDSUCH", 1024000); Assert.Equal(1024000, result); }
public void GetRomSize_WhenRomNameExists_ReturnsRomSize() { var dictionary = new RomSizeDictionary(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "snesromsizes.csv")); var result = dictionary.GetRomSize("ROCKMAN SOCCER"); Assert.Equal(1310720, result); }
public SnesVcExtractor(string decompressedRomPath, bool verbose = false) { this.verbose = verbose; string snesDictionaryPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, SNES_DICTIONARY_CSV_PATH); string snesSizePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, SNES_SIZE_CSV_PATH); snesDictionary = new RomNameDictionary(snesDictionaryPath); snesSizeDictionary = new RomSizeDictionary(snesSizePath); snesLoRomHeader = new byte[SNES_HEADER_LENGTH]; snesHiRomHeader = new byte[SNES_HEADER_LENGTH]; headerType = SnesHeaderType.NotDetermined; romPosition = 0; vcNamePosition = 0; this.decompressedRomPath = decompressedRomPath; }
/// <summary> /// Initializes a new instance of the <see cref="SnesVcExtractor"/> class. /// </summary> /// <param name="decompressedRomPath">path to the decompressed rom.</param> /// <param name="verbose">whether to provide verbose output.</param> public SnesVcExtractor(string decompressedRomPath, bool verbose = false) { this.verbose = verbose; string snesDictionaryPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, SnesDictionaryCsvPath); string snesSizePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, SnesSizeCsvPath); this.snesDictionary = new RomNameDictionary(snesDictionaryPath); this.snesSizeDictionary = new RomSizeDictionary(snesSizePath); this.snesLoRomHeader = new byte[SnesHeaderLength]; this.snesHiRomHeader = new byte[SnesHeaderLength]; this.headerType = SnesHeaderType.NotDetermined; this.romPosition = 0; this.vcNamePosition = 0; this.sdd1Offset = 0; this.sdd1OffsetPosition = 0; this.fileSize = 0; this.fileSizePosition = 0; this.decompressedRomPath = decompressedRomPath; }