void (*irq_callback)(int id, int level);\r
int is_slave;\r
\r
- // XXX: unused, will we ever use?\r
- int internal_irq_level;\r
+ UINT32 cycles_aim; // subtract sh2_icount to get global counter\r
} SH2;\r
\r
+SH2 *sh2; // active sh2\r
extern int sh2_icount;\r
\r
void sh2_init(SH2 *sh2, int is_slave);\r
sh2->pc = RL(0);
sh2->r[15] = RL(4);
sh2->sr = I;
-
- sh2->internal_irq_level = -1;
}
/* Execute cycles - returns number of cycles actually run */
{
sh2 = sh2_;
sh2_icount = cycles;
+ sh2->cycles_aim += cycles;
do
{
}
sh2_icount--;
}
- while (sh2_icount > 0);
+ while (sh2_icount > 0 || sh2->delay); /* can't interrupt before delay */
return cycles - sh2_icount;
}