From fb3539ce0c26598adf08021c2ebfa3fb931172f9 Mon Sep 17 00:00:00 2001 From: Nigel Barnes Date: Fri, 16 Feb 2024 18:10:35 +0000 Subject: bus/bbc/1mhzbus: Added The Barry-Box (not working) --- scripts/src/bus.lua | 2 + src/devices/bus/bbc/1mhzbus/1mhzbus.cpp | 15 +++-- src/devices/bus/bbc/1mhzbus/1mhzbus.h | 4 +- src/devices/bus/bbc/1mhzbus/barrybox.cpp | 101 +++++++++++++++++++++++++++++++ src/devices/bus/bbc/1mhzbus/barrybox.h | 11 ++++ 5 files changed, 125 insertions(+), 8 deletions(-) create mode 100644 src/devices/bus/bbc/1mhzbus/barrybox.cpp create mode 100644 src/devices/bus/bbc/1mhzbus/barrybox.h diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index e914629150a..33646671a1f 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -706,6 +706,8 @@ if (BUSES["BBC_1MHZBUS"]~=null) then MAME_DIR .. "src/devices/bus/bbc/1mhzbus/2ndserial.h", MAME_DIR .. "src/devices/bus/bbc/1mhzbus/autoprom.cpp", MAME_DIR .. "src/devices/bus/bbc/1mhzbus/autoprom.h", + MAME_DIR .. "src/devices/bus/bbc/1mhzbus/barrybox.cpp", + MAME_DIR .. "src/devices/bus/bbc/1mhzbus/barrybox.h", MAME_DIR .. "src/devices/bus/bbc/1mhzbus/beebopl.cpp", MAME_DIR .. "src/devices/bus/bbc/1mhzbus/beebopl.h", MAME_DIR .. "src/devices/bus/bbc/1mhzbus/beebsid.cpp", diff --git a/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp b/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp index ede63f18ead..502952bc185 100644 --- a/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp +++ b/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp @@ -26,10 +26,10 @@ DEFINE_DEVICE_TYPE(BBC_1MHZBUS_SLOT, bbc_1mhzbus_slot_device, "bbc_1mhzbus_slot" // device_bbc_1mhzbus_interface - constructor //------------------------------------------------- -device_bbc_1mhzbus_interface::device_bbc_1mhzbus_interface(const machine_config &mconfig, device_t &device) : - device_interface(device, "bbc1mhzbus") +device_bbc_1mhzbus_interface::device_bbc_1mhzbus_interface(const machine_config &mconfig, device_t &device) + : device_interface(device, "bbc1mhzbus") + , m_slot(dynamic_cast(device.owner())) { - m_slot = dynamic_cast(device.owner()); } @@ -106,6 +106,7 @@ void bbc_1mhzbus_slot_device::jim_w(offs_t offset, uint8_t data) #include "24bbc.h" #include "2ndserial.h" #include "autoprom.h" +#include "barrybox.h" #include "cc500.h" #include "cisco.h" //#include "beebscan.h" @@ -139,15 +140,15 @@ void bbc_1mhzbus_devices(device_slot_interface &device) device.option_add("m500", BBC_M500); /* Acorn ANV02 Music 500 */ device.option_add("awhd", BBC_AWHD); /* Acorn Winchester Disc */ device.option_add("autoprom", BBC_AUTOPROM); /* ATPL AutoPrommer */ + device.option_add("barrybox", BBC_BARRYBOX); /* The Barry-Box */ device.option_add("24bbc", BBC_24BBC); /* Sprow 24bBC/RAM Disc */ device.option_add("2ndserial", BBC_2NDSERIAL); /* Sprow 2nd Serial Port */ device.option_add("beebide", BBC_BEEBIDE); /* Sprow BeebIDE 16-bit */ device.option_add("ide8", BBC_IDE8); /* RetroClinic BBC 8-bit IDE */ //device.option_add("beebscan", BBC_BEEBSCAN); /* Beeb HandScan */ device.option_add("b488", BBC_B488); /* Aries B488 */ - device.option_add("cisco", BBC_CISCO); /* Cisco Terminal */ //device.option_add("videodig", BBC_VIDEODIG); /* Video Digitiser (RH Electronics) */ - device.option_add("emrmidi", BBC_EMRMIDI); /* EMR Midi Interface */ + device.option_add("emrmidi", BBC_EMRMIDI); /* EMR MIDI Interface */ //device.option_add("procyon", BBC_PROCYON); /* CST Procyon IEEE Interface */ device.option_add("m2000", BBC_M2000); /* Hybrid Music 2000 Interface */ device.option_add("m3000", BBC_M3000); /* Hybrid Music 3000 Expander */ @@ -167,6 +168,7 @@ void bbc_1mhzbus_devices(device_slot_interface &device) //device.option_add("prisma3", BBC_PRISMA3); /* PRISMA-3 - Millipede 1989 */ device.option_add("sprite", BBC_SPRITE); /* Logotron Sprite Board */ device.option_add_internal("cfa3000opt", CFA3000_OPT);/* Henson CFA 3000 Option Board */ + device.option_add_internal("cisco", BBC_CISCO); /* Cisco Terminal */ } void bbcm_1mhzbus_devices(device_slot_interface &device) @@ -174,13 +176,14 @@ void bbcm_1mhzbus_devices(device_slot_interface &device) //device.option_add("teletext", BBC_TELETEXT); /* Acorn ANE01 Teletext Adapter */ device.option_add("ieee488", BBC_IEEE488); /* Acorn ANK01 IEEE488 Interface */ device.option_add("awhd", BBC_AWHD); /* Acorn Winchester Disc */ + device.option_add("barrybox", BBC_BARRYBOX); /* The Barry-Box */ device.option_add("24bbc", BBC_24BBC); /* Sprow 24bBC/RAM Disc */ device.option_add("2ndserial", BBC_2NDSERIAL); /* Sprow 2nd Serial Port */ device.option_add("beebide", BBC_BEEBIDE); /* Sprow BeebIDE 16-bit */ device.option_add("ide8", BBC_IDE8); /* RetroClinic BBC 8-bit IDE */ device.option_add("b488", BBC_B488); /* Aries B488 */ //device.option_add("videodig", BBC_VIDEODIG); /* Video Digitiser (RH Electronics) */ - device.option_add("emrmidi", BBC_EMRMIDI); /* EMR Midi Interface */ + device.option_add("emrmidi", BBC_EMRMIDI); /* EMR MIDI Interface */ //device.option_add("procyon", BBC_PROCYON); /* CST Procyon IEEE Interface */ device.option_add("m2000", BBC_M2000); /* Hybrid Music 2000 Interface */ device.option_add("m3000", BBC_M3000); /* Hybrid Music 3000 Expander */ diff --git a/src/devices/bus/bbc/1mhzbus/1mhzbus.h b/src/devices/bus/bbc/1mhzbus/1mhzbus.h index d743cfc3ea5..c1885535645 100644 --- a/src/devices/bus/bbc/1mhzbus/1mhzbus.h +++ b/src/devices/bus/bbc/1mhzbus/1mhzbus.h @@ -116,7 +116,7 @@ public: void nmi_w(int state) { m_nmi_handler(state); } protected: - // device-level overrides + // device_t overrides virtual void device_start() override; device_bbc_1mhzbus_interface *m_card; @@ -140,7 +140,7 @@ public: protected: device_bbc_1mhzbus_interface(const machine_config &mconfig, device_t &device); - bbc_1mhzbus_slot_device *m_slot; + bbc_1mhzbus_slot_device *const m_slot; }; diff --git a/src/devices/bus/bbc/1mhzbus/barrybox.cpp b/src/devices/bus/bbc/1mhzbus/barrybox.cpp new file mode 100644 index 00000000000..1f9dc091c06 --- /dev/null +++ b/src/devices/bus/bbc/1mhzbus/barrybox.cpp @@ -0,0 +1,101 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + The Barry-Box from BML Electronics + + Use with Barry-Box ROM. + +**********************************************************************/ + +#include "emu.h" +#include "barrybox.h" + +#include "sound/dac.h" +#include "speaker.h" + + +namespace { + +class bbc_barrybox_device : public device_t, public device_bbc_1mhzbus_interface +{ +public: + static constexpr feature_type unemulated_features() { return feature::MICROPHONE; } + + bbc_barrybox_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, BBC_BARRYBOX, tag, owner, clock) + , device_bbc_1mhzbus_interface(mconfig, *this) + , m_dac(*this,"dac") + { + } + +protected: + // device_t overrides + virtual void device_start() override; + + // optional information overrides + virtual void device_add_mconfig(machine_config &config) override; + + virtual uint8_t jim_r(offs_t offset) override; + virtual void jim_w(offs_t offset, uint8_t data) override; + +private: + required_device m_dac; +}; + + +//------------------------------------------------- +// device_add_mconfig - add device configuration +//------------------------------------------------- + +void bbc_barrybox_device::device_add_mconfig(machine_config &config) +{ + SPEAKER(config, "speaker").front_center(); + ZN428E(config, m_dac, 0).add_route(ALL_OUTPUTS, "speaker", 0.5); + + // TODO: ZN449E ADC +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void bbc_barrybox_device::device_start() +{ +} + + +//************************************************************************** +// IMPLEMENTATION +//************************************************************************** + +uint8_t bbc_barrybox_device::jim_r(offs_t offset) +{ + uint8_t data = 0x00; + + if (offset & 0x01) + { + // ADC busy? + } + + if (offset & 0x04) + { + //data = m_adc->read(); + } + + return data; +} + +void bbc_barrybox_device::jim_w(offs_t offset, uint8_t data) +{ + if (offset & 0x02) + { + m_dac->write(data); + } +} + +} // anonymous namespace + + +DEFINE_DEVICE_TYPE_PRIVATE(BBC_BARRYBOX, device_bbc_1mhzbus_interface, bbc_barrybox_device, "bbc_barrybox", "The Barry-Box"); diff --git a/src/devices/bus/bbc/1mhzbus/barrybox.h b/src/devices/bus/bbc/1mhzbus/barrybox.h new file mode 100644 index 00000000000..c51164833a9 --- /dev/null +++ b/src/devices/bus/bbc/1mhzbus/barrybox.h @@ -0,0 +1,11 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +#ifndef MAME_BUS_BBC_1MHZBUS_BARRYBOX_H +#define MAME_BUS_BBC_1MHZBUS_BARRYBOX_H + +#include "1mhzbus.h" + + +DECLARE_DEVICE_TYPE(BBC_BARRYBOX, device_bbc_1mhzbus_interface); + +#endif // MAME_BUS_BBC_1MHZBUS_BARRYBOX_H -- cgit v1.2.3