H300 bootloader: (Work in progress) Boot Rockbox on RTC alarm, add charging screen, move to a separate source file, backlight is on during USB mode (again)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12546 a1c6a512-1295-4272-9138-f99709370657
diff --git a/bootloader/main.c b/bootloader/main.c
index 1b6ccc7..a9411a7 100644
--- a/bootloader/main.c
+++ b/bootloader/main.c
@@ -56,11 +56,6 @@
 static bool recovery_mode = false;
 #endif
 
-int usb_screen(void)
-{
-   return 0;
-}
-
 char version[] = APPSVERSION;
 
 /* Reset the cookie for the crt0 crash check */
@@ -434,9 +429,7 @@
         hold_status = true;
     }
     
-    /* Power on the hard drive early, to speed up the loading.
-       Some H300 don't like this, so we only do it for the H100 */
-#ifndef IRIVER_H300_SERIES
+    /* Power on the hard drive early, to speed up the loading. */
     if (!hold_status
 # ifdef HAVE_EEPROM_SETTINGS
         && !recovery_mode
@@ -450,7 +443,6 @@
     if (!hold_status && !usb_detect() && !recovery_mode)
         try_flashboot();
 # endif
-#endif
 
     backlight_init();
 #ifdef HAVE_UDA1380
@@ -596,3 +588,22 @@
 void screen_dump(void)
 {
 }
+
+int usb_screen(void)
+{
+   return 0;
+}
+
+unsigned short *bidi_l2v(const unsigned char *str, int orientation)
+{
+    static unsigned short utf16_buf[SCROLL_LINE_SIZE];
+    unsigned short *target;
+    (void)orientation;
+    
+    target = utf16_buf;
+    
+    while (*str)
+        str = utf8decode(str, target++);
+    *target = 0;
+    return utf16_buf;
+}