aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-11-09 23:09:44 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-11-09 23:09:44 +0000
commitfb065187e4ee9e0d1709b344ec01bb426ff1e43b (patch)
treeca7bf5ed6f0731429b9f9b6d62f2993583c9bcfb /hw
parentbf71c9d9b64a70e56db351c38ff71e5e27d871e7 (diff)
audio clean up (initial patch by malc)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1131 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw')
-rw-r--r--hw/adlib.c8
-rw-r--r--hw/pc.c13
-rw-r--r--hw/sb16.c20
3 files changed, 31 insertions, 10 deletions
diff --git a/hw/adlib.c b/hw/adlib.c
index a49b32b53d..939a7ed036 100644
--- a/hw/adlib.c
+++ b/hw/adlib.c
@@ -23,8 +23,12 @@
*/
#include "vl.h"
-#define AUDIO_CAP "adlib"
-#include "audio/audio.h"
+#define dolog(...) AUD_log ("adlib", __VA_ARGS__)
+#ifdef DEBUG
+#define ldebug(...) dolog (__VA_ARGS__)
+#else
+#define ldebug(...)
+#endif
#ifdef USE_YMF262
#define HAS_YMF262 1
diff --git a/hw/pc.c b/hw/pc.c
index fbcd969802..06ec7b1b69 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -555,8 +555,19 @@ void pc_init(int ram_size, int vga_ram_size, int boot_device,
DMA_init(0);
if (audio_enabled) {
- /* no audio supported yet for win32 */
AUD_init();
+#ifdef USE_SB16
+ if (sb16_enabled)
+ SB16_init ();
+#endif
+#ifdef CONFIG_ADLIB
+ if (adlib_enabled)
+ Adlib_init ();
+#endif
+#ifdef USE_GUS
+ if (gus_enabled)
+ GUS_init ();
+#endif
}
floppy_controller = fdctrl_init(6, 2, 0, 0x3f0, fd_table);
diff --git a/hw/sb16.c b/hw/sb16.c
index d9320566ab..a94e6899e9 100644
--- a/hw/sb16.c
+++ b/hw/sb16.c
@@ -23,12 +23,16 @@
*/
#include "vl.h"
-/* #define DEBUG */
-#define AUDIO_CAP "sb16"
-#include "audio/audio.h"
-
#define LENOFA(a) ((int) (sizeof(a)/sizeof(a[0])))
+#define dolog(...) AUD_log ("sb16", __VA_ARGS__)
+#ifdef DEBUG
+#define ldebug(...) dolog (__VA_ARGS__)
+#else
+#define ldebug(...)
+#endif
+
+/* #define DEBUG */
/* #define DEBUG_SB16_MOST */
#define IO_READ_PROTO(name) \
@@ -511,7 +515,7 @@ static void command (SB16State *s, uint8_t cmd)
return;
warn:
- dolog ("warning command %#x,%d is not trully understood yet\n",
+ dolog ("warning: command %#x,%d is not trully understood yet\n",
cmd, s->needed_bytes);
s->cmd = cmd;
return;
@@ -1172,8 +1176,10 @@ static int SB_load (QEMUFile *f, void *opaque, int version_id)
qemu_get_be32s (f, &s->mixer_nreg);
qemu_get_buffer (f, s->mixer_regs, 256);
- if (s->voice)
- AUD_reset (s->voice);
+ if (s->voice) {
+ AUD_close (s->voice);
+ s->voice = NULL;
+ }
if (s->dma_running) {
if (s->freq)