1 diff --git a/libpcsxcore/new_dynarec/linkage_arm.S b/libpcsxcore/new_dynarec/linkage_arm.S
2 index bbc52c3..83c5b08 100644
3 --- a/libpcsxcore/new_dynarec/linkage_arm.S
4 +++ b/libpcsxcore/new_dynarec/linkage_arm.S
5 @@ -437,7 +437,7 @@ FUNCTION(cc_interrupt):
6 str r1, [fp, #LO_pending_exception]
7 and r2, r2, r10, lsr #17
8 add r3, fp, #LO_restore_candidate
9 - str r10, [fp, #LO_cycle] /* PCSX cycles */
10 +@@@ str r10, [fp, #LO_cycle] /* PCSX cycles */
11 @@ str r10, [fp, #LO_reg_cop0+36] /* Count */
14 @@ -527,7 +527,7 @@ FUNCTION(new_dyna_leave):
15 ldr r0, [fp, #LO_last_count]
18 - str r10, [fp, #LO_cycle]
19 +@@@ str r10, [fp, #LO_cycle]
20 ldmfd sp!, {r4, r5, r6, r7, r8, r9, sl, fp, ip, pc}
21 .size new_dyna_leave, .-new_dyna_leave
23 @@ -644,7 +644,7 @@ FUNCTION(new_dyna_start):
24 \readop r0, [r1, r3, lsl #\tab_shift]
27 - str r2, [fp, #LO_cycle]
28 +@@@ str r2, [fp, #LO_cycle]
32 @@ -679,7 +679,7 @@ FUNCTION(jump_handler_read32):
36 - str r2, [fp, #LO_cycle]
37 +@@@ str r2, [fp, #LO_cycle]
40 ldr r0, [fp, #LO_next_interupt]
41 @@ -707,7 +707,7 @@ FUNCTION(jump_handler_write_h):
45 - str r2, [fp, #LO_cycle]
46 +@@@ str r2, [fp, #LO_cycle]
49 ldr r0, [fp, #LO_next_interupt]
50 diff --git a/libpcsxcore/new_dynarec/linkage_arm64.S b/libpcsxcore/new_dynarec/linkage_arm64.S
51 index 698bd78..798abea 100644
52 --- a/libpcsxcore/new_dynarec/linkage_arm64.S
53 +++ b/libpcsxcore/new_dynarec/linkage_arm64.S
54 @@ -119,7 +119,7 @@ FUNCTION(cc_interrupt):
55 str wzr, [rFP, #LO_pending_exception]
56 and w2, w2, rCC, lsr #17
57 add x3, rFP, #LO_restore_candidate
58 - str rCC, [rFP, #LO_cycle] /* PCSX cycles */
59 +## str rCC, [rFP, #LO_cycle] /* PCSX cycles */
60 # str rCC, [rFP, #LO_reg_cop0+36] /* Count */
61 ldr w19, [x3, w2, uxtw]
63 @@ -227,7 +227,7 @@ FUNCTION(new_dyna_start):
64 FUNCTION(new_dyna_leave):
65 ldr w0, [rFP, #LO_last_count]
67 - str rCC, [rFP, #LO_cycle]
68 +## str rCC, [rFP, #LO_cycle]
69 ldp x19, x20, [sp, #16*1]
70 ldp x21, x22, [sp, #16*2]
71 ldp x23, x24, [sp, #16*3]
72 @@ -245,7 +245,7 @@ FUNCTION(new_dyna_leave):
73 /* w0 = adddr/data, x1 = rhandler, w2 = cycles, x3 = whandler */
74 ldr w4, [rFP, #LO_last_count]
76 - str w4, [rFP, #LO_cycle]
77 +## str w4, [rFP, #LO_cycle]
80 .macro memhandler_post
81 diff --git a/libpcsxcore/new_dynarec/new_dynarec.c b/libpcsxcore/new_dynarec/new_dynarec.c
82 index 1452db3..8200e44 100644
83 --- a/libpcsxcore/new_dynarec/new_dynarec.c
84 +++ b/libpcsxcore/new_dynarec/new_dynarec.c
85 @@ -44,10 +44,10 @@ static int sceBlock;
86 #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
90 -//#define assem_debug printf
92 +#define assem_debug printf
93 //#define inv_debug printf
94 -#define assem_debug(...)
95 +//#define assem_debug(...)
96 #define inv_debug(...)
99 @@ -423,6 +423,9 @@ static int doesnt_expire_soon(void *tcaddr)
100 // This is called from the recompiled JR/JALR instructions
101 void noinline *get_addr(u_int vaddr)
104 +printf("get_addr %08x, pc=%08x\n", vaddr, psxRegs.pc);
106 u_int page=get_page(vaddr);
107 u_int vpage=get_vpage(vaddr);
108 struct ll_entry *head;
109 @@ -4393,13 +4396,15 @@ void do_cc(int i,signed char i_regmap[],int *adj,int addr,int taken,int invert)
111 emit_addimm_and_set_flags(cycles,HOST_CCREG);
119 emit_cmpimm(HOST_CCREG,-CLOCK_ADJUST(count+2));
125 add_stub(CC_STUB,jaddr,idle?idle:out,(*adj==0||invert||idle)?0:(count+2),i,addr,taken,0);
127 @@ -4807,7 +4812,8 @@ static void rjump_assemble(int i,struct regstat *i_regs)
128 // special case for RFE
134 //load_regs_bt(branch_regs[i].regmap,branch_regs[i].dirty,-1);
137 @@ -4912,7 +4918,8 @@ static void cjump_assemble(int i,struct regstat *i_regs)
139 emit_addimm_and_set_flags(CLOCK_ADJUST(ccadj[i]+2),cc);
144 add_stub(CC_STUB,jaddr,out,0,i,start+i*4+8,NOTTAKEN,0);
147 @@ -5099,7 +5106,8 @@ static void cjump_assemble(int i,struct regstat *i_regs)
148 emit_loadreg(CCREG,HOST_CCREG);
149 emit_addimm_and_set_flags(CLOCK_ADJUST(ccadj[i]+2),HOST_CCREG);
154 add_stub(CC_STUB,jaddr,out,0,i,start+i*4+8,NOTTAKEN,0);
155 emit_storereg(CCREG,HOST_CCREG);
157 @@ -5108,7 +5116,8 @@ static void cjump_assemble(int i,struct regstat *i_regs)
158 assert(cc==HOST_CCREG);
159 emit_addimm_and_set_flags(CLOCK_ADJUST(ccadj[i]+2),cc);
164 add_stub(CC_STUB,jaddr,out,0,i,start+i*4+8,likely[i]?NULLDS:NOTTAKEN,0);
167 @@ -5210,7 +5219,8 @@ static void sjump_assemble(int i,struct regstat *i_regs)
168 else if(nevertaken) {
169 emit_addimm_and_set_flags(CLOCK_ADJUST(ccadj[i]+2),cc);
174 add_stub(CC_STUB,jaddr,out,0,i,start+i*4+8,NOTTAKEN,0);
177 @@ -5366,7 +5376,8 @@ static void sjump_assemble(int i,struct regstat *i_regs)
178 emit_loadreg(CCREG,HOST_CCREG);
179 emit_addimm_and_set_flags(CLOCK_ADJUST(ccadj[i]+2),HOST_CCREG);
184 add_stub(CC_STUB,jaddr,out,0,i,start+i*4+8,NOTTAKEN,0);
185 emit_storereg(CCREG,HOST_CCREG);
187 @@ -5375,7 +5386,8 @@ static void sjump_assemble(int i,struct regstat *i_regs)
188 assert(cc==HOST_CCREG);
189 emit_addimm_and_set_flags(CLOCK_ADJUST(ccadj[i]+2),cc);
194 add_stub(CC_STUB,jaddr,out,0,i,start+i*4+8,likely[i]?NULLDS:NOTTAKEN,0);
197 @@ -5863,7 +5875,7 @@ void unneeded_registers(int istart,int iend,int r)
198 // R0 is always unneeded
202 + unneeded_reg[i]=1;//u;
203 gte_unneeded[i]=gte_u;
205 printf("ur (%d,%d) %x: ",istart,iend,start+i*4);
206 @@ -8387,6 +8399,7 @@ int new_recompile_block(int addr)
208 // This allocates registers (if possible) one instruction prior
209 // to use, which can avoid a load-use penalty on certain CPUs.
211 for(i=0;i<slen-1;i++)
213 if(!i||(itype[i-1]!=UJUMP&&itype[i-1]!=CJUMP&&itype[i-1]!=SJUMP&&itype[i-1]!=RJUMP))
214 @@ -8543,6 +8556,7 @@ int new_recompile_block(int addr)
220 /* Pass 6 - Optimize clean/dirty state */
221 clean_registers(0,slen-1,1);
222 @@ -8842,6 +8856,11 @@ int new_recompile_block(int addr)
224 pagespan_assemble(i,®s[i]);break;
228 + if(itype[i]!=UJUMP&&itype[i]!=CJUMP&&itype[i]!=SJUMP&&itype[i]!=RJUMP)
229 + wb_dirtys(regs[i].regmap,regs[i].dirty);
231 if(itype[i]==UJUMP||itype[i]==RJUMP||(source[i]>>16)==0x1000)
234 @@ -8950,7 +8969,7 @@ int new_recompile_block(int addr)
237 // External Branch Targets (jump_in)
238 - if(copy+slen*4>(void *)shadow+sizeof(shadow)) copy=shadow;
239 + if(copy+slen*4>(void *)shadow+sizeof(shadow)) {copy=shadow;printf("shadow overflow\n");}
243 @@ -9065,6 +9084,10 @@ int new_recompile_block(int addr)
245 expirep=(expirep+1)&65535;
248 +printf("new_recompile_block done\n");