mirror of
https://github.com/mamedev/mame.git
synced 2024-11-16 07:48:32 +01:00
bus/coco Added CoCo and Dragon MIDI cartridges. (#7589)
This commit is contained in:
parent
260d3e0395
commit
c49f1ee406
5 changed files with 133 additions and 1 deletions
|
@ -3409,6 +3409,8 @@ if (BUSES["COCO"]~=null) then
|
|||
MAME_DIR .. "src/devices/bus/coco/coco_fdc.h",
|
||||
MAME_DIR .. "src/devices/bus/coco/coco_gmc.cpp",
|
||||
MAME_DIR .. "src/devices/bus/coco/coco_gmc.h",
|
||||
MAME_DIR .. "src/devices/bus/coco/coco_midi.cpp",
|
||||
MAME_DIR .. "src/devices/bus/coco/coco_midi.h",
|
||||
MAME_DIR .. "src/devices/bus/coco/coco_multi.cpp",
|
||||
MAME_DIR .. "src/devices/bus/coco/coco_multi.h",
|
||||
MAME_DIR .. "src/devices/bus/coco/coco_orch90.cpp",
|
||||
|
|
112
src/devices/bus/coco/coco_midi.cpp
Normal file
112
src/devices/bus/coco/coco_midi.cpp
Normal file
|
@ -0,0 +1,112 @@
|
|||
// license:BSD-3-Clause
|
||||
// copyright-holders:tim lindner
|
||||
/***************************************************************************
|
||||
|
||||
coco_midi.cpp
|
||||
|
||||
Emulation of Rutherford Research's Midi Pak and also compatible with
|
||||
Go4Retro's MIDI Maestro.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "coco_midi.h"
|
||||
|
||||
#include "machine/6850acia.h"
|
||||
#include "machine/clock.h"
|
||||
#include "bus/midi/midi.h"
|
||||
|
||||
// ======================> coco_midi_device
|
||||
|
||||
class coco_midi_device :
|
||||
public device_t,
|
||||
public device_cococart_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
coco_midi_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
|
||||
|
||||
protected:
|
||||
coco_midi_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock);
|
||||
virtual void device_start() override;
|
||||
|
||||
// optional information overrides
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
required_device<acia6850_device> m_acia;
|
||||
DECLARE_WRITE_LINE_MEMBER( acia_irq_w );
|
||||
|
||||
private:
|
||||
required_device<midi_port_device> m_mdthru;
|
||||
};
|
||||
|
||||
class dragon_midi_device : public coco_midi_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
dragon_midi_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
|
||||
|
||||
protected:
|
||||
dragon_midi_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock);
|
||||
virtual void device_start() override;
|
||||
};
|
||||
|
||||
coco_midi_device::coco_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_cococart_interface(mconfig, *this )
|
||||
, m_acia(*this, "mc6850")
|
||||
, m_mdthru(*this, "mdthru")
|
||||
{
|
||||
}
|
||||
|
||||
coco_midi_device::coco_midi_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
|
||||
: coco_midi_device(mconfig, COCO_MIDI, tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
void coco_midi_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(FUNC(coco_midi_device::acia_irq_w));
|
||||
|
||||
midi_port_device &mdin(MIDI_PORT(config, "mdin", midiin_slot, "midiin"));
|
||||
mdin.rxd_handler().set(m_acia, FUNC(acia6850_device::write_rxd));
|
||||
mdin.rxd_handler().append(m_mdthru, FUNC(midi_port_device::write_txd));
|
||||
MIDI_PORT(config, m_mdthru, midiout_slot, "midiout");
|
||||
MIDI_PORT(config, "mdout", midiout_slot, "midiout");
|
||||
|
||||
clock_device &acia_clock(CLOCK(config, "acia_clock", 31250*16));
|
||||
acia_clock.signal_handler().set(m_acia, FUNC(acia6850_device::write_txc));
|
||||
acia_clock.signal_handler().append(m_acia, FUNC(acia6850_device::write_rxc));
|
||||
}
|
||||
|
||||
void coco_midi_device::device_start()
|
||||
{
|
||||
install_readwrite_handler(0xff6e, 0xff6f,
|
||||
read8sm_delegate(m_acia, FUNC(acia6850_device::read)),
|
||||
write8sm_delegate(m_acia, FUNC(acia6850_device::write)));
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(coco_midi_device::acia_irq_w)
|
||||
{
|
||||
set_line_value(line::CART, state == 0);
|
||||
}
|
||||
|
||||
dragon_midi_device::dragon_midi_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock)
|
||||
: coco_midi_device(mconfig, type, tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
dragon_midi_device::dragon_midi_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
|
||||
: dragon_midi_device(mconfig, DRAGON_MIDI, tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
void dragon_midi_device::device_start()
|
||||
{
|
||||
install_readwrite_handler(0xff74, 0xff75,
|
||||
read8sm_delegate(m_acia, FUNC(acia6850_device::read)),
|
||||
write8sm_delegate(m_acia, FUNC(acia6850_device::write)));
|
||||
}
|
||||
|
||||
DEFINE_DEVICE_TYPE(COCO_MIDI, coco_midi_device, "coco_midi", "CoCo MIDI PAK");
|
||||
DEFINE_DEVICE_TYPE(DRAGON_MIDI, dragon_midi_device, "dragon_midi", "Dragon MIDI PAK");
|
14
src/devices/bus/coco/coco_midi.h
Normal file
14
src/devices/bus/coco/coco_midi.h
Normal file
|
@ -0,0 +1,14 @@
|
|||
// license:BSD-3-Clause
|
||||
// copyright-holders:tim lindner
|
||||
#ifndef MAME_BUS_COCO_COCO_MIDI_H
|
||||
#define MAME_BUS_COCO_COCO_MIDI_H
|
||||
|
||||
#include "cococart.h"
|
||||
|
||||
#pragma once
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(COCO_MIDI, coco_midi_device)
|
||||
DECLARE_DEVICE_TYPE(DRAGON_MIDI, dragon_midi_device)
|
||||
|
||||
#endif // MAME_BUS_COCO_COCO_MIDI_H
|
|
@ -43,6 +43,7 @@
|
|||
#include "coco_dcmodem.h"
|
||||
#include "coco_fdc.h"
|
||||
#include "coco_gmc.h"
|
||||
#include "coco_midi.h"
|
||||
#include "coco_multi.h"
|
||||
#include "coco_orch90.h"
|
||||
#include "coco_pak.h"
|
||||
|
@ -694,11 +695,12 @@ void coco_cart_add_basic_devices(device_slot_interface &device)
|
|||
{
|
||||
// basic devices, on both the main slot and the Multi-Pak interface
|
||||
device.option_add_internal("banked_16k", COCO_PAK_BANKED);
|
||||
device.option_add_internal("pak", COCO_PAK);
|
||||
device.option_add("ccpsg", COCO_PSG);
|
||||
device.option_add("dcmodem", COCO_DCMODEM);
|
||||
device.option_add("games_master", COCO_PAK_GMC);
|
||||
device.option_add("midi", COCO_MIDI);
|
||||
device.option_add("orch90", COCO_ORCH90);
|
||||
device.option_add_internal("pak", COCO_PAK);
|
||||
device.option_add("ram", COCO_PAK_RAM);
|
||||
device.option_add("rs232", COCO_RS232);
|
||||
device.option_add("ssc", COCO_SSC);
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
#include "bus/coco/coco_gmc.h"
|
||||
#include "bus/coco/coco_orch90.h"
|
||||
#include "bus/coco/coco_midi.h"
|
||||
#include "bus/coco/coco_pak.h"
|
||||
#include "bus/coco/coco_psg.h"
|
||||
#include "bus/coco/coco_ram.h"
|
||||
|
@ -213,6 +214,7 @@ void dragon_cart(device_slot_interface &device)
|
|||
device.option_add("gmc", COCO_PAK_GMC);
|
||||
device.option_add("jcbsnd", DRAGON_JCBSND);
|
||||
device.option_add("jcbspch", DRAGON_JCBSPCH);
|
||||
device.option_add("midi", DRAGON_MIDI);
|
||||
device.option_add("orch90", COCO_ORCH90);
|
||||
device.option_add("pak", COCO_PAK);
|
||||
device.option_add("premier_fdc", PREMIER_FDC);
|
||||
|
|
Loading…
Reference in a new issue