From d8383fc2cefcadf462b76f7deb4ee2f9432e28e7 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 16 Apr 2010 08:58:28 +0000 Subject: [PATCH] snes_snd.c and mos6560.c assert fix (proper way this time) (no whatsnew) [Miodrag Milanovic] --- src/emu/sound/mos6560.c | 5 ++++- src/mame/audio/snes_snd.c | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/emu/sound/mos6560.c b/src/emu/sound/mos6560.c index 2c64c43f837..a5e1b353a54 100644 --- a/src/emu/sound/mos6560.c +++ b/src/emu/sound/mos6560.c @@ -125,6 +125,7 @@ INLINE mos6560_state *get_safe_token( running_device *device ) assert(device != NULL); assert(device->token != NULL); assert(device->type == SOUND); + assert(sound_get_type(device) == MOS656X); return (mos6560_state *)device->token; } @@ -132,7 +133,9 @@ INLINE mos6560_state *get_safe_token( running_device *device ) INLINE const mos6560_interface *get_interface( running_device *device ) { assert(device != NULL); - assert((device->type == SOUND)); + assert(device->type == SOUND); + assert(sound_get_type(device) == MOS656X); + return (const mos6560_interface *) device->baseconfig().static_config; } diff --git a/src/mame/audio/snes_snd.c b/src/mame/audio/snes_snd.c index 1c7acf84dd3..c21f704df67 100644 --- a/src/mame/audio/snes_snd.c +++ b/src/mame/audio/snes_snd.c @@ -234,8 +234,9 @@ struct _snes_sound_state INLINE snes_sound_state *get_safe_token( running_device *device ) { assert(device != NULL); - assert(device->token != NULL); - assert(device->type == SNES_SPC); + assert(device->token != NULL); + assert(device->type == SOUND); + assert(sound_get_type(device) == SNES_SPC); return (snes_sound_state *)device->token; }