From 5a18ce2e9a7dac901f6cfb5d0b42c58f23c53b29 Mon Sep 17 00:00:00 2001 From: notaz Date: Sun, 30 Jan 2022 01:39:40 +0200 Subject: [PATCH] drc: add apparently missing ROREG loading sjump_assemble had different loading for taken/not taken cases for whatever reason, and I added ROREG loading according to INVCP, which was (maybe?) erroneously missing for 'not taken' case. Fixes CTR crash shortly after starting driving. --- libpcsxcore/new_dynarec/new_dynarec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libpcsxcore/new_dynarec/new_dynarec.c b/libpcsxcore/new_dynarec/new_dynarec.c index 432f9da0..f9046bda 100644 --- a/libpcsxcore/new_dynarec/new_dynarec.c +++ b/libpcsxcore/new_dynarec/new_dynarec.c @@ -5855,7 +5855,9 @@ static void sjump_assemble(int i, const struct regstat *i_regs) wb_invalidate(regs[i].regmap,branch_regs[i].regmap,regs[i].dirty,ds_unneeded); load_regs(regs[i].regmap,branch_regs[i].regmap,dops[i+1].rs1,dops[i+1].rs2); address_generation(i+1,&branch_regs[i],0); - load_regs(regs[i].regmap,branch_regs[i].regmap,CCREG,CCREG); + if (ram_offset) + load_regs(regs[i].regmap,branch_regs[i].regmap,ROREG,ROREG); + load_regs(regs[i].regmap,branch_regs[i].regmap,CCREG,INVCP); ds_assemble(i+1,&branch_regs[i]); cc=get_reg(branch_regs[i].regmap,CCREG); if (cc == -1) { -- 2.39.2