trunk/src/mame/includes/maygay1b.h
| r26373 | r26374 | |
| 10 | 10 | #include "cpu/m6809/m6809.h" |
| 11 | 11 | #include "video/awpvid.h" //Fruit Machines Only |
| 12 | 12 | #include "machine/6821pia.h" |
| 13 | | #include "machine/68681.h" |
| 13 | #include "machine/n68681.h" |
| 14 | 14 | #include "machine/meters.h" |
| 15 | 15 | #include "machine/roc10937.h" // vfd |
| 16 | 16 | #include "machine/steppers.h" // stepper motor |
| r26373 | r26374 | |
| 41 | 41 | public: |
| 42 | 42 | maygay1b_state(const machine_config &mconfig, device_type type, const char *tag) |
| 43 | 43 | : driver_device(mconfig, type, tag), |
| 44 | | m_vfd(*this, "vfd"), |
| 45 | 44 | m_maincpu(*this, "maincpu"), |
| 46 | | m_msm6376(*this, "msm6376") { |
| 45 | m_vfd(*this, "vfd"), |
| 46 | m_msm6376(*this, "msm6376"), |
| 47 | m_duart68681(*this, "duart68681") { |
| 47 | 48 | m_NMIENABLE = 0; |
| 48 | 49 | } |
| 49 | 50 | |
| 51 | required_device<cpu_device> m_maincpu; |
| 52 | optional_device<roc10937_t> m_vfd; |
| 53 | optional_device<okim6376_device> m_msm6376; |
| 54 | required_device<duartn68681_device> m_duart68681; |
| 55 | |
| 50 | 56 | UINT8 m_lamppos; |
| 51 | 57 | int m_alpha_clock; |
| 52 | 58 | int m_RAMEN; |
| r26373 | r26374 | |
| 59 | 65 | TIMER_DEVICE_CALLBACK_MEMBER( maygay1b_nmitimer_callback ); |
| 60 | 66 | UINT8 m_Lamps[256]; |
| 61 | 67 | int m_optic_pattern; |
| 62 | | optional_device<roc10937_t> m_vfd; |
| 63 | | device_t *m_duart68681; |
| 64 | 68 | i8279_state m_i8279[2]; |
| 65 | 69 | DECLARE_READ8_MEMBER(m1_8279_r); |
| 66 | 70 | DECLARE_WRITE8_MEMBER(m1_8279_w); |
| r26373 | r26374 | |
| 80 | 84 | DECLARE_WRITE8_MEMBER(m1_meter_w); |
| 81 | 85 | DECLARE_READ8_MEMBER(m1_meter_r); |
| 82 | 86 | DECLARE_READ8_MEMBER(m1_firq_trg_r); |
| 87 | DECLARE_WRITE_LINE_MEMBER(duart_irq_handler); |
| 88 | DECLARE_READ8_MEMBER(m1_duart_r); |
| 83 | 89 | DECLARE_DRIVER_INIT(m1); |
| 84 | 90 | virtual void machine_start(); |
| 85 | 91 | virtual void machine_reset(); |
| 86 | 92 | void update_outputs(i8279_state *chip, UINT16 which); |
| 87 | 93 | void m1_stepper_reset(); |
| 88 | | required_device<cpu_device> m_maincpu; |
| 89 | | optional_device<okim6376_device> m_msm6376; |
| 90 | 94 | }; |
trunk/src/mame/drivers/maygay1b.c
| r26373 | r26374 | |
| 472 | 472 | void maygay1b_state::machine_reset() |
| 473 | 473 | { |
| 474 | 474 | m_vfd->reset(); // reset display1 |
| 475 | | m_duart68681 = machine().device( "duart68681" ); |
| 476 | 475 | m1_stepper_reset(); |
| 477 | 476 | } |
| 478 | 477 | |
| 479 | 478 | /////////////////////////////////////////////////////////////////////////// |
| 480 | 479 | |
| 481 | 480 | // IRQ from Duart (hopper?) |
| 482 | | static void duart_irq_handler(device_t *device, int state, UINT8 vector) |
| 481 | WRITE_LINE_MEMBER(maygay1b_state::duart_irq_handler) |
| 483 | 482 | { |
| 484 | | maygay1b_state *drvstate = device->machine().driver_data<maygay1b_state>(); |
| 485 | | drvstate->m_maincpu->set_input_line(M6809_IRQ_LINE, state?ASSERT_LINE:CLEAR_LINE); |
| 483 | m_maincpu->set_input_line(M6809_IRQ_LINE, state?ASSERT_LINE:CLEAR_LINE); |
| 486 | 484 | LOG(("6809 irq%d \n",state)); |
| 487 | 485 | } |
| 488 | 486 | |
| r26373 | r26374 | |
| 730 | 728 | awp_draw_reel(5); |
| 731 | 729 | } |
| 732 | 730 | |
| 733 | | static UINT8 m1_duart_r (device_t *device) |
| 731 | READ8_MEMBER(maygay1b_state::m1_duart_r) |
| 734 | 732 | { |
| 735 | | maygay1b_state *state = device->machine().driver_data<maygay1b_state>(); |
| 736 | | return ~(state->m_optic_pattern); |
| 733 | return ~(m_optic_pattern); |
| 737 | 734 | } |
| 738 | 735 | |
| 739 | 736 | WRITE8_MEMBER(maygay1b_state::m1_meter_w) |
| r26373 | r26374 | |
| 821 | 818 | AM_RANGE(0x2040, 0x2041) AM_READWRITE(m1_8279_2_r,m1_8279_2_w) |
| 822 | 819 | // AM_RANGE(0x2050, 0x2050)// SCAN on M1B |
| 823 | 820 | |
| 824 | | AM_RANGE(0x2070, 0x207f) AM_DEVREADWRITE_LEGACY("duart68681", duart68681_r, duart68681_w ) |
| 821 | AM_RANGE(0x2070, 0x207f) AM_DEVREADWRITE("duart68681", duartn68681_device, read, write ) |
| 825 | 822 | |
| 826 | 823 | AM_RANGE(0x2090, 0x2091) AM_DEVWRITE("aysnd", ay8910_device, address_data_w) |
| 827 | 824 | AM_RANGE(0x20B0, 0x20B0) AM_READ(m1_meter_r) |
| r26373 | r26374 | |
| 852 | 849 | DEVCB_NULL, |
| 853 | 850 | }; |
| 854 | 851 | |
| 855 | | static const duart68681_config maygaym1_duart68681_config = |
| 852 | static const duartn68681_config maygaym1_duart68681_config = |
| 856 | 853 | { |
| 857 | | duart_irq_handler, |
| 858 | | NULL, |
| 859 | | m1_duart_r, |
| 860 | | NULL |
| 854 | DEVCB_DRIVER_LINE_MEMBER(maygay1b_state, duart_irq_handler), |
| 855 | DEVCB_NULL, |
| 856 | DEVCB_NULL, |
| 857 | DEVCB_DRIVER_MEMBER(maygay1b_state, m1_duart_r), |
| 858 | DEVCB_NULL |
| 861 | 859 | }; |
| 862 | 860 | |
| 863 | 861 | // machine driver for maygay m1 board ///////////////////////////////// |
| r26373 | r26374 | |
| 869 | 867 | MCFG_CPU_ADD("maincpu", M6809, M1_MASTER_CLOCK/2) |
| 870 | 868 | MCFG_CPU_PROGRAM_MAP(m1_memmap) |
| 871 | 869 | |
| 872 | | MCFG_DUART68681_ADD("duart68681", M1_DUART_CLOCK, maygaym1_duart68681_config) |
| 870 | MCFG_DUARTN68681_ADD("duart68681", M1_DUART_CLOCK, maygaym1_duart68681_config) |
| 873 | 871 | MCFG_PIA6821_ADD("pia", m1_pia_intf) |
| 874 | 872 | MCFG_MSC1937_ADD("vfd",0,RIGHT_TO_LEFT) |
| 875 | 873 | MCFG_SPEAKER_STANDARD_MONO("mono") |