From 1c463815adbce34e2135217a2ab525631ef1c704 Mon Sep 17 00:00:00 2001 From: hap Date: Sun, 11 Aug 2024 16:39:51 +0200 Subject: s14001a: use device_rom_interface --- src/devices/sound/s14001a.cpp | 24 +++++-------- src/devices/sound/s14001a.h | 11 +++--- src/mame/fidelity/csc.cpp | 16 ++------- src/mame/fidelity/elite.cpp | 16 ++------- src/mame/fidelity/excel.cpp | 80 ++++++++++++++++++++++++------------------- src/mame/fidelity/vcc.cpp | 23 ++----------- src/mame/fidelity/vsc.cpp | 21 ++---------- src/mame/pinball/st_mp200.cpp | 11 ------ 8 files changed, 67 insertions(+), 135 deletions(-) diff --git a/src/devices/sound/s14001a.cpp b/src/devices/sound/s14001a.cpp index dc98f42088b..0c54622e46d 100644 --- a/src/devices/sound/s14001a.cpp +++ b/src/devices/sound/s14001a.cpp @@ -206,10 +206,9 @@ DEFINE_DEVICE_TYPE(S14001A, s14001a_device, "s14001a", "SSi TSI S14001A") s14001a_device::s14001a_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, S14001A, tag, owner, clock), device_sound_interface(mconfig, *this), - m_SpeechRom(*this, DEVICE_SELF), + device_rom_interface(mconfig, *this), m_stream(nullptr), - m_bsy_handler(*this), - m_ext_read_handler(*this, 0) + m_bsy_handler(*this) { } @@ -313,11 +312,6 @@ void s14001a_device::sound_stream_update(sound_stream &stream, std::vectorupdate(); -} - int s14001a_device::romen_r() { m_stream->update(); @@ -355,10 +349,10 @@ void s14001a_device::set_clock(u32 clock) Device emulation **************************************************************************/ -u8 s14001a_device::readmem(u16 offset, bool phase) +u8 s14001a_device::ReadMem(u16 offset, bool phase) { offset &= 0xfff; // 11-bit internal - return (m_ext_read_handler.isunset()) ? m_SpeechRom[offset & (m_SpeechRom.bytes() - 1)] : m_ext_read_handler(offset); + return read_byte(offset); } bool s14001a_device::Clock() @@ -435,7 +429,7 @@ bool s14001a_device::Clock() LOGMASKED(LOG_SPEAK, "speaking word %02x\n", m_uWord); // use uDAR to load uCWAR 8 msb - m_uCWARP1 = readmem(m_uRomAddrP2, m_bPhase1) << 4; // note use of rom address setup in previous state + m_uCWARP1 = ReadMem(m_uRomAddrP2, m_bPhase1) << 4; // note use of rom address setup in previous state // increment DAR by 4, 2 lsb's count deltas within a byte m_uDAR04To00P1 += 4; if (m_uDAR04To00P1 >= 32) @@ -447,7 +441,7 @@ bool s14001a_device::Clock() break; case states::CWARLSB: - m_uCWARP1 = m_uCWARP2 | (readmem(m_uRomAddrP2, m_bPhase1) >> 4); // setup in previous state + m_uCWARP1 = m_uCWARP2 | (ReadMem(m_uRomAddrP2, m_bPhase1) >> 4); // setup in previous state m_RomAddrP1 = m_uCWARP1; m_uOutputP1 = 7; @@ -455,7 +449,7 @@ bool s14001a_device::Clock() break; case states::DARMSB: - m_uDAR13To05P1 = readmem(m_uRomAddrP2, m_bPhase1) << 1; // 9 bit counter, 8 MSBs from ROM, lsb zeroed + m_uDAR13To05P1 = ReadMem(m_uRomAddrP2, m_bPhase1) << 1; // 9 bit counter, 8 MSBs from ROM, lsb zeroed m_uDAR04To00P1 = 0; m_uCWARP1++; m_RomAddrP1 = m_uCWARP1; @@ -466,7 +460,7 @@ bool s14001a_device::Clock() case states::CTRLBITS: { - u8 data = readmem(m_uRomAddrP2, m_bPhase1); + u8 data = ReadMem(m_uRomAddrP2, m_bPhase1); m_bStopP1 = bool(data & 0x80); m_bVoicedP1 = bool(data & 0x40); @@ -496,7 +490,7 @@ bool s14001a_device::Clock() uDeltaP2 = Mux8To2(m_bVoicedP2, m_uLengthP2 & 0x03, // pitch period quater counter m_uDAR04To00P2 & 0x03, // two bit delta address within byte - readmem(m_uRomAddrP2, m_bPhase1) + ReadMem(m_uRomAddrP2, m_bPhase1) ); CalculateIncrement(m_bVoicedP2, m_uLengthP2 & 0x03, // pitch period quater counter diff --git a/src/devices/sound/s14001a.h b/src/devices/sound/s14001a.h index 60e97a1a32a..151d62de2b1 100644 --- a/src/devices/sound/s14001a.h +++ b/src/devices/sound/s14001a.h @@ -10,14 +10,15 @@ #pragma once -class s14001a_device : public device_t, public device_sound_interface +#include "dirom.h" + +class s14001a_device : public device_t, public device_sound_interface, public device_rom_interface<12> { public: s14001a_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); // configuration helpers auto bsy() { return m_bsy_handler.bind(); } - auto ext_read() { return m_ext_read_handler.bind(); } int busy_r(); // /BUSY (pin 40) int romen_r(); // ROM /EN (pin 9) @@ -26,17 +27,17 @@ public: void set_clock(u32 clock); // set new CLK frequency void set_clock(const XTAL &xtal) { set_clock(xtal.value()); } - void force_update(); // update stream, eg. before external ROM bankswitch protected: // device-level overrides virtual void device_start() override; + virtual void rom_bank_pre_change() override { m_stream->update(); } // sound stream update overrides virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; private: - u8 readmem(u16 offset, bool phase); + u8 ReadMem(u16 offset, bool phase); bool Clock(); // called once to toggle external clock twice enum class states : u8 @@ -51,11 +52,9 @@ private: DELAY }; - required_region_ptr m_SpeechRom; sound_stream * m_stream; devcb_write_line m_bsy_handler; - devcb_read8 m_ext_read_handler; // internal state bool m_bPhase1; // 1 bit internal clock diff --git a/src/mame/fidelity/csc.cpp b/src/mame/fidelity/csc.cpp index 3d2665d412d..5fa23de6250 100644 --- a/src/mame/fidelity/csc.cpp +++ b/src/mame/fidelity/csc.cpp @@ -238,7 +238,6 @@ public: m_display(*this, "display"), m_dac(*this, "dac"), m_speech(*this, "speech"), - m_speech_rom(*this, "speech"), m_language(*this, "language"), m_inputs(*this, "IN.%u", 0) { } @@ -263,14 +262,12 @@ protected: required_device m_display; required_device m_dac; optional_device m_speech; - optional_region_ptr m_speech_rom; optional_region_ptr m_language; optional_ioport_array<9> m_inputs; u8 m_led_data = 0; u8 m_7seg_data = 0; u8 m_inp_mux = 0; - u8 m_speech_bank = 0; // address maps void csc_map(address_map &map); @@ -282,7 +279,6 @@ protected: void update_inputs(); void update_display(); void update_sound(); - u8 speech_r(offs_t offset); u8 pia0_read(offs_t offset); void pia0_write(offs_t offset, u8 data); @@ -303,7 +299,6 @@ void csc_state::machine_start() save_item(NAME(m_led_data)); save_item(NAME(m_7seg_data)); save_item(NAME(m_inp_mux)); - save_item(NAME(m_speech_bank)); } INPUT_CHANGED_MEMBER(csc_state::su9_change_cpu_freq) @@ -390,11 +385,6 @@ void csc_state::update_sound() m_dac->write(BIT(1 << m_inp_mux, 9)); } -u8 csc_state::speech_r(offs_t offset) -{ - return m_speech_rom[m_speech_bank << 12 | offset]; -} - // 6821 PIA 0 @@ -463,11 +453,10 @@ void csc_state::pia1_pa_w(u8 data) void csc_state::pia1_pb_w(u8 data) { // d0: speech ROM A12 - m_speech->force_update(); // update stream to now - m_speech_bank = data & 1; + m_speech->set_rom_bank(data & 1); // d1: TSI START line - m_speech->start_w(data >> 1 & 1); + m_speech->start_w(BIT(data, 1)); // d4: lower TSI volume m_speech->set_output_gain(0, (data & 0x10) ? 0.25 : 1.0); @@ -641,7 +630,6 @@ void csc_state::csc(machine_config &config) // sound hardware SPEAKER(config, "speaker").front_center(); S14001A(config, m_speech, 25000); // R/C circuit, around 25khz - m_speech->ext_read().set(FUNC(csc_state::speech_r)); m_speech->add_route(ALL_OUTPUTS, "speaker", 0.75); DAC_1BIT(config, m_dac).add_route(ALL_OUTPUTS, "speaker", 0.25); diff --git a/src/mame/fidelity/elite.cpp b/src/mame/fidelity/elite.cpp index 3827ada2af7..2255987b20a 100644 --- a/src/mame/fidelity/elite.cpp +++ b/src/mame/fidelity/elite.cpp @@ -115,7 +115,6 @@ public: m_display(*this, "display"), m_dac(*this, "dac"), m_speech(*this, "speech"), - m_speech_rom(*this, "speech"), m_language(*this, "language"), m_inputs(*this, "IN.%u", 0) { } @@ -144,7 +143,6 @@ protected: required_device m_display; required_device m_dac; required_device m_speech; - required_region_ptr m_speech_rom; required_region_ptr m_language; required_ioport_array<2> m_inputs; @@ -152,7 +150,6 @@ protected: u8 m_led_data = 0; u8 m_7seg_data = 0; u8 m_inp_mux = 0; - u8 m_speech_bank = 0; // address maps void pc_map(address_map &map); @@ -162,7 +159,6 @@ protected: // I/O handlers void update_display(); - u8 speech_r(offs_t offset); void segment_w(offs_t offset, u8 data); void led_w(offs_t offset, u8 data); u8 input_r(); @@ -182,7 +178,6 @@ void elite_state::machine_start() save_item(NAME(m_led_data)); save_item(NAME(m_7seg_data)); save_item(NAME(m_inp_mux)); - save_item(NAME(m_speech_bank)); } void elite_state::machine_reset() @@ -215,11 +210,6 @@ void elite_state::update_display() m_display->matrix(1 << m_inp_mux, m_led_data << 8 | seg_data); } -u8 elite_state::speech_r(offs_t offset) -{ - return m_speech_rom[m_speech_bank << 12 | offset]; -} - void elite_state::segment_w(offs_t offset, u8 data) { // a0-a2,d7: digit segment @@ -265,7 +255,7 @@ void elite_state::ppi_porta_w(u8 data) // d0-d5: TSI C0-C5 // d6: TSI START line m_speech->data_w(data & 0x3f); - m_speech->start_w(data >> 6 & 1); + m_speech->start_w(BIT(data, 6)); // d7: printer? (black wire to LED pcb) } @@ -281,8 +271,7 @@ void elite_state::ppi_portc_w(u8 data) m_dac->write(BIT(1 << m_inp_mux, 9)); // d4: speech ROM A12 - m_speech->force_update(); // update stream to now - m_speech_bank = data >> 4 & 1; + m_speech->set_rom_bank(BIT(data, 4)); // d5: lower TSI volume m_speech->set_output_gain(0, (data & 0x20) ? 0.25 : 1.0); @@ -476,7 +465,6 @@ void elite_state::pc(machine_config &config) // sound hardware SPEAKER(config, "speaker").front_center(); S14001A(config, m_speech, 25000); // R/C circuit, around 25khz - m_speech->ext_read().set(FUNC(elite_state::speech_r)); m_speech->add_route(ALL_OUTPUTS, "speaker", 0.75); DAC_1BIT(config, m_dac).add_route(ALL_OUTPUTS, "speaker", 0.25); diff --git a/src/mame/fidelity/excel.cpp b/src/mame/fidelity/excel.cpp index f1cf3de5891..d1b9e47b166 100644 --- a/src/mame/fidelity/excel.cpp +++ b/src/mame/fidelity/excel.cpp @@ -162,10 +162,11 @@ public: m_display(*this, "display"), m_dac(*this, "dac"), m_speech(*this, "speech"), - m_speech_rom(*this, "speech"), m_inputs(*this, "IN.%u", 0) { } + void init_fexcelv(); + // machine configs void fexcel(machine_config &config); void fexcelb(machine_config &config); @@ -189,7 +190,6 @@ private: required_device m_display; required_device m_dac; optional_device m_speech; - optional_region_ptr m_speech_rom; optional_ioport_array<3> m_inputs; u8 m_select = 0; @@ -202,7 +202,7 @@ private: void fexcelb_map(address_map &map); // I/O handlers - u8 speech_r(offs_t offset); + void speech_w(u8 data, u8 mask); void ttl_w(offs_t offset, u8 data); u8 ttl_r(offs_t offset); }; @@ -224,18 +224,39 @@ void excel_state::machine_start() // speech +void excel_state::init_fexcelv() +{ + u8 *rom = memregion("speech")->base(); + const u32 len = memregion("speech")->bytes(); + assert(len == 0x8000); + + // TSI A11 is A12, program controls A11, user controls A13,A14(language switches) + std::vector buf(len); + memcpy(&buf[0], rom, len); + for (int i = 0; i < len; i++) + rom[i] = buf[((i & 0x67ff) | bitswap<2>(i,11,12) << 11) ^ 0x6000]; +} + INPUT_CHANGED_MEMBER(excel_state::speech_bankswitch) { // tied to speech ROM highest bits - m_speech->force_update(); - m_speech_bank = (m_speech_bank & 1) | newval << 1; + m_speech_bank = (m_speech_bank & 1) | (newval << 1 & 6); + m_speech->set_rom_bank(m_speech_bank); } -u8 excel_state::speech_r(offs_t offset) +void excel_state::speech_w(u8 data, u8 mask) { - // TSI A11 is A12, program controls A11, user controls A13,A14(language switches) - offset = (offset & 0x7ff) | (offset << 1 & 0x1000); - return m_speech_rom[offset | (m_speech_bank << 11 & 0x800) | (~m_speech_bank << 12 & 0x6000)]; + // a0-a2,d2 (from ttl_w): 74259(2) to speech board + m_speech_data = (m_speech_data & ~mask) | ((data & 4) ? mask : 0); + + // 74259 Q6: TSI ROM A11 + m_speech_bank = (m_speech_bank & ~1) | BIT(m_speech_data, 6); + m_speech->set_rom_bank(m_speech_bank); + + // Q0-Q5: TSI C0-C5 + // Q7: TSI START line + m_speech->data_w(m_speech_data & 0x3f); + m_speech->start_w(BIT(m_speech_data, 7)); } @@ -268,19 +289,7 @@ void excel_state::ttl_w(offs_t offset, u8 data) // speech (model 6092) if (m_speech != nullptr) - { - // a0-a2,d2: 74259(2) to speech board - m_speech_data = (m_speech_data & ~mask) | ((data & 4) ? mask : 0); - - // 74259 Q6: TSI ROM A11 - m_speech->force_update(); // update stream to now - m_speech_bank = (m_speech_bank & ~1) | (m_speech_data >> 6 & 1); - - // Q0-Q5: TSI C0-C5 - // Q7: TSI START line - m_speech->data_w(m_speech_data & 0x3f); - m_speech->start_w(m_speech_data >> 7 & 1); - } + speech_w(data, mask); } u8 excel_state::ttl_r(offs_t offset) @@ -468,7 +477,6 @@ void excel_state::fexcelv(machine_config &config) // sound hardware S14001A(config, m_speech, 25000); // R/C circuit, around 25khz - m_speech->ext_read().set(FUNC(excel_state::speech_r)); m_speech->add_route(ALL_OUTPUTS, "speaker", 0.75); } @@ -551,16 +559,16 @@ ROM_END Drivers *******************************************************************************/ -// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -SYST( 1987, fexcel, 0, 0, fexcelb, fexcelb, excel_state, empty_init, "Fidelity International", "The Excellence (model 6080B)", MACHINE_SUPPORTS_SAVE ) -SYST( 1987, fexcelv, fexcel, 0, fexcelv, fexcelv, excel_state, empty_init, "Fidelity International", "Voice Excellence", MACHINE_SUPPORTS_SAVE ) -SYST( 1987, fexceld, fexcel, 0, fexceld, fexcelb, excel_state, empty_init, "Fidelity International", "Excel Display", MACHINE_SUPPORTS_SAVE ) -SYST( 1985, fexcel12, fexcel, 0, fexcel, fexcel, excel_state, empty_init, "Fidelity International", "The Excellence (model EP12, set 1)", MACHINE_SUPPORTS_SAVE ) // 1st version of The Excellence -SYST( 1985, fexcel124, fexcel, 0, fexcel4, fexcel, excel_state, empty_init, "Fidelity International", "The Excellence (model EP12, set 2)", MACHINE_SUPPORTS_SAVE ) -SYST( 1985, fexcela, fexcel, 0, fexcel, fexcel, excel_state, empty_init, "Fidelity International", "The Excellence (model 6080)", MACHINE_SUPPORTS_SAVE ) - -SYST( 1986, fexcelp, 0, 0, fexcelp, fexcel, excel_state, empty_init, "Fidelity International", "The Par Excellence", MACHINE_SUPPORTS_SAVE ) -SYST( 1986, fexcelpb, fexcelp, 0, fexcelp, fexcel, excel_state, empty_init, "Fidelity International", "The Par Excellence (rev. B)", MACHINE_SUPPORTS_SAVE ) -SYST( 1986, granits, fexcelp, 0, granits, fexcel, excel_state, empty_init, "hack (Remote Control Systems)", "Granit S", MACHINE_SUPPORTS_SAVE ) -SYST( 1988, fdes2000, fexcelp, 0, fdes2000, fdes, excel_state, empty_init, "Fidelity International", "Designer 2000", MACHINE_SUPPORTS_SAVE ) -SYST( 1988, fdes2100, fexcelp, 0, fdes2100, fdes, excel_state, empty_init, "Fidelity International", "Designer 2100", MACHINE_SUPPORTS_SAVE ) +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS +SYST( 1987, fexcel, 0, 0, fexcelb, fexcelb, excel_state, empty_init, "Fidelity International", "The Excellence (model 6080B)", MACHINE_SUPPORTS_SAVE ) +SYST( 1987, fexcelv, fexcel, 0, fexcelv, fexcelv, excel_state, init_fexcelv, "Fidelity International", "Voice Excellence", MACHINE_SUPPORTS_SAVE ) +SYST( 1987, fexceld, fexcel, 0, fexceld, fexcelb, excel_state, empty_init, "Fidelity International", "Excel Display", MACHINE_SUPPORTS_SAVE ) +SYST( 1985, fexcel12, fexcel, 0, fexcel, fexcel, excel_state, empty_init, "Fidelity International", "The Excellence (model EP12, set 1)", MACHINE_SUPPORTS_SAVE ) // 1st version of The Excellence +SYST( 1985, fexcel124, fexcel, 0, fexcel4, fexcel, excel_state, empty_init, "Fidelity International", "The Excellence (model EP12, set 2)", MACHINE_SUPPORTS_SAVE ) +SYST( 1985, fexcela, fexcel, 0, fexcel, fexcel, excel_state, empty_init, "Fidelity International", "The Excellence (model 6080)", MACHINE_SUPPORTS_SAVE ) + +SYST( 1986, fexcelp, 0, 0, fexcelp, fexcel, excel_state, empty_init, "Fidelity International", "The Par Excellence", MACHINE_SUPPORTS_SAVE ) +SYST( 1986, fexcelpb, fexcelp, 0, fexcelp, fexcel, excel_state, empty_init, "Fidelity International", "The Par Excellence (rev. B)", MACHINE_SUPPORTS_SAVE ) +SYST( 1986, granits, fexcelp, 0, granits, fexcel, excel_state, empty_init, "hack (Remote Control Systems)", "Granit S", MACHINE_SUPPORTS_SAVE ) +SYST( 1988, fdes2000, fexcelp, 0, fdes2000, fdes, excel_state, empty_init, "Fidelity International", "Designer 2000", MACHINE_SUPPORTS_SAVE ) +SYST( 1988, fdes2100, fexcelp, 0, fdes2100, fdes, excel_state, empty_init, "Fidelity International", "Designer 2100", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/fidelity/vcc.cpp b/src/mame/fidelity/vcc.cpp index 88f6b679b1a..031b245731e 100644 --- a/src/mame/fidelity/vcc.cpp +++ b/src/mame/fidelity/vcc.cpp @@ -126,7 +126,6 @@ public: m_ppi8255(*this, "ppi8255"), m_display(*this, "display"), m_speech(*this, "speech"), - m_speech_rom(*this, "speech"), m_language(*this, "language"), m_inputs(*this, "IN.%u", 0) { } @@ -146,14 +145,12 @@ private: required_device m_ppi8255; required_device m_display; required_device m_speech; - required_region_ptr m_speech_rom; required_region_ptr m_language; required_ioport_array<4> m_inputs; u8 m_led_select = 0; u8 m_7seg_data = 0; u8 m_inp_mux = 0; - u8 m_speech_bank = 0; // address maps void main_map(address_map &map); @@ -161,7 +158,6 @@ private: // I/O handlers void update_display(); - u8 speech_r(offs_t offset); void ppi_porta_w(u8 data); u8 ppi_portb_r(); void ppi_portb_w(u8 data); @@ -175,7 +171,6 @@ void vcc_state::machine_start() save_item(NAME(m_led_select)); save_item(NAME(m_7seg_data)); save_item(NAME(m_inp_mux)); - save_item(NAME(m_speech_bank)); // game relies on RAM filled with FF at power-on for (int i = 0; i < 0x400; i++) @@ -188,8 +183,6 @@ void vcc_state::machine_start() I/O *******************************************************************************/ -// misc handlers - void vcc_state::update_display() { // 4 7seg leds (note: sel d0 for extra leds) @@ -197,14 +190,6 @@ void vcc_state::update_display() m_display->matrix(m_led_select >> 2 & 0xf, outdata); } -u8 vcc_state::speech_r(offs_t offset) -{ - return m_speech_rom[m_speech_bank << 12 | offset]; -} - - -// I8255 PPI - void vcc_state::ppi_porta_w(u8 data) { // d0-d6: digit segment data, bits are xABCDEFG @@ -214,15 +199,12 @@ void vcc_state::ppi_porta_w(u8 data) // d0-d5: TSI C0-C5 // d7: TSI START line m_speech->data_w(data & 0x3f); - m_speech->start_w(data >> 7 & 1); + m_speech->start_w(BIT(data, 7)); // d6: language latch data // d7: language latch clock (latch on high) if (data & 0x80) - { - m_speech->force_update(); // update stream to now - m_speech_bank = data >> 6 & 1; - } + m_speech->set_rom_bank(BIT(data, 6)); } u8 vcc_state::ppi_portb_r() @@ -346,7 +328,6 @@ void vcc_state::vcc(machine_config &config) // sound hardware SPEAKER(config, "speaker").front_center(); S14001A(config, m_speech, 25000); // R/C circuit, around 25khz - m_speech->ext_read().set(FUNC(vcc_state::speech_r)); m_speech->add_route(ALL_OUTPUTS, "speaker", 0.75); } diff --git a/src/mame/fidelity/vsc.cpp b/src/mame/fidelity/vsc.cpp index 6ec644d238d..fc0f0b78a95 100644 --- a/src/mame/fidelity/vsc.cpp +++ b/src/mame/fidelity/vsc.cpp @@ -176,7 +176,6 @@ public: m_board(*this, "board"), m_display(*this, "display"), m_speech(*this, "speech"), - m_speech_rom(*this, "speech"), m_language(*this, "language"), m_inputs(*this, "IN.%u", 0) { } @@ -195,7 +194,6 @@ private: required_device m_board; required_device m_display; required_device m_speech; - required_region_ptr m_speech_rom; required_region_ptr m_language; required_ioport_array<2> m_inputs; @@ -204,7 +202,6 @@ private: u8 m_cb_mux = 0; u8 m_kp_mux = 0; bool m_lan_switch = false; - u8 m_speech_bank = 0; // address maps void main_map(address_map &map); @@ -214,7 +211,6 @@ private: // I/O handlers void update_display(); - u8 speech_r(offs_t offset); void ppi_porta_w(u8 data); void ppi_portb_w(u8 data); void ppi_portc_w(u8 data); @@ -231,7 +227,6 @@ void vsc_state::machine_start() save_item(NAME(m_cb_mux)); save_item(NAME(m_kp_mux)); save_item(NAME(m_lan_switch)); - save_item(NAME(m_speech_bank)); } @@ -240,7 +235,7 @@ void vsc_state::machine_start() I/O *******************************************************************************/ -// misc handlers +// I8255 PPI void vsc_state::update_display() { @@ -248,14 +243,6 @@ void vsc_state::update_display() m_display->matrix(m_cb_mux, m_led_data << 8 | m_7seg_data); } -u8 vsc_state::speech_r(offs_t offset) -{ - return m_speech_rom[m_speech_bank << 12 | offset]; -} - - -// I8255 PPI - void vsc_state::ppi_porta_w(u8 data) { // d0-d5: TSI C0-C5 @@ -324,11 +311,10 @@ void vsc_state::pio_portb_w(u8 data) m_lan_switch = bool(data & 0x20); // d7: TSI ROM A12 - m_speech->force_update(); // update stream to now - m_speech_bank = data >> 7 & 1; + m_speech->set_rom_bank(BIT(data, 7)); // d6: TSI START line - m_speech->start_w(data >> 6 & 1); + m_speech->start_w(BIT(data, 6)); // d2: lower TSI volume m_speech->set_output_gain(0, (data & 4) ? 0.25 : 1.0); @@ -440,7 +426,6 @@ void vsc_state::vsc(machine_config &config) // sound hardware SPEAKER(config, "speaker").front_center(); S14001A(config, m_speech, 25000); // R/C circuit, around 25khz - m_speech->ext_read().set(FUNC(vsc_state::speech_r)); m_speech->add_route(ALL_OUTPUTS, "speaker", 0.75); } diff --git a/src/mame/pinball/st_mp200.cpp b/src/mame/pinball/st_mp200.cpp index 883e611faca..48a1309548e 100644 --- a/src/mame/pinball/st_mp200.cpp +++ b/src/mame/pinball/st_mp200.cpp @@ -75,7 +75,6 @@ public: : genpin_class(mconfig, type, tag) , m_maincpu(*this, "maincpu") , m_s14001a(*this, "speech") - , m_speech(*this, "speech") , m_pia_u10(*this, "pia_u10") , m_pia_u11(*this, "pia_u11") , m_io_test(*this, "TEST") @@ -116,7 +115,6 @@ private: u8 u11_a_r(); void u11_a_w(u8 data); void u11_b_w(u8 data); - u8 speech_r(offs_t offset); void u10_ca2_w(int state); void u10_cb2_w(int state); void u11_ca2_w(int state); @@ -140,7 +138,6 @@ private: u8 m_last_solenoid = 31U; required_device m_maincpu; optional_device m_s14001a; - optional_region_ptr m_speech; required_device m_pia_u10; required_device m_pia_u11; required_ioport m_io_test; @@ -426,11 +423,9 @@ void st_mp200_state::u11_ca2_w(int state) } else if (BIT(m_u10a, 6)) { - m_s14001a->force_update(); m_s14001a->set_output_gain(0, ((m_u10a >> 3 & 0xf) + 1) / 16.0); u8 clock_divisor = 16 - (m_u10a & 0x07); - m_s14001a->set_clock(S14001_CLOCK / clock_divisor / 8); } } @@ -570,11 +565,6 @@ void st_mp200_state::u11_b_w(u8 data) m_last_solenoid = data; } -u8 st_mp200_state::speech_r(offs_t offset) -{ - return m_speech[offset]; -} - void st_mp200_state::machine_start() { genpin_class::machine_start(); @@ -677,7 +667,6 @@ void st_mp200_state::st_mp201(machine_config &config) st_mp200(config); SPEAKER(config, "mono").front_center(); S14001A(config, m_s14001a, S14001_CLOCK).add_route(ALL_OUTPUTS, "mono", 1.00); - m_s14001a->ext_read().set(FUNC(st_mp200_state::speech_r)); } void st_mp200_state::st_sam4(machine_config &config) -- cgit v1.2.3