Previous 15994 Revisions Next

r1197 Monday 29th October, 2007 at 08:00:24 UTC by Curt Coder
[MFP68901] Fixed interrupt handling some more
[src/mess/drivers]x68k.c
[src/mess/machine]68901mfp.c

src/mess/machine/68901mfp.c
r1196r1197
10951095
10961096   for (ch = 15; ch >= 0; ch--)
10971097   {
1098      if (BIT(mfp_p->ipr, ch))
1098      if (BIT(mfp_p->imr, ch) && BIT(mfp_p->ipr, ch))
10991099      {
11001100         if (mfp_p->vr & MFP68901_VR_S)
11011101         {
src/mess/drivers/x68k.c
r1196r1197
148148extern UINT16* x68k_spriteram;  // sprite/background RAM
149149extern UINT16* x68k_spritereg;  // sprite/background registers
150150UINT8 ppi_port[3];
151UINT8 current_vector[8];
151int current_vector[8];
152152UINT8 current_irq_line;
153153unsigned int x68k_scanline;
154154
r1196r1197
341341
342342}
343343*/
344
344345// 4 channel DMA controller (Hitachi HD63450)
345346WRITE16_HANDLER( x68k_dmac_w )
346347{
r1196r1197
764765      sys.ioc.irqstatus |= 0x80;
765766      current_irq_line = 1;
766767      logerror("FDC: IRQ triggered\n");
767      cpunum_set_input_line_and_vector(0,1,ASSERT_LINE,current_vector[1]);
768      cpunum_set_input_line_and_vector(0,1,HOLD_LINE,current_vector[1]);
768769   }
769770}
770771
r1196r1197
14011402   return data;
14021403}
14031404
1404TIMER_CALLBACK( x68k_delayed_irq )
1405void mfp_irq_callback(int which, int state)
14051406{
1407   static int prev;
1408   if(prev == CLEAR_LINE && state == CLEAR_LINE)  // eliminate unnecessary calls to set the IRQ line for speed reasons
1409      return;
14061410   if((sys.ioc.irqstatus & 0xc0) != 0)  // if the FDC is busy, then we don't want to miss that IRQ
1407   {
1408      mame_timer_set(MAME_TIME_IN_CYCLES(32,0),param,x68k_delayed_irq);
14091411      return;
1410   }
1411//   current_vector[6] = param;
1412   cpunum_set_input_line(0,6,HOLD_LINE);
1412   cpunum_set_input_line(0,6,state);
1413   prev = state;
14131414}
14141415
1415void mfp_irq_callback(int which, int state)
1416{
1417   if(state == CLEAR_LINE)
1418      cpunum_set_input_line(0,6,state);
1419   else
1420   {
1421//      if((sys.ioc.irqstatus & 0xc0) != 0)  // if the FDC is busy, then we don't want to miss that IRQ
1422//      {
1423//         mame_timer_set(MAME_TIME_IN_CYCLES(32,0),0,x68k_delayed_irq);
1424//         return;
1425//      }
1426//      current_vector[6] = vector;
1427      cpunum_set_input_line(0,6,state);
1428//      logerror("MFP IRQ callback: state=%i\n",state);
1429   }
1430}
1431
14321416static INTERRUPT_GEN( x68k_vsync_irq )
14331417{
14341418//   if(sys.mfp.ierb & 0x40)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team