mirror of
https://github.com/holub/mame
synced 2025-06-05 12:26:35 +03:00
Device-ized the SID code
This commit is contained in:
parent
a427b077af
commit
f79b04bf0f
@ -12,12 +12,11 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
static SID6581 *get_sid(int indx)
|
static SID6581 *get_sid(const device_config *device)
|
||||||
{
|
{
|
||||||
return NULL;
|
assert(device != NULL);
|
||||||
// sound_type type = sndnum_to_sndti(indx, NULL);
|
assert((sound_get_type(device) == SOUND_SID6581) || (sound_get_type(device) == SOUND_SID8580));
|
||||||
// assert((type == SOUND_SID6581) || (type == SOUND_SID8580));
|
return (SID6581 *) device->token;
|
||||||
// return (SID6581 *) sndti_token(space->machine, type, indx);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -70,24 +69,15 @@ static DEVICE_START( sid8580 )
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
READ8_HANDLER ( sid6581_0_port_r )
|
READ8_DEVICE_HANDLER ( sid6581_r )
|
||||||
{
|
{
|
||||||
return sid6581_port_r(space->machine, get_sid(0), offset);
|
return sid6581_port_r(device->machine, get_sid(device), offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
READ8_HANDLER ( sid6581_1_port_r )
|
|
||||||
{
|
|
||||||
return sid6581_port_r(space->machine, get_sid(1), offset);
|
|
||||||
}
|
|
||||||
|
|
||||||
WRITE8_HANDLER ( sid6581_0_port_w )
|
WRITE8_DEVICE_HANDLER ( sid6581_w )
|
||||||
{
|
{
|
||||||
sid6581_port_w(get_sid(0), offset, data);
|
sid6581_port_w(get_sid(device), offset, data);
|
||||||
}
|
|
||||||
|
|
||||||
WRITE8_HANDLER ( sid6581_1_port_w )
|
|
||||||
{
|
|
||||||
sid6581_port_w(get_sid(1), offset, data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,10 +27,8 @@ struct _sid6581_interface
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
READ8_HANDLER ( sid6581_0_port_r );
|
READ8_DEVICE_HANDLER ( sid6581_r );
|
||||||
READ8_HANDLER ( sid6581_1_port_r );
|
WRITE8_DEVICE_HANDLER ( sid6581_w );
|
||||||
WRITE8_HANDLER ( sid6581_0_port_w );
|
|
||||||
WRITE8_HANDLER ( sid6581_1_port_w );
|
|
||||||
|
|
||||||
DEVICE_GET_INFO( sid6581 );
|
DEVICE_GET_INFO( sid6581 );
|
||||||
DEVICE_GET_INFO( sid8580 );
|
DEVICE_GET_INFO( sid8580 );
|
||||||
|
Loading…
Reference in New Issue
Block a user