From a2036f5ce7e1e37d7e543e3dbab0cd9a6fbc6ea6 Mon Sep 17 00:00:00 2001 From: MegaMech Date: Sat, 17 Jan 2026 22:35:21 -0700 Subject: [PATCH] Fix screen blanking (#627) * Update main.c * Update skybox_and_splitscreen.c * Adjust framebuffer handling in race_logic_loop Reorder framebuffer clearing and creation for proper rendering. --- src/main.c | 5 +++-- src/racing/skybox_and_splitscreen.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main.c b/src/main.c index 5aa7e13ea..3053dad9f 100644 --- a/src/main.c +++ b/src/main.c @@ -469,7 +469,7 @@ void* clear_framebuffer(s32 color) { gDPSetCycleType(gDisplayListHead++, G_CYC_FILL); gDPSetFillColor(gDisplayListHead++, color); - gDPFillRectangle(gDisplayListHead++, 0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1); + gDPFillWideRectangle(gDisplayListHead++, OTRGetRectDimensionFromLeftEdge(0), 0, OTRGetGameRenderWidth(), SCREEN_HEIGHT); gDPPipeSync(gDisplayListHead++); @@ -1172,8 +1172,9 @@ void thread5_iteration(void) { } profiler_log_thread5_time(THREAD5_START); config_gfx_pool(); - FB_CreateFramebuffers(); read_controllers(); + FB_CreateFramebuffers(); + clear_framebuffer(0); // Clear the framebuffer game_state_handler(); // call_render_hook(); diff --git a/src/racing/skybox_and_splitscreen.c b/src/racing/skybox_and_splitscreen.c index 2ae1548f7..b36a55772 100644 --- a/src/racing/skybox_and_splitscreen.c +++ b/src/racing/skybox_and_splitscreen.c @@ -280,7 +280,7 @@ void select_framebuffer(void) { GPACK_RGBA5551(D_800DC5D0, D_800DC5D4, D_800DC5D8, 1)); gDPPipeSync(gDisplayListHead++); gDPSetScissor(gDisplayListHead++, G_SC_NON_INTERLACE, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); - gDPFillRectangle(gDisplayListHead++, 0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1); + gDPFillWideRectangle(gDisplayListHead++, OTRGetRectDimensionFromLeftEdge(0), 0, OTRGetGameRenderWidth(), SCREEN_HEIGHT); gDPPipeSync(gDisplayListHead++); gDPSetCycleType(gDisplayListHead++, G_CYC_1CYCLE); }