Example #1
0
        public static void RunGame(XmlNode game)
        {
            MainForm.ShowWaiting("Launching Game...");

            string name = XmlBinder.Eval(game, "@name");

            Process proc = new Process();

            proc.StartInfo.WorkingDirectory       = Config.MameDirectory;
            proc.StartInfo.FileName               = Config.MameDirectory + "mame.exe";
            proc.StartInfo.Arguments              = name;
            proc.StartInfo.CreateNoWindow         = true;
            proc.StartInfo.UseShellExecute        = false;
            proc.StartInfo.RedirectStandardOutput = true;
            //proc.StartInfo.RedirectStandardError = true;

            proc.Start();

            string output = proc.StandardOutput.ReadToEnd();

            proc.WaitForExit();

            //string error = proc.StandardError.ReadToEnd();
            //Console.WriteLine(error);

            //return output;

            MainForm.HideWaiting();
        }
Example #2
0
        public override void Refresh()
        {
            ArrayList[] groups = new ArrayList[27];

            for (int i = 0; i < groups.Length; i++)
            {
                groups[i] = new ArrayList();
            }

            foreach (XmlNode game in _master)
            {
                string val = XmlBinder.Eval(game, _field);

                if (val.Length == 0)
                {
                    val = "(unnamed)";
                }

                int  i     = 0;
                char first = val.ToUpper()[0];

                if (first >= 'a' && first <= 'z')
                {
                    i = first - 'a' + 1;
                }
                else if (first >= 'A' && first <= 'Z')
                {
                    i = first - 'A' + 1;
                }

                groups[i].Add(game);
            }

            Items.Clear();

            for (int i = 0; i < groups.Length; i++)
            {
                ArrayList group = groups[i];

                if (group.Count == 0)
                {
                    continue;
                }

                string name;

                if (i == 0)
                {
                    name = "#";
                }
                else
                {
                    name = ((char)(i - 1 + 'A')).ToString();
                }

                PodController c = new GameLeafController(_system, group, "description");
                Items.Add(new SimpleItem(name, null, c));
            }
        }
Example #3
0
        public void Reload()
        {
            _games.Clear();

            XmlNodeList games = _doc.SelectNodes("/nes/game");

            foreach (XmlNode game in games)
            {
                string name = XmlBinder.Eval(game, "@name");

                if (File.Exists(Config.NesDirectory + "roms\\" + name + ".nes"))
                {
                    _games.Add(game);
                }
            }
        }
Example #4
0
        public void Reload()
        {
            _games.Clear();

            XmlNodeList games = _doc.SelectNodes("/playstation/game");

            foreach (XmlNode game in games)
            {
                string name = XmlBinder.Eval(game, "@name");

                if (File.Exists(Config.PlaystationDirectory + "iso\\" + name + ".iso"))
                {
                    _games.Add(game);
                }
            }
        }
Example #5
0
        public void Reload()
        {
            _games.Clear();

            XmlNodeList games = _doc.SelectNodes("/mame/game[not(@runnable='no' or @cloneof)]");

            //XmlNodeList games = _doc.SelectNodes("/mame/game[not(@runnable='no')]");

            foreach (XmlNode game in games)
            {
                string name = XmlBinder.Eval(game, "@name");

                if (File.Exists(Config.MameDirectory + "roms\\" + name + ".zip"))
                {
                    _games.Add(game);
                }
            }
        }
Example #6
0
        public override void Refresh()
        {
            Hashtable hash = new Hashtable();

            foreach (XmlNode game in _master)
            {
                string val = XmlBinder.Eval(game, _field);

                if (val.Length == 0)
                {
                    val = "(n/a)";
                }

                ArrayList group = (ArrayList)hash[val];

                if (group == null)
                {
                    group     = new ArrayList();
                    hash[val] = group;
                }

                group.Add(game);
            }

            Items.Clear();

            foreach (string key in hash.Keys)
            {
                ArrayList group = (ArrayList)hash[key];

                if (group.Count > 20)
                {
                    PodController c = new AlphabetController(_system, group, "description");
                    Items.Add(new SimpleItem(key, null, c));
                }
                else
                {
                    PodController c = new GameLeafController(_system, group, "description");
                    Items.Add(new SimpleItem(key, null, c));
                }
            }

            Items.Sort(new PodItemComparer());
        }
Example #7
0
        public override void Refresh()
        {
            Items.Clear();

            foreach (XmlNode game in _master)
            {
                string val = XmlBinder.Eval(game, _field);

                if (val.Length == 0)
                {
                    val = "(unnamed)";
                }

                if (_findClones)
                {
                    XmlNodeList clones = game.SelectNodes("clones/game");
                    if (clones.Count > 0)
                    {
                        ArrayList group = new ArrayList();

                        group.Add(game);
                        foreach (XmlNode clone in clones)
                        {
                            group.Add(clone);
                        }

                        PodController c = new GameLeafController(_system, group, "description", false);
                        Items.Add(new GameItem(_system, game, val, c));

                        continue;
                    }
                }

                Items.Add(new GameItem(_system, game, val));
            }

            Items.Sort(new PodItemComparer());
        }
Example #8
0
        public static void RunGame(XmlNode game)
        {
            MainForm.ShowWaiting("Launching Game...");

            string name = XmlBinder.Eval(game, "@name");
            string args = "\"roms\\" + name + ".nes\"";

            Process proc = new Process();

            proc.StartInfo.WorkingDirectory = Config.NesDirectory;
            proc.StartInfo.FileName         = Config.NesDirectory + "nessie.exe";
            proc.StartInfo.Arguments        = args;
            proc.StartInfo.WindowStyle      = ProcessWindowStyle.Maximized;
            //proc.StartInfo.UseShellExecute = false;
            //proc.StartInfo.RedirectStandardOutput = true;

            proc.Start();

            //string output = proc.StandardOutput.ReadToEnd();

            proc.WaitForExit();

            MainForm.HideWaiting();
        }
Example #9
0
        public static void RunGame(XmlNode game)
        {
            MainForm.ShowWaiting("Launching Game...");

            string name = XmlBinder.Eval(game, "@name");
            string args = "-nogui -loadbin \"iso\\" + name + ".iso\"";

            Process proc = new Process();

            proc.StartInfo.WorkingDirectory       = Config.PlaystationDirectory;
            proc.StartInfo.FileName               = Config.PlaystationDirectory + "ePSXe.exe";
            proc.StartInfo.Arguments              = args;
            proc.StartInfo.CreateNoWindow         = true;
            proc.StartInfo.UseShellExecute        = false;
            proc.StartInfo.RedirectStandardOutput = true;

            proc.Start();

            string output = proc.StandardOutput.ReadToEnd();

            proc.WaitForExit();

            MainForm.HideWaiting();
        }
Example #10
0
        public static void RunGame(XmlNode game)
        {
            MainForm.ShowWaiting("Launching Game...");

            string name = XmlBinder.Eval(game, "@name");
            string args = "\"roms\\" + name + ".zip\"";

            Process proc = new Process();

            proc.StartInfo.WorkingDirectory       = Config.GameboyDirectory;
            proc.StartInfo.FileName               = Config.GameboyDirectory + "VisualBoyAdvance.exe";
            proc.StartInfo.Arguments              = args;
            proc.StartInfo.CreateNoWindow         = true;
            proc.StartInfo.UseShellExecute        = false;
            proc.StartInfo.RedirectStandardOutput = true;

            proc.Start();

            string output = proc.StandardOutput.ReadToEnd();

            proc.WaitForExit();

            MainForm.HideWaiting();
        }
Example #11
0
        private void UpdateSummary()
        {
            //http://thegamesdb.net/api/GetGame.php?name=sonic%20the%20hedgehog&platform=Sega%20Genesis

            Image titleImage = null;
            //Image screenImage = null;
            string year         = "";
            string manufacturer = "";
            string input        = "";
            string video        = "";
            string description  = "";

            PodItem item = (PodItem)PodList.SelectedItem;

            if (item != null)
            {
                if (item is GameItem)
                {
                    XmlNode    game   = ((GameItem)item).Game;
                    GameSystem system = ((GameItem)item).GameSystem;

                    if (game.ParentNode.LocalName == "clones")
                    {
                        game = game.ParentNode.ParentNode;
                    }

                    string name      = XmlBinder.Eval(game, "@name");
                    string cleanName = XmlBinder.Eval(game, "CleanName");
                    string baseDir   = SystemHelper.GetDirectoryForGameSystem(system);

                    try
                    {
                        string filename = SystemHelper.GetImageFilename(baseDir + "images\\", cleanName + "_front");
                        if (filename != null)
                        {
                            titleImage = Image.FromFile(filename);
                        }
                    }
                    catch { }

                    //try
                    //{
                    //    string filename = SystemHelper.GetImageFilename(baseDir + "images\\", cleanName + "_fan");
                    //    if (filename != null)
                    //        screenImage = Image.FromFile(filename);
                    //}
                    //catch { }

                    year         = XmlBinder.Eval(game, "ReleaseDate");
                    manufacturer = XmlBinder.Eval(game, "Publisher");
                    input        = XmlBinder.Eval(game, "Players");
                    video        = XmlBinder.Eval(game, "ESRB");
                    description  = XmlBinder.Eval(game, "Overview");
                    //string players = XmlBinder.Eval(game, "input/@players");
                    //string buttons = XmlBinder.Eval(game, "input/@buttons");
                    //if (players.Length > 0 && buttons.Length > 0)
                    //    input = string.Format("{0}x {1} buttons", players, buttons);

                    //string width = XmlBinder.Eval(game, "video/@width");
                    //string height = XmlBinder.Eval(game, "video/@height");
                    //if (width.Length > 0 && buttons.Length > 0)
                    //    video = string.Format("{0}x{1}", width, height);
                }
                else if (item is SimpleItem)
                {
                    try
                    {
                        string icon = ((SimpleItem)item).Icon;
                        if (icon != null)
                        {
                            titleImage = (Image)Resources.ResourceManager.GetObject(icon);
                        }
                    }
                    catch { }
                }
            }

            TitlePicture.Image = (titleImage == null) ? _blankImage : titleImage;
            //PlayPicture.Image = (screenImage == null) ? _blankImage : screenImage;

            YearValue.Text            = year;
            YearLabel.Visible         = (YearValue.Text.Length > 0);
            ManufacturerValue.Text    = manufacturer;
            ManufacturerLabel.Visible = (ManufacturerValue.Text.Length > 0);
            InputValue.Text           = input;
            InputLabel.Visible        = (InputValue.Text.Length > 0);
            VideoValue.Text           = video;
            VideoLabel.Visible        = (VideoValue.Text.Length > 0);
            DescriptionValue.Text     = description;
            DescriptionLabel.Visible  = (DescriptionValue.Text.Length > 0);
        }