32x: rework scheduling/timing

- don't run in line quantity
- decouple from 68k
- some things to tune..
This commit is contained in:
notaz 2013-07-08 02:38:42 +03:00
parent ed4402a7df
commit a8fd6e3761
9 changed files with 325 additions and 130 deletions

View file

@ -63,23 +63,27 @@ void sh2_do_irq(SH2 *sh2, int level, int vector)
// sh2->icount -= 13;
}
void sh2_irl_irq(SH2 *sh2, int level, int nested_call)
int sh2_irl_irq(SH2 *sh2, int level, int nested_call)
{
int taken;
sh2->pending_irl = level;
if (level < sh2->pending_int_irq)
level = sh2->pending_int_irq;
sh2->pending_level = level;
if (!nested_call) {
// not in memhandler, so handle this now (recompiler friendly)
// do this to avoid missing irqs that other SH2 might clear
if (level > ((sh2->sr >> 4) & 0x0f)) {
taken = (level > ((sh2->sr >> 4) & 0x0f));
if (taken) {
if (!nested_call) {
// not in memhandler, so handle this now (recompiler friendly)
// do this to avoid missing irqs that other SH2 might clear
int vector = sh2->irq_callback(sh2, level);
sh2_do_irq(sh2, level, vector);
}
else
sh2->test_irq = 1;
}
else
sh2->test_irq = 1;
return taken;
}
void sh2_internal_irq(SH2 *sh2, int level, int vector)

View file

@ -71,7 +71,7 @@ extern SH2 *sh2; // active sh2. XXX: consider removing
int sh2_init(SH2 *sh2, int is_slave);
void sh2_finish(SH2 *sh2);
void sh2_reset(SH2 *sh2);
void sh2_irl_irq(SH2 *sh2, int level, int nested_call);
int sh2_irl_irq(SH2 *sh2, int level, int nested_call);
void sh2_internal_irq(SH2 *sh2, int level, int vector);
void sh2_do_irq(SH2 *sh2, int level, int vector);
void sh2_pack(const SH2 *sh2, unsigned char *buff);