X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Fnew_dynarec%2Flinkage_arm64.S;h=39e95a834fd4eebe068dc71b49e98cc05e9ef5e9;hb=0787af868fcaf537eb53483c50973983894de7c3;hp=6f32fa3b6c4c74e214f2cc15aaf7bf9841a3fb7b;hpb=39b71d9abccb93457f17df887e50507a91390a78;p=pcsx_rearmed.git diff --git a/libpcsxcore/new_dynarec/linkage_arm64.S b/libpcsxcore/new_dynarec/linkage_arm64.S index 6f32fa3b..39e95a83 100644 --- a/libpcsxcore/new_dynarec/linkage_arm64.S +++ b/libpcsxcore/new_dynarec/linkage_arm64.S @@ -52,7 +52,7 @@ DRC_VAR(pending_exception, 4) DRC_VAR(stop, 4) DRC_VAR(branch_target, 4) DRC_VAR(address, 4) -#DRC_VAR(align0, 16) /* unused/alignment */ +DRC_VAR(hack_addr, 4) DRC_VAR(psxRegs, LO_psxRegs_end - LO_psxRegs) /* psxRegs */ @@ -77,7 +77,7 @@ DRC_VAR(psxH_ptr, 8) DRC_VAR(invc_ptr, 8) DRC_VAR(zeromem_ptr, 8) DRC_VAR(scratch_buf_ptr, 8) -#DRC_VAR(align1, 16) /* unused/alignment */ +DRC_VAR(ram_offset, 8) DRC_VAR(mini_ht, 256) DRC_VAR(restore_candidate, 512) @@ -182,19 +182,28 @@ FUNCTION(fp_exception_ds): .size fp_exception_ds, .-fp_exception_ds .align 2 +FUNCTION(jump_break_ds): + mov w0, #0x24 + mov w1, #1 + b call_psxException +FUNCTION(jump_break): + mov w0, #0x24 + mov w1, #0 + b call_psxException +FUNCTION(jump_syscall_ds): + mov w0, #0x20 + mov w1, #1 + b call_psxException FUNCTION(jump_syscall): - ldr w1, [rFP, #LO_reg_cop0+48] /* Status */ - mov w3, #0x80000000 - str w0, [rFP, #LO_reg_cop0+56] /* EPC */ - orr w1, w1, #2 - mov w2, #0x20 - str w1, [rFP, #LO_reg_cop0+48] /* Status */ - str w2, [rFP, #LO_reg_cop0+52] /* Cause */ - add w0, w3, #0x80 - bl get_addr_ht - br x0 - .size jump_syscall, .-jump_syscall - .align 2 + mov w0, #0x20 + mov w1, #0 + +call_psxException: + ldr w3, [rFP, #LO_last_count] + str w2, [rFP, #LO_pcaddr] + add rCC, w3, rCC + str rCC, [rFP, #LO_cycle] /* PCSX cycles */ + bl psxException /* note: psxException might do recursive recompiler call from it's HLE code, * so be ready for this */ @@ -253,10 +262,10 @@ FUNCTION(new_dyna_leave): .endm .macro memhandler_post - ldr w2, [rFP, #LO_next_interupt] - ldr w1, [rFP, #LO_cycle] - sub w0, w1, w2 - str w2, [rFP, #LO_last_count] + ldr w0, [rFP, #LO_next_interupt] + ldr w2, [rFP, #LO_cycle] // memhandlers can modify cc, like dma + str w0, [rFP, #LO_last_count] + sub w0, w2, w0 .endm FUNCTION(do_memhandler_pre): @@ -336,7 +345,7 @@ handler_write_end: FUNCTION(jump_handle_swl): /* w0 = address, w1 = data, w2 = cycles */ ldr x3, [rFP, #LO_mem_wtab] - mov w4, w0, lsr #12 + orr w4, wzr, w0, lsr #12 ldr x3, [x3, w4, uxtw #3] adds x3, x3, x3 bcs 4f @@ -371,7 +380,7 @@ FUNCTION(jump_handle_swl): FUNCTION(jump_handle_swr): /* w0 = address, w1 = data, w2 = cycles */ ldr x3, [rFP, #LO_mem_wtab] - mov w4, w0, lsr #12 + orr w4, wzr, w0, lsr #12 ldr x3, [x3, w4, uxtw #3] adds x3, x3, x3 bcs 4f