summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/export/lcd-remote.h1
-rw-r--r--firmware/export/lcd.h1
-rwxr-xr-xfirmware/target/coldfire/iaudio/x5/lcd-x5.c32
3 files changed, 3 insertions, 31 deletions
diff --git a/firmware/export/lcd-remote.h b/firmware/export/lcd-remote.h
index 13d78ac428..9665652716 100644
--- a/firmware/export/lcd-remote.h
+++ b/firmware/export/lcd-remote.h
@@ -121,7 +121,6 @@ extern void lcd_remote_update_rect(int x, int y, int width, int height);
121 121
122extern void lcd_remote_set_invert_display(bool yesno); 122extern void lcd_remote_set_invert_display(bool yesno);
123extern void lcd_remote_set_flip(bool yesno); 123extern void lcd_remote_set_flip(bool yesno);
124extern void lcd_remote_roll(int pixels);
125 124
126extern void lcd_remote_set_drawmode(int mode); 125extern void lcd_remote_set_drawmode(int mode);
127extern int lcd_remote_get_drawmode(void); 126extern int lcd_remote_get_drawmode(void);
diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h
index 22ae5a3763..a39147628d 100644
--- a/firmware/export/lcd.h
+++ b/firmware/export/lcd.h
@@ -292,7 +292,6 @@ struct bitmap {
292 292
293extern void lcd_set_invert_display(bool yesno); 293extern void lcd_set_invert_display(bool yesno);
294extern void lcd_set_flip(bool yesno); 294extern void lcd_set_flip(bool yesno);
295extern void lcd_roll(int pixels);
296 295
297extern void lcd_set_drawmode(int mode); 296extern void lcd_set_drawmode(int mode);
298extern int lcd_get_drawmode(void); 297extern int lcd_get_drawmode(void);
diff --git a/firmware/target/coldfire/iaudio/x5/lcd-x5.c b/firmware/target/coldfire/iaudio/x5/lcd-x5.c
index fc16c80a73..698ae477fa 100755
--- a/firmware/target/coldfire/iaudio/x5/lcd-x5.c
+++ b/firmware/target/coldfire/iaudio/x5/lcd-x5.c
@@ -50,9 +50,6 @@ static unsigned short r_gate_scan_start_pos = 0x0002;
50static unsigned short r_drv_output_control = 0x0313; 50static unsigned short r_drv_output_control = 0x0313;
51static unsigned short r_horiz_ram_addr_pos = 0x7f00; 51static unsigned short r_horiz_ram_addr_pos = 0x7f00;
52 52
53/* Rolling */
54static int roll_offset = 0; /* Amount of roll offset (0-127). */
55
56/* Dithering */ 53/* Dithering */
57#define R_ENTRY_MODE_SOLID 0x1038 54#define R_ENTRY_MODE_SOLID 0x1038
58#define R_ENTRY_MODE_DIT 0x9038 55#define R_ENTRY_MODE_DIT 0x9038
@@ -191,25 +188,6 @@ void lcd_set_flip(bool yesno)
191 lcd_write_reg(R_HORIZ_RAM_ADDR_POS, r_horiz_ram_addr_pos); 188 lcd_write_reg(R_HORIZ_RAM_ADDR_POS, r_horiz_ram_addr_pos);
192} 189}
193 190
194/* Rolls up the lcd display by the specified amount of lines.
195 * Lines that are rolled out over the top of the screen are
196 * rolled in from the bottom again. This is a hardware
197 * remapping only and all operations on the lcd are affected.
198 * ->
199 * @param int lines - The number of lines that are rolled.
200 * The value must be 0 <= pixels < LCD_HEIGHT.
201 * Call lcd_update() afterwards */
202void lcd_roll(int lines)
203{
204 /* Just allow any value mod LCD_HEIGHT-1. Assumes LCD_HEIGHT == 128. */
205 if (lines < 0)
206 lines = -lines & 127;
207 else
208 lines = (128 - (lines & 127)) & 127;
209
210 roll_offset = lines;
211}
212
213static void lcd_power_on(void) 191static void lcd_power_on(void)
214{ 192{
215 /* Be sure standby bit is clear. */ 193 /* Be sure standby bit is clear. */
@@ -399,7 +377,6 @@ void lcd_init_device(void)
399 lcd_set_contrast(DEFAULT_CONTRAST_SETTING); 377 lcd_set_contrast(DEFAULT_CONTRAST_SETTING);
400 lcd_set_invert_display(false); 378 lcd_set_invert_display(false);
401 lcd_set_flip(false); 379 lcd_set_flip(false);
402 lcd_roll(0);
403 hw_dither(false); /* do this or all bootloaders will need reflashing */ 380 hw_dither(false); /* do this or all bootloaders will need reflashing */
404#endif 381#endif
405} 382}
@@ -484,8 +461,7 @@ void lcd_yuv_blit(unsigned char * const src[3],
484 height = (height + 1) & ~1; 461 height = (height + 1) & ~1;
485 462
486 /* Set start position and window */ 463 /* Set start position and window */
487 lcd_write_reg(R_RAM_ADDR_SET, (x << 8) | 464 lcd_write_reg(R_RAM_ADDR_SET, (x << 8) | (y + y_offset));
488 (((y + roll_offset) & 127) + y_offset));
489 lcd_write_reg(R_VERT_RAM_ADDR_POS, ((x + width - 1) << 8) | x); 465 lcd_write_reg(R_VERT_RAM_ADDR_POS, ((x + width - 1) << 8) | x);
490 466
491 lcd_begin_write_gram(); 467 lcd_begin_write_gram();
@@ -522,8 +498,7 @@ void lcd_update(void)
522 hw_dither(false); 498 hw_dither(false);
523 499
524 /* Set start position and window */ 500 /* Set start position and window */
525 /* Just add roll offset to start address. CP will roll back around. */ 501 lcd_write_reg(R_RAM_ADDR_SET, y_offset); /* X == 0 */
526 lcd_write_reg(R_RAM_ADDR_SET, y_offset + roll_offset); /* X == 0 */
527 lcd_write_reg(R_VERT_RAM_ADDR_POS, (LCD_WIDTH-1) << 8); 502 lcd_write_reg(R_VERT_RAM_ADDR_POS, (LCD_WIDTH-1) << 8);
528 503
529 lcd_begin_write_gram(); 504 lcd_begin_write_gram();
@@ -560,8 +535,7 @@ void lcd_update_rect(int x, int y, int width, int height)
560 return; /* nothing left to do */ 535 return; /* nothing left to do */
561 536
562 /* Set start position and window */ 537 /* Set start position and window */
563 lcd_write_reg(R_RAM_ADDR_SET, (x << 8) | 538 lcd_write_reg(R_RAM_ADDR_SET, (x << 8) | (y + y_offset));
564 (((y + roll_offset) & 127) + y_offset));
565 lcd_write_reg(R_VERT_RAM_ADDR_POS, ((x + width - 1) << 8) | x); 539 lcd_write_reg(R_VERT_RAM_ADDR_POS, ((x + width - 1) << 8) | x);
566 540
567 lcd_begin_write_gram(); 541 lcd_begin_write_gram();