This commit is contained in:
gdkchan 2018-08-01 22:30:12 -03:00
commit bec39a10e4
2 changed files with 9 additions and 2 deletions

View file

@ -228,7 +228,7 @@ namespace ChocolArm64.Memory
PageTable[L0][L1] = Ptr; PageTable[L0][L1] = Ptr;
} }
public bool[] IsRegionModified(long Position, long Size) public (bool[], int) IsRegionModified(long Position, long Size)
{ {
long EndPosition = (Position + Size + PageMask) & ~PageMask; long EndPosition = (Position + Size + PageMask) & ~PageMask;
@ -238,6 +238,8 @@ namespace ChocolArm64.Memory
bool[] Modified = new bool[Size >> PTPageBits]; bool[] Modified = new bool[Size >> PTPageBits];
int Count = 0;
lock (ObservedPages) lock (ObservedPages)
{ {
for (int Page = 0; Page < Modified.Length; Page++) for (int Page = 0; Page < Modified.Length; Page++)
@ -257,7 +259,10 @@ namespace ChocolArm64.Memory
if (Lvl1 != null) if (Lvl1 != null)
{ {
Modified[Page] = Lvl1[L1] != null; if (Modified[Page] = Lvl1[L1] != null)
{
Count++;
}
} }
} }

View file

@ -130,6 +130,8 @@ namespace Ryujinx.HLE.Gpu.Memory
{ {
(bool[] Modified, long ModifiedCount) = Memory.IsRegionModified(PA, Size); (bool[] Modified, long ModifiedCount) = Memory.IsRegionModified(PA, Size);
PA = Memory.GetPhysicalAddress(PA);
ClearCachedPagesIfNeeded(); ClearCachedPagesIfNeeded();
long PageSize = AMemory.PageSize; long PageSize = AMemory.PageSize;