summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Dziok <b0hoon@o2.pl>2010-12-15 22:06:51 +0000
committerSzymon Dziok <b0hoon@o2.pl>2010-12-15 22:06:51 +0000
commit90e8dc8f6b8b1396f9b16361cff7a32204dfa069 (patch)
tree82f26d48eb426c23f8cdc3a7d5499e1e683c3be9
parent984e1a860cc064bede188e613653d5589d10911c (diff)
downloadrockbox-90e8dc8f6b8b1396f9b16361cff7a32204dfa069.zip
rockbox-90e8dc8f6b8b1396f9b16361cff7a32204dfa069.tar.gz
rockbox-90e8dc8f6b8b1396f9b16361cff7a32204dfa069.tar.bz2
rockbox-90e8dc8f6b8b1396f9b16361cff7a32204dfa069.tar.xz
HDD6330: implement lcd_set_flip() function.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28839 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/export/config/gogearhdd6330.h2
-rw-r--r--firmware/target/arm/philips/hdd6330/lcd-hdd6330.c18
2 files changed, 14 insertions, 6 deletions
diff --git a/firmware/export/config/gogearhdd6330.h b/firmware/export/config/gogearhdd6330.h
index c91e2a4..b0128cc 100644
--- a/firmware/export/config/gogearhdd6330.h
+++ b/firmware/export/config/gogearhdd6330.h
@@ -71,7 +71,7 @@
#endif
/* define this if you can flip your LCD */
-/* #define HAVE_LCD_FLIP */
+#define HAVE_LCD_FLIP
/* define this if you can invert the colours on your LCD */
#define HAVE_LCD_INVERT
diff --git a/firmware/target/arm/philips/hdd6330/lcd-hdd6330.c b/firmware/target/arm/philips/hdd6330/lcd-hdd6330.c
index 4549f09..86006c9 100644
--- a/firmware/target/arm/philips/hdd6330/lcd-hdd6330.c
+++ b/firmware/target/arm/philips/hdd6330/lcd-hdd6330.c
@@ -37,6 +37,9 @@
/* Display status */
static unsigned lcd_yuv_options SHAREDBSS_ATTR = 0;
+/* Used for flip offset correction */
+static int x_offset;
+
/* wait for LCD */
static inline void lcd_wait_write(void)
{
@@ -66,6 +69,8 @@ void lcd_init_device(void)
lcd_send_data(0x48);
lcd_send_reg(LCD_REG_UNKNOWN_05);
lcd_send_data(0x0f);
+
+ x_offset = 16;
}
/*** hardware configuration ***/
@@ -89,7 +94,10 @@ void lcd_set_invert_display(bool yesno)
/* turn the display upside down (call lcd_update() afterwards) */
void lcd_set_flip(bool yesno)
{
- (void)yesno;
+ int flip = (yesno) ? 0x88 : 0x48;
+ x_offset = (yesno) ? 4 : 16;
+ lcd_send_reg(LCD_REG_UNKNOWN_01);
+ lcd_send_data(flip);
}
void lcd_yuv_set_options(unsigned options)
@@ -131,10 +139,10 @@ void lcd_blit_yuv(unsigned char * const src[3],
lcd_send_data(y + height - 1);
lcd_send_reg(LCD_REG_VERT_ADDR_START);
- lcd_send_data(x + 16);
+ lcd_send_data(x + x_offset);
lcd_send_reg(LCD_REG_VERT_ADDR_END);
- lcd_send_data(x + width - 1 + 16);
+ lcd_send_data(x + width - 1 + x_offset);
lcd_send_reg(LCD_REG_WRITE_DATA_2_GRAM);
@@ -223,10 +231,10 @@ void lcd_update_rect(int x, int y, int width, int height)
lcd_send_data(y + height - 1);
lcd_send_reg(LCD_REG_VERT_ADDR_START);
- lcd_send_data(x + 16);
+ lcd_send_data(x + x_offset);
lcd_send_reg(LCD_REG_VERT_ADDR_END);
- lcd_send_data(x + width - 1 + 16);
+ lcd_send_data(x + width - 1 + x_offset);
lcd_send_reg(LCD_REG_WRITE_DATA_2_GRAM);