Previous 199869 Revisions Next

r33209 Tuesday 4th November, 2014 at 17:58:05 UTC by Ramiro Polla
upd7810: correctly deal with external interrupts
[src/emu/cpu/upd7810]upd7810.c upd7810.h

trunk/src/emu/cpu/upd7810/upd7810.c
r241720r241721
16161616   save_item(NAME(m_ovcf));
16171617   save_item(NAME(m_ovcs));
16181618   save_item(NAME(m_edges));
1619   save_item(NAME(m_nmi));
16191620   save_item(NAME(m_int1));
16201621   save_item(NAME(m_int2));
16211622
r241720r241721
17971798   m_co1 = 0;
17981799   m_irr = 0;
17991800   m_itf = 0;
1801   m_nmi = 0;
18001802   m_int1 = 0;
18011803   m_int2 = 0;
18021804
r241720r241721
19701972
19711973void upd7810_device::execute_set_input(int irqline, int state)
19721974{
1973   if (state != CLEAR_LINE)
1974   {
1975      if (irqline == INPUT_LINE_NMI)
1976      {
1977         /* no nested NMIs ? */
1978//          if (0 == (IRR & INTNMI))
1975   switch (irqline) {
1976   case INPUT_LINE_NMI:
1977      /* NMI is falling edge sensitive */
1978      if ( m_nmi == ASSERT_LINE && state == CLEAR_LINE )
19791979         IRR |= INTNMI;
1980      }
1981      else
1982      if (irqline == UPD7810_INTF1)
1980
1981      m_nmi = state;
1982      break;
1983   case UPD7810_INTF1:
1984      /* INT1 is rising edge sensitive */
1985      if ( m_int1 == CLEAR_LINE && state == ASSERT_LINE )
19831986         IRR |= INTF1;
1984      else
1985      if ( irqline == UPD7810_INTF2 && ( MKL & 0x20 ) )
1987
1988      m_int1 = state;
1989      break;
1990   case UPD7810_INTF2:
1991      /* INT2 is falling edge sensitive */
1992      if ( m_int2 == ASSERT_LINE && state == CLEAR_LINE )
19861993         IRR |= INTF2;
1987      else
1988         logerror("upd7810_set_irq_line invalid irq line #%d\n", irqline);
1994
1995      m_int2 = state;
1996      break;
1997   default:
1998      logerror("upd7810_set_irq_line invalid irq line #%d\n", irqline);
1999      break;
19892000   }
19902001   /* resetting interrupt requests is done with the SKIT/SKNIT opcodes only! */
19912002}
trunk/src/emu/cpu/upd7810/upd7810.h
r241720r241721
294294   UINT8   m_co1;
295295   UINT16  m_irr;    /* interrupt request register */
296296   UINT16  m_itf;    /* interrupt test flag register */
297   int     m_int1;   /* keep track of current int1 state. Needed for 7801 irq checking. */
298   int     m_int2;   /* keep track to current int2 state. Needed for 7801 irq checking. */
297   int     m_nmi;    /* keep track of current nmi state. Needed for 7810 irq checking. */
298   int     m_int1;   /* keep track of current int1 state. Needed for irq checking. */
299   int     m_int2;   /* keep track to current int2 state. Needed for irq checking. */
299300
300301   /* internal helper variables */
301302   UINT16  m_txs;    /* transmitter shift register */


Previous 199869 Revisions Next


© 1997-2024 The MAME Team