FindMaps() 공개 메소드

public FindMaps ( System.Util tableSearchRange, IList &list2D, IList &list3D ) : void
tableSearchRange System.Util
list2D IList
list3D IList
리턴 void
예제 #1
0
        public void LoadRom(string path)
        {
            romLoaded = false;
            rom       = new Subaru.File.Rom(path);

            string xmlPath   = PathWithNewExtension(path, ".xml");
            bool   xmlExists = System.IO.File.Exists(xmlPath);

            Subaru.File.RomXml romXml = null;
            if (xmlExists)
            {
                Console.WriteLine("Loading existing XML file " + xmlPath);
                romXml = new Subaru.File.RomXml();
                romXml.Load(xmlPath);
                romMetadata = romXml.RomMetadata;

                tableSearchStart = romXml.TableSearchStart;
                tableSearchEnd   = romXml.TableSearchEnd > romXml.TableSearchStart ? romXml.TableSearchEnd : int.MaxValue;
            }
            else
            {
                Console.WriteLine("No existing XML file has been found!");
                romXml      = null;
                romMetadata = new RomMetadata();
                // search through whole ROM file
                tableSearchStart = 0;
                tableSearchEnd   = int.MaxValue;
            }

            // correct tableSearchEnd if necessary
            tableSearchEnd = tableSearchEnd > tableSearchStart ? tableSearchEnd : int.MaxValue;

            romMetadata.Filesize = (int)rom.Stream.Length;
            //int calIDpos = romMetadata.CalibrationIDPos;

            calIDfromRom = romMetadata.CalibrationIDPos != 0 ? rom.ReadASCII(romMetadata.CalibrationIDPos, 8) : "Unknown";
            if (calIDfromRom != romMetadata.CalibrationID)
            {
                Console.Error.WriteLine("WARNING: Calibration ID mismatch");
            }

            if (this.ProgressChanged != null)
            {
                rom.ProgressChanged += OnProgressChanged;
            }

            rom.FindMaps(tableSearchStart, tableSearchEnd, out list2D, out list3D);

            rom.ProgressChanged -= OnProgressChanged;

            romLoaded = true;

            if (romXml != null)
            {
                romXml.RomStream = rom.Stream;
                romXml.TryMergeWith(list2D);
                romXml.TryMergeWith(list3D);
            }
        }
예제 #2
0
파일: Data.cs 프로젝트: spegelref/ScoobyRom
        public void LoadRom(string path)
        {
            romLoaded = false;
            rom       = new Subaru.File.Rom(path);

            rom.FindMetadata();

            string xmlPath   = PathWithNewExtension(path, ".xml");
            bool   xmlExists = System.IO.File.Exists(xmlPath);

            DataFile.RomXml romXml = null;
            if (xmlExists)
            {
                Console.WriteLine("Loading existing XML file " + xmlPath);
                romXml = new DataFile.RomXml();
                romXml.Load(xmlPath);
                romMetadata      = romXml.RomMetadata;
                tableSearchRange = romXml.TableSearchRange;
            }
            else
            {
                Console.WriteLine("No existing XML file has been found!");
                romXml           = null;
                romMetadata      = new DataFile.RomMetadata();
                tableSearchRange = null;
            }

            romMetadata.Filesize = rom.Size;
            int calIDpos = romMetadata.CalibrationIDPos;

            calIDfromRom = calIDpos != 0 ? rom.ReadASCII(calIDpos, 8) : "Unknown";
            if (calIDfromRom != romMetadata.CalibrationID)
            {
                Console.Error.WriteLine("WARNING: Calibration ID mismatch");
            }

            if (this.ProgressChanged != null)
            {
                rom.ProgressChanged += OnProgressChanged;
            }

            rom.FindMaps(tableSearchRange, out list2D, out list3D);

            rom.ProgressChanged -= OnProgressChanged;

            romLoaded = true;

            if (romXml != null)
            {
                romXml.RomStream = rom.Stream;
                romXml.TryMergeWith(list2D);
                romXml.TryMergeWith(list3D);
            }

            //PrintSharedStatistics ();
        }
예제 #3
0
        public void LoadRom(string path)
        {
            romLoaded = false;
            rom = new Subaru.File.Rom (path);

            rom.FindMetadata ();

            string xmlPath = PathWithNewExtension (path, ".xml");
            bool xmlExists = System.IO.File.Exists (xmlPath);

            DataFile.RomXml romXml = null;
            if (xmlExists) {
                Console.WriteLine ("Loading existing XML file " + xmlPath);
                romXml = new DataFile.RomXml ();
                romXml.Load (xmlPath);
                romMetadata = romXml.RomMetadata;
                tableSearchRange = romXml.TableSearchRange;
            } else {
                Console.WriteLine ("No existing XML file has been found!");
                romXml = null;
                romMetadata = new DataFile.RomMetadata ();
                tableSearchRange = null;
            }

            romMetadata.Filesize = rom.Size;
            int calIDpos = romMetadata.CalibrationIDPos;

            calIDfromRom = calIDpos != 0 ? rom.ReadASCII (calIDpos, 8) : "Unknown";
            if (calIDfromRom != romMetadata.CalibrationID)
                Console.Error.WriteLine ("WARNING: Calibration ID mismatch");

            if (this.ProgressChanged != null)
                rom.ProgressChanged += OnProgressChanged;

            rom.FindMaps (tableSearchRange, out list2D, out list3D);

            rom.ProgressChanged -= OnProgressChanged;

            romLoaded = true;

            if (romXml != null) {
                romXml.RomStream = rom.Stream;
                romXml.TryMergeWith (list2D);
                romXml.TryMergeWith (list3D);
            }

            //PrintSharedStatistics ();
        }
예제 #4
0
        public void LoadRom(string path)
        {
            romLoaded = false;
            rom = new Subaru.File.Rom (path);

            string xmlPath = PathWithNewExtension (path, ".xml");
            bool xmlExists = System.IO.File.Exists (xmlPath);

            Subaru.File.RomXml romXml = null;
            if (xmlExists) {
                Console.WriteLine ("Loading existing XML file " + xmlPath);
                romXml = new Subaru.File.RomXml ();
                romXml.Load (xmlPath);
                romMetadata = romXml.RomMetadata;

                tableSearchStart = romXml.TableSearchStart;
                tableSearchEnd = romXml.TableSearchEnd > romXml.TableSearchStart ? romXml.TableSearchEnd : int.MaxValue;
            } else {
                Console.WriteLine ("No existing XML file has been found!");
                romXml = null;
                romMetadata = new RomMetadata ();
                // search through whole ROM file
                tableSearchStart = 0;
                tableSearchEnd = int.MaxValue;
            }

            // correct tableSearchEnd if necessary
            tableSearchEnd = tableSearchEnd > tableSearchStart ? tableSearchEnd : int.MaxValue;

            romMetadata.Filesize = (int)rom.Stream.Length;
            //int calIDpos = romMetadata.CalibrationIDPos;

            calIDfromRom = romMetadata.CalibrationIDPos != 0 ? rom.ReadASCII (romMetadata.CalibrationIDPos, 8) : "Unknown";
            if (calIDfromRom != romMetadata.CalibrationID)
                Console.Error.WriteLine ("WARNING: Calibration ID mismatch");

            if (this.ProgressChanged != null)
                rom.ProgressChanged += OnProgressChanged;

            rom.FindMaps (tableSearchStart, tableSearchEnd, out list2D, out list3D);

            rom.ProgressChanged -= OnProgressChanged;

            romLoaded = true;

            if (romXml != null) {
                romXml.RomStream = rom.Stream;
                romXml.TryMergeWith (list2D);
                romXml.TryMergeWith (list3D);
            }
        }