trunk/src/mame/audio/taito_en.c
| r26378 | r26379 | |
| 9 | 9 | ****************************************************************************/ |
| 10 | 10 | |
| 11 | 11 | #include "emu.h" |
| 12 | | #include "machine/68681.h" |
| 13 | 12 | #include "machine/mb87078.h" |
| 14 | | #include "sound/es5506.h" |
| 15 | 13 | #include "taito_en.h" |
| 16 | 14 | |
| 17 | 15 | |
| r26378 | r26379 | |
| 52 | 50 | save_item(NAME(m_es5510_dadr_latch)); |
| 53 | 51 | save_item(NAME(m_es5510_gpr_latch)); |
| 54 | 52 | save_item(NAME(m_es5510_ram_sel)); |
| 53 | |
| 54 | m_duart68681 = machine().device<duartn68681_device>("duart68681"); |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | //------------------------------------------------- |
| r26378 | r26379 | |
| 252 | 252 | AM_RANGE(0x140000, 0x140fff) AM_DEVREADWRITE("taito_en", taito_en_device, en_68000_share_r, en_68000_share_w) |
| 253 | 253 | AM_RANGE(0x200000, 0x20001f) AM_DEVREADWRITE("ensoniq", es5505_device, read, write) |
| 254 | 254 | AM_RANGE(0x260000, 0x2601ff) AM_DEVREADWRITE("taito_en", taito_en_device, es5510_dsp_r, es5510_dsp_w) //todo: hook up cpu/es5510 |
| 255 | | AM_RANGE(0x280000, 0x28001f) AM_DEVREADWRITE8_LEGACY("duart68681", duart68681_r, duart68681_w, 0x00ff) |
| 255 | AM_RANGE(0x280000, 0x28001f) AM_DEVREADWRITE8("duart68681", duartn68681_device, read, write, 0x00ff) |
| 256 | 256 | AM_RANGE(0x300000, 0x30003f) AM_DEVWRITE("taito_en", taito_en_device, en_es5505_bank_w) |
| 257 | 257 | AM_RANGE(0x340000, 0x340003) AM_DEVWRITE("taito_en", taito_en_device, en_volume_w) |
| 258 | 258 | AM_RANGE(0xc00000, 0xc1ffff) AM_ROMBANK("bank1") |
| r26378 | r26379 | |
| 285 | 285 | *************************************/ |
| 286 | 286 | |
| 287 | 287 | |
| 288 | | static void taito_en_duart_irq_handler(device_t *device, int state, UINT8 vector) |
| 288 | WRITE_LINE_MEMBER(taito_en_device::duart_irq_handler) |
| 289 | 289 | { |
| 290 | 290 | if (state == ASSERT_LINE) |
| 291 | 291 | { |
| 292 | | device->machine().device("audiocpu")->execute().set_input_line_vector(M68K_IRQ_6, vector); |
| 293 | | device->machine().device("audiocpu")->execute().set_input_line(M68K_IRQ_6, ASSERT_LINE); |
| 292 | machine().device("audiocpu")->execute().set_input_line_vector(M68K_IRQ_6, m_duart68681->get_irq_vector()); |
| 293 | machine().device("audiocpu")->execute().set_input_line(M68K_IRQ_6, ASSERT_LINE); |
| 294 | 294 | } |
| 295 | 295 | else |
| 296 | 296 | { |
| 297 | | device->machine().device("audiocpu")->execute().set_input_line(M68K_IRQ_6, CLEAR_LINE); |
| 297 | machine().device("audiocpu")->execute().set_input_line(M68K_IRQ_6, CLEAR_LINE); |
| 298 | 298 | } |
| 299 | 299 | } |
| 300 | 300 | |
| r26378 | r26379 | |
| 316 | 316 | IP4: 0.5MHz |
| 317 | 317 | IP5: 1MHz |
| 318 | 318 | */ |
| 319 | | static const duart68681_config taito_en_duart68681_config = |
| 319 | static const duartn68681_config taito_en_duart68681_config = |
| 320 | 320 | { |
| 321 | | taito_en_duart_irq_handler, |
| 322 | | NULL, /* tx callback */ |
| 323 | | NULL, /* input port read */ |
| 324 | | NULL, /* output port write */ |
| 321 | DEVCB_DEVICE_LINE_MEMBER("taito_en", taito_en_device, duart_irq_handler), |
| 322 | DEVCB_NULL, /* tx_a callback */ |
| 323 | DEVCB_NULL, /* tx_b callback */ |
| 324 | DEVCB_NULL, /* input port read */ |
| 325 | DEVCB_NULL, /* output port write */ |
| 325 | 326 | XTAL_16MHz/2/8, /* IP2/RxCB clock */ |
| 326 | 327 | XTAL_16MHz/2/16, /* IP3/TxCA clock */ |
| 327 | 328 | XTAL_16MHz/2/16, /* IP4/RxCA clock */ |
| r26378 | r26379 | |
| 353 | 354 | MCFG_CPU_ADD("audiocpu", M68000, XTAL_30_4761MHz / 2) |
| 354 | 355 | MCFG_CPU_PROGRAM_MAP(en_sound_map) |
| 355 | 356 | |
| 356 | | MCFG_DUART68681_ADD("duart68681", XTAL_16MHz / 4, taito_en_duart68681_config) |
| 357 | MCFG_DUARTN68681_ADD("duart68681", XTAL_16MHz / 4, taito_en_duart68681_config) |
| 357 | 358 | MCFG_MB87078_ADD("mb87078", taito_en_mb87078_intf) |
| 358 | 359 | |
| 359 | 360 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |