Skip to content

PS2 games in the browser: static recompilation to WebAssembly with a native runtime

C++

VU: clip flags are readable three instructions after CLIP

Samir Nuri62df644c238a
diff --git a/runtime/include/ps2/vu_ops.hpp b/runtime/include/ps2/vu_ops.hpp
index f67de0c..0a8634c 100644
--- a/runtime/include/ps2/vu_ops.hpp
+++ b/runtime/include/ps2/vu_ops.hpp
@@ -251,7 +251,7 @@ struct FlagPipe {
PS2_VU_INLINE std::uint32_t clip() const {
for (unsigned k = 1; k <= 8; ++k) {
const unsigned i = (ch - k) & 7u;
- if (clip_ts[i] + 4u <= t) return clip_v[i];
+ if (clip_ts[i] + 3u <= t) return clip_v[i];
}
return clip_v[(ch - 8) & 7u];
}