From 2834bae31838aadbb4f9758f5d5af7827cefc4e6 Mon Sep 17 00:00:00 2001 From: TuxSH <1922548+TuxSH@users.noreply.github.com> Date: Fri, 8 May 2020 20:51:41 +0100 Subject: [PATCH] rosalina screenshots: improve conversion time by another 10% --- sysmodules/rosalina/source/draw.c | 3 +++ sysmodules/rosalina/source/menus.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sysmodules/rosalina/source/draw.c b/sysmodules/rosalina/source/draw.c index 724d6fd..06ba87b 100644 --- a/sysmodules/rosalina/source/draw.c +++ b/sysmodules/rosalina/source/draw.c @@ -333,7 +333,10 @@ static void Draw_ConvertFrameBufferLinesKernel(const FrameBufferConvertArgs *arg for (u32 y = args->startingLine; y < args->startingLine + args->numLines; y++) { for(u32 x = 0; x < width; x++) + { + __builtin_prefetch(addr + x * stride + y * formatSizes[fmt], 0, 3); Draw_ConvertPixelToBGR8(args->buf + (x + width * y) * 3 , addr + x * stride + y * formatSizes[fmt], fmt); + } } } diff --git a/sysmodules/rosalina/source/menus.c b/sysmodules/rosalina/source/menus.c index 7d3e5c7..8625c36 100644 --- a/sysmodules/rosalina/source/menus.c +++ b/sysmodules/rosalina/source/menus.c @@ -279,7 +279,7 @@ void RosalinaMenu_TakeScreenshot(void) TRY(RosalinaMenu_WriteScreenshot(&file, false, true)); TRY(IFile_Close(&file)); - if(false && (GPU_FB_TOP_FMT & 0x20) && (Draw_GetCurrentFramebufferAddress(true, true) != Draw_GetCurrentFramebufferAddress(true, false))) + if((GPU_FB_TOP_FMT & 0x20) && (Draw_GetCurrentFramebufferAddress(true, true) != Draw_GetCurrentFramebufferAddress(true, false))) { sprintf(filename, "/luma/screenshots/%04lu-%02lu-%02lu_%02lu-%02lu-%02lu.%03llu_top_right.bmp", year, month, days, hours, minutes, seconds, milliseconds); TRY(IFile_Open(&file, archiveId, fsMakePath(PATH_EMPTY, ""), fsMakePath(PATH_ASCII, filename), FS_OPEN_CREATE | FS_OPEN_WRITE));