summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author cam900 <dbtlrchl@naver.com>2020-11-07 07:00:47 +0900
committer GitHub <noreply@github.com>2020-11-07 09:00:47 +1100
commitb697d7d9ca18926f4f41d15b55ba367dc482c115 (patch)
tree88bcd26354937ac339fcf1b18dafd73beaa8344c
parent1b9b9c9509bcafde50314c0e45c614806861ef66 (diff)
c140.cpp: Reduce duplication in fetching sample (#7439)
-rw-r--r--src/devices/sound/c140.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/devices/sound/c140.cpp b/src/devices/sound/c140.cpp
index 5d0b0811854..62e32707f6c 100644
--- a/src/devices/sound/c140.cpp
+++ b/src/devices/sound/c140.cpp
@@ -292,8 +292,9 @@ void c140_device::sound_stream_update(sound_stream &stream, std::vector<read_str
if (cnt)
{
+ const u16 sample = read_word((sampleData + pos) << 1) & 0xfff0; // 12bit
prevdt = lastdt;
- lastdt = ((ch_mulaw(v)) ? m_pcmtbl[read_byte((sampleData + pos) << 1)] : s16(read_word((sampleData + pos) << 1) & 0xfff0)) >> 4; // 12bit
+ lastdt = ((ch_mulaw(v)) ? m_pcmtbl[(sample >> 8) & 0xff] : s16(sample)) >> 4;
dltdt = (lastdt - prevdt);
}