Esempio n. 1
0
        public ResetButton(ApplicationState state, IStoryService storyService, ISaveStateService saveStateService) : base(state)
        {
            _storyService     = storyService;
            _saveStateService = saveStateService;

            Title       = "Reset";
            IsVisible   = true;
            IsClickable = true;
        }
Esempio n. 2
0
        public GamePlayerVM(IPlatformService platformService, IEmulationService emulationService, ISaveStateService saveStateService)
        {
            PlatformService  = platformService;
            EmulationService = emulationService;
            SaveStateService = saveStateService;

            ShouldDisplayTouchGamepad = PlatformService.ShouldDisplayTouchGamepad;

            TappedCommand = new RelayCommand(() =>
            {
                DisplayPlayerUI = !DisplayPlayerUI;
            });

            PointerMovedCommand = new RelayCommand(() =>
            {
                PlatformService.ChangeMousePointerVisibility(MousePointerVisibility.Visible);
                LastPointerMoveTime = DateTimeOffset.UtcNow;
                DisplayPlayerUI     = true;
            });

            ToggleFullScreenCommand = new RelayCommand(() => RequestFullScreenChange(FullScreenChangeType.Toggle));

            TogglePauseCommand = new RelayCommand(() => { var task = TogglePause(false); }, () => CoreOperationsAllowed);
            ResetCommand       = new RelayCommand(Reset, () => CoreOperationsAllowed);
            StopCommand        = new RelayCommand(Stop, () => CoreOperationsAllowed);

            SaveStateSlot1 = new RelayCommand(() => SaveState(1), () => CoreOperationsAllowed);
            SaveStateSlot2 = new RelayCommand(() => SaveState(2), () => CoreOperationsAllowed);
            SaveStateSlot3 = new RelayCommand(() => SaveState(3), () => CoreOperationsAllowed);
            SaveStateSlot4 = new RelayCommand(() => SaveState(4), () => CoreOperationsAllowed);
            SaveStateSlot5 = new RelayCommand(() => SaveState(5), () => CoreOperationsAllowed);
            SaveStateSlot6 = new RelayCommand(() => SaveState(6), () => CoreOperationsAllowed);

            LoadStateSlot1 = new RelayCommand(() => LoadState(1), () => CoreOperationsAllowed);
            LoadStateSlot2 = new RelayCommand(() => LoadState(2), () => CoreOperationsAllowed);
            LoadStateSlot3 = new RelayCommand(() => LoadState(3), () => CoreOperationsAllowed);
            LoadStateSlot4 = new RelayCommand(() => LoadState(4), () => CoreOperationsAllowed);
            LoadStateSlot5 = new RelayCommand(() => LoadState(5), () => CoreOperationsAllowed);
            LoadStateSlot6 = new RelayCommand(() => LoadState(6), () => CoreOperationsAllowed);

            InjectInputCommand = new RelayCommand <InjectedInputTypes>(d => EmulationService.InjectInputPlayer1(d));

            AllCoreCommands = new RelayCommand[] { TogglePauseCommand, ResetCommand, StopCommand,
                                                   SaveStateSlot1, SaveStateSlot2, SaveStateSlot3, SaveStateSlot4, SaveStateSlot5, SaveStateSlot6,
                                                   LoadStateSlot1, LoadStateSlot2, LoadStateSlot3, LoadStateSlot4, LoadStateSlot5, LoadStateSlot6 };

            EmulationService.GameStarted += OnGameStarted;
            PlatformService.FullScreenChangeRequested   += (d, e) => RequestFullScreenChange(e.Type);
            PlatformService.PauseToggleRequested        += d => OnPauseToggleKey();
            PlatformService.GameStateOperationRequested += OnGameStateOperationRequested;
        }
Esempio n. 3
0
        public EmulationService(IFileSystem fileSystem, IUserDialogs dialogsService, ILocalizationService localizationService, IPlatformService platformService, ISaveStateService saveStateService, ILocalNotifications notificationService, ICryptographyService cryptographyService, IInputManager inputManager)
        {
            FileSystem          = fileSystem;
            LocalizationService = localizationService;
            PlatformService     = platformService;
            SaveStateService    = saveStateService;
            NotificationService = notificationService;
            InputManager        = inputManager;

            RootFrame.Navigated += OnNavigated;

            var CDImageExtensions = new HashSet <string> {
                ".bin", ".cue", ".iso", ".mds", ".mdf"
            };

            systems = new GameSystemVM[]
            {
                new GameSystemVM(LibRetriX.FCEUMM.Core.Instance, FileSystem, LocalizationService, "SystemNameNES", "ManufacturerNameNintendo", "\uf118"),
                new GameSystemVM(LibRetriX.Snes9X.Core.Instance, FileSystem, LocalizationService, "SystemNameSNES", "ManufacturerNameNintendo", "\uf119"),
                //new GameSystemVM(LibRetriX.ParallelN64.Core.Instance, FileSystem, LocalizationService, "SystemNameNintendo64", "ManufacturerNameNintendo", "\uf116"),
                new GameSystemVM(LibRetriX.Gambatte.Core.Instance, FileSystem, LocalizationService, "SystemNameGameBoy", "ManufacturerNameNintendo", "\uf11b"),
                new GameSystemVM(LibRetriX.VBAM.Core.Instance, FileSystem, LocalizationService, "SystemNameGameBoyAdvance", "ManufacturerNameNintendo", "\uf115"),
                new GameSystemVM(LibRetriX.MelonDS.Core.Instance, FileSystem, LocalizationService, "SystemNameDS", "ManufacturerNameNintendo", "\uf117"),
                new GameSystemVM(LibRetriX.GPGX.Core.Instance, FileSystem, LocalizationService, "SystemNameSG1000", "ManufacturerNameSega", "\uf102", true, new HashSet <string> {
                    ".sg"
                }),
                new GameSystemVM(LibRetriX.GPGX.Core.Instance, FileSystem, LocalizationService, "SystemNameMasterSystem", "ManufacturerNameSega", "\uf118", true, new HashSet <string> {
                    ".sms"
                }),
                new GameSystemVM(LibRetriX.GPGX.Core.Instance, FileSystem, LocalizationService, "SystemNameGameGear", "ManufacturerNameSega", "\uf129", true, new HashSet <string> {
                    ".gg"
                }),
                new GameSystemVM(LibRetriX.GPGX.Core.Instance, FileSystem, LocalizationService, "SystemNameMegaDrive", "ManufacturerNameSega", "\uf124", true, new HashSet <string> {
                    ".mds", ".md", ".smd", ".gen"
                }),
                new GameSystemVM(LibRetriX.GPGX.Core.Instance, FileSystem, LocalizationService, "SystemNameMegaCD", "ManufacturerNameSega", "\uf124", false, new HashSet <string> {
                    ".bin", ".cue", ".iso", ".chd"
                }, CDImageExtensions),
                //new GameSystemVM(LibRetriX.BeetleSaturn.Core.Instance, FileSystem, LocalizationService, "SystemNameSaturn", "ManufacturerNameSega", "\uf124", false, null, CDImageExtensions),
                new GameSystemVM(LibRetriX.BeetlePSX.Core.Instance, FileSystem, LocalizationService, "SystemNamePlayStation", "ManufacturerNameSony", "\uf128", false, null, CDImageExtensions),
                new GameSystemVM(LibRetriX.BeetlePCEFast.Core.Instance, FileSystem, LocalizationService, "SystemNamePCEngine", "ManufacturerNameNEC", "\uf124", true, new HashSet <string> {
                    ".pce"
                }),
                new GameSystemVM(LibRetriX.BeetlePCEFast.Core.Instance, FileSystem, LocalizationService, "SystemNamePCEngineCD", "ManufacturerNameNEC", "\uf124", false, new HashSet <string> {
                    ".cue", ".ccd", ".chd"
                }, CDImageExtensions),
                new GameSystemVM(LibRetriX.BeetlePCFX.Core.Instance, FileSystem, LocalizationService, "SystemNamePCFX", "ManufacturerNameNEC", "\uf124", false, null, CDImageExtensions),
                new GameSystemVM(LibRetriX.BeetleWswan.Core.Instance, FileSystem, LocalizationService, "SystemNameWonderSwan", "ManufacturerNameBandai", "\uf129"),
                new GameSystemVM(LibRetriX.FBAlpha.Core.Instance, FileSystem, LocalizationService, "SystemNameNeoGeo", "ManufacturerNameSNK", "\uf102", false),
                new GameSystemVM(LibRetriX.BeetleNGP.Core.Instance, FileSystem, LocalizationService, "SystemNameNeoGeoPocket", "ManufacturerNameSNK", "\uf129"),
                new GameSystemVM(LibRetriX.FBAlpha.Core.Instance, FileSystem, LocalizationService, "SystemNameArcade", "ManufacturerNameFBAlpha", "\uf102", true),
            };

            foreach (var i in systems.Select(d => d.Core).Distinct())
            {
                i.SystemRootPath  = VFSSystemPath;
                i.SaveRootPath    = VFSSavePath;
                i.OpenFileStream  = OnCoreOpenFileStream;
                i.CloseFileStream = OnCoreCloseFileStream;
            }
        }