summaryrefslogtreecommitdiff
path: root/apps/plugins/xworld/sys.c
diff options
context:
space:
mode:
authorMoshe Piekarski <dev.rockbox@melachim.net>2020-10-06 13:34:04 -0500
committerWilliam Wilgus <wilgus.william@gmail.com>2020-10-26 12:28:48 -0400
commit12f3ed1699d6bef25bed90ba95cbcc1a6bb4934a (patch)
treecb9850c2c4ea68b7acc816828c4d53dd7c8391f9 /apps/plugins/xworld/sys.c
parent5d5f8169b53fc989b456b0f0d7940bcf9415cbeb (diff)
downloadrockbox-12f3ed1699d6bef25bed90ba95cbcc1a6bb4934a.tar.gz
rockbox-12f3ed1699d6bef25bed90ba95cbcc1a6bb4934a.zip
make the plugin API frambuffer agnostic
Change-Id: I5abdc231093054c517ff53b9a456997e440e3f6e
Diffstat (limited to 'apps/plugins/xworld/sys.c')
-rw-r--r--apps/plugins/xworld/sys.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/apps/plugins/xworld/sys.c b/apps/plugins/xworld/sys.c
index db01dcc974..0bd1e0dc08 100644
--- a/apps/plugins/xworld/sys.c
+++ b/apps/plugins/xworld/sys.c
@@ -584,7 +584,7 @@ void sys_copyRect(struct System* sys, uint16_t x, uint16_t y, uint16_t w, uint16
584 struct bitmap out_bmp; 584 struct bitmap out_bmp;
585 out_bmp.width = LCD_WIDTH; 585 out_bmp.width = LCD_WIDTH;
586 out_bmp.height = LCD_HEIGHT; 586 out_bmp.height = LCD_HEIGHT;
587 out_bmp.data = (unsigned char*) rb->lcd_framebuffer; 587 out_bmp.data = (unsigned char*) *rb->lcd_framebuffer;
588 588
589#ifdef HAVE_LCD_COLOR 589#ifdef HAVE_LCD_COLOR
590 if(sys->settings.scaling_quality == 1) 590 if(sys->settings.scaling_quality == 1)
@@ -631,25 +631,25 @@ void sys_copyRect(struct System* sys, uint16_t x, uint16_t y, uint16_t w, uint16
631 { 631 {
632#ifdef HAVE_LCD_COLOR 632#ifdef HAVE_LCD_COLOR
633 int r, g, b; 633 int r, g, b;
634 fb_data pix = rb->lcd_framebuffer[y * LCD_WIDTH + x]; 634 fb_data pix = *rb->lcd_framebuffer[y * LCD_WIDTH + x];
635#if (LCD_DEPTH > 24) 635#if (LCD_DEPTH > 24)
636 r = 0xff - pix.r; 636 r = 0xff - pix.r;
637 g = 0xff - pix.g; 637 g = 0xff - pix.g;
638 b = 0xff - pix.b; 638 b = 0xff - pix.b;
639 rb->lcd_framebuffer[y * LCD_WIDTH + x] = (fb_data) { b, g, r, 255 }; 639 *rb->lcd_framebuffer[y * LCD_WIDTH + x] = (fb_data) { b, g, r, 255 };
640#elif (LCD_DEPTH == 24) 640#elif (LCD_DEPTH == 24)
641 r = 0xff - pix.r; 641 r = 0xff - pix.r;
642 g = 0xff - pix.g; 642 g = 0xff - pix.g;
643 b = 0xff - pix.b; 643 b = 0xff - pix.b;
644 rb->lcd_framebuffer[y * LCD_WIDTH + x] = (fb_data) { b, g, r }; 644 *rb->lcd_framebuffer[y * LCD_WIDTH + x] = (fb_data) { b, g, r };
645#else 645#else
646 r = RGB_UNPACK_RED (pix); 646 r = RGB_UNPACK_RED (pix);
647 g = RGB_UNPACK_GREEN(pix); 647 g = RGB_UNPACK_GREEN(pix);
648 b = RGB_UNPACK_BLUE (pix); 648 b = RGB_UNPACK_BLUE (pix);
649 rb->lcd_framebuffer[y * LCD_WIDTH + x] = LCD_RGBPACK(0xff - r, 0xff - g, 0xff - b); 649 *rb->lcd_framebuffer[y * LCD_WIDTH + x] = LCD_RGBPACK(0xff - r, 0xff - g, 0xff - b);
650#endif 650#endif
651#else 651#else
652 rb->lcd_framebuffer[y * LCD_WIDTH + x] = LCD_BRIGHTNESS(0xff - rb->lcd_framebuffer[y * LCD_WIDTH + x]); 652 *rb->lcd_framebuffer[y * LCD_WIDTH + x] = LCD_BRIGHTNESS(0xff - *rb->lcd_framebuffer[y * LCD_WIDTH + x]);
653#endif 653#endif
654 } 654 }
655 } 655 }
@@ -671,14 +671,14 @@ void sys_copyRect(struct System* sys, uint16_t x, uint16_t y, uint16_t w, uint16
671 if(prev_frames && orig_fb) 671 if(prev_frames && orig_fb)
672 { 672 {
673 673
674 rb->memcpy(orig_fb, rb->lcd_framebuffer, sizeof(fb_data) * LCD_WIDTH * LCD_HEIGHT); 674 rb->memcpy(orig_fb, *rb->lcd_framebuffer, sizeof(fb_data) * LCD_WIDTH * LCD_HEIGHT);
675 /* fancy useless slow motion blur */ 675 /* fancy useless slow motion blur */
676 for(int y = 0; y < LCD_HEIGHT; ++y) 676 for(int y = 0; y < LCD_HEIGHT; ++y)
677 { 677 {
678 for(int x = 0; x < LCD_WIDTH; ++x) 678 for(int x = 0; x < LCD_WIDTH; ++x)
679 { 679 {
680 int r, g, b; 680 int r, g, b;
681 fb_data pix = rb->lcd_framebuffer[y * LCD_WIDTH + x]; 681 fb_data pix = *rb->lcd_framebuffer[y * LCD_WIDTH + x];
682 r = RGB_UNPACK_RED (pix); 682 r = RGB_UNPACK_RED (pix);
683 g = RGB_UNPACK_GREEN(pix); 683 g = RGB_UNPACK_GREEN(pix);
684 b = RGB_UNPACK_BLUE (pix); 684 b = RGB_UNPACK_BLUE (pix);
@@ -695,7 +695,7 @@ void sys_copyRect(struct System* sys, uint16_t x, uint16_t y, uint16_t w, uint16
695 r /= (BLUR_FRAMES + 1) / 2 * (1 + BLUR_FRAMES + 1); 695 r /= (BLUR_FRAMES + 1) / 2 * (1 + BLUR_FRAMES + 1);
696 g /= (BLUR_FRAMES + 1) / 2 * (1 + BLUR_FRAMES + 1); 696 g /= (BLUR_FRAMES + 1) / 2 * (1 + BLUR_FRAMES + 1);
697 b /= (BLUR_FRAMES + 1) / 2 * (1 + BLUR_FRAMES + 1); 697 b /= (BLUR_FRAMES + 1) / 2 * (1 + BLUR_FRAMES + 1);
698 rb->lcd_framebuffer[y * LCD_WIDTH + x] = LCD_RGBPACK(r, g, b); 698 *rb->lcd_framebuffer[y * LCD_WIDTH + x] = LCD_RGBPACK(r, g, b);
699 } 699 }
700 } 700 }
701 prev_baseidx -= LCD_WIDTH * LCD_HEIGHT; 701 prev_baseidx -= LCD_WIDTH * LCD_HEIGHT;