Merge pull request #177 from nukeykt/ym3438

Nuked OPN2: Don't attack if key is off
This commit is contained in:
ekeeke 2017-09-26 14:19:12 +02:00 committed by GitHub
commit 1f0af7e5a8
2 changed files with 4 additions and 4 deletions

View File

@ -39,7 +39,7 @@
* OPLx decapsulated(Matthew Gambrell, Olli Niemitalo): * OPLx decapsulated(Matthew Gambrell, Olli Niemitalo):
* OPL2 ROMs. * OPL2 ROMs.
* *
* version: 1.0.3 * version: 1.0.4
*/ */
#include <string.h> #include <string.h>
@ -651,7 +651,7 @@ void OPN2_EnvelopeADSR(ym3438_t *chip)
{ {
nextlevel = 0; nextlevel = 0;
} }
else if (chip->eg_state[slot] == eg_num_attack && level != 0 && chip->eg_inc) else if (chip->eg_state[slot] == eg_num_attack && level != 0 && chip->eg_inc && nkon)
{ {
inc = (~level << chip->eg_inc) >> 5; inc = (~level << chip->eg_inc) >> 5;
} }
@ -665,7 +665,7 @@ void OPN2_EnvelopeADSR(ym3438_t *chip)
{ {
nextstate = eg_num_decay; nextstate = eg_num_decay;
} }
else if(chip->eg_inc && !chip->eg_ratemax) else if(chip->eg_inc && !chip->eg_ratemax && nkon)
{ {
inc = (~level << chip->eg_inc) >> 5; inc = (~level << chip->eg_inc) >> 5;
} }

View File

@ -39,7 +39,7 @@
* OPLx decapsulated(Matthew Gambrell, Olli Niemitalo): * OPLx decapsulated(Matthew Gambrell, Olli Niemitalo):
* OPL2 ROMs. * OPL2 ROMs.
* *
* version: 1.0.3 * version: 1.0.4
*/ */
#ifndef YM3438_H #ifndef YM3438_H