From cc64ef9670c8115543d965c5bda665dec2cfa8fe Mon Sep 17 00:00:00 2001 From: TuxSH Date: Tue, 20 Jun 2017 18:29:30 +0200 Subject: [PATCH] Take fb stride into account --- sysmodules/rosalina/source/draw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sysmodules/rosalina/source/draw.c b/sysmodules/rosalina/source/draw.c index 4cb2411..c02e850 100644 --- a/sysmodules/rosalina/source/draw.c +++ b/sysmodules/rosalina/source/draw.c @@ -265,10 +265,11 @@ void Draw_ConvertFrameBufferLine(u8 *line, bool top, bool left, u32 y) GSPGPU_FramebufferFormats fmt = top ? (GSPGPU_FramebufferFormats)(GPU_FB_TOP_FMT & 7) : (GSPGPU_FramebufferFormats)(GPU_FB_BOTTOM_FMT & 7); u32 width = top ? 400 : 320; u8 formatSizes[] = { 4, 3, 2, 2, 2 }; + u32 stride = top ? GPU_FB_TOP_STRIDE : GPU_FB_BOTTOM_STRIDE; u32 pa = Draw_GetCurrentFramebufferAddress(top, left); u8 *addr = (u8 *)PA_PTR(pa); for(u32 x = 0; x < width; x++) - Draw_ConvertPixelToBGR8(line + x * 3 , addr + (x * 240 + y) * formatSizes[(u8)fmt], fmt); + Draw_ConvertPixelToBGR8(line + x * 3 , addr + x * stride + y * formatSizes[(u8)fmt], fmt); }