From 7aa73e609b75568ffa85752d37f42aa3fd3833aa Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 28 Mar 2026 00:20:03 -0400 Subject: [PATCH] fix: handle RETRO_ENVIRONMENT_SHUTDOWN in Minarch environment callback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cores like PRBoom that have a built-in quit menu call environ_cb(RETRO_ENVIRONMENT_SHUTDOWN) to request the frontend to exit. Minarch had no handler for this command, so the request was silently ignored, leaving the main loop spinning on a core that returns immediately from retro_run() — resulting in a frozen screen with no input response. Set quit = 1 when shutdown is requested, matching the same exit path used by Minarch's own quit menu. --- workspace/all/minarch/minarch.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/workspace/all/minarch/minarch.c b/workspace/all/minarch/minarch.c index ed2f92abd..7507309ba 100644 --- a/workspace/all/minarch/minarch.c +++ b/workspace/all/minarch/minarch.c @@ -4514,6 +4514,11 @@ static bool environment_callback(unsigned cmd, void *data) { // copied from pico if (message) LOG_info("%s\n", message->msg); break; } + case RETRO_ENVIRONMENT_SHUTDOWN: { /* 7 */ + LOG_info("Core requested shutdown\n"); + quit = 1; + break; + } case RETRO_ENVIRONMENT_SET_PERFORMANCE_LEVEL: { /* 8 */ // puts("RETRO_ENVIRONMENT_SET_PERFORMANCE_LEVEL"); // TODO: used by fceumm at least