From 4c776b71ba9ae7bae9cfefebf7fd929c8570ce9a Mon Sep 17 00:00:00 2001 From: Nigel Barnes Date: Tue, 18 Oct 2022 20:13:34 +0100 Subject: bus/electron: Added Millsgrade Voxbox Speech Synthesiser. --- scripts/src/bus.lua | 2 + src/devices/bus/electron/exp.cpp | 4 +- src/devices/bus/electron/voxbox.cpp | 100 ++++++++++++++++++++++++++++++++++++ src/devices/bus/electron/voxbox.h | 54 +++++++++++++++++++ 4 files changed, 158 insertions(+), 2 deletions(-) create mode 100644 src/devices/bus/electron/voxbox.cpp create mode 100644 src/devices/bus/electron/voxbox.h diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index 6dbd217018c..8e3d98ab6d6 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -1242,6 +1242,8 @@ if (BUSES["ELECTRON"]~=null) then MAME_DIR .. "src/devices/bus/electron/romboxp.h", MAME_DIR .. "src/devices/bus/electron/sidewndr.cpp", MAME_DIR .. "src/devices/bus/electron/sidewndr.h", + MAME_DIR .. "src/devices/bus/electron/voxbox.cpp", + MAME_DIR .. "src/devices/bus/electron/voxbox.h", MAME_DIR .. "src/devices/bus/electron/m2105.cpp", MAME_DIR .. "src/devices/bus/electron/m2105.h", } diff --git a/src/devices/bus/electron/exp.cpp b/src/devices/bus/electron/exp.cpp index 6198b1abd0f..6e9b1c6a2e4 100644 --- a/src/devices/bus/electron/exp.cpp +++ b/src/devices/bus/electron/exp.cpp @@ -114,7 +114,7 @@ void electron_expansion_slot_device::expbus_w(offs_t offset, uint8_t data) #include "romboxp.h" #include "sidewndr.h" #include "m2105.h" -//#include "voxbox.h" +#include "voxbox.h" void electron_expansion_devices(device_slot_interface &device) @@ -136,5 +136,5 @@ void electron_expansion_devices(device_slot_interface &device) device.option_add("romboxp", ELECTRON_ROMBOXP); device.option_add("sidewndr", ELECTRON_SIDEWNDR); device.option_add("m2105", ELECTRON_M2105); - //device.option_add("voxbox", ELECTRON_VOXBOX); + device.option_add("voxbox", ELECTRON_VOXBOX); } diff --git a/src/devices/bus/electron/voxbox.cpp b/src/devices/bus/electron/voxbox.cpp new file mode 100644 index 00000000000..7d73d21ea92 --- /dev/null +++ b/src/devices/bus/electron/voxbox.cpp @@ -0,0 +1,100 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Millsgrade Voxbox Speech Synthesiser + +**********************************************************************/ + +#include "emu.h" +#include "voxbox.h" +#include "speaker.h" + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +DEFINE_DEVICE_TYPE(ELECTRON_VOXBOX, electron_voxbox_device, "electron_voxbox", "Millsgrade Voxbox Speech Synthesiser") + + +//------------------------------------------------- +// ROM( voxbox ) +//------------------------------------------------- + +ROM_START( voxbox ) + ROM_REGION(0x10000, "sp0256", 0) + ROM_LOAD( "sp0256a-al2.bin", 0x1000, 0x0800, CRC(b504ac15) SHA1(e60fcb5fa16ff3f3b69d36c7a6e955744d3feafc) ) +ROM_END + + +//------------------------------------------------- +// rom_region - device-specific ROM region +//------------------------------------------------- + +const tiny_rom_entry *electron_voxbox_device::device_rom_region() const +{ + return ROM_NAME( voxbox ); +} + + +//------------------------------------------------- +// device_add_mconfig - add device configuration +//------------------------------------------------- + +void electron_voxbox_device::device_add_mconfig(machine_config &config) +{ + SPEAKER(config, "mono").front_center(); + SP0256(config, m_nsp, DERIVED_CLOCK(1, 4)); + m_nsp->data_request_callback().set(FUNC(electron_voxbox_device::lrq_cb)); + m_nsp->add_route(ALL_OUTPUTS, "mono", 1.0); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// electron_voxbox_device - constructor +//------------------------------------------------- + +electron_voxbox_device::electron_voxbox_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, ELECTRON_VOXBOX, tag, owner, clock) + , device_electron_expansion_interface(mconfig, *this) + , m_nsp(*this, "sp0256") + , m_nmi(1) +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void electron_voxbox_device::device_start() +{ + save_item(NAME(m_nmi)); +} + + +//------------------------------------------------- +// expbus_w - expansion data write +//------------------------------------------------- + +void electron_voxbox_device::expbus_w(offs_t offset, uint8_t data) +{ + if ((offset & 0xff00) == 0xc000) + { + m_nsp->ald_w(offset & 0x3f); + } +} + +WRITE_LINE_MEMBER(electron_voxbox_device::lrq_cb) +{ + if (state != m_nmi) + { + m_nmi = state; + m_slot->nmi_w(state); + } +} diff --git a/src/devices/bus/electron/voxbox.h b/src/devices/bus/electron/voxbox.h new file mode 100644 index 00000000000..cf6d136f2a6 --- /dev/null +++ b/src/devices/bus/electron/voxbox.h @@ -0,0 +1,54 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Millsgrade Voxbox Speech Synthesiser + +**********************************************************************/ + +#ifndef MAME_BUS_ELECTRON_VOXBOX_H +#define MAME_BUS_ELECTRON_VOXBOX_H + +#pragma once + + +#include "exp.h" +#include "sound/sp0256.h" + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> electron_voxbox_device + +class electron_voxbox_device : public device_t, public device_electron_expansion_interface +{ +public: + // construction/destruction + electron_voxbox_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + // optional information overrides + virtual const tiny_rom_entry *device_rom_region() const override; + virtual void device_add_mconfig(machine_config &config) override; + + virtual void expbus_w(offs_t offset, uint8_t data) override; + +protected: + // device-level overrides + virtual void device_start() override; + +private: + required_device m_nsp; + + DECLARE_WRITE_LINE_MEMBER(lrq_cb); + + int m_nmi; +}; + + +// device type definition +DECLARE_DEVICE_TYPE(ELECTRON_VOXBOX, electron_voxbox_device) + + +#endif // MAME_BUS_ELECTRON_VOXBOX_H -- cgit v1.2.3