From nobody Tue Feb 10 09:57:52 2026 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; 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 1530697965596380.68667901412243; Wed, 4 Jul 2018 02:52:45 -0700 (PDT) Received: from localhost ([::1]:44958 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1faeSq-0002bV-VZ for importer@patchew.org; Wed, 04 Jul 2018 05:52:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57279) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1faeOo-0008D7-AQ for qemu-devel@nongnu.org; Wed, 04 Jul 2018 05:48:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1faeOj-0003v7-Do for qemu-devel@nongnu.org; Wed, 04 Jul 2018 05:48:34 -0400 Received: from zero.eik.bme.hu ([2001:738:2001:2001::2001]:46728) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1faeOj-0003uP-4J for qemu-devel@nongnu.org; Wed, 04 Jul 2018 05:48:29 -0400 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id 908BB7456CC; Wed, 4 Jul 2018 11:48:27 +0200 (CEST) Received: by zero.eik.bme.hu (Postfix, from userid 432) id 67C297456C9; Wed, 4 Jul 2018 11:48:27 +0200 (CEST) Message-Id: <5336b4402ad41f178a5a816129e563709923d73f.1530697258.git.balaton@eik.bme.hu> In-Reply-To: References: From: Sebastian Bauer Date: Wed, 04 Jul 2018 11:40:58 +0200 To: qemu-devel@nongnu.org X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:738:2001:2001::2001 Subject: [Qemu-devel] [PATCH v3 4/7] 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: Peter Maydell , Sebastian Bauer , Magnus Damm , Philippe Mathieu-Daude , Aurelien Jarno , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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 --- 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 d4878f0..0b44d95 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.7.6