From 81284c68caf803c81989b2e55a9b6434b892ab96 Mon Sep 17 00:00:00 2001 From: Giulio Zausa Date: Mon, 8 Jul 2024 22:44:06 +0200 Subject: Fixes/ROMs for Roland stuff (#12555) * Fixed screen * Added ROMs and GP/LP support * Fixed rom and prints * Leftover * Fix --- scripts/src/sound.lua | 22 ++- src/devices/sound/roland_gp.cpp | 78 ++++++++ src/devices/sound/roland_gp.h | 84 +++++++++ src/devices/sound/roland_lp.cpp | 384 +++++++++++++++++++++++++++++++++++++++ src/devices/sound/roland_lp.h | 69 +++++++ src/devices/sound/rolandpcm.cpp | 384 --------------------------------------- src/devices/sound/rolandpcm.h | 69 ------- src/devices/video/t6963c.cpp | 17 +- src/devices/video/t6963c.h | 1 + src/mame/roland/roland_cm32p.cpp | 2 +- src/mame/roland/roland_d50.cpp | 2 +- src/mame/roland/roland_d70.cpp | 14 +- src/mame/roland/roland_jv80.cpp | 85 ++++++++- src/mame/roland/roland_r8.cpp | 2 +- src/mame/roland/roland_u20.cpp | 2 +- 15 files changed, 734 insertions(+), 481 deletions(-) create mode 100644 src/devices/sound/roland_gp.cpp create mode 100644 src/devices/sound/roland_gp.h create mode 100644 src/devices/sound/roland_lp.cpp create mode 100644 src/devices/sound/roland_lp.h delete mode 100644 src/devices/sound/rolandpcm.cpp delete mode 100644 src/devices/sound/rolandpcm.h diff --git a/scripts/src/sound.lua b/scripts/src/sound.lua index ab5c7e5ebfb..848f5649099 100644 --- a/scripts/src/sound.lua +++ b/scripts/src/sound.lua @@ -1624,14 +1624,26 @@ if (SOUNDS["XT446"]~=null) then end --------------------------------------------------- --- Roland sample players ---@src/devices/sound/rolandpcm.h,SOUNDS["ROLANDPCM"] = true +-- Roland LP-based sample players +--@src/devices/sound/roland_lp.h,SOUNDS["ROLANDLP"] = true --------------------------------------------------- -if (SOUNDS["ROLANDPCM"]~=null) then +if (SOUNDS["ROLANDLP"]~=null) then files { - MAME_DIR .. "src/devices/sound/rolandpcm.cpp", - MAME_DIR .. "src/devices/sound/rolandpcm.h", + MAME_DIR .. "src/devices/sound/roland_lp.cpp", + MAME_DIR .. "src/devices/sound/roland_lp.h", + } +end + +--------------------------------------------------- +-- Roland GP-based sample players +--@src/devices/sound/roland_gp.h,SOUNDS["ROLANDGP"] = true +--------------------------------------------------- + +if (SOUNDS["ROLANDGP"]~=null) then + files { + MAME_DIR .. "src/devices/sound/roland_gp.cpp", + MAME_DIR .. "src/devices/sound/roland_gp.h", } end diff --git a/src/devices/sound/roland_gp.cpp b/src/devices/sound/roland_gp.cpp new file mode 100644 index 00000000000..fb6c4f208c2 --- /dev/null +++ b/src/devices/sound/roland_gp.cpp @@ -0,0 +1,78 @@ +// license:BSD-3-Clause +// copyright-holders:giulioz + +// Initial skeleton based on the RE work by nukeykt + +#include "emu.h" +#include "roland_gp.h" + +// Original chip (GP-2) TODO +// DEFINE_DEVICE_TYPE(TC24SC201AF, tc6116_device, "tc24sc201af", "Roland GP TC24SC201AF PCM") + +// Newer chip (GP-4) including bugfixes and H8/500 cpu glue logic +DEFINE_DEVICE_TYPE(TC6116, tc6116_device, "tc6116", "Roland GP TC6116 PCM") + + +tc6116_device::tc6116_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, TC6116, tag, owner, clock) + , device_sound_interface(mconfig, *this) + , device_rom_interface(mconfig, *this) + , m_int_callback(*this) + , m_clock(0) + , m_rate(0) + , m_stream(nullptr) + , m_sel_chn(0) +{ +} + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void tc6116_device::device_start() +{ + m_clock = clock() / 2; + m_rate = m_clock / 512; // usually 32 KHz + + m_stream = stream_alloc(0, 2, m_rate); + + logerror("Roland GP: Clock %u, Rate %u\n", m_clock, m_rate); +} + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void tc6116_device::device_reset() +{ + m_int_callback(CLEAR_LINE); +} + +//------------------------------------------------- +// rom_bank_pre_change - refresh the stream if the +// ROM banking changes +//------------------------------------------------- + +void tc6116_device::rom_bank_pre_change() +{ + // unused right now + m_stream->update(); +} + + +u8 tc6116_device::read(offs_t offset) +{ + return 0xff; +} + +void tc6116_device::write(offs_t offset, u8 data) +{ +} + +//------------------------------------------------- +// sound_stream_update - handle a stream update +//------------------------------------------------- + +void tc6116_device::sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) +{ +} diff --git a/src/devices/sound/roland_gp.h b/src/devices/sound/roland_gp.h new file mode 100644 index 00000000000..70f22085bed --- /dev/null +++ b/src/devices/sound/roland_gp.h @@ -0,0 +1,84 @@ +// license:BSD-3-Clause +// copyright-holders:giulioz +#ifndef MAME_SOUND_ROLANDGP_H +#define MAME_SOUND_ROLANDGP_H + +#pragma once + +#include "dirom.h" + +class tc6116_device : public device_t, public device_sound_interface, public device_rom_interface<23> +{ +public: + tc6116_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + auto int_callback() { return m_int_callback.bind(); } + + u8 read(offs_t offset); + void write(offs_t offset, u8 data); + +protected: + // device_t implementation + virtual void device_start() override; + virtual void device_reset() override; + + // device_sound_interface implementation + virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; + + // device_rom_interface implementation + virtual void rom_bank_pre_change() override; + +private: + static constexpr unsigned NUM_CHANNELS = 28; + + struct pcm_channel + { + pcm_channel() { } + + // registers + uint8_t pitch_coarse; + uint8_t pitch_fine; + uint8_t pan_l; + uint8_t pan_r; + uint8_t rev_send; + uint8_t chorus_send; + uint8_t volume1; + uint8_t volume1_speed; + uint8_t volume2; + uint8_t volume2_speed; + uint8_t cutoff; + uint8_t cutoff_speed; + + bool irq_enable; // 0 + bool filter_mode; // 1 (0:lpf, 1:hpf) + uint8_t resonance_flags; // 8-15 + + uint8_t sub_phase_addr; // 0-4 + bool key; // 5 + bool alt_loop; // 6 + bool reverse_play; // 7 + uint8_t hiaddr; // 8-11 + uint8_t nibble; // 2-15 + + // work variables + uint16_t sub_phase_state; // 0-13 + bool irq_disable; // 14 + bool alt_loop_state; // 15 + + uint16_t volume1_tv; + uint16_t volume2_tv; + uint16_t cutoff_tv; + }; + + devcb_write_line m_int_callback; + + uint32_t m_clock; // clock + uint32_t m_rate; // sample rate (usually 32000 Hz) + sound_stream* m_stream; // stream handle + pcm_channel m_chns[NUM_CHANNELS]; // channel memory + [[maybe_unused]] uint8_t m_sel_chn; // selected channel +}; + +DECLARE_DEVICE_TYPE(TC6116, tc6116_device) + +#endif // MAME_SOUND_ROLANDGP_H diff --git a/src/devices/sound/roland_lp.cpp b/src/devices/sound/roland_lp.cpp new file mode 100644 index 00000000000..fd63f56cf76 --- /dev/null +++ b/src/devices/sound/roland_lp.cpp @@ -0,0 +1,384 @@ +// license:BSD-3-Clause +// copyright-holders:Valley Bell + +// register write: +// 00/01 - ?? +// 02/03 - ROM bank (bits 10-13) / loop mode (bits 14-15) +// 04/05 - frequency (2.14 fixed point, 0x4000 = 32000 Hz) +// 06/07 - volume +// 08/09 - sample start address, fraction (2.14 fixed point, i.e. 1 byte = 0x4000) +// 0A/0B - sample start address (high word, i.e. address bits 2..17) +// 0C/0D - sample end address (high word) +// 0E/0F - sample loop address (high word) +// 10/12 - ?? (sometimes value 1F is written) +// 11/13/15/17 - voice enable mask (11 = least significant 8 bits, 17 = most significant 8 bits) +// 19/1B/1D - ?? (written at init time) +// 1A - ?? +// 1F - voice select +// +// register read: +// 01 - last sample data (used by main CPU to read sample table from PCM ROM) +// 02/03 - ?? (read after writing to 10/12) + +#include "emu.h" +#include "roland_lp.h" + + +DEFINE_DEVICE_TYPE(MB87419_MB87420, mb87419_mb87420_device, "mb87419_mb87420", "Roland LP MB87419/MB87420 PCM") + +mb87419_mb87420_device::mb87419_mb87420_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, MB87419_MB87420, tag, owner, clock) + , device_sound_interface(mconfig, *this) + , device_rom_interface(mconfig, *this) + , m_int_callback(*this) + , m_clock(0) + , m_rate(0) + , m_stream(nullptr) + , m_sel_chn(0) +{ +} + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void mb87419_mb87420_device::device_start() +{ + m_clock = clock() / 2; + m_rate = m_clock / 512; // usually 32 KHz + + m_stream = stream_alloc(0, 2, m_rate); + + logerror("Roland PCM: Clock %u, Rate %u\n", m_clock, m_rate); +} + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void mb87419_mb87420_device::device_reset() +{ + m_int_callback(CLEAR_LINE); +} + +//------------------------------------------------- +// rom_bank_pre_change - refresh the stream if the +// ROM banking changes +//------------------------------------------------- + +void mb87419_mb87420_device::rom_bank_pre_change() +{ + // unused right now + m_stream->update(); +} + + +u8 mb87419_mb87420_device::read(offs_t offset) +{ + // Note: only offset 0x01 is verified, the rest is probably all wrong + if (offset != 0x01) + logerror("Reading Reg %02X\n", offset); + if (offset < 0x10) + { + pcm_channel& chn = m_chns[m_sel_chn]; + switch(offset) + { + case 0x00: + return (chn.mode >> 0) & 0xFF; + case 0x01: + m_stream->update(); + { + offs_t addr = (chn.addr >> 14) | ((chn.bank & 0x3C00) << 8); + return read_byte(addr); // return sample data + } + case 0x02: // ROM bank LSB + return (chn.bank >> 0) & 0xFF; + case 0x03: // ROM bank MSB + return (chn.bank >> 8) & 0xFF; + case 0x04: // sample step LSB + return (chn.step >> 0) & 0xFF; + case 0x05: // sample step LSB + return (chn.step >> 8) & 0xFF; + case 0x06: // volume LSB + return (chn.volume >> 0) & 0xFF; + case 0x07: // volume MSB + return (chn.volume >> 8) & 0xFF; + case 0x08: // current address, fraction LSB + return (chn.start >> 0) & 0xFF; + case 0x09: // current address, fraction MSB + return (chn.start >> 8) & 0xFF; + case 0x0A: // current address LSB + return (chn.start >> 16) & 0xFF; + case 0x0B: // current address MSB + return (chn.start >> 24) & 0xFF; + case 0x0C: // sample end address LSB + return (chn.end >> 0) & 0xFF; + case 0x0D: // sample end address MSB + return (chn.end >> 8) & 0xFF; + case 0x0E: // sample loop address LSB + return (chn.loop >> 0) & 0xFF; + case 0x0F: // sample loop address MSB + return (chn.loop >> 8) & 0xFF; + } + } + else + { + switch(offset) + { + case 0x11: + case 0x13: + case 0x15: + case 0x17: + m_stream->update(); + { + uint8_t basechn = ((offset >> 1) & 0x03) * 8; + uint8_t result = 0x00; + for (uint8_t ch_id = 0; ch_id < 8; ch_id ++) + result |= (m_chns[basechn + ch_id].enable << ch_id); + return result; + } + break; + case 0x1F: + return m_sel_chn; + } + } + return 0x00; +} + +void mb87419_mb87420_device::write(offs_t offset, u8 data) +{ + logerror("Reg %02X = %02X\n", offset, data); + if (offset < 0x10) + { + pcm_channel& chn = m_chns[m_sel_chn]; + switch(offset) + { + case 0x00: + chn.mode = (chn.mode & 0xFF00) | (data << 0); + break; + case 0x01: + chn.mode = (chn.mode & 0x00FF) | (data << 8); + break; + case 0x02: // ROM bank LSB + chn.bank = (chn.bank & 0xFF00) | (data << 0); + break; + case 0x03: // ROM bank MSB / loop mode + chn.bank = (chn.bank & 0x00FF) | (data << 8); + break; + case 0x04: // sample step LSB + chn.step = (chn.step & 0xFF00) | (data << 0); + break; + case 0x05: // sample step LSB + chn.step = (chn.step & 0x00FF) | (data << 8); + break; + case 0x06: // volume LSB + chn.volume = (chn.volume & 0xFF00) | (data << 0); + break; + case 0x07: // volume MSB + chn.volume = (chn.volume & 0x00FF) | (data << 8); + break; + case 0x08: // current address, fraction LSB + chn.start = (chn.start & 0xFFFFFF00) | (data << 0); + if (chn.enable) + logerror("Roland PCM, channel %u: changing start address while playing!\n", m_sel_chn); + break; + case 0x09: // current address, fraction MSB + chn.start = (chn.start & 0xFFFF00FF) | (data << 8); + if (chn.enable) + logerror("Roland PCM, channel %u: changing start address while playing!\n", m_sel_chn); + break; + case 0x0A: // current address LSB + chn.start = (chn.start & 0xFF00FFFF) | (data << 16); + if (chn.enable) + logerror("Roland PCM, channel %u: changing start address while playing!\n", m_sel_chn); + break; + case 0x0B: // current address MSB + chn.start = (chn.start & 0x00FFFFFF) | (data << 24); + if (chn.enable) + logerror("Roland PCM, channel %u: changing start address while playing!\n", m_sel_chn); + break; + case 0x0C: // sample end address, LSB + chn.end = (chn.end & 0xFF00) | (data << 0); + break; + case 0x0D: // sample end address MSB + chn.end = (chn.end & 0x00FF) | (data << 8); + break; + case 0x0E: // sample loop address LSB + chn.loop = (chn.loop & 0xFF00) | (data << 0); + break; + case 0x0F: // sample loop address MSB + chn.loop = (chn.loop & 0x00FF) | (data << 8); + break; + } + } + else + { + switch(offset) + { + case 0x11: + case 0x13: + case 0x15: + case 0x17: + { + uint8_t basechn = ((offset >> 1) & 0x03) * 8; + for (uint8_t ch_id = 0; ch_id < 8; ch_id ++) + { + pcm_channel& chn = m_chns[basechn + ch_id]; + bool play = static_cast((data >> ch_id) & 1); + + if (play && ! chn.enable) + { + chn.addr = chn.start; + offs_t addr = (chn.addr >> 14) | ((chn.bank & 0x3C00) << 8); + chn.smpl_cur = 0; + chn.smpl_nxt = decode_sample((int8_t)read_byte(addr)); + chn.play_dir = +1; + logerror("Starting channel %u, bank 0x%04X, addr 0x%05X.%03X\n", + basechn + ch_id, chn.bank, chn.start >> 14, (chn.start & 0x3FFF) << 2); + logerror("Smpl End Ofs: 0x%04X, Loop Ofs 0x%04X, Step 0x%04X, Volume %04X\n", + chn.end << 2, chn.loop << 2, chn.step, chn.volume); + } + chn.enable = play; + } + } + break; + case 0x1F: + m_sel_chn = data & 0x1F; + break; + default: + logerror("Writing unknown reg %02X = %02X\n", offset, data); + break; + } + } +} + +//------------------------------------------------- +// sound_stream_update - handle a stream update +//------------------------------------------------- + +void mb87419_mb87420_device::sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) +{ + outputs[0].fill(0); + outputs[1].fill(0); + + for (auto& chn : m_chns) + { + if (! chn.enable || chn.play_dir == 0) + continue; + + for (int smpl = 0; smpl < outputs[0].samples(); smpl ++) + { + s32 smp_data; + if (chn.play_dir > 0) + smp_data = sample_interpolate(chn.smpl_cur, chn.smpl_nxt, chn.addr & 0x3FFF); + else + smp_data = sample_interpolate(chn.smpl_nxt, chn.smpl_cur, chn.addr & 0x3FFF); + smp_data = smp_data * chn.volume; + outputs[0].add_int(smpl, smp_data, 32768 << 14); // >>14 results in a good overall volume + outputs[1].add_int(smpl, smp_data, 32768 << 14); + + uint32_t old_addr = chn.addr; + if (chn.play_dir > 0) + chn.addr += chn.step; + else if (chn.play_dir < 0) + chn.addr -= chn.step; + + // Note: The sample data is read after incrementing the address, but before handling loop points. + // Reading the sample data after loop point handling breaks the test mode square wave. + // (Sample 0xA7 on the CM-32P.) + if ((chn.addr >> 14) != (old_addr >> 14)) + { + offs_t addr = (chn.addr >> 14) | ((chn.bank & 0x3C00) << 8); + //logerror("Chn %u: sample addr 0x%05X.%03X\n", &chn - &m_chns[0], chn.addr >> 14, (chn.addr & 0x3FFF) << 2); + chn.smpl_cur = chn.smpl_nxt; + chn.smpl_nxt += decode_sample((int8_t)read_byte(addr)); // This was verified to be independent from play_dir. + + // until the decoding is fixed, we prevent overflow bugs (due to DC offsets when looping) this way + chn.smpl_nxt = std::clamp(chn.smpl_nxt, -0x7FF, +0x7FF); + } + + bool reachedEnd = false; + if (chn.play_dir > 0) + { + // This works well with the test mode sine/square wave samples. + if ((chn.addr >> 16) >= chn.end) + reachedEnd = true; + } + else if (chn.play_dir < 0) + { + if ((chn.addr >> 16) < chn.loop) + reachedEnd = true; + } + if (reachedEnd) + { + offs_t oldAddr = chn.addr; + logerror("Chn %u: Sample End at addr 0x%05X.%03X. (Dir %d, Loop Mode %u)\n", + &chn - &m_chns[0], chn.addr >> 14, (chn.addr & 0x3FFF) << 2, + chn.play_dir, chn.bank >> 14); + switch(chn.bank >> 14) + { + case 0: // normal loop + chn.addr = chn.addr + ((chn.loop - chn.end) << 16); + logerror("addr 0x%05X.%03X -> addr 0x%05X.%03X\n", + oldAddr >> 14, (oldAddr & 0x3FFF) << 2, + chn.addr >> 14, (chn.addr & 0x3FFF) << 2); + break; + case 1: // no loop + case 3: // invalid, assume "no loop" + chn.play_dir = 0; + break; + case 2: // ping-pong + // CM-32P samples with ping-pong loop mode: + // 0x00 (low piano note), 0x58..0x67, 0x69..0x6C (choir/strings), 0x9F..0xA4 (brass) + // Note: These formulae are probably incorrect, as they cause some DC offset in most samples. + // Reference sample rate for C5 @ Sample 9F: 34290 Hz. + if (chn.play_dir > 0) + chn.addr = (chn.end << 16) - chn.addr + (chn.end << 16); + else if (chn.play_dir < 0) + chn.addr = (chn.loop << 16) - chn.addr + (chn.loop << 16); + chn.play_dir = -chn.play_dir; + break; + } + if (chn.play_dir == 0) + break; + } + } + } + + return; +} + +int16_t mb87419_mb87420_device::decode_sample(int8_t data) +{ + int16_t val; + int16_t sign; + uint8_t shift; + int16_t result; + + if (data < 0) + { + sign = -1; + val = -data; + } + else + { + sign = +1; + val = data; + } + + // thanks to Sarayan for figuring out the decoding formula + shift = val >> 4; + val &= 0x0F; + if (! shift) + result = val; + else + result = (0x10 + val) << (shift - 1); + return result * sign; +} + +int16_t mb87419_mb87420_device::sample_interpolate(int16_t smp1, int16_t smp2, uint16_t frac) +{ + int32_t smpfrac0 = (int32_t)smp1 * (0x4000 - frac); + int32_t smpfrac1 = (int32_t)smp2 * frac; + return (int16_t)((smpfrac0 + smpfrac1) >> 14); +} diff --git a/src/devices/sound/roland_lp.h b/src/devices/sound/roland_lp.h new file mode 100644 index 00000000000..24db843fd36 --- /dev/null +++ b/src/devices/sound/roland_lp.h @@ -0,0 +1,69 @@ +// license:BSD-3-Clause +// copyright-holders:Valley Bell +#ifndef MAME_SOUND_ROLANDLP_H +#define MAME_SOUND_ROLANDLP_H + +#pragma once + +#include "dirom.h" + +class mb87419_mb87420_device : public device_t, public device_sound_interface, public device_rom_interface<22> +{ +public: + mb87419_mb87420_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + auto int_callback() { return m_int_callback.bind(); } + + u8 read(offs_t offset); + void write(offs_t offset, u8 data); + +protected: + // device_t implementation + virtual void device_start() override; + virtual void device_reset() override; + + // device_sound_interface implementation + virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; + + // device_rom_interface implementation + virtual void rom_bank_pre_change() override; + + static int16_t decode_sample(int8_t data); + static int16_t sample_interpolate(int16_t smp1, int16_t smp2, uint16_t frac); + +private: + static constexpr unsigned NUM_CHANNELS = 32; + + struct pcm_channel + { + pcm_channel() { } + + // registers + uint16_t mode = 0; + uint16_t bank = 0; + uint16_t step = 0; // 2.14 fixed point (0x4000 equals 32000 Hz) + uint16_t volume = 0; + uint32_t start = 0; // start address (18.14 fixed point) + uint16_t end = 0; // end offset (high word) + uint16_t loop = 0; // loop offset (high word) + + // work variables + bool enable = false; + int8_t play_dir = 0; // playing direction, -1 [backwards] / 0 [stopped] / +1 [forwards] + uint32_t addr = 0; // current address + int16_t smpl_cur = 0; // current sample + int16_t smpl_nxt = 0; // next sample + }; + + devcb_write_line m_int_callback; + + uint32_t m_clock; // clock + uint32_t m_rate; // sample rate (usually 32000 Hz) + sound_stream* m_stream; // stream handle + pcm_channel m_chns[NUM_CHANNELS]; // channel memory + uint8_t m_sel_chn; // selected channel +}; + +DECLARE_DEVICE_TYPE(MB87419_MB87420, mb87419_mb87420_device) + +#endif // MAME_SOUND_ROLANDLP_H diff --git a/src/devices/sound/rolandpcm.cpp b/src/devices/sound/rolandpcm.cpp deleted file mode 100644 index d1ec25c8f5c..00000000000 --- a/src/devices/sound/rolandpcm.cpp +++ /dev/null @@ -1,384 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Valley Bell - -// register write: -// 00/01 - ?? -// 02/03 - ROM bank (bits 10-13) / loop mode (bits 14-15) -// 04/05 - frequency (2.14 fixed point, 0x4000 = 32000 Hz) -// 06/07 - volume -// 08/09 - sample start address, fraction (2.14 fixed point, i.e. 1 byte = 0x4000) -// 0A/0B - sample start address (high word, i.e. address bits 2..17) -// 0C/0D - sample end address (high word) -// 0E/0F - sample loop address (high word) -// 10/12 - ?? (sometimes value 1F is written) -// 11/13/15/17 - voice enable mask (11 = least significant 8 bits, 17 = most significant 8 bits) -// 19/1B/1D - ?? (written at init time) -// 1A - ?? -// 1F - voice select -// -// register read: -// 01 - last sample data (used by main CPU to read sample table from PCM ROM) -// 02/03 - ?? (read after writing to 10/12) - -#include "emu.h" -#include "rolandpcm.h" - - -DEFINE_DEVICE_TYPE(MB87419_MB87420, mb87419_mb87420_device, "mb87419_mb87420", "Roland MB87419/MB87420 PCM") - -mb87419_mb87420_device::mb87419_mb87420_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, MB87419_MB87420, tag, owner, clock) - , device_sound_interface(mconfig, *this) - , device_rom_interface(mconfig, *this) - , m_int_callback(*this) - , m_clock(0) - , m_rate(0) - , m_stream(nullptr) - , m_sel_chn(0) -{ -} - -//------------------------------------------------- -// device_start - device-specific startup -//------------------------------------------------- - -void mb87419_mb87420_device::device_start() -{ - m_clock = clock() / 2; - m_rate = m_clock / 512; // usually 32 KHz - - m_stream = stream_alloc(0, 2, m_rate); - - logerror("Roland PCM: Clock %u, Rate %u\n", m_clock, m_rate); -} - -//------------------------------------------------- -// device_reset - device-specific reset -//------------------------------------------------- - -void mb87419_mb87420_device::device_reset() -{ - m_int_callback(CLEAR_LINE); -} - -//------------------------------------------------- -// rom_bank_pre_change - refresh the stream if the -// ROM banking changes -//------------------------------------------------- - -void mb87419_mb87420_device::rom_bank_pre_change() -{ - // unused right now - m_stream->update(); -} - - -u8 mb87419_mb87420_device::read(offs_t offset) -{ - // Note: only offset 0x01 is verified, the rest is probably all wrong - if (offset != 0x01) - logerror("Reading Reg %02X\n", offset); - if (offset < 0x10) - { - pcm_channel& chn = m_chns[m_sel_chn]; - switch(offset) - { - case 0x00: - return (chn.mode >> 0) & 0xFF; - case 0x01: - m_stream->update(); - { - offs_t addr = (chn.addr >> 14) | ((chn.bank & 0x3C00) << 8); - return read_byte(addr); // return sample data - } - case 0x02: // ROM bank LSB - return (chn.bank >> 0) & 0xFF; - case 0x03: // ROM bank MSB - return (chn.bank >> 8) & 0xFF; - case 0x04: // sample step LSB - return (chn.step >> 0) & 0xFF; - case 0x05: // sample step LSB - return (chn.step >> 8) & 0xFF; - case 0x06: // volume LSB - return (chn.volume >> 0) & 0xFF; - case 0x07: // volume MSB - return (chn.volume >> 8) & 0xFF; - case 0x08: // current address, fraction LSB - return (chn.start >> 0) & 0xFF; - case 0x09: // current address, fraction MSB - return (chn.start >> 8) & 0xFF; - case 0x0A: // current address LSB - return (chn.start >> 16) & 0xFF; - case 0x0B: // current address MSB - return (chn.start >> 24) & 0xFF; - case 0x0C: // sample end address LSB - return (chn.end >> 0) & 0xFF; - case 0x0D: // sample end address MSB - return (chn.end >> 8) & 0xFF; - case 0x0E: // sample loop address LSB - return (chn.loop >> 0) & 0xFF; - case 0x0F: // sample loop address MSB - return (chn.loop >> 8) & 0xFF; - } - } - else - { - switch(offset) - { - case 0x11: - case 0x13: - case 0x15: - case 0x17: - m_stream->update(); - { - uint8_t basechn = ((offset >> 1) & 0x03) * 8; - uint8_t result = 0x00; - for (uint8_t ch_id = 0; ch_id < 8; ch_id ++) - result |= (m_chns[basechn + ch_id].enable << ch_id); - return result; - } - break; - case 0x1F: - return m_sel_chn; - } - } - return 0x00; -} - -void mb87419_mb87420_device::write(offs_t offset, u8 data) -{ - logerror("Reg %02X = %02X\n", offset, data); - if (offset < 0x10) - { - pcm_channel& chn = m_chns[m_sel_chn]; - switch(offset) - { - case 0x00: - chn.mode = (chn.mode & 0xFF00) | (data << 0); - break; - case 0x01: - chn.mode = (chn.mode & 0x00FF) | (data << 8); - break; - case 0x02: // ROM bank LSB - chn.bank = (chn.bank & 0xFF00) | (data << 0); - break; - case 0x03: // ROM bank MSB / loop mode - chn.bank = (chn.bank & 0x00FF) | (data << 8); - break; - case 0x04: // sample step LSB - chn.step = (chn.step & 0xFF00) | (data << 0); - break; - case 0x05: // sample step LSB - chn.step = (chn.step & 0x00FF) | (data << 8); - break; - case 0x06: // volume LSB - chn.volume = (chn.volume & 0xFF00) | (data << 0); - break; - case 0x07: // volume MSB - chn.volume = (chn.volume & 0x00FF) | (data << 8); - break; - case 0x08: // current address, fraction LSB - chn.start = (chn.start & 0xFFFFFF00) | (data << 0); - if (chn.enable) - logerror("Roland PCM, channel %u: changing start address while playing!\n", m_sel_chn); - break; - case 0x09: // current address, fraction MSB - chn.start = (chn.start & 0xFFFF00FF) | (data << 8); - if (chn.enable) - logerror("Roland PCM, channel %u: changing start address while playing!\n", m_sel_chn); - break; - case 0x0A: // current address LSB - chn.start = (chn.start & 0xFF00FFFF) | (data << 16); - if (chn.enable) - logerror("Roland PCM, channel %u: changing start address while playing!\n", m_sel_chn); - break; - case 0x0B: // current address MSB - chn.start = (chn.start & 0x00FFFFFF) | (data << 24); - if (chn.enable) - logerror("Roland PCM, channel %u: changing start address while playing!\n", m_sel_chn); - break; - case 0x0C: // sample end address, LSB - chn.end = (chn.end & 0xFF00) | (data << 0); - break; - case 0x0D: // sample end address MSB - chn.end = (chn.end & 0x00FF) | (data << 8); - break; - case 0x0E: // sample loop address LSB - chn.loop = (chn.loop & 0xFF00) | (data << 0); - break; - case 0x0F: // sample loop address MSB - chn.loop = (chn.loop & 0x00FF) | (data << 8); - break; - } - } - else - { - switch(offset) - { - case 0x11: - case 0x13: - case 0x15: - case 0x17: - { - uint8_t basechn = ((offset >> 1) & 0x03) * 8; - for (uint8_t ch_id = 0; ch_id < 8; ch_id ++) - { - pcm_channel& chn = m_chns[basechn + ch_id]; - bool play = static_cast((data >> ch_id) & 1); - - if (play && ! chn.enable) - { - chn.addr = chn.start; - offs_t addr = (chn.addr >> 14) | ((chn.bank & 0x3C00) << 8); - chn.smpl_cur = 0; - chn.smpl_nxt = decode_sample((int8_t)read_byte(addr)); - chn.play_dir = +1; - logerror("Starting channel %u, bank 0x%04X, addr 0x%05X.%03X\n", - basechn + ch_id, chn.bank, chn.start >> 14, (chn.start & 0x3FFF) << 2); - logerror("Smpl End Ofs: 0x%04X, Loop Ofs 0x%04X, Step 0x%04X, Volume %04X\n", - chn.end << 2, chn.loop << 2, chn.step, chn.volume); - } - chn.enable = play; - } - } - break; - case 0x1F: - m_sel_chn = data & 0x1F; - break; - default: - logerror("Writing unknown reg %02X = %02X\n", offset, data); - break; - } - } -} - -//------------------------------------------------- -// sound_stream_update - handle a stream update -//------------------------------------------------- - -void mb87419_mb87420_device::sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) -{ - outputs[0].fill(0); - outputs[1].fill(0); - - for (auto& chn : m_chns) - { - if (! chn.enable || chn.play_dir == 0) - continue; - - for (int smpl = 0; smpl < outputs[0].samples(); smpl ++) - { - s32 smp_data; - if (chn.play_dir > 0) - smp_data = sample_interpolate(chn.smpl_cur, chn.smpl_nxt, chn.addr & 0x3FFF); - else - smp_data = sample_interpolate(chn.smpl_nxt, chn.smpl_cur, chn.addr & 0x3FFF); - smp_data = smp_data * chn.volume; - outputs[0].add_int(smpl, smp_data, 32768 << 14); // >>14 results in a good overall volume - outputs[1].add_int(smpl, smp_data, 32768 << 14); - - uint32_t old_addr = chn.addr; - if (chn.play_dir > 0) - chn.addr += chn.step; - else if (chn.play_dir < 0) - chn.addr -= chn.step; - - // Note: The sample data is read after incrementing the address, but before handling loop points. - // Reading the sample data after loop point handling breaks the test mode square wave. - // (Sample 0xA7 on the CM-32P.) - if ((chn.addr >> 14) != (old_addr >> 14)) - { - offs_t addr = (chn.addr >> 14) | ((chn.bank & 0x3C00) << 8); - //logerror("Chn %u: sample addr 0x%05X.%03X\n", &chn - &m_chns[0], chn.addr >> 14, (chn.addr & 0x3FFF) << 2); - chn.smpl_cur = chn.smpl_nxt; - chn.smpl_nxt += decode_sample((int8_t)read_byte(addr)); // This was verified to be independent from play_dir. - - // until the decoding is fixed, we prevent overflow bugs (due to DC offsets when looping) this way - chn.smpl_nxt = std::clamp(chn.smpl_nxt, -0x7FF, +0x7FF); - } - - bool reachedEnd = false; - if (chn.play_dir > 0) - { - // This works well with the test mode sine/square wave samples. - if ((chn.addr >> 16) >= chn.end) - reachedEnd = true; - } - else if (chn.play_dir < 0) - { - if ((chn.addr >> 16) < chn.loop) - reachedEnd = true; - } - if (reachedEnd) - { - offs_t oldAddr = chn.addr; - logerror("Chn %u: Sample End at addr 0x%05X.%03X. (Dir %d, Loop Mode %u)\n", - &chn - &m_chns[0], chn.addr >> 14, (chn.addr & 0x3FFF) << 2, - chn.play_dir, chn.bank >> 14); - switch(chn.bank >> 14) - { - case 0: // normal loop - chn.addr = chn.addr + ((chn.loop - chn.end) << 16); - logerror("addr 0x%05X.%03X -> addr 0x%05X.%03X\n", - oldAddr >> 14, (oldAddr & 0x3FFF) << 2, - chn.addr >> 14, (chn.addr & 0x3FFF) << 2); - break; - case 1: // no loop - case 3: // invalid, assume "no loop" - chn.play_dir = 0; - break; - case 2: // ping-pong - // CM-32P samples with ping-pong loop mode: - // 0x00 (low piano note), 0x58..0x67, 0x69..0x6C (choir/strings), 0x9F..0xA4 (brass) - // Note: These formulae are probably incorrect, as they cause some DC offset in most samples. - // Reference sample rate for C5 @ Sample 9F: 34290 Hz. - if (chn.play_dir > 0) - chn.addr = (chn.end << 16) - chn.addr + (chn.end << 16); - else if (chn.play_dir < 0) - chn.addr = (chn.loop << 16) - chn.addr + (chn.loop << 16); - chn.play_dir = -chn.play_dir; - break; - } - if (chn.play_dir == 0) - break; - } - } - } - - return; -} - -int16_t mb87419_mb87420_device::decode_sample(int8_t data) -{ - int16_t val; - int16_t sign; - uint8_t shift; - int16_t result; - - if (data < 0) - { - sign = -1; - val = -data; - } - else - { - sign = +1; - val = data; - } - - // thanks to Sarayan for figuring out the decoding formula - shift = val >> 4; - val &= 0x0F; - if (! shift) - result = val; - else - result = (0x10 + val) << (shift - 1); - return result * sign; -} - -int16_t mb87419_mb87420_device::sample_interpolate(int16_t smp1, int16_t smp2, uint16_t frac) -{ - int32_t smpfrac0 = (int32_t)smp1 * (0x4000 - frac); - int32_t smpfrac1 = (int32_t)smp2 * frac; - return (int16_t)((smpfrac0 + smpfrac1) >> 14); -} diff --git a/src/devices/sound/rolandpcm.h b/src/devices/sound/rolandpcm.h deleted file mode 100644 index c8f1ebb5c08..00000000000 --- a/src/devices/sound/rolandpcm.h +++ /dev/null @@ -1,69 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Valley Bell -#ifndef MAME_SOUND_ROLANDPCM_H -#define MAME_SOUND_ROLANDPCM_H - -#pragma once - -#include "dirom.h" - -class mb87419_mb87420_device : public device_t, public device_sound_interface, public device_rom_interface<22> -{ -public: - mb87419_mb87420_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - - auto int_callback() { return m_int_callback.bind(); } - - u8 read(offs_t offset); - void write(offs_t offset, u8 data); - -protected: - // device_t implementation - virtual void device_start() override; - virtual void device_reset() override; - - // device_sound_interface implementation - virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; - - // device_rom_interface implementation - virtual void rom_bank_pre_change() override; - - static int16_t decode_sample(int8_t data); - static int16_t sample_interpolate(int16_t smp1, int16_t smp2, uint16_t frac); - -private: - static constexpr unsigned NUM_CHANNELS = 32; - - struct pcm_channel - { - pcm_channel() { } - - // registers - uint16_t mode = 0; - uint16_t bank = 0; - uint16_t step = 0; // 2.14 fixed point (0x4000 equals 32000 Hz) - uint16_t volume = 0; - uint32_t start = 0; // start address (18.14 fixed point) - uint16_t end = 0; // end offset (high word) - uint16_t loop = 0; // loop offset (high word) - - // work variables - bool enable = false; - int8_t play_dir = 0; // playing direction, -1 [backwards] / 0 [stopped] / +1 [forwards] - uint32_t addr = 0; // current address - int16_t smpl_cur = 0; // current sample - int16_t smpl_nxt = 0; // next sample - }; - - devcb_write_line m_int_callback; - - uint32_t m_clock; // clock - uint32_t m_rate; // sample rate (usually 32000 Hz) - sound_stream* m_stream; // stream handle - pcm_channel m_chns[NUM_CHANNELS]; // channel memory - uint8_t m_sel_chn; // selected channel -}; - -DECLARE_DEVICE_TYPE(MB87419_MB87420, mb87419_mb87420_device) - -#endif // MAME_SOUND_ROLANDPCM_H diff --git a/src/devices/video/t6963c.cpp b/src/devices/video/t6963c.cpp index bf0841450c0..a2e254809c7 100644 --- a/src/devices/video/t6963c.cpp +++ b/src/devices/video/t6963c.cpp @@ -5,6 +5,12 @@ Toshiba T6963C Dot Matrix LCD Controller Sharp LM24014H Dot Matrix LCD Unit + TODO: + - cursor + - screen peek + - screen copy + - auto read mode + **********************************************************************/ #include "emu.h" @@ -51,6 +57,7 @@ t6963c_device::t6963c_device(const machine_config &mconfig, const char *tag, dev , m_font_size(6) , m_number_cols(40) , m_number_lines(8) + , m_read_data(0) { } @@ -89,6 +96,7 @@ void t6963c_device::device_start() save_item(NAME(m_font_size)); save_item(NAME(m_number_cols)); save_item(NAME(m_number_lines)); + save_item(NAME(m_read_data)); } @@ -117,7 +125,7 @@ void t6963c_device::device_reset() u8 t6963c_device::read(offs_t offset) { - return BIT(offset, 0) ? 0x2b : 0x00; + return BIT(offset, 0) ? 0x2b : m_read_data; } @@ -219,7 +227,7 @@ void t6963c_device::do_command(u8 cmd) if (cmd == 0x90) LOG("%s: Display off\n", machine().describe_context()); else - LOG("%s: Text %s, graphic %s, cursor %s, blink %s\n", + LOG("%s: Graphic %s, text %s, cursor %s, blink %s\n", machine().describe_context(), BIT(cmd, 3) ? "on" : "off", BIT(cmd, 2) ? "on" : "off", @@ -251,6 +259,7 @@ void t6963c_device::do_command(u8 cmd) : (cmd & 0x0e) == 0x02 ? "decrement" : (cmd & 0x0e) == 0x04 ? "nonvariable" : "invalid"); + m_read_data = m_display_ram->read_byte(m_adp); } else { @@ -327,7 +336,7 @@ uint32_t t6963c_device::screen_update(screen_device &screen, bitmap_ind16 &bitma bitmap.fill(0, cliprect); // Text layer - if (BIT(m_display_mode, 3)) + if (BIT(m_display_mode, 2)) { offs = m_text_home; for(int y=0; y lm24014h_device diff --git a/src/mame/roland/roland_cm32p.cpp b/src/mame/roland/roland_cm32p.cpp index 943171392d1..81f6882cd69 100644 --- a/src/mame/roland/roland_cm32p.cpp +++ b/src/mame/roland/roland_cm32p.cpp @@ -256,7 +256,7 @@ Some routine locations #include "cpu/mcs96/i8x9x.h" #include "machine/ram.h" #include "machine/timer.h" -#include "sound/rolandpcm.h" +#include "sound/roland_lp.h" #include "video/msm6222b.h" #include "bus/generic/slot.h" #include "bus/generic/carts.h" diff --git a/src/mame/roland/roland_d50.cpp b/src/mame/roland/roland_d50.cpp index 6f57dee5436..3412c714957 100644 --- a/src/mame/roland/roland_d50.cpp +++ b/src/mame/roland/roland_d50.cpp @@ -122,7 +122,7 @@ ROM_START(d50) // Newer PCB with silkscreen "Roland || D-50, D-550 || MAIN BOARD // missing 2.00 ROM_REGION(0x2000, "maincpu", 0) - ROM_LOAD("d78312g-022_15179266.ic25", 0x0000, 0x2000, NO_DUMP) // 8-digit Roland part number not printed on IC + ROM_LOAD("d78312g-022_15179266.ic25", 0x0000, 0x2000, CRC(9564903f) SHA1(f68ed97a06764ee000fe6e9d7b39017165f0efc4)) // 8-digit Roland part number not printed on IC ROM_COPY("progrom", 0x0000, 0x0000, 0x2000) ROM_REGION(0x80000, "pcm", 0) diff --git a/src/mame/roland/roland_d70.cpp b/src/mame/roland/roland_d70.cpp index 05b03e2db17..7f73a6f4813 100644 --- a/src/mame/roland/roland_d70.cpp +++ b/src/mame/roland/roland_d70.cpp @@ -16,7 +16,7 @@ #include "cpu/mcs96/i8x9x.h" #include "cpu/mcs96/i8xc196.h" #include "machine/timer.h" -#include "sound/rolandpcm.h" +#include "sound/roland_lp.h" #include "video/t6963c.h" #include "emupal.h" @@ -352,12 +352,12 @@ void roland_d70_state::dsp_io_w(offs_t offset, u8 data) { } u8 roland_d70_state::tvf_io_r(offs_t offset) { - logerror("tvf read %x\n", offset); + logerror("tvf read %04x\n", offset); return 0; } void roland_d70_state::tvf_io_w(offs_t offset, u8 data) { - logerror("twf write $x= %x\n", offset, data); + logerror("tvf write %04x= %02x\n", offset, data); } u8 roland_d70_state::snd_io_r(offs_t offset) { @@ -494,11 +494,11 @@ void roland_d70_state::init_d70() { u8 *dst = reinterpret_cast(memregion("pcm")->base()); // descramble internal ROMs descramble_rom_internal(&dst[0x000000], &src[0x000000]); + descramble_rom_internal(&dst[0x080000], &src[0x080000]); descramble_rom_internal(&dst[0x100000], &src[0x100000]); + descramble_rom_internal(&dst[0x180000], &src[0x180000]); descramble_rom_internal(&dst[0x200000], &src[0x200000]); descramble_rom_internal(&dst[0x300000], &src[0x300000]); - descramble_rom_internal(&dst[0x400000], &src[0x400000]); - descramble_rom_internal(&dst[0x500000], &src[0x500000]); } void roland_d70_state::descramble_rom_internal(u8 *dst, const u8 *src) { @@ -515,11 +515,11 @@ ROM_START(d70) ROM_REGION(0x600000, "pcmorg", 0) // ROMs before descrambling ROM_LOAD("roland_d70_waverom-a.bin", 0x000000, 0x80000, CRC(8e53b2a3) SHA1(4872530870d5079776e80e477febe425dc0ec1df)) + ROM_LOAD("roland_d70_waverom-e.bin", 0x080000, 0x80000, CRC(d46cc7a4) SHA1(d378ac89a5963e37f7c157b3c8e71892c334fd7b)) ROM_LOAD("roland_d70_waverom-b.bin", 0x100000, 0x80000, CRC(c8220761) SHA1(49e55fa672020f95fd9c858ceaae94d6db93df7d)) + ROM_LOAD("roland_d70_waverom-f.bin", 0x180000, 0x80000, CRC(d4b01f5e) SHA1(acd867d68e49e5f59f1006ed14a7ca197b6dc4af)) ROM_LOAD("roland_d70_waverom-c.bin", 0x200000, 0x80000, CRC(733c4054) SHA1(9b6b59ab74e5bf838702abb087c408aaa85b7b1f)) ROM_LOAD("roland_d70_waverom-d.bin", 0x300000, 0x80000, CRC(b6c662d2) SHA1(3fcbcfd0d8d0fa419c710304c12482e2f79a907f)) - ROM_LOAD("roland_d70_waverom-e.bin", 0x400000, 0x80000, CRC(d46cc7a4) SHA1(d378ac89a5963e37f7c157b3c8e71892c334fd7b)) - ROM_LOAD("roland_d70_waverom-f.bin", 0x500000, 0x80000, CRC(d4b01f5e) SHA1(acd867d68e49e5f59f1006ed14a7ca197b6dc4af)) ROM_REGION(0x600000, "pcm", ROMREGION_ERASEFF) // ROMs after descrambling ROM_REGION(0x400, "lcd:cgrom", 0) diff --git a/src/mame/roland/roland_jv80.cpp b/src/mame/roland/roland_jv80.cpp index bf6088d3102..0cb55583747 100644 --- a/src/mame/roland/roland_jv80.cpp +++ b/src/mame/roland/roland_jv80.cpp @@ -2,13 +2,15 @@ // copyright-holders:AJR /**************************************************************************** - Skeleton driver for Roland JV-80 & JV-880 synthesizers. + Skeleton driver for Roland JV-80, JV-880 and related synthesizers. ****************************************************************************/ #include "emu.h" +#include "cpu/h8500/h8510.h" #include "cpu/h8500/h8532.h" #include "machine/nvram.h" +#include "sound/roland_gp.h" namespace { @@ -19,25 +21,30 @@ public: roland_jv80_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") + , m_pcm(*this, "pcm") { } void jv880(machine_config &config); private: - void mem_map(address_map &map); + void jv880_mem_map(address_map &map); required_device m_maincpu; + required_device m_pcm; }; -void roland_jv80_state::mem_map(address_map &map) +void roland_jv80_state::jv880_mem_map(address_map &map) { - map(0x08000, 0x09fff).ram(); + map(0x00000, 0x07fff).rom().region("maincpu", 0); + map(0x08000, 0x0dfff).ram().mirror(0xa0000); + map(0x0f000, 0x0f3ff).rw(m_pcm, FUNC(tc6116_device::read), FUNC(tc6116_device::write)); map(0x10000, 0x3ffff).rom().region("progrom", 0x10000); map(0x40000, 0x4ffff).rom().region("progrom", 0); - map(0xa0000, 0xa7fff).ram(); - map(0xe0000, 0xe7fff).ram().share("nvram"); + map(0xa0000, 0xbffff).ram(); + map(0xc0000, 0xd7fff).ram().share("nvram"); + // map(0xe0000, 0xf7fff).ram().share("cardram"); } static INPUT_PORTS_START(jv880) @@ -46,11 +53,61 @@ INPUT_PORTS_END void roland_jv80_state::jv880(machine_config &config) { HD6435328(config, m_maincpu, 20_MHz_XTAL); - m_maincpu->set_addrmap(AS_PROGRAM, &roland_jv80_state::mem_map); + m_maincpu->set_addrmap(AS_PROGRAM, &roland_jv80_state::jv880_mem_map); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); // LC36256AML-10 (IC18) + CR2032 battery - //TC6116(config, "pcm", 23.2_MHz_XTAL); + TC6116(config, "pcm", 23.2_MHz_XTAL); +} + +class roland_rd500_state : public driver_device +{ +public: + roland_rd500_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_pcm(*this, "pcm") + { + } + + void rd500(machine_config &config); + +private: + void rd500_mem_map(address_map &map); + + u8 keyscan_r(offs_t offset); + void keyscan_w(offs_t offset, u8 data); + + required_device m_maincpu; + required_device m_pcm; +}; + +void roland_rd500_state::rd500_mem_map(address_map &map) +{ + map(0x000000, 0x8fffff).rom().region("progrom", 0); + map(0x900000, 0x90ffff).ram(); + map(0xa00000, 0xa0ffff).rw(m_pcm, FUNC(tc6116_device::read), FUNC(tc6116_device::write)); + map(0xc00000, 0xc0ffff).rw(FUNC(roland_rd500_state::keyscan_r), FUNC(roland_rd500_state::keyscan_w)); +} + +u8 roland_rd500_state::keyscan_r(offs_t offset) +{ + return 0; +} + +void roland_rd500_state::keyscan_w(offs_t offset, u8 data) +{ +} + +static INPUT_PORTS_START(rd500) +INPUT_PORTS_END + +void roland_rd500_state::rd500(machine_config &config) +{ + HD6415108(config, m_maincpu, 20_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &roland_rd500_state::rd500_mem_map); + + TC6116(config, "pcm", 23.2_MHz_XTAL); } ROM_START(jv880) @@ -70,8 +127,20 @@ ROM_START(jv880) ROM_LOAD("roland-b_r15209313_lh5375n3.ic25", 0x200000, 0x200000, CRC(d55fcf90) SHA1(963ce75b6668dab377d3a2fd895630a745491be5)) ROM_END +ROM_START(rd500) + ROM_REGION(0x80000, "progrom", 0) + ROM_LOAD("rd500_rom.bin", 0x00000, 0x80000, CRC(668fc7e9) SHA1(59e28d3e2190902dd6fd02a9820f96e383781178)) + + ROM_REGION(0x400000, "waverom", 0) + ROM_LOAD("roland-a_r00342978.ic4", 0x000000, 0x200000, CRC(c885bf4f) SHA1(e14f0f4a8181e09fae7db10130e4ed3cd6bf5a34)) + ROM_LOAD("roland-b_r00343012.ic5", 0x200000, 0x200000, CRC(ceb02d33) SHA1(9f6969d94598c68902188085d0c91fb8b300d762)) + ROM_LOAD("roland-c_r00343023.ic6", 0x400000, 0x200000, CRC(f627cdb7) SHA1(7b834fee5db5a7377ec7f66172d0fa3096cefbc9)) + ROM_LOAD("roland-d_r00343034.ic7", 0x600000, 0x200000, CRC(c06be973) SHA1(2e7ce8a91a6f92648f73d7ff8c1d608f62df9aab)) +ROM_END + } // anonymous namespace //SYST(1992, jv80, 0, 0, jv80, jv80, roland_jv80_state, empty_init, "Roland", "JV-80 Multi Timbral Synthesizer", MACHINE_IS_SKELETON) SYST(1992, jv880, 0, 0, jv880, jv880, roland_jv80_state, empty_init, "Roland", "JV-880 Multi Timbral Synthesizer Module", MACHINE_IS_SKELETON) +SYST(1994, rd500, 0, 0, rd500, rd500, roland_rd500_state, empty_init, "Roland", "RD-500 Digital Piano", MACHINE_IS_SKELETON) diff --git a/src/mame/roland/roland_r8.cpp b/src/mame/roland/roland_r8.cpp index 4280953c9d9..064259cce44 100644 --- a/src/mame/roland/roland_r8.cpp +++ b/src/mame/roland/roland_r8.cpp @@ -79,7 +79,7 @@ R8 mkII doesn't seem to store the tone list in the program ROM. #include "bus/generic/slot.h" #include "cpu/upd78k/upd78k2.h" #include "machine/nvram.h" -#include "sound/rolandpcm.h" +#include "sound/roland_lp.h" #include "softlist_dev.h" #include "speaker.h" diff --git a/src/mame/roland/roland_u20.cpp b/src/mame/roland/roland_u20.cpp index cfa0e9d1b42..04289961732 100644 --- a/src/mame/roland/roland_u20.cpp +++ b/src/mame/roland/roland_u20.cpp @@ -8,7 +8,7 @@ #include "emu.h" #include "cpu/mcs96/i8x9x.h" -#include "sound/rolandpcm.h" +#include "sound/roland_lp.h" #include "speaker.h" -- cgit v1.2.3