aboutsummaryrefslogtreecommitdiff
path: root/hw/tcx.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/tcx.c')
-rw-r--r--hw/tcx.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/hw/tcx.c b/hw/tcx.c
index 2c65a0568e..675c74d9fe 100644
--- a/hw/tcx.c
+++ b/hw/tcx.c
@@ -58,13 +58,22 @@ static void update_palette_entries(TCXState *s, int start, int end)
s->palette[i] = rgb_to_pixel8(s->r[i], s->g[i], s->b[i]);
break;
case 15:
- s->palette[i] = rgb_to_pixel15(s->r[i], s->g[i], s->b[i]);
+ if (s->ds->bgr)
+ s->palette[i] = rgb_to_pixel15bgr(s->r[i], s->g[i], s->b[i]);
+ else
+ s->palette[i] = rgb_to_pixel15(s->r[i], s->g[i], s->b[i]);
break;
case 16:
- s->palette[i] = rgb_to_pixel16(s->r[i], s->g[i], s->b[i]);
+ if (s->ds->bgr)
+ s->palette[i] = rgb_to_pixel16bgr(s->r[i], s->g[i], s->b[i]);
+ else
+ s->palette[i] = rgb_to_pixel16(s->r[i], s->g[i], s->b[i]);
break;
case 32:
- s->palette[i] = rgb_to_pixel32(s->r[i], s->g[i], s->b[i]);
+ if (s->ds->bgr)
+ s->palette[i] = rgb_to_pixel32bgr(s->r[i], s->g[i], s->b[i]);
+ else
+ s->palette[i] = rgb_to_pixel32(s->r[i], s->g[i], s->b[i]);
break;
}
}