示例#1
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);
        }
示例#2
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);
            }
        }