about summary refs log tree commit diff stats
path: root/src/main.c
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2021-11-11 20:47:10 +0100
committerptitSeb <sebastien.chev@gmail.com>2021-11-11 20:47:10 +0100
commit6a1b9e050a488cb5b2e1217fd3a01e484c3d7bb7 (patch)
treeee38007ce576f32a13b6c8f9ec298002300d74ba /src/main.c
parent6675b43dd0d7eb567227bea204ee663b1e7aab4a (diff)
downloadbox64-6a1b9e050a488cb5b2e1217fd3a01e484c3d7bb7.tar.gz
box64-6a1b9e050a488cb5b2e1217fd3a01e484c3d7bb7.zip
[DYNAREC] Changed Dynarec a bit to try stabilise program using many threads and a JIT (help RimWorld Linux, but not enough to be 100% stable)
Diffstat (limited to 'src/main.c')
-rwxr-xr-xsrc/main.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 7cb84b43..682f4fe6 100755
--- a/src/main.c
+++ b/src/main.c
@@ -42,6 +42,7 @@ int box64_pagesize;
 int box64_dynarec = 1;
 int box64_dynarec_dump = 0;
 int box64_dynarec_forced = 0;
+int box64_dynarec_bigblock = 1;
 uintptr_t box64_nodynarec_start = 0;
 uintptr_t box64_nodynarec_end = 0;
 #ifdef ARM64
@@ -262,6 +263,15 @@ void LoadLogEnv()
         if(box64_dynarec_forced)
         printf_log(LOG_INFO, "Dynarec is Forced on all addresses\n");
     }
+    p = getenv("BOX64_DYNAREC_BIGBLOCK");
+    if(p) {
+        if(strlen(p)==1) {
+            if(p[0]>='0' && p[0]<='1')
+                box64_dynarec_bigblock = p[0]-'0';
+        }
+        if(!box64_dynarec_bigblock)
+        printf_log(LOG_INFO, "Dynarec will not try to make big block\n");
+    }
     p = getenv("BOX64_NODYNAREC");
     if(p) {
         if (strchr(p,'-')) {
@@ -938,6 +948,13 @@ int main(int argc, const char **argv, const char **env) {
         printf_log(LOG_INFO, "Zoom detected, trying to use system libturbojpeg if possible\n");
         box64_zoom = 1;
     }
+    // special case for RimWorldLinux
+    #ifdef DYNAREC
+    if(strstr(prgname, "RimWorldLinux")==prgname) {
+        printf_log(LOG_INFO, "RimWorld detected, disabling bigblock on the Dynarec\n");
+        box64_dynarec_bigblock = 0;
+    }
+    #endif
     /*if(strstr(prgname, "awesomium_process")==prgname) {
         printf_log(LOG_INFO, "awesomium_process detected, forcing emulated libpng12\n");
         AddPath("libpng12.so.0", &my_context->box64_emulated_libs, 0);