trunk/src/emu/bus/msx_cart/msx_audio.c
| r30660 | r30661 | |
| 28 | 28 | - multi sensor (?) |
| 29 | 29 | |
| 30 | 30 | - Philips NMS-1160 |
| 31 | - 61 keys: 5 full octaves + high C |
| 32 | - Different wiring, so incompatible with the other keyboards |
| 31 | 33 | |
| 34 | - Panasonic YK-20 |
| 35 | - 49 keys: 4 full octaves + high C |
| 32 | 36 | |
| 33 | 37 | |
| 34 | 38 | TODO: |
| 35 | 39 | - Test MIDI in/out/through |
| 36 | | - Sample RAM |
| 37 | | - Implement NMS-1160 keyboard |
| 40 | - Sample RAM, doesn't seem to get written to |
| 41 | - Test NMS-1160 keyboard |
| 38 | 42 | - HX-MU901: ENTER/SELECT keys and multi sensors |
| 39 | 43 | - NMS1160: Test the keyboard |
| 44 | - NMS1205: Add DAC |
| 45 | - NMS1205/FSCA1: Add muting of dac and y8950 based on io config writes. |
| 40 | 46 | |
| 47 | |
| 48 | For testing the sample ram: |
| 49 | - Disable firmware on the fs-ca1 |
| 50 | - call audio |
| 51 | - call copy pcm(#a, b) |
| 52 | - call play pcm (x) |
| 53 | |
| 54 | See also http://www.mccm.hetlab.tk/millennium/milc/gc/topic_26.htm (dutch) |
| 55 | |
| 56 | |
| 41 | 57 | **********************************************************************************/ |
| 42 | 58 | |
| 43 | 59 | #include "emu.h" |
| r30660 | r30661 | |
| 207 | 223 | : device_t(mconfig, MSX_CART_MSX_AUDIO_FSCA1, "MSX Cartridge - MSX-AUDIO FS-CA1", tag, owner, clock, "msx_audio_fsca1", __FILE__) |
| 208 | 224 | , msx_cart_interface(mconfig, *this) |
| 209 | 225 | , m_y8950(*this, "y8950") |
| 226 | , m_io_config(*this, "CONFIG") |
| 227 | , m_region_y8950(*this, "y8950") |
| 210 | 228 | , m_7ffe(0) |
| 211 | 229 | , m_7fff(0) |
| 212 | 230 | { |
| r30660 | r30661 | |
| 220 | 238 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) |
| 221 | 239 | MCFG_Y8950_KEYBOARD_WRITE_HANDLER(DEVWRITE8("kbdc", msx_audio_kbdc_port_device, write)) |
| 222 | 240 | MCFG_Y8950_KEYBOARD_READ_HANDLER(DEVREAD8("kbdc", msx_audio_kbdc_port_device, read)) |
| 241 | MCFG_Y8950_IO_READ_HANDLER(READ8(msx_cart_msx_audio_fsca1, y8950_io_r)) |
| 242 | MCFG_Y8950_IO_WRITE_HANDLER(WRITE8(msx_cart_msx_audio_fsca1, y8950_io_w)) |
| 223 | 243 | |
| 224 | 244 | MCFG_MSX_AUDIO_KBDC_PORT_ADD("kbdc", msx_audio_keyboards, NULL) |
| 225 | 245 | MACHINE_CONFIG_END |
| r30660 | r30661 | |
| 231 | 251 | } |
| 232 | 252 | |
| 233 | 253 | |
| 254 | static INPUT_PORTS_START( msx_audio_fsca1 ) |
| 255 | PORT_START("CONFIG") |
| 256 | PORT_CONFNAME( 0x04, 0x04, "FS-CA1 Firmware switch") |
| 257 | PORT_CONFSETTING( 0x04, "On" ) |
| 258 | PORT_CONFSETTING( 0x00, "Off" ) |
| 259 | PORT_BIT(0xFB, IP_ACTIVE_HIGH, IPT_UNKNOWN) |
| 260 | INPUT_PORTS_END |
| 261 | |
| 262 | |
| 263 | ioport_constructor msx_cart_msx_audio_fsca1::device_input_ports() const |
| 264 | { |
| 265 | return INPUT_PORTS_NAME( msx_audio_fsca1 ); |
| 266 | } |
| 267 | |
| 268 | |
| 269 | ROM_START( msx_fsca1 ) |
| 270 | ROM_REGION(0x8000, "y8950", ROMREGION_ERASE00) |
| 271 | ROM_END |
| 272 | |
| 273 | |
| 274 | const rom_entry *msx_cart_msx_audio_fsca1::device_rom_region() const |
| 275 | { |
| 276 | return ROM_NAME( msx_fsca1 ); |
| 277 | } |
| 278 | |
| 279 | |
| 234 | 280 | void msx_cart_msx_audio_fsca1::device_start() |
| 235 | 281 | { |
| 236 | 282 | // Install IO read/write handlers |
| r30660 | r30661 | |
| 242 | 288 | |
| 243 | 289 | void msx_cart_msx_audio_fsca1::initialize_cartridge() |
| 244 | 290 | { |
| 245 | | if (get_rom_size() != 0x20000) |
| 291 | if (get_rom_size() < 0x20000) |
| 246 | 292 | { |
| 247 | 293 | fatalerror("msx_audio_fsca1: Invalid ROM size\n"); |
| 248 | 294 | } |
| r30660 | r30661 | |
| 251 | 297 | |
| 252 | 298 | READ8_MEMBER(msx_cart_msx_audio_fsca1::read_cart) |
| 253 | 299 | { |
| 254 | | if (offset < 0x8000) |
| 300 | if (m_7ffe == 0 && (offset & 0xB000) == 0x3000) |
| 255 | 301 | { |
| 256 | | if ((offset & 0x3000) == 0x3000) |
| 257 | | { |
| 258 | | return m_ram[offset & 0xfff]; |
| 259 | | } |
| 260 | | return m_rom[offset]; |
| 302 | return m_sram[offset & 0xfff]; |
| 261 | 303 | } |
| 262 | | return 0xff; |
| 304 | return m_rom[((m_7ffe & 0x03) << 15) | (offset & 0x7fff)]; |
| 263 | 305 | } |
| 264 | 306 | |
| 265 | 307 | |
| r30660 | r30661 | |
| 277 | 319 | return; |
| 278 | 320 | } |
| 279 | 321 | |
| 280 | | if ((offset & 0xb000) == 0x3000) |
| 322 | if (m_7ffe == 0 && (offset & 0xb000) == 0x3000) |
| 281 | 323 | { |
| 282 | | m_ram[offset & 0xfff] = data; |
| 324 | m_sram[offset & 0xfff] = data; |
| 283 | 325 | return; |
| 284 | 326 | } |
| 285 | 327 | |
| 286 | | printf("msx_cart_msx_audio_fsca1: Unhandled write %02x to %04x\n", data, offset); |
| 328 | logerror("msx_cart_msx_audio_fsca1: Unhandled write %02x to %04x\n", data, offset); |
| 287 | 329 | } |
| 288 | 330 | |
| 289 | 331 | |
| r30660 | r30661 | |
| 318 | 360 | } |
| 319 | 361 | } |
| 320 | 362 | |
| 363 | |
| 364 | WRITE8_MEMBER(msx_cart_msx_audio_fsca1::y8950_io_w) |
| 365 | { |
| 366 | logerror("msx_fsca1::y8950_io_w: %02x\n", data); |
| 367 | } |
| 368 | |
| 369 | |
| 370 | READ8_MEMBER(msx_cart_msx_audio_fsca1::y8950_io_r) |
| 371 | { |
| 372 | return m_io_config->read(); |
| 373 | } |
| 374 | |