From 8c7f31bb4d17c384397313bd9b7117dedeb5042c Mon Sep 17 00:00:00 2001 From: Nanquitas Date: Thu, 23 Jul 2020 16:29:11 +0000 Subject: [PATCH 1/2] Rosalina: disable black fillcolor --- sysmodules/rosalina/include/draw.h | 4 ++++ sysmodules/rosalina/source/draw.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/sysmodules/rosalina/include/draw.h b/sysmodules/rosalina/include/draw.h index 5a5ef106..982f4a1d 100644 --- a/sysmodules/rosalina/include/draw.h +++ b/sysmodules/rosalina/include/draw.h @@ -55,7 +55,11 @@ #define GPU_CMDLIST_CNT REG32(0x104018F0) #define LCD_TOP_BRIGHTNESS REG32(0x10202240) +#define LCD_TOP_FILLCOLOR REG32(0x10202204) #define LCD_BOT_BRIGHTNESS REG32(0x10202A40) +#define LCD_BOT_FILLCOLOR REG32(0x10202A04) + +#define LCD_FILLCOLOR_ENABLE (1u << 24) #define FB_BOTTOM_VRAM_ADDR ((void *)0x1F48F000) // cached #define FB_BOTTOM_VRAM_PA 0x1848F000 diff --git a/sysmodules/rosalina/source/draw.c b/sysmodules/rosalina/source/draw.c index f8ee6724..29f9c33e 100644 --- a/sysmodules/rosalina/source/draw.c +++ b/sysmodules/rosalina/source/draw.c @@ -204,6 +204,8 @@ u32 Draw_SetupFramebuffer(void) GPU_FB_BOTTOM_FMT = format; GPU_FB_BOTTOM_STRIDE = 240 * 2; + LCD_BOT_FILLCOLOR &= ~LCD_FILLCOLOR_ENABLE; + return framebufferCacheSize; } From 804268916a54fcdba48404c03ed203f69d1ca2cf Mon Sep 17 00:00:00 2001 From: Nanquitas Date: Mon, 27 Jul 2020 06:50:12 +0200 Subject: [PATCH 2/2] rosalina: restore fillcolor reg --- sysmodules/rosalina/source/draw.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sysmodules/rosalina/source/draw.c b/sysmodules/rosalina/source/draw.c index 29f9c33e..333f48a9 100644 --- a/sysmodules/rosalina/source/draw.c +++ b/sysmodules/rosalina/source/draw.c @@ -36,7 +36,7 @@ #define KERNPA2VA(a) ((a) + (GET_VERSION_MINOR(osGetKernelVersion()) < 44 ? 0xD0000000 : 0xC0000000)) -static u32 gpuSavedFramebufferAddr1, gpuSavedFramebufferAddr2, gpuSavedFramebufferFormat, gpuSavedFramebufferStride; +static u32 gpuSavedFramebufferAddr1, gpuSavedFramebufferAddr2, gpuSavedFramebufferFormat, gpuSavedFramebufferStride, gpuSavedFillColor; static u32 framebufferCacheSize; static void *framebufferCache; static RecursiveLock lock; @@ -203,8 +203,9 @@ u32 Draw_SetupFramebuffer(void) GPU_FB_BOTTOM_ADDR_1 = GPU_FB_BOTTOM_ADDR_2 = FB_BOTTOM_VRAM_PA; GPU_FB_BOTTOM_FMT = format; GPU_FB_BOTTOM_STRIDE = 240 * 2; - - LCD_BOT_FILLCOLOR &= ~LCD_FILLCOLOR_ENABLE; + + gpuSavedFillColor = LCD_BOT_FILLCOLOR; + LCD_BOT_FILLCOLOR = 0; return framebufferCacheSize; } @@ -213,7 +214,8 @@ void Draw_RestoreFramebuffer(void) { memcpy(FB_BOTTOM_VRAM_ADDR, framebufferCache, FB_BOTTOM_SIZE); Draw_FlushFramebuffer(); - + + LCD_BOT_FILLCOLOR = gpuSavedFillColor; GPU_FB_BOTTOM_ADDR_1 = gpuSavedFramebufferAddr1; GPU_FB_BOTTOM_ADDR_2 = gpuSavedFramebufferAddr2; GPU_FB_BOTTOM_FMT = gpuSavedFramebufferFormat;