From patchwork Thu Jan 22 11:40:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 431783 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id DBA49140111 for ; Thu, 22 Jan 2015 22:42:45 +1100 (AEDT) Received: from localhost ([::1]:52533 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEG9s-0004Iw-5e for incoming@patchwork.ozlabs.org; Thu, 22 Jan 2015 06:42:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48891) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEG8Q-0002VZ-O7 for qemu-devel@nongnu.org; Thu, 22 Jan 2015 06:41:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YEG8N-0000SY-H9 for qemu-devel@nongnu.org; Thu, 22 Jan 2015 06:41:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42999) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEG8N-0000SQ-8s; Thu, 22 Jan 2015 06:41:11 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t0MBejdP013983 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 22 Jan 2015 06:40:45 -0500 Received: from nilsson.home.kraxel.org (ovpn-116-36.ams2.redhat.com [10.36.116.36]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t0MBeixx007082; Thu, 22 Jan 2015 06:40:45 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 7AA1080776; Thu, 22 Jan 2015 12:40:43 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Thu, 22 Jan 2015 12:40:41 +0100 Message-Id: <1421926841-22510-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1421926841-22510-1-git-send-email-kraxel@redhat.com> References: <1421926841-22510-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Paolo Bonzini , "Vassili Karpov \(malc\)" , Gerd Hoffmann , qemu-stable@nongnu.org Subject: [Qemu-devel] [PULL 1/1] sb16: fix interrupt acknowledgement X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Paolo Bonzini SoundBlaster 16 emulation is very broken and consumes a lot of CPU, but a small fix was suggested offlist and it is enough to fix some games. I got Epic Pinball to work with the "SoundBlaster Clone" option. The processing of the interrupt register is wrong due to two missing "not"s. This causes the interrupt flag to remain set even after the Acknowledge ports have been read (0x0e and 0x0f). The line was introduced by commit 85571bc (audio merge (malc), 2004-11-07), but the code might have been broken before because I did not look closely at the huge patches from 10 years ago. Reported-by: Joshua Bair Cc: Gerd Hoffmann Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini Signed-off-by: Gerd Hoffmann --- hw/audio/sb16.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/audio/sb16.c b/hw/audio/sb16.c index bda26d0..444eb9e 100644 --- a/hw/audio/sb16.c +++ b/hw/audio/sb16.c @@ -999,7 +999,7 @@ static IO_READ_PROTO (dsp_read) retval = (!s->out_data_len || s->highspeed) ? 0 : 0x80; if (s->mixer_regs[0x82] & 1) { ack = 1; - s->mixer_regs[0x82] &= 1; + s->mixer_regs[0x82] &= ~1; qemu_irq_lower (s->pic); } break; @@ -1008,7 +1008,7 @@ static IO_READ_PROTO (dsp_read) retval = 0xff; if (s->mixer_regs[0x82] & 2) { ack = 1; - s->mixer_regs[0x82] &= 2; + s->mixer_regs[0x82] &= ~2; qemu_irq_lower (s->pic); } break;