trunk/src/emu/cpu/upd7810/upd7810.c
r241720 | r241721 | |
1616 | 1616 | save_item(NAME(m_ovcf)); |
1617 | 1617 | save_item(NAME(m_ovcs)); |
1618 | 1618 | save_item(NAME(m_edges)); |
| 1619 | save_item(NAME(m_nmi)); |
1619 | 1620 | save_item(NAME(m_int1)); |
1620 | 1621 | save_item(NAME(m_int2)); |
1621 | 1622 | |
r241720 | r241721 | |
1797 | 1798 | m_co1 = 0; |
1798 | 1799 | m_irr = 0; |
1799 | 1800 | m_itf = 0; |
| 1801 | m_nmi = 0; |
1800 | 1802 | m_int1 = 0; |
1801 | 1803 | m_int2 = 0; |
1802 | 1804 | |
r241720 | r241721 | |
1970 | 1972 | |
1971 | 1973 | void upd7810_device::execute_set_input(int irqline, int state) |
1972 | 1974 | { |
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 ) |
1979 | 1979 | 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 ) |
1983 | 1986 | 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 ) |
1986 | 1993 | 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; |
1989 | 2000 | } |
1990 | 2001 | /* resetting interrupt requests is done with the SKIT/SKNIT opcodes only! */ |
1991 | 2002 | } |
trunk/src/emu/cpu/upd7810/upd7810.h
r241720 | r241721 | |
294 | 294 | UINT8 m_co1; |
295 | 295 | UINT16 m_irr; /* interrupt request register */ |
296 | 296 | 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. */ |
299 | 300 | |
300 | 301 | /* internal helper variables */ |
301 | 302 | UINT16 m_txs; /* transmitter shift register */ |