mirror of
https://github.com/holub/mame
synced 2025-04-19 15:11:37 +03:00
bus/archimedes/podule: Added MIDI devices:
- EMR MIDI 2 Interface - EMR MIDI 4 Interface
This commit is contained in:
parent
08882ee89e
commit
3e438cde6c
@ -376,6 +376,8 @@ if (BUSES["ARCHIMEDES_PODULE"]~=null) then
|
||||
MAME_DIR .. "src/devices/bus/archimedes/podule/lark.h",
|
||||
MAME_DIR .. "src/devices/bus/archimedes/podule/laserd.cpp",
|
||||
MAME_DIR .. "src/devices/bus/archimedes/podule/laserd.h",
|
||||
MAME_DIR .. "src/devices/bus/archimedes/podule/midi_emr.cpp",
|
||||
MAME_DIR .. "src/devices/bus/archimedes/podule/midi_emr.h",
|
||||
MAME_DIR .. "src/devices/bus/archimedes/podule/midimax.cpp",
|
||||
MAME_DIR .. "src/devices/bus/archimedes/podule/midimax.h",
|
||||
MAME_DIR .. "src/devices/bus/archimedes/podule/nexus.cpp",
|
||||
|
208
src/devices/bus/archimedes/podule/midi_emr.cpp
Normal file
208
src/devices/bus/archimedes/podule/midi_emr.cpp
Normal file
@ -0,0 +1,208 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Nigel Barnes
|
||||
/**********************************************************************
|
||||
|
||||
EMR MIDI Interface
|
||||
|
||||
http://chrisacorns.computinghistory.org.uk/32bit_UpgradesA2G/EMR_MIDI4.html
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "midi_emr.h"
|
||||
#include "machine/input_merger.h"
|
||||
#include "machine/mc68681.h"
|
||||
#include "bus/midi/midi.h"
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
// ======================> arc_midi2_emr_device
|
||||
|
||||
class arc_midi2_emr_device :
|
||||
public device_t,
|
||||
public device_archimedes_podule_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
arc_midi2_emr_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 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;
|
||||
virtual const tiny_rom_entry *device_rom_region() const override;
|
||||
|
||||
// device_archimedes_podule_interface overrides
|
||||
virtual void ioc_map(address_map &map) override;
|
||||
|
||||
private:
|
||||
required_memory_region m_podule_rom;
|
||||
|
||||
u8 m_rom_page;
|
||||
};
|
||||
|
||||
|
||||
// ======================> arc_midi4_emr_device
|
||||
|
||||
class arc_midi4_emr_device :
|
||||
public device_t,
|
||||
public device_archimedes_podule_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
arc_midi4_emr_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
|
||||
// optional information overrides
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
|
||||
// device_archimedes_podule_interface overrides
|
||||
virtual void ioc_map(address_map &map) override;
|
||||
};
|
||||
|
||||
|
||||
void arc_midi2_emr_device::ioc_map(address_map &map)
|
||||
{
|
||||
map(0x0000, 0x1fff).lr8(NAME([this](offs_t offset) { return m_podule_rom->base()[offset | ((m_rom_page << 11) & 0x7800) ^ 0x4000]; })).umask32(0x000000ff);
|
||||
map(0x1000, 0x1000).lw8(NAME([this](u8 data) { m_rom_page = data; }));
|
||||
map(0x2000, 0x203f).rw("uart", FUNC(scn2681_device::read), FUNC(scn2681_device::write)).umask32(0x000000ff);
|
||||
}
|
||||
|
||||
|
||||
void arc_midi4_emr_device::ioc_map(address_map &map)
|
||||
{
|
||||
map(0x2000, 0x203f).rw("uart1", FUNC(scn2681_device::read), FUNC(scn2681_device::write)).umask32(0x000000ff);
|
||||
map(0x3000, 0x303f).rw("uart2", FUNC(scn2681_device::read), FUNC(scn2681_device::write)).umask32(0x000000ff);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// ROM( midi2 )
|
||||
//-------------------------------------------------
|
||||
|
||||
ROM_START( midi2 )
|
||||
ROM_REGION(0x8000, "podule_rom", 0)
|
||||
ROM_SYSTEM_BIOS(0, "314", "V3.14/9/8/89")
|
||||
ROMX_LOAD("emr_midi2_v3.14.bin", 0x0000, 0x8000, CRC(7de739fe) SHA1(d0440e4ef0fa7bbab2ea3d6f9f3f1d4513aec8c0), ROM_BIOS(0))
|
||||
ROM_END
|
||||
|
||||
const tiny_rom_entry *arc_midi2_emr_device::device_rom_region() const
|
||||
{
|
||||
return ROM_NAME( midi2 );
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_add_mconfig - add device configuration
|
||||
//-------------------------------------------------
|
||||
|
||||
void arc_midi2_emr_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
scn2681_device &uart(SCN2681(config, "uart", DERIVED_CLOCK(1, 4))); // TODO: confirm device
|
||||
uart.irq_cb().set([this](int state) { set_pirq(state); });
|
||||
uart.a_tx_cb().set("mdout_a", FUNC(midi_port_device::write_txd));
|
||||
uart.b_tx_cb().set("mdout_b", FUNC(midi_port_device::write_txd));
|
||||
|
||||
midi_port_device &mdin1(MIDI_PORT(config, "mdin_a", midiin_slot, "midiin"));
|
||||
mdin1.rxd_handler().set("uart", FUNC(scn2681_device::rx_a_w));
|
||||
midi_port_device &mdin2(MIDI_PORT(config, "mdin_b", midiin_slot, "midiin"));
|
||||
mdin2.rxd_handler().set("uart", FUNC(scn2681_device::rx_b_w));
|
||||
|
||||
MIDI_PORT(config, "mdout_a", midiout_slot, "midiout");
|
||||
MIDI_PORT(config, "mdout_b", midiout_slot, "midiout");
|
||||
}
|
||||
|
||||
void arc_midi4_emr_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
INPUT_MERGER_ANY_HIGH(config, "irqs").output_handler().set([this](int state) { set_pirq(state); });
|
||||
|
||||
scn2681_device &uart1(SCN2681(config, "uart1", 3.6864_MHz_XTAL));
|
||||
uart1.irq_cb().set("irqs", FUNC(input_merger_device::in_w<0>));
|
||||
uart1.a_tx_cb().set("mdout_a", FUNC(midi_port_device::write_txd));
|
||||
uart1.b_tx_cb().set("mdout_b", FUNC(midi_port_device::write_txd));
|
||||
|
||||
midi_port_device &mdin1(MIDI_PORT(config, "mdin_a", midiin_slot, "midiin"));
|
||||
mdin1.rxd_handler().set("uart1", FUNC(scn2681_device::rx_a_w));
|
||||
midi_port_device &mdin2(MIDI_PORT(config, "mdin_b", midiin_slot, "midiin"));
|
||||
mdin2.rxd_handler().set("uart1", FUNC(scn2681_device::rx_b_w));
|
||||
|
||||
MIDI_PORT(config, "mdout_a", midiout_slot, "midiout");
|
||||
MIDI_PORT(config, "mdout_b", midiout_slot, "midiout");
|
||||
|
||||
scn2681_device &uart2(SCN2681(config, "uart2", 3.6864_MHz_XTAL));
|
||||
uart2.irq_cb().set("irqs", FUNC(input_merger_device::in_w<1>));
|
||||
uart2.a_tx_cb().set("mdout_c", FUNC(midi_port_device::write_txd));
|
||||
uart2.b_tx_cb().set("mdout_d", FUNC(midi_port_device::write_txd));
|
||||
|
||||
midi_port_device &mdin3(MIDI_PORT(config, "mdin_c", midiin_slot, "midiin"));
|
||||
mdin3.rxd_handler().set("uart2", FUNC(scn2681_device::rx_a_w));
|
||||
midi_port_device &mdin4(MIDI_PORT(config, "mdin_d", midiin_slot, "midiin"));
|
||||
mdin4.rxd_handler().set("uart2", FUNC(scn2681_device::rx_b_w));
|
||||
|
||||
MIDI_PORT(config, "mdout_c", midiout_slot, "midiout");
|
||||
MIDI_PORT(config, "mdout_d", midiout_slot, "midiout");
|
||||
}
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// LIVE DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// arc_midi_emr_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
arc_midi2_emr_device::arc_midi2_emr_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
|
||||
: device_t(mconfig, ARC_MIDI2_EMR, tag, owner, clock)
|
||||
, device_archimedes_podule_interface(mconfig, *this)
|
||||
, m_podule_rom(*this, "podule_rom")
|
||||
, m_rom_page(0)
|
||||
{
|
||||
}
|
||||
|
||||
arc_midi4_emr_device::arc_midi4_emr_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
|
||||
: device_t(mconfig, ARC_MIDI4_EMR, tag, owner, clock)
|
||||
, device_archimedes_podule_interface(mconfig, *this)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void arc_midi2_emr_device::device_start()
|
||||
{
|
||||
save_item(NAME(m_rom_page));
|
||||
}
|
||||
|
||||
void arc_midi4_emr_device::device_start()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void arc_midi2_emr_device::device_reset()
|
||||
{
|
||||
m_rom_page = 0x00;
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// DEVICE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
DEFINE_DEVICE_TYPE_PRIVATE(ARC_MIDI2_EMR, device_archimedes_podule_interface, arc_midi2_emr_device, "arc_midi2", "EMR MIDI 2 Interface")
|
||||
DEFINE_DEVICE_TYPE_PRIVATE(ARC_MIDI4_EMR, device_archimedes_podule_interface, arc_midi4_emr_device, "arc_midi4", "EMR MIDI 4 Interface")
|
20
src/devices/bus/archimedes/podule/midi_emr.h
Normal file
20
src/devices/bus/archimedes/podule/midi_emr.h
Normal file
@ -0,0 +1,20 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Nigel Barnes
|
||||
/**********************************************************************
|
||||
|
||||
EMR MIDI Interface
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef MAME_BUS_ARCHIMEDES_PODULE_MIDI_EMR_H
|
||||
#define MAME_BUS_ARCHIMEDES_PODULE_MIDI_EMR_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "slot.h"
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(ARC_MIDI2_EMR, device_archimedes_podule_interface)
|
||||
DECLARE_DEVICE_TYPE(ARC_MIDI4_EMR, device_archimedes_podule_interface)
|
||||
|
||||
#endif // MAME_BUS_ARCHIMEDES_PODULE_MIDI_EMR_H
|
@ -275,6 +275,7 @@ void device_archimedes_podule_interface::interface_post_start()
|
||||
#include "io_we.h"
|
||||
#include "lark.h"
|
||||
#include "laserd.h"
|
||||
#include "midi_emr.h"
|
||||
#include "midimax.h"
|
||||
#include "nexus.h"
|
||||
//#include "prisma3.h"
|
||||
@ -335,6 +336,8 @@ void archimedes_exp_devices(device_slot_interface &device)
|
||||
device.option_add("lark", ARC_LARK); // Wild Vision/Computer Concepts Lark A16
|
||||
device.option_add("lbp4", ARC_LBP4); // Computer Concepts LaserDirect LBP-4
|
||||
device.option_add("midi_aka16", ARC_MIDI_AKA16); // Acorn AKA16 MIDI Podule
|
||||
device.option_add("midi2", ARC_MIDI2_EMR); // EMR MIDI 2 Interface
|
||||
device.option_add("midi4", ARC_MIDI4_EMR); // EMR MIDI 4 Interface
|
||||
device.option_add("midimax", ARC_MIDIMAX); // Wild Vision MidiMax
|
||||
device.option_add("midimax2", ARC_MIDIMAX2); // Wild Vision MidiMax 2
|
||||
device.option_add("nexus_a500", ARC_NEXUS_A500); // SJ Research Nexus Interface (A500)
|
||||
|
Loading…
Reference in New Issue
Block a user