Previous 199869 Revisions Next

r17602 Sunday 2nd September, 2012 at 22:52:44 UTC by hap
get rid of old speedup hack (besides, it made halt timing inaccurate on drivers with custom cycletables)
[src/emu/cpu/z80]z80.c

trunk/src/emu/cpu/z80/z80.c
r17601r17602
366366
367367static void take_interrupt(z80_state *z80);
368368static void take_interrupt_nsc800(z80_state *z80);
369static CPU_BURN( z80 );
370369
371370typedef void (*funcptr)(z80_state *z80);
372371
r17601r17602
477476PROTOTYPES(Z80fd,fd);
478477PROTOTYPES(Z80xycb,xycb);
479478
480/****************************************************************************/
481/* Burn an odd amount of cycles, that is instructions taking something      */
482/* different from 4 T-states per opcode (and r increment)                   */
483/****************************************************************************/
484INLINE void BURNODD(z80_state *z80, int cycles, int opcodes, int cyclesum)
485{
486   if( cycles > 0 )
487   {
488      z80->r += (cycles / cyclesum) * opcodes;
489      z80->icount -= (cycles / cyclesum) * cyclesum;
490   }
491}
492
493479/***************************************************************
494480 * define an opcode function
495481 ***************************************************************/
r17601r17602
594580#define ENTER_HALT(Z) do {                              \
595581   (Z)->PC--;                                       \
596582   (Z)->halt = 1;                                    \
597   if( (Z)->irq_state == CLEAR_LINE )                     \
598      CPU_BURN_NAME(z80)( (Z)->device, (Z)->icount);         \
599583} while (0)
600584
601585/***************************************************************
r17601r17602
36873671}
36883672
36893673/****************************************************************************
3690 * Burn 'cycles' T-states. Adjust z80->r register for the lost time
3691 ****************************************************************************/
3692static CPU_BURN( z80 )
3693{
3694   z80_state *z80 = get_safe_token(device);
3695
3696   if( cycles > 0 )
3697   {
3698      /* NOP takes 4 cycles per instruction */
3699      int n = (cycles + 3) / 4;
3700      z80->r += n;
3701      z80->icount -= 4 * n;
3702   }
3703}
3704
3705/****************************************************************************
37063674 * Set IRQ line state
37073675 ****************************************************************************/
37083676static void set_irq_line(z80_state *z80, int irqline, int state)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team