GLRenderer.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698
  1. using ARMeilleure.Translation;
  2. using ARMeilleure.Translation.PTC;
  3. using Gdk;
  4. using OpenTK;
  5. using OpenTK.Graphics;
  6. using OpenTK.Graphics.OpenGL;
  7. using OpenTK.Input;
  8. using Ryujinx.Common.Configuration;
  9. using Ryujinx.Common.Configuration.Hid;
  10. using Ryujinx.Configuration;
  11. using Ryujinx.Graphics.OpenGL;
  12. using Ryujinx.HLE;
  13. using Ryujinx.HLE.HOS.Services.Hid;
  14. using Ryujinx.Modules.Motion;
  15. using Ryujinx.Ui.Widgets;
  16. using System;
  17. using System.Collections.Generic;
  18. using System.Threading;
  19. namespace Ryujinx.Ui
  20. {
  21. public class GlRenderer : GLWidget
  22. {
  23. static GlRenderer()
  24. {
  25. OpenTK.Graphics.GraphicsContext.ShareContexts = true;
  26. }
  27. private const int SwitchPanelWidth = 1280;
  28. private const int SwitchPanelHeight = 720;
  29. private const int TargetFps = 60;
  30. public ManualResetEvent WaitEvent { get; set; }
  31. public static event EventHandler<StatusUpdatedEventArgs> StatusUpdatedEvent;
  32. private bool _isActive;
  33. private bool _isStopped;
  34. private bool _isFocused;
  35. private double _mouseX;
  36. private double _mouseY;
  37. private bool _mousePressed;
  38. private bool _toggleFullscreen;
  39. private bool _toggleDockedMode;
  40. private readonly long _ticksPerFrame;
  41. private long _ticks = 0;
  42. private readonly System.Diagnostics.Stopwatch _chrono;
  43. private readonly Switch _device;
  44. private Renderer _renderer;
  45. private HotkeyButtons _prevHotkeyButtons;
  46. private Client _dsuClient;
  47. private GraphicsDebugLevel _glLogLevel;
  48. private readonly ManualResetEvent _exitEvent;
  49. public GlRenderer(Switch device, GraphicsDebugLevel glLogLevel)
  50. : base (GetGraphicsMode(),
  51. 3, 3,
  52. glLogLevel == GraphicsDebugLevel.None
  53. ? GraphicsContextFlags.ForwardCompatible
  54. : GraphicsContextFlags.ForwardCompatible | GraphicsContextFlags.Debug)
  55. {
  56. WaitEvent = new ManualResetEvent(false);
  57. _device = device;
  58. Initialized += GLRenderer_Initialized;
  59. Destroyed += GLRenderer_Destroyed;
  60. ShuttingDown += GLRenderer_ShuttingDown;
  61. Initialize();
  62. _chrono = new System.Diagnostics.Stopwatch();
  63. _ticksPerFrame = System.Diagnostics.Stopwatch.Frequency / TargetFps;
  64. AddEvents((int)(EventMask.ButtonPressMask
  65. | EventMask.ButtonReleaseMask
  66. | EventMask.PointerMotionMask
  67. | EventMask.KeyPressMask
  68. | EventMask.KeyReleaseMask));
  69. Shown += Renderer_Shown;
  70. _dsuClient = new Client();
  71. _glLogLevel = glLogLevel;
  72. _exitEvent = new ManualResetEvent(false);
  73. }
  74. private static GraphicsMode GetGraphicsMode()
  75. {
  76. return Environment.OSVersion.Platform == PlatformID.Unix ? new GraphicsMode(new ColorFormat(24)) : new GraphicsMode(new ColorFormat());
  77. }
  78. private void GLRenderer_ShuttingDown(object sender, EventArgs args)
  79. {
  80. _device.DisposeGpu();
  81. _dsuClient?.Dispose();
  82. }
  83. private void Parent_FocusOutEvent(object o, Gtk.FocusOutEventArgs args)
  84. {
  85. _isFocused = false;
  86. }
  87. private void Parent_FocusInEvent(object o, Gtk.FocusInEventArgs args)
  88. {
  89. _isFocused = true;
  90. }
  91. private void GLRenderer_Destroyed(object sender, EventArgs e)
  92. {
  93. _dsuClient?.Dispose();
  94. Dispose();
  95. }
  96. protected void Renderer_Shown(object sender, EventArgs e)
  97. {
  98. _isFocused = this.ParentWindow.State.HasFlag(Gdk.WindowState.Focused);
  99. }
  100. public void HandleScreenState(KeyboardState keyboard)
  101. {
  102. bool toggleFullscreen = keyboard.IsKeyDown(OpenTK.Input.Key.F11)
  103. || ((keyboard.IsKeyDown(OpenTK.Input.Key.AltLeft)
  104. || keyboard.IsKeyDown(OpenTK.Input.Key.AltRight))
  105. && keyboard.IsKeyDown(OpenTK.Input.Key.Enter))
  106. || keyboard.IsKeyDown(OpenTK.Input.Key.Escape);
  107. bool fullScreenToggled = ParentWindow.State.HasFlag(Gdk.WindowState.Fullscreen);
  108. if (toggleFullscreen != _toggleFullscreen)
  109. {
  110. if (toggleFullscreen)
  111. {
  112. if (fullScreenToggled)
  113. {
  114. ParentWindow.Unfullscreen();
  115. (Toplevel as MainWindow)?.ToggleExtraWidgets(true);
  116. }
  117. else
  118. {
  119. if (keyboard.IsKeyDown(OpenTK.Input.Key.Escape))
  120. {
  121. if (!ConfigurationState.Instance.ShowConfirmExit || GtkDialog.CreateExitDialog())
  122. {
  123. Exit();
  124. }
  125. }
  126. else
  127. {
  128. ParentWindow.Fullscreen();
  129. (Toplevel as MainWindow)?.ToggleExtraWidgets(false);
  130. }
  131. }
  132. }
  133. }
  134. _toggleFullscreen = toggleFullscreen;
  135. bool toggleDockedMode = keyboard.IsKeyDown(OpenTK.Input.Key.F9);
  136. if (toggleDockedMode != _toggleDockedMode)
  137. {
  138. if (toggleDockedMode)
  139. {
  140. ConfigurationState.Instance.System.EnableDockedMode.Value =
  141. !ConfigurationState.Instance.System.EnableDockedMode.Value;
  142. }
  143. }
  144. _toggleDockedMode = toggleDockedMode;
  145. }
  146. private void GLRenderer_Initialized(object sender, EventArgs e)
  147. {
  148. // Release the GL exclusivity that OpenTK gave us as we aren't going to use it in GTK Thread.
  149. GraphicsContext.MakeCurrent(null);
  150. WaitEvent.Set();
  151. }
  152. protected override bool OnConfigureEvent(EventConfigure evnt)
  153. {
  154. bool result = base.OnConfigureEvent(evnt);
  155. Gdk.Monitor monitor = Display.GetMonitorAtWindow(Window);
  156. _renderer.Window.SetSize(evnt.Width * monitor.ScaleFactor, evnt.Height * monitor.ScaleFactor);
  157. return result;
  158. }
  159. public void Start()
  160. {
  161. IsRenderHandler = true;
  162. _chrono.Restart();
  163. _isActive = true;
  164. Gtk.Window parent = this.Toplevel as Gtk.Window;
  165. parent.FocusInEvent += Parent_FocusInEvent;
  166. parent.FocusOutEvent += Parent_FocusOutEvent;
  167. Gtk.Application.Invoke(delegate
  168. {
  169. parent.Present();
  170. string titleNameSection = string.IsNullOrWhiteSpace(_device.Application.TitleName) ? string.Empty
  171. : $" - {_device.Application.TitleName}";
  172. string titleVersionSection = string.IsNullOrWhiteSpace(_device.Application.DisplayVersion) ? string.Empty
  173. : $" v{_device.Application.DisplayVersion}";
  174. string titleIdSection = string.IsNullOrWhiteSpace(_device.Application.TitleIdText) ? string.Empty
  175. : $" ({_device.Application.TitleIdText.ToUpper()})";
  176. string titleArchSection = _device.Application.TitleIs64Bit ? " (64-bit)" : " (32-bit)";
  177. parent.Title = $"Ryujinx {Program.Version}{titleNameSection}{titleVersionSection}{titleIdSection}{titleArchSection}";
  178. });
  179. Thread renderLoopThread = new Thread(Render)
  180. {
  181. Name = "GUI.RenderLoop"
  182. };
  183. renderLoopThread.Start();
  184. Thread nvStutterWorkaround = new Thread(NVStutterWorkaround)
  185. {
  186. Name = "GUI.NVStutterWorkaround"
  187. };
  188. nvStutterWorkaround.Start();
  189. MainLoop();
  190. renderLoopThread.Join();
  191. nvStutterWorkaround.Join();
  192. Exit();
  193. }
  194. private void NVStutterWorkaround()
  195. {
  196. while (_isActive)
  197. {
  198. // When NVIDIA Threaded Optimization is on, the driver will snapshot all threads in the system whenever the application creates any new ones.
  199. // The ThreadPool has something called a "GateThread" which terminates itself after some inactivity.
  200. // However, it immediately starts up again, since the rules regarding when to terminate and when to start differ.
  201. // This creates a new thread every second or so.
  202. // The main problem with this is that the thread snapshot can take 70ms, is on the OpenGL thread and will delay rendering any graphics.
  203. // This is a little over budget on a frame time of 16ms, so creates a large stutter.
  204. // The solution is to keep the ThreadPool active so that it never has a reason to terminate the GateThread.
  205. // TODO: This should be removed when the issue with the GateThread is resolved.
  206. ThreadPool.QueueUserWorkItem((state) => { });
  207. Thread.Sleep(300);
  208. }
  209. }
  210. protected override bool OnButtonPressEvent(EventButton evnt)
  211. {
  212. _mouseX = evnt.X;
  213. _mouseY = evnt.Y;
  214. if (evnt.Button == 1)
  215. {
  216. _mousePressed = true;
  217. }
  218. return false;
  219. }
  220. protected override bool OnButtonReleaseEvent(EventButton evnt)
  221. {
  222. if (evnt.Button == 1)
  223. {
  224. _mousePressed = false;
  225. }
  226. return false;
  227. }
  228. protected override bool OnMotionNotifyEvent(EventMotion evnt)
  229. {
  230. if (evnt.Device.InputSource == InputSource.Mouse)
  231. {
  232. _mouseX = evnt.X;
  233. _mouseY = evnt.Y;
  234. }
  235. return false;
  236. }
  237. protected override void OnGetPreferredHeight(out int minimumHeight, out int naturalHeight)
  238. {
  239. Gdk.Monitor monitor = Display.GetMonitorAtWindow(Window);
  240. // If the monitor is at least 1080p, use the Switch panel size as minimal size.
  241. if (monitor.Geometry.Height >= 1080)
  242. {
  243. minimumHeight = SwitchPanelHeight;
  244. }
  245. // Otherwise, we default minimal size to 480p 16:9.
  246. else
  247. {
  248. minimumHeight = 480;
  249. }
  250. naturalHeight = minimumHeight;
  251. }
  252. protected override void OnGetPreferredWidth(out int minimumWidth, out int naturalWidth)
  253. {
  254. Gdk.Monitor monitor = Display.GetMonitorAtWindow(Window);
  255. // If the monitor is at least 1080p, use the Switch panel size as minimal size.
  256. if (monitor.Geometry.Height >= 1080)
  257. {
  258. minimumWidth = SwitchPanelWidth;
  259. }
  260. // Otherwise, we default minimal size to 480p 16:9.
  261. else
  262. {
  263. minimumWidth = 854;
  264. }
  265. naturalWidth = minimumWidth;
  266. }
  267. public void Exit()
  268. {
  269. _dsuClient?.Dispose();
  270. if (_isStopped)
  271. {
  272. return;
  273. }
  274. _isStopped = true;
  275. _isActive = false;
  276. _exitEvent.WaitOne();
  277. _exitEvent.Dispose();
  278. }
  279. public void Initialize()
  280. {
  281. if (!(_device.Gpu.Renderer is Renderer))
  282. {
  283. throw new NotSupportedException($"GPU renderer must be an OpenGL renderer when using {typeof(Renderer).Name}!");
  284. }
  285. _renderer = (Renderer)_device.Gpu.Renderer;
  286. }
  287. public void Render()
  288. {
  289. // First take exclusivity on the OpenGL context.
  290. _renderer.InitializeBackgroundContext(GraphicsContext);
  291. Gtk.Window parent = Toplevel as Gtk.Window;
  292. parent.Present();
  293. GraphicsContext.MakeCurrent(WindowInfo);
  294. _device.Gpu.Renderer.Initialize(_glLogLevel);
  295. // Make sure the first frame is not transparent.
  296. GL.ClearColor(OpenTK.Color.Black);
  297. GL.Clear(ClearBufferMask.ColorBufferBit);
  298. SwapBuffers();
  299. _device.Gpu.InitializeShaderCache();
  300. Translator.IsReadyForTranslation.Set();
  301. while (_isActive)
  302. {
  303. if (_isStopped)
  304. {
  305. return;
  306. }
  307. _ticks += _chrono.ElapsedTicks;
  308. _chrono.Restart();
  309. if (_device.WaitFifo())
  310. {
  311. _device.Statistics.RecordFifoStart();
  312. _device.ProcessFrame();
  313. _device.Statistics.RecordFifoEnd();
  314. }
  315. while (_device.ConsumeFrameAvailable())
  316. {
  317. _device.PresentFrame(SwapBuffers);
  318. }
  319. if (_ticks >= _ticksPerFrame)
  320. {
  321. string dockedMode = ConfigurationState.Instance.System.EnableDockedMode ? "Docked" : "Handheld";
  322. float scale = Graphics.Gpu.GraphicsConfig.ResScale;
  323. if (scale != 1)
  324. {
  325. dockedMode += $" ({scale}x)";
  326. }
  327. StatusUpdatedEvent?.Invoke(this, new StatusUpdatedEventArgs(
  328. _device.EnableDeviceVsync,
  329. dockedMode,
  330. ConfigurationState.Instance.Graphics.AspectRatio.Value.ToText(),
  331. $"Game: {_device.Statistics.GetGameFrameRate():00.00} FPS",
  332. $"FIFO: {_device.Statistics.GetFifoPercent():0.00} %",
  333. $"GPU: {_renderer.GpuVendor}"));
  334. _ticks = Math.Min(_ticks - _ticksPerFrame, _ticksPerFrame);
  335. }
  336. }
  337. }
  338. public void SwapBuffers()
  339. {
  340. OpenTK.Graphics.GraphicsContext.CurrentContext.SwapBuffers();
  341. }
  342. public void MainLoop()
  343. {
  344. while (_isActive)
  345. {
  346. UpdateFrame();
  347. // Polling becomes expensive if it's not slept
  348. Thread.Sleep(1);
  349. }
  350. _exitEvent.Set();
  351. }
  352. private bool UpdateFrame()
  353. {
  354. if (!_isActive)
  355. {
  356. return true;
  357. }
  358. if (_isStopped)
  359. {
  360. return false;
  361. }
  362. if (_isFocused)
  363. {
  364. Gtk.Application.Invoke(delegate
  365. {
  366. KeyboardState keyboard = OpenTK.Input.Keyboard.GetState();
  367. HandleScreenState(keyboard);
  368. if (keyboard.IsKeyDown(OpenTK.Input.Key.Delete))
  369. {
  370. if (!ParentWindow.State.HasFlag(Gdk.WindowState.Fullscreen))
  371. {
  372. Ptc.Continue();
  373. }
  374. }
  375. });
  376. }
  377. List<GamepadInput> gamepadInputs = new List<GamepadInput>(NpadDevices.MaxControllers);
  378. List<SixAxisInput> motionInputs = new List<SixAxisInput>(NpadDevices.MaxControllers);
  379. MotionDevice motionDevice = new MotionDevice(_dsuClient);
  380. foreach (InputConfig inputConfig in ConfigurationState.Instance.Hid.InputConfig.Value)
  381. {
  382. ControllerKeys currentButton = 0;
  383. JoystickPosition leftJoystick = new JoystickPosition();
  384. JoystickPosition rightJoystick = new JoystickPosition();
  385. KeyboardInput? hidKeyboard = null;
  386. int leftJoystickDx = 0;
  387. int leftJoystickDy = 0;
  388. int rightJoystickDx = 0;
  389. int rightJoystickDy = 0;
  390. if (inputConfig.EnableMotion)
  391. {
  392. motionDevice.RegisterController(inputConfig.PlayerIndex);
  393. }
  394. if (inputConfig is KeyboardConfig keyboardConfig)
  395. {
  396. if (_isFocused)
  397. {
  398. // Keyboard Input
  399. KeyboardController keyboardController = new KeyboardController(keyboardConfig);
  400. currentButton = keyboardController.GetButtons();
  401. (leftJoystickDx, leftJoystickDy) = keyboardController.GetLeftStick();
  402. (rightJoystickDx, rightJoystickDy) = keyboardController.GetRightStick();
  403. leftJoystick = new JoystickPosition
  404. {
  405. Dx = leftJoystickDx,
  406. Dy = leftJoystickDy
  407. };
  408. rightJoystick = new JoystickPosition
  409. {
  410. Dx = rightJoystickDx,
  411. Dy = rightJoystickDy
  412. };
  413. if (ConfigurationState.Instance.Hid.EnableKeyboard)
  414. {
  415. hidKeyboard = keyboardController.GetKeysDown();
  416. }
  417. if (!hidKeyboard.HasValue)
  418. {
  419. hidKeyboard = new KeyboardInput
  420. {
  421. Modifier = 0,
  422. Keys = new int[0x8]
  423. };
  424. }
  425. if (ConfigurationState.Instance.Hid.EnableKeyboard)
  426. {
  427. _device.Hid.Keyboard.Update(hidKeyboard.Value);
  428. }
  429. }
  430. }
  431. else if (inputConfig is Common.Configuration.Hid.ControllerConfig controllerConfig)
  432. {
  433. // Controller Input
  434. JoystickController joystickController = new JoystickController(controllerConfig);
  435. currentButton |= joystickController.GetButtons();
  436. (leftJoystickDx, leftJoystickDy) = joystickController.GetLeftStick();
  437. (rightJoystickDx, rightJoystickDy) = joystickController.GetRightStick();
  438. leftJoystick = new JoystickPosition
  439. {
  440. Dx = controllerConfig.LeftJoycon.InvertStickX ? -leftJoystickDx : leftJoystickDx,
  441. Dy = controllerConfig.LeftJoycon.InvertStickY ? -leftJoystickDy : leftJoystickDy
  442. };
  443. rightJoystick = new JoystickPosition
  444. {
  445. Dx = controllerConfig.RightJoycon.InvertStickX ? -rightJoystickDx : rightJoystickDx,
  446. Dy = controllerConfig.RightJoycon.InvertStickY ? -rightJoystickDy : rightJoystickDy
  447. };
  448. }
  449. currentButton |= _device.Hid.UpdateStickButtons(leftJoystick, rightJoystick);
  450. motionDevice.Poll(inputConfig, inputConfig.Slot);
  451. SixAxisInput sixAxisInput = new SixAxisInput()
  452. {
  453. PlayerId = (HLE.HOS.Services.Hid.PlayerIndex)inputConfig.PlayerIndex,
  454. Accelerometer = motionDevice.Accelerometer,
  455. Gyroscope = motionDevice.Gyroscope,
  456. Rotation = motionDevice.Rotation,
  457. Orientation = motionDevice.Orientation
  458. };
  459. motionInputs.Add(sixAxisInput);
  460. gamepadInputs.Add(new GamepadInput
  461. {
  462. PlayerId = (HLE.HOS.Services.Hid.PlayerIndex)inputConfig.PlayerIndex,
  463. Buttons = currentButton,
  464. LStick = leftJoystick,
  465. RStick = rightJoystick
  466. });
  467. if (inputConfig.ControllerType == Common.Configuration.Hid.ControllerType.JoyconPair)
  468. {
  469. if (!inputConfig.MirrorInput)
  470. {
  471. motionDevice.Poll(inputConfig, inputConfig.AltSlot);
  472. sixAxisInput = new SixAxisInput()
  473. {
  474. PlayerId = (HLE.HOS.Services.Hid.PlayerIndex)inputConfig.PlayerIndex,
  475. Accelerometer = motionDevice.Accelerometer,
  476. Gyroscope = motionDevice.Gyroscope,
  477. Rotation = motionDevice.Rotation,
  478. Orientation = motionDevice.Orientation
  479. };
  480. }
  481. motionInputs.Add(sixAxisInput);
  482. }
  483. }
  484. _device.Hid.Npads.Update(gamepadInputs);
  485. _device.Hid.Npads.UpdateSixAxis(motionInputs);
  486. if(_isFocused)
  487. {
  488. // Hotkeys
  489. HotkeyButtons currentHotkeyButtons = KeyboardController.GetHotkeyButtons(OpenTK.Input.Keyboard.GetState());
  490. if (currentHotkeyButtons.HasFlag(HotkeyButtons.ToggleVSync) &&
  491. !_prevHotkeyButtons.HasFlag(HotkeyButtons.ToggleVSync))
  492. {
  493. _device.EnableDeviceVsync = !_device.EnableDeviceVsync;
  494. }
  495. _prevHotkeyButtons = currentHotkeyButtons;
  496. }
  497. //Touchscreen
  498. bool hasTouch = false;
  499. // Get screen touch position from left mouse click
  500. // OpenTK always captures mouse events, even if out of focus, so check if window is focused.
  501. if (_isFocused && _mousePressed)
  502. {
  503. float aspectWidth = SwitchPanelHeight * ConfigurationState.Instance.Graphics.AspectRatio.Value.ToFloat();
  504. int screenWidth = AllocatedWidth;
  505. int screenHeight = AllocatedHeight;
  506. if (AllocatedWidth > AllocatedHeight * aspectWidth / SwitchPanelHeight)
  507. {
  508. screenWidth = (int)(AllocatedHeight * aspectWidth) / SwitchPanelHeight;
  509. }
  510. else
  511. {
  512. screenHeight = (AllocatedWidth * SwitchPanelHeight) / (int)aspectWidth;
  513. }
  514. int startX = (AllocatedWidth - screenWidth) >> 1;
  515. int startY = (AllocatedHeight - screenHeight) >> 1;
  516. int endX = startX + screenWidth;
  517. int endY = startY + screenHeight;
  518. if (_mouseX >= startX &&
  519. _mouseY >= startY &&
  520. _mouseX < endX &&
  521. _mouseY < endY)
  522. {
  523. int screenMouseX = (int)_mouseX - startX;
  524. int screenMouseY = (int)_mouseY - startY;
  525. int mX = (screenMouseX * (int)aspectWidth) / screenWidth;
  526. int mY = (screenMouseY * SwitchPanelHeight) / screenHeight;
  527. TouchPoint currentPoint = new TouchPoint
  528. {
  529. X = (uint)mX,
  530. Y = (uint)mY,
  531. // Placeholder values till more data is acquired
  532. DiameterX = 10,
  533. DiameterY = 10,
  534. Angle = 90
  535. };
  536. hasTouch = true;
  537. _device.Hid.Touchscreen.Update(currentPoint);
  538. }
  539. }
  540. if (!hasTouch)
  541. {
  542. _device.Hid.Touchscreen.Update();
  543. }
  544. _device.Hid.DebugPad.Update();
  545. return true;
  546. }
  547. }
  548. }