From 1c0fb50877fdcca0e5560632946648309abf4ad3 Mon Sep 17 00:00:00 2001 From: bulzipke Date: Tue, 28 Jul 2020 15:03:43 +0900 Subject: [PATCH] Update ctr_gfx.c It fixed the sound cracking when opening or closing the 3DS screen. --- gfx/drivers/ctr_gfx.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gfx/drivers/ctr_gfx.c b/gfx/drivers/ctr_gfx.c index 7670b0624f..b7103aa708 100644 --- a/gfx/drivers/ctr_gfx.c +++ b/gfx/drivers/ctr_gfx.c @@ -294,6 +294,19 @@ static void ctr_lcd_aptHook(APT_HookType hook, void* param) svcCloseHandle(lcd_handle); } } + + if (menu_driver_is_alive()) + { + return; + } + else if ((hook == APTHOOK_ONSUSPEND) || (hook == APTHOOK_ONSLEEP)) + { + command_event(CMD_EVENT_AUDIO_STOP, NULL); + } + else if ((hook == APTHOOK_ONRESTORE) || (hook == APTHOOK_ONWAKEUP)) + { + command_event(CMD_EVENT_AUDIO_START, NULL); + } } static void ctr_vsync_hook(ctr_video_t* ctr)