bbc: BeebSID slot device for the 1MHz bus.

This commit is contained in:
Nigel Barnes 2017-08-24 10:31:50 +01:00
parent 942d583270
commit 5fdfce856e
6 changed files with 137 additions and 20 deletions

View File

@ -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",

View File

@ -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

View File

@ -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

View File

@ -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();
}

View File

@ -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

View File

@ -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))