Search
lxdream.org :: lxdream/src/sh4/sh4.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/sh4.c
changeset 1187:266e7a1bae90
prev1182:b38a327ad8fa
next1188:1cc9bb0b3848
author nkeynes
date Tue Nov 29 17:52:43 2011 +1000 (10 years ago)
permissions -rw-r--r--
last change Refactor event processing into sh4_handle_pending_events()
file annotate diff log raw
1.1 --- a/src/sh4/sh4.c Sun Nov 27 18:20:21 2011 +1000
1.2 +++ b/src/sh4/sh4.c Tue Nov 29 17:52:43 2011 +1000
1.3 @@ -403,6 +403,11 @@
1.4 sh4r.new_pc = pc+2;
1.5 }
1.6
1.7 +void sh4_set_event_pending( uint32_t cycles )
1.8 +{
1.9 + sh4r.event_pending = cycles;
1.10 +}
1.11 +
1.12 /**
1.13 * Dump all SH4 core information for crash-dump purposes
1.14 */
1.15 @@ -664,6 +669,16 @@
1.16 return addr != MMU_VMA_ERROR && mem_has_page(addr);
1.17 }
1.18
1.19 +void sh4_handle_pending_events() {
1.20 + if( sh4r.event_types & PENDING_EVENT ) {
1.21 + event_execute();
1.22 + }
1.23 + /* Eventq execute may (quite likely) deliver an immediate IRQ */
1.24 + if( sh4r.event_types & PENDING_IRQ ) {
1.25 + sh4_accept_interrupt();
1.26 + }
1.27 +}
1.28 +
1.29 /**
1.30 * Go through ext_address_space page by page
1.31 */
.