diff --git a/ExternalCoreProjects/Virtu/Memory.cs b/ExternalCoreProjects/Virtu/Memory.cs index 199110de20..b85abd7fdc 100644 --- a/ExternalCoreProjects/Virtu/Memory.cs +++ b/ExternalCoreProjects/Virtu/Memory.cs @@ -338,12 +338,12 @@ namespace Jellyfish.Virtu { return address switch { - > 0 and < 0x0200 => _ramMainRegion0001[address - 0], - > 0x0200 and < 0xC000 => _ramMainRegion02BF[address - 0x0200], - > 0xC000 and < 0xD000 => _ramMainBank1RegionD0DF[address - 0xC000], - > 0xD000 and < 0xE000 => _ramMainBank2RegionD0DF[address - 0xD000], - > 0xE000 and < 0x10000 => _ramMainRegionE0FF[address - 0xE000], - _ => throw new InvalidOperationException() + >= 0 and < 0x0200 => _ramMainRegion0001[address - 0], + >= 0x0200 and < 0xC000 => _ramMainRegion02BF[address - 0x0200], + >= 0xC000 and < 0xD000 => _ramMainBank1RegionD0DF[address - 0xC000], + >= 0xD000 and < 0xE000 => _ramMainBank2RegionD0DF[address - 0xD000], + >= 0xE000 and < 0x10000 => _ramMainRegionE0FF[address - 0xE000], + _ => throw new InvalidOperationException($"{nameof(address)} out of range ({address})") }; } @@ -351,23 +351,23 @@ namespace Jellyfish.Virtu { switch (address) { - case > 0 and < 0x0200: + case >= 0 and < 0x0200: _ramMainRegion0001[address - 0] = value; break; - case > 0x0200 and < 0xC000: + case >= 0x0200 and < 0xC000: _ramMainRegion02BF[address - 0x0200] = value; break; - case > 0xC000 and < 0xD000: + case >= 0xC000 and < 0xD000: _ramMainBank1RegionD0DF[address - 0xC000] = value; break; - case > 0xD000 and < 0xE000: + case >= 0xD000 and < 0xE000: _ramMainBank2RegionD0DF[address - 0xD000] = value; break; - case > 0xE000 and < 0x10000: + case >= 0xE000 and < 0x10000: _ramMainRegionE0FF[address - 0xE000] = value; break; default: - throw new InvalidOperationException(); + throw new InvalidOperationException($"{nameof(address)} out of range ({address})"); } } @@ -375,12 +375,12 @@ namespace Jellyfish.Virtu { return address switch { - > 0 and < 0x0200 => _ramAuxRegion0001[address - 0], - > 0x0200 and < 0xC000 => _ramAuxRegion02BF[address - 0x0200], - > 0xC000 and < 0xD000 => _ramAuxBank1RegionD0DF[address - 0xC000], - > 0xD000 and < 0xE000 => _ramAuxBank2RegionD0DF[address - 0xD000], - > 0xE000 and < 0x10000 => _ramAuxRegionE0FF[address - 0xE000], - _ => throw new InvalidOperationException() + >= 0 and < 0x0200 => _ramAuxRegion0001[address - 0], + >= 0x0200 and < 0xC000 => _ramAuxRegion02BF[address - 0x0200], + >= 0xC000 and < 0xD000 => _ramAuxBank1RegionD0DF[address - 0xC000], + >= 0xD000 and < 0xE000 => _ramAuxBank2RegionD0DF[address - 0xD000], + >= 0xE000 and < 0x10000 => _ramAuxRegionE0FF[address - 0xE000], + _ => throw new InvalidOperationException($"{nameof(address)} out of range ({address})") }; } @@ -388,23 +388,23 @@ namespace Jellyfish.Virtu { switch (address) { - case > 0 and < 0x0200: + case >= 0 and < 0x0200: _ramAuxRegion0001[address - 0] = value; break; - case > 0x0200 and < 0xC000: + case >= 0x0200 and < 0xC000: _ramAuxRegion02BF[address - 0x0200] = value; break; - case > 0xC000 and < 0xD000: + case >= 0xC000 and < 0xD000: _ramAuxBank1RegionD0DF[address - 0xC000] = value; break; - case > 0xD000 and < 0xE000: + case >= 0xD000 and < 0xE000: _ramAuxBank2RegionD0DF[address - 0xD000] = value; break; - case > 0xE000 and < 0x10000: + case >= 0xE000 and < 0x10000: _ramAuxRegionE0FF[address - 0xE000] = value; break; default: - throw new InvalidOperationException(); + throw new InvalidOperationException($"{nameof(address)} out of range ({address})"); } } diff --git a/References/Virtu.dll b/References/Virtu.dll index c18d3b4149..8b0923f614 100644 Binary files a/References/Virtu.dll and b/References/Virtu.dll differ