X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=cpu%2Fsh2%2Fcompiler.c;h=0b59920b87308e05c90c5c78828b66d55d6f14fa;hb=a76fad41291b7be0b42554353d6775dcdff065e0;hp=106fab50b2ae681ec640371a6a1414fdaf89675d;hpb=001f73a0d62cfaba80738c48b5deea27ab85dfc7;p=picodrive.git diff --git a/cpu/sh2/compiler.c b/cpu/sh2/compiler.c index 106fab5..0b59920 100644 --- a/cpu/sh2/compiler.c +++ b/cpu/sh2/compiler.c @@ -3126,6 +3126,7 @@ int sh2_execute(SH2 *sh2c, int cycles) if (ret_cycles > 0) dbg(1, "warning: drc returned with cycles: %d", ret_cycles); + sh2c->sr &= 0x3f3; return sh2c->cycles_timeslice - ret_cycles; } @@ -3307,7 +3308,8 @@ static void *dr_get_pc_base(u32 pc, int is_slave) } else if ((pc & 0xc6000000) == 0x02000000) { // ROM - ret = Pico.rom; + if ((pc & 0x3fffff) < Pico.romsize) + ret = Pico.rom; mask = 0x3fffff; }