Skip to content

Commit

Permalink
gus: clean up MemoryRegionPortio
Browse files Browse the repository at this point in the history
Remove 16-bit reads/writes, since ioport.c is able to synthesize them.
Remove the two MIDI registers (0x300 and 0x301) from gus_portio_list1,
and add the second MIDI register (0x301) to gus_portio_list2.

Tested with Second Reality.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
bonzini committed Apr 27, 2015
1 parent 3337d0b commit 54da54e
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions hw/audio/gus.c
Expand Up @@ -71,27 +71,13 @@ IO_READ_PROTO (gus_readb)
return gus_read (&s->emu, nport, 1);
}

IO_READ_PROTO (gus_readw)
{
GUSState *s = opaque;

return gus_read (&s->emu, nport, 2);
}

IO_WRITE_PROTO (gus_writeb)
{
GUSState *s = opaque;

gus_write (&s->emu, nport, 1, val);
}

IO_WRITE_PROTO (gus_writew)
{
GUSState *s = opaque;

gus_write (&s->emu, nport, 2, val);
}

static int write_audio (GUSState *s, int samples)
{
int net = 0;
Expand Down Expand Up @@ -236,17 +222,13 @@ static const VMStateDescription vmstate_gus = {

static const MemoryRegionPortio gus_portio_list1[] = {
{0x000, 1, 1, .write = gus_writeb },
{0x000, 1, 2, .write = gus_writew },
{0x006, 10, 1, .read = gus_readb, .write = gus_writeb },
{0x006, 10, 2, .read = gus_readw, .write = gus_writew },
{0x100, 8, 1, .read = gus_readb, .write = gus_writeb },
{0x100, 8, 2, .read = gus_readw, .write = gus_writew },
PORTIO_END_OF_LIST (),
};

static const MemoryRegionPortio gus_portio_list2[] = {
{0, 1, 1, .read = gus_readb },
{0, 1, 2, .read = gus_readw },
{0, 2, 1, .read = gus_readb },
PORTIO_END_OF_LIST (),
};

Expand Down

0 comments on commit 54da54e

Please sign in to comment.