summaryrefslogtreecommitdiff
path: root/firmware/drivers/lcd-1bit-vert.c
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2022-10-02 00:54:11 +0100
committerAidan MacDonald <amachronic@protonmail.com>2022-10-12 07:34:15 -0400
commit6acc8a81a73114b614102beaaaf732b92f4e6ddd (patch)
treea04c7065ea1893fec08ae60910532ab578348391 /firmware/drivers/lcd-1bit-vert.c
parent726673c638f5ecc8928ee66bb2e10b651e60e325 (diff)
downloadrockbox-6acc8a81a73114b614102beaaaf732b92f4e6ddd.tar.gz
rockbox-6acc8a81a73114b614102beaaaf732b92f4e6ddd.zip
lcd: Cosmetic variable renaming
Assign lcd_current_viewport to a local variable for easier typing. Change-Id: Ib5d4283fd1c5a21c94d3bd3c2c28ce206383fb96
Diffstat (limited to 'firmware/drivers/lcd-1bit-vert.c')
-rw-r--r--firmware/drivers/lcd-1bit-vert.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/firmware/drivers/lcd-1bit-vert.c b/firmware/drivers/lcd-1bit-vert.c
index 9c69b82e51..548dd96994 100644
--- a/firmware/drivers/lcd-1bit-vert.c
+++ b/firmware/drivers/lcd-1bit-vert.c
@@ -237,6 +237,7 @@ void LCDFN(clear_viewport)(void)
237/* Draw a horizontal line (optimised) */ 237/* Draw a horizontal line (optimised) */
238void LCDFN(hline)(int x1, int x2, int y) 238void LCDFN(hline)(int x1, int x2, int y)
239{ 239{
240 struct viewport *vp = CURRENT_VP;
240 int width; 241 int width;
241 unsigned char *dst, *dst_end; 242 unsigned char *dst, *dst_end;
242 unsigned mask; 243 unsigned mask;
@@ -247,7 +248,7 @@ void LCDFN(hline)(int x1, int x2, int y)
247 248
248 width = x2 - x1 + 1; 249 width = x2 - x1 + 1;
249 250
250 bfunc = LCDFN(blockfuncs)[CURRENT_VP->drawmode]; 251 bfunc = LCDFN(blockfuncs)[vp->drawmode];
251 dst = LCDFB(x1,y>>3); 252 dst = LCDFB(x1,y>>3);
252 mask = BIT_N(y & 7); 253 mask = BIT_N(y & 7);
253 254
@@ -260,6 +261,7 @@ void LCDFN(hline)(int x1, int x2, int y)
260/* Draw a vertical line (optimised) */ 261/* Draw a vertical line (optimised) */
261void LCDFN(vline)(int x, int y1, int y2) 262void LCDFN(vline)(int x, int y1, int y2)
262{ 263{
264 struct viewport *vp = CURRENT_VP;
263 int ny; 265 int ny;
264 FBFN(data) *dst; 266 FBFN(data) *dst;
265 int stride_dst; 267 int stride_dst;
@@ -269,12 +271,12 @@ void LCDFN(vline)(int x, int y1, int y2)
269 if (!LCDFN(clip_viewport_vline)(&x, &y1, &y2)) 271 if (!LCDFN(clip_viewport_vline)(&x, &y1, &y2))
270 return; 272 return;
271 273
272 bfunc = LCDFN(blockfuncs)[CURRENT_VP->drawmode]; 274 bfunc = LCDFN(blockfuncs)[vp->drawmode];
273 dst = LCDFB(x,y1>>3); 275 dst = LCDFB(x,y1>>3);
274 ny = y2 - (y1 & ~7); 276 ny = y2 - (y1 & ~7);
275 mask = 0xFFu << (y1 & 7); 277 mask = 0xFFu << (y1 & 7);
276 mask_bottom = 0xFFu >> (~ny & 7); 278 mask_bottom = 0xFFu >> (~ny & 7);
277 stride_dst = CURRENT_VP->buffer->stride; 279 stride_dst = vp->buffer->stride;
278 280
279 for (; ny >= 8; ny -= 8) 281 for (; ny >= 8; ny -= 8)
280 { 282 {
@@ -289,6 +291,7 @@ void LCDFN(vline)(int x, int y1, int y2)
289/* Fill a rectangular area */ 291/* Fill a rectangular area */
290void LCDFN(fillrect)(int x, int y, int width, int height) 292void LCDFN(fillrect)(int x, int y, int width, int height)
291{ 293{
294 struct viewport *vp = CURRENT_VP;
292 int ny; 295 int ny;
293 FBFN(data) *dst, *dst_end; 296 FBFN(data) *dst, *dst_end;
294 int stride_dst; 297 int stride_dst;
@@ -300,27 +303,27 @@ void LCDFN(fillrect)(int x, int y, int width, int height)
300 if (!LCDFN(clip_viewport_rect)(&x, &y, &width, &height, NULL, NULL)) 303 if (!LCDFN(clip_viewport_rect)(&x, &y, &width, &height, NULL, NULL))
301 return; 304 return;
302 305
303 if (CURRENT_VP->drawmode & DRMODE_INVERSEVID) 306 if (vp->drawmode & DRMODE_INVERSEVID)
304 { 307 {
305 if (CURRENT_VP->drawmode & DRMODE_BG) 308 if (vp->drawmode & DRMODE_BG)
306 { 309 {
307 fillopt = true; 310 fillopt = true;
308 } 311 }
309 } 312 }
310 else 313 else
311 { 314 {
312 if (CURRENT_VP->drawmode & DRMODE_FG) 315 if (vp->drawmode & DRMODE_FG)
313 { 316 {
314 fillopt = true; 317 fillopt = true;
315 bits = 0xFFu; 318 bits = 0xFFu;
316 } 319 }
317 } 320 }
318 bfunc = LCDFN(blockfuncs)[CURRENT_VP->drawmode]; 321 bfunc = LCDFN(blockfuncs)[vp->drawmode];
319 dst = LCDFB(x,y>>3); 322 dst = LCDFB(x,y>>3);
320 ny = height - 1 + (y & 7); 323 ny = height - 1 + (y & 7);
321 mask = 0xFFu << (y & 7); 324 mask = 0xFFu << (y & 7);
322 mask_bottom = 0xFFu >> (~ny & 7); 325 mask_bottom = 0xFFu >> (~ny & 7);
323 stride_dst = CURRENT_VP->buffer->stride; 326 stride_dst = vp->buffer->stride;
324 327
325 for (; ny >= 8; ny -= 8) 328 for (; ny >= 8; ny -= 8)
326 { 329 {
@@ -368,6 +371,7 @@ void ICODE_ATTR LCDFN(bitmap_part)(const unsigned char *src, int src_x,
368 int src_y, int stride, int x, int y, 371 int src_y, int stride, int x, int y,
369 int width, int height) 372 int width, int height)
370{ 373{
374 struct viewport *vp = CURRENT_VP;
371 int shift, ny; 375 int shift, ny;
372 FBFN(data) *dst, *dst_end; 376 FBFN(data) *dst, *dst_end;
373 int stride_dst; 377 int stride_dst;
@@ -381,17 +385,17 @@ void ICODE_ATTR LCDFN(bitmap_part)(const unsigned char *src, int src_x,
381 src_y &= 7; 385 src_y &= 7;
382 y -= src_y; 386 y -= src_y;
383 dst = LCDFB(x,y>>3); 387 dst = LCDFB(x,y>>3);
384 stride_dst = CURRENT_VP->buffer->stride; 388 stride_dst = vp->buffer->stride;
385 shift = y & 7; 389 shift = y & 7;
386 ny = height - 1 + shift + src_y; 390 ny = height - 1 + shift + src_y;
387 391
388 bfunc = LCDFN(blockfuncs)[CURRENT_VP->drawmode]; 392 bfunc = LCDFN(blockfuncs)[vp->drawmode];
389 mask = 0xFFu << (shift + src_y); 393 mask = 0xFFu << (shift + src_y);
390 mask_bottom = 0xFFu >> (~ny & 7); 394 mask_bottom = 0xFFu >> (~ny & 7);
391 395
392 if (shift == 0) 396 if (shift == 0)
393 { 397 {
394 bool copyopt = (CURRENT_VP->drawmode == DRMODE_SOLID); 398 bool copyopt = (vp->drawmode == DRMODE_SOLID);
395 399
396 for (; ny >= 8; ny -= 8) 400 for (; ny >= 8; ny -= 8)
397 { 401 {