fix incorrect masking

storing 36 bits of data in a 32 bit integer doesn't work so well
This commit is contained in:
LotP1 2024-11-29 22:31:23 +01:00
parent 72f227a1f9
commit 90b57a78be
2 changed files with 3 additions and 3 deletions

View File

@ -36,9 +36,9 @@ namespace ARMeilleure.Common
/// </summary>
/// <param name="address">Guest address</param>
/// <returns>Value of the <see cref="AddressTableLevel"/> from the specified guest <paramref name="address"/></returns>
public int GetValue(ulong address)
public long GetValue(ulong address)
{
return (int)((address & Mask) >> Index);
return (long)((address & Mask) >> Index);
}
}
}

View File

@ -238,7 +238,7 @@ namespace ARMeilleure.Common
{
TEntry* page = GetPage(address);
int index = Levels[^1].GetValue(address);
long index = Levels[^1].GetValue(address);
EnsureMapped((IntPtr)(page + index));