trunk/src/emu/bus/a2bus/a2alfam2.c
| r26030 | r26031 | |
| 3 | 3 | a2alfsm2.c |
| 4 | 4 | |
| 5 | 5 | Implementation of the ALF Apple Music II card (originally marketed as the "MC1") |
| 6 | The AE Super Music Synthesizer is a superset of this card (4x76489 instead of 3) |
| 6 | 7 | |
| 7 | 8 | *********************************************************************/ |
| 8 | 9 | |
| r26030 | r26031 | |
| 19 | 20 | //************************************************************************** |
| 20 | 21 | |
| 21 | 22 | const device_type A2BUS_ALFAM2 = &device_creator<a2bus_alfam2_device>; |
| 23 | const device_type A2BUS_AESMS = &device_creator<a2bus_aesms_device>; |
| 22 | 24 | |
| 23 | 25 | #define SN1_TAG "sn76489_1" // left |
| 24 | 26 | #define SN2_TAG "sn76489_2" // center |
| 25 | 27 | #define SN3_TAG "sn76489_3" // right |
| 28 | #define SN4_TAG "sn76489_4" // center? |
| 26 | 29 | |
| 27 | 30 | //------------------------------------------------- |
| 28 | 31 | // sn76496_config psg_intf |
| r26030 | r26031 | |
| 47 | 50 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "alf_r", 0.50) |
| 48 | 51 | MACHINE_CONFIG_END |
| 49 | 52 | |
| 53 | MACHINE_CONFIG_FRAGMENT( a2aesms ) |
| 54 | MCFG_SPEAKER_STANDARD_STEREO("alf_l", "alf_r") |
| 55 | MCFG_SOUND_ADD(SN1_TAG, SN76489, 1020484) |
| 56 | MCFG_SOUND_CONFIG(psg_intf) |
| 57 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "alf_l", 0.50) |
| 58 | MCFG_SOUND_ADD(SN2_TAG, SN76489, 1020484) |
| 59 | MCFG_SOUND_CONFIG(psg_intf) |
| 60 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "alf_l", 0.50) |
| 61 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "alf_r", 0.50) |
| 62 | MCFG_SOUND_ADD(SN3_TAG, SN76489, 1020484) |
| 63 | MCFG_SOUND_CONFIG(psg_intf) |
| 64 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "alf_r", 0.50) |
| 65 | MCFG_SOUND_ADD(SN4_TAG, SN76489, 1020484) |
| 66 | MCFG_SOUND_CONFIG(psg_intf) |
| 67 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "alf_l", 0.50) |
| 68 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "alf_r", 0.50) |
| 69 | MACHINE_CONFIG_END |
| 70 | |
| 50 | 71 | /*************************************************************************** |
| 51 | 72 | FUNCTION PROTOTYPES |
| 52 | 73 | ***************************************************************************/ |
| r26030 | r26031 | |
| 56 | 77 | // machine configurations |
| 57 | 78 | //------------------------------------------------- |
| 58 | 79 | |
| 59 | | machine_config_constructor a2bus_alfam2_device::device_mconfig_additions() const |
| 80 | machine_config_constructor a2bus_sn76489_device::device_mconfig_additions() const |
| 60 | 81 | { |
| 61 | 82 | return MACHINE_CONFIG_NAME( a2alfam2 ); |
| 62 | 83 | } |
| 63 | 84 | |
| 85 | machine_config_constructor a2bus_aesms_device::device_mconfig_additions() const |
| 86 | { |
| 87 | return MACHINE_CONFIG_NAME( a2aesms ); |
| 88 | } |
| 89 | |
| 64 | 90 | //************************************************************************** |
| 65 | 91 | // LIVE DEVICE |
| 66 | 92 | //************************************************************************** |
| 67 | 93 | |
| 68 | | a2bus_alfam2_device::a2bus_alfam2_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : |
| 94 | a2bus_sn76489_device::a2bus_sn76489_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : |
| 69 | 95 | device_t(mconfig, type, name, tag, owner, clock, shortname, source), |
| 70 | 96 | device_a2bus_card_interface(mconfig, *this), |
| 71 | 97 | m_sn1(*this, SN1_TAG), |
| 72 | 98 | m_sn2(*this, SN2_TAG), |
| 73 | | m_sn3(*this, SN3_TAG) |
| 99 | m_sn3(*this, SN3_TAG), |
| 100 | m_sn4(*this, SN4_TAG) |
| 74 | 101 | { |
| 75 | 102 | } |
| 76 | 103 | |
| 77 | 104 | a2bus_alfam2_device::a2bus_alfam2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 78 | | device_t(mconfig, A2BUS_ALFAM2, "ALF MC1 / Apple Music II", tag, owner, clock, "a2alfam2", __FILE__), |
| 79 | | device_a2bus_card_interface(mconfig, *this), |
| 80 | | m_sn1(*this, SN1_TAG), |
| 81 | | m_sn2(*this, SN2_TAG), |
| 82 | | m_sn3(*this, SN3_TAG) |
| 105 | a2bus_sn76489_device(mconfig, A2BUS_ALFAM2, "ALF MC1 / Apple Music II", tag, owner, clock, "a2alfam2", __FILE__) |
| 83 | 106 | { |
| 107 | m_has4thsn = false; |
| 84 | 108 | } |
| 85 | 109 | |
| 110 | a2bus_aesms_device::a2bus_aesms_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 111 | a2bus_sn76489_device(mconfig, A2BUS_ALFAM2, "Applied Engineering Super Music Synthesizer", tag, owner, clock, "a2aesms", __FILE__) |
| 112 | { |
| 113 | m_has4thsn = true; |
| 114 | } |
| 115 | |
| 86 | 116 | //------------------------------------------------- |
| 87 | 117 | // device_start - device-specific startup |
| 88 | 118 | //------------------------------------------------- |
| 89 | 119 | |
| 90 | | void a2bus_alfam2_device::device_start() |
| 120 | void a2bus_sn76489_device::device_start() |
| 91 | 121 | { |
| 92 | 122 | // set_a2bus_device makes m_slot valid |
| 93 | 123 | set_a2bus_device(); |
| 94 | | m_latch0 = m_latch1 = m_latch2 = 0; |
| 124 | m_latch0 = m_latch1 = m_latch2 = m_latch3 = 0; |
| 95 | 125 | |
| 96 | 126 | save_item(NAME(m_latch0)); |
| 97 | 127 | save_item(NAME(m_latch1)); |
| 98 | 128 | save_item(NAME(m_latch2)); |
| 129 | save_item(NAME(m_latch3)); |
| 99 | 130 | } |
| 100 | 131 | |
| 101 | | void a2bus_alfam2_device::device_reset() |
| 132 | void a2bus_sn76489_device::device_reset() |
| 102 | 133 | { |
| 103 | | m_latch0 = m_latch1 = m_latch2 = 0; |
| 134 | m_latch0 = m_latch1 = m_latch2 = m_latch3 = 0; |
| 104 | 135 | } |
| 105 | 136 | |
| 106 | | UINT8 a2bus_alfam2_device::read_c0nx(address_space &space, UINT8 offset) |
| 137 | UINT8 a2bus_sn76489_device::read_c0nx(address_space &space, UINT8 offset) |
| 107 | 138 | { |
| 108 | 139 | // SN76489 can't be read, it appears from the schematics this is what happens |
| 109 | 140 | switch (offset) |
| r26030 | r26031 | |
| 116 | 147 | |
| 117 | 148 | case 2: |
| 118 | 149 | return m_latch2; |
| 150 | |
| 151 | case 3: |
| 152 | return m_latch3; |
| 119 | 153 | } |
| 120 | 154 | |
| 121 | 155 | return 0xff; |
| 122 | 156 | } |
| 123 | 157 | |
| 124 | | void a2bus_alfam2_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) |
| 158 | void a2bus_sn76489_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) |
| 125 | 159 | { |
| 126 | 160 | switch (offset) |
| 127 | 161 | { |
| r26030 | r26031 | |
| 139 | 173 | m_sn3->write(space, 0, data); |
| 140 | 174 | m_latch2 = data; |
| 141 | 175 | break; |
| 176 | |
| 177 | case 3: |
| 178 | if (m_has4thsn) |
| 179 | { |
| 180 | m_sn4->write(space, 0, data); |
| 181 | m_latch3 = data; |
| 182 | } |
| 183 | break; |
| 142 | 184 | } |
| 143 | 185 | } |
| 144 | 186 | |
| 145 | | bool a2bus_alfam2_device::take_c800() |
| 187 | bool a2bus_sn76489_device::take_c800() |
| 146 | 188 | { |
| 147 | 189 | return false; |
| 148 | 190 | } |
trunk/src/emu/bus/a2bus/a2alfam2.h
| r26030 | r26031 | |
| 2 | 2 | |
| 3 | 3 | a2alfam2.h |
| 4 | 4 | |
| 5 | | Implementation of the ALF Apple Music II card |
| 5 | Implementation of the ALF Apple Music II card and compatibles |
| 6 | 6 | |
| 7 | 7 | *********************************************************************/ |
| 8 | 8 | |
| r26030 | r26031 | |
| 17 | 17 | // TYPE DEFINITIONS |
| 18 | 18 | //************************************************************************** |
| 19 | 19 | |
| 20 | | class a2bus_alfam2_device: |
| 20 | class a2bus_sn76489_device: |
| 21 | 21 | public device_t, |
| 22 | 22 | public device_a2bus_card_interface |
| 23 | 23 | { |
| 24 | 24 | public: |
| 25 | 25 | // construction/destruction |
| 26 | | a2bus_alfam2_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); |
| 27 | | a2bus_alfam2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 26 | a2bus_sn76489_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); |
| 28 | 27 | |
| 29 | 28 | // optional information overrides |
| 30 | 29 | virtual machine_config_constructor device_mconfig_additions() const; |
| r26030 | r26031 | |
| 32 | 31 | required_device<sn76489_device> m_sn1; |
| 33 | 32 | required_device<sn76489_device> m_sn2; |
| 34 | 33 | required_device<sn76489_device> m_sn3; |
| 34 | optional_device<sn76489_device> m_sn4; |
| 35 | 35 | |
| 36 | 36 | protected: |
| 37 | 37 | virtual void device_start(); |
| r26030 | r26031 | |
| 43 | 43 | virtual bool take_c800(); |
| 44 | 44 | |
| 45 | 45 | private: |
| 46 | | UINT8 m_latch0, m_latch1, m_latch2; |
| 46 | UINT8 m_latch0, m_latch1, m_latch2, m_latch3; |
| 47 | |
| 48 | protected: |
| 49 | bool m_has4thsn; |
| 47 | 50 | }; |
| 48 | 51 | |
| 52 | class a2bus_alfam2_device : public a2bus_sn76489_device |
| 53 | { |
| 54 | public: |
| 55 | a2bus_alfam2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 56 | }; |
| 57 | |
| 58 | class a2bus_aesms_device : public a2bus_sn76489_device |
| 59 | { |
| 60 | public: |
| 61 | a2bus_aesms_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 62 | |
| 63 | virtual machine_config_constructor device_mconfig_additions() const; |
| 64 | }; |
| 65 | |
| 49 | 66 | // device type definition |
| 50 | 67 | extern const device_type A2BUS_ALFAM2; |
| 68 | extern const device_type A2BUS_AESMS; |
| 51 | 69 | |
| 52 | 70 | #endif /* __A2BUS_ALFAM2__ */ |