From 2341b28c7f4cb222dededb44a69873e9ce57f315 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Fri, 1 Mar 2024 01:58:48 +0600 Subject: [PATCH] Add FM_ESFM type --- src/include/86box/snd_opl.h | 6 +++++- src/sound/snd_opl.c | 5 +++++ src/sound/snd_opl_esfm.c | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/include/86box/snd_opl.h b/src/include/86box/snd_opl.h index 0d89589c4..441e2a119 100644 --- a/src/include/86box/snd_opl.h +++ b/src/include/86box/snd_opl.h @@ -22,7 +22,8 @@ enum fm_type { FM_YMF262 = 1, /* OPL3 */ FM_YMF289B = 2, /* OPL3-L */ FM_YMF278B = 3, /* OPL 4 */ - FM_MAX = 4 + FM_ESFM = 4, /* ESFM */ + FM_MAX = 5 }; enum fm_driver { @@ -45,6 +46,7 @@ extern uint8_t fm_driver_get(int chip_id, fm_drv_t *drv); extern const fm_drv_t nuked_opl_drv; extern const fm_drv_t ymfm_drv; +extern const fm_drv_t esfmu_opl_drv; #ifdef EMU_DEVICE_H extern const device_t ym3812_nuked_device; @@ -54,6 +56,8 @@ extern const device_t ym3812_ymfm_device; extern const device_t ymf262_ymfm_device; extern const device_t ymf289b_ymfm_device; extern const device_t ymf278b_ymfm_device; + +extern const device_t esfm_esfmu_device; #endif #endif /*SOUND_OPL_H*/ diff --git a/src/sound/snd_opl.c b/src/sound/snd_opl.c index 21cc66f04..d98b3ccc2 100644 --- a/src/sound/snd_opl.c +++ b/src/sound/snd_opl.c @@ -68,6 +68,11 @@ fm_driver_get(int chip_id, fm_drv_t *drv) *drv = ymfm_drv; drv->priv = device_add_inst(&ymf278b_ymfm_device, fm_dev_inst[fm_driver][chip_id]++); break; + + case FM_ESFM: + *drv = esfmu_opl_drv; + drv->priv = device_add_inst(&esfm_esfmu_device, fm_dev_inst[fm_driver][chip_id]++); + break; default: return 0; diff --git a/src/sound/snd_opl_esfm.c b/src/sound/snd_opl_esfm.c index 47796a911..d8e350418 100644 --- a/src/sound/snd_opl_esfm.c +++ b/src/sound/snd_opl_esfm.c @@ -202,7 +202,7 @@ const device_t esfm_esfmu_device = { .name = "ESS Technology ESFM (ESFMu)", .internal_name = "esfm_esfmu", .flags = 0, - .local = 0, + .local = FM_ESFM, .init = esfm_drv_init, .close = esfm_drv_close, .reset = NULL,