diff options
author | Moshe Piekarski <dev.rockbox@melachim.net> | 2020-10-28 15:48:33 -0400 |
---|---|---|
committer | William Wilgus <me.theuser@yahoo.com> | 2020-11-08 03:19:04 +0000 |
commit | c4254d10fc61779656dd5692c2f6333692ba73f8 (patch) | |
tree | a96699e9e7bae2b4f48c9c72741891d14fca2097 /firmware/target | |
parent | 9fcdb44e55b5bee585e4906e93d055d230ee01d9 (diff) | |
download | rockbox-c4254d10fc61779656dd5692c2f6333692ba73f8.tar.gz rockbox-c4254d10fc61779656dd5692c2f6333692ba73f8.zip |
Fuze+: Fix misplaced rectangle when lcd_flip set
Change-Id: Ic5197d8dffd66cfefdb42242869b48b33aa4d042
Diffstat (limited to 'firmware/target')
-rw-r--r-- | firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c b/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c index 224ff3d0fc..92864c9ed7 100644 --- a/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c +++ b/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c | |||
@@ -545,7 +545,7 @@ void lcd_set_invert_display(bool yesno) | |||
545 | #ifdef HAVE_LCD_FLIP | 545 | #ifdef HAVE_LCD_FLIP |
546 | void lcd_set_flip(bool yesno) | 546 | void lcd_set_flip(bool yesno) |
547 | { | 547 | { |
548 | lcd_reg_3_val = yesno ? 0x1000 : 0x1030; | 548 | lcd_reg_3_val = yesno ? 0x1080 : 0x1030; |
549 | #ifdef HAVE_LCD_ENABLE | 549 | #ifdef HAVE_LCD_ENABLE |
550 | if(!lcd_on) | 550 | if(!lcd_on) |
551 | return; | 551 | return; |
@@ -587,13 +587,36 @@ void lcd_update_rect(int x, int y, int w, int h) | |||
587 | if (h <= 0) | 587 | if (h <= 0) |
588 | return; /* nothing left to do */ | 588 | return; /* nothing left to do */ |
589 | 589 | ||
590 | |||
590 | imx233_lcdif_wait_ready(); | 591 | imx233_lcdif_wait_ready(); |
591 | lcd_write_reg(0x50, x); | 592 | #ifdef HAVE_LCD_FLIP |
592 | lcd_write_reg(0x51, x + w - 1); | 593 | if(!(lcd_reg_3_val&0x10)) |
593 | lcd_write_reg(0x52, y); | 594 | { |
594 | lcd_write_reg(0x53, y + h - 1); | 595 | int xr = LCD_WIDTH - x; |
595 | lcd_write_reg(0x20, x); | 596 | lcd_write_reg(0x50, xr-w); |
596 | lcd_write_reg(0x21, y); | 597 | lcd_write_reg(0x51, xr-1); |
598 | lcd_write_reg(0x20, xr-w); | ||
599 | }else | ||
600 | #endif | ||
601 | { | ||
602 | lcd_write_reg(0x50, x); | ||
603 | lcd_write_reg(0x51, x + w - 1); | ||
604 | lcd_write_reg(0x20, x); | ||
605 | } | ||
606 | #ifdef HAVE_LCD_FLIP | ||
607 | if(!(lcd_reg_3_val&0x20)) | ||
608 | { | ||
609 | int yr = LCD_HEIGHT - y; | ||
610 | lcd_write_reg(0x52, yr-h); | ||
611 | lcd_write_reg(0x53, yr-1); | ||
612 | lcd_write_reg(0x21, yr-h); | ||
613 | }else | ||
614 | #endif | ||
615 | { | ||
616 | lcd_write_reg(0x52, y); | ||
617 | lcd_write_reg(0x53, y + h - 1); | ||
618 | lcd_write_reg(0x21, y); | ||
619 | } | ||
597 | lcd_write_reg(0x22, 0); | 620 | lcd_write_reg(0x22, 0); |
598 | imx233_lcdif_wait_ready(); | 621 | imx233_lcdif_wait_ready(); |
599 | imx233_lcdif_set_word_length(16); | 622 | imx233_lcdif_set_word_length(16); |