mirror of
https://github.com/holub/mame
synced 2025-04-19 15:11:37 +03:00
bus/archimedes/econet: Added MIDI devices:
- The Serial Port MIDI Interface - The Serial Port Sampler and MIDI Interface
This commit is contained in:
parent
0a102048f8
commit
08882ee89e
@ -325,6 +325,8 @@ if (BUSES["ARCHIMEDES_ECONET"]~=null) then
|
||||
MAME_DIR .. "src/devices/bus/archimedes/econet/slot.h",
|
||||
MAME_DIR .. "src/devices/bus/archimedes/econet/econet.cpp",
|
||||
MAME_DIR .. "src/devices/bus/archimedes/econet/econet.h",
|
||||
MAME_DIR .. "src/devices/bus/archimedes/econet/midi.cpp",
|
||||
MAME_DIR .. "src/devices/bus/archimedes/econet/midi.h",
|
||||
MAME_DIR .. "src/devices/bus/archimedes/econet/rtfmjoy.cpp",
|
||||
MAME_DIR .. "src/devices/bus/archimedes/econet/rtfmjoy.h",
|
||||
}
|
||||
|
100
src/devices/bus/archimedes/econet/midi.cpp
Normal file
100
src/devices/bus/archimedes/econet/midi.cpp
Normal file
@ -0,0 +1,100 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Nigel Barnes
|
||||
/**********************************************************************
|
||||
|
||||
The Serial Port MIDI Interface
|
||||
|
||||
http://chrisacorns.computinghistory.org.uk/32bit_UpgradesH2Z/TheSerialPort_MIDI.html
|
||||
|
||||
The Serial Port Sampler and MIDI Interface
|
||||
|
||||
http://chrisacorns.computinghistory.org.uk/32bit_UpgradesH2Z/TheSerialPort_SamplerMIDI.html
|
||||
|
||||
TODO:
|
||||
- add sampler using ZN439E
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "midi.h"
|
||||
#include "bus/midi/midi.h"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// DEVICE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
DEFINE_DEVICE_TYPE(ARC_SERIAL_MIDI, arc_serial_midi_device, "arc_serial_midi", "The Serial Port MIDI Interface");
|
||||
DEFINE_DEVICE_TYPE(ARC_SERIAL_SAMPLER, arc_serial_sampler_device, "arc_serial_sampler", "The Serial Port Sampler and MIDI Interface");
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_add_mconfig - add device configuration
|
||||
//-------------------------------------------------
|
||||
|
||||
void arc_serial_midi_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
MC6854(config, m_adlc);
|
||||
m_adlc->out_txd_cb().set("mdout", FUNC(midi_port_device::write_txd));
|
||||
m_adlc->out_irq_cb().set(DEVICE_SELF_OWNER, FUNC(archimedes_econet_slot_device::efiq_w));
|
||||
|
||||
midi_port_device &mdin(MIDI_PORT(config, "mdin", midiin_slot, "midiin"));
|
||||
mdin.rxd_handler().set(m_adlc, FUNC(mc6854_device::set_rx));
|
||||
MIDI_PORT(config, "mdout", midiout_slot, "midiout");
|
||||
}
|
||||
|
||||
void arc_serial_sampler_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
arc_serial_midi_device::device_add_mconfig(config);
|
||||
|
||||
// ZN439E
|
||||
}
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// LIVE DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// arc_serial_midi_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
arc_serial_midi_device::arc_serial_midi_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock)
|
||||
: device_t(mconfig, type, tag, owner, clock)
|
||||
, device_archimedes_econet_interface(mconfig, *this)
|
||||
, m_adlc(*this, "mc6854")
|
||||
{
|
||||
}
|
||||
|
||||
arc_serial_midi_device::arc_serial_midi_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
|
||||
: arc_serial_midi_device(mconfig, ARC_SERIAL_MIDI, tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
arc_serial_sampler_device::arc_serial_sampler_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
|
||||
: arc_serial_midi_device(mconfig, ARC_SERIAL_SAMPLER, tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void arc_serial_midi_device::device_start()
|
||||
{
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
// IMPLEMENTATION
|
||||
//**************************************************************************
|
||||
|
||||
u8 arc_serial_midi_device::read(offs_t offset)
|
||||
{
|
||||
return m_adlc->read(offset);
|
||||
}
|
||||
|
||||
void arc_serial_midi_device::write(offs_t offset, u8 data)
|
||||
{
|
||||
m_adlc->write(offset, data);
|
||||
}
|
73
src/devices/bus/archimedes/econet/midi.h
Normal file
73
src/devices/bus/archimedes/econet/midi.h
Normal file
@ -0,0 +1,73 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Nigel Barnes
|
||||
/**********************************************************************
|
||||
|
||||
The Serial Port MIDI Interface
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
|
||||
#ifndef MAME_BUS_ARCHIMEDES_ECONET_MIDI_H
|
||||
#define MAME_BUS_ARCHIMEDES_ECONET_MIDI_H
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
#include "slot.h"
|
||||
#include "machine/mc6854.h"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
// ======================> arc_serial_midi_device
|
||||
|
||||
class arc_serial_midi_device:
|
||||
public device_t,
|
||||
public device_archimedes_econet_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
arc_serial_midi_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
|
||||
|
||||
protected:
|
||||
arc_serial_midi_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock);
|
||||
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
|
||||
// optional information overrides
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
|
||||
virtual u8 read(offs_t offset) override;
|
||||
virtual void write(offs_t offset, u8 data) override;
|
||||
|
||||
private:
|
||||
required_device<mc6854_device> m_adlc;
|
||||
};
|
||||
|
||||
|
||||
// ======================> arc_serial_sampler_device
|
||||
|
||||
class arc_serial_sampler_device: public arc_serial_midi_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
arc_serial_sampler_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
|
||||
|
||||
static constexpr feature_type unemulated_features() { return feature::CAPTURE; }
|
||||
|
||||
protected:
|
||||
// optional information overrides
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
};
|
||||
|
||||
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(ARC_SERIAL_MIDI, arc_serial_midi_device);
|
||||
DECLARE_DEVICE_TYPE(ARC_SERIAL_SAMPLER, arc_serial_sampler_device);
|
||||
|
||||
|
||||
#endif /* MAME_BUS_ARCHIMEDES_ECONET_MIDI_H */
|
@ -92,11 +92,14 @@ void archimedes_econet_slot_device::write(offs_t offset, u8 data)
|
||||
|
||||
// slot devices
|
||||
#include "econet.h"
|
||||
#include "midi.h"
|
||||
#include "rtfmjoy.h"
|
||||
|
||||
|
||||
void archimedes_econet_devices(device_slot_interface &device)
|
||||
{
|
||||
device.option_add("econet", ARC_ECONET);
|
||||
device.option_add("midi", ARC_SERIAL_MIDI);
|
||||
device.option_add("rtfmjoy", ARC_RTFM_JOY);
|
||||
device.option_add("sampler", ARC_SERIAL_SAMPLER);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user