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.tar.gz
rockbox-90e8dc8f6b8b1396f9b16361cff7a32204dfa069.zip
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 c91e2a45d8..b0128cc84c 100644
--- a/firmware/export/config/gogearhdd6330.h
+++ b/firmware/export/config/gogearhdd6330.h
@@ -71,7 +71,7 @@
71#endif 71#endif
72 72
73/* define this if you can flip your LCD */ 73/* define this if you can flip your LCD */
74/* #define HAVE_LCD_FLIP */ 74#define HAVE_LCD_FLIP
75 75
76/* define this if you can invert the colours on your LCD */ 76/* define this if you can invert the colours on your LCD */
77#define HAVE_LCD_INVERT 77#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 4549f09d2a..86006c9636 100644
--- a/firmware/target/arm/philips/hdd6330/lcd-hdd6330.c
+++ b/firmware/target/arm/philips/hdd6330/lcd-hdd6330.c
@@ -37,6 +37,9 @@
37/* Display status */ 37/* Display status */
38static unsigned lcd_yuv_options SHAREDBSS_ATTR = 0; 38static unsigned lcd_yuv_options SHAREDBSS_ATTR = 0;
39 39
40/* Used for flip offset correction */
41static int x_offset;
42
40/* wait for LCD */ 43/* wait for LCD */
41static inline void lcd_wait_write(void) 44static inline void lcd_wait_write(void)
42{ 45{
@@ -66,6 +69,8 @@ void lcd_init_device(void)
66 lcd_send_data(0x48); 69 lcd_send_data(0x48);
67 lcd_send_reg(LCD_REG_UNKNOWN_05); 70 lcd_send_reg(LCD_REG_UNKNOWN_05);
68 lcd_send_data(0x0f); 71 lcd_send_data(0x0f);
72
73 x_offset = 16;
69} 74}
70 75
71/*** hardware configuration ***/ 76/*** hardware configuration ***/
@@ -89,7 +94,10 @@ void lcd_set_invert_display(bool yesno)
89/* turn the display upside down (call lcd_update() afterwards) */ 94/* turn the display upside down (call lcd_update() afterwards) */
90void lcd_set_flip(bool yesno) 95void lcd_set_flip(bool yesno)
91{ 96{
92 (void)yesno; 97 int flip = (yesno) ? 0x88 : 0x48;
98 x_offset = (yesno) ? 4 : 16;
99 lcd_send_reg(LCD_REG_UNKNOWN_01);
100 lcd_send_data(flip);
93} 101}
94 102
95void lcd_yuv_set_options(unsigned options) 103void lcd_yuv_set_options(unsigned options)
@@ -131,10 +139,10 @@ void lcd_blit_yuv(unsigned char * const src[3],
131 lcd_send_data(y + height - 1); 139 lcd_send_data(y + height - 1);
132 140
133 lcd_send_reg(LCD_REG_VERT_ADDR_START); 141 lcd_send_reg(LCD_REG_VERT_ADDR_START);
134 lcd_send_data(x + 16); 142 lcd_send_data(x + x_offset);
135 143
136 lcd_send_reg(LCD_REG_VERT_ADDR_END); 144 lcd_send_reg(LCD_REG_VERT_ADDR_END);
137 lcd_send_data(x + width - 1 + 16); 145 lcd_send_data(x + width - 1 + x_offset);
138 146
139 lcd_send_reg(LCD_REG_WRITE_DATA_2_GRAM); 147 lcd_send_reg(LCD_REG_WRITE_DATA_2_GRAM);
140 148
@@ -223,10 +231,10 @@ void lcd_update_rect(int x, int y, int width, int height)
223 lcd_send_data(y + height - 1); 231 lcd_send_data(y + height - 1);
224 232
225 lcd_send_reg(LCD_REG_VERT_ADDR_START); 233 lcd_send_reg(LCD_REG_VERT_ADDR_START);
226 lcd_send_data(x + 16); 234 lcd_send_data(x + x_offset);
227 235
228 lcd_send_reg(LCD_REG_VERT_ADDR_END); 236 lcd_send_reg(LCD_REG_VERT_ADDR_END);
229 lcd_send_data(x + width - 1 + 16); 237 lcd_send_data(x + width - 1 + x_offset);
230 238
231 lcd_send_reg(LCD_REG_WRITE_DATA_2_GRAM); 239 lcd_send_reg(LCD_REG_WRITE_DATA_2_GRAM);
232 240