summaryrefslogtreecommitdiff
path: root/apps/plugins/xworld/sys.c
diff options
context:
space:
mode:
authorMarcin Bukat <marcin.bukat@gmail.com>2018-03-02 21:53:55 +0100
committerMarcin Bukat <marcin.bukat@gmail.com>2018-06-12 10:31:15 +0200
commitfbb6a2ff6d751adaaef73a86a98700f91571d0a1 (patch)
treee4bf533e945a03887620361ad110b3612321d67d /apps/plugins/xworld/sys.c
parent0538ba3d59a1a29adcee0b4656b204fda102ad89 (diff)
downloadrockbox-fbb6a2ff6d751adaaef73a86a98700f91571d0a1.zip
rockbox-fbb6a2ff6d751adaaef73a86a98700f91571d0a1.tar.gz
rockbox-fbb6a2ff6d751adaaef73a86a98700f91571d0a1.tar.bz2
rockbox-fbb6a2ff6d751adaaef73a86a98700f91571d0a1.tar.xz
Agptek Rocker: Build plugins
Patch provided by Aapo Tahkola. Change-Id: I37a42a950d78d6b8aa3927ec7aeb30030f7be7a5
Diffstat (limited to 'apps/plugins/xworld/sys.c')
-rw-r--r--apps/plugins/xworld/sys.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/apps/plugins/xworld/sys.c b/apps/plugins/xworld/sys.c
index a240c75..22fc92f 100644
--- a/apps/plugins/xworld/sys.c
+++ b/apps/plugins/xworld/sys.c
@@ -448,7 +448,11 @@ void sys_setPalette(struct System* sys, uint8_t start, uint8_t n, const uint8_t
uint8_t col = buf[i * 3 + j];
c[j] = (col << 2) | (col & 3);
}
-#if (LCD_DEPTH > 16) && (LCD_DEPTH <= 24)
+#if (LCD_DEPTH > 24)
+ sys->palette[i] = (fb_data) {
+ c[2], c[1], c[0], 255
+ };
+#elif (LCD_DEPTH > 16) && (LCD_DEPTH <= 24)
sys->palette[i] = (fb_data) {
c[2], c[1], c[0]
};
@@ -621,7 +625,12 @@ void sys_copyRect(struct System* sys, uint16_t x, uint16_t y, uint16_t w, uint16
#ifdef HAVE_LCD_COLOR
int r, g, b;
fb_data pix = rb->lcd_framebuffer[y * LCD_WIDTH + x];
-#if (LCD_DEPTH == 24)
+#if (LCD_DEPTH > 24)
+ r = 0xff - pix.r;
+ g = 0xff - pix.g;
+ b = 0xff - pix.b;
+ rb->lcd_framebuffer[y * LCD_WIDTH + x] = (fb_data) { b, g, r, 255 };
+#elif (LCD_DEPTH == 24)
r = 0xff - pix.r;
g = 0xff - pix.g;
b = 0xff - pix.b;