diff --git a/HISTORY.txt b/HISTORY.txt index e09dd8b..18c9a6d 100644 --- a/HISTORY.txt +++ b/HISTORY.txt @@ -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] --------------- diff --git a/builds/genesis_plus_gx_libretro.dll b/builds/genesis_plus_gx_libretro.dll index 14929c0..e21996a 100644 Binary files a/builds/genesis_plus_gx_libretro.dll and b/builds/genesis_plus_gx_libretro.dll differ diff --git a/builds/genplus_cube.dol b/builds/genplus_cube.dol index 5afd884..299fd95 100644 Binary files a/builds/genplus_cube.dol and b/builds/genplus_cube.dol differ diff --git a/builds/genplus_wii.dol b/builds/genplus_wii.dol index 1ca772f..5a19e29 100644 Binary files a/builds/genplus_wii.dol and b/builds/genplus_wii.dol differ diff --git a/core/sound/ym2413.c b/core/sound/ym2413.c index b5cae56..f18f58d 100644 --- a/core/sound/ym2413.c +++ b/core/sound/ym2413.c @@ -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;