From f434787b6895e7a5f58c68c03ee1504789c34dd4 Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Wed, 26 Jul 2023 19:38:51 +0300 Subject: [PATCH] Fix double buffering bug --- src/emulator.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/emulator.cpp b/src/emulator.cpp index c5ea26d1..e24d617f 100644 --- a/src/emulator.cpp +++ b/src/emulator.cpp @@ -363,8 +363,8 @@ void Emulator::runFrame() { #ifdef PANDA3DS_ENABLE_HTTP_SERVER httpServer.processActions(); #endif - cpu.runFrame(); // Run 1 frame of instructions - gpu.display(); // Display graphics + cpu.runFrame(); // Run 1 frame of instructions + gpu.display(); // Display graphics // Send VBlank interrupts ServiceManager& srv = kernel.getServiceManager(); @@ -374,6 +374,10 @@ void Emulator::runFrame() { if (haveCheats) [[unlikely]] { cheats.run(); } + } else if (romType != ROMType::None) { + // If the emulator is not running and a game is loaded, we still want to display the framebuffer otherwise we will get weird + // double-buffering issues + gpu.display(); } }