From: Blue Swirl <blauwirbel@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [4937] Fix 24 bit mode
Date: Thu, 24 Jul 2008 11:26:39 +0000 [thread overview]
Message-ID: <E1KLyxz-0003S2-3m@cvs.savannah.gnu.org> (raw)
Revision: 4937
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4937
Author: blueswir1
Date: 2008-07-24 11:26:38 +0000 (Thu, 24 Jul 2008)
Log Message:
-----------
Fix 24 bit mode
Modified Paths:
--------------
trunk/hw/tcx.c
Modified: trunk/hw/tcx.c
===================================================================
--- trunk/hw/tcx.c 2008-07-24 11:25:30 UTC (rev 4936)
+++ trunk/hw/tcx.c 2008-07-24 11:26:38 UTC (rev 4937)
@@ -124,19 +124,34 @@
}
}
+/*
+ XXX Could be much more optimal:
+ * detect if line/page/whole screen is in 24 bit mode
+ * if destination is also BGR, use memcpy
+ */
static inline void tcx24_draw_line32(TCXState *s1, uint8_t *d,
const uint8_t *s, int width,
const uint32_t *cplane,
const uint32_t *s24)
{
- int x;
- uint8_t val;
+ int x, bgr, r, g, b;
+ uint8_t val, *p8;
uint32_t *p = (uint32_t *)d;
uint32_t dval;
+ bgr = s1->ds->bgr;
for(x = 0; x < width; x++, s++, s24++) {
- if ((bswap32(*cplane++) & 0xff000000) == 0x03000000) { // 24-bit direct
- dval = bswap32(*s24) & 0x00ffffff;
+ if ((be32_to_cpu(*cplane++) & 0xff000000) == 0x03000000) {
+ // 24-bit direct, BGR order
+ p8 = (uint8_t *)s24;
+ p8++;
+ b = *p8++;
+ g = *p8++;
+ r = *p8++;
+ if (bgr)
+ dval = rgb_to_pixel32bgr(r, g, b);
+ else
+ dval = rgb_to_pixel32(r, g, b);
} else {
val = *s;
dval = s1->palette[val];
reply other threads:[~2008-07-24 11:26 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1KLyxz-0003S2-3m@cvs.savannah.gnu.org \
--to=blauwirbel@gmail.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).