PS2 games in the browser: static recompilation to WebAssembly with a native runtime
C++
PS2_VU_INTERPRET forces the interpreter again, and PS2_VU_JIT=0 keeps the compiled programs
Samir Nurie3727791b6e3
diff --git a/runtime/src/vu_micro.cpp b/runtime/src/vu_micro.cppindex 73bebf0..fd27727 100644--- a/runtime/src/vu_micro.cpp+++ b/runtime/src/vu_micro.cpp@@ -861,10 +861,7 @@ void interpret(int unit, std::uint32_t pc) {void run_entry(int unit, std::uint32_t pc) {// Compiled programs are the default; retain an interpreter override for// differential checks and diagnosing newly recorded programs.- static const bool interpret_only = [] {- const char *env = std::getenv("PS2_VU_JIT");- return env && std::strcmp(env, "0") == 0;- }();+ static const bool interpret_only = std::getenv("PS2_VU_INTERPRET") != nullptr;static const bool count = std::getenv("PS2_VU_COUNT") != nullptr;static std::uint64_t compiled = 0, interpreted = 0;static std::unordered_map<std::uint32_t, std::uint64_t> misses;