Previous 15994 Revisions Next

r1135 Wednesday 17th October, 2007 at 15:25:01 UTC by Wilbert Pol
REDO COMMIT [MFP68901] Fixed software end-of-interrupt mode [Curt Coder]
[src/mess/machine]68901mfp.c

src/mess/machine/68901mfp.c
r1134r1135
7878      {
7979         if (mfp_p->ier & GPIO_MASK[bit]) // AND interrupt enabled bit is set...
8080         {
81            logerror("MFP68901 #%u Edge Transition Detected on GPIO%u\n", which, bit);
82
8183            mfp_p->ipr |= GPIO_MASK[bit]; // set interrupt pending bit
8284         }
8385      }
r1134r1135
9294
9395   int ch;
9496
95   if (!mfp_p->isr) // if no interrupts are currently in service...
97   for (ch = 15; ch >= 0; ch--) // loop thru each channel from 15 to 0
9698   {
97      for (ch = 15; ch >= 0; ch--) // loop thru each channel from 15 to 0
99      if (BIT(mfp_p->isr, ch)) // if interrupt channel is in service...
98100      {
99         if (BIT(mfp_p->imr, ch)) // if interrupt mask bit is set...
101         return; // don't process lower priority channels
102      }
103
104      if (BIT(mfp_p->imr, ch)) // if interrupt mask bit is set...
105      {
106         if (BIT(mfp_p->ipr, ch)) // AND interrupt pending bit is set...
100107         {
101            if (BIT(mfp_p->ipr, ch)) // AND interrupt pending bit is set...
102            {
103               logerror("MFP68901 #%u Interrupt Fired on Channel %u\n", which, ch);
108            logerror("MFP68901 #%u Interrupt Fired on Channel %u\n", which, ch);
104109
105               mfp_p->ipr &= ~(1 << ch); // clear interrupt pending bit
110            mfp_p->ipr &= ~(1 << ch); // clear interrupt pending bit
106111
107               if (mfp_p->vr & MFP68901_VR_S) // if software end-of-interrupt mode is enabled...
108               {
109                  mfp_p->isr |= (1 << ch); // set interrupt in service bit (bit will be cleared later by the interrupt service routine)
110               }
112            if (mfp_p->vr & MFP68901_VR_S) // if software end-of-interrupt mode is enabled...
113            {
114               mfp_p->isr |= (1 << ch); // set interrupt in service bit (bit will be cleared later by the interrupt service routine)
115            }
111116
112               mfp_p->intf->irq_callback(which, HOLD_LINE, (mfp_p->vr & 0xf0) | ch); // fire interrupt callback
117            mfp_p->intf->irq_callback(which, ASSERT_LINE, (mfp_p->vr & 0xf0) | ch); // fire interrupt callback
113118
114               return;
115            }
119            return;
116120         }
117121      }
118122   }
r1134r1135
558562
559563   case MFP68901_REGISTER_IPRA:
560564      logerror("MFP68901 #%u Interrupt Pending Register A : %x\n", which, data);
561      mfp_p->ier &= (data << 8) | (mfp_p->ier & 0xff);
565      mfp_p->ipr &= (data << 8) | (mfp_p->ipr & 0xff);
562566      break;
563567
564568   case MFP68901_REGISTER_IPRB:
r1134r1135
568572
569573   case MFP68901_REGISTER_ISRA:
570574      logerror("MFP68901 #%u Interrupt In-Service Register A : %x\n", which, data);
571      mfp_p->isr = (data << 8) | (mfp_p->isr & 0xff);
575      mfp_p->isr &= (data << 8) | (mfp_p->isr & 0xff);
572576      break;
573577
574578   case MFP68901_REGISTER_ISRB:
575579      logerror("MFP68901 #%u Interrupt In-Service Register B : %x\n", which, data);
576      mfp_p->isr = (mfp_p->isr & 0xff00) | data;
580      mfp_p->isr &= (mfp_p->isr & 0xff00) | data;
577581      break;
578582
579583   case MFP68901_REGISTER_IMRA:

Previous 15994 Revisions Next


© 1998-2018 The MESS Team