trunk/src/emu/machine/mc68901.c
| r26772 | r26773 | |
| 293 | 293 | |
| 294 | 294 | inline void mc68901_device::gpio_input(int bit, int state) |
| 295 | 295 | { |
| 296 | | if (BIT(m_gpip, bit) && !state) // if transition from 1 to 0 is detected... |
| 296 | if (state != BIT(m_gpip, bit)) |
| 297 | 297 | { |
| 298 | | if (LOG) logerror("MC68901 '%s' Edge Transition Detected on GPIO%u\n", tag(), bit); |
| 299 | | |
| 300 | | if (m_ier & INT_MASK_GPIO[bit]) // AND interrupt enabled bit is set... |
| 298 | if (state == BIT(m_aer, bit)) |
| 301 | 299 | { |
| 302 | | if (LOG) logerror("MC68901 '%s' Interrupt Pending for GPIO%u\n", tag(), bit); |
| 300 | if (LOG) logerror("MC68901 '%s' Edge Transition Detected on GPIO%u\n", tag(), bit); |
| 303 | 301 | |
| 304 | | take_interrupt(INT_MASK_GPIO[bit]); // set interrupt pending bit |
| 302 | if (m_ier & INT_MASK_GPIO[bit]) // AND interrupt enabled bit is set... |
| 303 | { |
| 304 | if (LOG) logerror("MC68901 '%s' Interrupt Pending for GPIO%u\n", tag(), bit); |
| 305 | |
| 306 | take_interrupt(INT_MASK_GPIO[bit]); // set interrupt pending bit |
| 307 | } |
| 305 | 308 | } |
| 309 | |
| 310 | |
| 311 | if (state) |
| 312 | m_gpip &= ~(1 << bit); |
| 313 | else |
| 314 | m_gpip |= (1 << bit); |
| 306 | 315 | } |
| 307 | | |
| 308 | | m_gpip &= ((1 << bit) ^ 0xff); |
| 309 | | m_gpip |= (state << bit); |
| 310 | 316 | } |
| 311 | 317 | |
| 312 | 318 | |