summaryrefslogtreecommitdiff
path: root/apps/plugins/rockboy/lcd.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/rockboy/lcd.c')
-rw-r--r--apps/plugins/rockboy/lcd.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/apps/plugins/rockboy/lcd.c b/apps/plugins/rockboy/lcd.c
index 2dc983f812..e8d43f772a 100644
--- a/apps/plugins/rockboy/lcd.c
+++ b/apps/plugins/rockboy/lcd.c
@@ -19,7 +19,7 @@ struct scan scan IBSS_ATTR;
19#define BG (scan.bg) 19#define BG (scan.bg)
20#define WND (scan.wnd) 20#define WND (scan.wnd)
21 21
22#if LCD_DEPTH ==16 22#if LCD_DEPTH >= 16
23#define BUF (scan.buf) 23#define BUF (scan.buf)
24#else 24#else
25#define BUF (scan.buf[scanline_ind]) 25#define BUF (scan.buf[scanline_ind])
@@ -1154,6 +1154,7 @@ void set_pal(void)
1154static void updatepalette(int i) 1154static void updatepalette(int i)
1155{ 1155{
1156 int c, r, g, b; 1156 int c, r, g, b;
1157 fb_data px;
1157 1158
1158 c = (lcd.pal[i<<1] | ((int)lcd.pal[(i<<1)|1] << 8)) & 0x7FFF; 1159 c = (lcd.pal[i<<1] | ((int)lcd.pal[(i<<1)|1] << 8)) & 0x7FFF;
1159 r = (c & 0x001F) << 3; 1160 r = (c & 0x001F) << 3;
@@ -1167,18 +1168,16 @@ static void updatepalette(int i)
1167 g = (g >> fb.cc[1].r) << fb.cc[1].l; 1168 g = (g >> fb.cc[1].r) << fb.cc[1].l;
1168 b = (b >> fb.cc[2].r) << fb.cc[2].l; 1169 b = (b >> fb.cc[2].r) << fb.cc[2].l;
1169 1170
1170#if LCD_PIXELFORMAT == RGB565
1171 c = r|g|b; 1171 c = r|g|b;
1172#elif LCD_PIXELFORMAT == RGB565SWAPPED 1172
1173 c = swap16(r|g|b); 1173 px = FB_SCALARPACK_LCD(c);
1174#endif
1175 1174
1176 /* updatepalette might get called, but the pallete does not necessarily 1175 /* updatepalette might get called, but the pallete does not necessarily
1177 * need to be updated. 1176 * need to be updated.
1178 */ 1177 */
1179 if(PAL[i]!=c) 1178 if(memcmp(&PAL[i], &px, sizeof(fb_data)))
1180 { 1179 {
1181 PAL[i] = c; 1180 PAL[i] = px;
1182#if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256) 1181#if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256)
1183 rb->lcd_pal256_update_pal(PAL); 1182 rb->lcd_pal256_update_pal(PAL);
1184#endif 1183#endif
@@ -1256,4 +1255,3 @@ void lcd_reset(void)
1256 lcd_begin(); 1255 lcd_begin();
1257 vram_dirty(); 1256 vram_dirty();
1258} 1257}
1259