mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2026-07-07 11:39:05 +00:00
Memory Changes part 2 (ryubing/ryujinx!123)
See merge request ryubing/ryujinx!123
This commit is contained in:
@@ -94,6 +94,8 @@ namespace Ryujinx.HLE.HOS.Services.Hid
|
||||
primaryIndex = PlayerIndex.Unknown;
|
||||
configuredCount = 0;
|
||||
|
||||
Span<NpadState> nPadsSpan = _device.Hid.SharedMemory.Npads.AsSpan();
|
||||
|
||||
for (int i = 0; i < MaxControllers; ++i)
|
||||
{
|
||||
ControllerType npad = _configuredTypes[i];
|
||||
@@ -103,7 +105,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
|
||||
continue;
|
||||
}
|
||||
|
||||
ControllerType currentType = (ControllerType)_device.Hid.SharedMemory.Npads[i].InternalState.StyleSet;
|
||||
ControllerType currentType = (ControllerType)nPadsSpan[i].InternalState.StyleSet;
|
||||
|
||||
if (currentType != ControllerType.None && (npad & acceptedTypes) != 0 && _supportedPlayers[i])
|
||||
{
|
||||
|
||||
@@ -23,12 +23,14 @@ namespace Ryujinx.HLE.HOS.Services.Hid
|
||||
{
|
||||
newState.TouchesCount = points.Length;
|
||||
|
||||
int pointsLength = Math.Min(points.Length, newState.Touches.Length);
|
||||
Span<TouchState> touchesSpan = newState.Touches.AsSpan();
|
||||
|
||||
int pointsLength = Math.Min(points.Length, touchesSpan.Length);
|
||||
|
||||
for (int i = 0; i < pointsLength; ++i)
|
||||
{
|
||||
TouchPoint pi = points[i];
|
||||
newState.Touches[i] = new TouchState
|
||||
touchesSpan[i] = new TouchState
|
||||
{
|
||||
DeltaTime = newState.SamplingNumber,
|
||||
Attribute = pi.Attribute,
|
||||
|
||||
Reference in New Issue
Block a user