git.y1.nz

SameBoy

Accurate GB/GBC emulator
download: https://git.y1.nz/archives/sameboy.tar.gz
README | Files | Log | Refs | LICENSE

commit 9096f629c9fab8f279043911d818cd6f3703a003
parent d50f9df9742b813df9acaa895f0b8f8eadfe709d
Author: Lior Halphon <LIJI32@gmail.com>
Date:   Fri, 28 Mar 2025 13:11:26 +0300

Fix double ^C quit on non-Windows SDL builds

Diffstat:
MSDL/main.c11+++++++++++
1 file changed, 11 insertions(+), 0 deletions(-)

diff --git a/SDL/main.c b/SDL/main.c @@ -123,6 +123,9 @@ retry: { #endif SDL_Event event; SDL_WaitEvent(&event); + if (pending_command == GB_SDL_QUIT_COMMAND) { + return strdup("c"); + } switch (event.type) { case SDL_DISPLAYEVENT: update_swap_interval(); @@ -673,7 +676,15 @@ static void rumble(GB_gameboy_t *gb, double amp) static void debugger_interrupt(int ignore) { +#ifndef _WIN32 + if (GB_debugger_is_stopped(&gb)) { + pending_command = GB_SDL_QUIT_COMMAND; + console_line_ready(); // Force the debugger wait-loop to process the command + return; + } +#endif pending_command = GB_SDL_DEBUGGER_INTERRUPT_COMMAND; + } #ifndef _WIN32

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.