More flexible memory manager (#307)

* Keep track mapped buffers with fixed offsets

* Started rewriting the memory manager

* Initial support for MapPhysicalMemory and UnmapPhysicalMemory, other tweaks

* MapPhysicalMemory/UnmapPhysicalMemory support, other tweaks

* Rebased

* Optimize the map/unmap physical memory svcs

* Integrate shared font support

* Fix address space reserve alignment

* Some fixes related to gpu memory mapping

* Some cleanup

* Only try uploading const buffers that are really used

* Check if memory region is contiguous

* Rebased

* Add missing count increment on IsRegionModified

* Check for reads/writes outside of the address space, optimize translation with a tail call
This commit is contained in:
gdkchan
2018-08-15 15:59:51 -03:00
committed by GitHub
parent 76d95dee05
commit c393cdf8e3
64 changed files with 3289 additions and 1852 deletions

View File

@ -1,9 +1,9 @@
using Ryujinx.Audio;
using Ryujinx.Graphics.Gal;
using Ryujinx.HLE.Font;
using Ryujinx.HLE.Gpu;
using Ryujinx.HLE.Input;
using Ryujinx.HLE.Logging;
using Ryujinx.HLE.Memory;
using Ryujinx.HLE.OsHle;
using System;
@ -15,6 +15,8 @@ namespace Ryujinx.HLE
public Logger Log { get; private set; }
internal DeviceMemory Memory { get; private set; }
internal NvGpu Gpu { get; private set; }
internal VirtualFileSystem VFs { get; private set; }
@ -25,8 +27,6 @@ namespace Ryujinx.HLE
public Hid Hid { get; private set; }
public SharedFontManager Font { get; private set; }
public event EventHandler Finish;
public Switch(IGalRenderer Renderer, IAalOutput AudioOut)
@ -45,6 +45,8 @@ namespace Ryujinx.HLE
Log = new Logger();
Memory = new DeviceMemory();
Gpu = new NvGpu(Renderer);
VFs = new VirtualFileSystem();
@ -53,15 +55,7 @@ namespace Ryujinx.HLE
Statistics = new PerformanceStatistics();
Hid = new Hid(Log);
Font = new SharedFontManager(Log, VFs.GetSystemPath());
Os.HidSharedMem.MemoryMapped += Hid.ShMemMap;
Os.HidSharedMem.MemoryUnmapped += Hid.ShMemUnmap;
Os.FontSharedMem.MemoryMapped += Font.ShMemMap;
Os.FontSharedMem.MemoryUnmapped += Font.ShMemUnmap;
Hid = new Hid(this, Os.HidSharedMem.PA);
}
public void LoadCart(string ExeFsDir, string RomFsFile = null)