コード例 #1
0
        void RefreshLibretroCore(bool bootstrap)
        {
            txtLibretroCore.Text            = "";
            btnLibretroLaunchNoGame.Enabled = false;
            btnLibretroLaunchGame.Enabled   = false;

            var core = Global.Config.LibretroCore;

            if (string.IsNullOrEmpty(core))
            {
                return;
            }

            txtLibretroCore.Text = core;
            CurrentDescription   = null;

            //scan the current libretro core to see if it can be launched with NoGame,and other stuff
            try
            {
                //OLD COMMENTS:
                ////a stub corecomm. to reinforce that this won't touch the frontend at all!
                ////LibRetroEmulator should be able to survive having this stub corecomm
                //NEW COMMENTS:
                //nope, we need to navigate to the dll path. this was a bad idea anyway. so many dlls get loaded, something to resolve them is needed
                var coreComm = new BizHawk.Emulation.Common.CoreComm(null, null);
                CoreFileProvider.SyncCoreCommInputSignals(coreComm);
                using (var retro = new LibretroCore(coreComm, core))
                {
                    btnLibretroLaunchGame.Enabled = true;
                    if (retro.Description.SupportsNoGame)
                    {
                        btnLibretroLaunchNoGame.Enabled = true;
                    }

                    //print descriptive information
                    var descr = retro.Description;
                    CurrentDescription = descr;
                    Console.WriteLine("core name: {0} version {1}", descr.LibraryName, descr.LibraryVersion);
                    Console.WriteLine("extensions: ", descr.ValidExtensions);
                    Console.WriteLine("NeedsRomAsPath: {0}", descr.NeedsRomAsPath);
                    Console.WriteLine("AcceptsArchives: {0}", descr.NeedsArchives);
                    Console.WriteLine("SupportsNoGame: {0}", descr.SupportsNoGame);

                    foreach (var v in descr.Variables.Values)
                    {
                        Console.WriteLine(v);
                    }
                }
            }
            catch (Exception ex)
            {
                if (!bootstrap)
                {
                    MessageBox.Show("Couldn't load the selected Libretro core for analysis. It won't be available.\n\nError:\n\n" + ex.ToString());
                }
            }
        }
コード例 #2
0
        public BatchRunner(IEnumerable <string> files, int numframes)
        {
            this.files     = new List <string>(files);
            this.numframes = numframes;

            ldr               = new RomLoader();
            ldr.OnLoadError  += OnLoadError;
            ldr.ChooseArchive = ChooseArchive;
            Comm              = new CoreComm(CommMessage, CommMessage);
            CoreFileProvider.SyncCoreCommInputSignals(Comm);
        }