diff options
author | Szymon Dziok <b0hoon@o2.pl> | 2010-12-15 22:06:51 +0000 |
---|---|---|
committer | Szymon Dziok <b0hoon@o2.pl> | 2010-12-15 22:06:51 +0000 |
commit | 90e8dc8f6b8b1396f9b16361cff7a32204dfa069 (patch) | |
tree | 82f26d48eb426c23f8cdc3a7d5499e1e683c3be9 /firmware/target/arm/philips/hdd6330 | |
parent | 984e1a860cc064bede188e613653d5589d10911c (diff) |
HDD6330: implement lcd_set_flip() function.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28839 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/philips/hdd6330')
-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 @@ /* 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); |