From 03a0d3457b3f096bdc69c0c6511033f18317ba93 Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Wed, 9 Jan 2013 02:41:00 -0500 Subject: Attempt to fix the crashing with sound interrupts, part 2: Stop the timer before the menu, and restart it after it ends. --- source/nds/entry.cpp | 2 +- source/nds/gui.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/source/nds/entry.cpp b/source/nds/entry.cpp index 788dd35..80b1221 100644 --- a/source/nds/entry.cpp +++ b/source/nds/entry.cpp @@ -613,8 +613,8 @@ int sfc_main (int argc, char **argv) copy_screen((void*)screen, up_screen_addr, 0, 0, 256, 192); menu(screen); - Settings.Paused = 0; game_disableAudio(); + Settings.Paused = 0; } #ifdef JOYSTICK_SUPPORT diff --git a/source/nds/gui.c b/source/nds/gui.c index c778ae1..7913481 100644 --- a/source/nds/gui.c +++ b/source/nds/gui.c @@ -1651,7 +1651,8 @@ unsigned int frame_interval; --------------------------------------------------------*/ u32 menu(u16 *screen) { - mdelay(50); // to prevent the touch key from being applied too soon? + stopTimer(0 /* timer interrupt channel for sound */); + mdelay(100); // to prevent ds2_setBacklight() from freezing/crashing gui_action_type gui_action; u32 i; u32 repeat; @@ -3849,6 +3850,7 @@ u32 menu(u16 *screen) ds2_setBacklight(2); wait_Allkey_release(0); + runTimer(0 /* timer interrupt channel for sound */); return return_value; } -- cgit v1.2.3