mirror of
https://github.com/ekeeke/Genesis-Plus-GX.git
synced 2024-12-28 12:11:50 +01:00
Merge pull request #183 from nukeykt/ym3438
Nuked OPN2: fix envelope generator increment calculation
This commit is contained in:
commit
f919bd3849
@ -39,7 +39,7 @@
|
|||||||
* OPLx decapsulated(Matthew Gambrell, Olli Niemitalo):
|
* OPLx decapsulated(Matthew Gambrell, Olli Niemitalo):
|
||||||
* OPL2 ROMs.
|
* OPL2 ROMs.
|
||||||
*
|
*
|
||||||
* version: 1.0.6
|
* version: 1.0.7
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -741,28 +741,24 @@ void OPN2_EnvelopePrepare(ym3438_t *chip)
|
|||||||
rate = 0x3f;
|
rate = 0x3f;
|
||||||
}
|
}
|
||||||
|
|
||||||
sum = (rate >> 2) + chip->eg_shift_lock;
|
sum = ((rate >> 2) + chip->eg_shift_lock) & 0x0f;
|
||||||
if (chip->eg_rate != 0 && chip->eg_quotient == 2)
|
if (chip->eg_rate != 0 && chip->eg_quotient == 2)
|
||||||
{
|
{
|
||||||
if (rate < 48)
|
if (rate < 48)
|
||||||
{
|
{
|
||||||
if ((sum & 0x0c) == 0x0c)
|
switch (sum)
|
||||||
{
|
{
|
||||||
if ((sum & 0x03) == 0)
|
case 12:
|
||||||
{
|
inc = 1;
|
||||||
inc = 1;
|
break;
|
||||||
}
|
case 13:
|
||||||
else
|
inc = (rate >> 1) & 0x01;
|
||||||
{
|
break;
|
||||||
if (sum & 0x01)
|
case 14:
|
||||||
{
|
inc = rate & 0x01;
|
||||||
inc |= (rate >> 1) & 0x01;
|
break;
|
||||||
}
|
default:
|
||||||
if (sum & 0x02)
|
break;
|
||||||
{
|
|
||||||
inc |= rate & 0x01;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
* OPLx decapsulated(Matthew Gambrell, Olli Niemitalo):
|
* OPLx decapsulated(Matthew Gambrell, Olli Niemitalo):
|
||||||
* OPL2 ROMs.
|
* OPL2 ROMs.
|
||||||
*
|
*
|
||||||
* version: 1.0.6
|
* version: 1.0.7
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef YM3438_H
|
#ifndef YM3438_H
|
||||||
|
Loading…
Reference in New Issue
Block a user