Update lightrec 20220912 (#688)
authorPaul Cercueil <paul@crapouillou.net>
Mon, 12 Sep 2022 20:26:25 +0000 (22:26 +0200)
committerGitHub <noreply@github.com>
Mon, 12 Sep 2022 20:26:25 +0000 (22:26 +0200)
* lightrec: Remove leftover debug stuff

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
* 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 <paul@crapouillou.net>
* 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 <paul@crapouillou.net>
deps/lightrec/.gitrepo
deps/lightrec/optimizer.c
libpcsxcore/lightrec/plugin.c

index 79aaa50..a5daddd 100644 (file)
@@ -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
index 2eba60e..0190722 100644 (file)
@@ -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;
index 8f12b97..bd3ee22 100644 (file)
@@ -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),