[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [patch] minimal PC speaker output

From: Joachim Henke
Subject: [Qemu-devel] [patch] minimal PC speaker output
Date: Mon, 9 Jan 2006 20:01:10 +0100

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:


--- 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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]