Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into screenshot-filename…
Browse files Browse the repository at this point in the history
…-improvements
  • Loading branch information
ioistired committed Nov 17, 2020
2 parents c5a9715 + c058e3f commit 50d9fa2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sysmodules/pm/source/firmlaunch.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ static void *const g_firmlaunchParameters = (void *)0x12000000;

void mapFirmlaunchParameters(void)
{
assertSuccess(svcKernelSetState(3, 0, g_firmlaunchParameters));
assertSuccess(svcKernelSetState(3, 0, (u64)((uintptr_t)g_firmlaunchParameters)));
}

Result GetFirmlaunchParams(void *outParams, size_t size)
Expand Down
4 changes: 4 additions & 0 deletions sysmodules/rosalina/include/draw.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions sysmodules/rosalina/source/draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -203,6 +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;

gpuSavedFillColor = LCD_BOT_FILLCOLOR;
LCD_BOT_FILLCOLOR = 0;

return framebufferCacheSize;
}
Expand All @@ -211,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;
Expand Down

0 comments on commit 50d9fa2

Please sign in to comment.