diff options
Diffstat (limited to 'src/emu/sound/sn76496.c')
-rw-r--r-- | src/emu/sound/sn76496.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/emu/sound/sn76496.c b/src/emu/sound/sn76496.c index 729c79b7a89..408c2b2b3e8 100644 --- a/src/emu/sound/sn76496.c +++ b/src/emu/sound/sn76496.c @@ -138,17 +138,15 @@ struct _sn76496_state INLINE sn76496_state *get_safe_token(running_device *device) { assert(device != NULL); - assert(device->token != NULL); - assert(device->type == SOUND); - assert(sound_get_type(device) == SOUND_SN76496 || - sound_get_type(device) == SOUND_SN76489 || - sound_get_type(device) == SOUND_SN76489A || - sound_get_type(device) == SOUND_SN76494 || - sound_get_type(device) == SOUND_SN94624 || - sound_get_type(device) == SOUND_NCR7496 || - sound_get_type(device) == SOUND_GAMEGEAR || - sound_get_type(device) == SOUND_SMSIII); - return (sn76496_state *)device->token; + assert(device->type() == SOUND_SN76496 || + device->type() == SOUND_SN76489 || + device->type() == SOUND_SN76489A || + device->type() == SOUND_SN76494 || + device->type() == SOUND_SN94624 || + device->type() == SOUND_NCR7496 || + device->type() == SOUND_GAMEGEAR || + device->type() == SOUND_SMSIII); + return (sn76496_state *)downcast<legacy_device_base *>(device)->token(); } READ8_DEVICE_HANDLER( sn76496_ready_r ) @@ -346,7 +344,7 @@ static void SN76496_set_gain(sn76496_state *R,int gain) static int SN76496_init(running_device *device, sn76496_state *R, int stereo) { - int sample_rate = device->clock/2; + int sample_rate = device->clock()/2; int i; R->Channel = stream_create(device,0,(stereo?2:1),sample_rate,R,SN76496Update); |