[Core/Sound] fixed MAME YM2413 core EG behavior when SL = 0 (verified on YM2413 real hardware, cf. https://www.smspower.org/Development/YM2413ReverseEngineeringNotes2015-12-24)

This commit is contained in:
ekeeke 2021-04-24 10:47:25 +02:00
parent ca484e9c56
commit 1a1c2a1e63
5 changed files with 4 additions and 2 deletions

View File

@ -155,6 +155,7 @@ Genesis Plus GX 1.7.5 (xx/xx/xxxx) (Eke-Eke)
* fixed YM2413 EG resolution bits (verified on YM2413B die)
* fixed YM2413 EG dump rate (verified on YM2413 hardware)
* fixed YM2413 EG behavior for fastest attack rates (verified on YM2413 hardware)
* fixed YM2413 EG behavior when SL=0 (verified on YM2413 hardware)
[Gamecube/Wii]
---------------

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

@ -34,6 +34,7 @@ to do:
/** 2021/04/24: fixed EG resolution bits (verified on YM2413B die, cf. https://www.smspower.org/Development/YM2413ReverseEngineeringNotes2015-03-20) **/
/** 2021/04/24: fixed EG dump rate (verified on YM2413 real hardware, cf. https://www.smspower.org/Development/YM2413ReverseEngineeringNotes2015-12-31) **/
/** 2021/04/25: fixed EG behavior for fastest attack rates (verified on YM2413 real hardware, cf. https://www.smspower.org/Development/YM2413ReverseEngineeringNotes2017-01-26) **/
/** 2021/04/25: fixed EG behavior when SL = 0 (verified on YM2413 real hardware, cf. https://www.smspower.org/Development/YM2413ReverseEngineeringNotes2015-12-24) **/
#include "shared.h"
@ -595,7 +596,7 @@ INLINE void advance(void)
else
{
op->volume = MIN_ATT_INDEX;
op->state = EG_DEC;
op->state = (op->sl == MIN_ATT_INDEX) ? EG_SUS : EG_DEC; /* decay phase should not occur in case SL = 0 */
}
/*dump phase is performed by both operators in each channel*/
@ -617,7 +618,7 @@ INLINE void advance(void)
if (op->volume <= MIN_ATT_INDEX)
{
op->volume = MIN_ATT_INDEX;
op->state = EG_DEC;
op->state = (op->sl == MIN_ATT_INDEX) ? EG_SUS : EG_DEC; /* decay phase should not occur in case SL = 0 */
}
}
break;