[Core/Sound] fixed Nuked YM2413 core attack phase rates 11.1 to 11.3 (cf. https://github.com/nukeykt/Nuked-OPLL/issues/6)

This commit is contained in:
ekeeke 2022-02-06 19:36:20 +01:00
parent e4c53348d9
commit 47dc5e1b61
4 changed files with 1 additions and 6 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

@ -634,13 +634,8 @@ void OPLL_EnvelopeGenerate(opll_t *chip) {
switch (state) { switch (state) {
case eg_num_attack: case eg_num_attack:
if (!chip->eg_maxrate && (chip->eg_kon & 2) && !zero) { if (!chip->eg_maxrate && (chip->eg_kon & 2) && !zero) {
int32_t shift = chip->eg_rate_hi - 11 + chip->eg_inc_hi; int32_t shift = (chip->eg_rate_hi < 12) ? chip->eg_inc_lo : (chip->eg_rate_hi - 11 + chip->eg_inc_hi);
if (chip->eg_inc_lo) {
shift = 1;
}
if (shift > 0) { if (shift > 0) {
if (shift > 4)
shift = 4;
step = ~level >> (5 - shift); step = ~level >> (5 - shift);
} }
} }