[Scummvm-git-logs] scummvm master -> 4877a1981df1320098561262b187bd13910124f5

bluegr noreply at scummvm.org
Mon Sep 9 06:25:46 UTC 2024


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
4877a1981d AUDIO: Sync with upstream Nuked OPL. Last commit: cfedb09e


Commit: 4877a1981df1320098561262b187bd13910124f5
    https://github.com/scummvm/scummvm/commit/4877a1981df1320098561262b187bd13910124f5
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-09-09T09:25:43+03:00

Commit Message:
AUDIO: Sync with upstream Nuked OPL. Last commit: cfedb09e

Changed paths:
    audio/softsynth/opl/nuked.cpp
    audio/softsynth/opl/nuked.h


diff --git a/audio/softsynth/opl/nuked.cpp b/audio/softsynth/opl/nuked.cpp
index 143183ff90d..075887cc120 100644
--- a/audio/softsynth/opl/nuked.cpp
+++ b/audio/softsynth/opl/nuked.cpp
@@ -426,8 +426,6 @@ static void OPL3_EnvelopeCalc(opl3_slot *slot)
         case envelope_gen_num_release:
             reg_rate = slot->reg_rr;
             break;
-        default:
-            break;
         }
     }
     slot->pg_reset = reset;
@@ -466,7 +464,7 @@ static void OPL3_EnvelopeCalc(opl3_slot *slot)
         }
         else
         {
-            shift = (rate_hi & 0x03) + eg_incstep[rate_lo][slot->chip->timer & 0x03u];
+            shift = (rate_hi & 0x03) + eg_incstep[rate_lo][slot->chip->eg_timer_lo];
             if (shift & 0x04)
             {
                 shift = 0x03;
@@ -523,8 +521,6 @@ static void OPL3_EnvelopeCalc(opl3_slot *slot)
             eg_inc = 1 << (shift - 1);
         }
         break;
-    default:
-        break;
     }
     slot->eg_rout = (eg_rout + eg_inc) & 0x1ff;
     /* Key off */
@@ -872,8 +868,6 @@ static void OPL3_ChannelSetupAlg(opl3_channel *channel)
             channel->slotz[0]->mod = &channel->slotz[0]->fbmod;
             channel->slotz[1]->mod = &channel->chip->zeromod;
             break;
-        default:
-            break;
         }
         return;
     }
@@ -929,8 +923,6 @@ static void OPL3_ChannelSetupAlg(opl3_channel *channel)
             channel->out[2] = &channel->slotz[1]->out;
             channel->out[3] = &channel->chip->zeromod;
             break;
-        default:
-            break;
         }
     }
     else
@@ -953,8 +945,6 @@ static void OPL3_ChannelSetupAlg(opl3_channel *channel)
             channel->out[2] = &channel->chip->zeromod;
             channel->out[3] = &channel->chip->zeromod;
             break;
-        default:
-            break;
         }
     }
 }
@@ -1219,10 +1209,9 @@ inline void OPL3_Generate4Ch(opl3_chip *chip, int16_t *buf4)
 
     chip->timer++;
 
-    chip->eg_add = 0;
-    if (chip->eg_timer)
+    if (chip->eg_state)
     {
-        while (shift < 36 && ((chip->eg_timer >> shift) & 1) == 0)
+        while (shift < 13 && ((chip->eg_timer >> shift) & 1) == 0)
         {
             shift++;
         }
@@ -1234,6 +1223,7 @@ inline void OPL3_Generate4Ch(opl3_chip *chip, int16_t *buf4)
         {
             chip->eg_add = shift + 1;
         }
+        chip->eg_timer_lo = (uint8_t)(chip->eg_timer & 0x3u);
     }
 
     if (chip->eg_timerrem || chip->eg_state)
@@ -1392,8 +1382,6 @@ void OPL3_WriteReg(opl3_chip *chip, uint16_t reg, uint8_t v)
                 chip->stereoext = (v >> 1) & 0x01;
 #endif
                 break;
-            default:
-                break;
             }
         }
         else
@@ -1403,8 +1391,6 @@ void OPL3_WriteReg(opl3_chip *chip, uint16_t reg, uint8_t v)
             case 0x08:
                 chip->nts = (v >> 6) & 0x01;
                 break;
-            default:
-                break;
             }
         }
         break;
@@ -1483,8 +1469,6 @@ void OPL3_WriteReg(opl3_chip *chip, uint16_t reg, uint8_t v)
         }
         break;
 #endif
-    default:
-        break;
     }
 }
 
diff --git a/audio/softsynth/opl/nuked.h b/audio/softsynth/opl/nuked.h
index 70860d2114c..22b3bcecafd 100644
--- a/audio/softsynth/opl/nuked.h
+++ b/audio/softsynth/opl/nuked.h
@@ -117,6 +117,7 @@ struct _opl3_chip {
     uint8_t eg_timerrem;
     uint8_t eg_state;
     uint8_t eg_add;
+    uint8_t eg_timer_lo;
     uint8_t newm;
     uint8_t nts;
     uint8_t rhy;
@@ -159,7 +160,7 @@ void OPL3_WriteReg(opl3_chip *chip, uint16_t reg, uint8_t v);
 void OPL3_WriteRegBuffered(opl3_chip *chip, uint16_t reg, uint8_t v);
 void OPL3_GenerateStream(opl3_chip *chip, int16_t *sndptr, uint32_t numsamples);
 
-void OPL3_Generate4Ch(opl3_chip *chpi, int16_t *buf4);
+void OPL3_Generate4Ch(opl3_chip *chip, int16_t *buf4);
 void OPL3_Generate4ChResampled(opl3_chip *chip, int16_t *buf4);
 void OPL3_Generate4ChStream(opl3_chip *chip, int16_t *sndptr1, int16_t *sndptr2, uint32_t numsamples);
 




More information about the Scummvm-git-logs mailing list