--- a/src/sh4/sh4.c Sun Nov 27 18:20:21 2011 +1000 +++ b/src/sh4/sh4.c Tue Nov 29 17:52:43 2011 +1000 @@ -403,6 +403,11 @@ sh4r.new_pc = pc+2; } +void sh4_set_event_pending( uint32_t cycles ) +{ + sh4r.event_pending = cycles; +} + /** * Dump all SH4 core information for crash-dump purposes */ @@ -664,6 +669,16 @@ return addr != MMU_VMA_ERROR && mem_has_page(addr); } +void sh4_handle_pending_events() { + if( sh4r.event_types & PENDING_EVENT ) { + event_execute(); + } + /* Eventq execute may (quite likely) deliver an immediate IRQ */ + if( sh4r.event_types & PENDING_IRQ ) { + sh4_accept_interrupt(); + } +} + /** * Go through ext_address_space page by page */