summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/video/huc6272.cpp
diff options
context:
space:
mode:
author cam900 <dbtlrchl@naver.com>2020-01-25 12:20:36 +0900
committer ajrhacker <ajrhacker@users.noreply.github.com>2020-01-24 22:20:36 -0500
commit606d3a0c4d9389b0b76708614b08d3967e6b93f9 (patch)
treecea628c7832c682b66a0e218d32f6b31b9eb926e /src/devices/video/huc6272.cpp
parentca4bb0e084116c66ce1c28c9ab6d794892ab36af (diff)
Fix PC-FX ADPCM frequency behavior (#6213)
* Fix PC-FX ADPCM frequency behavior but it's still noisy and imperfect; Add imperfect_features for this. huc6230.cpp : Fix ADPCM frequency, Make ADPCM less louder, Fix naming related to patents, Fix stream sample rate related to PSG output rate, Add notes huc6272.cpp : Fix ADPCM frequency * huc6230.cpp : Fix spacing * huc6272.cpp : Add patent for reference * huc6230.cpp, huc6272.cpp : Add patent for reference
Diffstat (limited to 'src/devices/video/huc6272.cpp')
-rw-r--r--src/devices/video/huc6272.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/devices/video/huc6272.cpp b/src/devices/video/huc6272.cpp
index b091b67afb9..d1fca5708ce 100644
--- a/src/devices/video/huc6272.cpp
+++ b/src/devices/video/huc6272.cpp
@@ -10,6 +10,8 @@
ADPCM related patents:
- https://patents.google.com/patent/US5692099
+ - https://patents.google.com/patent/US6453286
+ - https://patents.google.com/patent/US5548655A
***************************************************************************/
@@ -497,9 +499,9 @@ uint8_t huc6272_device::adpcm_update(int chan)
if (!m_adpcm.playing[chan])
return 0;
- int rate = (1 << m_adpcm.rate);
+ const unsigned rate = (1 << m_adpcm.rate);
m_adpcm.pos[chan]++;
- if (m_adpcm.pos[chan] > rate)
+ if (m_adpcm.pos[chan] >= rate)
{
if (m_adpcm.input[chan] == -1)
{
@@ -541,6 +543,7 @@ uint8_t huc6272_device::adpcm_update(int chan)
if (m_adpcm.nibble[chan] >= 28)
m_adpcm.input[chan] = -1;
}
+ m_adpcm.pos[chan] = 0;
}
return (m_adpcm.input[chan] >> m_adpcm.nibble[chan]) & 0xf;