Index: apps/logfdisp.c
===================================================================
RCS file: /cvsroot/rockbox/apps/logfdisp.c,v
retrieving revision 1.10
diff -u -r1.10 logfdisp.c
--- apps/logfdisp.c	18 Jul 2006 16:03:36 -0000	1.10
+++ apps/logfdisp.c	12 Aug 2006 13:37:21 -0000
@@ -73,7 +73,7 @@
     if(!lines)
         return false;
 
-    lcd_setmargins(0, 0);
+    lcd_setmargins(0, LCD_WIDTH, 0);
     lcd_clear_display();
     
     do {
Index: apps/debug_menu.c
===================================================================
RCS file: /cvsroot/rockbox/apps/debug_menu.c,v
retrieving revision 1.192
diff -u -r1.192 debug_menu.c
--- apps/debug_menu.c	11 Aug 2006 17:39:34 -0000	1.192
+++ apps/debug_menu.c	12 Aug 2006 13:37:20 -0000
@@ -90,7 +90,7 @@
     int i;
     int usage;
 
-    lcd_setmargins(0, 0);
+    lcd_setmargins(0, LCD_WIDTH, 0);
     lcd_setfont(FONT_SYSFIXED);
     lcd_clear_display();
 
@@ -166,7 +166,7 @@
     int button;
     struct audio_debug d;
 
-    lcd_setmargins(0, 0);
+    lcd_setmargins(0, LCD_WIDTH, 0);
     lcd_setfont(FONT_SYSFIXED);
     
     while(1)
@@ -240,7 +240,7 @@
 
     tick_add_task(dbg_audio_task);
     
-    lcd_setmargins(0, 0);
+    lcd_setmargins(0, LCD_WIDTH, 0);
     lcd_setfont(FONT_SYSFIXED);
     
     while(!done)
@@ -448,7 +448,7 @@
 
     system_memory_guard(oldmode);  /* re-enable memory guard */
 
-    lcd_setmargins(0, 0);
+    lcd_setmargins(0, LCD_WIDTH, 0);
     lcd_setfont(FONT_SYSFIXED);
     lcd_clear_display();
 
@@ -514,7 +514,7 @@
     
     system_memory_guard(oldmode);  /* re-enable memory guard */
 
-    lcd_setmargins(0, 0);
+    lcd_setmargins(0, LCD_WIDTH, 0);
     lcd_setfont(FONT_SYSFIXED);
     lcd_clear_display();
 
@@ -538,7 +538,7 @@
     char buf[32];
     int button;
 
-    lcd_setmargins(0, 0);
+    lcd_setmargins(0, 0, 0);
     lcd_setfont(FONT_SYSFIXED);
     lcd_clear_display();
 
@@ -731,7 +731,7 @@
     bool valnogood, symbolerr, parityerr;
     bool done = false;
 
-    lcd_setmargins(0, 0);
+    lcd_setmargins(0, LCD_WIDTH, 0);
     lcd_clear_display();
     lcd_setfont(FONT_SYSFIXED);
 #ifdef HAVE_SPDIF_POWER
@@ -904,7 +904,7 @@
     int batt_int, batt_frac;
 
     lcd_setfont(FONT_SYSFIXED);
-    lcd_setmargins(0, 0);
+    lcd_setmargins(0, LCD_WIDTH, 0);
     lcd_clear_display();
 
     while(1)
@@ -967,7 +967,7 @@
     int battery_voltage;
     int batt_int, batt_frac;
 
-    lcd_setmargins(0, 0);
+    lcd_setmargins(0, LCD_WIDTH, 0);
     lcd_clear_display();
     lcd_setfont(FONT_SYSFIXED);
 
@@ -1052,7 +1052,7 @@
     int button;
     int line;
 
-    lcd_setmargins(0, 0);
+    lcd_setmargins(0, LCD_WIDTH, 0);
     lcd_clear_display();
     lcd_setfont(FONT_SYSFIXED);
 
@@ -1203,7 +1203,7 @@
     int button;
 
 #ifdef HAVE_LCD_BITMAP
-    lcd_setmargins(0, 0);
+    lcd_setmargins(0, LCD_WIDTH, 0);
     lcd_setfont(FONT_SYSFIXED);
 #endif
     lcd_clear_display();
@@ -1280,7 +1280,7 @@
     unsigned short maxv, minv;
     char buf[32];
     
-    lcd_setmargins(0, 0);
+    lcd_setmargins(0, LCD_WIDTH, 0);
     lcd_setfont(FONT_SYSFIXED);
 
     while(1)
@@ -1552,7 +1552,7 @@
     
     card_name[6] = '\0';
 
-    lcd_setmargins(0, 0);
+    lcd_setmargins(0, LCD_WIDTH, 0);
     lcd_setfont(FONT_SYSFIXED);
 
     while (!done)
@@ -1656,7 +1656,7 @@
     char pio3[2], pio4[2];
 
 #ifdef HAVE_LCD_BITMAP
-    lcd_setmargins(0, 0);
+    lcd_setmargins(0, LCD_WIDTH, 0);
 #endif
     
     while(!done)
@@ -1812,7 +1812,7 @@
     int line;
     char buf[32];
 
-    lcd_setmargins(0, 0);
+    lcd_setmargins(0, LCD_WIDTH, 0);
     lcd_setfont(FONT_SYSFIXED);
 
     while (!done)
@@ -1871,7 +1871,7 @@
     char buf[32];
     struct tagcache_stat *stat;
 
-    lcd_setmargins(0, 0);
+    lcd_setmargins(0, LCD_WIDTH, 0);
     lcd_setfont(FONT_SYSFIXED);
 
     while (!done)
@@ -1983,7 +1983,7 @@
     bool fm_detected;
 
 #ifdef HAVE_LCD_BITMAP
-    lcd_setmargins(0, 0);
+    lcd_setmargins(0, LCD_WIDTH, 0);
 #endif
 
     while(1)
Index: apps/screen_access.h
===================================================================
RCS file: /cvsroot/rockbox/apps/screen_access.h,v
retrieving revision 1.27
diff -u -r1.27 screen_access.h
--- apps/screen_access.h	1 Jul 2006 10:14:27 -0000	1.27
+++ apps/screen_access.h	12 Aug 2006 13:37:28 -0000
@@ -62,8 +62,9 @@
 #endif
 
 #if defined(HAVE_LCD_BITMAP) || defined(HAVE_REMOTE_LCD) /* always bitmap */
-    void (*setmargins)(int x, int y);
-    int (*getxmargin)(void);
+    void (*setmargins)(int x1, int x2, int y);
+    int (*getleftmargin)(void);
+    int (*getrightmargin)(void);    
     int (*getymargin)(void);
 
     void (*setfont)(int newfont);
@@ -152,10 +153,10 @@
 /*
  * Sets the x margin in pixels for the given screen
  * - screen : the screen structure
- * - xmargin : the number of pixels to the left of the screen
+ * - leftmargin : the number of pixels to the left of the screen
  */
 #define screen_set_xmargin(screen, xmargin) \
-    (screen)->setmargins(xmargin, (screen)->getymargin());
+    (screen)->setmargins(xmargin, (screen)->width, (screen)->getymargin());
 
 /*
  * Sets the y margin in pixels for the given screen
@@ -163,7 +164,7 @@
  * - xmargin : the number of pixels to the top of the screen
  */
 #define screen_set_ymargin(screen, ymargin) \
-    (screen)->setmargins((screen)->getxmargin(), ymargin);
+    (screen)->setmargins((screen)->getleftmargin(), (screen)->width, ymargin);
 
 #if defined(HAVE_LCD_BITMAP) || defined(HAVE_REMOTE_LCD)
 /*
Index: apps/sound_menu.c
===================================================================
RCS file: /cvsroot/rockbox/apps/sound_menu.c,v
retrieving revision 1.106
diff -u -r1.106 sound_menu.c
--- apps/sound_menu.c	31 Jul 2006 12:55:26 -0000	1.106
+++ apps/sound_menu.c	12 Aug 2006 13:37:32 -0000
@@ -663,7 +663,7 @@
     int exit_request = false;
     enum trigger_menu_option selected = TRIGGER_MODE;
     bool retval = false;
-    int old_x_margin, old_y_margin;
+    int old_left_margin, old_right_margin, old_y_margin;
 
 #define TRIGGER_MODE_COUNT 3
     static const unsigned char *trigger_modes[] = {
@@ -711,12 +711,13 @@
 
     lcd_clear_display();
 
-    old_x_margin = lcd_getxmargin();
+    old_left_margin = lcd_getleftmargin();
+    old_right_margin = lcd_getrightmargin();
     old_y_margin = lcd_getymargin();
     if(global_settings.statusbar)
-        lcd_setmargins(0, STATUSBAR_HEIGHT);
+        lcd_setmargins(0, LCD_WIDTH, STATUSBAR_HEIGHT);
     else
-        lcd_setmargins(0, 0);
+        lcd_setmargins(0, LCD_WIDTH, 0);
 
     lcd_getstringsize("M", &w, &h);
 
@@ -961,7 +962,7 @@
 
     peak_meter_trigger(false);
     lcd_setfont(FONT_UI);
-    lcd_setmargins(old_x_margin, old_y_margin);
+    lcd_setmargins(old_left_margin, old_right_margin, old_y_margin);
     return retval;
 }
 #endif
Index: apps/playlist.c
===================================================================
RCS file: /cvsroot/rockbox/apps/playlist.c,v
retrieving revision 1.166
diff -u -r1.166 playlist.c
--- apps/playlist.c	12 Aug 2006 11:00:37 -0000	1.166
+++ apps/playlist.c	12 Aug 2006 13:37:27 -0000
@@ -472,9 +472,9 @@
     
 #ifdef HAVE_LCD_BITMAP
     if(global_settings.statusbar)
-        lcd_setmargins(0, STATUSBAR_HEIGHT);
+        lcd_setmargins(0, LCD_WIDTH, STATUSBAR_HEIGHT);
     else
-        lcd_setmargins(0, 0);
+        lcd_setmargins(0, LCD_WIDTH, 0);
 #endif
 
     gui_syncsplash(0, true, str(LANG_PLAYLIST_LOAD));
@@ -1548,9 +1548,9 @@
 
 #ifdef HAVE_LCD_BITMAP
     if(global_settings.statusbar)
-        lcd_setmargins(0, STATUSBAR_HEIGHT);
+        lcd_setmargins(0, LCD_WIDTH, STATUSBAR_HEIGHT);
     else
-        lcd_setmargins(0, 0);
+        lcd_setmargins(0, LCD_WIDTH, 0);
 #endif
 
     gui_syncsplash(0, true, fmt, count,
Index: apps/screens.c
===================================================================
RCS file: /cvsroot/rockbox/apps/screens.c,v
retrieving revision 1.160
diff -u -r1.160 screens.c
--- apps/screens.c	7 Aug 2006 21:24:19 -0000	1.160
+++ apps/screens.c	12 Aug 2006 13:37:31 -0000
@@ -528,7 +528,7 @@
     struct option_select left_option;
     struct option_select bottom_option;
     struct option_select right_option;
-    int oldrepeat, old_x_margin, old_y_margin;
+    int oldrepeat, old_left_margin, old_right_margin, old_y_margin;
 
     static const struct opt_items left_items[] = {
         [0]={ STR(LANG_SYSFONT_OFF) },
@@ -552,9 +552,10 @@
     };
     struct gui_quickscreen qs;
 
-    old_x_margin = lcd_getxmargin();
+    old_left_margin = lcd_getleftmargin();
+    old_right_margin = lcd_getrightmargin();
     old_y_margin = lcd_getymargin();
-    lcd_setmargins(0, 0);
+    lcd_setmargins(0, LCD_WIDTH, 0);
 
     option_select_init_items(&left_option,
                              (char *)str(LANG_SYSFONT_SHUFFLE),
@@ -595,7 +596,7 @@
         }
         settings_save();
     }
-    lcd_setmargins(old_x_margin, old_y_margin);
+    lcd_setmargins(old_left_margin, old_right_margin, old_y_margin);
     return(res);
 }
 
@@ -618,7 +619,7 @@
     struct option_select left_option;
     struct option_select bottom_option;
     struct option_select right_option;
-    int old_x_margin, old_y_margin;
+    int old_left_margin, old_right_margin, old_y_margin;
 
     static const struct opt_items onoff_items[] = {
         [0]={ STR(LANG_SYSFONT_OFF) },
@@ -631,9 +632,10 @@
 
     struct gui_quickscreen qs;
 
-    old_x_margin = lcd_getxmargin();
+    old_left_margin = lcd_getrightmargin();
+    old_right_margin = lcd_getleftmargin();
     old_y_margin = lcd_getymargin();
-    lcd_setmargins(0, 0);
+    lcd_setmargins(0, LCD_WIDTH, 0);
 
     option_select_init_items(&left_option,
                              str(LANG_SYSFONT_SCROLL_BAR),
@@ -655,7 +657,7 @@
     res=gui_syncquickscreen_run(&qs, button_enter);
     if(!res)
         settings_save();
-    lcd_setmargins(old_x_margin, old_y_margin);
+    lcd_setmargins(old_left_margin, old_right_margin, old_y_margin);
     return(res);
 }
 #endif /* BUTTON_F3 */
@@ -762,9 +764,9 @@
 
 #ifdef HAVE_LCD_BITMAP
     if(global_settings.statusbar)
-        lcd_setmargins(0, STATUSBAR_HEIGHT);
+        lcd_setmargins(0, LCD_WIDTH, STATUSBAR_HEIGHT);
     else
-        lcd_setmargins(0, 0);
+        lcd_setmargins(0, LCD_WIDTH, 0);
 #endif
     lcd_clear_display();
     lcd_puts_scroll(0, 0, string);
Index: apps/plugin.c
===================================================================
RCS file: /cvsroot/rockbox/apps/plugin.c,v
retrieving revision 1.180
diff -u -r1.180 plugin.c
--- apps/plugin.c	11 Aug 2006 14:10:34 -0000	1.180
+++ apps/plugin.c	12 Aug 2006 13:37:28 -0000
@@ -556,9 +556,9 @@
     plugin_loaded = true;
 
 #ifdef HAVE_LCD_BITMAP
-    xm = lcd_getxmargin();
+    xm = lcd_getleftmargin();
     ym = lcd_getymargin();
-    lcd_setmargins(0,0);
+    lcd_setmargins(0, LCD_WIDTH, 0);
 #ifdef HAVE_LCD_COLOR
     old_backdrop = lcd_get_backdrop();
     lcd_set_backdrop(NULL);
@@ -570,9 +570,9 @@
 #endif
 
 #ifdef HAVE_REMOTE_LCD
-    rxm = lcd_remote_getxmargin();
+    rxm = lcd_remote_getleftmargin();
     rym = lcd_remote_getymargin();
-    lcd_remote_setmargins(0, 0);
+    lcd_remote_setmargins(0, LCD_REMOTE_WIDTH, 0);
     lcd_remote_clear_display();
     lcd_remote_update();
 #endif
@@ -596,7 +596,7 @@
     lcd_set_drawmode(DRMODE_SOLID);
 #endif /* LCD_DEPTH */
     /* restore margins */
-    lcd_setmargins(xm,ym);
+    lcd_setmargins(xm, LCD_WIDTH, ym);
 #ifdef HAVE_LCD_COLOR
     lcd_set_backdrop(old_backdrop);
 #endif
@@ -606,7 +606,7 @@
 
 #ifdef HAVE_REMOTE_LCD
     lcd_remote_set_drawmode(DRMODE_SOLID);
-    lcd_remote_setmargins(rxm, rym);
+    lcd_remote_setmargins(rxm, LCD_REMOTE_WIDTH, rym);
     lcd_remote_clear_display();
     lcd_remote_update();
 #endif
Index: apps/onplay.c
===================================================================
RCS file: /cvsroot/rockbox/apps/onplay.c,v
retrieving revision 1.85
diff -u -r1.85 onplay.c
--- apps/onplay.c	12 Aug 2006 11:00:37 -0000	1.85
+++ apps/onplay.c	12 Aug 2006 13:37:25 -0000
@@ -996,9 +996,9 @@
 
 #ifdef HAVE_LCD_BITMAP
         if (global_settings.statusbar)
-            lcd_setmargins(0, STATUSBAR_HEIGHT);
+            lcd_setmargins(0, LCD_WIDTH, STATUSBAR_HEIGHT);
         else
-            lcd_setmargins(0, 0);
+            lcd_setmargins(0, LCD_WIDTH, 0);
 #endif
     }
 
Index: apps/bookmark.c
===================================================================
RCS file: /cvsroot/rockbox/apps/bookmark.c,v
retrieving revision 1.50
diff -u -r1.50 bookmark.c
--- apps/bookmark.c	18 Jul 2006 19:11:56 -0000	1.50
+++ apps/bookmark.c	12 Aug 2006 13:37:18 -0000
@@ -443,7 +443,7 @@
         FOR_NB_SCREENS(i)
         {
 #ifdef HAVE_LCD_BITMAP
-            screens[i].setmargins(0, STATUSBAR_HEIGHT);
+            screens[i].setmargins(0, LCD_WIDTH, STATUSBAR_HEIGHT);
             screens[i].puts_scroll(0,0, str(LANG_BOOKMARK_AUTOLOAD_QUERY));
             screens[i].puts(0,1, str(LANG_CONFIRM_WITH_PLAY_RECORDER));
             screens[i].puts(0,2, str(LANG_BOOKMARK_SELECT_LIST_BOOKMARKS));
@@ -577,10 +577,10 @@
 
 #ifdef HAVE_LCD_BITMAP
     int i;
-    int x = lcd_getxmargin();
+    int x = lcd_getleftmargin();
     int y = lcd_getymargin();
     FOR_NB_SCREENS(i)
-        screens[i].setmargins(0, 0);
+        screens[i].setmargins(0, LCD_WIDTH, 0);
 #endif
 
     bookmark_count = get_bookmark_count(bookmark_file_name);
@@ -637,12 +637,12 @@
                 if (global_settings.statusbar)
                 {
                     FOR_NB_SCREENS(i)
-                        screens[i].setmargins(0, STATUSBAR_HEIGHT);
+                        screens[i].setmargins(0, LCD_WIDTH, STATUSBAR_HEIGHT);
                 }
                 else
                 {
                    FOR_NB_SCREENS(i)
-                        screens[i].setmargins(0, 0);
+                        screens[i].setmargins(0, LCD_WIDTH, 0);
                 }
 #endif
                 return bookmark;
@@ -694,7 +694,7 @@
 #endif
 #ifdef HAVE_LCD_BITMAP
                 FOR_NB_SCREENS(i)
-                    screens[i].setmargins(x, y);
+                    screens[i].setmargins(x, LCD_WIDTH, y);
 #endif
                 return NULL;
 
Index: apps/pcm_recording.c
===================================================================
RCS file: /cvsroot/rockbox/apps/pcm_recording.c,v
retrieving revision 1.6
diff -u -r1.6 pcm_recording.c
--- apps/pcm_recording.c	14 Sep 2005 10:55:45 -0000	1.6
+++ apps/pcm_recording.c	12 Aug 2006 13:37:25 -0000
@@ -71,7 +71,7 @@
 
     lcd_setfont(FONT_SYSFIXED);
     lcd_getstringsize("M", &w, &h);
-    lcd_setmargins(0, 8);
+    lcd_setmargins(0, LCD_WIDTH, 8);
 
     play_vol = 120;
 
Index: apps/screen_access.c
===================================================================
RCS file: /cvsroot/rockbox/apps/screen_access.c,v
retrieving revision 1.26
diff -u -r1.26 screen_access.c
--- apps/screen_access.c	1 Jul 2006 10:14:26 -0000	1.26
+++ apps/screen_access.c	12 Aug 2006 13:37:28 -0000
@@ -46,7 +46,8 @@
             screen->height=LCD_REMOTE_HEIGHT;
             screen->setmargins=&lcd_remote_setmargins;
             screen->getymargin=&lcd_remote_getymargin;
-            screen->getxmargin=&lcd_remote_getxmargin;
+            screen->getleftmargin=&lcd_remote_getleftmargin;
+            screen->getrightmargin=&lcd_remote_getrightmargin;            
             screen->setfont=&lcd_remote_setfont;
             screen->setfont(FONT_UI);
             screen->getstringsize=&lcd_remote_getstringsize;
@@ -118,7 +119,8 @@
             screen->height=LCD_HEIGHT;
             screen->setmargins=&lcd_setmargins;
             screen->getymargin=&lcd_getymargin;
-            screen->getxmargin=&lcd_getxmargin;
+            screen->getleftmargin=&lcd_getleftmargin;
+            screen->getrightmargin=&lcd_getrightmargin;            
             screen->setfont=&lcd_setfont;
             screen->setfont(FONT_UI);
             screen->getstringsize=&lcd_getstringsize;
Index: firmware/export/lcd-remote.h
===================================================================
RCS file: /cvsroot/rockbox/firmware/export/lcd-remote.h,v
retrieving revision 1.20
diff -u -r1.20 lcd-remote.h
--- firmware/export/lcd-remote.h	28 Jul 2006 13:35:36 -0000	1.20
+++ firmware/export/lcd-remote.h	12 Aug 2006 13:37:45 -0000
@@ -117,8 +117,9 @@
 
 extern void lcd_remote_set_drawmode(int mode);
 extern int  lcd_remote_get_drawmode(void);
-extern void lcd_remote_setmargins(int xmargin, int ymargin);
-extern int  lcd_remote_getxmargin(void);
+extern void lcd_remote_setmargins(int leftmargin, int rightmargin, int ymargin);
+extern int  lcd_remote_getleftmargin(void);
+extern int  lcd_remote_getrightmargin(void);
 extern int  lcd_remote_getymargin(void);
 extern void lcd_remote_setfont(int font);
 extern int  lcd_remote_getstringsize(const unsigned char *str, int *w, int *h);
Index: firmware/export/lcd.h
===================================================================
RCS file: /cvsroot/rockbox/firmware/export/lcd.h,v
retrieving revision 1.68
diff -u -r1.68 lcd.h
--- firmware/export/lcd.h	12 Aug 2006 09:27:26 -0000	1.68
+++ firmware/export/lcd.h	12 Aug 2006 13:37:45 -0000
@@ -265,8 +265,9 @@
 
 extern void lcd_set_drawmode(int mode);
 extern int  lcd_get_drawmode(void);
-extern void lcd_setmargins(int xmargin, int ymargin);
-extern int  lcd_getxmargin(void);
+extern void lcd_setmargins(int leftmargin, int rightmargin, int ymargin);
+extern int  lcd_getleftmargin(void);
+extern int  lcd_getrightmargin(void);
 extern int  lcd_getymargin(void);
 extern void lcd_setfont(int font);
 extern int  lcd_getstringsize(const unsigned char *str, int *w, int *h);
@@ -345,6 +346,8 @@
     bool bidir;
     bool invert; /* invert the scrolled text */
     long start_tick;
+    int left_margin;
+    int right_margin;
 };
 #else /* !HAVE_LCD_BITMAP */
 
Index: firmware/drivers/lcd-remote-2bit-vi.c
===================================================================
RCS file: /cvsroot/rockbox/firmware/drivers/lcd-remote-2bit-vi.c,v
retrieving revision 1.2
diff -u -r1.2 lcd-remote-2bit-vi.c
--- firmware/drivers/lcd-remote-2bit-vi.c	28 Jul 2006 12:41:13 -0000	1.2
+++ firmware/drivers/lcd-remote-2bit-vi.c	12 Aug 2006 13:37:44 -0000
@@ -47,7 +47,8 @@
 static unsigned fg_pattern IDATA_ATTR = 0xFFFF; /* initially black */
 static unsigned bg_pattern IDATA_ATTR = 0x0000; /* initially white */
 static int drawmode = DRMODE_SOLID;
-static int xmargin = 0;
+static int leftmargin = 0;
+static int rightmargin = LCD_REMOTE_WIDTH;
 static int ymargin = 0;
 static int curfont = FONT_SYSFIXED;
 
@@ -115,17 +116,23 @@
     lcd_remote_set_background(bg_brightness);
 }
 
-void lcd_remote_setmargins(int x, int y)
+void lcd_remote_setmargins(int x1, int x2, int y)
 {
-    xmargin = x;
+    leftmargin = x1;
+    rightmargin = x2;    
     ymargin = y;
 }
 
-int lcd_remote_getxmargin(void)
+int lcd_remote_getleftmargin(void)
 {
-    return xmargin;
+    return leftmargin;
 }
 
+int lcd_remote_getrightmargin(void)
+{
+    return rightmargin;
+}
+ 
 int lcd_remote_getymargin(void)
 {
     return ymargin;
@@ -892,7 +899,7 @@
         return;
 
     lcd_remote_getstringsize(str, &w, &h);
-    xpos = xmargin + x*w / utf8length((char *)str);
+    xpos = leftmargin + x*w / utf8length((char *)str);
     ypos = ymargin + y*h;
     drawmode = (style & STYLE_INVERT) ?
                (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID;
@@ -976,7 +983,7 @@
 
     lcd_remote_getstringsize(string, &w, &h);
 
-    if (LCD_REMOTE_WIDTH - x * 8 - xmargin < w) {
+    if (LCD_REMOTE_WIDTH - x * 8 - leftmargin < w) {
         /* prepare scroll line */
         char *end;
 
@@ -989,7 +996,7 @@
         /* scroll bidirectional or forward only depending on the string
            width */
         if ( bidir_limit ) {
-            s->bidir = s->width < (LCD_REMOTE_WIDTH - xmargin) *
+            s->bidir = s->width < (LCD_REMOTE_WIDTH - leftmargin) *
                 (100 + bidir_limit) / 100;
         }
         else
@@ -1120,7 +1127,7 @@
                 s->offset += scroll_step;
 
             pf = font_get(curfont);
-            xpos = xmargin + s->startx * s->width / s->len;
+            xpos = leftmargin + s->startx * s->width / s->len;
             ypos = ymargin + index * pf->height;
 
             if (s->bidir) { /* scroll bidirectional */
Index: firmware/drivers/lcd-recorder.c
===================================================================
RCS file: /cvsroot/rockbox/firmware/drivers/lcd-recorder.c,v
retrieving revision 1.84
diff -u -r1.84 lcd-recorder.c
--- firmware/drivers/lcd-recorder.c	25 Jul 2006 11:15:50 -0000	1.84
+++ firmware/drivers/lcd-recorder.c	12 Aug 2006 13:37:43 -0000
@@ -80,7 +80,8 @@
 unsigned char lcd_framebuffer[LCD_HEIGHT/8][LCD_WIDTH];
 
 static int drawmode = DRMODE_SOLID;
-static int xmargin = 0;
+static int leftmargin = 0;
+static int rightmargin = 0;
 static int ymargin = 0;
 static int curfont = FONT_SYSFIXED;
 #ifndef SIMULATOR
@@ -360,15 +361,21 @@
     return drawmode;
 }
 
-void lcd_setmargins(int x, int y)
+void lcd_setmargins(int x1, int x2, int y)
 {
-    xmargin = x;
+    leftmargin = x1;
+    rightmargin = x2;    
     ymargin = y;
 }
 
-int lcd_getxmargin(void)
+int lcd_getleftmargin(void)
 {
-    return xmargin;
+    return leftmargin;
+}
+
+int lcd_getrightmargin(void)
+{
+    return rightmargin;
 }
 
 int lcd_getymargin(void)
@@ -947,14 +954,17 @@
         return;
 
     lcd_getstringsize(str, &w, &h);
-    xpos = xmargin + x*w / utf8length(str);
+    xpos = leftmargin + x*w / utf8length(str);
     ypos = ymargin + y*h;
     drawmode = (style & STYLE_INVERT) ?
                (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID;
     lcd_putsxyofs(xpos, ypos, offset, str);
     drawmode ^= DRMODE_INVERSEVID;
     xrect = xpos + MAX(w - offset, 0);
-    lcd_fillrect(xrect, ypos, LCD_WIDTH - xrect, h);
+    lcd_fillrect(xpos + w, ypos, rightmargin - (xpos + w), h);
+    if (LCD_WIDTH>rightmargin) {
+	lcd_fillrect(rightmargin, ypos, LCD_WIDTH - rightmargin, h);
+    }
     drawmode = lastmode;
 }
 
@@ -1032,7 +1042,7 @@
 
     lcd_getstringsize(string, &w, &h);
 
-    if (LCD_WIDTH - x * 8 - xmargin < w) {
+    if (rightmargin - x * 8 - leftmargin < w) {
         /* prepare scroll line */
         char *end;
 
@@ -1045,7 +1055,7 @@
         /* scroll bidirectional or forward only depending on the string
            width */
         if ( bidir_limit ) {
-            s->bidir = s->width < (LCD_WIDTH - xmargin) *
+            s->bidir = s->width < (rightmargin - leftmargin) *
                 (100 + bidir_limit) / 100;
         }
         else
@@ -1058,12 +1068,14 @@
         }
 
         end = strchr(s->line, '\0');
-        strncpy(end, string, LCD_WIDTH/2);
+        strncpy(end, string, rightmargin/2);
 
         s->len = utf8length(string);
         s->offset = offset;
         s->startx = x;
         s->backward = false;
+        s->left_margin=leftmargin;
+        s->right_margin=rightmargin;
         scrolling_lines |= (1<<y);
     }
     else
@@ -1100,7 +1112,7 @@
                 s->offset += scroll_step;
 
             pf = font_get(curfont);
-            xpos = xmargin + s->startx * s->width / s->len;
+            xpos = s->left_margin + s->startx * s->width / s->len;
             ypos = ymargin + index * pf->height;
 
             if (s->bidir) { /* scroll bidirectional */
@@ -1110,9 +1122,9 @@
                     s->backward = false;
                     s->start_tick = current_tick + scroll_delay * 2;
                 }
-                if (s->offset >= s->width - (LCD_WIDTH - xpos)) {
+                if (s->offset >= s->width - (s->right_margin - xpos)) {
                     /* at end of line */
-                    s->offset = s->width - (LCD_WIDTH - xpos);
+                    s->offset = s->width - (s->right_margin - xpos);
                     s->backward = true;
                     s->start_tick = current_tick + scroll_delay * 2;
                 }
@@ -1127,8 +1139,12 @@
             drawmode = s->invert ?
                        (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID;
             lcd_putsxyofs(xpos, ypos, s->offset, s->line);
+            if (LCD_WIDTH>s->right_margin) {
+            drawmode ^= DRMODE_INVERSEVID;
+                lcd_fillrect(s->right_margin, ypos, LCD_WIDTH - s->right_margin, pf->height);
+            }
             drawmode = lastmode;
-            lcd_update_rect(xpos, ypos, LCD_WIDTH - xpos, pf->height);
+            lcd_update_rect(xpos, ypos, s->right_margin - xpos, pf->height);
         }
 
         sleep(scroll_ticks);
Index: firmware/drivers/lcd-h100-remote.c
===================================================================
RCS file: /cvsroot/rockbox/firmware/drivers/lcd-h100-remote.c,v
retrieving revision 1.58
diff -u -r1.58 lcd-h100-remote.c
--- firmware/drivers/lcd-h100-remote.c	28 Jul 2006 13:35:36 -0000	1.58
+++ firmware/drivers/lcd-h100-remote.c	12 Aug 2006 13:37:41 -0000
@@ -69,7 +69,8 @@
                                       IBSS_ATTR;
 
 static int drawmode = DRMODE_SOLID;
-static int xmargin = 0;
+static int leftmargin = 0;
+static int rightmargin = LCD_REMOTE_WIDTH;
 static int ymargin = 0;
 static int curfont = FONT_SYSFIXED;
 
@@ -636,15 +637,21 @@
     return drawmode;
 }
 
-void lcd_remote_setmargins(int x, int y)
+void lcd_remote_setmargins(int x1, int x2, int y)
 {
-    xmargin = x;
+    leftmargin = x1;
+    rightmargin = x2;    
     ymargin = y;
 }
 
-int lcd_remote_getxmargin(void)
+int lcd_remote_getleftmargin(void)
 {
-    return xmargin;
+    return leftmargin;
+}
+
+int lcd_remote_getrightmargin(void)
+{
+    return rightmargin;
 }
 
 int lcd_remote_getymargin(void)
@@ -1228,7 +1235,7 @@
         return;
 
     lcd_remote_getstringsize(str, &w, &h);
-    xpos = xmargin + x*w / utf8length((char *)str);
+    xpos = leftmargin + x*w / utf8length((char *)str);
     ypos = ymargin + y*h;
     drawmode = (style & STYLE_INVERT) ?
                (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID;
@@ -1312,7 +1319,7 @@
 
     lcd_remote_getstringsize(string, &w, &h);
 
-    if (LCD_REMOTE_WIDTH - x * 8 - xmargin < w) {
+    if (LCD_REMOTE_WIDTH - x * 8 - leftmargin < w) {
         /* prepare scroll line */
         char *end;
 
@@ -1325,7 +1332,7 @@
         /* scroll bidirectional or forward only depending on the string
            width */
         if ( bidir_limit ) {
-            s->bidir = s->width < (LCD_REMOTE_WIDTH - xmargin) *
+            s->bidir = s->width < (LCD_REMOTE_WIDTH - leftmargin) *
                 (100 + bidir_limit) / 100;
         }
         else
@@ -1412,7 +1419,7 @@
                 s->offset += scroll_step;
 
             pf = font_get(curfont);
-            xpos = xmargin + s->startx * s->width / s->len;
+            xpos = leftmargin + s->startx * s->width / s->len;
             ypos = ymargin + index * pf->height;
 
             if (s->bidir) { /* scroll bidirectional */
Index: firmware/drivers/lcd-16bit.c
===================================================================
RCS file: /cvsroot/rockbox/firmware/drivers/lcd-16bit.c,v
retrieving revision 1.35
diff -u -r1.35 lcd-16bit.c
--- firmware/drivers/lcd-16bit.c	28 Jul 2006 07:16:59 -0000	1.35
+++ firmware/drivers/lcd-16bit.c	12 Aug 2006 13:37:39 -0000
@@ -51,7 +51,8 @@
 static unsigned fg_pattern IDATA_ATTR = LCD_DEFAULT_FG;
 static unsigned bg_pattern IDATA_ATTR = LCD_DEFAULT_BG;
 static int drawmode = DRMODE_SOLID;
-static int xmargin = 0;
+static int leftmargin = 0;
+static int rightmargin = LCD_WIDTH;
 static int ymargin = 0;
 static int curfont = FONT_SYSFIXED;
 
@@ -121,15 +122,21 @@
     bg_pattern = bg_color;
 }
 
-void lcd_setmargins(int x, int y)
+void lcd_setmargins(int x1, int x2, int y)
 {
-    xmargin = x;
+    leftmargin = x1;
+    rightmargin = x2;
     ymargin = y;
 }
 
-int lcd_getxmargin(void)
+int lcd_getleftmargin(void)
 {
-    return xmargin;
+    return leftmargin;
+}
+
+int lcd_getrightmargin(void)
+{
+    return rightmargin;
 }
 
 int lcd_getymargin(void)
@@ -786,14 +793,17 @@
         return;
 
     lcd_getstringsize(str, &w, &h);
-    xpos = xmargin + x*w / utf8length(str);
+    xpos = leftmargin + x*w / utf8length(str);
     ypos = ymargin + y*h;
     drawmode = (style & STYLE_INVERT) ?
                (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID;
     lcd_putsxyofs(xpos, ypos, offset, str);
     drawmode ^= DRMODE_INVERSEVID;
     xrect = xpos + MAX(w - offset, 0);
-    lcd_fillrect(xrect, ypos, LCD_WIDTH - xrect, h);
+    lcd_fillrect(xpos + w, ypos, rightmargin - (xpos + w), h);
+    if (LCD_WIDTH>rightmargin) {
+	lcd_fillrect(rightmargin, ypos, LCD_WIDTH - rightmargin, h);
+    }
     drawmode = lastmode;
 }
 
@@ -870,7 +880,7 @@
 
     lcd_getstringsize(string, &w, &h);
 
-    if (LCD_WIDTH - x * 8 - xmargin < w) {
+    if (rightmargin - x * 8 - leftmargin < w) {
         /* prepare scroll line */
         char *end;
 
@@ -883,7 +893,7 @@
         /* scroll bidirectional or forward only depending on the string
            width */
         if ( bidir_limit ) {
-            s->bidir = s->width < (LCD_WIDTH - xmargin) *
+            s->bidir = s->width < (rightmargin - leftmargin) *
                 (100 + bidir_limit) / 100;
         }
         else
@@ -896,12 +906,14 @@
         }
 
         end = strchr(s->line, '\0');
-        strncpy(end, string, LCD_WIDTH/2);
+        strncpy(end, string, rightmargin/2);
 
         s->len = utf8length(string);
         s->offset = offset;
         s->startx = x;
         s->backward = false;
+        s->left_margin=leftmargin;
+        s->right_margin=rightmargin;
         scrolling_lines |= (1<<y);
     }
     else
@@ -938,7 +950,7 @@
                 s->offset += scroll_step;
 
             pf = font_get(curfont);
-            xpos = xmargin + s->startx * s->width / s->len;
+            xpos = s->left_margin + s->startx * s->width / s->len;
             ypos = ymargin + index * pf->height;
 
             if (s->bidir) { /* scroll bidirectional */
@@ -948,9 +960,9 @@
                     s->backward = false;
                     s->start_tick = current_tick + scroll_delay * 2;
                 }
-                if (s->offset >= s->width - (LCD_WIDTH - xpos)) {
+                if (s->offset >= s->width - (s->right_margin - xpos)) {
                     /* at end of line */
-                    s->offset = s->width - (LCD_WIDTH - xpos);
+                    s->offset = s->width - (s->right_margin - xpos);
                     s->backward = true;
                     s->start_tick = current_tick + scroll_delay * 2;
                 }
@@ -965,8 +977,12 @@
             drawmode = s->invert ? 
                        (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID;
             lcd_putsxyofs(xpos, ypos, s->offset, s->line);
+            if (LCD_WIDTH>s->right_margin) {
+            drawmode ^= DRMODE_INVERSEVID;
+                lcd_fillrect(s->right_margin, ypos, LCD_WIDTH - s->right_margin, pf->height);
+            }
             drawmode = lastmode;
-            lcd_update_rect(xpos, ypos, LCD_WIDTH - xpos, pf->height);
+            lcd_update_rect(xpos, ypos, s->right_margin - xpos, pf->height);
         }
 
         sleep(scroll_ticks);
Index: firmware/drivers/lcd-h100.c
===================================================================
RCS file: /cvsroot/rockbox/firmware/drivers/lcd-h100.c,v
retrieving revision 1.52
diff -u -r1.52 lcd-h100.c
--- firmware/drivers/lcd-h100.c	10 Aug 2006 16:32:14 -0000	1.52
+++ firmware/drivers/lcd-h100.c	12 Aug 2006 13:37:42 -0000
@@ -77,7 +77,8 @@
 static unsigned fg_pattern IDATA_ATTR = 0xFF; /* initially black */
 static unsigned bg_pattern IDATA_ATTR = 0x00; /* initially white */
 static int drawmode = DRMODE_SOLID;
-static int xmargin = 0;
+static int leftmargin = 0;
+static int rightmargin = 0;
 static int ymargin = 0;
 static int curfont = FONT_SYSFIXED;
 
@@ -327,17 +328,25 @@
     lcd_set_background(bg_brightness);
 }
 
-void lcd_setmargins(int x, int y)
+void lcd_setmargins(int x1, int x2, int y)
 {
-    xmargin = x;
+    leftmargin = x1;
+    rightmargin = x2;
     ymargin = y;
+    
+}
+
+int lcd_getleftmargin(void)
+{
+    return leftmargin;
 }
 
-int lcd_getxmargin(void)
+int lcd_getrightmargin(void)
 {
-    return xmargin;
+    return rightmargin;
 }
 
+
 int lcd_getymargin(void)
 {
     return ymargin;
@@ -1110,14 +1119,17 @@
         return;
 
     lcd_getstringsize(str, &w, &h);
-    xpos = xmargin + x*w / utf8length((char *)str);
+    xpos = leftmargin + x*w / utf8length((char *)str);
     ypos = ymargin + y*h;
     drawmode = (style & STYLE_INVERT) ?
                (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID;
     lcd_putsxyofs(xpos, ypos, offset, str);
     drawmode ^= DRMODE_INVERSEVID;
     xrect = xpos + MAX(w - offset, 0);
-    lcd_fillrect(xrect, ypos, LCD_WIDTH - xrect, h);
+    lcd_fillrect(xpos + w, ypos, rightmargin - (xpos + w), h);
+    if (LCD_WIDTH>rightmargin) {
+	lcd_fillrect(rightmargin, ypos, LCD_WIDTH - rightmargin, h);
+    }
     drawmode = lastmode;
 }
 
@@ -1194,7 +1206,7 @@
 
     lcd_getstringsize(string, &w, &h);
 
-    if (LCD_WIDTH - x * 8 - xmargin < w) {
+    if (rightmargin - x * 8 - leftmargin < w) {
         /* prepare scroll line */
         char *end;
 
@@ -1207,7 +1219,7 @@
         /* scroll bidirectional or forward only depending on the string
            width */
         if ( bidir_limit ) {
-            s->bidir = s->width < (LCD_WIDTH - xmargin) *
+            s->bidir = s->width < (rightmargin - leftmargin) *
                 (100 + bidir_limit) / 100;
         }
         else
@@ -1220,12 +1232,14 @@
         }
 
         end = strchr(s->line, '\0');
-        strncpy(end, (char *)string, LCD_WIDTH/2);
+        strncpy(end, (char *)string, rightmargin/2);
 
         s->len = utf8length((char *)string);
         s->offset = offset;
         s->startx = x;
         s->backward = false;
+        s->left_margin=leftmargin;
+        s->right_margin=rightmargin;
         scrolling_lines |= (1<<y);
     }
     else
@@ -1262,7 +1276,7 @@
                 s->offset += scroll_step;
 
             pf = font_get(curfont);
-            xpos = xmargin + s->startx * s->width / s->len;
+            xpos = s->left_margin + s->startx * s->width / s->len;
             ypos = ymargin + index * pf->height;
 
             if (s->bidir) { /* scroll bidirectional */
@@ -1272,9 +1286,9 @@
                     s->backward = false;
                     s->start_tick = current_tick + scroll_delay * 2;
                 }
-                if (s->offset >= s->width - (LCD_WIDTH - xpos)) {
+                if (s->offset >= s->width - (s->right_margin - xpos)) {
                     /* at end of line */
-                    s->offset = s->width - (LCD_WIDTH - xpos);
+                    s->offset = s->width - (s->right_margin - xpos);
                     s->backward = true;
                     s->start_tick = current_tick + scroll_delay * 2;
                 }
@@ -1289,8 +1303,12 @@
             drawmode = s->invert ?
                        (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID;
             lcd_putsxyofs(xpos, ypos, s->offset, s->line);
+            if (LCD_WIDTH>s->right_margin) {
+            drawmode ^= DRMODE_INVERSEVID;
+                lcd_fillrect(s->right_margin, ypos, LCD_WIDTH - s->right_margin, pf->height);
+            }
             drawmode = lastmode;
-            lcd_update_rect(xpos, ypos, LCD_WIDTH - xpos, pf->height);
+            lcd_update_rect(xpos, ypos, s->right_margin - xpos, pf->height);
         }
 
         sleep(scroll_ticks);
Index: firmware/drivers/lcd-2bit-horz.c
===================================================================
RCS file: /cvsroot/rockbox/firmware/drivers/lcd-2bit-horz.c,v
retrieving revision 1.18
diff -u -r1.18 lcd-2bit-horz.c
--- firmware/drivers/lcd-2bit-horz.c	28 Jul 2006 07:16:59 -0000	1.18
+++ firmware/drivers/lcd-2bit-horz.c	12 Aug 2006 13:37:39 -0000
@@ -118,15 +118,21 @@
     lcd_set_background(bg_brightness);
 }
 
-void lcd_setmargins(int x, int y)
+void lcd_setmargins(int x1, int x2, int y)
 {
-    xmargin = x;
+    leftmargin = x1;
+    rightmargin = x2;
     ymargin = y;
 }
 
-int lcd_getxmargin(void)
+int lcd_getleftmargin(void)
 {
-    return xmargin;
+    return leftmargin;
+}
+
+int lcd_getrightmargin(void)
+{
+    return rightmargin;
 }
 
 int lcd_getymargin(void)
Index: apps/gui/list.c
===================================================================
RCS file: /cvsroot/rockbox/apps/gui/list.c,v
retrieving revision 1.23
diff -u -r1.23 list.c
--- apps/gui/list.c	2 Jul 2006 16:18:59 -0000	1.23
+++ apps/gui/list.c	12 Aug 2006 13:37:37 -0000
@@ -88,7 +88,7 @@
     int line_ypos=display->getymargin()+display->char_height*selected_line;
     if (global_settings.invert_cursor)
     {
-        int line_xpos=display->getxmargin();
+        int line_xpos=display->getleftmargin();
         display->set_drawmode(DRMODE_COMPLEMENT);
         display->fillrect(line_xpos, line_ypos, display->width,
                           display->char_height);
Index: apps/gui/gwps-common.c
===================================================================
RCS file: /cvsroot/rockbox/apps/gui/gwps-common.c,v
retrieving revision 1.59
diff -u -r1.59 gwps-common.c
--- apps/gui/gwps-common.c	5 Aug 2006 12:47:42 -0000	1.59
+++ apps/gui/gwps-common.c	12 Aug 2006 13:37:34 -0000
@@ -21,6 +21,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
+#include <ctype.h>
 #include "system.h"
 #include "settings.h"
 #include "rtc.h"
@@ -1294,6 +1295,35 @@
             case 0:
                 *buf++ = '%';
                 break;
+
+            case 'm': /* margins */
+            {
+                int x1=0;
+                int x2=gwps->display->width;
+
+                fmt++;
+                if (*fmt=='|') {
+                    char *p=strchr(fmt, '|');
+                    if (p) {
+                        fmt = ++p;
+                        if (isdigit(*p)) {
+                            x1=atoi(p);
+                            p=strchr(p, '|');
+                            if (p) {
+                                fmt = ++p;
+                                if (isdigit(*p)) {
+                                    x2=atoi(p);
+                                    p=strchr(p, '|');
+                                    if (p)
+                                        fmt = ++p;
+                                }
+                            }
+                        }
+                    }
+                }
+                gwps->display->setmargins( x1, x2, gwps->display->getymargin() );
+            } break;
+
             case 'a':
                 ++fmt;
                 /* remember where the current aligned text started */
@@ -1386,7 +1416,7 @@
                 level++;
                 break;
 
-            default:
+            default:            
                 value = get_tag(gwps->data, id3, nid3, fmt, temp_buf,
                                 sizeof(temp_buf), &tag_length,
                                 subline_time_mult, flags,&intval);
@@ -1838,7 +1868,7 @@
             else {
                 left_width = 0;
             }
-            left_xpos = 0;
+            left_xpos = display->getleftmargin();
 
             if (data->format_align[i][data->curr_subline[i]].center != 0) {
                 display->getstringsize((unsigned char *)data->format_align[i]
@@ -1848,7 +1878,7 @@
             else {
                 center_width = 0;
             }
-            center_xpos=(display->width - center_width) / 2;
+            center_xpos=(display->getrightmargin()-display->getleftmargin() - center_width) / 2 + display->getleftmargin();
 
             if (data->format_align[i][data->curr_subline[i]].right != 0) {
                 display->getstringsize((unsigned char *)data->format_align[i]
@@ -1858,7 +1888,7 @@
             else {
                 right_width = 0;
             }
-            right_xpos = (display->width - right_width);
+            right_xpos = (display->getrightmargin() - right_width);
 
             /* Checks for overlapping strings.
                If needed the overlapping strings will be merged, separated by a
@@ -1902,7 +1932,7 @@
                   data->format_align[i][data->curr_subline[i]].center;
                 /* calculate the new width and position of the merged string */
                 right_width = center_width + space_width + right_width;
-                right_xpos = (display->width - right_width);
+                right_xpos = (display->getrightmargin() - right_width);
                 /* there is no centered string anymore */
                 center_width = 0;
             }
@@ -1914,7 +1944,7 @@
                   data->format_align[i][data->curr_subline[i]].center;
                 /* calculate the new width and position of the string */
                 right_width = center_width;
-                right_xpos = (display->width - right_width);
+                right_xpos = (display->getrightmargin() - right_width);
                 /* there is no centered string anymore */
                 center_width = 0;
             }
@@ -1958,7 +1988,10 @@
                     ypos = (i*string_height)+display->getymargin();
                     update_line = true;
 
-                    if (left_width>display->width) {
+                    if ((left_width > display->width) || 
+                       (display->getrightmargin()-display->getleftmargin() < left_width) ||
+                       (display->getrightmargin()-display->getleftmargin() < center_width) ||
+                       (display->getrightmargin()-display->getleftmargin() < right_width)) {
                         display->puts_scroll(0, i,
                                              (unsigned char *)data->format_align[i]
                                              [data->curr_subline[i]].left);
@@ -1991,6 +2024,7 @@
                                             (unsigned char *)data->format_align[i]
                                             [data->curr_subline[i]].right);
                         }
+                        
                     }
 #else
                     display->puts_scroll(0, i, buf);
@@ -2036,6 +2070,8 @@
                                         (unsigned char *)data->format_align[i]
                                         [data->curr_subline[i]].right);
                     }
+                    
+                   
 #else
                     update_line = true;
                     display->puts(0, i, buf);
Index: apps/gui/gwps.c
===================================================================
RCS file: /cvsroot/rockbox/apps/gui/gwps.c,v
retrieving revision 1.46
diff -u -r1.46 gwps.c
--- apps/gui/gwps.c	18 Jul 2006 15:12:49 -0000	1.46
+++ apps/gui/gwps.c	12 Aug 2006 13:37:35 -0000
@@ -74,11 +74,10 @@
 {
     int offset = 0;
     struct wps_data *data = gwps->data;
-    if(data->wps_sb_tag && data->show_sb_on_wps)
+    if((data->wps_sb_tag && data->show_sb_on_wps) || 
+       (global_settings.statusbar && !data->wps_sb_tag))
         offset = STATUSBAR_HEIGHT;
-    else if ( global_settings.statusbar && !data->wps_sb_tag)
-        offset = STATUSBAR_HEIGHT;
-    gwps->display->setmargins(0, offset);
+    gwps->display->setmargins(0, gwps->display->width, offset);
 }
 #endif
 
Index: firmware/logf.c
===================================================================
RCS file: /cvsroot/rockbox/firmware/logf.c,v
retrieving revision 1.8
diff -u -r1.8 logf.c
--- firmware/logf.c	30 Jun 2005 15:14:33 -0000	1.8
+++ firmware/logf.c	12 Aug 2006 13:37:38 -0000
@@ -52,7 +52,7 @@
     lcd_remote_getstringsize("A", &w, &h);
     lines = LCD_REMOTE_HEIGHT/h;
     columns = LCD_REMOTE_WIDTH/w;
-    lcd_remote_setmargins(0, 0);
+    lcd_remote_setmargins(0, LCD_REMOTE_WIDTH, 0);
     lcd_remote_clear_display();
     
     index = logfindex;
Index: apps/recorder/recording.c
===================================================================
RCS file: /cvsroot/rockbox/apps/recorder/recording.c,v
retrieving revision 1.125
diff -u -r1.125 recording.c
--- apps/recorder/recording.c	7 Aug 2006 21:40:11 -0000	1.125
+++ apps/recorder/recording.c	12 Aug 2006 13:37:38 -0000
@@ -418,7 +418,7 @@
     {
         screens[i].setfont(FONT_SYSFIXED);
         screens[i].getstringsize("M", &w, &h);
-        screens[i].setmargins(global_settings.invert_cursor ? 0 : w, 8);
+        screens[i].setmargins(global_settings.invert_cursor ? 0 : w, screens[i].width, 8);
         filename_offset[i] = ((screens[i].height >= 80) ? 1 : 0);
         pm_y[i] = 8 + h * (2 + filename_offset[i]);
     }
@@ -785,7 +785,7 @@
                     FOR_NB_SCREENS(i)
                     {
                         screens[i].setfont(FONT_SYSFIXED);
-                        screens[i].setmargins(global_settings.invert_cursor ? 0 : w, 8);
+                        screens[i].setmargins(global_settings.invert_cursor ? 0 : w, screens[i].width, 8);
                     }
                 }
                 break;
