Merge pull request #2881 from Cacodemon345/mirosound_pcm10_opl4

OPTiMC: Fix OPL volume mixing
This commit is contained in:
Jasmine Iwanek
2022-11-20 03:14:31 -05:00
committed by GitHub
5 changed files with 38 additions and 0 deletions

View File

@@ -70,6 +70,16 @@ typedef struct optimc_t {
uint8_t regs[6];
} optimc_t, opti_82c929_t;
static void
optimc_filter_opl(void* priv, double* out_l, double* out_r)
{
optimc_t *optimc = (optimc_t *) priv;
if (optimc->cur_wss_enabled) {
ad1848_filter_aux2((void*)&optimc->ad1848, out_l, out_r);
}
}
static uint8_t
optimc_wss_read(uint16_t addr, void *priv)
{
@@ -365,6 +375,9 @@ optimc_init(const device_t *info)
sb_dsp_setdma8(&optimc->sb->dsp, optimc->cur_dma);
sb_ct1345_mixer_reset(optimc->sb);
optimc->sb->opl_mixer = optimc;
optimc->sb->opl_mix = optimc_filter_opl;
optimc->fm_type = (info->local & OPTIMC_OPL4) ? FM_YMF278B : FM_YMF262;
fm_driver_get(optimc->fm_type, &optimc->sb->opl);
io_sethandler(optimc->cur_addr + 0, 0x0004, optimc->sb->opl.read, NULL, NULL, optimc->sb->opl.write, NULL, NULL, optimc->sb->opl.priv);