diff options
author | Jens Arnold <amiconn@rockbox.org> | 2005-07-04 06:20:50 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2005-07-04 06:20:50 +0000 |
commit | f89f011508c80985b4dfee4fcc296689c149b30f (patch) | |
tree | 4c09a16f8420504adb7195456052d51bb081b80d /firmware | |
parent | c0e6ed6b66f31bb44c2f38afb85453a8389d4c34 (diff) | |
download | rockbox-f89f011508c80985b4dfee4fcc296689c149b30f.tar.gz rockbox-f89f011508c80985b4dfee4fcc296689c149b30f.zip |
Converted to use the IRAM defines, and some small optimisations.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7007 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/drivers/lcd-h100-remote.c | 42 | ||||
-rw-r--r-- | firmware/drivers/lcd-recorder.c | 38 |
2 files changed, 40 insertions, 40 deletions
diff --git a/firmware/drivers/lcd-h100-remote.c b/firmware/drivers/lcd-h100-remote.c index 8fa193ac9b..b68890a1e9 100644 --- a/firmware/drivers/lcd-h100-remote.c +++ b/firmware/drivers/lcd-h100-remote.c | |||
@@ -68,7 +68,7 @@ | |||
68 | 68 | ||
69 | unsigned char lcd_remote_framebuffer[LCD_REMOTE_HEIGHT/8][LCD_REMOTE_WIDTH] | 69 | unsigned char lcd_remote_framebuffer[LCD_REMOTE_HEIGHT/8][LCD_REMOTE_WIDTH] |
70 | IDATA_ATTR; | 70 | IDATA_ATTR; |
71 | 71 | ||
72 | static int drawmode = DRMODE_SOLID; | 72 | static int drawmode = DRMODE_SOLID; |
73 | static int xmargin = 0; | 73 | static int xmargin = 0; |
74 | static int ymargin = 0; | 74 | static int ymargin = 0; |
@@ -380,7 +380,7 @@ void lcd_remote_init(void) | |||
380 | 380 | ||
381 | /* Update the display. | 381 | /* Update the display. |
382 | This must be called after all other LCD functions that change the display. */ | 382 | This must be called after all other LCD functions that change the display. */ |
383 | void lcd_remote_update(void) __attribute__ ((section (".icode"))); | 383 | void lcd_remote_update(void) ICODE_ATTR; |
384 | void lcd_remote_update(void) | 384 | void lcd_remote_update(void) |
385 | { | 385 | { |
386 | int y; | 386 | int y; |
@@ -399,7 +399,7 @@ void lcd_remote_update(void) | |||
399 | } | 399 | } |
400 | 400 | ||
401 | /* Update a fraction of the display. */ | 401 | /* Update a fraction of the display. */ |
402 | void lcd_remote_update_rect(int, int, int, int) __attribute__ ((section (".icode"))); | 402 | void lcd_remote_update_rect(int, int, int, int) ICODE_ATTR; |
403 | void lcd_remote_update_rect(int x, int y, int width, int height) | 403 | void lcd_remote_update_rect(int x, int y, int width, int height) |
404 | { | 404 | { |
405 | int ymax; | 405 | int ymax; |
@@ -497,56 +497,56 @@ lcd_pixelfunc_type* lcd_remote_pixelfuncs[8] = { | |||
497 | }; | 497 | }; |
498 | 498 | ||
499 | static void flipblock(unsigned char *address, unsigned mask, unsigned bits) | 499 | static void flipblock(unsigned char *address, unsigned mask, unsigned bits) |
500 | __attribute__ ((section(".icode"))); | 500 | ICODE_ATTR; |
501 | static void flipblock(unsigned char *address, unsigned mask, unsigned bits) | 501 | static void flipblock(unsigned char *address, unsigned mask, unsigned bits) |
502 | { | 502 | { |
503 | *address ^= (bits & mask); | 503 | *address ^= bits & mask; |
504 | } | 504 | } |
505 | 505 | ||
506 | static void bgblock(unsigned char *address, unsigned mask, unsigned bits) | 506 | static void bgblock(unsigned char *address, unsigned mask, unsigned bits) |
507 | __attribute__ ((section(".icode"))); | 507 | ICODE_ATTR; |
508 | static void bgblock(unsigned char *address, unsigned mask, unsigned bits) | 508 | static void bgblock(unsigned char *address, unsigned mask, unsigned bits) |
509 | { | 509 | { |
510 | *address &= (bits | ~mask); | 510 | *address &= bits | ~mask; |
511 | } | 511 | } |
512 | 512 | ||
513 | static void fgblock(unsigned char *address, unsigned mask, unsigned bits) | 513 | static void fgblock(unsigned char *address, unsigned mask, unsigned bits) |
514 | __attribute__ ((section(".icode"))); | 514 | ICODE_ATTR; |
515 | static void fgblock(unsigned char *address, unsigned mask, unsigned bits) | 515 | static void fgblock(unsigned char *address, unsigned mask, unsigned bits) |
516 | { | 516 | { |
517 | *address |= (bits & mask); | 517 | *address |= bits & mask; |
518 | } | 518 | } |
519 | 519 | ||
520 | static void solidblock(unsigned char *address, unsigned mask, unsigned bits) | 520 | static void solidblock(unsigned char *address, unsigned mask, unsigned bits) |
521 | __attribute__ ((section(".icode"))); | 521 | ICODE_ATTR; |
522 | static void solidblock(unsigned char *address, unsigned mask, unsigned bits) | 522 | static void solidblock(unsigned char *address, unsigned mask, unsigned bits) |
523 | { | 523 | { |
524 | *address = (*address & ~mask) | (bits & mask); | 524 | *address = (*address & ~mask) | (bits & mask); |
525 | } | 525 | } |
526 | 526 | ||
527 | static void flipinvblock(unsigned char *address, unsigned mask, unsigned bits) | 527 | static void flipinvblock(unsigned char *address, unsigned mask, unsigned bits) |
528 | __attribute__ ((section(".icode"))); | 528 | ICODE_ATTR; |
529 | static void flipinvblock(unsigned char *address, unsigned mask, unsigned bits) | 529 | static void flipinvblock(unsigned char *address, unsigned mask, unsigned bits) |
530 | { | 530 | { |
531 | *address ^= (~bits & mask); | 531 | *address ^= ~bits & mask; |
532 | } | 532 | } |
533 | 533 | ||
534 | static void bginvblock(unsigned char *address, unsigned mask, unsigned bits) | 534 | static void bginvblock(unsigned char *address, unsigned mask, unsigned bits) |
535 | __attribute__ ((section(".icode"))); | 535 | ICODE_ATTR; |
536 | static void bginvblock(unsigned char *address, unsigned mask, unsigned bits) | 536 | static void bginvblock(unsigned char *address, unsigned mask, unsigned bits) |
537 | { | 537 | { |
538 | *address &= ~(bits & mask); | 538 | *address &= ~(bits & mask); |
539 | } | 539 | } |
540 | 540 | ||
541 | static void fginvblock(unsigned char *address, unsigned mask, unsigned bits) | 541 | static void fginvblock(unsigned char *address, unsigned mask, unsigned bits) |
542 | __attribute__ ((section(".icode"))); | 542 | ICODE_ATTR; |
543 | static void fginvblock(unsigned char *address, unsigned mask, unsigned bits) | 543 | static void fginvblock(unsigned char *address, unsigned mask, unsigned bits) |
544 | { | 544 | { |
545 | *address |= (~bits & mask); | 545 | *address |= ~bits & mask; |
546 | } | 546 | } |
547 | 547 | ||
548 | static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits) | 548 | static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits) |
549 | __attribute__ ((section(".icode"))); | 549 | ICODE_ATTR; |
550 | static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits) | 550 | static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits) |
551 | { | 551 | { |
552 | *address = (*address & ~mask) | (~bits & mask); | 552 | *address = (*address & ~mask) | (~bits & mask); |
@@ -714,7 +714,7 @@ void lcd_remote_vline(int x, int y1, int y2) | |||
714 | dst = &lcd_remote_framebuffer[y1>>3][x]; | 714 | dst = &lcd_remote_framebuffer[y1>>3][x]; |
715 | ny = y2 - (y1 & ~7); | 715 | ny = y2 - (y1 & ~7); |
716 | mask = 0xFFu << (y1 & 7); | 716 | mask = 0xFFu << (y1 & 7); |
717 | mask_bottom = 0xFFu >> (7 - (ny & 7)); | 717 | mask_bottom = 0xFFu >> (~ny & 7); |
718 | 718 | ||
719 | for (; ny >= 8; ny -= 8) | 719 | for (; ny >= 8; ny -= 8) |
720 | { | 720 | { |
@@ -780,7 +780,7 @@ void lcd_remote_fillrect(int x, int y, int width, int height) | |||
780 | dst = &lcd_remote_framebuffer[y>>3][x]; | 780 | dst = &lcd_remote_framebuffer[y>>3][x]; |
781 | ny = height - 1 + (y & 7); | 781 | ny = height - 1 + (y & 7); |
782 | mask = 0xFFu << (y & 7); | 782 | mask = 0xFFu << (y & 7); |
783 | mask_bottom = 0xFFu >> (7 - (ny & 7)); | 783 | mask_bottom = 0xFFu >> (~ny & 7); |
784 | 784 | ||
785 | for (; ny >= 8; ny -= 8) | 785 | for (; ny >= 8; ny -= 8) |
786 | { | 786 | { |
@@ -826,7 +826,7 @@ void lcd_remote_fillrect(int x, int y, int width, int height) | |||
826 | /* Draw a partial bitmap */ | 826 | /* Draw a partial bitmap */ |
827 | void lcd_remote_bitmap_part(const unsigned char *src, int src_x, int src_y, | 827 | void lcd_remote_bitmap_part(const unsigned char *src, int src_x, int src_y, |
828 | int stride, int x, int y, int width, int height) | 828 | int stride, int x, int y, int width, int height) |
829 | __attribute__ ((section(".icode"))); | 829 | ICODE_ATTR; |
830 | void lcd_remote_bitmap_part(const unsigned char *src, int src_x, int src_y, | 830 | void lcd_remote_bitmap_part(const unsigned char *src, int src_x, int src_y, |
831 | int stride, int x, int y, int width, int height) | 831 | int stride, int x, int y, int width, int height) |
832 | { | 832 | { |
@@ -867,8 +867,8 @@ void lcd_remote_bitmap_part(const unsigned char *src, int src_x, int src_y, | |||
867 | 867 | ||
868 | bfunc = lcd_remote_blockfuncs[drawmode]; | 868 | bfunc = lcd_remote_blockfuncs[drawmode]; |
869 | mask = 0xFFu << (shift + src_y); | 869 | mask = 0xFFu << (shift + src_y); |
870 | mask_bottom = 0xFFu >> (7 - (ny & 7)); | 870 | mask_bottom = 0xFFu >> (~ny & 7); |
871 | 871 | ||
872 | if (shift == 0) | 872 | if (shift == 0) |
873 | { | 873 | { |
874 | bool copyopt = (drawmode == DRMODE_SOLID); | 874 | bool copyopt = (drawmode == DRMODE_SOLID); |
diff --git a/firmware/drivers/lcd-recorder.c b/firmware/drivers/lcd-recorder.c index b857708514..b0308c6c77 100644 --- a/firmware/drivers/lcd-recorder.c +++ b/firmware/drivers/lcd-recorder.c | |||
@@ -284,7 +284,7 @@ void lcd_blit(const unsigned char* data, int x, int by, int width, | |||
284 | 284 | ||
285 | /* Update the display. | 285 | /* Update the display. |
286 | This must be called after all other LCD functions that change the display. */ | 286 | This must be called after all other LCD functions that change the display. */ |
287 | void lcd_update(void) __attribute__ ((section (".icode"))); | 287 | void lcd_update(void) ICODE_ATTR; |
288 | void lcd_update(void) | 288 | void lcd_update(void) |
289 | { | 289 | { |
290 | int y; | 290 | int y; |
@@ -301,7 +301,7 @@ void lcd_update(void) | |||
301 | } | 301 | } |
302 | 302 | ||
303 | /* Update a fraction of the display. */ | 303 | /* Update a fraction of the display. */ |
304 | void lcd_update_rect(int, int, int, int) __attribute__ ((section (".icode"))); | 304 | void lcd_update_rect(int, int, int, int) ICODE_ATTR; |
305 | void lcd_update_rect(int x, int y, int width, int height) | 305 | void lcd_update_rect(int x, int y, int width, int height) |
306 | { | 306 | { |
307 | int ymax; | 307 | int ymax; |
@@ -396,56 +396,56 @@ lcd_pixelfunc_type* lcd_pixelfuncs[8] = { | |||
396 | }; | 396 | }; |
397 | 397 | ||
398 | static void flipblock(unsigned char *address, unsigned mask, unsigned bits) | 398 | static void flipblock(unsigned char *address, unsigned mask, unsigned bits) |
399 | __attribute__ ((section(".icode"))); | 399 | ICODE_ATTR; |
400 | static void flipblock(unsigned char *address, unsigned mask, unsigned bits) | 400 | static void flipblock(unsigned char *address, unsigned mask, unsigned bits) |
401 | { | 401 | { |
402 | *address ^= (bits & mask); | 402 | *address ^= bits & mask; |
403 | } | 403 | } |
404 | 404 | ||
405 | static void bgblock(unsigned char *address, unsigned mask, unsigned bits) | 405 | static void bgblock(unsigned char *address, unsigned mask, unsigned bits) |
406 | __attribute__ ((section(".icode"))); | 406 | ICODE_ATTR; |
407 | static void bgblock(unsigned char *address, unsigned mask, unsigned bits) | 407 | static void bgblock(unsigned char *address, unsigned mask, unsigned bits) |
408 | { | 408 | { |
409 | *address &= (bits | ~mask); | 409 | *address &= bits | ~mask; |
410 | } | 410 | } |
411 | 411 | ||
412 | static void fgblock(unsigned char *address, unsigned mask, unsigned bits) | 412 | static void fgblock(unsigned char *address, unsigned mask, unsigned bits) |
413 | __attribute__ ((section(".icode"))); | 413 | ICODE_ATTR; |
414 | static void fgblock(unsigned char *address, unsigned mask, unsigned bits) | 414 | static void fgblock(unsigned char *address, unsigned mask, unsigned bits) |
415 | { | 415 | { |
416 | *address |= (bits & mask); | 416 | *address |= bits & mask; |
417 | } | 417 | } |
418 | 418 | ||
419 | static void solidblock(unsigned char *address, unsigned mask, unsigned bits) | 419 | static void solidblock(unsigned char *address, unsigned mask, unsigned bits) |
420 | __attribute__ ((section(".icode"))); | 420 | ICODE_ATTR; |
421 | static void solidblock(unsigned char *address, unsigned mask, unsigned bits) | 421 | static void solidblock(unsigned char *address, unsigned mask, unsigned bits) |
422 | { | 422 | { |
423 | *address = (*address & ~mask) | (bits & mask); | 423 | *address = (*address & ~mask) | (bits & mask); |
424 | } | 424 | } |
425 | 425 | ||
426 | static void flipinvblock(unsigned char *address, unsigned mask, unsigned bits) | 426 | static void flipinvblock(unsigned char *address, unsigned mask, unsigned bits) |
427 | __attribute__ ((section(".icode"))); | 427 | ICODE_ATTR; |
428 | static void flipinvblock(unsigned char *address, unsigned mask, unsigned bits) | 428 | static void flipinvblock(unsigned char *address, unsigned mask, unsigned bits) |
429 | { | 429 | { |
430 | *address ^= (~bits & mask); | 430 | *address ^= ~bits & mask; |
431 | } | 431 | } |
432 | 432 | ||
433 | static void bginvblock(unsigned char *address, unsigned mask, unsigned bits) | 433 | static void bginvblock(unsigned char *address, unsigned mask, unsigned bits) |
434 | __attribute__ ((section(".icode"))); | 434 | ICODE_ATTR; |
435 | static void bginvblock(unsigned char *address, unsigned mask, unsigned bits) | 435 | static void bginvblock(unsigned char *address, unsigned mask, unsigned bits) |
436 | { | 436 | { |
437 | *address &= ~(bits & mask); | 437 | *address &= ~(bits & mask); |
438 | } | 438 | } |
439 | 439 | ||
440 | static void fginvblock(unsigned char *address, unsigned mask, unsigned bits) | 440 | static void fginvblock(unsigned char *address, unsigned mask, unsigned bits) |
441 | __attribute__ ((section(".icode"))); | 441 | ICODE_ATTR; |
442 | static void fginvblock(unsigned char *address, unsigned mask, unsigned bits) | 442 | static void fginvblock(unsigned char *address, unsigned mask, unsigned bits) |
443 | { | 443 | { |
444 | *address |= (~bits & mask); | 444 | *address |= ~bits & mask; |
445 | } | 445 | } |
446 | 446 | ||
447 | static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits) | 447 | static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits) |
448 | __attribute__ ((section(".icode"))); | 448 | ICODE_ATTR; |
449 | static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits) | 449 | static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits) |
450 | { | 450 | { |
451 | *address = (*address & ~mask) | (~bits & mask); | 451 | *address = (*address & ~mask) | (~bits & mask); |
@@ -611,7 +611,7 @@ void lcd_vline(int x, int y1, int y2) | |||
611 | dst = &lcd_framebuffer[y1>>3][x]; | 611 | dst = &lcd_framebuffer[y1>>3][x]; |
612 | ny = y2 - (y1 & ~7); | 612 | ny = y2 - (y1 & ~7); |
613 | mask = 0xFFu << (y1 & 7); | 613 | mask = 0xFFu << (y1 & 7); |
614 | mask_bottom = 0xFFu >> (7 - (ny & 7)); | 614 | mask_bottom = 0xFFu >> (~ny & 7); |
615 | 615 | ||
616 | for (; ny >= 8; ny -= 8) | 616 | for (; ny >= 8; ny -= 8) |
617 | { | 617 | { |
@@ -677,7 +677,7 @@ void lcd_fillrect(int x, int y, int width, int height) | |||
677 | dst = &lcd_framebuffer[y>>3][x]; | 677 | dst = &lcd_framebuffer[y>>3][x]; |
678 | ny = height - 1 + (y & 7); | 678 | ny = height - 1 + (y & 7); |
679 | mask = 0xFFu << (y & 7); | 679 | mask = 0xFFu << (y & 7); |
680 | mask_bottom = 0xFFu >> (7 - (ny & 7)); | 680 | mask_bottom = 0xFFu >> (~ny & 7); |
681 | 681 | ||
682 | for (; ny >= 8; ny -= 8) | 682 | for (; ny >= 8; ny -= 8) |
683 | { | 683 | { |
@@ -723,7 +723,7 @@ void lcd_fillrect(int x, int y, int width, int height) | |||
723 | /* Draw a partial bitmap */ | 723 | /* Draw a partial bitmap */ |
724 | void lcd_bitmap_part(const unsigned char *src, int src_x, int src_y, | 724 | void lcd_bitmap_part(const unsigned char *src, int src_x, int src_y, |
725 | int stride, int x, int y, int width, int height) | 725 | int stride, int x, int y, int width, int height) |
726 | __attribute__ ((section(".icode"))); | 726 | ICODE_ATTR; |
727 | void lcd_bitmap_part(const unsigned char *src, int src_x, int src_y, | 727 | void lcd_bitmap_part(const unsigned char *src, int src_x, int src_y, |
728 | int stride, int x, int y, int width, int height) | 728 | int stride, int x, int y, int width, int height) |
729 | { | 729 | { |
@@ -764,7 +764,7 @@ void lcd_bitmap_part(const unsigned char *src, int src_x, int src_y, | |||
764 | 764 | ||
765 | bfunc = lcd_blockfuncs[drawmode]; | 765 | bfunc = lcd_blockfuncs[drawmode]; |
766 | mask = 0xFFu << (shift + src_y); | 766 | mask = 0xFFu << (shift + src_y); |
767 | mask_bottom = 0xFFu >> (7 - (ny & 7)); | 767 | mask_bottom = 0xFFu >> (~ny & 7); |
768 | 768 | ||
769 | if (shift == 0) | 769 | if (shift == 0) |
770 | { | 770 | { |