mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 07:17:45 -04:00
sh2 interpreter, minor improvement for irq handling
This commit is contained in:
parent
341b0ccbad
commit
f99f0794cf
1 changed files with 6 additions and 4 deletions
|
@ -167,14 +167,16 @@ int sh2_execute_interpreter(SH2 *sh2, int cycles)
|
|||
|
||||
sh2->icount--;
|
||||
|
||||
if (sh2->test_irq && !sh2->delay && sh2->pending_level > ((sh2->sr >> 4) & 0x0f))
|
||||
if (sh2->test_irq && !sh2->delay)
|
||||
{
|
||||
int level = sh2->pending_level;
|
||||
if (level > ((sh2->sr >> 4) & 0x0f))
|
||||
{
|
||||
int vector = sh2->irq_callback(sh2, level);
|
||||
sh2_do_irq(sh2, level, vector);
|
||||
}
|
||||
sh2->test_irq = 0;
|
||||
}
|
||||
|
||||
}
|
||||
while (sh2->icount > 0 || sh2->delay); /* can't interrupt before delay */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue