summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author arbee <rb6502@users.noreply.github.com>2020-11-08 12:59:53 -0500
committer arbee <rb6502@users.noreply.github.com>2020-11-08 12:59:53 -0500
commitabd5378a1638a5f78e5678b2ffa0802b4aded0e9 (patch)
tree863dfce80477b796c10b843f1ce485ef2ebeb0bd
parent538221861b3fa38da4df2e75c0809e594693beba (diff)
multipcm: fix endianness of word reads. Some 12-bit samples sound almost reasonable now. [R. Belmont]
-rw-r--r--src/devices/sound/multipcm.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/devices/sound/multipcm.cpp b/src/devices/sound/multipcm.cpp
index fbb87b833d6..be61f46838f 100644
--- a/src/devices/sound/multipcm.cpp
+++ b/src/devices/sound/multipcm.cpp
@@ -695,27 +695,27 @@ void multipcm_device::sound_stream_update(sound_stream &stream, std::vector<read
{
case 0:
{ // .abc .... ....
- u16 w0 = read_word(adr);
+ u16 w0 = read_byte(adr)<<8 | read_byte(adr+1);
csample = (w0 & 0x0fff) << 4;
break;
}
case 1:
{ // C... ..AB ....
- u16 w0 = read_word(adr);
- u16 w1 = read_word(adr + 2);
+ u16 w0 = read_byte(adr) << 8 | read_byte(adr + 1);
+ u16 w1 = read_byte(adr + 2) << 8 | read_byte(adr + 3);
csample = ((w0 & 0xf000) >> 8) | ((w1 & 0x00ff) << 8);
break;
}
case 2:
{ // .... bc.. ...a
- u16 w0 = read_word(adr + 2);
- u16 w1 = read_word(adr + 4);
+ u16 w0 = read_byte(adr + 2) << 8 | read_byte(adr + 3);
+ u16 w1 = read_byte(adr + 4) << 8 | read_byte(adr + 5);
csample = ((w0 & 0xff00) >> 4) | ((w1 & 0x000f) << 12);
break;
}
case 3:
{ // .... .... ABC.
- u16 w1 = read_word(adr + 4);
+ u16 w1 = read_byte(adr + 4) << 8 | read_byte(adr + 5);
csample = w1 & 0xfff0;
break;
}