Nuked OPN2: Fix LFO PM

This commit is contained in:
nukeykt 2017-09-26 19:23:43 +09:00
parent 3d8bd155a7
commit 13ab2aafbc
2 changed files with 5 additions and 5 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.2 * version: 1.0.3
*/ */
#include <string.h> #include <string.h>
@ -488,9 +488,9 @@ void OPN2_PhaseCalcIncrement(ym3438_t *chip)
lfo_l ^= 0x0f; lfo_l ^= 0x0f;
} }
fm = (fnum_h >> pg_lfo_sh1[pms][lfo_l]) + (fnum_h >> pg_lfo_sh2[pms][lfo_l]); fm = (fnum_h >> pg_lfo_sh1[pms][lfo_l]) + (fnum_h >> pg_lfo_sh2[pms][lfo_l]);
if (lfo_l > 5) if (pms > 5)
{ {
fm <<= 7 - lfo_l; fm <<= pms - 5;
} }
fm >>= 2; fm >>= 2;
if (lfo & 0x10) if (lfo & 0x10)
@ -554,11 +554,11 @@ void OPN2_PhaseGenerate(ym3438_t *chip)
void OPN2_EnvelopeSSGEG(ym3438_t *chip) void OPN2_EnvelopeSSGEG(ym3438_t *chip)
{ {
Bit32u slot = chip->slot; Bit32u slot = chip->slot;
Bit8u direction = 0;
chip->eg_ssg_pgrst_latch[slot] = 0; chip->eg_ssg_pgrst_latch[slot] = 0;
chip->eg_ssg_repeat_latch[slot] = 0; chip->eg_ssg_repeat_latch[slot] = 0;
chip->eg_ssg_hold_up_latch[slot] = 0; chip->eg_ssg_hold_up_latch[slot] = 0;
chip->eg_ssg_inv[slot] = 0; chip->eg_ssg_inv[slot] = 0;
Bit8u direction = 0;
if (chip->ssg_eg[slot] & 0x08) if (chip->ssg_eg[slot] & 0x08)
{ {
direction = chip->eg_ssg_dir[slot]; direction = chip->eg_ssg_dir[slot];

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.2 * version: 1.0.3
*/ */
#ifndef YM3438_H #ifndef YM3438_H