Search
lxdream.org :: lxdream/src/sh4/sh4trans.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/sh4trans.c
changeset 941:c67574ed4355
prev936:f394309c399a
next949:d7833018931f
author nkeynes
date Sat Jan 03 08:55:15 2009 +0000 (13 years ago)
branchlxdream-mem
permissions -rw-r--r--
last change Implement CORE_EXIT_EXCEPTION for use when direct frame messing about doesn't work
file annotate diff log raw
1.1 --- a/src/sh4/sh4trans.c Sat Dec 27 02:59:35 2008 +0000
1.2 +++ b/src/sh4/sh4trans.c Sat Jan 03 08:55:15 2009 +0000
1.3 @@ -158,6 +158,16 @@
1.4 sh4r.pc += (recovery->sh4_icount<<1);
1.5 }
1.6
1.7 +/**
1.8 + * Same as sh4_translate_run_recovery, but is used to recover from a taken
1.9 + * exception - that is, it fixes sh4r.spc rather than sh4r.pc
1.10 + */
1.11 +void sh4_translate_run_exception_recovery( xlat_recovery_record_t recovery )
1.12 +{
1.13 + sh4r.slice_cycle += (recovery->sh4_icount * sh4_cpu_period);
1.14 + sh4r.spc += (recovery->sh4_icount<<1);
1.15 +}
1.16 +
1.17 void sh4_translate_exit_recover( )
1.18 {
1.19 void *code = xlat_get_code_by_vma( sh4r.pc );
1.20 @@ -175,6 +185,24 @@
1.21 }
1.22 }
1.23
1.24 +void sh4_translate_exception_exit_recover( )
1.25 +{
1.26 + void *code = xlat_get_code_by_vma( sh4r.spc );
1.27 + if( code != NULL ) {
1.28 + uint32_t size = xlat_get_code_size( code );
1.29 + void *pc = xlat_get_native_pc( code, size );
1.30 + if( pc != NULL ) {
1.31 + // could be null if we're not actually running inside the translator
1.32 + xlat_recovery_record_t recover = xlat_get_pre_recovery(code, pc);
1.33 + if( recover != NULL ) {
1.34 + // Can be null if there is no recovery necessary
1.35 + sh4_translate_run_exception_recovery(recover);
1.36 + }
1.37 + }
1.38 + }
1.39 +
1.40 +}
1.41 +
1.42 void FASTCALL sh4_translate_breakpoint_hit(uint32_t pc)
1.43 {
1.44 if( sh4_starting && sh4r.slice_cycle == 0 && pc == sh4r.pc ) {
.