mirror of
https://github.com/holub/mame
synced 2025-04-21 07:52:35 +03:00
bus/spectrum: Added The Music Machine (MIDI I/O expansion). (#12842)
This commit is contained in:
parent
31c80501f7
commit
bb90e82295
@ -4844,6 +4844,8 @@ if (BUSES["SPECTRUM"]~=null) then
|
||||
MAME_DIR .. "src/devices/bus/spectrum/mikroplus.h",
|
||||
MAME_DIR .. "src/devices/bus/spectrum/mpoker.cpp",
|
||||
MAME_DIR .. "src/devices/bus/spectrum/mpoker.h",
|
||||
MAME_DIR .. "src/devices/bus/spectrum/musicmachine.cpp",
|
||||
MAME_DIR .. "src/devices/bus/spectrum/musicmachine.h",
|
||||
MAME_DIR .. "src/devices/bus/spectrum/opus.cpp",
|
||||
MAME_DIR .. "src/devices/bus/spectrum/opus.h",
|
||||
MAME_DIR .. "src/devices/bus/spectrum/plus2test.cpp",
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Barry Rodewald
|
||||
/*
|
||||
* The Music Machine - MIDI and sampling expansion
|
||||
* by Ram Electronics
|
||||
* by Ram Electronics Ltd
|
||||
*/
|
||||
|
||||
#include "emu.h"
|
||||
@ -16,7 +16,7 @@
|
||||
// DEVICE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
DEFINE_DEVICE_TYPE(CPC_MUSICMACHINE, cpc_musicmachine_device, "cpcmusic", "The Music Machine")
|
||||
DEFINE_DEVICE_TYPE(CPC_MUSICMACHINE, cpc_musicmachine_device, "cpcmusic", "The Music Machine (CPC)")
|
||||
|
||||
|
||||
void cpc_musicmachine_device::device_add_mconfig(machine_config &config)
|
||||
|
@ -167,6 +167,7 @@ void spectrum_expansion_slot_device::mreq_w(offs_t offset, uint8_t data)
|
||||
#include "mgt.h"
|
||||
#include "mikroplus.h"
|
||||
#include "mpoker.h"
|
||||
#include "musicmachine.h"
|
||||
#include "opus.h"
|
||||
#include "plus2test.h"
|
||||
#include "protek.h"
|
||||
@ -215,6 +216,7 @@ void spectrum_expansion_devices(device_slot_interface &device)
|
||||
device.option_add("mikroplus", SPECTRUM_MIKROPLUS);
|
||||
device.option_add("mpoker", SPECTRUM_MPOKER);
|
||||
device.option_add("mprint", SPECTRUM_MPRINT);
|
||||
device.option_add("musicmachine", SPECTRUM_MUSICMACHINE);
|
||||
device.option_add("opus", SPECTRUM_OPUS);
|
||||
device.option_add("plusd", SPECTRUM_PLUSD);
|
||||
device.option_add("proceed", SPECTRUM_PROCEED);
|
||||
@ -244,6 +246,7 @@ void spec128_expansion_devices(device_slot_interface &device)
|
||||
device.option_add("mface128", SPECTRUM_MFACE128);
|
||||
device.option_add("mikroplus", SPECTRUM_MIKROPLUS);
|
||||
device.option_add("mprint", SPECTRUM_MPRINT);
|
||||
device.option_add("musicmachine", SPECTRUM_MUSICMACHINE);
|
||||
device.option_add("opus", SPECTRUM_OPUS);
|
||||
device.option_add("plusd", SPECTRUM_PLUSD);
|
||||
device.option_add("plus2test", SPECTRUM_PLUS2TEST);
|
||||
@ -259,5 +262,6 @@ void specpls3_expansion_devices(device_slot_interface &device)
|
||||
{
|
||||
device.option_add("kempjoy", SPECTRUM_KEMPJOY);
|
||||
device.option_add("mface3", SPECTRUM_MFACE3);
|
||||
device.option_add("musicmachine", SPECTRUM_MUSICMACHINE);
|
||||
}
|
||||
|
||||
|
114
src/devices/bus/spectrum/musicmachine.cpp
Normal file
114
src/devices/bus/spectrum/musicmachine.cpp
Normal file
@ -0,0 +1,114 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Andrei I. Holub
|
||||
/*
|
||||
* The Music Machine - MIDI and sampling expansion
|
||||
* by Ram Electronics Ltd
|
||||
*/
|
||||
|
||||
#include "emu.h"
|
||||
#include "musicmachine.h"
|
||||
|
||||
#include "bus/midi/midi.h"
|
||||
#include "machine/clock.h"
|
||||
#include "speaker.h"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// DEVICE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
DEFINE_DEVICE_TYPE(SPECTRUM_MUSICMACHINE, spectrum_musicmachine_device, "spectrummusic", "The Music Machine (ZX)")
|
||||
|
||||
|
||||
void spectrum_musicmachine_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
ACIA6850(config, m_acia).txd_handler().set("mdout", FUNC(midi_port_device::write_txd));
|
||||
m_acia->irq_handler().set(DEVICE_SELF_OWNER, FUNC(spectrum_expansion_slot_device::nmi_w));
|
||||
MIDI_PORT(config, "mdin", midiin_slot, "midiin").rxd_handler().set(m_acia, FUNC(acia6850_device::write_rxd));
|
||||
MIDI_PORT(config, "mdout", midiout_slot, "midiout");
|
||||
clock_device &acia_clock(CLOCK(config, "acia_clock", 31250*16));
|
||||
acia_clock.signal_handler().set(FUNC(spectrum_musicmachine_device::write_acia_clock));
|
||||
|
||||
SPEAKER(config, "speaker").front_center();
|
||||
ZN429E(config, m_dac, 0).add_route(ALL_OUTPUTS, "speaker", 0.2);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
// LIVE DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
spectrum_musicmachine_device::spectrum_musicmachine_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
|
||||
device_t(mconfig, SPECTRUM_MUSICMACHINE, tag, owner, clock)
|
||||
, device_spectrum_expansion_interface(mconfig, *this)
|
||||
, m_acia(*this,"acia")
|
||||
, m_dac(*this,"dac")
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void spectrum_musicmachine_device::device_start()
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void spectrum_musicmachine_device::device_reset()
|
||||
{
|
||||
m_irq_select = false;
|
||||
}
|
||||
|
||||
void spectrum_musicmachine_device::write_acia_clock(u8 data)
|
||||
{
|
||||
m_acia->write_txc(data);
|
||||
m_acia->write_rxc(data);
|
||||
}
|
||||
|
||||
u8 spectrum_musicmachine_device::iorq_r(offs_t offset)
|
||||
{
|
||||
u8 data = offset & 1 ? m_slot->fb_r() : 0xff;
|
||||
|
||||
switch (offset & 0xff)
|
||||
{
|
||||
case 0x7f:
|
||||
if (offset == 0xfc7f)
|
||||
data = m_acia->status_r();
|
||||
else
|
||||
data = m_acia->data_r();
|
||||
break;
|
||||
case 0xbf:
|
||||
// TODO ADC_READ
|
||||
break;
|
||||
case 0xdf:
|
||||
// TODO Strobe: ADC_START
|
||||
break;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
void spectrum_musicmachine_device::iorq_w(offs_t offset, u8 data)
|
||||
{
|
||||
switch (offset & 0xff)
|
||||
{
|
||||
case 0x5f:
|
||||
m_irq_select = data & 1;
|
||||
break;
|
||||
case 0x7f:
|
||||
if (offset == 0xfc7f)
|
||||
m_acia->control_w(data);
|
||||
else
|
||||
m_acia->data_w(data);
|
||||
break;
|
||||
case 0x9f:
|
||||
m_dac->write(data);
|
||||
break;
|
||||
case 0xdf:
|
||||
// TODO Strobe: ADC_START
|
||||
break;
|
||||
}
|
||||
}
|
49
src/devices/bus/spectrum/musicmachine.h
Normal file
49
src/devices/bus/spectrum/musicmachine.h
Normal file
@ -0,0 +1,49 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Barry Rodewald
|
||||
/*
|
||||
* The Music Machine - MIDI and sampling expansion
|
||||
* by Ram Electronics
|
||||
*
|
||||
* Contains a 6850 AICA, Ferranti ZN429E8 DAC and ZN449 ADC
|
||||
*/
|
||||
|
||||
#ifndef MAME_BUS_SPECTRUM_MUSICMACHINE_H
|
||||
#define MAME_BUS_SPECTRUM_MUSICMACHINE_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "exp.h"
|
||||
#include "machine/6850acia.h"
|
||||
#include "sound/dac.h"
|
||||
|
||||
class spectrum_musicmachine_device : public device_t
|
||||
, public device_spectrum_expansion_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
spectrum_musicmachine_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
|
||||
|
||||
void write_acia_clock(u8 data);
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start() override ATTR_COLD;
|
||||
virtual void device_reset() override ATTR_COLD;
|
||||
|
||||
// optional information overrides
|
||||
virtual void device_add_mconfig(machine_config &config) override ATTR_COLD;
|
||||
|
||||
virtual u8 iorq_r(offs_t offset) override;
|
||||
virtual void iorq_w(offs_t offset, u8 data) override;
|
||||
|
||||
private:
|
||||
required_device<acia6850_device> m_acia;
|
||||
required_device<dac_byte_interface> m_dac;
|
||||
|
||||
bool m_irq_select;
|
||||
};
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(SPECTRUM_MUSICMACHINE, spectrum_musicmachine_device)
|
||||
|
||||
#endif // MAME_BUS_SPECTRUM_MUSICMACHINE_H
|
Loading…
Reference in New Issue
Block a user