Exemplo n.º 1
0
        public static bool ExistsFile(this NDS.Nitro.NDS ROM, string Name, SFSDirectory Dir)
        {
            bool ex = false;

            if (Dir.Files.Count > 0)
            {
                foreach (var file in Dir.Files)
                {
                    if (file.FileName == Name)
                    {
                        ex = true;
                        break;
                    }
                }
            }
            if (!ex)
            {
                if (Dir.SubDirectories.Count > 0)
                {
                    foreach (var dir in Dir.SubDirectories)
                    {
                        bool ex2 = ROM.ExistsFile(Name, dir);
                        if (ex2)
                        {
                            ex = true;
                            break;
                        }
                    }
                }
            }
            return(ex);
        }
Exemplo n.º 2
0
        public static string GetTitleNameByLanguage(this NDS.Nitro.NDS ROM)
        {
            int    idx  = 1;
            string lang = Thread.CurrentThread.CurrentUICulture.Name;

            if (lang.StartsWith("ja-"))
            {
                idx = 0;
            }
            else if (lang.StartsWith("fr-"))
            {
                idx = 2;
            }
            else if (lang.StartsWith("de-"))
            {
                idx = 3;
            }
            else if (lang.StartsWith("it-"))
            {
                idx = 4;
            }
            else if (lang.StartsWith("es-"))
            {
                idx = 5;
            }
            return(ROM.Banner.Banner.GameName[idx]);
        }
Exemplo n.º 3
0
        public static void TryLoad(string path)
        {
            var rom = new EFEROM(SystemFile.ReadAllBytes(path));

            // Ensure the filesystem is valid
            rom.ToFileSystem();
            // Check its a valid MKDS ROM
            if (!rom.IsMKDS())
            {
                throw new NotMKDSROMException();
            }
            ROM = new ROMObject(path, rom);
        }
Exemplo n.º 4
0
 public static NDS.Nitro.NDS LoadROM(string Path)
 {
     NDS.Nitro.NDS rom;
     try
     {
         rom = new NDS.Nitro.NDS(File.ReadAllBytes(Path));
         var tmpfs = rom.ToFileSystem();
     }
     catch
     {
         rom = null;
     }
     return(rom);
 }
Exemplo n.º 5
0
        public static bool IsMKDS(this NDS.Nitro.NDS ROM)
        {
            bool ismk = true;
            var  root = ROM.ToFileSystem();

            foreach (var file in SomeMKDSFiles)
            {
                if (!ROM.ExistsFile(file, root))
                {
                    ismk = false;
                    break;
                }
            }
            return(ismk);
        }
Exemplo n.º 6
0
 public ROMObject(string path, EFEROM rom)
 {
     Path = path;
     ROM  = rom;
     Load();
 }