Previous 199869 Revisions Next

r26773 Friday 27th December, 2013 at 00:42:15 UTC by smf
uses aer register to select which transition to generate an interrupt on [smf]
[src/emu/machine]mc68901.c

trunk/src/emu/machine/mc68901.c
r26772r26773
293293
294294inline void mc68901_device::gpio_input(int bit, int state)
295295{
296   if (BIT(m_gpip, bit) && !state) // if transition from 1 to 0 is detected...
296   if (state != BIT(m_gpip, bit))
297297   {
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))
301299      {
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);
303301
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         }
305308      }
309
310
311      if (state)
312         m_gpip &= ~(1 << bit);
313      else
314         m_gpip |= (1 << bit);
306315   }
307
308   m_gpip &= ((1 << bit) ^ 0xff);
309   m_gpip |= (state << bit);
310316}
311317
312318

Previous 199869 Revisions Next


© 1997-2024 The MAME Team