| Previous | 199869 Revisions | Next |
| r20945 Monday 11th February, 2013 at 15:13:15 UTC by Curt Coder |
|---|
| (MESS) c64: Added support for the standard MIDI cartridges: Passport/Syntech, Siel/JMS/DATEL, Sequential, Namesoft, and Maplin. [Curt Coder] |
| [src/mess] | mess.mak |
| [src/mess/machine] | c64_midi_maplin.c* c64_midi_maplin.h* c64_midi_namesoft.c* c64_midi_namesoft.h* c64_midi_passport.c* c64_midi_passport.h* c64_midi_sci.c* c64_midi_sci.h* c64_midi_siel.c* c64_midi_siel.h* cbmipt.c cbmipt.h |
| r0 | r20945 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Sequential Circuits MIDI Interface cartridge emulation | |
| 4 | ||
| 5 | Copyright MESS Team. | |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | ||
| 8 | **********************************************************************/ | |
| 9 | ||
| 10 | #include "c64_midi_sci.h" | |
| 11 | ||
| 12 | ||
| 13 | ||
| 14 | //************************************************************************** | |
| 15 | // MACROS/CONSTANTS | |
| 16 | //************************************************************************** | |
| 17 | ||
| 18 | #define MC6850_TAG "mc6850" | |
| 19 | ||
| 20 | ||
| 21 | ||
| 22 | //************************************************************************** | |
| 23 | // DEVICE DEFINITIONS | |
| 24 | //************************************************************************** | |
| 25 | ||
| 26 | const device_type C64_MIDI_SCI = &device_creator<c64_sequential_midi_cartridge_device>; | |
| 27 | ||
| 28 | ||
| 29 | //------------------------------------------------- | |
| 30 | // ACIA6850_INTERFACE( acia_intf ) | |
| 31 | //------------------------------------------------- | |
| 32 | ||
| 33 | WRITE_LINE_MEMBER( c64_sequential_midi_cartridge_device::acia_irq_w ) | |
| 34 | { | |
| 35 | m_slot->irq_w(state); | |
| 36 | } | |
| 37 | ||
| 38 | READ_LINE_MEMBER( c64_sequential_midi_cartridge_device::rx_in ) | |
| 39 | { | |
| 40 | return m_rx_state; | |
| 41 | } | |
| 42 | ||
| 43 | WRITE_LINE_MEMBER( c64_sequential_midi_cartridge_device::tx_out ) | |
| 44 | { | |
| 45 | m_mdout->tx(state); | |
| 46 | } | |
| 47 | ||
| 48 | static ACIA6850_INTERFACE( acia_intf ) | |
| 49 | { | |
| 50 | 500000, | |
| 51 | 0, // rx clock (we manually clock rx) | |
| 52 | DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_sequential_midi_cartridge_device, rx_in), | |
| 53 | DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_sequential_midi_cartridge_device, tx_out), | |
| 54 | DEVCB_NULL, | |
| 55 | DEVCB_NULL, | |
| 56 | DEVCB_NULL, | |
| 57 | DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_sequential_midi_cartridge_device, acia_irq_w) | |
| 58 | }; | |
| 59 | ||
| 60 | ||
| 61 | //------------------------------------------------- | |
| 62 | // SLOT_INTERFACE( midiin_slot ) | |
| 63 | //------------------------------------------------- | |
| 64 | ||
| 65 | static SLOT_INTERFACE_START( midiin_slot ) | |
| 66 | SLOT_INTERFACE("midiin", MIDIIN_PORT) | |
| 67 | SLOT_INTERFACE_END | |
| 68 | ||
| 69 | WRITE_LINE_MEMBER( c64_sequential_midi_cartridge_device::midi_rx_w ) | |
| 70 | { | |
| 71 | m_rx_state = state; | |
| 72 | ||
| 73 | for (int i = 0; i < 16; i++) // divider is set to 16 | |
| 74 | { | |
| 75 | m_acia->rx_clock_in(); | |
| 76 | } | |
| 77 | } | |
| 78 | ||
| 79 | static const serial_port_interface midiin_intf = | |
| 80 | { | |
| 81 | DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_sequential_midi_cartridge_device, midi_rx_w) | |
| 82 | }; | |
| 83 | ||
| 84 | ||
| 85 | //------------------------------------------------- | |
| 86 | // SLOT_INTERFACE( midiout_slot ) | |
| 87 | //------------------------------------------------- | |
| 88 | ||
| 89 | static SLOT_INTERFACE_START( midiout_slot ) | |
| 90 | SLOT_INTERFACE("midiout", MIDIOUT_PORT) | |
| 91 | SLOT_INTERFACE_END | |
| 92 | ||
| 93 | static const serial_port_interface midiout_intf = | |
| 94 | { | |
| 95 | DEVCB_NULL // midi out ports don't transmit inward | |
| 96 | }; | |
| 97 | ||
| 98 | ||
| 99 | //------------------------------------------------- | |
| 100 | // MACHINE_CONFIG_FRAGMENT( c64_sequential_midi ) | |
| 101 | //------------------------------------------------- | |
| 102 | ||
| 103 | static MACHINE_CONFIG_FRAGMENT( c64_sequential_midi ) | |
| 104 | MCFG_ACIA6850_ADD(MC6850_TAG, acia_intf) | |
| 105 | ||
| 106 | MCFG_SERIAL_PORT_ADD("mdin", midiin_intf, midiin_slot, "midiin", NULL) | |
| 107 | MCFG_SERIAL_PORT_ADD("mdout", midiout_intf, midiout_slot, "midiout", NULL) | |
| 108 | MACHINE_CONFIG_END | |
| 109 | ||
| 110 | ||
| 111 | //------------------------------------------------- | |
| 112 | // machine_config_additions - device-specific | |
| 113 | // machine configurations | |
| 114 | //------------------------------------------------- | |
| 115 | ||
| 116 | machine_config_constructor c64_sequential_midi_cartridge_device::device_mconfig_additions() const | |
| 117 | { | |
| 118 | return MACHINE_CONFIG_NAME( c64_sequential_midi ); | |
| 119 | } | |
| 120 | ||
| 121 | ||
| 122 | ||
| 123 | //************************************************************************** | |
| 124 | // LIVE DEVICE | |
| 125 | //************************************************************************** | |
| 126 | ||
| 127 | //------------------------------------------------- | |
| 128 | // c64_sequential_midi_cartridge_device - constructor | |
| 129 | //------------------------------------------------- | |
| 130 | ||
| 131 | c64_sequential_midi_cartridge_device::c64_sequential_midi_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 132 | device_t(mconfig, C64_MIDI_SCI, "C64 Sequential Circuits MIDI", tag, owner, clock), | |
| 133 | device_c64_expansion_card_interface(mconfig, *this), | |
| 134 | m_acia(*this, MC6850_TAG), | |
| 135 | m_mdout(*this, "mdout"), | |
| 136 | m_rx_state(0) | |
| 137 | { | |
| 138 | } | |
| 139 | ||
| 140 | ||
| 141 | //------------------------------------------------- | |
| 142 | // device_start - device-specific startup | |
| 143 | //------------------------------------------------- | |
| 144 | ||
| 145 | void c64_sequential_midi_cartridge_device::device_start() | |
| 146 | { | |
| 147 | // state saving | |
| 148 | save_item(NAME(m_rx_state)); | |
| 149 | } | |
| 150 | ||
| 151 | //------------------------------------------------- | |
| 152 | // device_reset - device-specific reset | |
| 153 | //------------------------------------------------- | |
| 154 | ||
| 155 | void c64_sequential_midi_cartridge_device::device_reset() | |
| 156 | { | |
| 157 | m_acia->reset(); | |
| 158 | ||
| 159 | m_rx_state = 0; | |
| 160 | } | |
| 161 | ||
| 162 | ||
| 163 | //------------------------------------------------- | |
| 164 | // c64_cd_r - cartridge data read | |
| 165 | //------------------------------------------------- | |
| 166 | ||
| 167 | 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) | |
| 168 | { | |
| 169 | if (!io1) | |
| 170 | { | |
| 171 | switch (offset & 0xff) | |
| 172 | { | |
| 173 | case 2: | |
| 174 | data = m_acia->status_read(space, 0); | |
| 175 | break; | |
| 176 | ||
| 177 | case 3: | |
| 178 | data = m_acia->data_read(space, 0); | |
| 179 | break; | |
| 180 | } | |
| 181 | } | |
| 182 | ||
| 183 | return data; | |
| 184 | } | |
| 185 | ||
| 186 | ||
| 187 | //------------------------------------------------- | |
| 188 | // c64_cd_w - cartridge data write | |
| 189 | //------------------------------------------------- | |
| 190 | ||
| 191 | 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) | |
| 192 | { | |
| 193 | if (!io1) | |
| 194 | { | |
| 195 | switch (offset & 0xff) | |
| 196 | { | |
| 197 | case 0: | |
| 198 | m_acia->control_write(space, 0, data); | |
| 199 | break; | |
| 200 | ||
| 201 | case 1: | |
| 202 | m_acia->data_write(space, 0, data); | |
| 203 | break; | |
| 204 | } | |
| 205 | } | |
| 206 | } |
| Added: svn:eol-style + native Added: svn:mime-type + text/plain |
| r0 | r20945 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Sequential Circuits MIDI Interface cartridge emulation | |
| 4 | ||
| 5 | Copyright MESS Team. | |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | ||
| 8 | **********************************************************************/ | |
| 9 | ||
| 10 | #pragma once | |
| 11 | ||
| 12 | #ifndef __C64_MIDI_SCI__ | |
| 13 | #define __C64_MIDI_SCI__ | |
| 14 | ||
| 15 | #include "emu.h" | |
| 16 | #include "machine/c64exp.h" | |
| 17 | #include "machine/6850acia.h" | |
| 18 | #include "machine/serial.h" | |
| 19 | #include "machine/midiinport.h" | |
| 20 | #include "machine/midioutport.h" | |
| 21 | ||
| 22 | ||
| 23 | ||
| 24 | //************************************************************************** | |
| 25 | // TYPE DEFINITIONS | |
| 26 | //************************************************************************** | |
| 27 | ||
| 28 | // ======================> c64_sequential_midi_cartridge_device | |
| 29 | ||
| 30 | class c64_sequential_midi_cartridge_device : public device_t, | |
| 31 | public device_c64_expansion_card_interface | |
| 32 | { | |
| 33 | public: | |
| 34 | // construction/destruction | |
| 35 | c64_sequential_midi_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 36 | ||
| 37 | // optional information overrides | |
| 38 | virtual machine_config_constructor device_mconfig_additions() const; | |
| 39 | ||
| 40 | DECLARE_WRITE_LINE_MEMBER( acia_irq_w ); | |
| 41 | DECLARE_WRITE_LINE_MEMBER( midi_rx_w ); | |
| 42 | DECLARE_READ_LINE_MEMBER( rx_in ); | |
| 43 | DECLARE_WRITE_LINE_MEMBER( tx_out ); | |
| 44 | ||
| 45 | protected: | |
| 46 | // device-level overrides | |
| 47 | virtual void device_config_complete() { m_shortname = "c64_midisci"; } | |
| 48 | virtual void device_start(); | |
| 49 | virtual void device_reset(); | |
| 50 | ||
| 51 | // device_c64_expansion_card_interface overrides | |
| 52 | 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); | |
| 53 | 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); | |
| 54 | ||
| 55 | private: | |
| 56 | required_device<acia6850_device> m_acia; | |
| 57 | required_device<serial_port_device> m_mdout; | |
| 58 | ||
| 59 | int m_rx_state; | |
| 60 | }; | |
| 61 | ||
| 62 | ||
| 63 | // device type definition | |
| 64 | extern const device_type C64_MIDI_SCI; | |
| 65 | ||
| 66 | ||
| 67 | #endif |
| Added: svn:mime-type + text/plain Added: svn:eol-style + native |
| r0 | r20945 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Siel/JMS/DATEL MIDI Interface cartridge emulation | |
| 4 | ||
| 5 | Copyright MESS Team. | |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | ||
| 8 | **********************************************************************/ | |
| 9 | ||
| 10 | #include "c64_midi_siel.h" | |
| 11 | ||
| 12 | ||
| 13 | ||
| 14 | //************************************************************************** | |
| 15 | // MACROS/CONSTANTS | |
| 16 | //************************************************************************** | |
| 17 | ||
| 18 | #define MC6850_TAG "mc6850" | |
| 19 | ||
| 20 | ||
| 21 | ||
| 22 | //************************************************************************** | |
| 23 | // DEVICE DEFINITIONS | |
| 24 | //************************************************************************** | |
| 25 | ||
| 26 | const device_type C64_MIDI_SIEL = &device_creator<c64_siel_midi_cartridge_device>; | |
| 27 | ||
| 28 | ||
| 29 | //------------------------------------------------- | |
| 30 | // ACIA6850_INTERFACE( acia_intf ) | |
| 31 | //------------------------------------------------- | |
| 32 | ||
| 33 | WRITE_LINE_MEMBER( c64_siel_midi_cartridge_device::acia_irq_w ) | |
| 34 | { | |
| 35 | m_slot->irq_w(state); | |
| 36 | } | |
| 37 | ||
| 38 | READ_LINE_MEMBER( c64_siel_midi_cartridge_device::rx_in ) | |
| 39 | { | |
| 40 | return m_rx_state; | |
| 41 | } | |
| 42 | ||
| 43 | WRITE_LINE_MEMBER( c64_siel_midi_cartridge_device::tx_out ) | |
| 44 | { | |
| 45 | m_mdout->tx(state); | |
| 46 | } | |
| 47 | ||
| 48 | static ACIA6850_INTERFACE( acia_intf ) | |
| 49 | { | |
| 50 | XTAL_2MHz, | |
| 51 | 0, // rx clock (we manually clock rx) | |
| 52 | DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_siel_midi_cartridge_device, rx_in), | |
| 53 | DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_siel_midi_cartridge_device, tx_out), | |
| 54 | DEVCB_NULL, | |
| 55 | DEVCB_NULL, | |
| 56 | DEVCB_NULL, | |
| 57 | DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_siel_midi_cartridge_device, acia_irq_w) | |
| 58 | }; | |
| 59 | ||
| 60 | ||
| 61 | //------------------------------------------------- | |
| 62 | // SLOT_INTERFACE( midiin_slot ) | |
| 63 | //------------------------------------------------- | |
| 64 | ||
| 65 | static SLOT_INTERFACE_START( midiin_slot ) | |
| 66 | SLOT_INTERFACE("midiin", MIDIIN_PORT) | |
| 67 | SLOT_INTERFACE_END | |
| 68 | ||
| 69 | WRITE_LINE_MEMBER( c64_siel_midi_cartridge_device::midi_rx_w ) | |
| 70 | { | |
| 71 | m_rx_state = state; | |
| 72 | ||
| 73 | for (int i = 0; i < 64; i++) // divider is set to 64 | |
| 74 | { | |
| 75 | m_acia->rx_clock_in(); | |
| 76 | } | |
| 77 | } | |
| 78 | ||
| 79 | static const serial_port_interface midiin_intf = | |
| 80 | { | |
| 81 | DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_siel_midi_cartridge_device, midi_rx_w) | |
| 82 | }; | |
| 83 | ||
| 84 | ||
| 85 | //------------------------------------------------- | |
| 86 | // SLOT_INTERFACE( midiout_slot ) | |
| 87 | //------------------------------------------------- | |
| 88 | ||
| 89 | static SLOT_INTERFACE_START( midiout_slot ) | |
| 90 | SLOT_INTERFACE("midiout", MIDIOUT_PORT) | |
| 91 | SLOT_INTERFACE_END | |
| 92 | ||
| 93 | static const serial_port_interface midiout_intf = | |
| 94 | { | |
| 95 | DEVCB_NULL // midi out ports don't transmit inward | |
| 96 | }; | |
| 97 | ||
| 98 | ||
| 99 | //------------------------------------------------- | |
| 100 | // MACHINE_CONFIG_FRAGMENT( c64_siel_midi ) | |
| 101 | //------------------------------------------------- | |
| 102 | ||
| 103 | static MACHINE_CONFIG_FRAGMENT( c64_siel_midi ) | |
| 104 | MCFG_ACIA6850_ADD(MC6850_TAG, acia_intf) | |
| 105 | ||
| 106 | MCFG_SERIAL_PORT_ADD("mdin", midiin_intf, midiin_slot, "midiin", NULL) | |
| 107 | MCFG_SERIAL_PORT_ADD("mdout", midiout_intf, midiout_slot, "midiout", NULL) | |
| 108 | MACHINE_CONFIG_END | |
| 109 | ||
| 110 | ||
| 111 | //------------------------------------------------- | |
| 112 | // machine_config_additions - device-specific | |
| 113 | // machine configurations | |
| 114 | //------------------------------------------------- | |
| 115 | ||
| 116 | machine_config_constructor c64_siel_midi_cartridge_device::device_mconfig_additions() const | |
| 117 | { | |
| 118 | return MACHINE_CONFIG_NAME( c64_siel_midi ); | |
| 119 | } | |
| 120 | ||
| 121 | ||
| 122 | ||
| 123 | //************************************************************************** | |
| 124 | // LIVE DEVICE | |
| 125 | //************************************************************************** | |
| 126 | ||
| 127 | //------------------------------------------------- | |
| 128 | // c64_siel_midi_cartridge_device - constructor | |
| 129 | //------------------------------------------------- | |
| 130 | ||
| 131 | c64_siel_midi_cartridge_device::c64_siel_midi_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 132 | device_t(mconfig, C64_MIDI_SIEL, "C64 Siel MIDI", tag, owner, clock), | |
| 133 | device_c64_expansion_card_interface(mconfig, *this), | |
| 134 | m_acia(*this, MC6850_TAG), | |
| 135 | m_mdout(*this, "mdout"), | |
| 136 | m_rx_state(0) | |
| 137 | { | |
| 138 | } | |
| 139 | ||
| 140 | ||
| 141 | //------------------------------------------------- | |
| 142 | // device_start - device-specific startup | |
| 143 | //------------------------------------------------- | |
| 144 | ||
| 145 | void c64_siel_midi_cartridge_device::device_start() | |
| 146 | { | |
| 147 | // state saving | |
| 148 | save_item(NAME(m_rx_state)); | |
| 149 | } | |
| 150 | ||
| 151 | ||
| 152 | //------------------------------------------------- | |
| 153 | // device_reset - device-specific reset | |
| 154 | //------------------------------------------------- | |
| 155 | ||
| 156 | void c64_siel_midi_cartridge_device::device_reset() | |
| 157 | { | |
| 158 | m_acia->reset(); | |
| 159 | ||
| 160 | m_rx_state = 0; | |
| 161 | } | |
| 162 | ||
| 163 | ||
| 164 | //------------------------------------------------- | |
| 165 | // c64_cd_r - cartridge data read | |
| 166 | //------------------------------------------------- | |
| 167 | ||
| 168 | 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) | |
| 169 | { | |
| 170 | if (!io1) | |
| 171 | { | |
| 172 | switch (offset & 0xff) | |
| 173 | { | |
| 174 | case 6: | |
| 175 | data = m_acia->status_read(space, 0); | |
| 176 | break; | |
| 177 | ||
| 178 | case 7: | |
| 179 | data = m_acia->data_read(space, 0); | |
| 180 | break; | |
| 181 | } | |
| 182 | } | |
| 183 | ||
| 184 | return data; | |
| 185 | } | |
| 186 | ||
| 187 | ||
| 188 | //------------------------------------------------- | |
| 189 | // c64_cd_w - cartridge data write | |
| 190 | //------------------------------------------------- | |
| 191 | ||
| 192 | 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) | |
| 193 | { | |
| 194 | if (!io1) | |
| 195 | { | |
| 196 | switch (offset & 0xff) | |
| 197 | { | |
| 198 | case 4: | |
| 199 | m_acia->control_write(space, 0, data); | |
| 200 | break; | |
| 201 | ||
| 202 | case 5: | |
| 203 | m_acia->data_write(space, 0, data); | |
| 204 | break; | |
| 205 | } | |
| 206 | } | |
| 207 | } |
| Added: svn:mime-type + text/plain Added: svn:eol-style + native |
| r0 | r20945 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Siel/JMS/DATEL MIDI Interface cartridge emulation | |
| 4 | ||
| 5 | Copyright MESS Team. | |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | ||
| 8 | **********************************************************************/ | |
| 9 | ||
| 10 | #pragma once | |
| 11 | ||
| 12 | #ifndef __C64_MIDI_SIEL__ | |
| 13 | #define __C64_MIDI_SIEL__ | |
| 14 | ||
| 15 | #include "emu.h" | |
| 16 | #include "machine/c64exp.h" | |
| 17 | #include "machine/6850acia.h" | |
| 18 | #include "machine/serial.h" | |
| 19 | #include "machine/midiinport.h" | |
| 20 | #include "machine/midioutport.h" | |
| 21 | ||
| 22 | ||
| 23 | ||
| 24 | //************************************************************************** | |
| 25 | // TYPE DEFINITIONS | |
| 26 | //************************************************************************** | |
| 27 | ||
| 28 | // ======================> c64_siel_midi_cartridge_device | |
| 29 | ||
| 30 | class c64_siel_midi_cartridge_device : public device_t, | |
| 31 | public device_c64_expansion_card_interface | |
| 32 | { | |
| 33 | public: | |
| 34 | // construction/destruction | |
| 35 | c64_siel_midi_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 36 | ||
| 37 | // optional information overrides | |
| 38 | virtual machine_config_constructor device_mconfig_additions() const; | |
| 39 | ||
| 40 | DECLARE_WRITE_LINE_MEMBER( acia_irq_w ); | |
| 41 | DECLARE_WRITE_LINE_MEMBER( midi_rx_w ); | |
| 42 | DECLARE_READ_LINE_MEMBER( rx_in ); | |
| 43 | DECLARE_WRITE_LINE_MEMBER( tx_out ); | |
| 44 | ||
| 45 | protected: | |
| 46 | // device-level overrides | |
| 47 | virtual void device_config_complete() { m_shortname = "c64_midisiel"; } | |
| 48 | virtual void device_start(); | |
| 49 | virtual void device_reset(); | |
| 50 | ||
| 51 | // device_c64_expansion_card_interface overrides | |
| 52 | 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); | |
| 53 | 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); | |
| 54 | ||
| 55 | private: | |
| 56 | required_device<acia6850_device> m_acia; | |
| 57 | required_device<serial_port_device> m_mdout; | |
| 58 | ||
| 59 | int m_rx_state; | |
| 60 | }; | |
| 61 | ||
| 62 | ||
| 63 | // device type definition | |
| 64 | extern const device_type C64_MIDI_SIEL; | |
| 65 | ||
| 66 | ||
| 67 | #endif |
| Added: svn:mime-type + text/plain Added: svn:eol-style + native |
| r20944 | r20945 | |
|---|---|---|
| 1122 | 1122 | SLOT_INTERFACE("easyflash", C64_EASYFLASH) |
| 1123 | 1123 | SLOT_INTERFACE("georam", C64_GEORAM) |
| 1124 | 1124 | SLOT_INTERFACE("ide64", C64_IDE64) |
| 1125 | SLOT_INTERFACE("midimap", C64_MIDI_MAPLIN) | |
| 1126 | SLOT_INTERFACE("midins", C64_MIDI_NAMESOFT) | |
| 1127 | SLOT_INTERFACE("midipp", C64_MIDI_PASSPORT) | |
| 1128 | SLOT_INTERFACE("midisci", C64_MIDI_SCI) | |
| 1129 | SLOT_INTERFACE("midisiel", C64_MIDI_SIEL) | |
| 1125 | 1130 | SLOT_INTERFACE("neoram", C64_NEORAM) |
| 1126 | 1131 | SLOT_INTERFACE("reu1700", C64_REU1700) |
| 1127 | 1132 | SLOT_INTERFACE("reu1750", C64_REU1750) |
| r20944 | r20945 | |
|---|---|---|
| 35 | 35 | #include "machine/c64_magic_desk.h" |
| 36 | 36 | #include "machine/c64_magic_formel.h" |
| 37 | 37 | #include "machine/c64_magic_voice.h" |
| 38 | #include "machine/c64_midi_maplin.h" | |
| 39 | #include "machine/c64_midi_namesoft.h" | |
| 40 | #include "machine/c64_midi_passport.h" | |
| 41 | #include "machine/c64_midi_sci.h" | |
| 42 | #include "machine/c64_midi_siel.h" | |
| 38 | 43 | #include "machine/c64_mikro_assembler.h" |
| 39 | 44 | #include "machine/c64_multiscreen.h" |
| 40 | 45 | #include "machine/c64_neoram.h" |
| r0 | r20945 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Namesoft MIDI Interface cartridge emulation | |
| 4 | ||
| 5 | Copyright MESS Team. | |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | ||
| 8 | **********************************************************************/ | |
| 9 | ||
| 10 | #include "c64_midi_namesoft.h" | |
| 11 | ||
| 12 | ||
| 13 | ||
| 14 | //************************************************************************** | |
| 15 | // MACROS/CONSTANTS | |
| 16 | //************************************************************************** | |
| 17 | ||
| 18 | #define MC6850_TAG "mc6850" | |
| 19 | ||
| 20 | ||
| 21 | ||
| 22 | //************************************************************************** | |
| 23 | // DEVICE DEFINITIONS | |
| 24 | //************************************************************************** | |
| 25 | ||
| 26 | const device_type C64_MIDI_NAMESOFT = &device_creator<c64_namesoft_midi_cartridge_device>; | |
| 27 | ||
| 28 | ||
| 29 | //------------------------------------------------- | |
| 30 | // ACIA6850_INTERFACE( acia_intf ) | |
| 31 | //------------------------------------------------- | |
| 32 | ||
| 33 | WRITE_LINE_MEMBER( c64_namesoft_midi_cartridge_device::acia_irq_w ) | |
| 34 | { | |
| 35 | m_slot->nmi_w(state); | |
| 36 | } | |
| 37 | ||
| 38 | READ_LINE_MEMBER( c64_namesoft_midi_cartridge_device::rx_in ) | |
| 39 | { | |
| 40 | return m_rx_state; | |
| 41 | } | |
| 42 | ||
| 43 | WRITE_LINE_MEMBER( c64_namesoft_midi_cartridge_device::tx_out ) | |
| 44 | { | |
| 45 | m_mdout->tx(state); | |
| 46 | } | |
| 47 | ||
| 48 | static ACIA6850_INTERFACE( acia_intf ) | |
| 49 | { | |
| 50 | 500000, | |
| 51 | 0, // rx clock (we manually clock rx) | |
| 52 | DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_namesoft_midi_cartridge_device, rx_in), | |
| 53 | DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_namesoft_midi_cartridge_device, tx_out), | |
| 54 | DEVCB_NULL, | |
| 55 | DEVCB_NULL, | |
| 56 | DEVCB_NULL, | |
| 57 | DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_namesoft_midi_cartridge_device, acia_irq_w) | |
| 58 | }; | |
| 59 | ||
| 60 | ||
| 61 | //------------------------------------------------- | |
| 62 | // SLOT_INTERFACE( midiin_slot ) | |
| 63 | //------------------------------------------------- | |
| 64 | ||
| 65 | static SLOT_INTERFACE_START( midiin_slot ) | |
| 66 | SLOT_INTERFACE("midiin", MIDIIN_PORT) | |
| 67 | SLOT_INTERFACE_END | |
| 68 | ||
| 69 | WRITE_LINE_MEMBER( c64_namesoft_midi_cartridge_device::midi_rx_w ) | |
| 70 | { | |
| 71 | m_rx_state = state; | |
| 72 | ||
| 73 | for (int i = 0; i < 16; i++) // divider is set to 16 | |
| 74 | { | |
| 75 | m_acia->rx_clock_in(); | |
| 76 | } | |
| 77 | } | |
| 78 | ||
| 79 | static const serial_port_interface midiin_intf = | |
| 80 | { | |
| 81 | DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_namesoft_midi_cartridge_device, midi_rx_w) | |
| 82 | }; | |
| 83 | ||
| 84 | ||
| 85 | //------------------------------------------------- | |
| 86 | // SLOT_INTERFACE( midiout_slot ) | |
| 87 | //------------------------------------------------- | |
| 88 | ||
| 89 | static SLOT_INTERFACE_START( midiout_slot ) | |
| 90 | SLOT_INTERFACE("midiout", MIDIOUT_PORT) | |
| 91 | SLOT_INTERFACE_END | |
| 92 | ||
| 93 | static const serial_port_interface midiout_intf = | |
| 94 | { | |
| 95 | DEVCB_NULL // midi out ports don't transmit inward | |
| 96 | }; | |
| 97 | ||
| 98 | ||
| 99 | //------------------------------------------------- | |
| 100 | // MACHINE_CONFIG_FRAGMENT( c64_passport_midi ) | |
| 101 | //------------------------------------------------- | |
| 102 | ||
| 103 | static MACHINE_CONFIG_FRAGMENT( c64_passport_midi ) | |
| 104 | MCFG_ACIA6850_ADD(MC6850_TAG, acia_intf) | |
| 105 | ||
| 106 | MCFG_SERIAL_PORT_ADD("mdin", midiin_intf, midiin_slot, "midiin", NULL) | |
| 107 | MCFG_SERIAL_PORT_ADD("mdout", midiout_intf, midiout_slot, "midiout", NULL) | |
| 108 | MACHINE_CONFIG_END | |
| 109 | ||
| 110 | ||
| 111 | //------------------------------------------------- | |
| 112 | // machine_config_additions - device-specific | |
| 113 | // machine configurations | |
| 114 | //------------------------------------------------- | |
| 115 | ||
| 116 | machine_config_constructor c64_namesoft_midi_cartridge_device::device_mconfig_additions() const | |
| 117 | { | |
| 118 | return MACHINE_CONFIG_NAME( c64_passport_midi ); | |
| 119 | } | |
| 120 | ||
| 121 | ||
| 122 | ||
| 123 | //************************************************************************** | |
| 124 | // LIVE DEVICE | |
| 125 | //************************************************************************** | |
| 126 | ||
| 127 | //------------------------------------------------- | |
| 128 | // c64_namesoft_midi_cartridge_device - constructor | |
| 129 | //------------------------------------------------- | |
| 130 | ||
| 131 | c64_namesoft_midi_cartridge_device::c64_namesoft_midi_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 132 | device_t(mconfig, C64_MIDI_NAMESOFT, "C64 Namesoft MIDI", tag, owner, clock), | |
| 133 | device_c64_expansion_card_interface(mconfig, *this), | |
| 134 | m_acia(*this, MC6850_TAG), | |
| 135 | m_mdout(*this, "mdout"), | |
| 136 | m_rx_state(0) | |
| 137 | { | |
| 138 | } | |
| 139 | ||
| 140 | ||
| 141 | //------------------------------------------------- | |
| 142 | // device_start - device-specific startup | |
| 143 | //------------------------------------------------- | |
| 144 | ||
| 145 | void c64_namesoft_midi_cartridge_device::device_start() | |
| 146 | { | |
| 147 | // state saving | |
| 148 | save_item(NAME(m_rx_state)); | |
| 149 | } | |
| 150 | ||
| 151 | //------------------------------------------------- | |
| 152 | // device_reset - device-specific reset | |
| 153 | //------------------------------------------------- | |
| 154 | ||
| 155 | void c64_namesoft_midi_cartridge_device::device_reset() | |
| 156 | { | |
| 157 | m_acia->reset(); | |
| 158 | ||
| 159 | m_rx_state = 0; | |
| 160 | } | |
| 161 | ||
| 162 | ||
| 163 | //------------------------------------------------- | |
| 164 | // c64_cd_r - cartridge data read | |
| 165 | //------------------------------------------------- | |
| 166 | ||
| 167 | 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) | |
| 168 | { | |
| 169 | if (!io1) | |
| 170 | { | |
| 171 | switch (offset & 0xff) | |
| 172 | { | |
| 173 | case 2: | |
| 174 | data = m_acia->status_read(space, 0); | |
| 175 | break; | |
| 176 | ||
| 177 | case 3: | |
| 178 | data = m_acia->data_read(space, 0); | |
| 179 | break; | |
| 180 | } | |
| 181 | } | |
| 182 | ||
| 183 | return data; | |
| 184 | } | |
| 185 | ||
| 186 | ||
| 187 | //------------------------------------------------- | |
| 188 | // c64_cd_w - cartridge data write | |
| 189 | //------------------------------------------------- | |
| 190 | ||
| 191 | 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) | |
| 192 | { | |
| 193 | if (!io1) | |
| 194 | { | |
| 195 | switch (offset & 0xff) | |
| 196 | { | |
| 197 | case 0: | |
| 198 | m_acia->control_write(space, 0, data); | |
| 199 | break; | |
| 200 | ||
| 201 | case 1: | |
| 202 | m_acia->data_write(space, 0, data); | |
| 203 | break; | |
| 204 | } | |
| 205 | } | |
| 206 | } |
| Added: svn:mime-type + text/plain Added: svn:eol-style + native |
| r0 | r20945 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Namesoft MIDI Interface cartridge emulation | |
| 4 | ||
| 5 | Copyright MESS Team. | |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | ||
| 8 | **********************************************************************/ | |
| 9 | ||
| 10 | #pragma once | |
| 11 | ||
| 12 | #ifndef __C64_MIDI_NAMESOFT__ | |
| 13 | #define __C64_MIDI_NAMESOFT__ | |
| 14 | ||
| 15 | #include "emu.h" | |
| 16 | #include "machine/c64exp.h" | |
| 17 | #include "machine/6850acia.h" | |
| 18 | #include "machine/serial.h" | |
| 19 | #include "machine/midiinport.h" | |
| 20 | #include "machine/midioutport.h" | |
| 21 | ||
| 22 | ||
| 23 | ||
| 24 | //************************************************************************** | |
| 25 | // TYPE DEFINITIONS | |
| 26 | //************************************************************************** | |
| 27 | ||
| 28 | // ======================> c64_namesoft_midi_cartridge_device | |
| 29 | ||
| 30 | class c64_namesoft_midi_cartridge_device : public device_t, | |
| 31 | public device_c64_expansion_card_interface | |
| 32 | { | |
| 33 | public: | |
| 34 | // construction/destruction | |
| 35 | c64_namesoft_midi_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 36 | ||
| 37 | // optional information overrides | |
| 38 | virtual machine_config_constructor device_mconfig_additions() const; | |
| 39 | ||
| 40 | DECLARE_WRITE_LINE_MEMBER( acia_irq_w ); | |
| 41 | DECLARE_WRITE_LINE_MEMBER( midi_rx_w ); | |
| 42 | DECLARE_READ_LINE_MEMBER( rx_in ); | |
| 43 | DECLARE_WRITE_LINE_MEMBER( tx_out ); | |
| 44 | ||
| 45 | protected: | |
| 46 | // device-level overrides | |
| 47 | virtual void device_config_complete() { m_shortname = "c64_midins"; } | |
| 48 | virtual void device_start(); | |
| 49 | virtual void device_reset(); | |
| 50 | ||
| 51 | // device_c64_expansion_card_interface overrides | |
| 52 | 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); | |
| 53 | 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); | |
| 54 | ||
| 55 | private: | |
| 56 | required_device<acia6850_device> m_acia; | |
| 57 | required_device<serial_port_device> m_mdout; | |
| 58 | ||
| 59 | int m_rx_state; | |
| 60 | }; | |
| 61 | ||
| 62 | ||
| 63 | // device type definition | |
| 64 | extern const device_type C64_MIDI_NAMESOFT; | |
| 65 | ||
| 66 | ||
| 67 | #endif |
| Added: svn:eol-style + native Added: svn:mime-type + text/plain |
| r0 | r20945 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Maplin MIDI Interface cartridge emulation | |
| 4 | ||
| 5 | Copyright MESS Team. | |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | ||
| 8 | **********************************************************************/ | |
| 9 | ||
| 10 | #include "c64_midi_maplin.h" | |
| 11 | ||
| 12 | ||
| 13 | ||
| 14 | //************************************************************************** | |
| 15 | // MACROS/CONSTANTS | |
| 16 | //************************************************************************** | |
| 17 | ||
| 18 | #define MC6850_TAG "mc6850" | |
| 19 | ||
| 20 | ||
| 21 | ||
| 22 | //************************************************************************** | |
| 23 | // DEVICE DEFINITIONS | |
| 24 | //************************************************************************** | |
| 25 | ||
| 26 | const device_type C64_MIDI_MAPLIN = &device_creator<c64_maplin_midi_cartridge_device>; | |
| 27 | ||
| 28 | ||
| 29 | //------------------------------------------------- | |
| 30 | // ACIA6850_INTERFACE( acia_intf ) | |
| 31 | //------------------------------------------------- | |
| 32 | ||
| 33 | WRITE_LINE_MEMBER( c64_maplin_midi_cartridge_device::acia_irq_w ) | |
| 34 | { | |
| 35 | m_slot->irq_w(state); | |
| 36 | } | |
| 37 | ||
| 38 | READ_LINE_MEMBER( c64_maplin_midi_cartridge_device::rx_in ) | |
| 39 | { | |
| 40 | return m_rx_state; | |
| 41 | } | |
| 42 | ||
| 43 | WRITE_LINE_MEMBER( c64_maplin_midi_cartridge_device::tx_out ) | |
| 44 | { | |
| 45 | m_mdout->tx(state); | |
| 46 | } | |
| 47 | ||
| 48 | static ACIA6850_INTERFACE( acia_intf ) | |
| 49 | { | |
| 50 | 500000, | |
| 51 | 0, // rx clock (we manually clock rx) | |
| 52 | DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_maplin_midi_cartridge_device, rx_in), | |
| 53 | DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_maplin_midi_cartridge_device, tx_out), | |
| 54 | DEVCB_NULL, | |
| 55 | DEVCB_NULL, | |
| 56 | DEVCB_NULL, | |
| 57 | DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_maplin_midi_cartridge_device, acia_irq_w) | |
| 58 | }; | |
| 59 | ||
| 60 | ||
| 61 | //------------------------------------------------- | |
| 62 | // SLOT_INTERFACE( midiin_slot ) | |
| 63 | //------------------------------------------------- | |
| 64 | ||
| 65 | static SLOT_INTERFACE_START( midiin_slot ) | |
| 66 | SLOT_INTERFACE("midiin", MIDIIN_PORT) | |
| 67 | SLOT_INTERFACE_END | |
| 68 | ||
| 69 | WRITE_LINE_MEMBER( c64_maplin_midi_cartridge_device::midi_rx_w ) | |
| 70 | { | |
| 71 | m_rx_state = state; | |
| 72 | ||
| 73 | for (int i = 0; i < 16; i++) // divider is set to 64 | |
| 74 | { | |
| 75 | m_acia->rx_clock_in(); | |
| 76 | } | |
| 77 | } | |
| 78 | ||
| 79 | static const serial_port_interface midiin_intf = | |
| 80 | { | |
| 81 | DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_maplin_midi_cartridge_device, midi_rx_w) | |
| 82 | }; | |
| 83 | ||
| 84 | ||
| 85 | //------------------------------------------------- | |
| 86 | // SLOT_INTERFACE( midiout_slot ) | |
| 87 | //------------------------------------------------- | |
| 88 | ||
| 89 | static SLOT_INTERFACE_START( midiout_slot ) | |
| 90 | SLOT_INTERFACE("midiout", MIDIOUT_PORT) | |
| 91 | SLOT_INTERFACE_END | |
| 92 | ||
| 93 | static const serial_port_interface midiout_intf = | |
| 94 | { | |
| 95 | DEVCB_NULL // midi out ports don't transmit inward | |
| 96 | }; | |
| 97 | ||
| 98 | ||
| 99 | //------------------------------------------------- | |
| 100 | // MACHINE_CONFIG_FRAGMENT( c64_maplin_midi ) | |
| 101 | //------------------------------------------------- | |
| 102 | ||
| 103 | static MACHINE_CONFIG_FRAGMENT( c64_maplin_midi ) | |
| 104 | MCFG_ACIA6850_ADD(MC6850_TAG, acia_intf) | |
| 105 | ||
| 106 | MCFG_SERIAL_PORT_ADD("mdin", midiin_intf, midiin_slot, "midiin", NULL) | |
| 107 | MCFG_SERIAL_PORT_ADD("mdout", midiout_intf, midiout_slot, "midiout", NULL) | |
| 108 | MACHINE_CONFIG_END | |
| 109 | ||
| 110 | ||
| 111 | //------------------------------------------------- | |
| 112 | // machine_config_additions - device-specific | |
| 113 | // machine configurations | |
| 114 | //------------------------------------------------- | |
| 115 | ||
| 116 | machine_config_constructor c64_maplin_midi_cartridge_device::device_mconfig_additions() const | |
| 117 | { | |
| 118 | return MACHINE_CONFIG_NAME( c64_maplin_midi ); | |
| 119 | } | |
| 120 | ||
| 121 | ||
| 122 | ||
| 123 | //************************************************************************** | |
| 124 | // LIVE DEVICE | |
| 125 | //************************************************************************** | |
| 126 | ||
| 127 | //------------------------------------------------- | |
| 128 | // c64_maplin_midi_cartridge_device - constructor | |
| 129 | //------------------------------------------------- | |
| 130 | ||
| 131 | c64_maplin_midi_cartridge_device::c64_maplin_midi_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 132 | device_t(mconfig, C64_MIDI_MAPLIN, "C64 Maplin MIDI", tag, owner, clock), | |
| 133 | device_c64_expansion_card_interface(mconfig, *this), | |
| 134 | m_acia(*this, MC6850_TAG), | |
| 135 | m_mdout(*this, "mdout"), | |
| 136 | m_rx_state(0) | |
| 137 | { | |
| 138 | } | |
| 139 | ||
| 140 | ||
| 141 | //------------------------------------------------- | |
| 142 | // device_start - device-specific startup | |
| 143 | //------------------------------------------------- | |
| 144 | ||
| 145 | void c64_maplin_midi_cartridge_device::device_start() | |
| 146 | { | |
| 147 | // state saving | |
| 148 | save_item(NAME(m_rx_state)); | |
| 149 | } | |
| 150 | ||
| 151 | ||
| 152 | //------------------------------------------------- | |
| 153 | // device_reset - device-specific reset | |
| 154 | //------------------------------------------------- | |
| 155 | ||
| 156 | void c64_maplin_midi_cartridge_device::device_reset() | |
| 157 | { | |
| 158 | m_acia->reset(); | |
| 159 | ||
| 160 | m_rx_state = 0; | |
| 161 | } | |
| 162 | ||
| 163 | ||
| 164 | //------------------------------------------------- | |
| 165 | // c64_cd_r - cartridge data read | |
| 166 | //------------------------------------------------- | |
| 167 | ||
| 168 | 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) | |
| 169 | { | |
| 170 | if (!io2) | |
| 171 | { | |
| 172 | switch (offset & 0xff) | |
| 173 | { | |
| 174 | case 0: | |
| 175 | data = m_acia->status_read(space, 0); | |
| 176 | break; | |
| 177 | ||
| 178 | case 1: | |
| 179 | data = m_acia->data_read(space, 0); | |
| 180 | break; | |
| 181 | } | |
| 182 | } | |
| 183 | ||
| 184 | return data; | |
| 185 | } | |
| 186 | ||
| 187 | ||
| 188 | //------------------------------------------------- | |
| 189 | // c64_cd_w - cartridge data write | |
| 190 | //------------------------------------------------- | |
| 191 | ||
| 192 | 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) | |
| 193 | { | |
| 194 | if (!io2) | |
| 195 | { | |
| 196 | switch (offset & 0xff) | |
| 197 | { | |
| 198 | case 0: | |
| 199 | m_acia->control_write(space, 0, data); | |
| 200 | break; | |
| 201 | ||
| 202 | case 1: | |
| 203 | m_acia->data_write(space, 0, data); | |
| 204 | break; | |
| 205 | } | |
| 206 | } | |
| 207 | } |
| Added: svn:mime-type + text/plain Added: svn:eol-style + native |
| r0 | r20945 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Maplin MIDI Interface cartridge emulation | |
| 4 | ||
| 5 | Copyright MESS Team. | |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | ||
| 8 | **********************************************************************/ | |
| 9 | ||
| 10 | #pragma once | |
| 11 | ||
| 12 | #ifndef __C64_MIDI_MAPLIN__ | |
| 13 | #define __C64_MIDI_MAPLIN__ | |
| 14 | ||
| 15 | #include "emu.h" | |
| 16 | #include "machine/c64exp.h" | |
| 17 | #include "machine/6850acia.h" | |
| 18 | #include "machine/serial.h" | |
| 19 | #include "machine/midiinport.h" | |
| 20 | #include "machine/midioutport.h" | |
| 21 | ||
| 22 | ||
| 23 | ||
| 24 | //************************************************************************** | |
| 25 | // TYPE DEFINITIONS | |
| 26 | //************************************************************************** | |
| 27 | ||
| 28 | // ======================> c64_maplin_midi_cartridge_device | |
| 29 | ||
| 30 | class c64_maplin_midi_cartridge_device : public device_t, | |
| 31 | public device_c64_expansion_card_interface | |
| 32 | { | |
| 33 | public: | |
| 34 | // construction/destruction | |
| 35 | c64_maplin_midi_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 36 | ||
| 37 | // optional information overrides | |
| 38 | virtual machine_config_constructor device_mconfig_additions() const; | |
| 39 | ||
| 40 | DECLARE_WRITE_LINE_MEMBER( acia_irq_w ); | |
| 41 | DECLARE_WRITE_LINE_MEMBER( midi_rx_w ); | |
| 42 | DECLARE_READ_LINE_MEMBER( rx_in ); | |
| 43 | DECLARE_WRITE_LINE_MEMBER( tx_out ); | |
| 44 | ||
| 45 | protected: | |
| 46 | // device-level overrides | |
| 47 | virtual void device_config_complete() { m_shortname = "c64_midimap"; } | |
| 48 | virtual void device_start(); | |
| 49 | virtual void device_reset(); | |
| 50 | ||
| 51 | // device_c64_expansion_card_interface overrides | |
| 52 | 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); | |
| 53 | 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); | |
| 54 | ||
| 55 | private: | |
| 56 | required_device<acia6850_device> m_acia; | |
| 57 | required_device<serial_port_device> m_mdout; | |
| 58 | ||
| 59 | int m_rx_state; | |
| 60 | }; | |
| 61 | ||
| 62 | ||
| 63 | // device type definition | |
| 64 | extern const device_type C64_MIDI_MAPLIN; | |
| 65 | ||
| 66 | ||
| 67 | #endif |
| Added: svn:mime-type + text/plain Added: svn:eol-style + native |
| r0 | r20945 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Passport/Syntech MIDI Interface cartridge emulation | |
| 4 | ||
| 5 | Copyright MESS Team. | |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | ||
| 8 | **********************************************************************/ | |
| 9 | ||
| 10 | #include "c64_midi_passport.h" | |
| 11 | ||
| 12 | ||
| 13 | ||
| 14 | //************************************************************************** | |
| 15 | // MACROS/CONSTANTS | |
| 16 | //************************************************************************** | |
| 17 | ||
| 18 | #define MC6840_TAG "mc6840" | |
| 19 | #define MC6850_TAG "mc6850" | |
| 20 | ||
| 21 | ||
| 22 | ||
| 23 | //************************************************************************** | |
| 24 | // DEVICE DEFINITIONS | |
| 25 | //************************************************************************** | |
| 26 | ||
| 27 | const device_type C64_MIDI_PASSPORT = &device_creator<c64_passport_midi_cartridge_device>; | |
| 28 | ||
| 29 | ||
| 30 | //------------------------------------------------- | |
| 31 | // ptm6840_interface ptm_intf | |
| 32 | //------------------------------------------------- | |
| 33 | ||
| 34 | WRITE_LINE_MEMBER( c64_passport_midi_cartridge_device::ptm_irq_w ) | |
| 35 | { | |
| 36 | m_ptm_irq = state; | |
| 37 | ||
| 38 | m_slot->irq_w(m_ptm_irq || m_acia_irq); | |
| 39 | } | |
| 40 | ||
| 41 | static const ptm6840_interface ptm_intf = | |
| 42 | { | |
| 43 | 1021800.0f, | |
| 44 | { 1021800.0f, 1021800.0f, 1021800.0f }, | |
| 45 | { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }, | |
| 46 | DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_passport_midi_cartridge_device, ptm_irq_w) | |
| 47 | }; | |
| 48 | ||
| 49 | ||
| 50 | //------------------------------------------------- | |
| 51 | // ACIA6850_INTERFACE( acia_intf ) | |
| 52 | //------------------------------------------------- | |
| 53 | ||
| 54 | WRITE_LINE_MEMBER( c64_passport_midi_cartridge_device::acia_irq_w ) | |
| 55 | { | |
| 56 | m_acia_irq = state; | |
| 57 | ||
| 58 | m_slot->irq_w(m_ptm_irq || m_acia_irq); | |
| 59 | } | |
| 60 | ||
| 61 | READ_LINE_MEMBER( c64_passport_midi_cartridge_device::rx_in ) | |
| 62 | { | |
| 63 | return m_rx_state; | |
| 64 | } | |
| 65 | ||
| 66 | WRITE_LINE_MEMBER( c64_passport_midi_cartridge_device::tx_out ) | |
| 67 | { | |
| 68 | m_mdout->tx(state); | |
| 69 | } | |
| 70 | ||
| 71 | static ACIA6850_INTERFACE( acia_intf ) | |
| 72 | { | |
| 73 | 500000, | |
| 74 | 0, // rx clock (we manually clock rx) | |
| 75 | DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_passport_midi_cartridge_device, rx_in), | |
| 76 | DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_passport_midi_cartridge_device, tx_out), | |
| 77 | DEVCB_NULL, | |
| 78 | DEVCB_NULL, | |
| 79 | DEVCB_NULL, | |
| 80 | DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_passport_midi_cartridge_device, acia_irq_w) | |
| 81 | }; | |
| 82 | ||
| 83 | ||
| 84 | //------------------------------------------------- | |
| 85 | // SLOT_INTERFACE( midiin_slot ) | |
| 86 | //------------------------------------------------- | |
| 87 | ||
| 88 | static SLOT_INTERFACE_START( midiin_slot ) | |
| 89 | SLOT_INTERFACE("midiin", MIDIIN_PORT) | |
| 90 | SLOT_INTERFACE_END | |
| 91 | ||
| 92 | WRITE_LINE_MEMBER( c64_passport_midi_cartridge_device::midi_rx_w ) | |
| 93 | { | |
| 94 | m_rx_state = state; | |
| 95 | ||
| 96 | for (int i = 0; i < 16; i++) // divider is set to 16 | |
| 97 | { | |
| 98 | m_acia->rx_clock_in(); | |
| 99 | } | |
| 100 | } | |
| 101 | ||
| 102 | static const serial_port_interface midiin_intf = | |
| 103 | { | |
| 104 | DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_passport_midi_cartridge_device, midi_rx_w) | |
| 105 | }; | |
| 106 | ||
| 107 | ||
| 108 | //------------------------------------------------- | |
| 109 | // SLOT_INTERFACE( midiout_slot ) | |
| 110 | //------------------------------------------------- | |
| 111 | ||
| 112 | static SLOT_INTERFACE_START( midiout_slot ) | |
| 113 | SLOT_INTERFACE("midiout", MIDIOUT_PORT) | |
| 114 | SLOT_INTERFACE_END | |
| 115 | ||
| 116 | static const serial_port_interface midiout_intf = | |
| 117 | { | |
| 118 | DEVCB_NULL // midi out ports don't transmit inward | |
| 119 | }; | |
| 120 | ||
| 121 | ||
| 122 | //------------------------------------------------- | |
| 123 | // MACHINE_CONFIG_FRAGMENT( c64_passport_midi ) | |
| 124 | //------------------------------------------------- | |
| 125 | ||
| 126 | static MACHINE_CONFIG_FRAGMENT( c64_passport_midi ) | |
| 127 | MCFG_ACIA6850_ADD(MC6850_TAG, acia_intf) | |
| 128 | MCFG_PTM6840_ADD(MC6840_TAG, ptm_intf) | |
| 129 | ||
| 130 | MCFG_SERIAL_PORT_ADD("mdin", midiin_intf, midiin_slot, "midiin", NULL) | |
| 131 | MCFG_SERIAL_PORT_ADD("mdout", midiout_intf, midiout_slot, "midiout", NULL) | |
| 132 | MACHINE_CONFIG_END | |
| 133 | ||
| 134 | ||
| 135 | //------------------------------------------------- | |
| 136 | // machine_config_additions - device-specific | |
| 137 | // machine configurations | |
| 138 | //------------------------------------------------- | |
| 139 | ||
| 140 | machine_config_constructor c64_passport_midi_cartridge_device::device_mconfig_additions() const | |
| 141 | { | |
| 142 | return MACHINE_CONFIG_NAME( c64_passport_midi ); | |
| 143 | } | |
| 144 | ||
| 145 | ||
| 146 | ||
| 147 | //************************************************************************** | |
| 148 | // LIVE DEVICE | |
| 149 | //************************************************************************** | |
| 150 | ||
| 151 | //------------------------------------------------- | |
| 152 | // c64_passport_midi_cartridge_device - constructor | |
| 153 | //------------------------------------------------- | |
| 154 | ||
| 155 | c64_passport_midi_cartridge_device::c64_passport_midi_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 156 | device_t(mconfig, C64_MIDI_PASSPORT, "C64 Passport MIDI", tag, owner, clock), | |
| 157 | device_c64_expansion_card_interface(mconfig, *this), | |
| 158 | m_acia(*this, MC6850_TAG), | |
| 159 | m_ptm(*this, MC6840_TAG), | |
| 160 | m_mdout(*this, "mdout"), | |
| 161 | m_ptm_irq(CLEAR_LINE), | |
| 162 | m_acia_irq(CLEAR_LINE), | |
| 163 | m_rx_state(0) | |
| 164 | { | |
| 165 | } | |
| 166 | ||
| 167 | ||
| 168 | //------------------------------------------------- | |
| 169 | // device_start - device-specific startup | |
| 170 | //------------------------------------------------- | |
| 171 | ||
| 172 | void c64_passport_midi_cartridge_device::device_start() | |
| 173 | { | |
| 174 | // state saving | |
| 175 | save_item(NAME(m_ptm_irq)); | |
| 176 | save_item(NAME(m_acia_irq)); | |
| 177 | save_item(NAME(m_rx_state)); | |
| 178 | } | |
| 179 | ||
| 180 | ||
| 181 | //------------------------------------------------- | |
| 182 | // device_reset - device-specific reset | |
| 183 | //------------------------------------------------- | |
| 184 | ||
| 185 | void c64_passport_midi_cartridge_device::device_reset() | |
| 186 | { | |
| 187 | m_acia->reset(); | |
| 188 | m_ptm->reset(); | |
| 189 | ||
| 190 | m_rx_state = 0; | |
| 191 | } | |
| 192 | ||
| 193 | ||
| 194 | //------------------------------------------------- | |
| 195 | // c64_cd_r - cartridge data read | |
| 196 | //------------------------------------------------- | |
| 197 | ||
| 198 | 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) | |
| 199 | { | |
| 200 | if (!io1) | |
| 201 | { | |
| 202 | switch (offset & 0xff) | |
| 203 | { | |
| 204 | case 0: case 1: case 2: case 3: | |
| 205 | case 4: case 5: case 6: case 7: | |
| 206 | data = m_ptm->read(space, offset & 0x07); | |
| 207 | break; | |
| 208 | ||
| 209 | case 8: | |
| 210 | data = m_acia->status_read(space, 0); | |
| 211 | break; | |
| 212 | ||
| 213 | case 9: | |
| 214 | data = m_acia->data_read(space, 0); | |
| 215 | break; | |
| 216 | } | |
| 217 | } | |
| 218 | ||
| 219 | return data; | |
| 220 | } | |
| 221 | ||
| 222 | ||
| 223 | //------------------------------------------------- | |
| 224 | // c64_cd_w - cartridge data write | |
| 225 | //------------------------------------------------- | |
| 226 | ||
| 227 | 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) | |
| 228 | { | |
| 229 | if (!io1) | |
| 230 | { | |
| 231 | switch (offset & 0xff) | |
| 232 | { | |
| 233 | case 0: case 1: case 2: case 3: | |
| 234 | case 4: case 5: case 6: case 7: | |
| 235 | m_ptm->write(space, offset & 0x07, data); | |
| 236 | break; | |
| 237 | ||
| 238 | case 8: | |
| 239 | m_acia->control_write(space, 0, data); | |
| 240 | break; | |
| 241 | ||
| 242 | case 9: | |
| 243 | m_acia->data_write(space, 0, data); | |
| 244 | break; | |
| 245 | ||
| 246 | case 0x30: | |
| 247 | // Drum sync SET | |
| 248 | break; | |
| 249 | ||
| 250 | case 0x38: | |
| 251 | // Drum sync CLEAR | |
| 252 | break; | |
| 253 | } | |
| 254 | } | |
| 255 | } |
| Added: svn:mime-type + text/plain Added: svn:eol-style + native |
| r0 | r20945 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Passport/Syntech MIDI Interface cartridge emulation | |
| 4 | ||
| 5 | Copyright MESS Team. | |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | ||
| 8 | **********************************************************************/ | |
| 9 | ||
| 10 | #pragma once | |
| 11 | ||
| 12 | #ifndef __C64_MIDI_PASSPORT__ | |
| 13 | #define __C64_MIDI_PASSPORT__ | |
| 14 | ||
| 15 | #include "emu.h" | |
| 16 | #include "machine/c64exp.h" | |
| 17 | #include "machine/6840ptm.h" | |
| 18 | #include "machine/6850acia.h" | |
| 19 | #include "machine/serial.h" | |
| 20 | #include "machine/midiinport.h" | |
| 21 | #include "machine/midioutport.h" | |
| 22 | ||
| 23 | ||
| 24 | ||
| 25 | //************************************************************************** | |
| 26 | // TYPE DEFINITIONS | |
| 27 | //************************************************************************** | |
| 28 | ||
| 29 | // ======================> c64_passport_midi_cartridge_device | |
| 30 | ||
| 31 | class c64_passport_midi_cartridge_device : public device_t, | |
| 32 | public device_c64_expansion_card_interface | |
| 33 | { | |
| 34 | public: | |
| 35 | // construction/destruction | |
| 36 | c64_passport_midi_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 37 | ||
| 38 | // optional information overrides | |
| 39 | virtual machine_config_constructor device_mconfig_additions() const; | |
| 40 | ||
| 41 | DECLARE_WRITE_LINE_MEMBER( ptm_irq_w ); | |
| 42 | DECLARE_WRITE_LINE_MEMBER( acia_irq_w ); | |
| 43 | DECLARE_WRITE_LINE_MEMBER( midi_rx_w ); | |
| 44 | DECLARE_READ_LINE_MEMBER( rx_in ); | |
| 45 | DECLARE_WRITE_LINE_MEMBER( tx_out ); | |
| 46 | ||
| 47 | protected: | |
| 48 | // device-level overrides | |
| 49 | virtual void device_config_complete() { m_shortname = "c64_midipp"; } | |
| 50 | virtual void device_start(); | |
| 51 | virtual void device_reset(); | |
| 52 | ||
| 53 | // device_c64_expansion_card_interface overrides | |
| 54 | 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); | |
| 55 | 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); | |
| 56 | ||
| 57 | private: | |
| 58 | required_device<acia6850_device> m_acia; | |
| 59 | required_device<ptm6840_device> m_ptm; | |
| 60 | required_device<serial_port_device> m_mdout; | |
| 61 | ||
| 62 | int m_ptm_irq; | |
| 63 | int m_acia_irq; | |
| 64 | int m_rx_state; | |
| 65 | }; | |
| 66 | ||
| 67 | ||
| 68 | // device type definition | |
| 69 | extern const device_type C64_MIDI_PASSPORT; | |
| 70 | ||
| 71 | ||
| 72 | #endif |
| Added: svn:mime-type + text/plain Added: svn:eol-style + native |
| r20944 | r20945 | |
|---|---|---|
| 871 | 871 | $(MESS_MACHINE)/c64_magic_desk.o \ |
| 872 | 872 | $(MESS_MACHINE)/c64_magic_formel.o \ |
| 873 | 873 | $(MESS_MACHINE)/c64_magic_voice.o \ |
| 874 | $(MESS_MACHINE)/c64_midi_maplin.o \ | |
| 875 | $(MESS_MACHINE)/c64_midi_namesoft.o \ | |
| 876 | $(MESS_MACHINE)/c64_midi_passport.o \ | |
| 877 | $(MESS_MACHINE)/c64_midi_sci.o \ | |
| 878 | $(MESS_MACHINE)/c64_midi_siel.o \ | |
| 874 | 879 | $(MESS_MACHINE)/c64_mikro_assembler.o \ |
| 875 | 880 | $(MESS_MACHINE)/c64_multiscreen.o \ |
| 876 | 881 | $(MESS_MACHINE)/c64_neoram.o \ |
| Previous | 199869 Revisions | Next |