diff options
author | Marcin Bukat <marcin.bukat@gmail.com> | 2013-05-11 12:30:04 +0200 |
---|---|---|
committer | Marcin Bukat <marcin.bukat@gmail.com> | 2013-05-11 12:30:38 +0200 |
commit | ca8154741fd01e4b11461ce522da7d5e30a12d6e (patch) | |
tree | c60f09d1f91b2c7c3e520b220a60b90545ddf86d /firmware/target/arm/rk27xx/ma/lcd-ma.c | |
parent | 3f4824b94fdfcb99cd8bfe8d7b60ba6106f3accd (diff) | |
download | rockbox-ca8154741fd01e4b11461ce522da7d5e30a12d6e.tar.gz rockbox-ca8154741fd01e4b11461ce522da7d5e30a12d6e.zip |
rk27xx: Slightly refactor lcd_set_gram_area()
Change-Id: I1040164220dd87b19b58be560eb5b628857bc284
Diffstat (limited to 'firmware/target/arm/rk27xx/ma/lcd-ma.c')
-rw-r--r-- | firmware/target/arm/rk27xx/ma/lcd-ma.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/firmware/target/arm/rk27xx/ma/lcd-ma.c b/firmware/target/arm/rk27xx/ma/lcd-ma.c index ad67352eb7..3c3d9fb097 100644 --- a/firmware/target/arm/rk27xx/ma/lcd-ma.c +++ b/firmware/target/arm/rk27xx/ma/lcd-ma.c | |||
@@ -151,21 +151,22 @@ void lcd_enable (bool on) | |||
151 | LCDC_CTRL &= ~RGB24B; | 151 | LCDC_CTRL &= ~RGB24B; |
152 | } | 152 | } |
153 | 153 | ||
154 | void lcd_set_gram_area(int x, int y, int width, int height) | 154 | void lcd_set_gram_area(int x_start, int y_start, |
155 | int x_end, int y_end) | ||
155 | { | 156 | { |
156 | lcdctrl_bypass(1); | 157 | lcdctrl_bypass(1); |
157 | LCDC_CTRL |= RGB24B; | 158 | LCDC_CTRL |= RGB24B; |
158 | 159 | ||
159 | lcd_cmd(0x002A); | 160 | lcd_cmd(0x002A); |
160 | lcd_data((x&0xff00)>>8); | 161 | lcd_data((x_start&0xff00)>>8); |
161 | lcd_data(x&0x00ff); | 162 | lcd_data(x_start&0x00ff); |
162 | lcd_data(((width-1)&0xff00)>>8); | 163 | lcd_data((x_end&0xff00)>>8); |
163 | lcd_data((width-1)&0x00ff); | 164 | lcd_data(x_end&0x00ff); |
164 | lcd_cmd(0x002B); | 165 | lcd_cmd(0x002B); |
165 | lcd_data((y&0xff00)>>8); | 166 | lcd_data((y_start&0xff00)>>8); |
166 | lcd_data(y&0x00ff); | 167 | lcd_data(y_start&0x00ff); |
167 | lcd_data(((height-1)&0xff00)>>8); | 168 | lcd_data((y_end&0xff00)>>8); |
168 | lcd_data((height-1)&0x00ff); | 169 | lcd_data(y_end&0x00ff); |
169 | 170 | ||
170 | lcd_cmd(0x2c); | 171 | lcd_cmd(0x2c); |
171 | LCDC_CTRL &= ~RGB24B; | 172 | LCDC_CTRL &= ~RGB24B; |
@@ -176,7 +177,7 @@ void lcd_update_rect(int x, int y, int width, int height) | |||
176 | int px = x, py = y; | 177 | int px = x, py = y; |
177 | int pxmax = x + width, pymax = y + height; | 178 | int pxmax = x + width, pymax = y + height; |
178 | 179 | ||
179 | lcd_set_gram_area(x, y, pxmax, pymax); | 180 | lcd_set_gram_area(x, y, pxmax-1, pymax-1); |
180 | 181 | ||
181 | for (py = y; py < pymax; py++) | 182 | for (py = y; py < pymax; py++) |
182 | for (px = x; px < pxmax; px++) | 183 | for (px = x; px < pxmax; px++) |