src/mess/machine/68901mfp.c
| r1134 | r1135 | |
| 78 | 78 | { |
| 79 | 79 | if (mfp_p->ier & GPIO_MASK[bit]) // AND interrupt enabled bit is set... |
| 80 | 80 | { |
| 81 | logerror("MFP68901 #%u Edge Transition Detected on GPIO%u\n", which, bit); |
| 82 | |
| 81 | 83 | mfp_p->ipr |= GPIO_MASK[bit]; // set interrupt pending bit |
| 82 | 84 | } |
| 83 | 85 | } |
| r1134 | r1135 | |
| 92 | 94 | |
| 93 | 95 | int ch; |
| 94 | 96 | |
| 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 |
| 96 | 98 | { |
| 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... |
| 98 | 100 | { |
| 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... |
| 100 | 107 | { |
| 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); |
| 104 | 109 | |
| 105 | | mfp_p->ipr &= ~(1 << ch); // clear interrupt pending bit |
| 110 | mfp_p->ipr &= ~(1 << ch); // clear interrupt pending bit |
| 106 | 111 | |
| 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 | } |
| 111 | 116 | |
| 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 |
| 113 | 118 | |
| 114 | | return; |
| 115 | | } |
| 119 | return; |
| 116 | 120 | } |
| 117 | 121 | } |
| 118 | 122 | } |
| r1134 | r1135 | |
| 558 | 562 | |
| 559 | 563 | case MFP68901_REGISTER_IPRA: |
| 560 | 564 | 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); |
| 562 | 566 | break; |
| 563 | 567 | |
| 564 | 568 | case MFP68901_REGISTER_IPRB: |
| r1134 | r1135 | |
| 568 | 572 | |
| 569 | 573 | case MFP68901_REGISTER_ISRA: |
| 570 | 574 | 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); |
| 572 | 576 | break; |
| 573 | 577 | |
| 574 | 578 | case MFP68901_REGISTER_ISRB: |
| 575 | 579 | 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; |
| 577 | 581 | break; |
| 578 | 582 | |
| 579 | 583 | case MFP68901_REGISTER_IMRA: |