diff options
Diffstat (limited to 'firmware/target/arm/philips/hdd6330/lcd-hdd6330.c')
-rw-r--r-- | firmware/target/arm/philips/hdd6330/lcd-hdd6330.c | 18 |
1 files changed, 13 insertions, 5 deletions
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 */ |
38 | static unsigned lcd_yuv_options SHAREDBSS_ATTR = 0; | 38 | static unsigned lcd_yuv_options SHAREDBSS_ATTR = 0; |
39 | 39 | ||
40 | /* Used for flip offset correction */ | ||
41 | static int x_offset; | ||
42 | |||
40 | /* wait for LCD */ | 43 | /* wait for LCD */ |
41 | static inline void lcd_wait_write(void) | 44 | static 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) */ |
90 | void lcd_set_flip(bool yesno) | 95 | void 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 | ||
95 | void lcd_yuv_set_options(unsigned options) | 103 | void 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 | ||