From 4acb89b82299c474704273994e8bed3090abcea0 Mon Sep 17 00:00:00 2001 From: Abdelali221 <196317120+abdelali221@users.noreply.github.com> Date: Thu, 11 Sep 2025 10:04:54 +0100 Subject: [PATCH 1/2] Fixed a small bug. Not clearing the framebuffer caused some weird bugs, such as a green bar on the top of the screen and random crashes of the app. --- source/main.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/source/main.c b/source/main.c index 7f91cb8..e5d2930 100644 --- a/source/main.c +++ b/source/main.c @@ -73,7 +73,7 @@ int main(int argc, char **argv) { char gateway[16] = {0}; char netmask[16] = {0}; - VIDEO_Init(); + VIDEO_Init(); WPAD_Init(); PAD_Init(); @@ -84,11 +84,13 @@ int main(int argc, char **argv) { console_init(xfb,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ); - VIDEO_Configure(rmode); + VIDEO_Configure(rmode); VIDEO_SetNextFramebuffer(xfb); - VIDEO_SetBlack(FALSE); + VIDEO_ClearFrameBuffer(rmode, xfb, COLOR_BLACK); + + VIDEO_SetBlack(false); VIDEO_Flush(); @@ -265,7 +267,7 @@ int main(int argc, char **argv) { start_tui(config, winagent); - free(winagent); + if (winagent) free(winagent); clear_screen(); printf("Exiting...\n"); From 7e8be3eaff2cf7de69d392a7a7dc1f167766aa6f Mon Sep 17 00:00:00 2001 From: Abdelali <196317120+abdelali221@users.noreply.github.com> Date: Thu, 23 Oct 2025 06:56:43 +0100 Subject: [PATCH 2/2] Fixed the issue that caused the app to behave weirdly (thanks to nezbednik!). --- source/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/main.c b/source/main.c index e5d2930..2a65f47 100644 --- a/source/main.c +++ b/source/main.c @@ -82,7 +82,7 @@ int main(int argc, char **argv) { xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode)); - console_init(xfb,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ); + console_init(xfb,20,20,rmode->fbWidth-20,rmode->xfbHeight-20,rmode->fbWidth*VI_DISPLAY_PIX_SZ); VIDEO_Configure(rmode);