trunk/src/emu/bus/msx_cart/msx_audio_kb.c
| r0 | r30621 | |
| 1 | #include "emu.h" |
| 2 | #include "msx_audio_kb.h" |
| 3 | |
| 4 | |
| 5 | const device_type MSX_AUDIO_KBDC_PORT = &device_creator<msx_audio_kbdc_port_device>; |
| 6 | |
| 7 | |
| 8 | msx_audio_kbdc_port_device::msx_audio_kbdc_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 9 | : device_t(mconfig, MSX_AUDIO_KBDC_PORT, "MSX Audio keyboard connector port", tag, owner, clock, "msx_audio_kbdc_port", __FILE__) |
| 10 | , device_slot_interface(mconfig, *this) |
| 11 | { |
| 12 | } |
| 13 | |
| 14 | |
| 15 | void msx_audio_kbdc_port_device::device_start() |
| 16 | { |
| 17 | m_keyboard = dynamic_cast<msx_audio_kb_port_interface *>(get_card_device()); |
| 18 | } |
| 19 | |
| 20 | |
| 21 | WRITE8_MEMBER(msx_audio_kbdc_port_device::write) |
| 22 | { |
| 23 | if (m_keyboard) |
| 24 | { |
| 25 | m_keyboard->write(space, offset, data); |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | |
| 30 | READ8_MEMBER(msx_audio_kbdc_port_device::read) |
| 31 | { |
| 32 | if (m_keyboard) |
| 33 | { |
| 34 | return m_keyboard->read(space, offset); |
| 35 | } |
| 36 | return 0xff; |
| 37 | } |
| 38 | |
| 39 | |
| 40 | extern const device_type MSX_AUDIO_KB_HXMU901; |
| 41 | extern const device_type MSX_AUDIO_KB_NMS1160; |
| 42 | |
| 43 | |
| 44 | class msx_hxmu901 : public device_t |
| 45 | , public msx_audio_kb_port_interface |
| 46 | { |
| 47 | public: |
| 48 | msx_hxmu901(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 49 | : device_t(mconfig, MSX_AUDIO_KB_HXMU901, "Toshiba HXMU901", tag, owner, clock, "hxmu901", __FILE__) |
| 50 | , msx_audio_kb_port_interface(mconfig, *this) |
| 51 | , m_row(0) |
| 52 | , m_keyboard(*this, "KEY") |
| 53 | { }; |
| 54 | |
| 55 | virtual ioport_constructor device_input_ports() const; |
| 56 | |
| 57 | virtual DECLARE_READ8_MEMBER(read) |
| 58 | { |
| 59 | UINT8 result = 0xff; |
| 60 | |
| 61 | for (int i = 0; i < 8; i++) |
| 62 | { |
| 63 | if (BIT(m_row,i)) |
| 64 | { |
| 65 | result &= m_keyboard[i]->read(); |
| 66 | } |
| 67 | } |
| 68 | return result; |
| 69 | } |
| 70 | |
| 71 | virtual DECLARE_WRITE8_MEMBER(write) |
| 72 | { |
| 73 | m_row = data; |
| 74 | } |
| 75 | |
| 76 | protected: |
| 77 | virtual void device_start() { } |
| 78 | |
| 79 | private: |
| 80 | UINT8 m_row; |
| 81 | required_ioport_array<8> m_keyboard; |
| 82 | }; |
| 83 | |
| 84 | |
| 85 | static INPUT_PORTS_START( hxmu901) |
| 86 | PORT_START("KEY.0") |
| 87 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C#1") |
| 88 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D1") |
| 89 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D#1") |
| 90 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNKNOWN) // Multi sensor related? |
| 91 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E1") |
| 92 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F1") |
| 93 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F#1") |
| 94 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C1") |
| 95 | |
| 96 | PORT_START("KEY.1") |
| 97 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G1") |
| 98 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G#1") |
| 99 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A1") |
| 100 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNKNOWN) // Multi sensor related? |
| 101 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A#1") |
| 102 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B1") |
| 103 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C2") |
| 104 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED) |
| 105 | |
| 106 | PORT_START("KEY.2") |
| 107 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C#2") |
| 108 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D2") |
| 109 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D#2") |
| 110 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNKNOWN) // Multi sensor related? |
| 111 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E2") |
| 112 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F2") |
| 113 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F#2") |
| 114 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED) |
| 115 | |
| 116 | PORT_START("KEY.3") |
| 117 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G2") |
| 118 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G#2") |
| 119 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A2") |
| 120 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNKNOWN) // Multi sensor related? |
| 121 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A#2") |
| 122 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B2") |
| 123 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C3") |
| 124 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED) |
| 125 | |
| 126 | PORT_START("KEY.4") |
| 127 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C#3") |
| 128 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D3") |
| 129 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D#3") |
| 130 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNKNOWN) // Multi sensor related? |
| 131 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E3") |
| 132 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F3") |
| 133 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F#3") |
| 134 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED) |
| 135 | |
| 136 | PORT_START("KEY.5") |
| 137 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G3") |
| 138 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G#3") |
| 139 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A3") |
| 140 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNKNOWN) // Multi sensor related? |
| 141 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A#3") |
| 142 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B3") |
| 143 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C4") |
| 144 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED) |
| 145 | |
| 146 | PORT_START("KEY.6") |
| 147 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C#4") |
| 148 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D4") |
| 149 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D#4") |
| 150 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNKNOWN) // Multi sensor related? |
| 151 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E4") |
| 152 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F4") |
| 153 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F#4") |
| 154 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED) |
| 155 | |
| 156 | PORT_START("KEY.7") |
| 157 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G4") |
| 158 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G#4") |
| 159 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A4") |
| 160 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNKNOWN) // Multi sensor related? |
| 161 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A#4") |
| 162 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B4") |
| 163 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C5") |
| 164 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED) |
| 165 | INPUT_PORTS_END |
| 166 | |
| 167 | |
| 168 | ioport_constructor msx_hxmu901::device_input_ports() const |
| 169 | { |
| 170 | return INPUT_PORTS_NAME( hxmu901 ); |
| 171 | } |
| 172 | |
| 173 | |
| 174 | class msx_nms1160 : public device_t |
| 175 | , public msx_audio_kb_port_interface |
| 176 | { |
| 177 | public: |
| 178 | msx_nms1160(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 179 | : device_t(mconfig, MSX_AUDIO_KB_NMS1160, "Philips NMS-1160", tag, owner, clock, "nms1160", __FILE__) |
| 180 | , msx_audio_kb_port_interface(mconfig, *this) |
| 181 | , m_row(0) |
| 182 | { }; |
| 183 | |
| 184 | // virtual ioport_constructor device_input_ports() const; |
| 185 | |
| 186 | virtual DECLARE_READ8_MEMBER(read) |
| 187 | { |
| 188 | return 0xff; |
| 189 | } |
| 190 | |
| 191 | virtual DECLARE_WRITE8_MEMBER(write) |
| 192 | { |
| 193 | printf("msx_nms1160::write %02x\n", data); |
| 194 | m_row = data; |
| 195 | } |
| 196 | |
| 197 | protected: |
| 198 | virtual void device_start() { } |
| 199 | |
| 200 | private: |
| 201 | UINT8 m_row; |
| 202 | }; |
| 203 | |
| 204 | |
| 205 | const device_type MSX_AUDIO_KB_HXMU901 = &device_creator<msx_hxmu901>; |
| 206 | const device_type MSX_AUDIO_KB_NMS1160 = &device_creator<msx_nms1160>; |
| 207 | |
| 208 | |
| 209 | SLOT_INTERFACE_START( msx_audio_keyboards ) |
| 210 | SLOT_INTERFACE("hxmu901", MSX_AUDIO_KB_HXMU901) |
| 211 | SLOT_INTERFACE("nms1160", MSX_AUDIO_KB_NMS1160) |
| 212 | SLOT_INTERFACE_END |
| 213 | |
| 214 | |
trunk/src/emu/bus/msx_cart/msx_audio.c
| r30620 | r30621 | |
| 5 | 5 | - Panasonic FS-CA1 |
| 6 | 6 | - Y8950 |
| 7 | 7 | - 4KB ram |
| 8 | - Connector for Toshiba HX-MU901 keyboard |
| 8 | 9 | |
| 9 | 10 | - Toshiba HX-MU900 |
| 10 | 11 | - Y8950 |
| 11 | 12 | - No midi ports |
| 12 | 13 | - No ram |
| 14 | - Connector for Toshiba HX-MU901 keyboard |
| 13 | 15 | |
| 14 | 16 | - Philips NMS-1205 |
| 15 | 17 | - Y8950 |
| 16 | 18 | - Midi ports |
| 17 | 19 | - 32KB sample ram |
| 20 | - Connector for Philips NMS-1160 keyboard |
| 18 | 21 | |
| 22 | |
| 23 | The keyboards: |
| 24 | - Toshiba HX-MU901 |
| 25 | - 49 keys: 4 full octaves + high C |
| 26 | - ENTER key |
| 27 | - SELECT key |
| 28 | - multi sensor (?) |
| 29 | |
| 30 | - Philips NMS-1160 |
| 31 | |
| 19 | 32 | **********************************************************************************/ |
| 20 | 33 | |
| 21 | 34 | #include "emu.h" |
| 22 | 35 | #include "msx_audio.h" |
| 36 | #include "bus/msx_cart/msx_audio_kb.h" |
| 23 | 37 | |
| 38 | |
| 24 | 39 | const device_type MSX_CART_MSX_AUDIO_HXMU900 = &device_creator<msx_cart_msx_audio_hxmu900>; |
| 25 | 40 | const device_type MSX_CART_MSX_AUDIO_NMS1205 = &device_creator<msx_cart_msx_audio_nms1205>; |
| 26 | 41 | const device_type MSX_CART_MSX_AUDIO_FSCA1 = &device_creator<msx_cart_msx_audio_fsca1>; |
| r30620 | r30621 | |
| 39 | 54 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 40 | 55 | MCFG_SOUND_ADD("y8950", Y8950, XTAL_3_579545MHz) // Not verified |
| 41 | 56 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) |
| 57 | MCFG_Y8950_KEYBOARD_WRITE_HANDLER(DEVWRITE8("kbdc", msx_audio_kbdc_port_device, write)) |
| 58 | MCFG_Y8950_KEYBOARD_READ_HANDLER(DEVREAD8("kbdc", msx_audio_kbdc_port_device, read)) |
| 59 | |
| 60 | MCFG_MSX_AUDIO_KBDC_PORT_ADD("kbdc", msx_audio_keyboards, NULL) |
| 42 | 61 | MACHINE_CONFIG_END |
| 43 | 62 | |
| 44 | 63 | |
| r30620 | r30621 | |
| 77 | 96 | |
| 78 | 97 | |
| 79 | 98 | |
| 99 | |
| 100 | |
| 80 | 101 | msx_cart_msx_audio_nms1205::msx_cart_msx_audio_nms1205(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 81 | 102 | : device_t(mconfig, MSX_CART_MSX_AUDIO_NMS1205, "MSX Cartridge - MSX-AUDIO NMS-1205", tag, owner, clock, "msx_audio_nms1205", __FILE__) |
| 82 | 103 | , msx_cart_interface(mconfig, *this) |
| r30620 | r30621 | |
| 93 | 114 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 94 | 115 | MCFG_SOUND_ADD("y8950", Y8950, XTAL_3_579545MHz) |
| 95 | 116 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) |
| 117 | MCFG_Y8950_KEYBOARD_WRITE_HANDLER(DEVWRITE8("kbdc", msx_audio_kbdc_port_device, write)) |
| 118 | MCFG_Y8950_KEYBOARD_READ_HANDLER(DEVREAD8("kbdc", msx_audio_kbdc_port_device, read)) |
| 96 | 119 | |
| 120 | MCFG_MSX_AUDIO_KBDC_PORT_ADD("kbdc", msx_audio_keyboards, NULL) |
| 121 | |
| 97 | 122 | MCFG_DEVICE_ADD("acia6850", ACIA6850, 0) |
| 98 | 123 | MACHINE_CONFIG_END |
| 99 | 124 | |
| r30620 | r30621 | |
| 136 | 161 | |
| 137 | 162 | |
| 138 | 163 | |
| 164 | |
| 139 | 165 | msx_cart_msx_audio_fsca1::msx_cart_msx_audio_fsca1(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 140 | 166 | : device_t(mconfig, MSX_CART_MSX_AUDIO_FSCA1, "MSX Cartridge - MSX-AUDIO FS-CA1", tag, owner, clock, "msx_audio_fsca1", __FILE__) |
| 141 | 167 | , msx_cart_interface(mconfig, *this) |
| r30620 | r30621 | |
| 151 | 177 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 152 | 178 | MCFG_SOUND_ADD("y8950", Y8950, XTAL_3_579545MHz) |
| 153 | 179 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) |
| 180 | MCFG_Y8950_KEYBOARD_WRITE_HANDLER(DEVWRITE8("kbdc", msx_audio_kbdc_port_device, write)) |
| 181 | MCFG_Y8950_KEYBOARD_READ_HANDLER(DEVREAD8("kbdc", msx_audio_kbdc_port_device, read)) |
| 182 | |
| 183 | MCFG_MSX_AUDIO_KBDC_PORT_ADD("kbdc", msx_audio_keyboards, NULL) |
| 154 | 184 | MACHINE_CONFIG_END |
| 155 | 185 | |
| 156 | 186 | |
| r30620 | r30621 | |
| 234 | 264 | } |
| 235 | 265 | } |
| 236 | 266 | |
| 267 | |
| 237 | 268 | READ8_MEMBER(msx_cart_msx_audio_fsca1::read_y8950) |
| 238 | 269 | { |
| 239 | 270 | if (offset & 2) |