summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices
diff options
context:
space:
mode:
author arbee <rb6502@users.noreply.github.com>2020-11-08 17:49:19 -0500
committer arbee <rb6502@users.noreply.github.com>2020-11-08 17:49:19 -0500
commitfeaaccb7e7961c2d8d51a6bb0e65d45d57ceb31b (patch)
tree9d8ac3489029efbb3407af347f327c877e784d8a /src/devices
parente88b62261911f7013bab5160d99ceabae44b2ad1 (diff)
multipcm: Found the real 12-bit format flag. [R. Belmont]
mu5: Adjusted PCM clock closer to correct. [R. Belmont]
Diffstat (limited to 'src/devices')
-rw-r--r--src/devices/sound/multipcm.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/devices/sound/multipcm.cpp b/src/devices/sound/multipcm.cpp
index 370d242ff3b..3e974703372 100644
--- a/src/devices/sound/multipcm.cpp
+++ b/src/devices/sound/multipcm.cpp
@@ -21,7 +21,9 @@
* bytes per instrument sample. This is very similar to the YMF278B 'OPL4'.
* This sample format might be derived from the one used by the older YM7138 'GEW6' chip.
*
- * The first 3 bytes are the offset into the file (big endian). (0, 1, 2)
+ * The first 3 bytes are the offset into the file (big endian). (0, 1, 2).
+ Bit 23 is the sample format flag: 0 for 8-bit linear, 1 for 12-bit linear.
+ Bits 21 and 22 are used by the MU5 on some samples for as-yet unknown purposes.
* The next 2 are the loop start point, in samples (big endian) (3, 4)
* The next 2 are the 2's complement negation of of the total number of samples (big endian) (5, 6)
* The next byte is LFO freq + depth (copied to reg 6 ?) (7, 8)
@@ -80,6 +82,7 @@ void multipcm_device::init_sample(sample_t *sample, uint32_t index)
uint32_t address = index * 12;
sample->m_start = (read_byte(address) << 16) | (read_byte(address + 1) << 8) | read_byte(address + 2);
+ sample->m_format = (sample->m_start>>20) & 0xfe;
sample->m_start &= 0x3fffff;
sample->m_loop = (read_byte(address + 3) << 8) | read_byte(address + 4);
sample->m_end = 0xffff - ((read_byte(address + 5) << 8) | read_byte(address + 6));
@@ -328,7 +331,6 @@ void multipcm_device::write_slot(slot_t &slot, int32_t reg, uint8_t data)
{
case 0: // PANPOT
slot.m_pan = (data >> 4) & 0xf;
- slot.m_format = (data & 0x0f); // bit 3: 0 = 8-bit linear, 1 = 12-bit linear
break;
case 1: // Sample
@@ -367,6 +369,7 @@ void multipcm_device::write_slot(slot_t &slot, int32_t reg, uint8_t data)
slot.m_offset = 0;
slot.m_prev_sample = 0;
slot.m_total_level = slot.m_dest_total_level << TL_SHIFT;
+ slot.m_format = slot.m_sample.m_format;
envelope_generator_calc(slot);
slot.m_envelope_gen.m_state = state_t::ATTACK;