summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/sound/ymf262.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/sound/ymf262.cpp')
-rw-r--r--src/devices/sound/ymf262.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/devices/sound/ymf262.cpp b/src/devices/sound/ymf262.cpp
index f69c15da9d4..666e377d5a8 100644
--- a/src/devices/sound/ymf262.cpp
+++ b/src/devices/sound/ymf262.cpp
@@ -1401,6 +1401,15 @@ static void OPL3_initalize(OPL3 *chip)
}
+static void OPL3_clock_changed(OPL3 *chip, int clock, int rate)
+{
+ chip->clock = clock;
+ chip->rate = rate;
+
+ /* init global tables */
+ OPL3_initalize(chip);
+}
+
static inline void FM_KEYON(OPL3_SLOT *SLOT, uint32_t key_set)
{
if( !SLOT->key )
@@ -2360,11 +2369,7 @@ static OPL3 *OPL3Create(device_t *device, int clock, int rate, int type)
chip->device = device;
chip->type = type;
- chip->clock = clock;
- chip->rate = rate;
-
- /* init global tables */
- OPL3_initalize(chip);
+ OPL3_clock_changed(chip, clock, rate);
/* reset chip */
OPL3ResetChip(chip);
@@ -2531,6 +2536,11 @@ void * ymf262_init(device_t *device, int clock, int rate)
return chip;
}
+void ymf262_clock_changed(void *chip, int clock, int rate)
+{
+ OPL3_clock_changed((OPL3 *)chip, clock, rate);
+}
+
void ymf262_post_load(void *chip) {
OPL3 *opl3 = (OPL3 *)chip;
for (int ch=0; ch<18; ch++) {