Search
lxdream.org :: lxdream/src/sh4/sh4trans.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/sh4trans.c
changeset 368:36fac4c42322
prev359:c588dce7ebde
next390:d066209999f1
author nkeynes
date Wed Sep 12 11:31:16 2007 +0000 (16 years ago)
permissions -rw-r--r--
last change Fix load_spreg/store_spreg
Fix PREF
Add jump target debug checking
file annotate diff log raw
1.1 --- a/src/sh4/sh4trans.c Thu Aug 23 12:33:27 2007 +0000
1.2 +++ b/src/sh4/sh4trans.c Wed Sep 12 11:31:16 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: sh4trans.c,v 1.1 2007-08-23 12:33:27 nkeynes Exp $
1.6 + * $Id: sh4trans.c,v 1.2 2007-09-04 08:40:23 nkeynes Exp $
1.7 *
1.8 * SH4 translation core module. This part handles the non-target-specific
1.9 * section of the translation.
1.10 @@ -27,7 +27,7 @@
1.11 */
1.12 uint32_t sh4_xlat_run_slice( uint32_t nanosecs )
1.13 {
1.14 - int i, result = 1;
1.15 + int i;
1.16 sh4r.slice_cycle = 0;
1.17
1.18 if( sh4r.sh4_state != SH4_STATE_RUNNING ) {
1.19 @@ -37,7 +37,7 @@
1.20 }
1.21 }
1.22
1.23 - for( ; sh4r.slice_cycle < nanosecs && result != 0; sh4r.slice_cycle ) {
1.24 + while( sh4r.slice_cycle < nanosecs ) {
1.25 if( SH4_EVENT_PENDING() ) {
1.26 if( sh4r.event_types & PENDING_EVENT ) {
1.27 event_execute();
1.28 @@ -48,12 +48,12 @@
1.29 }
1.30 }
1.31
1.32 - int (*code)() = xlat_get_code(sh4r.pc);
1.33 + gboolean (*code)() = xlat_get_code(sh4r.pc);
1.34 if( code == NULL ) {
1.35 code = sh4_translate_basic_block( sh4r.pc );
1.36 }
1.37 - result = code();
1.38 - sh4r.slice_cycle += result;
1.39 + if( !code() )
1.40 + break;
1.41 }
1.42
1.43 /* If we aborted early, but the cpu is still technically running,
1.44 @@ -97,8 +97,8 @@
1.45 }
1.46 pc += 2;
1.47 }
1.48 - sh4_translate_end_block(done);
1.49 - xlat_commit_block( xlat_output - block->size, pc-start );
1.50 + sh4_translate_end_block(pc);
1.51 + xlat_commit_block( xlat_output - block->code, pc-start );
1.52 return block->code;
1.53 }
1.54
.