diff options
author | Michael Giacomelli <giac2000@hotmail.com> | 2009-07-18 01:38:17 +0000 |
---|---|---|
committer | Michael Giacomelli <giac2000@hotmail.com> | 2009-07-18 01:38:17 +0000 |
commit | e362aeb61f62d7dbd06c84c4b19fe49f898f37e8 (patch) | |
tree | 98ed65fa3ed51da6644e7747de849cd37ed07700 /firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c | |
parent | 6f4294219e2ec8f0190a84020aa67dfe969ebb66 (diff) | |
download | rockbox-e362aeb61f62d7dbd06c84c4b19fe49f898f37e8.tar.gz rockbox-e362aeb61f62d7dbd06c84c4b19fe49f898f37e8.zip |
Commit FS#10413 by Michael Chicoine. Fixes upside down menu in mpegplayer when watching videos with the screen inverted.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21942 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c')
-rw-r--r-- | firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c b/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c index ece773f2fa..69e1d2504f 100644 --- a/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c +++ b/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c | |||
@@ -89,7 +89,8 @@ static volatile bool lcd_busy = false; | |||
89 | static unsigned short r_entry_mode = R_ENTRY_MODE_HORZ_NORMAL; | 89 | static unsigned short r_entry_mode = R_ENTRY_MODE_HORZ_NORMAL; |
90 | #define R_ENTRY_MODE_VERT 0x7038 | 90 | #define R_ENTRY_MODE_VERT 0x7038 |
91 | #define R_ENTRY_MODE_SOLID_VERT 0x1038 | 91 | #define R_ENTRY_MODE_SOLID_VERT 0x1038 |
92 | #define R_ENTRY_MODE_VIDEO 0x7020 | 92 | #define R_ENTRY_MODE_VIDEO_NORMAL 0x7020 |
93 | #define R_ENTRY_MODE_VIDEO_FLIPPED 0x7010 | ||
93 | 94 | ||
94 | 95 | ||
95 | /* Reverse Flag */ | 96 | /* Reverse Flag */ |
@@ -380,9 +381,18 @@ void lcd_yuv_set_options(unsigned options) | |||
380 | 381 | ||
381 | static void lcd_window_blit(int xmin, int ymin, int xmax, int ymax) | 382 | static void lcd_window_blit(int xmin, int ymin, int xmax, int ymax) |
382 | { | 383 | { |
383 | lcd_write_reg(R_HORIZ_RAM_ADDR_POS, ((LCD_WIDTH-1 - xmin) << 8) | (LCD_WIDTH-1 - xmax)); | 384 | if (!display_flipped) |
384 | lcd_write_reg(R_VERT_RAM_ADDR_POS, (ymax << 8) | ymin); | 385 | { |
385 | lcd_write_reg(R_RAM_ADDR_SET, (ymin << 8) | (LCD_WIDTH-1 - xmin)); | 386 | lcd_write_reg(R_HORIZ_RAM_ADDR_POS, ((LCD_WIDTH-1 - xmin) << 8) | (LCD_WIDTH-1 - xmax)); |
387 | lcd_write_reg(R_VERT_RAM_ADDR_POS, (ymax << 8) | ymin); | ||
388 | lcd_write_reg(R_RAM_ADDR_SET, (ymin << 8) | (LCD_WIDTH-1 - xmin)); | ||
389 | } | ||
390 | else | ||
391 | { | ||
392 | lcd_write_reg(R_HORIZ_RAM_ADDR_POS, (xmax << 8) | xmin); | ||
393 | lcd_write_reg(R_VERT_RAM_ADDR_POS, (ymax << 8) | ymin); | ||
394 | lcd_write_reg(R_RAM_ADDR_SET, (ymax << 8) | xmin); | ||
395 | } | ||
386 | } | 396 | } |
387 | 397 | ||
388 | /* Performance function to blit a YUV bitmap directly to the LCD | 398 | /* Performance function to blit a YUV bitmap directly to the LCD |
@@ -407,7 +417,14 @@ void lcd_blit_yuv(unsigned char * const src[3], | |||
407 | yuv_src[1] = src[1] + (z >> 2) + (src_x >> 1); | 417 | yuv_src[1] = src[1] + (z >> 2) + (src_x >> 1); |
408 | yuv_src[2] = src[2] + (yuv_src[1] - src[1]); | 418 | yuv_src[2] = src[2] + (yuv_src[1] - src[1]); |
409 | 419 | ||
410 | lcd_write_reg(R_ENTRY_MODE, R_ENTRY_MODE_VIDEO); | 420 | if (!display_flipped) |
421 | { | ||
422 | lcd_write_reg(R_ENTRY_MODE, R_ENTRY_MODE_VIDEO_NORMAL); | ||
423 | } | ||
424 | else | ||
425 | { | ||
426 | lcd_write_reg(R_ENTRY_MODE, R_ENTRY_MODE_VIDEO_FLIPPED); | ||
427 | } | ||
411 | 428 | ||
412 | if (lcd_yuv_options & LCD_YUV_DITHER) | 429 | if (lcd_yuv_options & LCD_YUV_DITHER) |
413 | { | 430 | { |