diff options
Diffstat (limited to 'src/devices/bus/bk/covox.cpp')
| -rw-r--r-- | src/devices/bus/bk/covox.cpp | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/src/devices/bus/bk/covox.cpp b/src/devices/bus/bk/covox.cpp new file mode 100644 index 00000000000..5cc72a4e96f --- /dev/null +++ b/src/devices/bus/bk/covox.cpp @@ -0,0 +1,72 @@ +// license:BSD-3-Clause +// copyright-holders:Sergey Svishchev +/*************************************************************************** + + Mono Covox interface with passthrough for loopback cart + (used by "In Your Space" demo.) + +***************************************************************************/ + +#include "emu.h" +#include "covox.h" + + +//************************************************************************** +// CONSTANTS/MACROS +//************************************************************************** + +#define VERBOSE 0 + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +DEFINE_DEVICE_TYPE(BK_COVOX, bk_covox_device, "bk_covox", "Mono Covox Interface") + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// bk_covox_device - constructor +//------------------------------------------------- + +bk_covox_device::bk_covox_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, BK_COVOX, tag, owner, clock) + , device_bk_parallel_interface(mconfig, *this) + , m_dac(*this, "dac") + , m_up(*this, "up") +{ +} + + +//************************************************************************** +// IMPLEMENTATION +//************************************************************************** + +void bk_covox_device::device_add_mconfig(machine_config &config) +{ + SPEAKER(config, "covox").front_center(); + DAC_8BIT_R2R(config, m_dac, 0).add_route(ALL_OUTPUTS, "covox", 0.5); // unknown DAC + + BK_PARALLEL_SLOT(config, m_up, DERIVED_CLOCK(1, 1), bk_parallel_devices, nullptr); +} + +void bk_covox_device::device_start() +{ + save_item(NAME(m_data)); +} + +uint16_t bk_covox_device::io_r() +{ + return m_up->read() ^ 0xffff; +} + +void bk_covox_device::io_w(uint16_t data, bool word) +{ + m_data = data; + m_dac->write(data); + m_up->write(0, data ^ 0xffff, word); +} |
