Esempio n. 1
0
 public virtual IEnumerable <PadSchema> GetPadSchemas(IEmulator core)
 {
     return(core switch
     {
         PCEngine pce => PceHawkSchemas(pce),
         NymaCore nyma => NymaSchemas(nyma),
         _ => Enumerable.Empty <PadSchema>()
     });
 public virtual IEnumerable <PadSchema> GetPadSchemas(IEmulator core, Action <string> showMessageBox)
 {
     return(core switch
     {
         PCEngine.PCEngine pce => PceHawkSchemas(pce, showMessageBox),
         NymaCore nyma => NymaSchemas(nyma, showMessageBox),
         _ => Enumerable.Empty <PadSchema>()
     });
 public IEnumerable <PadSchema> GetPadSchemas(IEmulator core, Action <string> showMessageBox)
 {
     return(core switch
     {
         LibsnesCore libsnes => GetLibsnesPadSchemas(libsnes),
         BsnesCore bsnes => GetBsnesPadSchemas(bsnes),
         NymaCore nyma => GetFaustSchemas(nyma, showMessageBox),
         _ => GetSnes9xPadSchemas((Snes9x)core)
     });
Esempio n. 4
0
        public static void DoDialog(IEmulator emulator, IDialogParent owner, bool isMovieActive)
        {
            var settable = ((MainForm)owner).GetSettingsAdapterForLoadedCoreUntyped();              //HACK
            var title    = $"{emulator.Attributes().CoreName} Settings";

            _ = emulator switch
            {
                MAME mame => DoMAMEDialog(owner, settable, mame.CurrentDriverSettings, isMovieActive: isMovieActive),
                NymaCore core => DoNymaDialogFor(owner, settable, title, core.SettingsInfo, isMovieActive: isMovieActive),
                _ => DoDialogFor(owner, settable, title, isMovieActive: isMovieActive)
            };
        }
        private static IEnumerable <PadSchema> GetFaustSchemas(NymaCore nyma, Action <string> showMessageBox)
        {
            foreach (NymaCore.PortResult result in nyma.ActualPortData)
            {
                var num    = int.Parse(result.Port.ShortName.Last().ToString());
                var device = result.Device.ShortName;
                if (device == "gamepad")
                {
                    yield return(StandardController(num));
                }
                else if (device != "none")
                {
                    showMessageBox($"Controller type {device} not supported yet.");
                }
            }

            yield return(ConsoleButtons());
        }