Esempio n. 1
0
        public void RomSizeDictionary_WhenCSVFileExists_ContructsRomNameDictionary()
        {
            var expected = typeof(RomSizeDictionary);
            var result   = new RomSizeDictionary(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "snesromsizes.csv"));

            Assert.IsType(expected, result);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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;
        }
Esempio n. 5
0
        /// <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;
        }