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

            Assert.IsType(expected, result);
        }
        public GbaVcExtractor(string dumpPath, PsbFile psbFile)
        {
            string gbaDictionaryPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, GBA_DICTIONARY_CSV_PATH);

            gbaDictionary = new RomNameDictionary(gbaDictionaryPath);

            this.psbFile = psbFile;
        }
Esempio n. 3
0
        public void GetRomName_WhenIDDoesNotExist_ReturnsEmptyString()
        {
            var dictionary = new RomNameDictionary(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "snesromnames.csv"));

            var result = dictionary.GetRomName("WUP-JUNKANDSUCH");

            Assert.Equal(string.Empty, result);
        }
Esempio n. 4
0
        public void GetRomName_WhenIDExists_ReturnsRomName()
        {
            var dictionary = new RomNameDictionary(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "snesromnames.csv"));

            var result = dictionary.GetRomName("WUP-JDBE");

            Assert.Equal("Rival Turf", result);
        }
Esempio n. 5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GbaVcExtractor"/> class.
        /// </summary>
        /// <param name="psbFile">PSB file to parse.</param>
        /// <param name="verbose">whether to provide verbose output.</param>
        public GbaVcExtractor(PsbFile psbFile, bool verbose = false)
        {
            this.verbose = verbose;
            string gbaDictionaryPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, GbaDictionaryCsvPath);

            this.gbaDictionary = new RomNameDictionary(gbaDictionaryPath);

            this.psbFile = psbFile;
        }
Esempio n. 6
0
        public NesVcExtractor(string dumpPath, RpxFile rpxFile)
        {
            string nesDictionaryPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, NES_DICTIONARY_CSV_PATH);

            nesDictionary  = new RomNameDictionary(nesDictionaryPath);
            nesRomHeader   = new byte[NES_HEADER_LENGTH];
            romPosition    = 0;
            vcNamePosition = 0;

            this.rpxFile = rpxFile;
        }
Esempio n. 7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NesVcExtractor"/> class.
        /// </summary>
        /// <param name="rpxFile">RPX file to parse.</param>
        /// <param name="verbose">whether to provide verbose output.</param>
        public NesVcExtractor(RpxFile rpxFile, bool verbose = false)
        {
            this.verbose = verbose;
            string nesDictionaryPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, NesDictionaryCsvPath);

            this.nesDictionary  = new RomNameDictionary(nesDictionaryPath);
            this.nesRomHeader   = new byte[NesHeaderLength];
            this.romPosition    = 0;
            this.vcNamePosition = 0;

            this.rpxFile = rpxFile;
        }
        public SnesVcExtractor(string dumpPath, RpxFile rpxFile)
        {
            string snesDictionaryPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, SNES_DICTIONARY_CSV_PATH);

            snesDictionary  = new RomNameDictionary(snesDictionaryPath);
            snesLoRomHeader = new byte[SNES_HEADER_LENGTH];
            snesHiRomHeader = new byte[SNES_HEADER_LENGTH];
            headerType      = SnesHeaderType.NotDetermined;
            romPosition     = 0;
            vcNamePosition  = 0;

            this.rpxFile = rpxFile;
        }
Esempio n. 9
0
        public FdsVcExtractor(RpxFile rpxFile, bool verbose = false)
        {
            this.verbose = verbose;
            string nesDictionaryPath = Path.Combine(
                AppDomain.CurrentDomain.BaseDirectory, NES_DICTIONARY_CSV_PATH);

            nesDictionary  = new RomNameDictionary(nesDictionaryPath);
            fdsRomHeader   = new byte[FDS_HEADER_LENGTH];
            romPosition    = 0;
            vcNamePosition = 0;
            numberOfSides  = 1;

            this.rpxFile = rpxFile;
        }
Esempio n. 10
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. 11
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;
        }