Skip to content

Commit

Permalink
fix incorrect masking
Browse files Browse the repository at this point in the history
storing 36 bits of data in a 32 bit integer doesn't work so well
  • Loading branch information
LotP1 committed Nov 29, 2024
1 parent 72f227a commit 90b57a7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/ARMeilleure/Common/AddressTableLevel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ public AddressTableLevel(int index, int length)
/// </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);
}
}
}
2 changes: 1 addition & 1 deletion src/Ryujinx.Cpu/AddressTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ public ref TEntry GetValue(ulong address)
{
TEntry* page = GetPage(address);

int index = Levels[^1].GetValue(address);
long index = Levels[^1].GetValue(address);

EnsureMapped((IntPtr)(page + index));

Expand Down

0 comments on commit 90b57a7

Please sign in to comment.