diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2018-03-09 23:12:57 -0300 |
|---|---|---|
| committer | gdkchan <gab.dark.100@gmail.com> | 2018-03-09 23:12:57 -0300 |
| commit | 5912bd2beb42e1853fdcf11e4bb87e063a0ef35b (patch) | |
| tree | 5ad631cea858a30e6c300eba0fa7da7a8ca14799 /Ryujinx.Core/OsHle | |
| parent | be0e4007dc92e24a77bdc36a40d2450c41d9b560 (diff) | |
Disable memory checks by default, even on debug, move ram memory allocation inside the CPU, since the size if fixed anyway, better heap region size
Diffstat (limited to 'Ryujinx.Core/OsHle')
| -rw-r--r-- | Ryujinx.Core/OsHle/MemoryRegions.cs | 5 | ||||
| -rw-r--r-- | Ryujinx.Core/OsHle/Process.cs | 2 | ||||
| -rw-r--r-- | Ryujinx.Core/OsHle/Services/Vi/NvFlinger.cs | 6 | ||||
| -rw-r--r-- | Ryujinx.Core/OsHle/Svc/SvcSystem.cs | 2 |
4 files changed, 8 insertions, 7 deletions
diff --git a/Ryujinx.Core/OsHle/MemoryRegions.cs b/Ryujinx.Core/OsHle/MemoryRegions.cs index 7f5ab0ed..75b97b1f 100644 --- a/Ryujinx.Core/OsHle/MemoryRegions.cs +++ b/Ryujinx.Core/OsHle/MemoryRegions.cs @@ -9,6 +9,9 @@ namespace Ryujinx.Core.OsHle public const long MapRegionAddress = 0x10000000; public const long MapRegionSize = 0x20000000; + public const long HeapRegionAddress = MapRegionAddress + MapRegionSize; + public const long HeapRegionSize = TlsPagesAddress - HeapRegionAddress; + public const long MainStackSize = 0x100000; public const long MainStackAddress = AMemoryMgr.AddrSize - MainStackSize; @@ -17,8 +20,6 @@ namespace Ryujinx.Core.OsHle public const long TlsPagesAddress = MainStackAddress - TlsPagesSize; - public const long HeapRegionAddress = MapRegionAddress + MapRegionSize; - public const long TotalMemoryUsed = HeapRegionAddress + TlsPagesSize + MainStackSize; public const long TotalMemoryAvailable = AMemoryMgr.RamSize - AddrSpaceStart; diff --git a/Ryujinx.Core/OsHle/Process.cs b/Ryujinx.Core/OsHle/Process.cs index f549b027..a919f1af 100644 --- a/Ryujinx.Core/OsHle/Process.cs +++ b/Ryujinx.Core/OsHle/Process.cs @@ -45,7 +45,7 @@ namespace Ryujinx.Core.OsHle this.Ns = Ns; this.ProcessId = ProcessId; - Memory = new AMemory(Ns.Ram); + Memory = Ns.Memory; Scheduler = new KProcessScheduler(); diff --git a/Ryujinx.Core/OsHle/Services/Vi/NvFlinger.cs b/Ryujinx.Core/OsHle/Services/Vi/NvFlinger.cs index 740a35f9..1d394fb4 100644 --- a/Ryujinx.Core/OsHle/Services/Vi/NvFlinger.cs +++ b/Ryujinx.Core/OsHle/Services/Vi/NvFlinger.cs @@ -264,11 +264,11 @@ namespace Ryujinx.Core.OsHle.IpcServices.Android int FbWidth = BufferQueue[Slot].Data.Width; int FbHeight = BufferQueue[Slot].Data.Height; - int FbSize = FbWidth * FbHeight * 4; + long FbSize = (uint)FbWidth * FbHeight * 4; HNvMap NvMap = GetNvMap(Context, Slot); - if (FbSize < 0 || NvMap.Address < 0 || NvMap.Address + FbSize > AMemoryMgr.AddrSize) + if ((ulong)(NvMap.Address + FbSize) > AMemoryMgr.AddrSize) { Logging.Error($"Frame buffer address {NvMap.Address:x16} is invalid!"); @@ -330,7 +330,7 @@ namespace Ryujinx.Core.OsHle.IpcServices.Android Rotate = -MathF.PI * 0.5f; } - byte* Fb = (byte*)Context.Ns.Ram + NvMap.Address; + byte* Fb = (byte*)Context.Ns.Memory.Ram + NvMap.Address; Context.Ns.Gpu.Renderer.QueueAction(delegate() { diff --git a/Ryujinx.Core/OsHle/Svc/SvcSystem.cs b/Ryujinx.Core/OsHle/Svc/SvcSystem.cs index 8a0a3917..a276fe3c 100644 --- a/Ryujinx.Core/OsHle/Svc/SvcSystem.cs +++ b/Ryujinx.Core/OsHle/Svc/SvcSystem.cs @@ -197,7 +197,7 @@ namespace Ryujinx.Core.OsHle.Svc break; case 5: - ThreadState.X1 = CurrentHeapSize; + ThreadState.X1 = MemoryRegions.HeapRegionSize; break; case 6: |
