From nobody Tue Nov 4 21:44:01 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 153112294686239.0114891481569; Mon, 9 Jul 2018 00:55:46 -0700 (PDT) Received: from localhost ([::1]:39780 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcR1N-0005kG-S1 for importer@patchew.org; Mon, 09 Jul 2018 03:55:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44258) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcQq9-00053m-Fn for qemu-devel@nongnu.org; Mon, 09 Jul 2018 03:44:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fcQq7-0002E9-W0 for qemu-devel@nongnu.org; Mon, 09 Jul 2018 03:44:09 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:33577) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fcQq7-0002BA-7c; Mon, 09 Jul 2018 03:44:07 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 41PHQS4v8Yz9s2R; Mon, 9 Jul 2018 17:44:00 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1531122240; bh=Th6+ZBTQI1ljjatnqH4MUDQSIaTbOY3VOfkYpK4MM+4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p53pRXe+cHgvc9m69djBtnhFoicko0fjO47Q+KLNJeAQQorl1yaK9CRFCkSf3aHgs LInwg699IimvNXMs04xuA5VieiuSAr7OPQL1FYHOXE9rCgWrC33jsALrlIfbkUA1GP TLXDcD97kgsu1ErcZWRgV8fxNMobhgJleQfPjbQA= From: David Gibson To: peter.maydell@linaro.org Date: Mon, 9 Jul 2018 17:43:40 +1000 Message-Id: <20180709074350.27086-7-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180709074350.27086-1-david@gibson.dropbear.id.au> References: <20180709074350.27086-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 06/16] sm501: Implement negated destination raster operation mode X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sebastian Bauer , qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Sebastian Bauer Add support for the negated destination operation mode. This is used e.g. by AmigaOS for the INVERSEVID drawing mode. With this change, the cursor in the shell and non-immediate window adjustment are working now. Signed-off-by: BALATON Zoltan Signed-off-by: David Gibson --- hw/display/sm501.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/hw/display/sm501.c b/hw/display/sm501.c index d4878f01c0..0b44d95169 100644 --- a/hw/display/sm501.c +++ b/hw/display/sm501.c @@ -705,6 +705,8 @@ static void sm501_2d_operation(SM501State *s) uint32_t color =3D s->twoD_foreground; int format_flags =3D (s->twoD_stretch >> 20) & 0x3; int addressing =3D (s->twoD_stretch >> 16) & 0xF; + int rop_mode =3D (s->twoD_control >> 15) & 0x1; /* 1 for rop2, else ro= p3 */ + int rop =3D s->twoD_control & 0xFF; =20 /* get frame buffer info */ uint8_t *src =3D s->local_mem + (s->twoD_source_base & 0x03FFFFFF); @@ -729,6 +731,8 @@ static void sm501_2d_operation(SM501State *s) int y, x, index_d, index_s; = \ for (y =3D 0; y < operation_height; y++) { = \ for (x =3D 0; x < operation_width; x++) { = \ + _pixel_type val; = \ + = \ if (rtl) { = \ index_s =3D ((src_y - y) * src_width + src_x - x) * _b= pp; \ index_d =3D ((dst_y - y) * dst_width + dst_x - x) * _b= pp; \ @@ -736,7 +740,13 @@ static void sm501_2d_operation(SM501State *s) index_s =3D ((src_y + y) * src_width + src_x + x) * _b= pp; \ index_d =3D ((dst_y + y) * dst_width + dst_x + x) * _b= pp; \ } = \ - *(_pixel_type *)&dst[index_d] =3D *(_pixel_type *)&src[ind= ex_s];\ + if (rop_mode =3D=3D 1 && rop =3D=3D 5) { = \ + /* Invert dest */ = \ + val =3D ~*(_pixel_type *)&dst[index_d]; = \ + } else { = \ + val =3D *(_pixel_type *)&src[index_s]; = \ + } = \ + *(_pixel_type *)&dst[index_d] =3D val; = \ } = \ } = \ } --=20 2.17.1