diff options
author | Nigel Barnes <Pernod70@users.noreply.github.com> | 2017-08-24 10:31:50 +0100 |
---|---|---|
committer | Nigel Barnes <Pernod70@users.noreply.github.com> | 2017-08-24 12:59:29 +0100 |
commit | 5fdfce856ed7251036803c7a91c69982ab8ff050 (patch) | |
tree | dbd4cdf9c49a384438ab7ac03ab4743bbe28ce84 | |
parent | 942d583270e7fb567b375b27c94ec03b61ca5115 (diff) |
bbc: BeebSID slot device for the 1MHz bus.
-rw-r--r-- | scripts/src/bus.lua | 4 | ||||
-rw-r--r-- | src/devices/bus/bbc/1mhzbus/1mhzbus.cpp | 20 | ||||
-rw-r--r-- | src/devices/bus/bbc/1mhzbus/1mhzbus.h | 3 | ||||
-rw-r--r-- | src/devices/bus/bbc/1mhzbus/beebsid.cpp | 78 | ||||
-rw-r--r-- | src/devices/bus/bbc/1mhzbus/beebsid.h | 47 | ||||
-rw-r--r-- | src/mame/drivers/bbc.cpp | 5 |
6 files changed, 137 insertions, 20 deletions
diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index 0321bbdf922..bbf1f35bd52 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -277,6 +277,8 @@ if (BUSES["BBC_1MHZBUS"]~=null) then files { MAME_DIR .. "src/devices/bus/bbc/1mhzbus/1mhzbus.cpp", MAME_DIR .. "src/devices/bus/bbc/1mhzbus/1mhzbus.h", + MAME_DIR .. "src/devices/bus/bbc/1mhzbus/beebsid.cpp", + MAME_DIR .. "src/devices/bus/bbc/1mhzbus/beebsid.h", MAME_DIR .. "src/devices/bus/bbc/1mhzbus/opus3.cpp", MAME_DIR .. "src/devices/bus/bbc/1mhzbus/opus3.h", } @@ -3129,7 +3131,7 @@ if (BUSES["CBUS"]~=null) then MAME_DIR .. "src/devices/bus/cbus/pc9801_118.cpp", MAME_DIR .. "src/devices/bus/cbus/pc9801_118.h", MAME_DIR .. "src/devices/bus/cbus/pc9801_amd98.cpp", - MAME_DIR .. "src/devices/bus/cbus/pc9801_amd98.h", + MAME_DIR .. "src/devices/bus/cbus/pc9801_amd98.h", MAME_DIR .. "src/devices/bus/cbus/mpu_pc98.cpp", MAME_DIR .. "src/devices/bus/cbus/mpu_pc98.h", MAME_DIR .. "src/devices/bus/cbus/pc9801_cbus.cpp", diff --git a/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp b/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp index a03d3b439ee..023412f7e7c 100644 --- a/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp +++ b/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp @@ -107,37 +107,27 @@ void bbc_1mhzbus_slot_device::device_reset() //#include "ieee488.h" //#include "music500.h" //#include "music5000.h" +//#include "multiform.h" #include "opus3.h" //#include "ramdisc.h" //#include "torchg400.h" //#include "torchg800.h" -//#include "beebsid.h" +#include "beebsid.h" //#include "prisma3.h" -SLOT_INTERFACE_START(bbcb_1mhzbus_devices) +SLOT_INTERFACE_START(bbc_1mhzbus_devices) // SLOT_INTERFACE("teletext", BBC_TELETEXT) /* Acorn ANE01 Teletext Adapter */ // SLOT_INTERFACE("ieee488", BBC_IEEE488) /* Acorn ANK01 IEEE488 Interface */ // SLOT_INTERFACE("music500", BBC_MUSIC500) /* Acorn ANV02 Music500 */ // SLOT_INTERFACE("music2000", BBC_MUSIC2000) /* Hybrid Music 2000 MIDI Interface */ // SLOT_INTERFACE("music3000", BBC_MUSIC3000) /* Hybrid Music 3000 Expander */ // SLOT_INTERFACE("music5000", BBC_MUSIC5000) /* Hybrid Music 5000 Synthesiser */ +// SLOT_INTERFACE("multiform", BBC_MULTIFORM) /* Technomatic Multiform Z80 */ SLOT_INTERFACE("opus3", BBC_OPUS3) /* Opus Challenger 3 */ // SLOT_INTERFACE("ramdisc", BBC_RAMDISC) /* Morley Electronics RAM Disc */ // SLOT_INTERFACE("torchg400", BBC_TORCHG400) /* Torch Graduate G400 */ // SLOT_INTERFACE("torchg800", BBC_TORCHG800) /* Torch Graduate G800 */ -// SLOT_INTERFACE("beebsid", BBC_BEEBSID) /* BeebSID */ -// SLOT_INTERFACE("prisma3", BBC_PRISMA3) /* Prisma 3 - Millipede 1989 */ -SLOT_INTERFACE_END - -SLOT_INTERFACE_START( bbcm_1mhzbus_devices ) -// SLOT_INTERFACE("teletext", BBC_TELETEXT) /* Acorn ANE01 Teletext Adapter */ -// SLOT_INTERFACE("ieee488", BBC_IEEE488) /* Acorn ANK01 IEEE488 Interface */ -// SLOT_INTERFACE("music500", BBC_MUSIC500) /* Acorn ANV02 Music500 */ -// SLOT_INTERFACE("music2000", BBC_MUSIC2000) /* Hybrid Music 2000 MIDI Interface */ -// SLOT_INTERFACE("music3000", BBC_MUSIC3000) /* Hybrid Music 3000 Expander */ -// SLOT_INTERFACE("music5000", BBC_MUSIC5000) /* Hybrid Music 5000 Synthesiser */ -// SLOT_INTERFACE("ramdisc", BBC_RAMDISC) /* Morley Electronics RAM Disc */ -// SLOT_INTERFACE("beebsid", BBC_BEEBSID) /* BeebSID */ + SLOT_INTERFACE("beebsid", BBC_BEEBSID) /* BeebSID */ // SLOT_INTERFACE("prisma3", BBC_PRISMA3) /* Prisma 3 - Millipede 1989 */ SLOT_INTERFACE_END diff --git a/src/devices/bus/bbc/1mhzbus/1mhzbus.h b/src/devices/bus/bbc/1mhzbus/1mhzbus.h index 450e7fd8357..a05d3d7eb12 100644 --- a/src/devices/bus/bbc/1mhzbus/1mhzbus.h +++ b/src/devices/bus/bbc/1mhzbus/1mhzbus.h @@ -162,8 +162,7 @@ protected: // device type definition DECLARE_DEVICE_TYPE(BBC_1MHZBUS_SLOT, bbc_1mhzbus_slot_device) -SLOT_INTERFACE_EXTERN( bbcb_1mhzbus_devices ); -SLOT_INTERFACE_EXTERN( bbcm_1mhzbus_devices ); +SLOT_INTERFACE_EXTERN( bbc_1mhzbus_devices ); #endif // MAME_BUS_BBC_1MHZBUS_1MHZBUS_H diff --git a/src/devices/bus/bbc/1mhzbus/beebsid.cpp b/src/devices/bus/bbc/1mhzbus/beebsid.cpp new file mode 100644 index 00000000000..a86c31f67f3 --- /dev/null +++ b/src/devices/bus/bbc/1mhzbus/beebsid.cpp @@ -0,0 +1,78 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + BeebSID emulation + +**********************************************************************/ + + +#include "emu.h" +#include "beebsid.h" +#include "speaker.h" + + +//************************************************************************** +// MACROS / CONSTANTS +//************************************************************************** + +#define MOS8580_TAG "mos8580" + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +DEFINE_DEVICE_TYPE(BBC_BEEBSID, bbc_beebsid_device, "beebsid", "BeebSID") + + +//------------------------------------------------- +// device_add_mconfig - add device configuration +//------------------------------------------------- + +MACHINE_CONFIG_MEMBER(bbc_beebsid_device::device_add_mconfig ) + MCFG_SPEAKER_STANDARD_MONO("speaker") + MCFG_SOUND_ADD(MOS8580_TAG, MOS8580, XTAL_16MHz / 16) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) + + MCFG_BBC_PASSTHRU_1MHZBUS_SLOT_ADD() +MACHINE_CONFIG_END + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// bbc_beebsid_device - constructor +//------------------------------------------------- + +bbc_beebsid_device::bbc_beebsid_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, BBC_BEEBSID, tag, owner, clock), + device_bbc_1mhzbus_interface(mconfig, *this), + m_sid(*this, MOS8580_TAG) +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void bbc_beebsid_device::device_start() +{ + address_space& space = machine().device("maincpu")->memory().space(AS_PROGRAM); + m_slot = dynamic_cast<bbc_1mhzbus_slot_device *>(owner()); + + space.install_readwrite_handler(0xfc20, 0xfc3f, read8_delegate(FUNC(mos8580_device::read), (mos8580_device*)m_sid), write8_delegate(FUNC(mos8580_device::write), (mos8580_device*)m_sid)); +} + + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void bbc_beebsid_device::device_reset() +{ + m_sid->reset(); +} diff --git a/src/devices/bus/bbc/1mhzbus/beebsid.h b/src/devices/bus/bbc/1mhzbus/beebsid.h new file mode 100644 index 00000000000..e8c15c4fb6b --- /dev/null +++ b/src/devices/bus/bbc/1mhzbus/beebsid.h @@ -0,0 +1,47 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + BeebSID emulation + +**********************************************************************/ + +#ifndef MAME_BUS_BBC_1MHZBUS_BEEBSID_H +#define MAME_BUS_BBC_1MHZBUS_BEEBSID_H + +#include "1mhzbus.h" +#include "sound/mos6581.h" + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> bbc_beebsid_device + +class bbc_beebsid_device : + public device_t, + public device_bbc_1mhzbus_interface +{ +public: + // construction/destruction + bbc_beebsid_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + +protected: + // device-level overrides + virtual void device_start() override; + virtual void device_reset() override; + + // optional information overrides + virtual void device_add_mconfig(machine_config &config) override; + +private: + required_device<mos8580_device> m_sid; +}; + + +// device type definition +DECLARE_DEVICE_TYPE(BBC_BEEBSID, bbc_beebsid_device) + + +#endif // MAME_BUS_BBC_1MHZBUS_BEEBSID_H diff --git a/src/mame/drivers/bbc.cpp b/src/mame/drivers/bbc.cpp index edf06c85b54..a2660c71bc3 100644 --- a/src/mame/drivers/bbc.cpp +++ b/src/mame/drivers/bbc.cpp @@ -302,6 +302,7 @@ INPUT_CHANGED_MEMBER(bbc_state::trigger_reset) if (m_rtc) m_rtc->reset(); if (m_fdc) m_fdc->reset(); if (m_i8271) m_i8271->reset(); + if (m_1mhzbus) m_1mhzbus->reset(); } } @@ -984,7 +985,7 @@ static MACHINE_CONFIG_DERIVED( bbcb, bbca ) MCFG_BBC_ANALOGUE_SLOT_ADD("analogue", bbc_analogue_devices, "acornjoy") /* 1mhz bus port */ - MCFG_BBC_1MHZBUS_SLOT_ADD("1mhzbus", bbcb_1mhzbus_devices, nullptr) + MCFG_BBC_1MHZBUS_SLOT_ADD("1mhzbus", bbc_1mhzbus_devices, nullptr) MCFG_BBC_1MHZBUS_SLOT_IRQ_HANDLER(DEVWRITELINE("irqs", input_merger_device, in_w<3>)) MCFG_BBC_1MHZBUS_SLOT_NMI_HANDLER(WRITELINE(bbc_state, bus_nmi_w)) @@ -1447,7 +1448,7 @@ static MACHINE_CONFIG_START( bbcm ) MCFG_BBC_ANALOGUE_SLOT_ADD("analogue", bbc_analogue_devices, "acornjoy") /* 1mhz bus port */ - MCFG_BBC_1MHZBUS_SLOT_ADD("1mhzbus", bbcm_1mhzbus_devices, nullptr) + MCFG_BBC_1MHZBUS_SLOT_ADD("1mhzbus", bbc_1mhzbus_devices, nullptr) MCFG_BBC_1MHZBUS_SLOT_IRQ_HANDLER(DEVWRITELINE("irqs", input_merger_device, in_w<3>)) MCFG_BBC_1MHZBUS_SLOT_NMI_HANDLER(WRITELINE(bbc_state, bus_nmi_w)) |