shithub: choc

Download patch

ref: c91572ed3ff3a3114d8fb13abb8165d67d0a9044
parent: 95dc2af73c4314cbdc09095f7aacd18499ff5d94
author: nukeykt <alexeytf2@icloud.com>
date: Mon Jul 11 05:01:19 EDT 2016

opl: Nuked OPL3 v1.7.3

--- a/opl/opl3.c
+++ b/opl/opl3.c
@@ -21,7 +21,7 @@
 //      OPLx decapsulated(Matthew Gambrell, Olli Niemitalo):
 //          OPL2 ROMs.
 //
-// version: 1.7.2
+// version: 1.7.3
 //
 
 #include <stdio.h>
@@ -1184,15 +1184,15 @@
     if ((chip->timer & 0x3f) == 0x3f)
     {
         chip->tremolopos = (chip->tremolopos + 1) % 210;
-        if (chip->tremolopos < 105)
-        {
-            chip->tremolo = chip->tremolopos >> chip->tremoloshift;
-        }
-        else
-        {
-            chip->tremolo = (210 - chip->tremolopos) >> chip->tremoloshift;
-        }
     }
+    if (chip->tremolopos < 105)
+    {
+        chip->tremolo = chip->tremolopos >> chip->tremoloshift;
+    }
+    else
+    {
+        chip->tremolo = (210 - chip->tremolopos) >> chip->tremoloshift;
+    }
 
     if ((chip->timer & 0x3ff) == 0x3ff)
     {
@@ -1268,6 +1268,8 @@
     }
     chip->noise = 0x306600;
     chip->rateratio = (samplerate << RSM_FRAC) / 49716;
+    chip->tremoloshift = 4;
+    chip->vibshift = 1;
 }
 
 void OPL3_WriteReg(opl3_chip *chip, Bit16u reg, Bit8u v)
--- a/opl/opl3.h
+++ b/opl/opl3.h
@@ -21,7 +21,7 @@
 //      OPLx decapsulated(Matthew Gambrell, Olli Niemitalo):
 //          OPL2 ROMs.
 //
-// version: 1.7.2
+// version: 1.7.3
 //
 
 #ifndef OPL_OPL3_H