diff --git a/libpcsxcore/new_dynarec/new_dynarec.c b/libpcsxcore/new_dynarec/new_dynarec.c
-index f1005db..ebd1d4f 100644
+index b160a4a..0d91999 100644
--- a/libpcsxcore/new_dynarec/new_dynarec.c
+++ b/libpcsxcore/new_dynarec/new_dynarec.c
-@@ -235,7 +235,7 @@ static struct decoded_insn
+@@ -285,7 +285,7 @@ static struct decoded_insn
int new_dynarec_hacks_old;
int new_dynarec_did_compile;
extern int cycle_count; // ... until end of the timeslice, counts -N -> 0
extern int last_count; // last absolute target, often = next_interupt
-@@ -471,6 +471,7 @@ int cycle_multiplier_old;
+@@ -532,6 +532,7 @@ static int cycle_multiplier_active;
static int CLOCK_ADJUST(int x)
{
+ return x * 2;
- int m = cycle_multiplier_override && cycle_multiplier == CYCLE_MULT_DEFAULT
- ? cycle_multiplier_override : cycle_multiplier;
- int s=(x>>31)|1;
-@@ -522,6 +523,9 @@ static int doesnt_expire_soon(void *tcaddr)
+ int m = cycle_multiplier_active;
+ int s = (x >> 31) | 1;
+ return (x * m + s * 50) / 100;
+@@ -662,6 +663,9 @@ static void *try_restore_block(u_int vaddr, u_int start_page, u_int end_page)
// This is called from the recompiled JR/JALR instructions
- void noinline *get_addr(u_int vaddr)
+ static void noinline *get_addr(u_int vaddr, int can_compile)
{
+#ifdef DRC_DBG
+printf("get_addr %08x, pc=%08x\n", vaddr, psxRegs.pc);
+#endif
- u_int page=get_page(vaddr);
- u_int vpage=get_vpage(vaddr);
- struct ll_entry *head;
-@@ -6248,7 +6252,7 @@ void unneeded_registers(int istart,int iend,int r)
+ u_int start_page = get_page_prev(vaddr);
+ u_int i, page, end_page = get_page(vaddr);
+ void *found_clean = NULL;
+@@ -7046,7 +7050,7 @@ static noinline void pass2_unneeded_regs(int istart,int iend,int r)
// R0 is always unneeded
u|=1;
// Save it
gte_unneeded[i]=gte_u;
/*
printf("ur (%d,%d) %x: ",istart,iend,start+i*4);
-@@ -8794,6 +8798,7 @@ int new_recompile_block(u_int addr)
-
- // This allocates registers (if possible) one instruction prior
- // to use, which can avoid a load-use penalty on certain CPUs.
-+#if 0
+@@ -8236,6 +8240,7 @@ static noinline void pass5a_preallocate1(void)
+ static noinline void pass5b_preallocate2(void)
+ {
+ int i, hr;
++ return;
for(i=0;i<slen-1;i++)
{
if (!i || !dops[i-1].is_jump)
-@@ -8950,6 +8955,7 @@ int new_recompile_block(u_int addr)
- }
- }
- }
-+#endif
-
- /* Pass 6 - Optimize clean/dirty state */
- clean_registers(0,slen-1,1);
-@@ -9204,6 +9210,11 @@ int new_recompile_block(u_int addr)
- load_regs(regs[i].regmap_entry,regs[i].regmap,INVCP,INVCP);
+@@ -9045,6 +9050,11 @@ static int new_recompile_block(u_int addr)
+ load_reg(regs[i].regmap_entry,regs[i].regmap,INVCP);
ds = assemble(i, ®s[i], ccadj[i]);
+#ifdef DRC_DBG
if (dops[i].is_ujump)
literal_pool(1024);
-@@ -9439,6 +9450,10 @@ int new_recompile_block(u_int addr)
- }
+@@ -9236,6 +9246,10 @@ static int new_recompile_block(u_int addr)
+
#ifdef ASSEM_PRINT
fflush(stdout);
+#endif
+printf("new_recompile_block done\n");
+fflush(stdout);
#endif
+ stat_inc(stat_bc_direct);
return 0;
- }
diff --git a/libpcsxcore/new_dynarec/pcsxmem.c b/libpcsxcore/new_dynarec/pcsxmem.c
index bb471b6..8f68a3b 100644
--- a/libpcsxcore/new_dynarec/pcsxmem.c
case 0x800: case 0x804:
unmap_ram_write();
diff --git a/libpcsxcore/psxcounters.c b/libpcsxcore/psxcounters.c
-index b2cc07b..f916580 100644
+index ff0efbc..4459644 100644
--- a/libpcsxcore/psxcounters.c
+++ b/libpcsxcore/psxcounters.c
-@@ -378,9 +378,12 @@ void psxRcntUpdate()
+@@ -379,9 +379,12 @@ void psxRcntUpdate()
/******************************************************************************/
_psxRcntWcount( index, value );
psxRcntSet();
-@@ -389,6 +392,7 @@ void psxRcntWcount( u32 index, u32 value )
+@@ -390,6 +393,7 @@ void psxRcntWcount( u32 index, u32 value )
void psxRcntWmode( u32 index, u32 value )
{
verboseLog( 1, "[RCNT %i] wmode: %x\n", index, value );
_psxRcntWmode( index, value );
_psxRcntWcount( index, 0 );
-@@ -400,6 +404,7 @@ void psxRcntWmode( u32 index, u32 value )
+@@ -401,6 +405,7 @@ void psxRcntWmode( u32 index, u32 value )
void psxRcntWtarget( u32 index, u32 value )
{
verboseLog( 1, "[RCNT %i] wtarget: %x\n", index, value );
rcnts[index].target = value;
-@@ -412,6 +417,7 @@ void psxRcntWtarget( u32 index, u32 value )
+@@ -413,6 +418,7 @@ void psxRcntWtarget( u32 index, u32 value )
u32 psxRcntRcount( u32 index )
{
u32 count;
count = _psxRcntRcount( index );
+
diff --git a/libpcsxcore/new_dynarec/emu_if.c b/libpcsxcore/new_dynarec/emu_if.c
-index 90c4660..441eaca 100644
+index 10d99ba..1e097ae 100644
--- a/libpcsxcore/new_dynarec/emu_if.c
+++ b/libpcsxcore/new_dynarec/emu_if.c
-@@ -424,13 +424,17 @@ static void ari64_shutdown()
+@@ -405,13 +407,17 @@ static void ari64_shutdown()
{
new_dynarec_cleanup();
new_dyna_pcsx_mem_shutdown();
ari64_clear,
ari64_notify,
ari64_apply_config,
-@@ -501,7 +505,7 @@ static u32 memcheck_read(u32 a)
+@@ -481,7 +487,7 @@ static u32 memcheck_read(u32 a)
return *(u32 *)(psxM + (a & 0x1ffffc));
}
case 0x800: case 0x804:
unmap_ram_write();
diff --git a/libpcsxcore/psxcounters.c b/libpcsxcore/psxcounters.c
-index b2cc07b..f916580 100644
+index ff0efbc..4459644 100644
--- a/libpcsxcore/psxcounters.c
+++ b/libpcsxcore/psxcounters.c
-@@ -378,9 +378,12 @@ void psxRcntUpdate()
+@@ -379,9 +379,12 @@ void psxRcntUpdate()
/******************************************************************************/
_psxRcntWcount( index, value );
psxRcntSet();
-@@ -389,6 +392,7 @@ void psxRcntWcount( u32 index, u32 value )
+@@ -390,6 +393,7 @@ void psxRcntWcount( u32 index, u32 value )
void psxRcntWmode( u32 index, u32 value )
{
verboseLog( 1, "[RCNT %i] wmode: %x\n", index, value );
_psxRcntWmode( index, value );
_psxRcntWcount( index, 0 );
-@@ -400,6 +404,7 @@ void psxRcntWmode( u32 index, u32 value )
+@@ -401,6 +405,7 @@ void psxRcntWmode( u32 index, u32 value )
void psxRcntWtarget( u32 index, u32 value )
{
verboseLog( 1, "[RCNT %i] wtarget: %x\n", index, value );
rcnts[index].target = value;
-@@ -412,6 +417,7 @@ void psxRcntWtarget( u32 index, u32 value )
+@@ -413,6 +418,7 @@ void psxRcntWtarget( u32 index, u32 value )
u32 psxRcntRcount( u32 index )
{
u32 count;
#ifdef PSXHW_LOG
PSXHW_LOG("*Unknown 32bit write at address %x value %x\n", add, value);
diff --git a/libpcsxcore/psxinterpreter.c b/libpcsxcore/psxinterpreter.c
-index f7898e9..1f125ed 100644
+index e7e3269..8f4004d 100644
--- a/libpcsxcore/psxinterpreter.c
+++ b/libpcsxcore/psxinterpreter.c
-@@ -466,6 +466,8 @@ static void doBranch(u32 tar) {
+@@ -467,6 +467,8 @@ static void doBranch(u32 tar) {
psxRegs.pc += 4;
psxRegs.cycle += BIAS;
// check for load delay
tmp = psxRegs.code >> 26;
switch (tmp) {
-@@ -499,13 +501,15 @@ static void doBranch(u32 tar) {
+@@ -500,13 +502,15 @@ static void doBranch(u32 tar) {
}
break;
}
}
/*********************************************************
-@@ -615,12 +619,13 @@ void psxMULTU_stall() {
+@@ -616,12 +620,13 @@ void psxMULTU_stall() {
psxMULTU();
}
void psxBGEZ() { RepZBranchi32(>=) } // Branch if Rs >= 0
void psxBGEZAL() { RepZBranchLinki32(>=) } // Branch if Rs >= 0 and link
-@@ -702,7 +707,7 @@ void psxRFE() {
+@@ -703,7 +708,7 @@ void psxRFE() {
* Register branch logic *
* Format: OP rs, rt, offset *
*********************************************************/
void psxBEQ() { RepBranchi32(==) } // Branch if Rs == Rt
void psxBNE() { RepBranchi32(!=) } // Branch if Rs != Rt
-@@ -886,6 +891,7 @@ void MTC0(int reg, u32 val) {
- case 12: // Status
- psxRegs.CP0.r[12] = val;
- psxTestSWInts();
-+ //psxBranchTest();
- break;
+@@ -901,7 +907,7 @@ void MTC0(int reg, u32 val) {
+ }
+ }
- case 13: // Cause
-@@ -1027,6 +1033,23 @@ void intExecuteBlock() {
+-void psxMTC0() { MTC0(_Rd_, _u32(_rRt_)); }
++void psxMTC0() { MTC0(_Rd_, _u32(_rRt_)); psxBranchTest(); }
+ void psxCTC0() { MTC0(_Rd_, _u32(_rRt_)); }
+
+ /*********************************************************
+@@ -1028,6 +1034,23 @@ void intExecuteBlock() {
while (!branch2) execI();
}
static void intClear(u32 Addr, u32 Size) {
}
-@@ -1049,7 +1072,7 @@ void intApplyConfig() {
+@@ -1050,7 +1073,7 @@ void intApplyConfig() {
assert(psxSPC[26] == psxDIV || psxSPC[26] == psxDIV_stall);
assert(psxSPC[27] == psxDIVU || psxSPC[27] == psxDIVU_stall);
psxBSC[18] = psxCOP2;
psxBSC[50] = gteLWC2;
psxBSC[58] = gteSWC2;
-@@ -1091,9 +1114,10 @@ void execI() {
+@@ -1092,9 +1115,10 @@ void execI() {
if (Config.Debug) ProcessDebug();
psxRegs.pc += 4;
R3000Acpu psxInt = {
diff --git a/libpcsxcore/psxmem.c b/libpcsxcore/psxmem.c
-index 04aeec2..710a379 100644
+index 46cee0c..c814587 100644
--- a/libpcsxcore/psxmem.c
+++ b/libpcsxcore/psxmem.c
-@@ -217,11 +217,13 @@ void psxMemShutdown() {
+@@ -218,11 +218,13 @@ void psxMemShutdown() {
}
static int writeok = 1;
t = mem >> 16;
if (t == 0x1f80 || t == 0x9f80 || t == 0xbf80) {
if ((mem & 0xffff) < 0x400)
-@@ -247,6 +249,7 @@ u16 psxMemRead16(u32 mem) {
+@@ -248,6 +250,7 @@ u16 psxMemRead16(u32 mem) {
char *p;
u32 t;
t = mem >> 16;
if (t == 0x1f80 || t == 0x9f80 || t == 0xbf80) {
if ((mem & 0xffff) < 0x400)
-@@ -272,6 +275,7 @@ u32 psxMemRead32(u32 mem) {
+@@ -273,6 +276,7 @@ u32 psxMemRead32(u32 mem) {
char *p;
u32 t;
t = mem >> 16;
if (t == 0x1f80 || t == 0x9f80 || t == 0xbf80) {
if ((mem & 0xffff) < 0x400)
-@@ -297,6 +301,7 @@ void psxMemWrite8(u32 mem, u8 value) {
+@@ -298,6 +302,7 @@ void psxMemWrite8(u32 mem, u8 value) {
char *p;
u32 t;
t = mem >> 16;
if (t == 0x1f80 || t == 0x9f80 || t == 0xbf80) {
if ((mem & 0xffff) < 0x400)
-@@ -324,6 +329,7 @@ void psxMemWrite16(u32 mem, u16 value) {
+@@ -325,6 +330,7 @@ void psxMemWrite16(u32 mem, u16 value) {
char *p;
u32 t;
t = mem >> 16;
if (t == 0x1f80 || t == 0x9f80 || t == 0xbf80) {
if ((mem & 0xffff) < 0x400)
-@@ -351,6 +357,7 @@ void psxMemWrite32(u32 mem, u32 value) {
+@@ -352,6 +358,7 @@ void psxMemWrite32(u32 mem, u32 value) {
char *p;
u32 t;
// if ((mem&0x1fffff) == 0x71E18 || value == 0x48088800) SysPrintf("t2fix!!\n");
t = mem >> 16;
if (t == 0x1f80 || t == 0x9f80 || t == 0xbf80) {
-@@ -380,6 +387,8 @@ void psxMemWrite32(u32 mem, u32 value) {
+@@ -381,6 +388,8 @@ void psxMemWrite32(u32 mem, u32 value) {
} else {
int i;