summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2010-04-16 08:58:28 +0000
committer Miodrag Milanovic <mmicko@gmail.com>2010-04-16 08:58:28 +0000
commitd8383fc2cefcadf462b76f7deb4ee2f9432e28e7 (patch)
tree8f03e005d4ce0dfb7b39656c3e97e86dcf686e80 /src
parentcb8e95bd9fd97159da70999811a515f9db1ba911 (diff)
snes_snd.c and mos6560.c assert fix (proper way this time) (no whatsnew) [Miodrag Milanovic]
Diffstat (limited to 'src')
-rw-r--r--src/emu/sound/mos6560.c5
-rw-r--r--src/mame/audio/snes_snd.c5
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;
}