diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2018-02-08 20:20:01 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-02-08 20:20:01 -0300 |
| commit | ae91da5b60789e4e900823a6ec999ce0d748911e (patch) | |
| tree | a624749e51bc5c2bd716f150e4f7ecec1a19382b /GLScreen.cs | |
| parent | 7be38562b14ccf829efd90125c75eaed359a039d (diff) | |
| parent | 18ac1c4045cc156068bd5a4fa82035c79c74e25d (diff) | |
Merge pull request #2 from gdkchan/direct_memory
Removed parts of the MMU functionality to use memory directly (faster…
Diffstat (limited to 'GLScreen.cs')
| -rw-r--r-- | GLScreen.cs | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/GLScreen.cs b/GLScreen.cs index d757db8f..3e16f7f1 100644 --- a/GLScreen.cs +++ b/GLScreen.cs @@ -6,6 +6,7 @@ using Gal; using OpenTK; using OpenTK.Graphics; using OpenTK.Graphics.OpenGL; +using Ryujinx.OsHle; using System; namespace Ryujinx @@ -60,12 +61,14 @@ namespace Ryujinx unsafe void UploadBitmap() { - if (Renderer.FrameBufferPtr == 0) + int FbSize = Width * Height * 4; + + if (Renderer.FrameBufferPtr == 0 || Renderer.FrameBufferPtr + FbSize > uint.MaxValue) { return; } - byte* SrcPtr = (byte*)IntPtr.Add(Ns.Ram, (int)Renderer.FrameBufferPtr); + byte* SrcPtr = (byte*)Ns.Ram + (uint)Renderer.FrameBufferPtr; for (int Y = 0; Y < Height; Y++) { @@ -275,7 +278,14 @@ void main(void) { { unsafe { - byte* Ptr = (byte*)IntPtr.Add(Ns.Ram, (int)Ns.Os.HidOffset); + long HidOffset = Ns.Os.GetVirtHidOffset(); + + if (HidOffset == 0 || HidOffset + Horizon.HidSize > uint.MaxValue) + { + return; + } + + byte* Ptr = (byte*)Ns.Ram + (uint)HidOffset; int State = 0; |
