From d87b5e732417a2797eff22b3593be2ef44d6aa3d Mon Sep 17 00:00:00 2001 From: goyuken Date: Sat, 4 May 2013 01:30:39 +0000 Subject: [PATCH] n64: turn right side up again --- BizHawk.Emulation/Consoles/Nintendo/N64/N64.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/BizHawk.Emulation/Consoles/Nintendo/N64/N64.cs b/BizHawk.Emulation/Consoles/Nintendo/N64/N64.cs index e1ef907823..a302aebea6 100644 --- a/BizHawk.Emulation/Consoles/Nintendo/N64/N64.cs +++ b/BizHawk.Emulation/Consoles/Nintendo/N64/N64.cs @@ -349,14 +349,22 @@ namespace BizHawk.Emulation.Consoles.Nintendo.N64 [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate void StartupCallback(); - //byte[] m64p_FrameBuffer = new byte[800 * 600 * 3]; + int[] m64p_FrameBuffer = new int[800 * 600]; public void Getm64pFrameBuffer() { int width = 0; int height = 0; - //GFXReadScreen2(m64p_FrameBuffer, ref width, ref height, 0); - GFXReadScreen2(frameBuffer, ref width, ref height, 0); - //m64pFrameComplete = true; + GFXReadScreen2(m64p_FrameBuffer, ref width, ref height, 0); + + // vflip + int fromindex = 800 * 599 * 4; + int toindex = 0; + for (int j = 0; j < 600; j++) + { + Buffer.BlockCopy(m64p_FrameBuffer, fromindex, frameBuffer, toindex, 800 * 4); + fromindex -= 800 * 4; + toindex += 800 * 4; + } } [UnmanagedFunctionPointer(CallingConvention.Cdecl)]