Index: ondavx747.c
===================================================================
--- ondavx747.c	(版本 27631)
+++ ondavx747.c	(工作副本)
@@ -7,7 +7,7 @@
  *                     \/            \/     \/    \/            \/
  * $Id$
  *
- * Copyright (C) 2008 by Maurus Cuelenaere
+ * Copyright (C) 2010 by Purling Nayuki based on Maurus Cuelenaere's Bootloader.
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -188,7 +188,17 @@
 #define TEXT_Y(i)     (RECT_Y(i) + RECT_HEIGHT/2 - SYSFONT_HEIGHT/2)
 static int boot_menu(void)
 {
-    const char* strings[] = {"Boot Rockbox", "Boot OF", "USB mode", "Reset Rockbox configuration"};
+    const char* strings[] = {"Boot Rockbox", 
+   	                         "Boot OF", 
+   	                         "USB mode", 
+   	                         "Reset Rockbox configuration"};
+    
+    #ifndef HAVE_TOUCHSCREEN
+    int found = 0, dummy, slen;
+    #else
+    int found = -1;
+    #endif
+    
     int button, touch, poweroff_repeat = 0;
     unsigned int i;
 
@@ -202,16 +212,34 @@
         lcd_drawrect(RECT_X, RECT_Y(i), RECT_WIDTH, RECT_HEIGHT);
         lcd_putsxy(TEXT_X(i), TEXT_Y(i), strings[i]);
     }
-    lcd_update();
+    #ifndef HAVE_TOUCHSCREEN
+    lcd_drawrect(RECT_X, RECT_Y(found), RECT_WIDTH, RECT_HEIGHT);
+    #endif
+	lcd_update();
 
     while(1)
     {
-        button = button_get_w_tmo(HZ/4);
+    	#ifndef HAVE_TOUCHSCREEN
+    	 sleep(HZ/6);
+        lcd_clear_display();
+        for(i=0; i<ARRAYLEN(strings); i++)
+        {
+            lcd_drawrect(RECT_X, RECT_Y(i), RECT_WIDTH, RECT_HEIGHT);
+            lcd_putsxy(TEXT_X(i), TEXT_Y(i), strings[i]);
+        }
+    	 lcd_drawrect(RECT_X, RECT_Y(found), RECT_WIDTH, RECT_HEIGHT);
+    	#endif
+    	#ifdef HAVE_TOUCHSCREEN
+         button = button_get_w_tmo(HZ/4);
+        #else
+         button = button_read_device(&dummy);
+        #endif
+        
+        #ifdef HAVE_TOUCHSCREEN
         if(button & BUTTON_TOUCHSCREEN)
         {
             touch = button_get_data();
             unsigned int x = touch & 0xFFFF, y = touch >> 16;
-            int found = -1;
             for(i=0; i<ARRAYLEN(strings); i++)
             {
                 if(x > RECT_X && x < RECT_X+RECT_WIDTH &&
@@ -221,6 +249,28 @@
                     break;
                 }
             }
+        #else
+        if(button & BUTTON_VOL_UP)
+    	{
+    		if(found==slen)
+    		    found = 0;
+		    else
+		        found += 1;
+            goto redraw;
+    	}
+   	    
+        else if(button & BUTTON_VOL_DOWN)
+    	{
+    		if(found==0)
+    		    found = slen;
+		    else
+		        found -= 1;
+            goto redraw;
+    	}
+    	
+    	else if(button & BUTTON_MENU)
+    	{
+   		#endif
 
             switch(found)
             {
@@ -242,6 +292,9 @@
 
             if(found != -1)
                 goto redraw;
+        #ifndef HAVE_SCREEN
+    	}
+    	#endif
         }
         else if(button & BUTTON_POWER)
     {
