aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNebuleon Fumika2013-01-27 00:30:48 -0500
committerNebuleon Fumika2013-01-27 00:30:48 -0500
commit362b28e9372d124ac6602bfc49e9775e510ba929 (patch)
tree14d380251d7cec1fc4acbc21c6c0bd0d7635df59
parentdded2161378bdf0ead156f47f2473872854fc129 (diff)
downloadsnes9x2005-362b28e9372d124ac6602bfc49e9775e510ba929.tar.gz
snes9x2005-362b28e9372d124ac6602bfc49e9775e510ba929.tar.bz2
snes9x2005-362b28e9372d124ac6602bfc49e9775e510ba929.zip
Suspend on lid-close in the menu.
-rw-r--r--source/nds/gui.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/source/nds/gui.c b/source/nds/gui.c
index 93b3e7b..ece310c 100644
--- a/source/nds/gui.c
+++ b/source/nds/gui.c
@@ -324,6 +324,21 @@ gui_action_type get_gui_input(void)
key = getKey();
+ if (key & KEY_LID)
+ {
+ ds2_setSupend();
+ struct key_buf inputdata;
+ do {
+ ds2_getrawInput(&inputdata);
+ mdelay(1);
+ } while (inputdata.key & KEY_LID);
+ ds2_wakeup();
+ // In the menu, the lower screen's backlight needs to be on,
+ // and it is on right away after resuming from suspend.
+ // mdelay(100); // needed to avoid ds2_setBacklight crashing
+ // ds2_setBacklight(3);
+ }
+
switch(key)
{
case KEY_UP: