Esempio n. 1
0
        private void Update()
        {
            EmulationMode mode = this.m_Mode;

            if (mode != EmulationMode.Simulated)
            {
                if (mode == EmulationMode.RemoteDevice)
                {
                    HolographicStreamerConnectionState connectionState = PerceptionRemotingPlugin.GetConnectionState();
                    if (connectionState != this.m_LastConnectionState)
                    {
                        base.Repaint();
                    }
                    HolographicStreamerConnectionFailureReason holographicStreamerConnectionFailureReason = PerceptionRemotingPlugin.CheckForDisconnect();
                    if (holographicStreamerConnectionFailureReason == HolographicStreamerConnectionFailureReason.Unreachable || holographicStreamerConnectionFailureReason == HolographicStreamerConnectionFailureReason.ConnectionLost)
                    {
                        Debug.LogWarning("Disconnected with failure reason " + holographicStreamerConnectionFailureReason + ", attempting to reconnect.");
                        this.Connect();
                    }
                    else if (holographicStreamerConnectionFailureReason != HolographicStreamerConnectionFailureReason.None)
                    {
                        Debug.LogError("Disconnected with error " + holographicStreamerConnectionFailureReason);
                    }
                    this.m_LastConnectionState = connectionState;
                }
            }
            else
            {
                HolographicEmulation.SetGestureHand(this.m_Hand);
            }
        }
 public EmulatorStartingEvent(Guid emulationRunnerId, IEmulationRunner emulationRunner, Game game, EmulationMode mode)
 {
     EmulationRunnerId = emulationRunnerId;
     EmulationRunner = emulationRunner;
     Game = game;
     Mode = mode;
 }
Esempio n. 3
0
 public static void DetectEmulationMode()
 {
     if (File.Exists(GameVars.BasePath + "RACES\\CASTLE.TXT") || File.Exists(GameVars.BasePath + "RACES\\TINSEL.TXT"))
     {
         if (!File.Exists(GameVars.BasePath + "NETRACES.TXT"))
         {
             GameVars.Emulation = EmulationMode.SplatPackDemo;
         }
         else
         {
             GameVars.Emulation = EmulationMode.SplatPack;
         }
     }
     else
     {
         if (!File.Exists(GameVars.BasePath + "NETRACES.TXT"))
         {
             GameVars.Emulation = EmulationMode.Demo;
         }
         else
         {
             GameVars.Emulation = EmulationMode.Full;
         }
     }
 }
        private void OnPlayModeChanged()
        {
            bool inPlayMode = this.m_InPlayMode;

            this.m_InPlayMode = EditorApplication.isPlayingOrWillChangePlaymode;
            if (this.m_InPlayMode && !inPlayMode)
            {
                PerceptionSimulation.SetEmulationMode(this.m_Mode);
                EmulationMode mode = this.m_Mode;
                if (mode != EmulationMode.Simulated)
                {
                    if (mode != EmulationMode.RemoteDevice)
                    {
                    }
                }
                else
                {
                    this.InitializeSimulation();
                }
            }
            else if (!this.m_InPlayMode && inPlayMode)
            {
                EmulationMode mode2 = this.m_Mode;
                if (mode2 != EmulationMode.Simulated)
                {
                    if (mode2 != EmulationMode.RemoteDevice)
                    {
                    }
                }
                else
                {
                    PerceptionSimulation.Shutdown();
                }
            }
        }
Esempio n. 5
0
 private void DrawRemotingMode()
 {
     EditorGUI.BeginChangeCheck();
     this.m_Mode = (EmulationMode)EditorGUILayout.Popup(HolographicEmulationWindow.s_EmulationModeText, (int)this.m_Mode, HolographicEmulationWindow.s_ModeStrings, new GUILayoutOption[0]);
     if (EditorGUI.EndChangeCheck() && this.m_Mode != EmulationMode.RemoteDevice)
     {
         this.Disconnect();
     }
 }
 private void DrawRemotingMode()
 {
     EditorGUI.BeginChangeCheck();
     m_Mode = (EmulationMode)EditorGUILayout.Popup(s_EmulationModeText, (int)m_Mode, s_ModeStrings);
     if (EditorGUI.EndChangeCheck() && m_Mode != EmulationMode.RemoteDevice)
     {
         Disconnect();
     }
 }
 /// <summary>
 /// Initializes the options
 /// </summary>
 /// <param name="emulationMode">Execution emulation mode</param>
 /// <param name="debugStepMode">Debugging execution mode</param>
 /// <param name="fastTapeMode">Fast tape mode</param>
 /// <param name="terminationPoint">Termination point to reach</param>
 public ExecuteCycleOptions(EmulationMode emulationMode = EmulationMode.Continuous,
                            DebugStepMode debugStepMode = DebugStepMode.StopAtBreakpoint,
                            bool fastTapeMode           = false,
                            ushort terminationPoint     = 0x0000)
 {
     EmulationMode    = emulationMode;
     DebugStepMode    = debugStepMode;
     FastTapeMode     = fastTapeMode;
     TerminationPoint = terminationPoint;
 }
 /// <summary>
 /// Initializes the options
 /// </summary>
 /// <param name="emulationMode">Execution emulation mode</param>
 /// <param name="debugStepMode">Debugging execution mode</param>
 /// <param name="fastTapeMode">Fast tape mode</param>
 /// <param name="terminationRom">ROM index of the termination point</param>
 /// <param name="terminationPoint">Termination point to reach</param>
 /// <param name="skipInterruptRoutine">
 /// Signs if maskable interrupt routine instructions should be skipped
 /// </param>
 public ExecuteCycleOptions(EmulationMode emulationMode = EmulationMode.Continuous,
                            DebugStepMode debugStepMode = DebugStepMode.StopAtBreakpoint,
                            bool fastTapeMode           = false,
                            int terminationRom          = 0x0000,
                            ushort terminationPoint     = 0x0000,
                            bool skipInterruptRoutine   = false)
 {
     EmulationMode        = emulationMode;
     DebugStepMode        = debugStepMode;
     FastTapeMode         = fastTapeMode;
     TerminationRom       = terminationRom;
     TerminationPoint     = terminationPoint;
     SkipInterruptRoutine = skipInterruptRoutine;
 }
Esempio n. 9
0
        private void DrawRemotingMode()
        {
            EditorGUI.BeginChangeCheck();
            EmulationMode previousMode = m_Mode;

            m_Mode = (EmulationMode)EditorGUILayout.Popup(s_EmulationModeText, (int)m_Mode, s_ModeStrings);
            if (EditorGUI.EndChangeCheck())
            {
                if (previousMode == EmulationMode.RemoteDevice)
                {
                    Disconnect();
                }
                HolographicAutomation.SetEmulationMode(m_Mode);
            }
        }
Esempio n. 10
0
 public static void DetectEmulationMode()
 {
     if (File.Exists(GameVars.BasePath + "RACES\\CASTLE.TXT") || File.Exists(GameVars.BasePath + "RACES\\TINSEL.TXT"))
     {
         if (!File.Exists(GameVars.BasePath + "NETRACES.TXT"))
             GameVars.Emulation = EmulationMode.SplatPackDemo;
         else
             GameVars.Emulation = EmulationMode.SplatPack;
     }
     else
     {
         if (!File.Exists(GameVars.BasePath + "NETRACES.TXT"))
             GameVars.Emulation = EmulationMode.Demo;
         else
             GameVars.Emulation = EmulationMode.Full;
     }
 }
Esempio n. 11
0
 /// <summary>
 /// Initializes the options.
 /// </summary>
 /// <param name="emulationMode">Execution emulation mode.</param>
 /// <param name="debugStepMode">Debugging execution mode.</param>
 /// <param name="fastTapeMode">Fast tape mode.</param>
 /// <param name="terminationRom">ROM index of the termination point.</param>
 /// <param name="terminationPoint">Termination point to reach.</param>
 public ExecuteCycleOptions(EmulationMode emulationMode = EmulationMode.Continuous,
                            DebugStepMode debugStepMode = DebugStepMode.StopAtBreakpoint,
                            bool fastTapeMode           = false,
                            int terminationRom          = 0x0000,
                            ushort terminationPoint     = 0x0000,
                            bool fastVmMode             = false,
                            long timeoutTacts           = 0,
                            bool disableScreenRendering = false)
 {
     EmulationMode          = emulationMode;
     DebugStepMode          = debugStepMode;
     FastTapeMode           = fastTapeMode;
     TerminationRom         = terminationRom;
     TerminationPoint       = terminationPoint;
     FastVmMode             = fastVmMode;
     TimeoutTacts           = timeoutTacts;
     DisableScreenRendering = disableScreenRendering;
 }
Esempio n. 12
0
 private void OnGUI()
 {
     if (!this.CheckOperatingSystem())
     {
         EditorGUILayout.HelpBox("You must be running Windows build 14318 or later to use Holographic Simulation or Remoting.", MessageType.Warning);
     }
     else if (!this.IsWindowsMixedRealityCurrentTarget())
     {
         EditorGUILayout.HelpBox("You must enable Virtual Reality support in settings and add Windows Mixed Reality to the devices to use Holographic Emulation.", MessageType.Warning);
     }
     else
     {
         EditorGUILayout.Space();
         EditorGUI.BeginDisabledGroup(this.m_InPlayMode);
         this.DrawRemotingMode();
         EditorGUI.EndDisabledGroup();
         EmulationMode mode = this.m_Mode;
         if (mode != EmulationMode.RemoteDevice)
         {
             if (mode == EmulationMode.Simulated)
             {
                 EditorGUI.BeginChangeCheck();
                 this.m_RoomIndex = EditorGUILayout.Popup(HolographicEmulationWindow.s_RoomText, this.m_RoomIndex, HolographicEmulationWindow.s_RoomStrings, new GUILayoutOption[0]);
                 if (EditorGUI.EndChangeCheck() && this.m_InPlayMode)
                 {
                     this.LoadCurrentRoom();
                 }
                 EditorGUI.BeginChangeCheck();
                 this.m_Hand = (GestureHand)EditorGUILayout.Popup(HolographicEmulationWindow.s_HandText, (int)this.m_Hand, HolographicEmulationWindow.s_HandStrings, new GUILayoutOption[0]);
                 if (EditorGUI.EndChangeCheck())
                 {
                     HolographicEmulation.SetGestureHand(this.m_Hand);
                 }
             }
         }
         else
         {
             EditorGUI.BeginDisabledGroup(this.IsConnectedToRemoteDevice());
             this.RemotingPreferencesOnGUI();
             EditorGUI.EndDisabledGroup();
             this.ConnectionStateGUI();
         }
     }
 }
Esempio n. 13
0
 private void OnPlayModeStateChanged(PlayModeStateChange state)
 {
     if (this.IsWindowsMixedRealityCurrentTarget())
     {
         bool inPlayMode = this.m_InPlayMode;
         this.m_InPlayMode = EditorApplication.isPlayingOrWillChangePlaymode;
         if (this.m_InPlayMode && !inPlayMode)
         {
             HolographicEmulation.SetEmulationMode(this.m_Mode);
             EmulationMode mode = this.m_Mode;
             if (mode != EmulationMode.Simulated)
             {
                 if (mode != EmulationMode.RemoteDevice)
                 {
                 }
             }
             else
             {
                 this.InitializeSimulation();
             }
         }
         else if (!this.m_InPlayMode && inPlayMode)
         {
             EmulationMode mode2 = this.m_Mode;
             if (mode2 != EmulationMode.Simulated)
             {
                 if (mode2 != EmulationMode.RemoteDevice)
                 {
                 }
             }
             else
             {
                 HolographicEmulation.Shutdown();
             }
         }
     }
 }
Esempio n. 14
0
        public void Start(EmulationContext context, IEventAggregator eventAggregator, EmulationMode mode)
        {
            _emulator = _emulatorRegistry.GetEmulator(context.EmulatedSystem, _handle);

            IRomSource loader = null;

            if (context.Game.RomPath.ToLower().EndsWith(".zip"))
            {
                loader = new ZipRomSource(context.Game.RomPath);
            }
            else
            {
                loader = new FileRomSource(context.Game.RomPath);
            }

            using (var romData = loader.GetRomData())
            {
                if (!_emulator.IsRomValid(romData))
                    return;

                romData.Seek(0, System.IO.SeekOrigin.Begin);

                _emulator.LoadRom(romData, null);
            }

            eventAggregator.Publish(new EmulatorStartingEvent(InstanceId, this, context.Game, mode));

            while (_bus.HasMessages)
            {
                _bus.GetCommand().Execute(_emulator);
            }

            _emulator.Initialize(eventAggregator);

            int pixelWidth, pixelHeight;
            Wren.Core.PixelFormats requestedPixelFormat;
            Int32 framePerSecond;

            // assemble rendering pipeline
            _emulator.GetSpecifications(out pixelWidth, out pixelHeight, out framePerSecond, out requestedPixelFormat);

            var rSource = _renderingSourceFactory.Create(pixelWidth, pixelHeight, requestedPixelFormat);
            eventAggregator.Publish(new RenderingSurfaceCreatedEvent(this.InstanceId, rSource.MemorySection, rSource.RenderingSurface, rSource.SurfaceInformation));

            _emulator.SetRenderingSurface(rSource.RenderingSurface);
            var input = _inputPipeline.BuildInputSource(context);

            eventAggregator.Publish(new EmulatorStartedEvent(this.InstanceId));

            FrameRateTimer fp = _frameRateTimerFactory.GetFrameRateTimer(framePerSecond);
            fp.ScheduleAction(() =>
            {
                while (_bus.HasMessages)
                {
                    _bus.GetCommand().Execute(_emulator);
                }

                _emulator.SetInput(input.GetCurrentInputState());

                Boolean isRunning;
                try
                {
                    isRunning = _emulator.Run();
                }
                catch
                {
                    isRunning = false;
                }

                eventAggregator.Publish(new FrameRenderedEvent(this.InstanceId));

                if (!isRunning)
                {
                    eventAggregator.Publish(new EmulatorQuitEvent(this.InstanceId));
                    input.Close();
                }

                return isRunning;
            });

            if (!fp.IsRunning)
            {
                fp.Start();
            }
        }
Esempio n. 15
0
 internal static void SetEmulationMode(EmulationMode mode)
 {
     SetEmulationMode_Internal(mode);
 }
Esempio n. 16
0
 public static void ClearOperationModeFlag(EmulationMode flagValue)
 {
     _emulationMode &= ~((int)flagValue);
 }
Esempio n. 17
0
 public static bool IsOperationModeFlagSet(EmulationMode flagValue)
 {
     return((_emulationMode & (int)flagValue) > 0);
 }
Esempio n. 18
0
 public static void SetEmulationMode(EmulationMode emulationMode)
 {
     _emulationMode = _emulationMode | (int)emulationMode;
     ValidateFlag();
 }
Esempio n. 19
0
 private void DrawRemotingMode()
 {
     this.m_Mode = (EmulationMode)EditorGUILayout.Popup(s_EmulationModeText, (int)this.m_Mode, s_ModeStrings, new GUILayoutOption[0]);
 }
Esempio n. 20
0
 internal static void SetEmulationMode(EmulationMode mode)
 {
     HolographicEmulation.SetEmulationMode_Internal(mode);
 }
 internal static void SetEmulationMode(EmulationMode mode)
 {
     SetEmulationMode_Internal(mode);
 }
Esempio n. 22
0
 public Exchange(Session session, ILogger logger)
 {
     this.session = session;
     this.logger  = logger;
     mode         = EmulationMode.Trading;
 }
 private void DrawRemotingMode()
 {
     this.m_Mode = (EmulationMode)EditorGUILayout.Popup(HolographicEmulationWindow.s_EmulationModeText, (int)this.m_Mode, HolographicEmulationWindow.s_ModeStrings, new GUILayoutOption[0]);
 }
 internal static extern void SetEmulationMode_Internal(EmulationMode mode);
 extern internal static void SetEmulationMode(EmulationMode mode);
Esempio n. 26
0
 internal static extern void SetEmulationMode_Internal(EmulationMode mode);
Esempio n. 27
0
 internal static void SetEmulationMode(EmulationMode mode)
 {
     PerceptionSimulation.SetEmulationMode_Internal(mode);
 }
 private void DrawRemotingMode()
 {
     this.m_Mode = (EmulationMode) EditorGUILayout.Popup(s_EmulationModeText, (int) this.m_Mode, s_ModeStrings, new GUILayoutOption[0]);
 }