aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNebuleon Fumika2013-01-09 02:41:00 -0500
committerNebuleon Fumika2013-01-09 03:21:44 -0500
commit03a0d3457b3f096bdc69c0c6511033f18317ba93 (patch)
treea94335d9a09fd30c1fd92f0b0afb38ce0753eb67
parent3585aa1c2a7af48728486d76a45efce7599b6ff6 (diff)
downloadsnes9x2005-03a0d3457b3f096bdc69c0c6511033f18317ba93.tar.gz
snes9x2005-03a0d3457b3f096bdc69c0c6511033f18317ba93.tar.bz2
snes9x2005-03a0d3457b3f096bdc69c0c6511033f18317ba93.zip
Attempt to fix the crashing with sound interrupts, part 2: Stop the timer before the menu, and restart it after it ends.
-rw-r--r--source/nds/entry.cpp2
-rw-r--r--source/nds/gui.c4
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;
}