diff options
author | Nigel Barnes <Pernod70@users.noreply.github.com> | 2019-03-14 14:01:32 +0000 |
---|---|---|
committer | Nigel Barnes <Pernod70@users.noreply.github.com> | 2019-03-14 14:01:32 +0000 |
commit | 3a8fc3967b1632117ecaff849dcbd4e924d34e75 (patch) | |
tree | 1e7baff821f2cc126a7894b3785f7cc82598d33f | |
parent | 596c68e75559ef3b8f4aba82f3347091fbfde02e (diff) |
spectrum: Added the Cheetah SpecDrum device.
-rw-r--r-- | scripts/src/bus.lua | 2 | ||||
-rw-r--r-- | src/devices/bus/spectrum/exp.cpp | 3 | ||||
-rw-r--r-- | src/devices/bus/spectrum/specdrum.cpp | 73 | ||||
-rw-r--r-- | src/devices/bus/spectrum/specdrum.h | 51 |
4 files changed, 129 insertions, 0 deletions
diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index b12bd630ce2..142927e64e0 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -3307,6 +3307,8 @@ if (BUSES["SPECTRUM"]~=null) then MAME_DIR .. "src/devices/bus/spectrum/plus2test.h", MAME_DIR .. "src/devices/bus/spectrum/protek.cpp", MAME_DIR .. "src/devices/bus/spectrum/protek.h", + MAME_DIR .. "src/devices/bus/spectrum/specdrum.cpp", + MAME_DIR .. "src/devices/bus/spectrum/specdrum.h", MAME_DIR .. "src/devices/bus/spectrum/uslot.cpp", MAME_DIR .. "src/devices/bus/spectrum/uslot.h", MAME_DIR .. "src/devices/bus/spectrum/usource.cpp", diff --git a/src/devices/bus/spectrum/exp.cpp b/src/devices/bus/spectrum/exp.cpp index ec71d31617a..b93be6c7162 100644 --- a/src/devices/bus/spectrum/exp.cpp +++ b/src/devices/bus/spectrum/exp.cpp @@ -171,6 +171,7 @@ void spectrum_expansion_slot_device::mreq_w(offs_t offset, uint8_t data) #include "plus2test.h" //#include "plusd.h" #include "protek.h" +#include "specdrum.h" #include "uslot.h" #include "usource.h" #include "uspeech.h" @@ -192,6 +193,7 @@ void spectrum_expansion_devices(device_slot_interface &device) //device.option_add("opus", SPECTRUM_OPUS); //device.option_add("plusd", SPECTRUM_PLUSD); device.option_add("protek", SPECTRUM_PROTEK); + device.option_add("specdrum", SPECTRUM_SPECDRUM); device.option_add("uslot", SPECTRUM_USLOT); device.option_add("usource", SPECTRUM_USOURCE); device.option_add("uspeech", SPECTRUM_USPEECH); @@ -209,6 +211,7 @@ void spec128_expansion_devices(device_slot_interface &device) device.option_add("mprint", SPECTRUM_MPRINT); device.option_add("plus2test", SPECTRUM_PLUS2TEST); device.option_add("protek", SPECTRUM_PROTEK); + device.option_add("specdrum", SPECTRUM_SPECDRUM); } void specpls3_expansion_devices(device_slot_interface &device) diff --git a/src/devices/bus/spectrum/specdrum.cpp b/src/devices/bus/spectrum/specdrum.cpp new file mode 100644 index 00000000000..9c809a1b36a --- /dev/null +++ b/src/devices/bus/spectrum/specdrum.cpp @@ -0,0 +1,73 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Cheetah Marketing SpecDrum emulation + +**********************************************************************/ + +#include "emu.h" +#include "specdrum.h" +#include "sound/volt_reg.h" +#include "speaker.h" + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +DEFINE_DEVICE_TYPE(SPECTRUM_SPECDRUM, spectrum_specdrum_device, "spectrum_specdrum", "SpecDrum") + + +//------------------------------------------------- +// device_add_mconfig - add device configuration +//------------------------------------------------- + +void spectrum_specdrum_device::device_add_mconfig(machine_config &config) +{ + SPEAKER(config, "speaker").front_center(); + ZN428E(config, m_dac, 0).add_route(ALL_OUTPUTS, "speaker", 0.5); + voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref")); + vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT); + vref.add_route(0, "dac", -1.0, DAC_VREF_NEG_INPUT); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// spectrum_specdrum_device - constructor +//------------------------------------------------- + +spectrum_specdrum_device::spectrum_specdrum_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, SPECTRUM_SPECDRUM, tag, owner, clock) + , device_spectrum_expansion_interface(mconfig, *this) + , m_dac(*this, "dac") +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void spectrum_specdrum_device::device_start() +{ +} + + +//************************************************************************** +// IMPLEMENTATION +//************************************************************************** + +void spectrum_specdrum_device::iorq_w(offs_t offset, uint8_t data) +{ + switch (offset & 0x00ff) + { + case 0xdf: + m_dac->write(data); + break; + } +} diff --git a/src/devices/bus/spectrum/specdrum.h b/src/devices/bus/spectrum/specdrum.h new file mode 100644 index 00000000000..7412a8509c0 --- /dev/null +++ b/src/devices/bus/spectrum/specdrum.h @@ -0,0 +1,51 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Cheetah Marketing SpecDrum emulation + +**********************************************************************/ + +#ifndef MAME_BUS_SPECTRUM_SPECDRUM_H +#define MAME_BUS_SPECTRUM_SPECDRUM_H + +#pragma once + + +#include "exp.h" +#include "sound/dac.h" + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> spectrum_specdrum_device + +class spectrum_specdrum_device : + public device_t, + public device_spectrum_expansion_interface +{ +public: + // construction/destruction + spectrum_specdrum_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + +protected: + // device-level overrides + virtual void device_start() override; + + // optional information overrides + virtual void device_add_mconfig(machine_config &config) override; + + virtual void iorq_w(offs_t offset, uint8_t data) override; + +private: + required_device<dac_byte_interface> m_dac; +}; + + +// device type definition +DECLARE_DEVICE_TYPE(SPECTRUM_SPECDRUM, spectrum_specdrum_device) + + +#endif // MAME_BUS_SPECTRUM_SPECDRUM_H |