Skip to content

Commit 5868034

Browse files
Allan Peramakikraxel
authored andcommitted
hw/audio/gus: Fix registers 32-bit access
Fix audio on software that accesses DRAM above 64k via register peek/poke and some cases when more than 16 voices are used. Cc: [email protected] Fixes: 135f5ae ("audio: GUSsample is int16_t") Signed-off-by: Allan Peramaki <[email protected]> Tested-by: Volker Rümelin <[email protected]> Reviewed-by: Volker Rümelin <[email protected]> Reviewed-by: Thomas Huth <[email protected]> Reviewed-by: Peter Maydell <[email protected]> Signed-off-by: Philippe Mathieu-Daudé <[email protected]> Message-id: [email protected] Message-Id: <[email protected]> [PMD: Removed unrelated style changes] Signed-off-by: Philippe Mathieu-Daudé <[email protected]> Signed-off-by: Gerd Hoffmann <[email protected]>
1 parent bc81e6e commit 5868034

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

hw/audio/gusemu_hal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
#define GUSregb(position) (* (gusptr+(position)))
3434
#define GUSregw(position) (*(uint16_t *) (gusptr+(position)))
35-
#define GUSregd(position) (*(uint16_t *)(gusptr+(position)))
35+
#define GUSregd(position) (*(uint32_t *)(gusptr + (position)))
3636

3737
/* size given in bytes */
3838
unsigned int gus_read(GUSEmuState * state, int port, int size)

hw/audio/gusemu_mixer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
#define GUSregb(position) (* (gusptr+(position)))
3030
#define GUSregw(position) (*(uint16_t *) (gusptr+(position)))
31-
#define GUSregd(position) (*(uint16_t *)(gusptr+(position)))
31+
#define GUSregd(position) (*(uint32_t *)(gusptr + (position)))
3232

3333
#define GUSvoice(position) (*(uint16_t *)(voiceptr+(position)))
3434

0 commit comments

Comments
 (0)