X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Fnew_dynarec%2Flinkage_arm.S;h=d2d6d8740665c3f2e3088c8b72e20160062a765d;hb=25427adfbaed8ac93f01b56c4fac9811dd029b51;hp=f859817adb2b28b799df0be914784fd3c00aa79f;hpb=a5cd72d0e598f037fd9d9f23948af5b2fb06e2eb;p=pcsx_rearmed.git diff --git a/libpcsxcore/new_dynarec/linkage_arm.S b/libpcsxcore/new_dynarec/linkage_arm.S index f859817a..d2d6d874 100644 --- a/libpcsxcore/new_dynarec/linkage_arm.S +++ b/libpcsxcore/new_dynarec/linkage_arm.S @@ -239,10 +239,9 @@ FUNCTION(cc_interrupt): add r10, r0, r10 str r1, [fp, #LO_pending_exception] str r10, [fp, #LO_cycle] /* PCSX cycles */ -@@ str r10, [fp, #LO_reg_cop0+36] /* Count - not on PSX */ mov r10, lr - add r0, fp, #(LO_psxRegs + 34*4) /* CP0 */ + add r0, fp, #LO_reg_cop0 /* CP0 */ bl gen_interupt mov lr, r10 ldr r10, [fp, #LO_cycle] @@ -261,6 +260,14 @@ FUNCTION(cc_interrupt): .size cc_interrupt, .-cc_interrupt .align 2 +FUNCTION(jump_addrerror_ds): /* R3000E_AdEL / R3000E_AdES in r0 */ + str r1, [fp, #(LO_psxRegs + (34+8)*4)] /* BadVaddr */ + mov r1, #1 + b call_psxException +FUNCTION(jump_addrerror): + str r1, [fp, #(LO_psxRegs + (34+8)*4)] /* BadVaddr */ + mov r1, #0 + b call_psxException FUNCTION(jump_overflow_ds): mov r0, #(12<<2) /* R3000E_Ov */ mov r1, #1 @@ -290,17 +297,20 @@ call_psxException: str r2, [fp, #LO_pcaddr] add r10, r3, r10 str r10, [fp, #LO_cycle] /* PCSX cycles */ - add r2, fp, #(LO_psxRegs + 34*4) /* CP0 */ + add r2, fp, #LO_reg_cop0 /* CP0 */ bl psxException /* note: psxException might do recursive recompiler call from it's HLE code, * so be ready for this */ FUNCTION(jump_to_new_pc): + ldr r2, [fp, #LO_stop] ldr r1, [fp, #LO_next_interupt] ldr r10, [fp, #LO_cycle] ldr r0, [fp, #LO_pcaddr] - sub r10, r10, r1 + tst r2, r2 str r1, [fp, #LO_last_count] + sub r10, r10, r1 + bne new_dyna_leave bl ndrc_get_addr_ht mov pc, r0 .size jump_to_new_pc, .-jump_to_new_pc @@ -510,7 +520,7 @@ FUNCTION(jump_handle_swl): mov r12,r0,lsr #12 ldr r3, [r3, r12, lsl #2] lsls r3, #1 - bcs 4f + bcs jump_handle_swx_interp add r3, r0, r3 mov r0, r2 tst r3, #2 @@ -533,11 +543,6 @@ FUNCTION(jump_handle_swl): strhne r1, [r3, #-1] strbeq r12, [r3] bx lr -4: - mov r0, r2 -@ b abort - bx lr @ TODO? - FUNCTION(jump_handle_swr): /* r0 = address, r1 = data, r2 = cycles */ @@ -545,7 +550,7 @@ FUNCTION(jump_handle_swr): mov r12,r0,lsr #12 ldr r3, [r3, r12, lsl #2] lsls r3, #1 - bcs 4f + bcs jump_handle_swx_interp add r3, r0, r3 and r12,r3, #3 mov r0, r2 @@ -559,11 +564,14 @@ FUNCTION(jump_handle_swr): strb r1, [r3] strh r2, [r3, #1] bx lr -4: - mov r0, r2 -@ b abort - bx lr @ TODO? +jump_handle_swx_interp: /* almost never happens */ + ldr r3, [fp, #LO_last_count] + add r0, fp, #LO_psxRegs + add r2, r3, r2 + str r2, [fp, #LO_cycle] /* PCSX cycles */ + bl execI + b jump_to_new_pc .macro rcntx_read_mode0 num /* r0 = address, r2 = cycles */