From 8dcffe6a5103920ab63e46f93029b27e311335f3 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Sun, 4 Mar 2018 00:06:44 -0300 Subject: Fix hid touch screen timestamp, add more log info --- Ryujinx.Core/Hid/Hid.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'Ryujinx.Core/Hid') diff --git a/Ryujinx.Core/Hid/Hid.cs b/Ryujinx.Core/Hid/Hid.cs index 4dbac40c..c76782cf 100644 --- a/Ryujinx.Core/Hid/Hid.cs +++ b/Ryujinx.Core/Hid/Hid.cs @@ -164,6 +164,8 @@ namespace Ryujinx.Core.Input public void SetTouchPoints(params HidTouchPoint[] Points) { + Logging.Debug("hid touch"); + long LastEntry = ReadInt64(HidTouchScreenOffset + 0x10); long CurrEntry = (LastEntry + 1) % HidEntryCount; @@ -178,9 +180,13 @@ namespace Ryujinx.Core.Input long TouchEntryOffset = HidTouchScreenOffset + HidTouchHeaderSize; - TouchEntryOffset += CurrEntry * HidTouchEntrySize; + long LastEntryOffset = TouchEntryOffset + LastEntry * HidTouchEntrySize; + + long LastTimestamp = ReadInt64(LastEntryOffset); + + TouchEntryOffset += CurrEntry * HidTouchEntrySize; - WriteInt64(TouchEntryOffset + 0x0, Timestamp); + WriteInt64(TouchEntryOffset + 0x0, LastTimestamp + 1); WriteInt64(TouchEntryOffset + 0x8, Points.Length); TouchEntryOffset += HidTouchEntryHeaderSize; @@ -220,6 +226,8 @@ namespace Ryujinx.Core.Input if ((ulong)Position + 4 > AMemoryMgr.AddrSize) return; + Logging.Debug($"hid wr32 {Position:x8} {Value:x8}"); + *((int*)((byte*)Ns.Ram + Position)) = Value; } @@ -229,6 +237,8 @@ namespace Ryujinx.Core.Input if ((ulong)Position + 8 > AMemoryMgr.AddrSize) return; + Logging.Debug($"hid wr64 {Position:x8} {Value:x16}"); + *((long*)((byte*)Ns.Ram + Position)) = Value; } } -- cgit v1.2.3