diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2024-08-05 11:00:41 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-05 11:00:41 -0300 |
| commit | 4a4b11871e362016b41c56d4dd4654ade0b894e0 (patch) | |
| tree | c8cafe8f577411b371550c06d2ea03625586fd35 /src/Ryujinx.Memory/Range/IMultiRangeItem.cs | |
| parent | e85ee673b10da5a314e68cea88caeacd2918f311 (diff) | |
Fix same textures with unmapped start being considered different (#7141)
* Fix same textures with unmapped start being considered different
* Consolidate IsInvalid check
* InvalidAddress const
* Fix typo
Co-authored-by: riperiperi <rhy3756547@hotmail.com>
---------
Co-authored-by: riperiperi <rhy3756547@hotmail.com>
Diffstat (limited to 'src/Ryujinx.Memory/Range/IMultiRangeItem.cs')
| -rw-r--r-- | src/Ryujinx.Memory/Range/IMultiRangeItem.cs | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/Ryujinx.Memory/Range/IMultiRangeItem.cs b/src/Ryujinx.Memory/Range/IMultiRangeItem.cs index 87fde246..5f9611c7 100644 --- a/src/Ryujinx.Memory/Range/IMultiRangeItem.cs +++ b/src/Ryujinx.Memory/Range/IMultiRangeItem.cs @@ -4,6 +4,22 @@ namespace Ryujinx.Memory.Range { MultiRange Range { get; } - ulong BaseAddress => Range.GetSubRange(0).Address; + ulong BaseAddress + { + get + { + for (int index = 0; index < Range.Count; index++) + { + MemoryRange subRange = Range.GetSubRange(index); + + if (!MemoryRange.IsInvalid(ref subRange)) + { + return subRange.Address; + } + } + + return MemoryRange.InvalidAddress; + } + } } } |
