X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2F32x%2F32x.c;h=323b0b65a669aa01b8ebd097bdc3cfe7a8b55e4b;hb=e05b81fc5b3f640496795ced5d893ece4cc51c2d;hp=ba89d9825b22f1d57b401fc542bad41144915deb;hpb=efd100fc0a1426202abd2dd2cb1e3ed18bf4440d;p=picodrive.git diff --git a/pico/32x/32x.c b/pico/32x/32x.c index ba89d98..323b0b6 100644 --- a/pico/32x/32x.c +++ b/pico/32x/32x.c @@ -4,10 +4,19 @@ struct Pico32x Pico32x; SH2 sh2s[2]; -static void sh2_irq_cb(int id, int level) +static int REGPARM(2) sh2_irq_cb(SH2 *sh2, int level) { - // diagnostic for now - elprintf(EL_32X, "%csh2 ack %d @ %08x", id ? 's' : 'm', level, sh2_pc(id)); + if (sh2->pending_irl > sh2->pending_int_irq) { + elprintf(EL_32X, "%csh2 ack/irl %d @ %08x", + sh2->is_slave ? 's' : 'm', level, sh2->pc); + return 64 + sh2->pending_irl / 2; + } else { + elprintf(EL_32X, "%csh2 ack/int %d/%d @ %08x", + sh2->is_slave ? 's' : 'm', level, sh2->pending_int_vector, sh2->pc); + sh2->pending_int_irq = 0; // auto-clear + sh2->pending_level = sh2->pending_irl; + return sh2->pending_int_vector; + } } void p32x_update_irls(void)