(MESS) c64: Added support for the standard MIDI cartridges: Passport/Syntech, Siel/JMS/DATEL, Sequential, Namesoft, and Maplin. [Curt Coder]
This commit is contained in:
parent
f07681252e
commit
497661c016
10
.gitattributes
vendored
10
.gitattributes
vendored
@ -6934,6 +6934,16 @@ src/mess/machine/c64_magic_formel.c svneol=native#text/plain
|
||||
src/mess/machine/c64_magic_formel.h svneol=native#text/plain
|
||||
src/mess/machine/c64_magic_voice.c svneol=native#text/plain
|
||||
src/mess/machine/c64_magic_voice.h svneol=native#text/plain
|
||||
src/mess/machine/c64_midi_maplin.c svneol=native#text/plain
|
||||
src/mess/machine/c64_midi_maplin.h svneol=native#text/plain
|
||||
src/mess/machine/c64_midi_namesoft.c svneol=native#text/plain
|
||||
src/mess/machine/c64_midi_namesoft.h svneol=native#text/plain
|
||||
src/mess/machine/c64_midi_passport.c svneol=native#text/plain
|
||||
src/mess/machine/c64_midi_passport.h svneol=native#text/plain
|
||||
src/mess/machine/c64_midi_sci.c svneol=native#text/plain
|
||||
src/mess/machine/c64_midi_sci.h svneol=native#text/plain
|
||||
src/mess/machine/c64_midi_siel.c svneol=native#text/plain
|
||||
src/mess/machine/c64_midi_siel.h svneol=native#text/plain
|
||||
src/mess/machine/c64_mikro_assembler.c svneol=native#text/plain
|
||||
src/mess/machine/c64_mikro_assembler.h svneol=native#text/plain
|
||||
src/mess/machine/c64_multiscreen.c svneol=native#text/plain
|
||||
|
207
src/mess/machine/c64_midi_maplin.c
Normal file
207
src/mess/machine/c64_midi_maplin.c
Normal file
@ -0,0 +1,207 @@
|
||||
/**********************************************************************
|
||||
|
||||
Maplin MIDI Interface cartridge emulation
|
||||
|
||||
Copyright MESS Team.
|
||||
Visit http://mamedev.org for licensing and usage restrictions.
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#include "c64_midi_maplin.h"
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// MACROS/CONSTANTS
|
||||
//**************************************************************************
|
||||
|
||||
#define MC6850_TAG "mc6850"
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// DEVICE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
const device_type C64_MIDI_MAPLIN = &device_creator<c64_maplin_midi_cartridge_device>;
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// ACIA6850_INTERFACE( acia_intf )
|
||||
//-------------------------------------------------
|
||||
|
||||
WRITE_LINE_MEMBER( c64_maplin_midi_cartridge_device::acia_irq_w )
|
||||
{
|
||||
m_slot->irq_w(state);
|
||||
}
|
||||
|
||||
READ_LINE_MEMBER( c64_maplin_midi_cartridge_device::rx_in )
|
||||
{
|
||||
return m_rx_state;
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER( c64_maplin_midi_cartridge_device::tx_out )
|
||||
{
|
||||
m_mdout->tx(state);
|
||||
}
|
||||
|
||||
static ACIA6850_INTERFACE( acia_intf )
|
||||
{
|
||||
500000,
|
||||
0, // rx clock (we manually clock rx)
|
||||
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_maplin_midi_cartridge_device, rx_in),
|
||||
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_maplin_midi_cartridge_device, tx_out),
|
||||
DEVCB_NULL,
|
||||
DEVCB_NULL,
|
||||
DEVCB_NULL,
|
||||
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_maplin_midi_cartridge_device, acia_irq_w)
|
||||
};
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// SLOT_INTERFACE( midiin_slot )
|
||||
//-------------------------------------------------
|
||||
|
||||
static SLOT_INTERFACE_START( midiin_slot )
|
||||
SLOT_INTERFACE("midiin", MIDIIN_PORT)
|
||||
SLOT_INTERFACE_END
|
||||
|
||||
WRITE_LINE_MEMBER( c64_maplin_midi_cartridge_device::midi_rx_w )
|
||||
{
|
||||
m_rx_state = state;
|
||||
|
||||
for (int i = 0; i < 16; i++) // divider is set to 64
|
||||
{
|
||||
m_acia->rx_clock_in();
|
||||
}
|
||||
}
|
||||
|
||||
static const serial_port_interface midiin_intf =
|
||||
{
|
||||
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_maplin_midi_cartridge_device, midi_rx_w)
|
||||
};
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// SLOT_INTERFACE( midiout_slot )
|
||||
//-------------------------------------------------
|
||||
|
||||
static SLOT_INTERFACE_START( midiout_slot )
|
||||
SLOT_INTERFACE("midiout", MIDIOUT_PORT)
|
||||
SLOT_INTERFACE_END
|
||||
|
||||
static const serial_port_interface midiout_intf =
|
||||
{
|
||||
DEVCB_NULL // midi out ports don't transmit inward
|
||||
};
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// MACHINE_CONFIG_FRAGMENT( c64_maplin_midi )
|
||||
//-------------------------------------------------
|
||||
|
||||
static MACHINE_CONFIG_FRAGMENT( c64_maplin_midi )
|
||||
MCFG_ACIA6850_ADD(MC6850_TAG, acia_intf)
|
||||
|
||||
MCFG_SERIAL_PORT_ADD("mdin", midiin_intf, midiin_slot, "midiin", NULL)
|
||||
MCFG_SERIAL_PORT_ADD("mdout", midiout_intf, midiout_slot, "midiout", NULL)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// machine_config_additions - device-specific
|
||||
// machine configurations
|
||||
//-------------------------------------------------
|
||||
|
||||
machine_config_constructor c64_maplin_midi_cartridge_device::device_mconfig_additions() const
|
||||
{
|
||||
return MACHINE_CONFIG_NAME( c64_maplin_midi );
|
||||
}
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// LIVE DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// c64_maplin_midi_cartridge_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
c64_maplin_midi_cartridge_device::c64_maplin_midi_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
||||
device_t(mconfig, C64_MIDI_MAPLIN, "C64 Maplin MIDI", tag, owner, clock),
|
||||
device_c64_expansion_card_interface(mconfig, *this),
|
||||
m_acia(*this, MC6850_TAG),
|
||||
m_mdout(*this, "mdout"),
|
||||
m_rx_state(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void c64_maplin_midi_cartridge_device::device_start()
|
||||
{
|
||||
// state saving
|
||||
save_item(NAME(m_rx_state));
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void c64_maplin_midi_cartridge_device::device_reset()
|
||||
{
|
||||
m_acia->reset();
|
||||
|
||||
m_rx_state = 0;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// c64_cd_r - cartridge data read
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT8 c64_maplin_midi_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
|
||||
{
|
||||
if (!io2)
|
||||
{
|
||||
switch (offset & 0xff)
|
||||
{
|
||||
case 0:
|
||||
data = m_acia->status_read(space, 0);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
data = m_acia->data_read(space, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// c64_cd_w - cartridge data write
|
||||
//-------------------------------------------------
|
||||
|
||||
void c64_maplin_midi_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
|
||||
{
|
||||
if (!io2)
|
||||
{
|
||||
switch (offset & 0xff)
|
||||
{
|
||||
case 0:
|
||||
m_acia->control_write(space, 0, data);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
m_acia->data_write(space, 0, data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
67
src/mess/machine/c64_midi_maplin.h
Normal file
67
src/mess/machine/c64_midi_maplin.h
Normal file
@ -0,0 +1,67 @@
|
||||
/**********************************************************************
|
||||
|
||||
Maplin MIDI Interface cartridge emulation
|
||||
|
||||
Copyright MESS Team.
|
||||
Visit http://mamedev.org for licensing and usage restrictions.
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef __C64_MIDI_MAPLIN__
|
||||
#define __C64_MIDI_MAPLIN__
|
||||
|
||||
#include "emu.h"
|
||||
#include "machine/c64exp.h"
|
||||
#include "machine/6850acia.h"
|
||||
#include "machine/serial.h"
|
||||
#include "machine/midiinport.h"
|
||||
#include "machine/midioutport.h"
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
// ======================> c64_maplin_midi_cartridge_device
|
||||
|
||||
class c64_maplin_midi_cartridge_device : public device_t,
|
||||
public device_c64_expansion_card_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
c64_maplin_midi_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
// optional information overrides
|
||||
virtual machine_config_constructor device_mconfig_additions() const;
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER( acia_irq_w );
|
||||
DECLARE_WRITE_LINE_MEMBER( midi_rx_w );
|
||||
DECLARE_READ_LINE_MEMBER( rx_in );
|
||||
DECLARE_WRITE_LINE_MEMBER( tx_out );
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_config_complete() { m_shortname = "c64_midimap"; }
|
||||
virtual void device_start();
|
||||
virtual void device_reset();
|
||||
|
||||
// device_c64_expansion_card_interface overrides
|
||||
virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
|
||||
virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
|
||||
|
||||
private:
|
||||
required_device<acia6850_device> m_acia;
|
||||
required_device<serial_port_device> m_mdout;
|
||||
|
||||
int m_rx_state;
|
||||
};
|
||||
|
||||
|
||||
// device type definition
|
||||
extern const device_type C64_MIDI_MAPLIN;
|
||||
|
||||
|
||||
#endif
|
206
src/mess/machine/c64_midi_namesoft.c
Normal file
206
src/mess/machine/c64_midi_namesoft.c
Normal file
@ -0,0 +1,206 @@
|
||||
/**********************************************************************
|
||||
|
||||
Namesoft MIDI Interface cartridge emulation
|
||||
|
||||
Copyright MESS Team.
|
||||
Visit http://mamedev.org for licensing and usage restrictions.
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#include "c64_midi_namesoft.h"
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// MACROS/CONSTANTS
|
||||
//**************************************************************************
|
||||
|
||||
#define MC6850_TAG "mc6850"
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// DEVICE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
const device_type C64_MIDI_NAMESOFT = &device_creator<c64_namesoft_midi_cartridge_device>;
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// ACIA6850_INTERFACE( acia_intf )
|
||||
//-------------------------------------------------
|
||||
|
||||
WRITE_LINE_MEMBER( c64_namesoft_midi_cartridge_device::acia_irq_w )
|
||||
{
|
||||
m_slot->nmi_w(state);
|
||||
}
|
||||
|
||||
READ_LINE_MEMBER( c64_namesoft_midi_cartridge_device::rx_in )
|
||||
{
|
||||
return m_rx_state;
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER( c64_namesoft_midi_cartridge_device::tx_out )
|
||||
{
|
||||
m_mdout->tx(state);
|
||||
}
|
||||
|
||||
static ACIA6850_INTERFACE( acia_intf )
|
||||
{
|
||||
500000,
|
||||
0, // rx clock (we manually clock rx)
|
||||
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_namesoft_midi_cartridge_device, rx_in),
|
||||
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_namesoft_midi_cartridge_device, tx_out),
|
||||
DEVCB_NULL,
|
||||
DEVCB_NULL,
|
||||
DEVCB_NULL,
|
||||
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_namesoft_midi_cartridge_device, acia_irq_w)
|
||||
};
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// SLOT_INTERFACE( midiin_slot )
|
||||
//-------------------------------------------------
|
||||
|
||||
static SLOT_INTERFACE_START( midiin_slot )
|
||||
SLOT_INTERFACE("midiin", MIDIIN_PORT)
|
||||
SLOT_INTERFACE_END
|
||||
|
||||
WRITE_LINE_MEMBER( c64_namesoft_midi_cartridge_device::midi_rx_w )
|
||||
{
|
||||
m_rx_state = state;
|
||||
|
||||
for (int i = 0; i < 16; i++) // divider is set to 16
|
||||
{
|
||||
m_acia->rx_clock_in();
|
||||
}
|
||||
}
|
||||
|
||||
static const serial_port_interface midiin_intf =
|
||||
{
|
||||
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_namesoft_midi_cartridge_device, midi_rx_w)
|
||||
};
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// SLOT_INTERFACE( midiout_slot )
|
||||
//-------------------------------------------------
|
||||
|
||||
static SLOT_INTERFACE_START( midiout_slot )
|
||||
SLOT_INTERFACE("midiout", MIDIOUT_PORT)
|
||||
SLOT_INTERFACE_END
|
||||
|
||||
static const serial_port_interface midiout_intf =
|
||||
{
|
||||
DEVCB_NULL // midi out ports don't transmit inward
|
||||
};
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// MACHINE_CONFIG_FRAGMENT( c64_passport_midi )
|
||||
//-------------------------------------------------
|
||||
|
||||
static MACHINE_CONFIG_FRAGMENT( c64_passport_midi )
|
||||
MCFG_ACIA6850_ADD(MC6850_TAG, acia_intf)
|
||||
|
||||
MCFG_SERIAL_PORT_ADD("mdin", midiin_intf, midiin_slot, "midiin", NULL)
|
||||
MCFG_SERIAL_PORT_ADD("mdout", midiout_intf, midiout_slot, "midiout", NULL)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// machine_config_additions - device-specific
|
||||
// machine configurations
|
||||
//-------------------------------------------------
|
||||
|
||||
machine_config_constructor c64_namesoft_midi_cartridge_device::device_mconfig_additions() const
|
||||
{
|
||||
return MACHINE_CONFIG_NAME( c64_passport_midi );
|
||||
}
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// LIVE DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// c64_namesoft_midi_cartridge_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
c64_namesoft_midi_cartridge_device::c64_namesoft_midi_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
||||
device_t(mconfig, C64_MIDI_NAMESOFT, "C64 Namesoft MIDI", tag, owner, clock),
|
||||
device_c64_expansion_card_interface(mconfig, *this),
|
||||
m_acia(*this, MC6850_TAG),
|
||||
m_mdout(*this, "mdout"),
|
||||
m_rx_state(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void c64_namesoft_midi_cartridge_device::device_start()
|
||||
{
|
||||
// state saving
|
||||
save_item(NAME(m_rx_state));
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void c64_namesoft_midi_cartridge_device::device_reset()
|
||||
{
|
||||
m_acia->reset();
|
||||
|
||||
m_rx_state = 0;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// c64_cd_r - cartridge data read
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT8 c64_namesoft_midi_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
|
||||
{
|
||||
if (!io1)
|
||||
{
|
||||
switch (offset & 0xff)
|
||||
{
|
||||
case 2:
|
||||
data = m_acia->status_read(space, 0);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
data = m_acia->data_read(space, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// c64_cd_w - cartridge data write
|
||||
//-------------------------------------------------
|
||||
|
||||
void c64_namesoft_midi_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
|
||||
{
|
||||
if (!io1)
|
||||
{
|
||||
switch (offset & 0xff)
|
||||
{
|
||||
case 0:
|
||||
m_acia->control_write(space, 0, data);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
m_acia->data_write(space, 0, data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
67
src/mess/machine/c64_midi_namesoft.h
Normal file
67
src/mess/machine/c64_midi_namesoft.h
Normal file
@ -0,0 +1,67 @@
|
||||
/**********************************************************************
|
||||
|
||||
Namesoft MIDI Interface cartridge emulation
|
||||
|
||||
Copyright MESS Team.
|
||||
Visit http://mamedev.org for licensing and usage restrictions.
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef __C64_MIDI_NAMESOFT__
|
||||
#define __C64_MIDI_NAMESOFT__
|
||||
|
||||
#include "emu.h"
|
||||
#include "machine/c64exp.h"
|
||||
#include "machine/6850acia.h"
|
||||
#include "machine/serial.h"
|
||||
#include "machine/midiinport.h"
|
||||
#include "machine/midioutport.h"
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
// ======================> c64_namesoft_midi_cartridge_device
|
||||
|
||||
class c64_namesoft_midi_cartridge_device : public device_t,
|
||||
public device_c64_expansion_card_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
c64_namesoft_midi_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
// optional information overrides
|
||||
virtual machine_config_constructor device_mconfig_additions() const;
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER( acia_irq_w );
|
||||
DECLARE_WRITE_LINE_MEMBER( midi_rx_w );
|
||||
DECLARE_READ_LINE_MEMBER( rx_in );
|
||||
DECLARE_WRITE_LINE_MEMBER( tx_out );
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_config_complete() { m_shortname = "c64_midins"; }
|
||||
virtual void device_start();
|
||||
virtual void device_reset();
|
||||
|
||||
// device_c64_expansion_card_interface overrides
|
||||
virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
|
||||
virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
|
||||
|
||||
private:
|
||||
required_device<acia6850_device> m_acia;
|
||||
required_device<serial_port_device> m_mdout;
|
||||
|
||||
int m_rx_state;
|
||||
};
|
||||
|
||||
|
||||
// device type definition
|
||||
extern const device_type C64_MIDI_NAMESOFT;
|
||||
|
||||
|
||||
#endif
|
255
src/mess/machine/c64_midi_passport.c
Normal file
255
src/mess/machine/c64_midi_passport.c
Normal file
@ -0,0 +1,255 @@
|
||||
/**********************************************************************
|
||||
|
||||
Passport/Syntech MIDI Interface cartridge emulation
|
||||
|
||||
Copyright MESS Team.
|
||||
Visit http://mamedev.org for licensing and usage restrictions.
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#include "c64_midi_passport.h"
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// MACROS/CONSTANTS
|
||||
//**************************************************************************
|
||||
|
||||
#define MC6840_TAG "mc6840"
|
||||
#define MC6850_TAG "mc6850"
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// DEVICE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
const device_type C64_MIDI_PASSPORT = &device_creator<c64_passport_midi_cartridge_device>;
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// ptm6840_interface ptm_intf
|
||||
//-------------------------------------------------
|
||||
|
||||
WRITE_LINE_MEMBER( c64_passport_midi_cartridge_device::ptm_irq_w )
|
||||
{
|
||||
m_ptm_irq = state;
|
||||
|
||||
m_slot->irq_w(m_ptm_irq || m_acia_irq);
|
||||
}
|
||||
|
||||
static const ptm6840_interface ptm_intf =
|
||||
{
|
||||
1021800.0f,
|
||||
{ 1021800.0f, 1021800.0f, 1021800.0f },
|
||||
{ DEVCB_NULL, DEVCB_NULL, DEVCB_NULL },
|
||||
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_passport_midi_cartridge_device, ptm_irq_w)
|
||||
};
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// ACIA6850_INTERFACE( acia_intf )
|
||||
//-------------------------------------------------
|
||||
|
||||
WRITE_LINE_MEMBER( c64_passport_midi_cartridge_device::acia_irq_w )
|
||||
{
|
||||
m_acia_irq = state;
|
||||
|
||||
m_slot->irq_w(m_ptm_irq || m_acia_irq);
|
||||
}
|
||||
|
||||
READ_LINE_MEMBER( c64_passport_midi_cartridge_device::rx_in )
|
||||
{
|
||||
return m_rx_state;
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER( c64_passport_midi_cartridge_device::tx_out )
|
||||
{
|
||||
m_mdout->tx(state);
|
||||
}
|
||||
|
||||
static ACIA6850_INTERFACE( acia_intf )
|
||||
{
|
||||
500000,
|
||||
0, // rx clock (we manually clock rx)
|
||||
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_passport_midi_cartridge_device, rx_in),
|
||||
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_passport_midi_cartridge_device, tx_out),
|
||||
DEVCB_NULL,
|
||||
DEVCB_NULL,
|
||||
DEVCB_NULL,
|
||||
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_passport_midi_cartridge_device, acia_irq_w)
|
||||
};
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// SLOT_INTERFACE( midiin_slot )
|
||||
//-------------------------------------------------
|
||||
|
||||
static SLOT_INTERFACE_START( midiin_slot )
|
||||
SLOT_INTERFACE("midiin", MIDIIN_PORT)
|
||||
SLOT_INTERFACE_END
|
||||
|
||||
WRITE_LINE_MEMBER( c64_passport_midi_cartridge_device::midi_rx_w )
|
||||
{
|
||||
m_rx_state = state;
|
||||
|
||||
for (int i = 0; i < 16; i++) // divider is set to 16
|
||||
{
|
||||
m_acia->rx_clock_in();
|
||||
}
|
||||
}
|
||||
|
||||
static const serial_port_interface midiin_intf =
|
||||
{
|
||||
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_passport_midi_cartridge_device, midi_rx_w)
|
||||
};
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// SLOT_INTERFACE( midiout_slot )
|
||||
//-------------------------------------------------
|
||||
|
||||
static SLOT_INTERFACE_START( midiout_slot )
|
||||
SLOT_INTERFACE("midiout", MIDIOUT_PORT)
|
||||
SLOT_INTERFACE_END
|
||||
|
||||
static const serial_port_interface midiout_intf =
|
||||
{
|
||||
DEVCB_NULL // midi out ports don't transmit inward
|
||||
};
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// MACHINE_CONFIG_FRAGMENT( c64_passport_midi )
|
||||
//-------------------------------------------------
|
||||
|
||||
static MACHINE_CONFIG_FRAGMENT( c64_passport_midi )
|
||||
MCFG_ACIA6850_ADD(MC6850_TAG, acia_intf)
|
||||
MCFG_PTM6840_ADD(MC6840_TAG, ptm_intf)
|
||||
|
||||
MCFG_SERIAL_PORT_ADD("mdin", midiin_intf, midiin_slot, "midiin", NULL)
|
||||
MCFG_SERIAL_PORT_ADD("mdout", midiout_intf, midiout_slot, "midiout", NULL)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// machine_config_additions - device-specific
|
||||
// machine configurations
|
||||
//-------------------------------------------------
|
||||
|
||||
machine_config_constructor c64_passport_midi_cartridge_device::device_mconfig_additions() const
|
||||
{
|
||||
return MACHINE_CONFIG_NAME( c64_passport_midi );
|
||||
}
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// LIVE DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// c64_passport_midi_cartridge_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
c64_passport_midi_cartridge_device::c64_passport_midi_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
||||
device_t(mconfig, C64_MIDI_PASSPORT, "C64 Passport MIDI", tag, owner, clock),
|
||||
device_c64_expansion_card_interface(mconfig, *this),
|
||||
m_acia(*this, MC6850_TAG),
|
||||
m_ptm(*this, MC6840_TAG),
|
||||
m_mdout(*this, "mdout"),
|
||||
m_ptm_irq(CLEAR_LINE),
|
||||
m_acia_irq(CLEAR_LINE),
|
||||
m_rx_state(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void c64_passport_midi_cartridge_device::device_start()
|
||||
{
|
||||
// state saving
|
||||
save_item(NAME(m_ptm_irq));
|
||||
save_item(NAME(m_acia_irq));
|
||||
save_item(NAME(m_rx_state));
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void c64_passport_midi_cartridge_device::device_reset()
|
||||
{
|
||||
m_acia->reset();
|
||||
m_ptm->reset();
|
||||
|
||||
m_rx_state = 0;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// c64_cd_r - cartridge data read
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT8 c64_passport_midi_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
|
||||
{
|
||||
if (!io1)
|
||||
{
|
||||
switch (offset & 0xff)
|
||||
{
|
||||
case 0: case 1: case 2: case 3:
|
||||
case 4: case 5: case 6: case 7:
|
||||
data = m_ptm->read(space, offset & 0x07);
|
||||
break;
|
||||
|
||||
case 8:
|
||||
data = m_acia->status_read(space, 0);
|
||||
break;
|
||||
|
||||
case 9:
|
||||
data = m_acia->data_read(space, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// c64_cd_w - cartridge data write
|
||||
//-------------------------------------------------
|
||||
|
||||
void c64_passport_midi_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
|
||||
{
|
||||
if (!io1)
|
||||
{
|
||||
switch (offset & 0xff)
|
||||
{
|
||||
case 0: case 1: case 2: case 3:
|
||||
case 4: case 5: case 6: case 7:
|
||||
m_ptm->write(space, offset & 0x07, data);
|
||||
break;
|
||||
|
||||
case 8:
|
||||
m_acia->control_write(space, 0, data);
|
||||
break;
|
||||
|
||||
case 9:
|
||||
m_acia->data_write(space, 0, data);
|
||||
break;
|
||||
|
||||
case 0x30:
|
||||
// Drum sync SET
|
||||
break;
|
||||
|
||||
case 0x38:
|
||||
// Drum sync CLEAR
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
72
src/mess/machine/c64_midi_passport.h
Normal file
72
src/mess/machine/c64_midi_passport.h
Normal file
@ -0,0 +1,72 @@
|
||||
/**********************************************************************
|
||||
|
||||
Passport/Syntech MIDI Interface cartridge emulation
|
||||
|
||||
Copyright MESS Team.
|
||||
Visit http://mamedev.org for licensing and usage restrictions.
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef __C64_MIDI_PASSPORT__
|
||||
#define __C64_MIDI_PASSPORT__
|
||||
|
||||
#include "emu.h"
|
||||
#include "machine/c64exp.h"
|
||||
#include "machine/6840ptm.h"
|
||||
#include "machine/6850acia.h"
|
||||
#include "machine/serial.h"
|
||||
#include "machine/midiinport.h"
|
||||
#include "machine/midioutport.h"
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
// ======================> c64_passport_midi_cartridge_device
|
||||
|
||||
class c64_passport_midi_cartridge_device : public device_t,
|
||||
public device_c64_expansion_card_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
c64_passport_midi_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
// optional information overrides
|
||||
virtual machine_config_constructor device_mconfig_additions() const;
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER( ptm_irq_w );
|
||||
DECLARE_WRITE_LINE_MEMBER( acia_irq_w );
|
||||
DECLARE_WRITE_LINE_MEMBER( midi_rx_w );
|
||||
DECLARE_READ_LINE_MEMBER( rx_in );
|
||||
DECLARE_WRITE_LINE_MEMBER( tx_out );
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_config_complete() { m_shortname = "c64_midipp"; }
|
||||
virtual void device_start();
|
||||
virtual void device_reset();
|
||||
|
||||
// device_c64_expansion_card_interface overrides
|
||||
virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
|
||||
virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
|
||||
|
||||
private:
|
||||
required_device<acia6850_device> m_acia;
|
||||
required_device<ptm6840_device> m_ptm;
|
||||
required_device<serial_port_device> m_mdout;
|
||||
|
||||
int m_ptm_irq;
|
||||
int m_acia_irq;
|
||||
int m_rx_state;
|
||||
};
|
||||
|
||||
|
||||
// device type definition
|
||||
extern const device_type C64_MIDI_PASSPORT;
|
||||
|
||||
|
||||
#endif
|
206
src/mess/machine/c64_midi_sci.c
Normal file
206
src/mess/machine/c64_midi_sci.c
Normal file
@ -0,0 +1,206 @@
|
||||
/**********************************************************************
|
||||
|
||||
Sequential Circuits MIDI Interface cartridge emulation
|
||||
|
||||
Copyright MESS Team.
|
||||
Visit http://mamedev.org for licensing and usage restrictions.
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#include "c64_midi_sci.h"
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// MACROS/CONSTANTS
|
||||
//**************************************************************************
|
||||
|
||||
#define MC6850_TAG "mc6850"
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// DEVICE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
const device_type C64_MIDI_SCI = &device_creator<c64_sequential_midi_cartridge_device>;
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// ACIA6850_INTERFACE( acia_intf )
|
||||
//-------------------------------------------------
|
||||
|
||||
WRITE_LINE_MEMBER( c64_sequential_midi_cartridge_device::acia_irq_w )
|
||||
{
|
||||
m_slot->irq_w(state);
|
||||
}
|
||||
|
||||
READ_LINE_MEMBER( c64_sequential_midi_cartridge_device::rx_in )
|
||||
{
|
||||
return m_rx_state;
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER( c64_sequential_midi_cartridge_device::tx_out )
|
||||
{
|
||||
m_mdout->tx(state);
|
||||
}
|
||||
|
||||
static ACIA6850_INTERFACE( acia_intf )
|
||||
{
|
||||
500000,
|
||||
0, // rx clock (we manually clock rx)
|
||||
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_sequential_midi_cartridge_device, rx_in),
|
||||
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_sequential_midi_cartridge_device, tx_out),
|
||||
DEVCB_NULL,
|
||||
DEVCB_NULL,
|
||||
DEVCB_NULL,
|
||||
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_sequential_midi_cartridge_device, acia_irq_w)
|
||||
};
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// SLOT_INTERFACE( midiin_slot )
|
||||
//-------------------------------------------------
|
||||
|
||||
static SLOT_INTERFACE_START( midiin_slot )
|
||||
SLOT_INTERFACE("midiin", MIDIIN_PORT)
|
||||
SLOT_INTERFACE_END
|
||||
|
||||
WRITE_LINE_MEMBER( c64_sequential_midi_cartridge_device::midi_rx_w )
|
||||
{
|
||||
m_rx_state = state;
|
||||
|
||||
for (int i = 0; i < 16; i++) // divider is set to 16
|
||||
{
|
||||
m_acia->rx_clock_in();
|
||||
}
|
||||
}
|
||||
|
||||
static const serial_port_interface midiin_intf =
|
||||
{
|
||||
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_sequential_midi_cartridge_device, midi_rx_w)
|
||||
};
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// SLOT_INTERFACE( midiout_slot )
|
||||
//-------------------------------------------------
|
||||
|
||||
static SLOT_INTERFACE_START( midiout_slot )
|
||||
SLOT_INTERFACE("midiout", MIDIOUT_PORT)
|
||||
SLOT_INTERFACE_END
|
||||
|
||||
static const serial_port_interface midiout_intf =
|
||||
{
|
||||
DEVCB_NULL // midi out ports don't transmit inward
|
||||
};
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// MACHINE_CONFIG_FRAGMENT( c64_sequential_midi )
|
||||
//-------------------------------------------------
|
||||
|
||||
static MACHINE_CONFIG_FRAGMENT( c64_sequential_midi )
|
||||
MCFG_ACIA6850_ADD(MC6850_TAG, acia_intf)
|
||||
|
||||
MCFG_SERIAL_PORT_ADD("mdin", midiin_intf, midiin_slot, "midiin", NULL)
|
||||
MCFG_SERIAL_PORT_ADD("mdout", midiout_intf, midiout_slot, "midiout", NULL)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// machine_config_additions - device-specific
|
||||
// machine configurations
|
||||
//-------------------------------------------------
|
||||
|
||||
machine_config_constructor c64_sequential_midi_cartridge_device::device_mconfig_additions() const
|
||||
{
|
||||
return MACHINE_CONFIG_NAME( c64_sequential_midi );
|
||||
}
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// LIVE DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// c64_sequential_midi_cartridge_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
c64_sequential_midi_cartridge_device::c64_sequential_midi_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
||||
device_t(mconfig, C64_MIDI_SCI, "C64 Sequential Circuits MIDI", tag, owner, clock),
|
||||
device_c64_expansion_card_interface(mconfig, *this),
|
||||
m_acia(*this, MC6850_TAG),
|
||||
m_mdout(*this, "mdout"),
|
||||
m_rx_state(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void c64_sequential_midi_cartridge_device::device_start()
|
||||
{
|
||||
// state saving
|
||||
save_item(NAME(m_rx_state));
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void c64_sequential_midi_cartridge_device::device_reset()
|
||||
{
|
||||
m_acia->reset();
|
||||
|
||||
m_rx_state = 0;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// c64_cd_r - cartridge data read
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT8 c64_sequential_midi_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
|
||||
{
|
||||
if (!io1)
|
||||
{
|
||||
switch (offset & 0xff)
|
||||
{
|
||||
case 2:
|
||||
data = m_acia->status_read(space, 0);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
data = m_acia->data_read(space, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// c64_cd_w - cartridge data write
|
||||
//-------------------------------------------------
|
||||
|
||||
void c64_sequential_midi_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
|
||||
{
|
||||
if (!io1)
|
||||
{
|
||||
switch (offset & 0xff)
|
||||
{
|
||||
case 0:
|
||||
m_acia->control_write(space, 0, data);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
m_acia->data_write(space, 0, data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
67
src/mess/machine/c64_midi_sci.h
Normal file
67
src/mess/machine/c64_midi_sci.h
Normal file
@ -0,0 +1,67 @@
|
||||
/**********************************************************************
|
||||
|
||||
Sequential Circuits MIDI Interface cartridge emulation
|
||||
|
||||
Copyright MESS Team.
|
||||
Visit http://mamedev.org for licensing and usage restrictions.
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef __C64_MIDI_SCI__
|
||||
#define __C64_MIDI_SCI__
|
||||
|
||||
#include "emu.h"
|
||||
#include "machine/c64exp.h"
|
||||
#include "machine/6850acia.h"
|
||||
#include "machine/serial.h"
|
||||
#include "machine/midiinport.h"
|
||||
#include "machine/midioutport.h"
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
// ======================> c64_sequential_midi_cartridge_device
|
||||
|
||||
class c64_sequential_midi_cartridge_device : public device_t,
|
||||
public device_c64_expansion_card_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
c64_sequential_midi_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
// optional information overrides
|
||||
virtual machine_config_constructor device_mconfig_additions() const;
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER( acia_irq_w );
|
||||
DECLARE_WRITE_LINE_MEMBER( midi_rx_w );
|
||||
DECLARE_READ_LINE_MEMBER( rx_in );
|
||||
DECLARE_WRITE_LINE_MEMBER( tx_out );
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_config_complete() { m_shortname = "c64_midisci"; }
|
||||
virtual void device_start();
|
||||
virtual void device_reset();
|
||||
|
||||
// device_c64_expansion_card_interface overrides
|
||||
virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
|
||||
virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
|
||||
|
||||
private:
|
||||
required_device<acia6850_device> m_acia;
|
||||
required_device<serial_port_device> m_mdout;
|
||||
|
||||
int m_rx_state;
|
||||
};
|
||||
|
||||
|
||||
// device type definition
|
||||
extern const device_type C64_MIDI_SCI;
|
||||
|
||||
|
||||
#endif
|
207
src/mess/machine/c64_midi_siel.c
Normal file
207
src/mess/machine/c64_midi_siel.c
Normal file
@ -0,0 +1,207 @@
|
||||
/**********************************************************************
|
||||
|
||||
Siel/JMS/DATEL MIDI Interface cartridge emulation
|
||||
|
||||
Copyright MESS Team.
|
||||
Visit http://mamedev.org for licensing and usage restrictions.
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#include "c64_midi_siel.h"
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// MACROS/CONSTANTS
|
||||
//**************************************************************************
|
||||
|
||||
#define MC6850_TAG "mc6850"
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// DEVICE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
const device_type C64_MIDI_SIEL = &device_creator<c64_siel_midi_cartridge_device>;
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// ACIA6850_INTERFACE( acia_intf )
|
||||
//-------------------------------------------------
|
||||
|
||||
WRITE_LINE_MEMBER( c64_siel_midi_cartridge_device::acia_irq_w )
|
||||
{
|
||||
m_slot->irq_w(state);
|
||||
}
|
||||
|
||||
READ_LINE_MEMBER( c64_siel_midi_cartridge_device::rx_in )
|
||||
{
|
||||
return m_rx_state;
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER( c64_siel_midi_cartridge_device::tx_out )
|
||||
{
|
||||
m_mdout->tx(state);
|
||||
}
|
||||
|
||||
static ACIA6850_INTERFACE( acia_intf )
|
||||
{
|
||||
XTAL_2MHz,
|
||||
0, // rx clock (we manually clock rx)
|
||||
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_siel_midi_cartridge_device, rx_in),
|
||||
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_siel_midi_cartridge_device, tx_out),
|
||||
DEVCB_NULL,
|
||||
DEVCB_NULL,
|
||||
DEVCB_NULL,
|
||||
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_siel_midi_cartridge_device, acia_irq_w)
|
||||
};
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// SLOT_INTERFACE( midiin_slot )
|
||||
//-------------------------------------------------
|
||||
|
||||
static SLOT_INTERFACE_START( midiin_slot )
|
||||
SLOT_INTERFACE("midiin", MIDIIN_PORT)
|
||||
SLOT_INTERFACE_END
|
||||
|
||||
WRITE_LINE_MEMBER( c64_siel_midi_cartridge_device::midi_rx_w )
|
||||
{
|
||||
m_rx_state = state;
|
||||
|
||||
for (int i = 0; i < 64; i++) // divider is set to 64
|
||||
{
|
||||
m_acia->rx_clock_in();
|
||||
}
|
||||
}
|
||||
|
||||
static const serial_port_interface midiin_intf =
|
||||
{
|
||||
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_siel_midi_cartridge_device, midi_rx_w)
|
||||
};
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// SLOT_INTERFACE( midiout_slot )
|
||||
//-------------------------------------------------
|
||||
|
||||
static SLOT_INTERFACE_START( midiout_slot )
|
||||
SLOT_INTERFACE("midiout", MIDIOUT_PORT)
|
||||
SLOT_INTERFACE_END
|
||||
|
||||
static const serial_port_interface midiout_intf =
|
||||
{
|
||||
DEVCB_NULL // midi out ports don't transmit inward
|
||||
};
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// MACHINE_CONFIG_FRAGMENT( c64_siel_midi )
|
||||
//-------------------------------------------------
|
||||
|
||||
static MACHINE_CONFIG_FRAGMENT( c64_siel_midi )
|
||||
MCFG_ACIA6850_ADD(MC6850_TAG, acia_intf)
|
||||
|
||||
MCFG_SERIAL_PORT_ADD("mdin", midiin_intf, midiin_slot, "midiin", NULL)
|
||||
MCFG_SERIAL_PORT_ADD("mdout", midiout_intf, midiout_slot, "midiout", NULL)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// machine_config_additions - device-specific
|
||||
// machine configurations
|
||||
//-------------------------------------------------
|
||||
|
||||
machine_config_constructor c64_siel_midi_cartridge_device::device_mconfig_additions() const
|
||||
{
|
||||
return MACHINE_CONFIG_NAME( c64_siel_midi );
|
||||
}
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// LIVE DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// c64_siel_midi_cartridge_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
c64_siel_midi_cartridge_device::c64_siel_midi_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
||||
device_t(mconfig, C64_MIDI_SIEL, "C64 Siel MIDI", tag, owner, clock),
|
||||
device_c64_expansion_card_interface(mconfig, *this),
|
||||
m_acia(*this, MC6850_TAG),
|
||||
m_mdout(*this, "mdout"),
|
||||
m_rx_state(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void c64_siel_midi_cartridge_device::device_start()
|
||||
{
|
||||
// state saving
|
||||
save_item(NAME(m_rx_state));
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void c64_siel_midi_cartridge_device::device_reset()
|
||||
{
|
||||
m_acia->reset();
|
||||
|
||||
m_rx_state = 0;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// c64_cd_r - cartridge data read
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT8 c64_siel_midi_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
|
||||
{
|
||||
if (!io1)
|
||||
{
|
||||
switch (offset & 0xff)
|
||||
{
|
||||
case 6:
|
||||
data = m_acia->status_read(space, 0);
|
||||
break;
|
||||
|
||||
case 7:
|
||||
data = m_acia->data_read(space, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// c64_cd_w - cartridge data write
|
||||
//-------------------------------------------------
|
||||
|
||||
void c64_siel_midi_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
|
||||
{
|
||||
if (!io1)
|
||||
{
|
||||
switch (offset & 0xff)
|
||||
{
|
||||
case 4:
|
||||
m_acia->control_write(space, 0, data);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
m_acia->data_write(space, 0, data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
67
src/mess/machine/c64_midi_siel.h
Normal file
67
src/mess/machine/c64_midi_siel.h
Normal file
@ -0,0 +1,67 @@
|
||||
/**********************************************************************
|
||||
|
||||
Siel/JMS/DATEL MIDI Interface cartridge emulation
|
||||
|
||||
Copyright MESS Team.
|
||||
Visit http://mamedev.org for licensing and usage restrictions.
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef __C64_MIDI_SIEL__
|
||||
#define __C64_MIDI_SIEL__
|
||||
|
||||
#include "emu.h"
|
||||
#include "machine/c64exp.h"
|
||||
#include "machine/6850acia.h"
|
||||
#include "machine/serial.h"
|
||||
#include "machine/midiinport.h"
|
||||
#include "machine/midioutport.h"
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
// ======================> c64_siel_midi_cartridge_device
|
||||
|
||||
class c64_siel_midi_cartridge_device : public device_t,
|
||||
public device_c64_expansion_card_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
c64_siel_midi_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
// optional information overrides
|
||||
virtual machine_config_constructor device_mconfig_additions() const;
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER( acia_irq_w );
|
||||
DECLARE_WRITE_LINE_MEMBER( midi_rx_w );
|
||||
DECLARE_READ_LINE_MEMBER( rx_in );
|
||||
DECLARE_WRITE_LINE_MEMBER( tx_out );
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_config_complete() { m_shortname = "c64_midisiel"; }
|
||||
virtual void device_start();
|
||||
virtual void device_reset();
|
||||
|
||||
// device_c64_expansion_card_interface overrides
|
||||
virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
|
||||
virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
|
||||
|
||||
private:
|
||||
required_device<acia6850_device> m_acia;
|
||||
required_device<serial_port_device> m_mdout;
|
||||
|
||||
int m_rx_state;
|
||||
};
|
||||
|
||||
|
||||
// device type definition
|
||||
extern const device_type C64_MIDI_SIEL;
|
||||
|
||||
|
||||
#endif
|
@ -1122,6 +1122,11 @@ SLOT_INTERFACE_START( c64_expansion_cards )
|
||||
SLOT_INTERFACE("easyflash", C64_EASYFLASH)
|
||||
SLOT_INTERFACE("georam", C64_GEORAM)
|
||||
SLOT_INTERFACE("ide64", C64_IDE64)
|
||||
SLOT_INTERFACE("midimap", C64_MIDI_MAPLIN)
|
||||
SLOT_INTERFACE("midins", C64_MIDI_NAMESOFT)
|
||||
SLOT_INTERFACE("midipp", C64_MIDI_PASSPORT)
|
||||
SLOT_INTERFACE("midisci", C64_MIDI_SCI)
|
||||
SLOT_INTERFACE("midisiel", C64_MIDI_SIEL)
|
||||
SLOT_INTERFACE("neoram", C64_NEORAM)
|
||||
SLOT_INTERFACE("reu1700", C64_REU1700)
|
||||
SLOT_INTERFACE("reu1750", C64_REU1750)
|
||||
|
@ -35,6 +35,11 @@
|
||||
#include "machine/c64_magic_desk.h"
|
||||
#include "machine/c64_magic_formel.h"
|
||||
#include "machine/c64_magic_voice.h"
|
||||
#include "machine/c64_midi_maplin.h"
|
||||
#include "machine/c64_midi_namesoft.h"
|
||||
#include "machine/c64_midi_passport.h"
|
||||
#include "machine/c64_midi_sci.h"
|
||||
#include "machine/c64_midi_siel.h"
|
||||
#include "machine/c64_mikro_assembler.h"
|
||||
#include "machine/c64_multiscreen.h"
|
||||
#include "machine/c64_neoram.h"
|
||||
|
@ -871,6 +871,11 @@ $(MESSOBJ)/cbm.a: \
|
||||
$(MESS_MACHINE)/c64_magic_desk.o \
|
||||
$(MESS_MACHINE)/c64_magic_formel.o \
|
||||
$(MESS_MACHINE)/c64_magic_voice.o \
|
||||
$(MESS_MACHINE)/c64_midi_maplin.o \
|
||||
$(MESS_MACHINE)/c64_midi_namesoft.o \
|
||||
$(MESS_MACHINE)/c64_midi_passport.o \
|
||||
$(MESS_MACHINE)/c64_midi_sci.o \
|
||||
$(MESS_MACHINE)/c64_midi_siel.o \
|
||||
$(MESS_MACHINE)/c64_mikro_assembler.o \
|
||||
$(MESS_MACHINE)/c64_multiscreen.o \
|
||||
$(MESS_MACHINE)/c64_neoram.o \
|
||||
|
Loading…
Reference in New Issue
Block a user