[Core/Sound] fixed edge case in MAME YM2413 core when Key-Off occurs with envelope already off

This commit is contained in:
ekeeke 2022-02-13 23:16:44 +01:00
parent 17cbc63a10
commit 4a899e8262
4 changed files with 2 additions and 3 deletions

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 MiB

After

Width:  |  Height:  |  Size: 3.8 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 MiB

After

Width:  |  Height:  |  Size: 4.0 MiB

View File

@ -1208,9 +1208,8 @@ INLINE void KEY_OFF(YM2413_OPLL_SLOT *SLOT, UINT32 key_clr)
if( !SLOT->key )
{
/* phase -> Release */
if (SLOT->state>EG_REL)
SLOT->state = EG_REL;
/* phase -> Release (forced off if already at maximal attenuation level) */
SLOT->state = ( (SLOT->volume & ~3) == (MAX_ATT_INDEX & ~3) ) ? EG_OFF : EG_REL;
}
}
}