summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-07-04 06:20:50 +0000
committerJens Arnold <amiconn@rockbox.org>2005-07-04 06:20:50 +0000
commitf89f011508c80985b4dfee4fcc296689c149b30f (patch)
tree4c09a16f8420504adb7195456052d51bb081b80d
parentc0e6ed6b66f31bb44c2f38afb85453a8389d4c34 (diff)
downloadrockbox-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
-rw-r--r--firmware/drivers/lcd-h100-remote.c42
-rw-r--r--firmware/drivers/lcd-recorder.c38
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
69unsigned char lcd_remote_framebuffer[LCD_REMOTE_HEIGHT/8][LCD_REMOTE_WIDTH] 69unsigned char lcd_remote_framebuffer[LCD_REMOTE_HEIGHT/8][LCD_REMOTE_WIDTH]
70 IDATA_ATTR; 70 IDATA_ATTR;
71 71
72static int drawmode = DRMODE_SOLID; 72static int drawmode = DRMODE_SOLID;
73static int xmargin = 0; 73static int xmargin = 0;
74static int ymargin = 0; 74static 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. */
383void lcd_remote_update(void) __attribute__ ((section (".icode"))); 383void lcd_remote_update(void) ICODE_ATTR;
384void lcd_remote_update(void) 384void 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. */
402void lcd_remote_update_rect(int, int, int, int) __attribute__ ((section (".icode"))); 402void lcd_remote_update_rect(int, int, int, int) ICODE_ATTR;
403void lcd_remote_update_rect(int x, int y, int width, int height) 403void 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
499static void flipblock(unsigned char *address, unsigned mask, unsigned bits) 499static void flipblock(unsigned char *address, unsigned mask, unsigned bits)
500 __attribute__ ((section(".icode"))); 500 ICODE_ATTR;
501static void flipblock(unsigned char *address, unsigned mask, unsigned bits) 501static void flipblock(unsigned char *address, unsigned mask, unsigned bits)
502{ 502{
503 *address ^= (bits & mask); 503 *address ^= bits & mask;
504} 504}
505 505
506static void bgblock(unsigned char *address, unsigned mask, unsigned bits) 506static void bgblock(unsigned char *address, unsigned mask, unsigned bits)
507 __attribute__ ((section(".icode"))); 507 ICODE_ATTR;
508static void bgblock(unsigned char *address, unsigned mask, unsigned bits) 508static void bgblock(unsigned char *address, unsigned mask, unsigned bits)
509{ 509{
510 *address &= (bits | ~mask); 510 *address &= bits | ~mask;
511} 511}
512 512
513static void fgblock(unsigned char *address, unsigned mask, unsigned bits) 513static void fgblock(unsigned char *address, unsigned mask, unsigned bits)
514 __attribute__ ((section(".icode"))); 514 ICODE_ATTR;
515static void fgblock(unsigned char *address, unsigned mask, unsigned bits) 515static void fgblock(unsigned char *address, unsigned mask, unsigned bits)
516{ 516{
517 *address |= (bits & mask); 517 *address |= bits & mask;
518} 518}
519 519
520static void solidblock(unsigned char *address, unsigned mask, unsigned bits) 520static void solidblock(unsigned char *address, unsigned mask, unsigned bits)
521 __attribute__ ((section(".icode"))); 521 ICODE_ATTR;
522static void solidblock(unsigned char *address, unsigned mask, unsigned bits) 522static 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
527static void flipinvblock(unsigned char *address, unsigned mask, unsigned bits) 527static void flipinvblock(unsigned char *address, unsigned mask, unsigned bits)
528 __attribute__ ((section(".icode"))); 528 ICODE_ATTR;
529static void flipinvblock(unsigned char *address, unsigned mask, unsigned bits) 529static void flipinvblock(unsigned char *address, unsigned mask, unsigned bits)
530{ 530{
531 *address ^= (~bits & mask); 531 *address ^= ~bits & mask;
532} 532}
533 533
534static void bginvblock(unsigned char *address, unsigned mask, unsigned bits) 534static void bginvblock(unsigned char *address, unsigned mask, unsigned bits)
535 __attribute__ ((section(".icode"))); 535 ICODE_ATTR;
536static void bginvblock(unsigned char *address, unsigned mask, unsigned bits) 536static void bginvblock(unsigned char *address, unsigned mask, unsigned bits)
537{ 537{
538 *address &= ~(bits & mask); 538 *address &= ~(bits & mask);
539} 539}
540 540
541static void fginvblock(unsigned char *address, unsigned mask, unsigned bits) 541static void fginvblock(unsigned char *address, unsigned mask, unsigned bits)
542 __attribute__ ((section(".icode"))); 542 ICODE_ATTR;
543static void fginvblock(unsigned char *address, unsigned mask, unsigned bits) 543static void fginvblock(unsigned char *address, unsigned mask, unsigned bits)
544{ 544{
545 *address |= (~bits & mask); 545 *address |= ~bits & mask;
546} 546}
547 547
548static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits) 548static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits)
549 __attribute__ ((section(".icode"))); 549 ICODE_ATTR;
550static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits) 550static 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 */
827void lcd_remote_bitmap_part(const unsigned char *src, int src_x, int src_y, 827void 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;
830void lcd_remote_bitmap_part(const unsigned char *src, int src_x, int src_y, 830void 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. */
287void lcd_update(void) __attribute__ ((section (".icode"))); 287void lcd_update(void) ICODE_ATTR;
288void lcd_update(void) 288void 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. */
304void lcd_update_rect(int, int, int, int) __attribute__ ((section (".icode"))); 304void lcd_update_rect(int, int, int, int) ICODE_ATTR;
305void lcd_update_rect(int x, int y, int width, int height) 305void 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
398static void flipblock(unsigned char *address, unsigned mask, unsigned bits) 398static void flipblock(unsigned char *address, unsigned mask, unsigned bits)
399 __attribute__ ((section(".icode"))); 399 ICODE_ATTR;
400static void flipblock(unsigned char *address, unsigned mask, unsigned bits) 400static void flipblock(unsigned char *address, unsigned mask, unsigned bits)
401{ 401{
402 *address ^= (bits & mask); 402 *address ^= bits & mask;
403} 403}
404 404
405static void bgblock(unsigned char *address, unsigned mask, unsigned bits) 405static void bgblock(unsigned char *address, unsigned mask, unsigned bits)
406 __attribute__ ((section(".icode"))); 406 ICODE_ATTR;
407static void bgblock(unsigned char *address, unsigned mask, unsigned bits) 407static void bgblock(unsigned char *address, unsigned mask, unsigned bits)
408{ 408{
409 *address &= (bits | ~mask); 409 *address &= bits | ~mask;
410} 410}
411 411
412static void fgblock(unsigned char *address, unsigned mask, unsigned bits) 412static void fgblock(unsigned char *address, unsigned mask, unsigned bits)
413 __attribute__ ((section(".icode"))); 413 ICODE_ATTR;
414static void fgblock(unsigned char *address, unsigned mask, unsigned bits) 414static void fgblock(unsigned char *address, unsigned mask, unsigned bits)
415{ 415{
416 *address |= (bits & mask); 416 *address |= bits & mask;
417} 417}
418 418
419static void solidblock(unsigned char *address, unsigned mask, unsigned bits) 419static void solidblock(unsigned char *address, unsigned mask, unsigned bits)
420 __attribute__ ((section(".icode"))); 420 ICODE_ATTR;
421static void solidblock(unsigned char *address, unsigned mask, unsigned bits) 421static 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
426static void flipinvblock(unsigned char *address, unsigned mask, unsigned bits) 426static void flipinvblock(unsigned char *address, unsigned mask, unsigned bits)
427 __attribute__ ((section(".icode"))); 427 ICODE_ATTR;
428static void flipinvblock(unsigned char *address, unsigned mask, unsigned bits) 428static void flipinvblock(unsigned char *address, unsigned mask, unsigned bits)
429{ 429{
430 *address ^= (~bits & mask); 430 *address ^= ~bits & mask;
431} 431}
432 432
433static void bginvblock(unsigned char *address, unsigned mask, unsigned bits) 433static void bginvblock(unsigned char *address, unsigned mask, unsigned bits)
434 __attribute__ ((section(".icode"))); 434 ICODE_ATTR;
435static void bginvblock(unsigned char *address, unsigned mask, unsigned bits) 435static void bginvblock(unsigned char *address, unsigned mask, unsigned bits)
436{ 436{
437 *address &= ~(bits & mask); 437 *address &= ~(bits & mask);
438} 438}
439 439
440static void fginvblock(unsigned char *address, unsigned mask, unsigned bits) 440static void fginvblock(unsigned char *address, unsigned mask, unsigned bits)
441 __attribute__ ((section(".icode"))); 441 ICODE_ATTR;
442static void fginvblock(unsigned char *address, unsigned mask, unsigned bits) 442static void fginvblock(unsigned char *address, unsigned mask, unsigned bits)
443{ 443{
444 *address |= (~bits & mask); 444 *address |= ~bits & mask;
445} 445}
446 446
447static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits) 447static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits)
448 __attribute__ ((section(".icode"))); 448 ICODE_ATTR;
449static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits) 449static 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 */
724void lcd_bitmap_part(const unsigned char *src, int src_x, int src_y, 724void 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;
727void lcd_bitmap_part(const unsigned char *src, int src_x, int src_y, 727void 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 {