Skip to content

Commit

Permalink
Mikey core: fix mute flags being reset
Browse files Browse the repository at this point in the history
Previously it would reset the mute flags when resetting the chip.
They are kept now, as it is expected from all cores.
  • Loading branch information
ValleyBell committed Dec 25, 2023
1 parent 77c34eb commit e83cbc3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
16 changes: 12 additions & 4 deletions emu/cores/mikey.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ++)
Expand All @@ -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;
}
}

Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down
9 changes: 9 additions & 0 deletions player/vgmplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down

0 comments on commit e83cbc3

Please sign in to comment.