X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=cpu%2Fsh2%2Fcompiler.c;h=2f959d2b89a1dd2b5b5bdf5bd95d926a60da6d6c;hb=f4c0720c249d4d51f13f9cd69e3f149dcdf64a9e;hp=10d4c01497ba9471006887a8a504580fa5d1e12c;hpb=65514d85d5d534dfbca3d414ce6eb64ef73cb73b;p=picodrive.git diff --git a/cpu/sh2/compiler.c b/cpu/sh2/compiler.c index 10d4c01..2f959d2 100644 --- a/cpu/sh2/compiler.c +++ b/cpu/sh2/compiler.c @@ -61,7 +61,7 @@ } #include "mame/sh2dasm.h" -#include +#include static int insns_compiled, hash_collisions, host_insn_count; #define COUNT_OP \ host_insn_count++ @@ -983,6 +983,10 @@ static int emit_memhandler_read_(int size, int ram_check) } } rcache_invalidate(); + + if (reg_map_g2h[SHR_SR] != -1) + emith_ctx_read(reg_map_g2h[SHR_SR], SHR_SR * 4); + // assuming arg0 and retval reg matches return rcache_get_tmp_arg(0); } @@ -1040,6 +1044,9 @@ static void emit_memhandler_write(int size, u32 pc, int delay) { int ctxr; host_arg2reg(ctxr, 2); + if (reg_map_g2h[SHR_SR] != -1) + emith_ctx_write(reg_map_g2h[SHR_SR], SHR_SR * 4); + switch (size) { case 0: // 8 // XXX: consider inlining sh2_drc_write8 @@ -1065,6 +1072,9 @@ static void emit_memhandler_write(int size, u32 pc, int delay) emith_call(sh2_drc_write32); break; } + + if (reg_map_g2h[SHR_SR] != -1) + emith_ctx_read(reg_map_g2h[SHR_SR], SHR_SR * 4); rcache_invalidate(); } @@ -2981,7 +2991,6 @@ void sh2_drc_wcheck_da(unsigned int a, int val, int cpuid) int sh2_execute(SH2 *sh2c, int cycles) { int ret_cycles; - sh2 = sh2c; // XXX sh2c->cycles_timeslice = cycles;