diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua index 0ac2a6bd64a..0669f3c1dac 100644 --- a/scripts/target/mame/mess.lua +++ b/scripts/target/mame/mess.lua @@ -3421,6 +3421,8 @@ files { MAME_DIR .. "src/mame/audio/jx8p_synth.h", MAME_DIR .. "src/mame/audio/mb63h114.cpp", MAME_DIR .. "src/mame/audio/mb63h114.h", + MAME_DIR .. "src/mame/audio/sa16.cpp", + MAME_DIR .. "src/mame/audio/sa16.h", MAME_DIR .. "src/mame/machine/mb62h195.cpp", MAME_DIR .. "src/mame/machine/mb62h195.h", MAME_DIR .. "src/mame/machine/mb63h149.cpp", diff --git a/src/mame/audio/bu3905.cpp b/src/mame/audio/bu3905.cpp index 734eb8fc287..2f893fad8bc 100644 --- a/src/mame/audio/bu3905.cpp +++ b/src/mame/audio/bu3905.cpp @@ -29,3 +29,7 @@ void bu3905_device::write(offs_t offset, u8 data) { logerror("%s: Writing %02X to offset %X\n", machine().describe_context(), data, offset & 0xf); } + +WRITE_LINE_MEMBER(bu3905_device::axi_w) +{ +} diff --git a/src/mame/audio/bu3905.h b/src/mame/audio/bu3905.h index 883d5fbc908..b1c70f95721 100644 --- a/src/mame/audio/bu3905.h +++ b/src/mame/audio/bu3905.h @@ -45,6 +45,8 @@ public: // construction/destruction void write(offs_t offset, u8 data); + DECLARE_WRITE_LINE_MEMBER(axi_w); + protected: // device-level overrides virtual void device_start() override; diff --git a/src/mame/audio/sa16.cpp b/src/mame/audio/sa16.cpp new file mode 100644 index 00000000000..11e428b4b90 --- /dev/null +++ b/src/mame/audio/sa16.cpp @@ -0,0 +1,113 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/**************************************************************************** + + Roland RF5C36 (15229840) & SA-16 (15229874) Sampler Custom ICs + + Skeleton devices. + + Waveform data is 12 bits, and is normally stored in DRAM banks, though + at least one Roland product also uses ROMs. 16-bit output can be + connected directly to a PCM54 or MD6209 DAC or conditioned through a + MB654419 TVF interface. + + Sampling rate is either 30kHz or 15kHz. + +****************************************************************************/ + +#include "emu.h" +#include "sa16.h" + +//************************************************************************** +// GLOBAL VARIABLES +//************************************************************************** + +// device type definitions +DEFINE_DEVICE_TYPE(RF5C36, rf5c36_device, "rf5c36", "Roland RF5C36 Sampler") +DEFINE_DEVICE_TYPE(SA16, sa16_device, "sa16", "Roland SA-16 Sampler") + + +//************************************************************************** +// DEVICE IMPLEMENTATION +//************************************************************************** + +//------------------------------------------------- +// sa16_base_device - constructor +//------------------------------------------------- + +sa16_base_device::sa16_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, type, tag, owner, clock) + , m_int_callback(*this) + , m_sh_callback(*this) +{ +} + + +//------------------------------------------------- +// rf5c36_device - constructor +//------------------------------------------------- + +rf5c36_device::rf5c36_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : sa16_base_device(mconfig, RF5C36, tag, owner, clock) +{ +} + + +//------------------------------------------------- +// sa16_device - constructor +//------------------------------------------------- + +sa16_device::sa16_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : sa16_base_device(mconfig, SA16, tag, owner, clock) +{ +} + + +//------------------------------------------------- +// device_resolve_objects - resolve objects that +// may be needed for other devices to set +// initial conditions at start time +//------------------------------------------------- + +void sa16_base_device::device_resolve_objects() +{ + m_int_callback.resolve_safe(); + m_sh_callback.resolve_safe(); +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void sa16_base_device::device_start() +{ +} + + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void sa16_base_device::device_reset() +{ +} + + +//------------------------------------------------- +// read - read data to CPU bus +//------------------------------------------------- + +u8 sa16_base_device::read(offs_t offset) +{ + return 0; +} + + +//------------------------------------------------- +// write - write data from CPU bus +//------------------------------------------------- + +void sa16_base_device::write(offs_t offset, u8 data) +{ +} diff --git a/src/mame/audio/sa16.h b/src/mame/audio/sa16.h new file mode 100644 index 00000000000..6c1ea1d75d2 --- /dev/null +++ b/src/mame/audio/sa16.h @@ -0,0 +1,70 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/*************************************************************************** + + Roland RF5C36 (15229840) & SA-16 (15229874) Sampler Custom ICs + +***************************************************************************/ + +#ifndef MAME_MACHINE_SA16_H +#define MAME_MACHINE_SA16_H + +#pragma once + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> sa16_base_device + +class sa16_base_device : public device_t +{ +public: + // callback configuration + auto int_callback() { return m_int_callback.bind(); } + auto sh_callback() { return m_sh_callback.bind(); } + + // CPU read/write handlers + u8 read(offs_t offset); + void write(offs_t offset, u8 data); + +protected: + // base type constructor + sa16_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); + + // device-specific overrides + virtual void device_resolve_objects() override; + virtual void device_start() override; + virtual void device_reset() override; + +private: + // line callbacks + devcb_write_line m_int_callback; + devcb_write_line m_sh_callback; + + // internal state (TODO) +}; + +// ======================> rf5c36_device + +class rf5c36_device : public sa16_base_device +{ +public: + // device type constructor + rf5c36_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +// ======================> sa16_device + +class sa16_device : public sa16_base_device +{ +public: + // device type constructor + sa16_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +// device type declarations +DECLARE_DEVICE_TYPE(RF5C36, rf5c36_device) +DECLARE_DEVICE_TYPE(SA16, sa16_device) + +#endif // MAME_MACHINE_SA16_H diff --git a/src/mame/drivers/roland_s10.cpp b/src/mame/drivers/roland_s10.cpp index 7c198ac45b5..072aef20fa6 100644 --- a/src/mame/drivers/roland_s10.cpp +++ b/src/mame/drivers/roland_s10.cpp @@ -12,6 +12,7 @@ #include "emu.h" #include "audio/bu3905.h" +#include "audio/sa16.h" //#include "bus/midi/midi.h" #include "cpu/mcs51/mcs51.h" #include "machine/i8251.h" @@ -33,6 +34,7 @@ public: , m_io(*this, "io") , m_usart(*this, "usart") , m_lcdc(*this, "lcdc") + , m_sampler(*this, "sampler") { } @@ -60,6 +62,7 @@ protected: required_device m_io; required_device m_usart; required_device m_lcdc; + required_device m_sampler; }; class roland_s220_state : public roland_s10_state @@ -168,7 +171,7 @@ void roland_s10_state::mks100_ext_map(address_map &map) map(0x9000, 0x90ff).mirror(0xf00).w(FUNC(roland_s10_state::led_data_w)); map(0xa000, 0xa0ff).mirror(0xf00).rw(FUNC(roland_s10_state::sw_scan_r), FUNC(roland_s10_state::sw_scan_w)); map(0xc000, 0xc000).mirror(0xfff).w(FUNC(roland_s10_state::led_latch_w)); - //map(0xe000, 0xffff).rw("wave", FUNC(rf5c36_device::read), FUNC(rf5c36_device::write)); + map(0xe000, 0xffff).rw(m_sampler, FUNC(rf5c36_device::read), FUNC(rf5c36_device::write)); } void roland_s10_state::s10_ext_map(address_map &map) @@ -188,7 +191,7 @@ void roland_s220_state::s220_ext_map(address_map &map) map(0x9000, 0x90ff).mirror(0xf00).w(FUNC(roland_s220_state::vca_cv_w)); map(0xa000, 0xa0ff).mirror(0xf00).rw(FUNC(roland_s220_state::sw_scan_r), FUNC(roland_s220_state::sw_scan_w)); map(0xc000, 0xc000).mirror(0xfff).w(FUNC(roland_s220_state::led_latch2_w)); - //map(0xe000, 0xffff).rw("wave", FUNC(rf5c36_device::read), FUNC(rf5c36_device::write)); + map(0xe000, 0xffff).rw(m_sampler, FUNC(rf5c36_device::read), FUNC(rf5c36_device::write)); } @@ -247,7 +250,8 @@ void roland_s10_state::s10(machine_config &config) UPD7001(config, "adc", RES_K(27), CAP_P(47)); - //RF5C36(config, "wave", 26.88_MHz_XTAL); + RF5C36(config, m_sampler, 26.88_MHz_XTAL); + m_sampler->int_callback().set_inputline(m_maincpu, MCS51_INT1_LINE); } void roland_s10_state::mks100(machine_config &config) @@ -283,6 +287,8 @@ void roland_s220_state::s220(machine_config &config) m_lcdc->set_pixel_update_cb(FUNC(roland_s220_state::lcd_pixel_update)); BU3905(config, m_outctrl); + + m_sampler->sh_callback().set(m_outctrl, FUNC(bu3905_device::axi_w)); } diff --git a/src/mame/drivers/roland_s50.cpp b/src/mame/drivers/roland_s50.cpp index 2ca7500c2e2..d05f54b332b 100644 --- a/src/mame/drivers/roland_s50.cpp +++ b/src/mame/drivers/roland_s50.cpp @@ -8,6 +8,7 @@ #include "emu.h" #include "audio/bu3905.h" +#include "audio/sa16.h" //#include "bus/midi/midi.h" #include "cpu/mcs96/i8x9x.h" #include "imagedev/floppy.h" @@ -31,6 +32,7 @@ public: , m_fdc(*this, "fdc") , m_floppy(*this, "fdc:0") , m_vdp(*this, "vdp") + , m_wave(*this, "wave") , m_keyscan(*this, "keyscan") { } @@ -64,7 +66,7 @@ protected: required_device m_fdc; required_device m_floppy; optional_device m_vdp; - //required_device m_wave; + required_device m_wave; optional_device m_keyscan; }; @@ -213,7 +215,7 @@ void roland_s50_state::io_map(address_map &map) map(0x1200, 0x1200).r(m_vdp, FUNC(tms3556_device::vram_r)); map(0x1202, 0x1202).rw(m_vdp, FUNC(tms3556_device::initptr_r), FUNC(tms3556_device::vram_w)); map(0x1204, 0x1204).rw(m_vdp, FUNC(tms3556_device::reg_r), FUNC(tms3556_device::reg_w)); - //map(0x0000, 0x3fff).rw(m_wave, FUNC(rf5c16_device::read), FUNC(rf5c16_device::write)).umask16(0xff00); + map(0x0000, 0x3fff).rw(m_wave, FUNC(rf5c36_device::read), FUNC(rf5c36_device::write)).umask16(0xff00); map(0x4000, 0x4fff).mirror(0x3000).rw(FUNC(roland_s50_state::key_r), FUNC(roland_s50_state::key_w)); } @@ -238,7 +240,7 @@ void roland_s550_state::io_map(address_map &map) map(0x2000, 0x2000).w(FUNC(roland_s550_state::sram_bank_w)); map(0x2800, 0x281f).w("outas", FUNC(bu3905_device::write)).umask16(0x00ff); //map(0x3800, 0x381f).rw(m_scsic, FUNC(mb89352_device::read), FUNC(mb89352_device::write)).umask16(0x00ff); - //map(0x0000, 0x3fff).rw(m_wave, FUNC(rf5c16_device::read), FUNC(rf5c16_device::write)).umask16(0xff00); + map(0x0000, 0x3fff).rw(m_wave, FUNC(rf5c36_device::read), FUNC(rf5c36_device::write)).umask16(0xff00); } void roland_w30_state::w30_mem_map(address_map &map) @@ -255,7 +257,7 @@ void roland_w30_state::w30_mem_map(address_map &map) map(0xe400, 0xe403).rw("lcd", FUNC(lm24014h_device::read), FUNC(lm24014h_device::write)).umask16(0x00ff); //map(0xe800, 0xe83f).w("output", FUNC(upd65006gf_376_3b8_device::write)).umask16(0x00ff); //map(0xf000, 0xf01f).rw(m_tvf, FUNC(mb654419u_device::read), FUNC(mb654419u_device::write)).umask16(0x00ff); - //map(0xc000, 0xffff).rw(m_wave, FUNC(sa16_device::read), FUNC(sa16_device::write)).umask16(0xff00); + map(0xc000, 0xffff).rw(m_wave, FUNC(sa16_device::read), FUNC(sa16_device::write)).umask16(0xff00); } #ifdef UNUSED_DEFINITION @@ -265,7 +267,7 @@ void roland_w30_state::s330_mem_map(address_map &map) map(0x2000, 0x3fff).rom().region("program", 0x2000); map(0x4000, 0x7fff).ram().share("common"); map(0x8000, 0xbfff).m(m_psram[1], FUNC(address_map_bank_device::amap16)); - //map(0xc000, 0xffff).rw(m_wave, FUNC(sa16_device::read), FUNC(sa16_device::write)).umask16(0xff00); + map(0xc000, 0xffff).rw(m_wave, FUNC(sa16_device::read), FUNC(sa16_device::write)).umask16(0xff00); } #endif @@ -368,8 +370,8 @@ void roland_s50_state::s50(machine_config &config) TIMER(config, "vdp_timer").configure_scanline(FUNC(roland_s50_state::vdp_timer), "screen", 0, 1); - //RF5C16(config, m_wave, 26.88_MHz_XTAL); - //m_wave->int_callback().set_inputline(m_maincpu, i8x9x_device::HSI0_LINE); + RF5C36(config, m_wave, 26.88_MHz_XTAL); + m_wave->int_callback().set_inputline(m_maincpu, i8x9x_device::HSI0_LINE); } void roland_s550_state::s550(machine_config &config) @@ -396,6 +398,8 @@ void roland_s550_state::s550(machine_config &config) BU3905(config, "outas"); //MB654419U(config, m_tvf, 20_MHz_XTAL); + + m_wave->sh_callback().set("outas", FUNC(bu3905_device::axi_w)); } void roland_w30_state::w30(machine_config &config) @@ -429,8 +433,8 @@ void roland_w30_state::w30(machine_config &config) LM24014H(config, "lcd"); // LCD unit: LM240142 - //R15229874(config, m_wave, 26.88_MHz_XTAL); - //m_wave->int_callback().set_inputline(m_maincpu, i8x9x_device::HSI0_LINE); + SA16(config, m_wave, 26.88_MHz_XTAL); + m_wave->int_callback().set_inputline(m_maincpu, i8x9x_device::HSI0_LINE); //UPD65006GF_376_3B8(config, "output", 26.88_MHz_XTAL); @@ -480,8 +484,9 @@ void roland_w30_state::s330(machine_config &config) TIMER(config, "vdp_timer").configure_scanline(FUNC(roland_w30_state::vdp_timer), "screen", 0, 1); - //R15229874(config, m_wave, 26.88_MHz_XTAL); - //m_wave->int_callback().set_inputline(m_maincpu, i8x9x_device::HSI0_LINE); + SA16(config, m_wave, 26.88_MHz_XTAL); + m_wave->int_callback().set_inputline(m_maincpu, i8x9x_device::HSI0_LINE); + m_wave->sh_callback().set("outas", FUNC(bu3905_device::axi_w)); BU3905(config, "outas");