]> git.proxmox.com Git - qemu.git/blobdiff - hw/lm4549.c
moxie: configure with default-configs file
[qemu.git] / hw / lm4549.c
index 4d5b83125f3545e4644d1e4de26bb707c4bbd6b4..67335cba615b3af24de97bab7c303005d2e51cce 100644 (file)
@@ -4,7 +4,7 @@
  * Copyright (c) 2011
  * Written by Mathieu Sonet - www.elasticsheep.com
  *
- * This code is licenced under the GPL.
+ * This code is licensed under the GPL.
  *
  * *****************************************************************
  *
@@ -13,9 +13,9 @@
  * It supports only one playback voice and no record voice.
  */
 
-#include "hw.h"
+#include "hw/hw.h"
 #include "audio/audio.h"
-#include "lm4549.h"
+#include "hw/lm4549.h"
 
 #if 0
 #define LM4549_DEBUG  1
@@ -150,7 +150,7 @@ static void lm4549_audio_out_callback(void *opaque, int free)
     }
 }
 
-uint32_t lm4549_read(lm4549_state *s, target_phys_addr_t offset)
+uint32_t lm4549_read(lm4549_state *s, hwaddr offset)
 {
     uint16_t *regfile = s->regfile;
     uint32_t value = 0;
@@ -165,7 +165,7 @@ uint32_t lm4549_read(lm4549_state *s, target_phys_addr_t offset)
 }
 
 void lm4549_write(lm4549_state *s,
-                  target_phys_addr_t offset, uint32_t value)
+                  hwaddr offset, uint32_t value)
 {
     uint16_t *regfile = s->regfile;
 
@@ -224,7 +224,7 @@ uint32_t lm4549_write_samples(lm4549_state *s, uint32_t left, uint32_t right)
        This model supports 16-bit playback.
     */
 
-    if (s->buffer_level >= LM4549_BUFFER_SIZE) {
+    if (s->buffer_level > LM4549_BUFFER_SIZE - 2) {
         DPRINTF("write_sample Buffer full\n");
         return 0;
     }