All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Volker Rümelin" <vr_qemu@t-online.de>
To: Allan Peramaki <aperamak@pp1.inet.fi>, kraxel@redhat.com
Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [PATCH] hw/audio/gus: Fix registers 32-bit access
Date: Wed, 17 Jun 2020 21:58:43 +0200	[thread overview]
Message-ID: <a41528cf-1743-e580-8ec5-32614f4b655f@t-online.de> (raw)
In-Reply-To: <20200615201757.16868-1-aperamak@pp1.inet.fi>

> Fix audio on software that accesses DRAM above 64k via register peek/poke
> and some cases when more than 16 voices are used.
>
> Fixes: 135f5ae1974c ("audio: GUSsample is int16_t")
> Signed-off-by: Allan Peramaki <aperamak@pp1.inet.fi>
> ---
>  hw/audio/gusemu_hal.c   | 6 +++---
>  hw/audio/gusemu_mixer.c | 8 ++++----
>  2 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/hw/audio/gusemu_hal.c b/hw/audio/gusemu_hal.c
> index ae40ca341c..e35e941926 100644
> --- a/hw/audio/gusemu_hal.c
> +++ b/hw/audio/gusemu_hal.c
> @@ -30,9 +30,9 @@
>  #include "gustate.h"
>  #include "gusemu.h"
>  
> -#define GUSregb(position) (*            (gusptr+(position)))
> -#define GUSregw(position) (*(uint16_t *) (gusptr+(position)))
> -#define GUSregd(position) (*(uint16_t *)(gusptr+(position)))
> +#define GUSregb(position) (*(gusptr + (position)))
> +#define GUSregw(position) (*(uint16_t *)(gusptr + (position)))
> +#define GUSregd(position) (*(uint32_t *)(gusptr + (position)))
>  
>  /* size given in bytes */
>  unsigned int gus_read(GUSEmuState * state, int port, int size)
> diff --git a/hw/audio/gusemu_mixer.c b/hw/audio/gusemu_mixer.c
> index 00b9861b92..3b39254518 100644
> --- a/hw/audio/gusemu_mixer.c
> +++ b/hw/audio/gusemu_mixer.c
> @@ -26,11 +26,11 @@
>  #include "gusemu.h"
>  #include "gustate.h"
>  
> -#define GUSregb(position)  (*            (gusptr+(position)))
> -#define GUSregw(position)  (*(uint16_t *) (gusptr+(position)))
> -#define GUSregd(position)  (*(uint16_t *)(gusptr+(position)))
> +#define GUSregb(position)  (*(gusptr + (position)))
> +#define GUSregw(position)  (*(uint16_t *)(gusptr + (position)))
> +#define GUSregd(position)  (*(uint32_t *)(gusptr + (position)))
>  
> -#define GUSvoice(position) (*(uint16_t *)(voiceptr+(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,

With this patch I can hear the sound effects of DOOM Shareware in a FreeDOS 1.2 guest with a GUS audio device.

Reviewed-by: Volker Rümelin <vr_qemu@t-online.de>


  reply	other threads:[~2020-06-17 19:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-15 20:17 [PATCH] hw/audio/gus: Fix registers 32-bit access Allan Peramaki
2020-06-17 19:58 ` Volker Rümelin [this message]
2020-06-17 20:23 ` Peter Maydell
2020-06-17 22:25   ` Allan Peramaki
2020-06-17 23:10     ` Allan Peramaki
2020-06-18  4:57     ` Thomas Huth
2020-06-18  9:13     ` Peter Maydell
2020-06-18 10:22   ` Philippe Mathieu-Daudé
2020-06-18 10:23     ` Peter Maydell
2020-06-18 10:35       ` Philippe Mathieu-Daudé
2020-06-18  4:59 ` Thomas Huth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a41528cf-1743-e580-8ec5-32614f4b655f@t-online.de \
    --to=vr_qemu@t-online.de \
    --cc=aperamak@pp1.inet.fi \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.