From 7df4fcada702dbc01d09b8f6fa027f5d409e33e3 Mon Sep 17 00:00:00 2001 From: riperiperi Date: Fri, 5 May 2023 22:40:46 +0100 Subject: GPU: Remove CPU region handle containers (#4817) * GPU: Remove CPU region handle containers. Another one for the "I don't know why I didn't do this earlier" pile. This removes the "Cpu" prefixed region handle classes, which each mirror a region handle type from Ryujinx.Memory. Originally, not all projects had a reference to Ryujinx.Memory, so these classes were introduced to bridge the gap. Someone else crossed that bridge since, so these classes don't have much of a purpose anymore. This PR replaces all uses of CpuRegionHandle etc to their direct Ryujinx.Memory versions. RegionHandle methods (specifically QueryModified) are about the hottest path there is in the entire emulator, so there is a nice boost from doing this. * Add docs --- src/Ryujinx.Cpu/Tracking/CpuRegionHandle.cs | 37 ----------------------------- 1 file changed, 37 deletions(-) delete mode 100644 src/Ryujinx.Cpu/Tracking/CpuRegionHandle.cs (limited to 'src/Ryujinx.Cpu/Tracking/CpuRegionHandle.cs') diff --git a/src/Ryujinx.Cpu/Tracking/CpuRegionHandle.cs b/src/Ryujinx.Cpu/Tracking/CpuRegionHandle.cs deleted file mode 100644 index e766460f..00000000 --- a/src/Ryujinx.Cpu/Tracking/CpuRegionHandle.cs +++ /dev/null @@ -1,37 +0,0 @@ -using Ryujinx.Memory.Tracking; -using System; - -namespace Ryujinx.Cpu.Tracking -{ - public class CpuRegionHandle : IRegionHandle - { - private readonly RegionHandle _impl; - - public bool Dirty => _impl.Dirty; - public bool Unmapped => _impl.Unmapped; - public ulong Address => _impl.Address; - public ulong Size => _impl.Size; - public ulong EndAddress => _impl.EndAddress; - - internal CpuRegionHandle(RegionHandle impl) - { - _impl = impl; - } - - public void Dispose() => _impl.Dispose(); - public bool DirtyOrVolatile() => _impl.DirtyOrVolatile(); - public void ForceDirty() => _impl.ForceDirty(); - public IRegionHandle GetHandle() => _impl; - public void RegisterAction(RegionSignal action) => _impl.RegisterAction(action); - public void RegisterPreciseAction(PreciseRegionSignal action) => _impl.RegisterPreciseAction(action); - public void RegisterDirtyEvent(Action action) => _impl.RegisterDirtyEvent(action); - public void Reprotect(bool asDirty = false) => _impl.Reprotect(asDirty); - - public bool OverlapsWith(ulong address, ulong size) => _impl.OverlapsWith(address, size); - - public bool RangeEquals(CpuRegionHandle other) - { - return _impl.RealAddress == other._impl.RealAddress && _impl.RealSize == other._impl.RealSize; - } - } -} -- cgit v1.2.3