Exemple #1
0
        public static DiscInspector GetSaturnInfo(string path)
        {
            try
            {
                DiscInspector d = DiscInspector.ScanSaturn(path);
                if (d != null)
                {
                    return(d);
                }
            }
            catch
            {
                return(null);
            }

            return(null);
        }
Exemple #2
0
        public static DiscInspector ScanDiscGame(string path)
        {
            try
            {
                DiscInspector d = DiscInspector.ScanDisc(path);
                if (d != null)
                {
                    return(d);
                }
            }
            catch
            {
                return(null);
            }

            return(null);
        }
Exemple #3
0
        public static DiscInspector CDiParser(DiscInspector di)
        {
            if (!File.Exists(di.CuePath))
            {
                return(null);
            }

            using (FileStream stream = File.Open(di.CuePath, FileMode.Open))
            {
                // try and detect dreamcast
                long headerPos = GetHeaderOffset(stream);
                stream.Seek(headerPos, SeekOrigin.Begin);
                byte[] buffer    = new byte[0x100];
                byte[] detection = new byte[0x10];
                stream.Read(buffer, 0, buffer.Length);
                Array.Copy(buffer, 0x0, detection, 0, detection.Length);
                string detStr = (Encoding.UTF8.GetString(detection));

                // internal name
                stream.Seek(headerPos, SeekOrigin.Begin);
                buffer = new byte[0x100];
                byte[] internalName = new byte[0x80];
                stream.Read(buffer, 0, buffer.Length);
                Array.Copy(buffer, 0x80, internalName, 0, internalName.Length);
                string intName = (Encoding.UTF8.GetString(internalName));

                string buffStr = (Encoding.UTF8.GetString(buffer));

                byte[] data = new byte[0x9];
                stream.Read(buffer, 0, buffer.Length);
                Array.Copy(buffer, 0x40, data, 0, data.Length);

                /*
                 * header = 0x0 SEGA SEGAKATANA for 0x10 bytes (0xF bytes without 0x20 space)
                 * internal name = 0x80 for 0x80 bytes
                 * serial number (id) = 0x40 for 9 bytes
                 */



                string res = (Encoding.UTF8.GetString(data));

                return(di);
            }
        }
Exemple #4
0
        /// <summary>
        /// returns the PSX serial - Bizhawk DiscSystem requires either cue, ccd or iso (not bin or img)
        /// </summary>
        /// <param name="path"></param>
        /// <returns></returns>
        public static string GetPSXSerial(string path)
        {
            try
            {
                DiscInspector d = DiscInspector.ScanPSX(path);

                if (d != null)
                {
                    if (d.Data.SerialNumber != null)
                    {
                        return(d.Data.SerialNumber.ToUpper());
                    }
                }
            }
            catch
            {
                return(null);
            }

            return(null);
        }
Exemple #5
0
        public static void ParsePSPData(DiscInspector di, SFO sfo)
        {
            PSPData data = new PSPData();

            foreach (var p in sfo.Parameters)
            {
                switch (p.Name)
                {
                case "APP_VER": data.APP_VER = p.ValueString; break;

                case "ATTRIBUTE": data.ATTRIBUTE = p.ValueInt.GetValueOrDefault(); break;

                case "BOOTABLE": data.BOOTABLE = p.ValueInt.GetValueOrDefault() != 0; break;

                case "CATEGORY": data.CATEGORY = GetPSPCategory(p.ValueString); break;

                case "DISC_ID": data.DISC_ID = FormatDiscID(p.ValueString); break;

                case "DISC_NUMBER": data.DISC_NUMBER = p.ValueInt.GetValueOrDefault(); break;

                case "DISC_TOTAL": data.DISC_TOTAL = p.ValueInt.GetValueOrDefault(); break;

                case "DISC_VERSION": data.DISC_VERSION = p.ValueString; break;

                case "DRIVER_PATH": data.DRIVER_PATH = p.ValueString; break;

                case "HRKGMP_VER": data.HRKGMP_VER = p.ValueInt.GetValueOrDefault(); break;

                case "LICENSE": data.LICENSE = p.ValueString; break;

                case "MEMSIZE": data.MEMSIZE = p.ValueInt.GetValueOrDefault(); break;

                case "LANGUAGE": data.LANGUAGE = p.ValueString; break;

                case "PARENTAL_LEVEL": data.PARENTAL_LEVEL = p.ValueInt.GetValueOrDefault(); break;

                case "PBOOT_TITLE": data.PBOOT_TITLE = p.ValueString; break;

                case "PSP_SYSTEM_VER": data.PSP_SYSTEM_VER = p.ValueString; break;

                case "REGION": data.REGION = p.ValueInt.GetValueOrDefault(); break;

                case "TITLE": data.TITLE = p.ValueString; break;

                case "TITLE_0": data.TITLE_0 = p.ValueString; break;

                case "TITLE_10": data.TITLE_10 = p.ValueString; break;

                case "TITLE_11": data.TITLE_11 = p.ValueString; break;

                case "TITLE_2": data.TITLE_2 = p.ValueString; break;

                case "TITLE_3": data.TITLE_3 = p.ValueString; break;

                case "TITLE_4": data.TITLE_4 = p.ValueString; break;

                case "TITLE_5": data.TITLE_5 = p.ValueString; break;

                case "TITLE_6": data.TITLE_6 = p.ValueString; break;

                case "TITLE_7": data.TITLE_7 = p.ValueString; break;

                case "TITLE_8": data.TITLE_8 = p.ValueString; break;

                case "TITLE_9": data.TITLE_9 = p.ValueString; break;

                case "UPDATER_VER": data.UPDATER_VER = p.ValueString; break;

                case "USE_USB": data.USE_USB = p.ValueInt.GetValueOrDefault() != 0; break;
                }
            }

            di.Data._PSPData = data;
        }
Exemple #6
0
 public static void ParseCDiData(DiscInspector di, SFO sfo)
 {
 }
Exemple #7
0
        static void Main(string[] args)
        {
            //DiscInspector.test();

            //string dcPath = @"G:\_Emulation\Dreamcast\games\Daytona_USA_USA_DC-ECHELON\E-DAYUSA.cue";
            //string dcPath = @"G:\_Emulation\Dreamcast\games\Sword_Of_The_Berserk_USA_DC-KALISTO\kal-sotb.cue";
            //string dcPath = @"G:\_Emulation\Dreamcast\games\Sword_Of_The_Berserk_USA_DC-KALISTO\kal-sotb.cdi";
            //string dcPath = @"G:\_Emulation\Dreamcast\games\Sega_Rally_2_Championship_USA_DC-KALISTO\KAL-SR2.CUE";
            //string dcPath = @"G:\_Emulation\PSX\iso\Legend of Mana (USA)\Legend of Mana (USA).cue";
            //string dcPath = @"G:\_Emulation\Sega Saturn\disks\ws-gals_panic.cue";
            //string dcPath = @"G:\_Emulation\NeoGeo CD\discs\Metal Slug (1996)(SNK)(Jp-US)[!].cue";
            //string dcPath = @"G:\_Emulation\NeoGeo CD\discs\Breakers (1997)(Visco)(Jp)[!].cue";
            //string dcPath = @"G:\_Emulation\Philips CD-i\discs\Hotel Mario.cue";
            //string dcPath = @"G:\_Emulation\Sega Megadrive - 32x - SegaCD\discs\segacd\Shining Force CD (Sega CD) (U)-redump.cue";
            //string dcPath = @"G:\_Emulation\Sega Saturn\disks\Primal Rage (Europe) (En,Fr,De,Es,It,Pt)\Primal Rage (Europe) (En,Fr,De,Es,It,Pt).cue";
            //string dcPath = @"G:\_Emulation\PCFX\Games\Battle Heat\Battle Heat.cue";
            //string dcPath = @"G:\_Emulation\PCFX\Games\Angelique Special\Angelique Special.cue";


            //string dcPath = @"G:\_Emulation\Philips CD-i\discs\Zombie Dinos.cue";


            //string dcPath = @"G:\_Emulation\PSX\iso\Metal Gear Solid - Integral (J) [SLPM-86247]\Metal Gear Solid - Integral (J) (Disc 1) [SLPM-86247].cue";
            //string dcPath = @"G:\_Emulation\PC Engine\discs\Cyber_City_OEDO_808_(NTSC-J)_[NSCD0003]\Cyber_City_OEDO_808_(NTSC-J)_[NSCD0003].cue";
            //string dcPath = @"G:\_Emulation\Sega Saturn\disks\Virtua Fighter CG Portrait Series Vol1 Sarah Bryant (J) [!]\Virtua Fighter CG Portrait Series Vol1 Sarah Bryant (J) [!] [SegaSaturn].CCD";

            //var cdi = DiscInspector.ScanCDi(@"G:\_Emulation\Philips CD-i\discs\Zombie Dinos.cue");
            //var psx = DiscInspector.ScanPSX(@"G:\_Emulation\PSX\iso\Metal Gear Solid - Integral (J) [SLPM-86247]\Metal Gear Solid - Integral (J) (Disc 1) [SLPM-86247].cue");
            //var saturn = DiscInspector.ScanSaturn(@"G:\_Emulation\Sega Saturn\disks\Primal Rage (Europe) (En,Fr,De,Es,It,Pt)\Primal Rage (Europe) (En,Fr,De,Es,It,Pt).cue");
            //var pcecd = DiscInspector.ScanPCECD(@"G:\_Emulation\PC Engine\discs\Godzilla [U][SCD][TGXCD1051][Toho][1993][PCE]\Godzilla [U][SCD][TGXCD1051][Toho][1993][PCE].cue");
            //var pcecd = DiscInspector.ScanPCECD(@"G:\_Emulation\PC Engine\discs\Cyber_City_OEDO_808_(NTSC-J)_[NSCD0003]\Cyber_City_OEDO_808_(NTSC-J)_[NSCD0003].cue");
            //var pcfx = DiscInspector.ScanPCFX(@"G:\_Emulation\PCFX\Games\Angelique Special\Angelique Special.cue");
            //var segacd = DiscInspector.ScanSegaCD(@"G:\_Emulation\Sega Megadrive - 32x - SegaCD\discs\segacd\Shining Force CD (Sega CD) (U)-redump.cue");
            //var neogeo = DiscInspector.ScanNeoGeoCD(@"G:\_Emulation\NeoGeo CD\discs\Breakers (1997)(Visco)(Jp)[!].cue");
            //var dreamcast = DiscInspector.ScanDreamcast(@"G:\_Emulation\Dreamcast\games\Daytona_USA_USA_DC-ECHELON\E-DAYUSA.cue1");

            //string dcPath = @"G:\_Emulation\PSX\iso\Alien Trilogy (E) [SLES-00101]\Alien Trilogy (E) [SLES-00101]\Alien Trilogy (E) [SLES-00101].cue";
            // string dcPath = @"G:\_Emulation\PC Engine\discs\L-Dis (1991)(Masaya - NCS)(JP).ccd";

            //DiscInspector.UnknownTest();

            //string dcPath = @"G:\_Emulation\Panasonic 3DO\Need for Speed, The (1994)(Electronic Arts)(US)[A1115 CC 735507-2 R70].cue";
            //string dcPath = @"G:\_Emulation\Sega Saturn\disks\ws-gals_panic.cue";
            //string dcPath = @"G:\_Emulation\Commadore Amiga\cd32\Zool - Ninja of the 'Nth' Dimension (1993)(Gremlin)[!].cue";
            //string dcPath = @"C:\Users\matt\Desktop\test1\Angelique Special.cue";

            //string dcPath = @"G:\_Emulation\Commadore Amiga\cdtv\Nemac IV - Director's Cut (1996)(ZenTek)[!].cue";

            //string dcPath = @"G:\_Emulation\Bandai Playdia\Aqua Adventure - Blue Lilty (1994)(Bandai)(JP)[!].cue";
            //string dcPath = @"G:\_Emulation\Bandai Playdia\Ultraman - Hiragana Dai Sakusen (1992)(Bandai)(JP).cue";

            //string dcPath = @"C:\Users\admin\Downloads\Snatcher_(NTSC-J)_[KMCD2002]\Snatcher_(NTSC-J)_[KMCD2002].cue";
            //string dcPath = @"C:\Users\admin\Downloads\Snatcher_(NTSC-J)_[KMCD2002]\Kisou_Louga_(NTSC-J)_[KSCD3004].cue";
            //string dcPath = @"C:\Users\admin\Downloads\Snatcher_(NTSC-J)_[KMCD2002]\Dragon_Ball_Z_-_Idainaru_Son_Gokuu_Densetsu_(NTSC-J)_[BNCD4001].cue";

            //string dcPath = @"G:\_Emulation\Dreamcast\games\Dead_or_Alive_2_USA_DC-UTOPIA\dead2.cdi";
            // string dcPath = @"G:\_Emulation\Gamecube - Wii\disks\Mortal Kombat - Deadly Alliance (Europe).iso";
            //string dcPath = @"G:\_Emulation\Gamecube - Wii\wii\Super Mario Galaxy 2 WII PAL MULTI5.iso";

            //string dcPath = @"G:\_Emulation\PS2\Games\Gran Turismo 4 (USA)\Gran Turismo 4 (USA).iso";

            //string dcPath = @"G:\_Emulation\PS2\Games\Grand Theft Auto III (Europe) (En,Fr,De,Es,It) (v1.60)\Grand Theft Auto III (Europe) (En,Fr,De,Es,It) (v1.60).iso";

            //string dcPath = @"G:\_Emulation\PS2\Games\Dark Wind (Europe) (En,Fr,De,Es,It)\Dark Wind (Europe) (En,Fr,De,Es,It).cue";

            //string dcPath = @"C:\Users\admin\Downloads\Speed Power Gunbike (Japan) [SLPS-01066]\Speed Power Gunbike (Japan) [SLPS-01066].cue";
            //string dcPath = @"C:\Users\admin\Downloads\Rakugaki Showtime (Japan) [SLPM-86272]\Rakugaki Showtime (Japan) [SLPM-86272].cue";

            //string dcPath = @"G:\_Emulation\psp\Ace_Combat_Joint_Assault_EUR_PSP-RoME\rm-acja.iso";
            // string dcPath = @"G:\_Emulation\psp\Star_Ocean_Second_Evolution_USA_PSP-PSPKiNG\pspking-sose.ISO";

            //string dcPath = @"G:\_Emulation\PSX\iso\Alien Trilogy (E) [SLES-00101]\Alien Trilogy (E) [SLES-00101].cue";
            //string dcPath = @"G:\_Emulation\PSX\iso\Cool Boarders 2 (USA)\Cool Boarders 2 (USA)2.cue";


            //string dcPath = @"G:\_Emulation\FM Towns\marty\Dungeon Master II for FM-Towns.cue";
            //string dcPath = @"G:\_Emulation\FM Towns\marty\Dungeon.Master.ISO.FM-Towns-OpTiMaL.cue";

            string dcPath = @"G:\_Emulation\PSX\iso\Thunder Storm & Road Blaster (Japan) (Disc 1) (Thunder Storm).cue";
            //var psx = DiscInspector.ScanPSX(dcPath);
            var dc = DiscInspector.ScanDisc(dcPath);

            string stop = "";

            /*
             * //string neocdPath = @"G:\_Emulation\NeoGeo CD\discs\Metal Slug (1996)(SNK)(Jp-US)[!].cue";
             * string neocdPath = @"G:\_Emulation\NeoGeo CD\discs\Breakers (1997)(Visco)(Jp)[!].cue";
             * var neocd = new DiscInspector(neocdPath);
             *
             * string cdiPath = @"G:\_Emulation\Philips CD-i\discs\Hotel Mario.cue";
             * //string cdiPath = @"G:\_Emulation\Philips CD-i\discs\Zombie Dinos.cue";
             * var cdi = new DiscInspector(cdiPath);
             *
             * string sega = @"G:\_Emulation\Sega Megadrive - 32x - SegaCD\discs\segacd\sonic_cd_-_sega_cd_MK-4407_(redump).cue";
             * var sDisc = new DiscInspector(sega);
             *
             * sega = @"G:\_Emulation\Sega Megadrive - 32x - SegaCD\discs\segacd\Shining Force CD (Sega CD) (U)-redump.cue";
             * var sDisc2 = new DiscInspector(sega);
             *
             * string baseFolder = @"G:\_Emulation";
             * string[] discFolders = new string[]
             * {
             *  "\\PC Engine",
             *  "\\PCFX",
             *  "\\PSX",
             *  "\\Sega Saturn"
             * };
             *
             * List<string> files = new List<string>();
             *
             * foreach (var f in discFolders)
             * {
             *  List<string> allFiles = System.IO.Directory.GetFiles(baseFolder + f, "*.*", System.IO.SearchOption.AllDirectories)
             *  .Where(a => System.IO.Path.GetExtension(a).ToLower() == ".cue" ||
             *  System.IO.Path.GetExtension(a).ToLower() == ".ccd" ||
             *  System.IO.Path.GetExtension(a).ToLower() == ".toc").ToList();
             *
             *  files.AddRange(allFiles);
             * }
             *
             * List<DiscInspector> psx = new List<DiscInspector>();
             * List<DiscInspector> ss = new List<DiscInspector>();
             * List<DiscInspector> pce = new List<DiscInspector>();
             * List<DiscInspector> pcfx = new List<DiscInspector>();
             * List<DiscInspector> unknownOrAudio = new List<DiscInspector>();
             *
             *
             * foreach (var s in files)
             * {
             *  try
             *  {
             *      var DISC = new DiscInspector(s);
             *      if (DISC == null)
             *          continue;
             *      if (DISC.Data == null)
             *          continue;
             *
             *      switch (DISC.DetectedDiscType)
             *      {
             *          case DetectedDiscType.PCFX:
             *              pcfx.Add(DISC);
             *              break;
             *          case DetectedDiscType.SegaSaturn:
             *              ss.Add(DISC);
             *              break;
             *          case DetectedDiscType.SonyPSX:
             *              psx.Add(DISC);
             *              break;
             *          case DetectedDiscType.SegaCD:
             *              pce.Add(DISC);
             *              break;
             *          default:
             *              unknownOrAudio.Add(DISC);
             *              break;
             *      }
             *  }
             *
             *  catch
             *  {
             *      continue;
             *  }
             *
             * }
             */

            Console.ReadKey();
        }