mirror of
https://github.com/holub/mame
synced 2025-04-23 00:39:36 +03:00
bus/bbc/1mhzbus: Added BeebOPL FM Synthesiser.
This commit is contained in:
parent
ec751fc8c6
commit
b1d16b6c9a
@ -467,6 +467,8 @@ if (BUSES["BBC_1MHZBUS"]~=null) then
|
||||
MAME_DIR .. "src/devices/bus/bbc/1mhzbus/1mhzbus.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/beebopl.cpp",
|
||||
MAME_DIR .. "src/devices/bus/bbc/1mhzbus/beebopl.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/emrmidi.cpp",
|
||||
|
@ -121,6 +121,7 @@ void bbc_1mhzbus_slot_device::jim_w(offs_t offset, uint8_t data)
|
||||
#include "pms64k.h"
|
||||
#include "ramdisc.h"
|
||||
//#include "graduate.h"
|
||||
#include "beebopl.h"
|
||||
#include "beebsid.h"
|
||||
//#include "prisma3.h"
|
||||
#include "sprite.h"
|
||||
@ -145,6 +146,7 @@ void bbc_1mhzbus_devices(device_slot_interface &device)
|
||||
device.option_add("pms64k", BBC_PMS64K); /* PMS 64K Non-Volatile Ram Module */
|
||||
device.option_add("ramdisc", BBC_RAMDISC); /* Morley Electronics RAM Disc */
|
||||
//device.option_add("graduate", BBC_GRADUATE); /* The Torch Graduate G400/G800 */
|
||||
device.option_add("beebopl", BBC_BEEBOPL); /* BeebOPL */
|
||||
device.option_add("beebsid", BBC_BEEBSID); /* BeebSID */
|
||||
//device.option_add("prisma3", BBC_PRISMA3); /* PRISMA-3 - Millipede 1989 */
|
||||
device.option_add("sprite", BBC_SPRITE); /* Logotron Sprite Board */
|
||||
@ -170,6 +172,7 @@ void bbcm_1mhzbus_devices(device_slot_interface &device)
|
||||
device.option_add("pms64k", BBC_PMS64K); /* PMS 64K Non-Volatile Ram Module */
|
||||
device.option_add("ramdisc", BBC_RAMDISC); /* Morley Electronics RAM Disc */
|
||||
//device.option_add("graduate", BBC_GRADUATE); /* The Torch Graduate G400/G800 */
|
||||
device.option_add("beebopl", BBC_BEEBOPL); /* BeebOPL */
|
||||
device.option_add("beebsid", BBC_BEEBSID); /* BeebSID */
|
||||
//device.option_add("prisma3", BBC_PRISMA3); /* PRISMA-3 - Millipede 1989 */
|
||||
device.option_add("sprite", BBC_SPRITE); /* Logotron Sprite Board */
|
||||
|
95
src/devices/bus/bbc/1mhzbus/beebopl.cpp
Normal file
95
src/devices/bus/bbc/1mhzbus/beebopl.cpp
Normal file
@ -0,0 +1,95 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Nigel Barnes
|
||||
/**********************************************************************
|
||||
|
||||
BeebOPL FM Synthesiser emulation
|
||||
|
||||
https://github.com/JudgeBeeb/BeebOPL
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
|
||||
#include "emu.h"
|
||||
#include "beebopl.h"
|
||||
#include "speaker.h"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// DEVICE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
DEFINE_DEVICE_TYPE(BBC_BEEBOPL, bbc_beebopl_device, "beebopl", "BeebOPL FM Synthesiser")
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_add_mconfig - add device configuration
|
||||
//-------------------------------------------------
|
||||
|
||||
void bbc_beebopl_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
SPEAKER(config, "speaker").front_center();
|
||||
|
||||
YM3812(config, m_ym3812, 3.579_MHz_XTAL);
|
||||
m_ym3812->irq_handler().set(DEVICE_SELF_OWNER, FUNC(bbc_1mhzbus_slot_device::irq_w));
|
||||
m_ym3812->add_route(ALL_OUTPUTS, "speaker", 1.0);
|
||||
|
||||
BBC_1MHZBUS_SLOT(config, m_1mhzbus, DERIVED_CLOCK(1, 1), bbc_1mhzbus_devices, nullptr);
|
||||
m_1mhzbus->irq_handler().set(DEVICE_SELF_OWNER, FUNC(bbc_1mhzbus_slot_device::irq_w));
|
||||
m_1mhzbus->nmi_handler().set(DEVICE_SELF_OWNER, FUNC(bbc_1mhzbus_slot_device::nmi_w));
|
||||
}
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// LIVE DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// bbc_beebopl_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
bbc_beebopl_device::bbc_beebopl_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: device_t(mconfig, BBC_BEEBOPL, tag, owner, clock)
|
||||
, device_bbc_1mhzbus_interface(mconfig, *this)
|
||||
, m_1mhzbus(*this, "1mhzbus")
|
||||
, m_ym3812(*this, "ym3812")
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// IMPLEMENTATION
|
||||
//**************************************************************************
|
||||
|
||||
uint8_t bbc_beebopl_device::fred_r(offs_t offset)
|
||||
{
|
||||
uint8_t data = 0xff;
|
||||
|
||||
if ((offset & 0xfe) == 0x04)
|
||||
{
|
||||
data = m_ym3812->read(offset);
|
||||
}
|
||||
|
||||
data &= m_1mhzbus->fred_r(offset);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
void bbc_beebopl_device::fred_w(offs_t offset, uint8_t data)
|
||||
{
|
||||
if ((offset & 0xfe) == 0x04)
|
||||
{
|
||||
m_ym3812->write(offset, data);
|
||||
}
|
||||
|
||||
m_1mhzbus->fred_w(offset, data);
|
||||
}
|
||||
|
||||
uint8_t bbc_beebopl_device::jim_r(offs_t offset)
|
||||
{
|
||||
return m_1mhzbus->jim_r(offset);
|
||||
}
|
||||
|
||||
void bbc_beebopl_device::jim_w(offs_t offset, uint8_t data)
|
||||
{
|
||||
m_1mhzbus->jim_w(offset, data);
|
||||
}
|
52
src/devices/bus/bbc/1mhzbus/beebopl.h
Normal file
52
src/devices/bus/bbc/1mhzbus/beebopl.h
Normal file
@ -0,0 +1,52 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Nigel Barnes
|
||||
/**********************************************************************
|
||||
|
||||
BeebOPL FM Synthesiser emulation
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef MAME_BUS_BBC_1MHZBUS_BEEBOPL_H
|
||||
#define MAME_BUS_BBC_1MHZBUS_BEEBOPL_H
|
||||
|
||||
#include "1mhzbus.h"
|
||||
#include "sound/3812intf.h"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
// ======================> bbc_beebopl_device
|
||||
|
||||
class bbc_beebopl_device :
|
||||
public device_t,
|
||||
public device_bbc_1mhzbus_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
bbc_beebopl_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 uint8_t fred_r(offs_t offset) override;
|
||||
virtual void fred_w(offs_t offset, uint8_t data) override;
|
||||
virtual uint8_t jim_r(offs_t offset) override;
|
||||
virtual void jim_w(offs_t offset, uint8_t data) override;
|
||||
|
||||
private:
|
||||
required_device<bbc_1mhzbus_slot_device> m_1mhzbus;
|
||||
required_device<ym3812_device> m_ym3812;
|
||||
};
|
||||
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(BBC_BEEBOPL, bbc_beebopl_device)
|
||||
|
||||
|
||||
#endif // MAME_BUS_BBC_1MHZBUS_BEEBOPL_H
|
@ -89,6 +89,7 @@ const double XTAL::known_xtals[] = {
|
||||
3'521'280, /* 3.52128_MHz_XTAL RCA COSMAC VIP */
|
||||
3'570'000, /* 3.57_MHz_XTAL Telmac TMC-600 */
|
||||
3'578'640, /* 3.57864_MHz_XTAL Atari Portfolio PCD3311T */
|
||||
3'579'000, /* 3.579_MHz_XTAL BeebOPL */
|
||||
3'579'545, /* 3.579545_MHz_XTAL NTSC color subcarrier, extremely common, used on 100's of PCBs (Keytronic custom part #48-300-010 is equivalent) */
|
||||
3'686'400, /* 3.6864_MHz_XTAL Baud rate clock for MC68681 and similar UARTs */
|
||||
3'840'000, /* 3.84_MHz_XTAL Fairlight CMI Alphanumeric Keyboard */
|
||||
|
Loading…
Reference in New Issue
Block a user