Advertisement
Nicknine

Dolphin DSP coef table print

Nov 15th, 2021 (edited)
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.06 KB | None | 0 0
  1. diff --git a/Source/Core/Core/DSP/DSPAccelerator.cpp b/Source/Core/Core/DSP/DSPAccelerator.cpp
  2. index afa2bbcba4..efb2c47a69 100644
  3. --- a/Source/Core/Core/DSP/DSPAccelerator.cpp
  4. +++ b/Source/Core/Core/DSP/DSPAccelerator.cpp
  5. @@ -76,6 +76,35 @@ u16 Accelerator::Read(const s16* coefs)
  6.    {
  7.    case 0x00:  // ADPCM audio
  8.    {
  9. +    static std::vector<s16*> coefs_hist;
  10. +    bool found = false;
  11. +
  12. +    for (s16* prev : coefs_hist)
  13. +    {
  14. +      if (memcmp(prev, coefs, 16 * sizeof(s16)) == 0)
  15. +      {
  16. +        found = true;
  17. +        break;
  18. +      }
  19. +    }
  20. +
  21. +    if (!found) {
  22. +      s16 *buf = new s16[16];
  23. +      memcpy(buf, coefs, 16 * sizeof(s16));
  24. +      coefs_hist.push_back(buf);
  25. +
  26. +      char hexBuf[256] = {0};
  27. +
  28. +      for (int i = 0; i < 16; i++)
  29. +      {
  30. +        char hex[16];
  31. +        sprintf(hex, "%04x", (uint16_t)coefs[i]);
  32. +        strcat(hexBuf, hex);
  33. +      }
  34. +
  35. +      NOTICE_LOG_FMT(DSPINTERFACE, "DSP coef table: {}", hexBuf);
  36. +    }
  37. +
  38.      int scale = 1 << (m_pred_scale & 0xF);
  39.      int coef_idx = (m_pred_scale >> 4) & 0x7;
  40.  
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement