mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-06 07:38:05 -04:00
32x: improve irq handling + few bugfixes
git-svn-id: file:///home/notaz/opt/svn/PicoDrive@866 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
04092e329b
commit
1f1ff763e6
10 changed files with 43 additions and 38 deletions
|
@ -54,15 +54,23 @@ void sh2_do_irq(SH2 *sh2, int level, int vector)
|
|||
// sh2->icount -= 13;
|
||||
}
|
||||
|
||||
void sh2_irl_irq(SH2 *sh2, int level)
|
||||
void sh2_irl_irq(SH2 *sh2, int level, int nested_call)
|
||||
{
|
||||
sh2->pending_irl = level;
|
||||
if (level > sh2->pending_int_irq)
|
||||
sh2->pending_level = level;
|
||||
else
|
||||
sh2->pending_level = sh2->pending_int_irq;
|
||||
if (level < sh2->pending_int_irq)
|
||||
level = sh2->pending_int_irq;
|
||||
sh2->pending_level = level;
|
||||
|
||||
sh2->test_irq = 1;
|
||||
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)) {
|
||||
int vector = sh2->irq_callback(sh2, level);
|
||||
sh2_do_irq(sh2, level, vector);
|
||||
}
|
||||
}
|
||||
else
|
||||
sh2->test_irq = 1;
|
||||
}
|
||||
|
||||
void sh2_internal_irq(SH2 *sh2, int level, int vector)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue