trunk/src/emu/machine/68307.h
| r26536 | r26537 | |
| 88 | 88 | static const device_type M68307 = &device_creator<m68307cpu_device>; |
| 89 | 89 | |
| 90 | 90 | extern void m68307_set_port_callbacks(m68307cpu_device *device, m68307_porta_read_callback porta_r, m68307_porta_write_callback porta_w, m68307_portb_read_callback portb_r, m68307_portb_write_callback portb_w); |
| 91 | | extern void m68307_set_duart68681(m68307cpu_device* cpudev, duartn68681_device *duart68681); |
| 91 | extern void m68307_set_duart68681(m68307cpu_device* cpudev, device_t *duart68681); |
| 92 | 92 | extern UINT16 m68307_get_cs(m68307cpu_device *device, offs_t address); |
| 93 | 93 | extern void m68307_timer0_interrupt(m68307cpu_device *cpudev); |
| 94 | 94 | extern void m68307_timer1_interrupt(m68307cpu_device *cpudev); |
trunk/src/emu/machine/68307ser.c
| r26536 | r26537 | |
| 24 | 24 | // if we're piggybacking on the existing 68681 implementation... |
| 25 | 25 | if (serial->m_duart68681) |
| 26 | 26 | { |
| 27 | | if (offset&1) return serial->m_duart68681->read(*m68k->program, offset>>1); |
| 27 | if (offset&1) return duart68681_r(serial->m_duart68681, *m68k->program, offset>>1); |
| 28 | 28 | } |
| 29 | 29 | else |
| 30 | 30 | { |
| r26536 | r26537 | |
| 103 | 103 | // if we're piggybacking on the existing 68681 implementation... |
| 104 | 104 | if (serial->m_duart68681) |
| 105 | 105 | { |
| 106 | | if (offset&1) serial->m_duart68681->write(*m68k->program, offset>>1, data); |
| 106 | if (offset&1) duart68681_w(serial->m_duart68681, *m68k->program, offset>>1, data); |
| 107 | 107 | } |
| 108 | 108 | else |
| 109 | 109 | { |
trunk/src/mame/drivers/bfm_sc4h.c
| r26536 | r26537 | |
| 610 | 610 | bfm_sc4_68307_porta_w, |
| 611 | 611 | bfm_sc4_68307_portb_r, |
| 612 | 612 | bfm_sc4_68307_portb_w ); |
| 613 | | m68307_set_duart68681(m_maincpu,machine().device<duartn68681_device>("m68307_68681")); |
| 613 | m68307_set_duart68681(m_maincpu,machine().device("m68307_68681")); |
| 614 | 614 | |
| 615 | 615 | |
| 616 | 616 | |
| r26536 | r26537 | |
| 689 | 689 | |
| 690 | 690 | |
| 691 | 691 | |
| 692 | | WRITE_LINE_MEMBER(sc4_state::m68307_duart_irq_handler) |
| 692 | void m68307_duart_irq_handler(device_t *device, int state, UINT8 vector) |
| 693 | 693 | { |
| 694 | sc4_state *drvstate = device->machine().driver_data<sc4_state>(); |
| 694 | 695 | logerror("m68307_duart_irq_handler\n"); |
| 695 | 696 | if (state == ASSERT_LINE) |
| 696 | 697 | { |
| 697 | | m68307_serial_interrupt(m_maincpu, machine().device<duartn68681_device>("m68307_68681")->get_irq_vector()); |
| 698 | m68307_serial_interrupt(drvstate->m_maincpu, vector); |
| 698 | 699 | } |
| 699 | 700 | } |
| 700 | 701 | |
| 701 | | WRITE_LINE_MEMBER(sc4_state::m68307_duart_txa) |
| 702 | void m68307_duart_tx(device_t *device, int channel, UINT8 data) |
| 702 | 703 | { |
| 703 | | logerror("m68307_duart_tx %02x\n", state); |
| 704 | if (channel==0) |
| 705 | { |
| 706 | logerror("m68307_duart_tx %02x\n",data); |
| 707 | } |
| 708 | else |
| 709 | { |
| 710 | printf("(illegal channel 1) m68307_duart_tx %02x\n",data); |
| 711 | } |
| 704 | 712 | } |
| 705 | 713 | |
| 706 | | WRITE_LINE_MEMBER(sc4_state::m68307_duart_txb) |
| 714 | UINT8 m68307_duart_input_r(device_t *device) |
| 707 | 715 | { |
| 708 | | printf("(illegal channel 1) m68307_duart_tx %02x\n", state); |
| 709 | | } |
| 710 | | |
| 711 | | READ8_MEMBER(sc4_state::m68307_duart_input_r) |
| 712 | | { |
| 713 | 716 | logerror("m68307_duart_input_r\n"); |
| 714 | 717 | return 0x00; |
| 715 | 718 | } |
| 716 | 719 | |
| 717 | | WRITE8_MEMBER(sc4_state::m68307_duart_output_w) |
| 720 | void m68307_duart_output_w(device_t *device, UINT8 data) |
| 718 | 721 | { |
| 719 | 722 | logerror("m68307_duart_output_w %02x\n", data); |
| 720 | 723 | } |
| 721 | 724 | |
| 722 | | |
| 723 | | |
| 724 | | static const duartn68681_config m68307_duart68681_config = |
| 725 | static const duart68681_config m68307_duart68681_config = |
| 725 | 726 | { |
| 726 | | DEVCB_DRIVER_LINE_MEMBER(sc4_state, m68307_duart_irq_handler), |
| 727 | | DEVCB_DRIVER_LINE_MEMBER(sc4_state, m68307_duart_txa), |
| 728 | | DEVCB_DRIVER_LINE_MEMBER(sc4_state, m68307_duart_txb), |
| 729 | | DEVCB_DRIVER_MEMBER(sc4_state, m68307_duart_input_r), |
| 730 | | DEVCB_DRIVER_MEMBER(sc4_state, m68307_duart_output_w) |
| 727 | m68307_duart_irq_handler, |
| 728 | m68307_duart_tx, |
| 729 | m68307_duart_input_r, |
| 730 | m68307_duart_output_w |
| 731 | 731 | }; |
| 732 | 732 | |
| 733 | 733 | /* default dmd */ |
| r26536 | r26537 | |
| 748 | 748 | MCFG_CPU_PROGRAM_MAP(sc4_map) |
| 749 | 749 | |
| 750 | 750 | // internal duart of the 68307... paired in machine start |
| 751 | | MCFG_DUARTN68681_ADD("m68307_68681", 16000000/4, m68307_duart68681_config) // ?? Mhz |
| 751 | MCFG_DUART68681_ADD("m68307_68681", 16000000/4, m68307_duart68681_config) // ?? Mhz |
| 752 | 752 | |
| 753 | 753 | MCFG_MACHINE_START_OVERRIDE(sc4_state, sc4 ) |
| 754 | 754 | MCFG_MACHINE_RESET_OVERRIDE(sc4_state, sc4 ) |