From: Paul Cercueil Date: Mon, 12 Sep 2022 20:26:25 +0000 (+0200) Subject: Update lightrec 20220912 (#688) X-Git-Tag: r24l~388 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cdfa353653a8dec134873b2e4b38a7ebf98fc0ef;p=pcsx_rearmed.git Update lightrec 20220912 (#688) * lightrec: Remove leftover debug stuff Signed-off-by: Paul Cercueil * lightrec: Fix lightrec_can_hw_direct() table It was slightly wrong, which caused crashes in the intro FMV of Sled Storm (and maybe other games). Signed-off-by: Paul Cercueil * git subrepo pull --force deps/lightrec subrepo: subdir: "deps/lightrec" merged: "962ba05793" upstream: origin: "https://github.com/pcercuei/lightrec.git" branch: "master" commit: "962ba05793" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" Signed-off-by: Paul Cercueil --- diff --git a/deps/lightrec/.gitrepo b/deps/lightrec/.gitrepo index 79aaa500..a5daddd7 100644 --- a/deps/lightrec/.gitrepo +++ b/deps/lightrec/.gitrepo @@ -6,7 +6,7 @@ [subrepo] remote = https://github.com/pcercuei/lightrec.git branch = master - commit = 071973e3ac26619cd3afbe339f020a2d4d61c28a - parent = cc8a5c0c654c18b3ad074e49f526cb6cae77f8b0 + commit = 962ba057937b7fcb809f16682b4e24d27f08cdb1 + parent = 5b2da975316f1d88d02a14f8f2c876b2213ff1f3 method = merge cmdver = 0.4.3 diff --git a/deps/lightrec/optimizer.c b/deps/lightrec/optimizer.c index 2eba60ed..01907225 100644 --- a/deps/lightrec/optimizer.c +++ b/deps/lightrec/optimizer.c @@ -635,6 +635,10 @@ static u32 lightrec_propagate_consts(const struct opcode *op, if (OPT_FLAG_MULT_DIV && c.r.imm) known &= ~BIT(c.r.imm); break; + case OP_SPECIAL_MFLO: + case OP_SPECIAL_MFHI: + known &= ~BIT(c.r.rd); + break; default: break; } @@ -1645,6 +1649,9 @@ static int lightrec_flag_io(struct lightrec_state *state, struct block *block) pr_debug("Flagging opcode %u as direct I/O access\n", i); list->flags |= LIGHTREC_IO_MODE(LIGHTREC_IO_DIRECT_HW); + + if (no_mask) + list->flags |= LIGHTREC_NO_MASK; break; } fallthrough; diff --git a/libpcsxcore/lightrec/plugin.c b/libpcsxcore/lightrec/plugin.c index 8f12b979..bd3ee222 100644 --- a/libpcsxcore/lightrec/plugin.c +++ b/libpcsxcore/lightrec/plugin.c @@ -54,7 +54,6 @@ static char *name = "retroarch.exe"; static bool use_lightrec_interpreter; static bool use_pcsx_interpreter; static bool booting; -static u32 lightrec_begin_cycles; enum my_cp2_opcodes { OP_CP2_RTPS = 0x01, @@ -345,7 +344,7 @@ static bool lightrec_can_hw_direct(u32 kaddr, bool is_write, u8 size) case 0x1f801074: return !is_write; default: - return is_write || kaddr < 0x1f801c00 || kaddr >= 0x1f801e00; + return kaddr < 0x1f801c00 || kaddr >= 0x1f801e00; } default: switch (kaddr) { @@ -403,9 +402,6 @@ static int lightrec_plugin_init(void) } use_lightrec_interpreter = !!getenv("LIGHTREC_INTERPRETER"); - if (getenv("LIGHTREC_BEGIN_CYCLES")) - lightrec_begin_cycles = (unsigned int) strtol( - getenv("LIGHTREC_BEGIN_CYCLES"), NULL, 0); lightrec_state = lightrec_init(name, lightrec_map, ARRAY_SIZE(lightrec_map),