aboutsummaryrefslogtreecommitdiff
path: root/hw/wm8750.c
diff options
context:
space:
mode:
authorbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-04-26 12:00:18 +0000
committerbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-04-26 12:00:18 +0000
commit662caa6f9197a4e0d5e64743f1078ddc82836852 (patch)
tree2b3092fd51c86201bfcfc1bbaed7d4cb76711ae5 /hw/wm8750.c
parentc21c583a1de9c1033252ef51929398ddc237a7c0 (diff)
Let WM8750 users write to audio buffer directly.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4254 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/wm8750.c')
-rw-r--r--hw/wm8750.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/hw/wm8750.c b/hw/wm8750.c
index c26961a2fc..4722e6c4a0 100644
--- a/hw/wm8750.c
+++ b/hw/wm8750.c
@@ -627,6 +627,24 @@ void wm8750_dac_dat(void *opaque, uint32_t sample)
wm8750_out_flush(s);
}
+void *wm8750_dac_buffer(void *opaque, int samples)
+{
+ struct wm8750_s *s = (struct wm8750_s *) opaque;
+ /* XXX: Should check if there are <i>samples</i> free samples available */
+ void *ret = s->data_out + s->idx_out;
+
+ s->idx_out += samples << 2;
+ s->req_out -= samples << 2;
+ return ret;
+}
+
+void wm8750_dac_commit(void *opaque)
+{
+ struct wm8750_s *s = (struct wm8750_s *) opaque;
+
+ return wm8750_out_flush(s);
+}
+
uint32_t wm8750_adc_dat(void *opaque)
{
struct wm8750_s *s = (struct wm8750_s *) opaque;