From e83cbc3565c9f4341260c4814f10f80192fd017e Mon Sep 17 00:00:00 2001 From: Valley Bell Date: Mon, 25 Dec 2023 17:59:15 +0100 Subject: [PATCH] Mikey core: fix mute flags being reset Previously it would reset the mute flags when resetting the chip. They are kept now, as it is expected from all cores. --- emu/cores/mikey.c | 16 ++++++++++++---- player/vgmplayer.cpp | 9 +++++++++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/emu/cores/mikey.c b/emu/cores/mikey.c index 00f49f19..5e5ed8be 100644 --- a/emu/cores/mikey.c +++ b/emu/cores/mikey.c @@ -489,7 +489,16 @@ typedef struct #define MPAN 0x44 #define MSTEREO 0x50 +static void mikey_pimpl_reset( mikey_pimpl_t* mikey ); static void mikey_pimpl_MikeyPimpl( mikey_pimpl_t* mikey ) +{ + int i; + mikey_pimpl_reset(mikey); + for (i = 0; i < 4; i ++) + mikey->mMute[i] = false; +} + +static void mikey_pimpl_reset( mikey_pimpl_t* mikey ) { int i; for (i = 0; i < 4; i ++) @@ -502,7 +511,6 @@ static void mikey_pimpl_MikeyPimpl( mikey_pimpl_t* mikey ) { mikey->mAttenuationLeft[i] = 0x3c; mikey->mAttenuationRight[i] = 0x3c; - mikey->mMute[i] = false; } } @@ -646,8 +654,8 @@ static UINT8 mikey_start( const DEV_GEN_CFG* cfg, DEV_INFO* retDevInf ) if (mikey == NULL) return 0xFF; - //mikey_pimpl_MikeyPimpl( &mikey->mMikey ); - //mikey_action_queue_ActionQueue( &mikey->mQueue ); + mikey_pimpl_MikeyPimpl( &mikey->mMikey ); + mikey_action_queue_ActionQueue( &mikey->mQueue ); mikey->mSampleRate = cfg->smplRate; mikey->mTicksPerSample1 = 16000000 / mikey->mSampleRate; mikey->mTicksPerSample2 = 16000000 % mikey->mSampleRate; @@ -661,7 +669,7 @@ static UINT8 mikey_start( const DEV_GEN_CFG* cfg, DEV_INFO* retDevInf ) static void mikey_reset( void* info ) { mikey_t* mikey = (mikey_t*)info; - mikey_pimpl_MikeyPimpl( &mikey->mMikey ); + mikey_pimpl_reset( &mikey->mMikey ); mikey_action_queue_ActionQueue( &mikey->mQueue ); mikey->mTick = 0; mikey->mNextTick = 0; diff --git a/player/vgmplayer.cpp b/player/vgmplayer.cpp index ea4405a8..30b6771c 100644 --- a/player/vgmplayer.cpp +++ b/player/vgmplayer.cpp @@ -183,6 +183,15 @@ VGMPlayer::VGMPlayer() : else if (devID == DEVID_SCSP) devOpts.coreOpts = OPT_SCSP_BYPASS_DSP; _devOptMap[devID][chipID] = optID; + _optDevMap[optID] = (size_t)-1; + } + } + { + UINT8 vgmChip; + for (vgmChip = 0x00; vgmChip < _CHIP_COUNT; vgmChip ++) + { + for (chipID = 0; chipID < 2; chipID ++) + _vdDevMap[vgmChip][chipID] = (size_t)-1; } }