diff options
| author | 2010-09-17 14:34:03 +0000 | |
|---|---|---|
| committer | 2010-09-17 14:34:03 +0000 | |
| commit | 1ab324aebed44bf0b1509d0bfc20733fc0b0a60a (patch) | |
| tree | aa5899f9012ad600f001dee1f770f53b4971cf0f | |
| parent | 1a066df97d68010ec0b332c696ead694dea51d0f (diff) | |
Added a function to change the MSM5205 frequency dynamically [Angelo Salese]
| -rw-r--r-- | src/emu/sound/msm5205.c | 9 | ||||
| -rw-r--r-- | src/emu/sound/msm5205.h | 2 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/emu/sound/msm5205.c b/src/emu/sound/msm5205.c index 7ce72505348..afbaf3c3e00 100644 --- a/src/emu/sound/msm5205.c +++ b/src/emu/sound/msm5205.c @@ -298,7 +298,16 @@ void msm5205_set_volume(running_device *device,int volume) stream_set_output_gain(voice->stream,0,volume / 100.0); } +void msm5205_change_clock_w(running_device *device, INT32 clock) +{ + msm5205_state *voice = get_safe_token(device); + attotime period; + voice->clock = clock; + + period = attotime_mul(ATTOTIME_IN_HZ(voice->clock), voice->prescaler); + timer_adjust_periodic(voice->timer, period, 0, period); +} /************************************************************************** diff --git a/src/emu/sound/msm5205.h b/src/emu/sound/msm5205.h index fe9114cfd19..e89ee41cc30 100644 --- a/src/emu/sound/msm5205.h +++ b/src/emu/sound/msm5205.h @@ -38,6 +38,8 @@ void msm5205_playmode_w(running_device *device, int _select); void msm5205_set_volume(running_device *device,int volume); +void msm5205_change_clock_w(running_device *device, INT32 clock); + DECLARE_LEGACY_SOUND_DEVICE(MSM5205, msm5205); #endif /* __MSM5205_H__ */ |
