Updated maygay1b to use the n68681 device. (nw)

This commit is contained in:
Ivan Vangelista 2013-11-23 11:36:46 +00:00
parent 1684adab21
commit 8b17b14e74
2 changed files with 23 additions and 21 deletions

View File

@ -472,17 +472,15 @@ void maygay1b_state::m1_stepper_reset()
void maygay1b_state::machine_reset()
{
m_vfd->reset(); // reset display1
m_duart68681 = machine().device( "duart68681" );
m1_stepper_reset();
}
///////////////////////////////////////////////////////////////////////////
// IRQ from Duart (hopper?)
static void duart_irq_handler(device_t *device, int state, UINT8 vector)
WRITE_LINE_MEMBER(maygay1b_state::duart_irq_handler)
{
maygay1b_state *drvstate = device->machine().driver_data<maygay1b_state>();
drvstate->m_maincpu->set_input_line(M6809_IRQ_LINE, state?ASSERT_LINE:CLEAR_LINE);
m_maincpu->set_input_line(M6809_IRQ_LINE, state?ASSERT_LINE:CLEAR_LINE);
LOG(("6809 irq%d \n",state));
}
@ -730,10 +728,9 @@ WRITE8_MEMBER(maygay1b_state::reel56_w)
awp_draw_reel(5);
}
static UINT8 m1_duart_r (device_t *device)
READ8_MEMBER(maygay1b_state::m1_duart_r)
{
maygay1b_state *state = device->machine().driver_data<maygay1b_state>();
return ~(state->m_optic_pattern);
return ~(m_optic_pattern);
}
WRITE8_MEMBER(maygay1b_state::m1_meter_w)
@ -821,7 +818,7 @@ static ADDRESS_MAP_START( m1_memmap, AS_PROGRAM, 8, maygay1b_state )
AM_RANGE(0x2040, 0x2041) AM_READWRITE(m1_8279_2_r,m1_8279_2_w)
// AM_RANGE(0x2050, 0x2050)// SCAN on M1B
AM_RANGE(0x2070, 0x207f) AM_DEVREADWRITE_LEGACY("duart68681", duart68681_r, duart68681_w )
AM_RANGE(0x2070, 0x207f) AM_DEVREADWRITE("duart68681", duartn68681_device, read, write )
AM_RANGE(0x2090, 0x2091) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
AM_RANGE(0x20B0, 0x20B0) AM_READ(m1_meter_r)
@ -852,12 +849,13 @@ static const ay8910_interface ay8910_config =
DEVCB_NULL,
};
static const duart68681_config maygaym1_duart68681_config =
static const duartn68681_config maygaym1_duart68681_config =
{
duart_irq_handler,
NULL,
m1_duart_r,
NULL
DEVCB_DRIVER_LINE_MEMBER(maygay1b_state, duart_irq_handler),
DEVCB_NULL,
DEVCB_NULL,
DEVCB_DRIVER_MEMBER(maygay1b_state, m1_duart_r),
DEVCB_NULL
};
// machine driver for maygay m1 board /////////////////////////////////
@ -869,7 +867,7 @@ MACHINE_CONFIG_START( maygay_m1, maygay1b_state )
MCFG_CPU_ADD("maincpu", M6809, M1_MASTER_CLOCK/2)
MCFG_CPU_PROGRAM_MAP(m1_memmap)
MCFG_DUART68681_ADD("duart68681", M1_DUART_CLOCK, maygaym1_duart68681_config)
MCFG_DUARTN68681_ADD("duart68681", M1_DUART_CLOCK, maygaym1_duart68681_config)
MCFG_PIA6821_ADD("pia", m1_pia_intf)
MCFG_MSC1937_ADD("vfd",0,RIGHT_TO_LEFT)
MCFG_SPEAKER_STANDARD_MONO("mono")

View File

@ -10,7 +10,7 @@
#include "cpu/m6809/m6809.h"
#include "video/awpvid.h" //Fruit Machines Only
#include "machine/6821pia.h"
#include "machine/68681.h"
#include "machine/n68681.h"
#include "machine/meters.h"
#include "machine/roc10937.h" // vfd
#include "machine/steppers.h" // stepper motor
@ -41,12 +41,18 @@ class maygay1b_state : public driver_device
public:
maygay1b_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_vfd(*this, "vfd"),
m_maincpu(*this, "maincpu"),
m_msm6376(*this, "msm6376") {
m_vfd(*this, "vfd"),
m_msm6376(*this, "msm6376"),
m_duart68681(*this, "duart68681") {
m_NMIENABLE = 0;
}
required_device<cpu_device> m_maincpu;
optional_device<roc10937_t> m_vfd;
optional_device<okim6376_device> m_msm6376;
required_device<duartn68681_device> m_duart68681;
UINT8 m_lamppos;
int m_alpha_clock;
int m_RAMEN;
@ -59,8 +65,6 @@ public:
TIMER_DEVICE_CALLBACK_MEMBER( maygay1b_nmitimer_callback );
UINT8 m_Lamps[256];
int m_optic_pattern;
optional_device<roc10937_t> m_vfd;
device_t *m_duart68681;
i8279_state m_i8279[2];
DECLARE_READ8_MEMBER(m1_8279_r);
DECLARE_WRITE8_MEMBER(m1_8279_w);
@ -80,11 +84,11 @@ public:
DECLARE_WRITE8_MEMBER(m1_meter_w);
DECLARE_READ8_MEMBER(m1_meter_r);
DECLARE_READ8_MEMBER(m1_firq_trg_r);
DECLARE_WRITE_LINE_MEMBER(duart_irq_handler);
DECLARE_READ8_MEMBER(m1_duart_r);
DECLARE_DRIVER_INIT(m1);
virtual void machine_start();
virtual void machine_reset();
void update_outputs(i8279_state *chip, UINT16 which);
void m1_stepper_reset();
required_device<cpu_device> m_maincpu;
optional_device<okim6376_device> m_msm6376;
};