summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c37
1 files changed, 30 insertions, 7 deletions
diff --git a/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c b/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c
index 224ff3d0fc..92864c9ed7 100644
--- a/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c
+++ b/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c
@@ -545,7 +545,7 @@ void lcd_set_invert_display(bool yesno)
#ifdef HAVE_LCD_FLIP
void lcd_set_flip(bool yesno)
{
- lcd_reg_3_val = yesno ? 0x1000 : 0x1030;
+ lcd_reg_3_val = yesno ? 0x1080 : 0x1030;
#ifdef HAVE_LCD_ENABLE
if(!lcd_on)
return;
@@ -587,13 +587,36 @@ void lcd_update_rect(int x, int y, int w, int h)
if (h <= 0)
return; /* nothing left to do */
+
imx233_lcdif_wait_ready();
- lcd_write_reg(0x50, x);
- lcd_write_reg(0x51, x + w - 1);
- lcd_write_reg(0x52, y);
- lcd_write_reg(0x53, y + h - 1);
- lcd_write_reg(0x20, x);
- lcd_write_reg(0x21, y);
+#ifdef HAVE_LCD_FLIP
+ if(!(lcd_reg_3_val&0x10))
+ {
+ int xr = LCD_WIDTH - x;
+ lcd_write_reg(0x50, xr-w);
+ lcd_write_reg(0x51, xr-1);
+ lcd_write_reg(0x20, xr-w);
+ }else
+#endif
+ {
+ lcd_write_reg(0x50, x);
+ lcd_write_reg(0x51, x + w - 1);
+ lcd_write_reg(0x20, x);
+ }
+#ifdef HAVE_LCD_FLIP
+ if(!(lcd_reg_3_val&0x20))
+ {
+ int yr = LCD_HEIGHT - y;
+ lcd_write_reg(0x52, yr-h);
+ lcd_write_reg(0x53, yr-1);
+ lcd_write_reg(0x21, yr-h);
+ }else
+#endif
+ {
+ lcd_write_reg(0x52, y);
+ lcd_write_reg(0x53, y + h - 1);
+ lcd_write_reg(0x21, y);
+ }
lcd_write_reg(0x22, 0);
imx233_lcdif_wait_ready();
imx233_lcdif_set_word_length(16);