Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ew2V1-0004wL-QN for qemu-devel@nongnu.org; Mon, 09 Jan 2006 14:16:11 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ew2Uz-0004w5-NE for qemu-devel@nongnu.org; Mon, 09 Jan 2006 14:16:11 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ew2Uz-0004w1-5b for qemu-devel@nongnu.org; Mon, 09 Jan 2006 14:16:09 -0500 Received: from [213.165.64.21] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.34) id 1Ew2XJ-0002yO-4g for qemu-devel@nongnu.org; Mon, 09 Jan 2006 14:18:33 -0500 Mime-Version: 1.0 (Apple Message framework v746.2) Content-Transfer-Encoding: 7bit Message-Id: Content-Type: text/plain; charset=US-ASCII From: Joachim Henke Date: Mon, 9 Jan 2006 20:01:10 +0100 Subject: [Qemu-devel] [patch] minimal PC speaker output Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Ok, although this ugly hack has nothing to do with real PC speaker emulation, it's probably the most portable way to have some noise anyway. I just post this for people (like me) who are missing their guest operating system beeps. For this case the patch below is "better than nothing" (c: Greets Jo. --- pc.c +++ pc.c @@ -276,6 +276,11 @@ static void speaker_ioport_write(void *opaque, uint32_t addr, uint32_t val) { + int spk_off = speaker_data_on ^ 1; + speaker_data_on = (val >> 1) & 1; pit_set_gate(pit, 2, val & 1); + /* ring terminal bell, if speaker is switched on */ + if (spk_off & speaker_data_on) + puts("*beep*\a"); } -- Joachim Henke http://he-jo.net/