コード例 #1
0
ファイル: TasMovie.cs プロジェクト: SushantDhote936/BizHawk
        public override void Attach(IEmulator emulator)
        {
            if (!emulator.HasSavestates())
            {
                throw new InvalidOperationException($"A core must be able to provide an {nameof(IStatable)} service");
            }

            if (!emulator.CanPollInput())
            {
                throw new InvalidOperationException($"A core must be able to provide an {nameof(IInputPollable)} service");
            }

            _inputPollable = emulator.AsInputPollable();

            if (StartsFromSavestate)
            {
                TasStateManager.Engage(BinarySavestate);
            }
            else
            {
                var ms = new MemoryStream();
                emulator.AsStatable().SaveStateBinary(new BinaryWriter(ms));
                TasStateManager.Engage(ms.ToArray());
            }

            base.Attach(emulator);

            foreach (var button in emulator.ControllerDefinition.BoolButtons)
            {
                _mnemonicCache[button] = Bk2MnemonicLookup.Lookup(button, emulator.SystemId);
            }
        }
コード例 #2
0
ファイル: N64Input.cs プロジェクト: Qapples/BizHawk
        internal N64Input(IInputPollable emuCore, mupen64plusApi core, N64SyncSettings.N64ControllerSettings[] controllerSettings)
        {
            _emuCore = emuCore;
            _api     = new mupen64plusInputApi(core);

            _api.SetM64PInputCallback(GetControllerInput);

            core.VInterrupt += ShiftInputPolledBools;
            for (int i = 0; i < controllerSettings.Length; ++i)
            {
                SetControllerConnected(i, controllerSettings[i].IsConnected);
                SetControllerPakType(i, controllerSettings[i].PakType);
            }
        }
コード例 #3
0
ファイル: N64Input.cs プロジェクト: CadeLaRen/BizHawk
		public N64Input(IInputPollable emuCore, mupen64plusApi core, CoreComm comm, N64SyncSettings.N64ControllerSettings[] controllerSettings)
		{
			_emuCore = emuCore;
			api = new mupen64plusInputApi(core);
			CoreComm = comm;

			api.SetM64PInputCallback(new mupen64plusInputApi.InputCallback(GetControllerInput));

			core.VInterrupt += ShiftInputPolledBools;
			for (int i = 0; i < controllerSettings.Length; ++i)
			{
				SetControllerConnected(i, controllerSettings[i].IsConnected);
				SetControllerPakType(i, controllerSettings[i].PakType);
			}
		}
コード例 #4
0
        public override void Attach(IEmulator emulator)
        {
            if (!emulator.HasSavestates())
            {
                throw new InvalidOperationException($"A core must be able to provide an {nameof(IStatable)} service");
            }

            if (!emulator.CanPollInput())
            {
                throw new InvalidOperationException($"A core must be able to provide an {nameof(IInputPollable)} service");
            }

            _inputPollable = emulator.AsInputPollable();
            TasStateManager.Attach(emulator);
            base.Attach(emulator);
        }
コード例 #5
0
        public override void Attach(IEmulator emulator)
        {
            if (!emulator.HasSavestates())
            {
                throw new InvalidOperationException($"A core must be able to provide an {nameof(IStatable)} service");
            }

            if (!emulator.CanPollInput())
            {
                throw new InvalidOperationException($"A core must be able to provide an {nameof(IInputPollable)} service");
            }

            _inputPollable = emulator.AsInputPollable();
            TasStateManager.Attach(emulator);

            base.Attach(emulator);

            foreach (var button in emulator.ControllerDefinition.BoolButtons)
            {
                _mnemonicCache[button] = Bk2MnemonicLookup.Lookup(button, emulator.SystemId);
            }
        }