summaryrefslogtreecommitdiff
path: root/hw/audio/gusemu_mixer.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2017-04-26 00:37:32 +0200
committerGerd Hoffmann <kraxel@redhat.com>2017-05-04 09:16:05 +0200
commit135f5ae1974ccd8e77f004924a5fe7168be1b9eb (patch)
treebb8f5597c370765440176172e123c80421513c99 /hw/audio/gusemu_mixer.c
parent4bf7792aaedc1f66f94e21c1bae91bb4d208a08d (diff)
downloadqemu-135f5ae1974ccd8e77f004924a5fe7168be1b9eb.tar.gz
audio: GUSsample is int16_t
Signed-off-by: Juan Quintela <quintela@redhat.com> Message-id: 20170425223739.6703-20-quintela@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/audio/gusemu_mixer.c')
-rw-r--r--hw/audio/gusemu_mixer.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/hw/audio/gusemu_mixer.c b/hw/audio/gusemu_mixer.c
index 981a9ae0d4..00b9861b92 100644
--- a/hw/audio/gusemu_mixer.c
+++ b/hw/audio/gusemu_mixer.c
@@ -28,13 +28,13 @@
#define GUSregb(position) (* (gusptr+(position)))
#define GUSregw(position) (*(uint16_t *) (gusptr+(position)))
-#define GUSregd(position) (*(GUSdword *)(gusptr+(position)))
+#define GUSregd(position) (*(uint16_t *)(gusptr+(position)))
#define GUSvoice(position) (*(uint16_t *)(voiceptr+(position)))
/* samples are always 16bit stereo (4 bytes each, first right then left interleaved) */
void gus_mixvoices(GUSEmuState * state, unsigned int playback_freq, unsigned int numsamples,
- GUSsample *bufferpos)
+ int16_t *bufferpos)
{
/* note that byte registers are stored in the upper half of each voice register! */
uint8_t *gusptr;
@@ -171,8 +171,8 @@ void gus_mixvoices(GUSEmuState * state, unsigned int playback_freq, unsigned int
}
/* mix samples into buffer */
- *(bufferpos + 2 * sample) += (GUSsample) ((sample1 * PanningPos) >> 4); /* right */
- *(bufferpos + 2 * sample + 1) += (GUSsample) ((sample1 * (15 - PanningPos)) >> 4); /* left */
+ *(bufferpos + 2 * sample) += (int16_t) ((sample1 * PanningPos) >> 4); /* right */
+ *(bufferpos + 2 * sample + 1) += (int16_t) ((sample1 * (15 - PanningPos)) >> 4); /* left */
}
/* write back voice and volume */
GUSvoice(wVSRCurrVol) = Volume32 / 32;