diff --git a/src/hardware/nukedopl.cpp b/src/hardware/nukedopl.cpp index b10e224cfee..9836aec9482 100644 --- a/src/hardware/nukedopl.cpp +++ b/src/hardware/nukedopl.cpp @@ -1208,9 +1208,9 @@ inline void OPL3_Generate4Ch(opl3_chip *chip, int16_t *buf4) chip->timer++; chip->eg_add = 0; - if (chip->eg_state) + if (chip->eg_timer) { - while (shift < 13 && ((chip->eg_timer >> shift) & 1) == 0) + while (shift < 36 && ((chip->eg_timer >> shift) & 1) == 0) { shift++; }