Previous 15994 Revisions Next

r6221 Friday 30th October, 2009 at 16:13:33 UTC by Dirk Best
[Z80] Check for NOP in IM0
[src/emu/cpu/z80]z80.c

src/emu/cpu/z80/z80.c
r6220r6221
33163316      /* if neither of these were found we assume a 1 byte opcode */
33173317      /* was placed on the databus                                */
33183318      LOG(("Z80 '%s' IM0 $%04x\n", z80->device->tag, irq_vector));
3319      switch (irq_vector & 0xff0000)
3319
3320      /* check for nop */
3321      if (irq_vector != 0)
33203322      {
3321         case 0xcd0000:   /* call */
3322            PUSH(z80, pc);
3323            z80->PCD = irq_vector & 0xffff;
3324             /* CALL $xxxx + 'interrupt latency' cycles */
3325            z80->icount -= z80->cc_op[0xcd] + z80->cc_ex[0xff];
3326            break;
3327         case 0xc30000:   /* jump */
3328            z80->PCD = irq_vector & 0xffff;
3329            /* JP $xxxx + 2 cycles */
3330            z80->icount -= z80->cc_op[0xc3] + z80->cc_ex[0xff];
3331            break;
3332         default:      /* rst (or other opcodes?) */
3333            PUSH(z80, pc);
3334            z80->PCD = irq_vector & 0x0038;
3335            /* RST $xx + 2 cycles */
3336            z80->icount -= z80->cc_op[0xff] + z80->cc_ex[0xff];
3337            break;
3323         switch (irq_vector & 0xff0000)
3324         {
3325            case 0xcd0000:   /* call */
3326               PUSH(z80, pc);
3327               z80->PCD = irq_vector & 0xffff;
3328                /* CALL $xxxx cycles */
3329               z80->icount -= z80->cc_op[0xcd];
3330               break;
3331            case 0xc30000:   /* jump */
3332               z80->PCD = irq_vector & 0xffff;
3333               /* JP $xxxx cycles */
3334               z80->icount -= z80->cc_op[0xc3];
3335               break;
3336            default:      /* rst (or other opcodes?) */
3337               PUSH(z80, pc);
3338               z80->PCD = irq_vector & 0x0038;
3339               /* RST $xx cycles */
3340               z80->icount -= z80->cc_op[0xff];
3341               break;
3342         }
33383343      }
3344
3345      /* 'interrupt latency' cycles */
3346      z80->icount -= z80->cc_ex[0xff];
33393347   }
33403348   z80->WZ=z80->PCD;
33413349}

Previous 15994 Revisions Next


© 1998-2018 The MESS Team